
4 Oct
2010
4 Oct
'10
7:49 p.m.
Quoth "Richard O'Keefe"
Erlang manages fine with multiclause 'fun':
(fun (1) -> "One" ; (_) -> "Not-one" end)(1)
ML manages fine with multiclause 'fn':
(fn 1 => "one" | _ => "not-one")(1)
In both cases, the same notation is used for multiclause lambda as for single clause lambda. It seems excessively ugly to use completely different notation depending on the number of alternatives, especially when one of the notations has another, much more common, and distinct usage.
Just to be sure, are you saying, rather than case of 1 -> f 2 -> g you'd like to see \ support pattern matching etc. like named functions - \ 1 -> f 2 -> g ? Donn