lua-users home
lua-l archive

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

>  Speaking of functions as first class, is there any reason why the
>  following doesn't work (I'm using 4.0 alpha):
>  function(x) return x end ("foo")

Because the parser cannot understand that (the old problem with optional
semicolons...). In Lua 5.0, you can write that adding parentheses:

  (function(x) return x end) ("foo")

-- Roberto