[erlang-questions] Function Declaration Syntax

Alexander Krasnukhin the.malkolm@REDACTED
Fri May 13 15:34:21 CEST 2011


Think about it not as whole function but as set of clauses. It make sense
this way.

On Fri, May 13, 2011 at 11:43 AM, Justus <mapandfold@REDACTED> 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
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
>



-- 
Regards,
Alexander
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20110513/b49fe395/attachment.htm>


More information about the erlang-questions mailing list