[erlang-questions] separators before end
David Mercer
dmercer@REDACTED
Wed Sep 19 19:07:15 CEST 2007
> The fact that Erlang doesn't *HAVE* statements. It only has
> expressions. What is the value of an empty expression?
Good point.
> Where Erlang *does* need to allow extra semicolons is at the
> *beginnings* of ifs, cases, and receives, so you can write
> case e0 of
> ; p1 when g1 -> e1
> ; ...
> ; pn when gn -> en
> end
> and be sure of having your punctuation right.
I prefer this, too.
Cheers,
David
-----Original Message-----
From: erlang-questions-bounces@REDACTED
[mailto:erlang-questions-bounces@REDACTED] On Behalf Of ok
Sent: Wednesday, September 19, 2007 01:00
To: Erlang-Questions (E-mail)
Subject: Re: [erlang-questions] separators before end
On 19 Sep 2007, at 3:33 pm, Doug Edmunds wrote:
> Can someone tell me why it would be so difficult for Erlang
> to allow commas and semi-colons before the word ''end"?
Syntactically it would be easy.
>
> If there is a syntax error waiting to happen it is doing
> a copy/paste that doesn't add or take away a comma or
> semi-colon.
This doesn't happen to me, but I'm not a *heavy* user of Erlang,
so evidence from people who are would be useful.
> What is so bad about having an empty statement?
The fact that Erlang doesn't *HAVE* statements. It only has
expressions. What is the value of an empty expression?
Should
if ... -> E1, ; ... -> En, ; end
have the same value as
if ... -> E1 ; ... -> En end
and if so, how come the empty expression has so many different values?
If not, why not?
Where Erlang *does* need to allow extra semicolons is at the
*beginnings* of ifs, cases, and receives, so you can write
case e0 of
; p1 when g1 -> e1
; ...
; pn when gn -> en
end
and be sure of having your punctuation right.
>
>
> --dae
>
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://www.erlang.org/mailman/listinfo/erlang-questions
_______________________________________________
erlang-questions mailing list
erlang-questions@REDACTED
http://www.erlang.org/mailman/listinfo/erlang-questions
More information about the erlang-questions
mailing list