When typing interactively, if you realize you've made a mistake and want to break out of the braced expression without executing it, what's the best way to do it?
I usually just do something like this (type random characters), which works. I seem to recall it not working a few times, though. For instance, I'll often type a closed parens )
, which doesn't break out of the braced expression if I've already typed an open parens somewhere.
> if(TRUE) {
+ !@##!@#
Error: unexpected '@' in:
"if(TRUE) {
!@"
Or if you've typed a quote then the above doesn't work:
> if(TRUE) {
+ "
+ !@##!@#
+
So the question is this:
Without having to evaluate what has been typed on previous lines, how can you break out of the endless sequence of "give me more input"
+
prompts?
Or stated differently, given,
if(TRUE) {
...
+
what expression breaks evaluation for all possible ...
's?