lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


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