cbuschka / beanshell2

Automatically exported from code.google.com/p/beanshell2
0 stars 0 forks source link

improvement suggestion: make a built-in read-eval-print loop #102

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Most interpreter shells (irb, python) have an automatic read-eval-print loop. 
bsh seems to just be read-eval. It would be nice to not have to type 'print' 
after each statement to view the return value.

If the beanshell window in the GUI had an input reader, it would just be

BufferedReader br = new BufferedReader(new InputStreamReader(console.in));
while(true) { print(eval(br.readLine()); }

Or something a little more complex to handle multiline input like the console 
does now... 

This would greatly increase the ease of use for debugging interactively

Original issue reported on code.google.com by henry.mi...@gmail.com on 3 Apr 2014 at 12:30

GoogleCodeExporter commented 8 years ago
The "print" part is toggled with the "show()" command. I don't know why the 
default was chosen to be 'off'. But since that is easy to toggle, I think it 
could just stay this way.

Original comment by pejob...@gmail.com on 4 Apr 2014 at 9:44