How can I access the last result in Scala REPL?

后端 未结 3 1946
旧时难觅i
旧时难觅i 2021-01-04 01:02

In python REPL I can do things like:

>>> [1,2,3,4]
[1, 2, 3, 4]
>>> sum(_)
10

In clojure REPL I can do this:

         


        
3条回答
  •  春和景丽
    2021-01-04 01:34

    I normally just hit the key to bring back the last line of code and carry on typing. This has the advantage of keeping the whole expression together for easy cutting-and-pasting or editing later.

提交回复
热议问题