A read-eval-print loop (REPL) is an interactive prompt that repeatedly reads an expression, evaluates it, prints its name, type, and value, then prompts for another expression. section 1.3
In Scala, start the interpreter with no arguments, enter expressions at the scala> prompt, paste code directly, or load a source file before trying its definitions. Exit with :quit, Ctrl-D, or Ctrl-C. section 2.1.1
Load and test a definition
Load MyProgram.scala with :load, call MyProgram.abs(-42), and inspect the returned binding: val res0: Int = 42. This short feedback cycle makes the REPL useful for trying code while programming. section 2.1.1
> scala Welcome to Scala. Type in expressions for evaluation. Or try :help. scala> :load MyProgram.scala #1 // defined object MyProgram scala> MyProgram.abs(-42) #2 val res0: Int = 42 #3
Shows the complete Scala REPL sequence: start the interpreter, load a file, invoke a definition, and inspect the typed result. section 2.1.1





