lua-users home
lua-l archive

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


Quinn Tyler Jackson wrote:

> Another silly question:
>
>      print((function(y) return y+10; end) (10));
>
> Is there a reason the () around the function object are
> required?

I wondered this myself for a while.  From the reference
manual (note the last case of "prefixexp"):

> prefixexp ::= var | functioncall | `(' exp `)'
>
> functioncall ::= prefixexp args | prefixexp `:' Name args 

-- 
Aaron