Multiline input on console
Hi! When following the tutorial and entering a function definition in the console:
average = function(x, y)
return (x + y)/2
end
As soon as I enter
average = function(x, y) RETURN
The line is evaluated and I cannot continue with the function body. By reflex I tried Shift + Return without luck. Is it possible to enter multiline expressions inside the console? If so, how?
Thanks!
I will answer myself :) Nevertheless I find the question valid because I found the behavior unintuitive:
After entering
average = function(x, y) RETURN
The console is actually waiting more input but there is no clue about it. So the correct way to proceed is to enter the remaining code line by line and when evaluating the closing
end
The function has been completely defined and is available.
I think there should be some kind of feedback here about the REPL current status, otherwise a missing end
leaves you inside the function definition forever...
I see, actually the console used to allow that, I broke it with recent updates ; if you refresh the whole microStudio page and do not run your project, go directly to the console and try again, you will understand what I mean. If you launch your project, it is subsequently broken, I will make sure to fix that. (Also if you are using the standalone, make sure to download the latest version)