[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Lightweight function syntax (again)
- From: Alex Bradbury <asb@...>
- Date: Wed, 24 Nov 2010 08:55:33 +0000
On 23 November 2010 20:26, Tony Finch <dot@dotat.at> wrote:
> So I'm leaning towards a syntax like
>
> function ::= function `(´ [parlist] `)´ <block> end
> | `\´ [parlist] `(´ [explist] `)´
> | `\´ [parlist] <funbody>
>
> funbody ::= <function> | <dostat> | <ifstat> | <loopstat>
On balance, I think this is my favourite proposal so far. Perhaps my
only niggle is I'm used to parentheses around an expression resulting
in that expression returning only one value, though I assume \ x,y
(x*x, y*y) will return two. Still, for me personally the trade-offs
with this solution are the easiest to stomach of the proposals I've
seen so far. I particularly like that the syntax works well with
functions containing statements as well as those which just return
expressions.
I don't suppose you've looked at implementing this patch for LuaJIT 2?
Alex
- References:
- [ANN] Lua 5.2.0 (alpha-rc2) now available, Luiz Henrique de Figueiredo
- Re: [ANN] Lua 5.2.0 (alpha-rc2) now available, Petite Abeille
- Re: [ANN] Lua 5.2.0 (alpha-rc2) now available, Luiz Henrique de Figueiredo
- Re: [ANN] Lua 5.2.0 (alpha-rc2) now available, Petite Abeille
- Re: [ANN] Lua 5.2.0 (alpha-rc2) now available, Pierre-Yves Gérardy
- Lightweight function syntax (again) Re: [ANN] Lua 5.2.0 (alpha-rc2) now available, Mark Hamburg
- Re: Lightweight function syntax (again) Re: [ANN] Lua 5.2.0 (alpha-rc2) now available, steve donovan
- Re: Lightweight function syntax (again) Re: [ANN] Lua 5.2.0 (alpha-rc2) now available, Mark Hamburg
- Re: Lightweight function syntax (again) Re: [ANN] Lua 5.2.0 (alpha-rc2) now available, Pierre-Yves Gérardy
- Re: Lightweight function syntax (again) Re: [ANN] Lua 5.2.0 (alpha-rc2) now available, steve donovan
- Re: Lightweight function syntax (again), Drake Wilson
- Re: Lightweight function syntax (again), Axel Kittenberger
- Re: Lightweight function syntax (again), Tony Finch