pattern match

Ulf Wiger <>
Fri Mar 11 22:46:13 CET 2005


Den 2005-03-11 21:47:35 skrev Serge Aleynikov <>:

> Is there any difference in doing a pattern match on a parameter in the  
> following implementations, or this is just a matter of programming style?
>
> f({a, _B} = Param) ->
>    Param.
>
> or
>
> f(Param = {a, _B}) ->
>    Param.

Please see the discussion started with
http://www.erlang.org/ml-archive/erlang-questions/200410/msg00198.html

The short answer: it's a matter of programming style.
Personally, I would pick the first alternative. From the thread,
you will learn who agrees or disagrees, and why.

Regards,
Uffe



More information about the erlang-questions mailing list