lua-users home
lua-l archive

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


On Nov 25, 2010, at 3:11 AM, Pierre-Yves Gérardy wrote:

> One more candidate:
> 
>    `do` `[` args `]` chunk `end`
> 
> with a short return token wouldn't be too bad. It looks more like the
> usual Lua syntax.

I used to favor "do" as a notation for lightweight functions but that really leads to expecting return to be a return from the enclosing function -- i.e., one ends up wanting blocks as opposed to closures and then there's pressure for a block return symbol which I guess provides one with the short return token...

	`do `[ args `] `=> exprlist `end

But then Lua needs to implement the appropriate semantic changes because this would have different effects from:

	`do `[ args `] `return exprlist `end

Mark