lua-users home
lua-l archive

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


On Mar 2, 2012, at 2:43 AM, Luiz Henrique de Figueiredo wrote:

>> Given Lua's indulgence to all those Fortran programmers out
>> there, what about good old "arithmetic statement functions" for
>> a lightweight syntax?  In this case:
>> 
>> foo(x) = x.foo
> 
> I've toyed with
> 	function f(x,y,z) = expression
> 
> which saves "return" and "end" but keeps "function" (and can be used with
> "local as well).

Unfortunately, that would have precedence issues around commas, but otherwise I can imagine cases where it would help.

Mark