[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Lightweight syntax: a dissident view
- From: steve donovan <steve.j.donovan@...>
- Date: Fri, 26 Nov 2010 08:09:54 +0200
On Thu, Nov 25, 2010 at 11:34 PM, Axel Kittenberger <axkibe@gmail.com> wrote:
> Why everything so complicated?
>
> How about simply this
>
> lambda(x) x == 2
Fine, but then you started to make it complicated ;) If there are
actual statements in an anonymous function, then the existing syntax
is fine as it is.
I read this as 'lambda' <arglist> <expr>, with the operator 'lambda'
<arglist> having the highest precedence.
Not sure in fact whether multiple return values should even be allowed
in this case .... that is, how one would interpret this?
lambda() (10,20)
The syntax and semantics should be as simple as possible,and then
there are less ugly edge cases.
An objection to keyword 'lambda' is that it is 6 chars as opposed to
one (\) but clearly \ has its own difficulties and seems to have
existing connotations. I would still claim that 'lambda(x) x==2` is
less visually noisy than `function(x) return x==2 end` and yet visible
enough not to get lost in 'expression noise'.
steve d.
- References:
- Re: Re: Re: Lightweight syntax: a dissident view, Gunnar Zötl
- Re: Re: Re: Lightweight syntax: a dissident view, Luis Carvalho
- Re: Re: Re: Lightweight syntax: a dissident view, Axel Kittenberger
- Re: Re: Re: Lightweight syntax: a dissident view, Pierre-Yves Gérardy
- Re: Re: Re: Lightweight syntax: a dissident view, Roberto Ierusalimschy
- Re: Re: Re: Lightweight syntax: a dissident view, Mateusz Czaplinski
- Re: Re: Re: Lightweight syntax: a dissident view, Axel Kittenberger
- Re: Lightweight syntax: a dissident view, Philippe Lhoste
- Re: Lightweight syntax: a dissident view, Pierre-Yves Gérardy
- Re: Lightweight syntax: a dissident view, Mark Hamburg
- Re: Lightweight syntax: a dissident view, Pierre-Yves Gérardy
- Re: Lightweight syntax: a dissident view, Pierre-Yves Gérardy
- Re: Lightweight syntax: a dissident view, Axel Kittenberger