[erlang-questions] extending function clauses

Zvi <>
Sat Dec 20 03:14:41 CET 2008


fixed another typo:


Zvi wrote:
> 
> Function caluses in Erlang are just syntactic shugar for case, i.e.
> 
> f(Pattern1) -> E1;
> f(Pattern2) -> E2;
> ...
> f(PatternN) -> EN.
> 
> is equivalent to:
> 

f(X) -> 
 case X of
   Pattern1 -> E1;
   Pattern2 -> E2;
   ...
   PatternN -> EN
 end.

-- 
View this message in context: http://www.nabble.com/extending-function-clauses-tp21091060p21101155.html
Sent from the Erlang Questions mailing list archive at Nabble.com.




More information about the erlang-questions mailing list