问题
If I open the Scala REPL, I noticed I can create classes.
My questions are:
- What does the REPL do when there is a class definition?
- Does it compile the class?
回答1:
The REPL is not an interpreter in the usual sense, as it never executes code directly. Code that you enter in the REPL is always compiled and so are class definitions.
来源:https://stackoverflow.com/questions/12712254/how-does-the-scala-repl-work-when-defining-a-class