[erlang-questions] DRY principle and the syntax inconsistency in fun vs. vanilla functions

Michael Turner michael.eugene.turner@REDACTED
Wed May 18 18:21:12 CEST 2011


"Anyway, it is often a good idea to break funs out into full functions to
reduce nesting and facilitate tracing.  Lots of funs make programs hard to
debug."

I agree. On both points. But neither point is really relevant to my case
here. I'm not proposing that people write more funs. I'm proposing that
writing named functions enjoy one of the syntactic benefits of funs.

-michael turner

On Thu, May 19, 2011 at 1:17 AM, Daniel Goertzen <
dang@REDACTED> wrote:

>
>
> On Wed, May 18, 2011 at 11:08 AM, Michael Turner <
> michael.eugene.turner@REDACTED> wrote
>
> "I didn't ask that question until I *stumbled* on the extended syntax for
> funs; I didn't know about it before. The current documentation makes it hard
> to find."
>
>
>
>
> I think this is a key issue here: multi-clause funs just don't happen all
> that often.  It was very late in my Erlang learning experience that I found
> the need for multi-clause funs, and I easily found the documentation at the
> time.  I did notice the syntax inconsistency, but didn't care.   Anyway, it
> is often a good idea to break funs out into full functions to reduce nesting
> and facilitate tracing.  Lots of funs make programs hard to debug.
>
> Dan.
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20110519/9b44d07f/attachment.htm>


More information about the erlang-questions mailing list