[erlang-questions] erlang *****
Wed Mar 19 02:33:23 CET 2008
On 19/03/2008, Richard A. O'Keefe <ok@REDACTED> wrote:
> I've forgotten who it was who proposed simply allowing multiple
> pairs on cases:
> case E
> of P1 when E1 ;
> P2 when E2 -> B2
> ; P3 when E3 ;
> P4 when E4 -> B4
> f(P1...) when E1 ;
> f(P2...) when E2 -> B2;
> f(P3...) when E3 ;
> f(P4...) when E4 -> B4.
> The syntax could be better, but this extension *does* satisfy all the
> that anyone has actually mentioned wanting in a real program and
> *doesn't* need
> major revisions to the compiler or virtual machine and *doesn't* turn
> selection into an exponential-time horror.
Those were the reasons that I suggested it, plus that guards are a part of
pattern matching and should be directly connected to the patterns to which
they refer. Also, it was an off the top of my head minimal syntax change so
there is no doubt the syntax can be improved but I wouldn't make it to
different or it could cloud the meaning.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the erlang-questions