[erlang-questions] Erlang Syntax - again

Richard A. O'Keefe ok@REDACTED
Tue Mar 11 04:46:59 CET 2008


On 11 Mar 2008, at 1:46 pm, Michael FIG wrote:

> Hi,
>
> If I could change just one thing about Erlang's syntax, I would want  
> to allow an optional semicolon before a "case" expression's "end",  
> just so I could do:
>
> case myfun(abc) of
>    zot -> bar;
>    zing -> baz;
> end,

I wish I could remember which programming language it was that allowed
an optional occurrence of its equivalent of the semicolon at the  
BEGINNING.
Because what I've always wanted is
	case myfun(abc) of
	   ; zot  -> bar
	   ; zing -> baz
	end

Currently I write
	case myfun(abc)
	  of zot  -> bar
	   ; zing -> baz
	end
and it seems to work out OK.

Ada of course uses 'when' the way I'm using ';', and it's not optional.

Why do I want to put the ';' at the beginning of a line?
Because patterns in Erlang designedly look a whole lot like expressions,
and I want it to be *obvious* to the reader, especially me, that
"here is a pattern".




More information about the erlang-questions mailing list