Is there a quick command? I don't want to Ctrl+d
and run Scala everytime I want to clear all variables. reset, clear and clean don't work and :help
doesn't have anything listed
res in scala shell are val. you can verify this by trying to reassign a value to res. e.g. - scala> List(1)
Implementing it wouldn't be hard, either! I believe Ctrl + L should be able to clear the REPL console.
The Scala REPL (Read-Eval-Print-Loop) is a development tool to interpret fragments of Scala code. It doesn't require too much setup or infrastructure and it is going to be essential during your learning journey. Using the REPL, you'll be able to play and experiment with the language by typing and evaluating code.
The Scala REPL is a tool (scala) for evaluating expressions in Scala. The scala command will execute a source script by wrapping it in a template and then compiling and executing the resulting program.
You can use :reset
Welcome to Scala version 2.10.0-RC2 (Java HotSpot(TM) 64-Bit Server VM, Java 1.6.0_37). Type in expressions to have them evaluated. Type :help for more information. scala> val a = 1 a: Int = 1 scala> val b = 3 b: Int = 3 scala> :reset Resetting interpreter state. Forgetting this session history: val a = 1 val b = 3 Forgetting all expression results and named terms: $intp, a, b scala>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With