Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to modify previous line in REPL - scala to modify the typing errors to save time compare to entering each line using up/down arrows

There are chances that some typing (in Ubuntu terminal - scala -version Scala code runner version 2.9.1) errors occur, example shown below where instead of (l: Int) (l: int) has been typed in parameters.

 scala> class Rectangle (l:int, w: Int){
 | val length = l
 | val length = w
    .
    .
    .
    few more lines but still ... module Rectangle is not defined. Or sometimes enter command given and error shows up.

Is there anyway where directly that typing error can be edited / modified and rerun the code? It will save great deal of time otherwise I am entering line by line using up/down arrow.

Please guide.

like image 666
Optimight Avatar asked Jun 06 '12 10:06

Optimight


1 Answers

I don't know if there is a better solution, but in my case I tend to use my usual text editor to write code snippet and paste them using the paste mode of the REPL (you can enter the paste mode thanks to the :paste command).

like image 105
Nicolas Avatar answered Sep 23 '22 12:09

Nicolas