[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Lightweight function syntax (again)
- From: Doug Currie <doug.currie@...>
- Date: Wed, 24 Nov 2010 11:26:04 -0500
On Nov 24, 2010, at 3:55 AM, Alex Bradbury wrote:
> 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.
Mine, too. It has lightweight support for lambda expressions (with multiple return values), and for full closures with statements using do, conditionals, or loops. There is no ambiguity about the end of the parlist or the entire function expression. The only funny character is '\' which looks like a lambda and is used for this purpose in other languages. Thanks, Tony.
e
- 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
- Re: Lightweight function syntax (again), Alex Bradbury