Using the REPL
Quite a few languages provide a REPL—read-eval-print loop—a tool that’s a convenient way to key in snippets of code and interactively see the code come to life immediately. In addition to executing code snippets, REPLs often provide details that are not easily accessible at runtime. That makes REPL a special tool for experimentation and also to learn how the language infers types for variables and functions.
The command-line shell named scala is the REPL for Scala and it’s the quickest way to try out the language. Using this tool we can start playing with small code snippets. This is not simply a learning tool; it comes in handy during development of large applications as well. You can quickly try out some code ideas—micro prototyping—in ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access