[erlang-questions] Function Declaration Syntax

Joe Armstrong <>
Fri May 13 22:23:25 CEST 2011


No good reason. Erlang evolved from Prolog and that how it was done in
Prolog
no deep thought was involved ..

/Joe


On Fri, May 13, 2011 at 11:43 AM, Justus <> wrote:

> Hi all,
>
> I come to a question on function declaration syntax: why does function
> name appear in each clause?
>
> Name(Pattern11,...,Pattern1N) [when GuardSeq1] ->
>    Body1;
> ...;
> Name(PatternK1,...,PatternKN) [when GuardSeqK] ->
>    BodyK.
>
> It does not provide any information, except that one might make silly
> mistakes.
>
> If omitting it, a new problem is how to indent clauses properly and
> beautifully.
>
> Name(Pattern11,...,Pattern1N) [when GuardSeq1] ->
>    Body1;
>    (PatternK1,...,PatternKN) [when GuardSeqK] ->
>    BodyK.
>
> --
> Best Regards,
> Justus
> _______________________________________________
> erlang-questions mailing list
> 
> http://erlang.org/mailman/listinfo/erlang-questions
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20110513/b2d50e55/attachment.html>


More information about the erlang-questions mailing list