What are the limitations and walkarounds of Scala interpreter?
What kind of constructs need 'scalac' compile and how to make an equivalent that will work in interpreter? Edit: I want to use scala instead of python as a scripting language. (with #!/usr/bin/scala) You ought to be able to do anything in the REPL that you can do in outside code. Keep in mind that: Things that refer to each other circularly need to be inside one block. So the following can't be entered as-is; you have to wrap it inside some other object: class C(i : Int) { def succ = C(i+1) } object C { def apply(i: Int) = new C(i) } The execution environment is somewhat different, so