News for hackers. Stuff that matters.
Re:A History of Erlang (2007) by Jtsummers on Monday April 06, 2020 @07:59PM (#22799122)
There's no meaningful whitespace in your example. You have a syntax error in the first example.

To get the effect you wanted in the you needed a `.`:

  1> 2 + 2
  1> .
  4
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:

  * <line number>: <syntax error information>
What you've essentially typed in your first example is (replacing the newline with a single space):

  1> 2 + 2 2 + 2.
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:

  1> 2 + 2
  1> ,2 + 2. ;; this is weird to do, but valid
  4
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).
Re:A History of Erlang (2007) by seagreen on Monday April 06, 2020 @08:17PM (#22799222)
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.

Re:A History of Erlang (2007) by Jtsummers on Monday April 06, 2020 @08:19PM (#22799231)
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.