Oh, that makes sense! Thanks to both you and moreoutput.
My argument is wrong then-- this isn't shockingly bad anything, just a little quirkiness.
I think part of it is that the shell is not the most forgiving of syntax errors, and Erlang doesn't always give the clearest syntax error description.
It's always been correct by line number for me, but I usually have to read that and the line above/below to understand what my actual errors are.
To get the effect you wanted in the you needed a `.`:
That is, if you really wanted it split over multiple lines.The syntax error is indicated as being on line 2 (though not obviously on line 2) with the prefix to the error:
What you've essentially typed in your first example is (replacing the newline with a single space): You'd expect an error from that since there is no operator between the second and third 2. Even placing a comma would've been enough: The shell expects a period terminating an expression before it parses it. This permits entering multi-line expressions without doing anything special (you don't need a special "I'm going to continue on to the next line please don't parse this one" backslash, for instance).