lua-users home
lua-l archive

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


Peter Hill wrote:
I don't have an exe of Lua5.0 to test this on so could someone else tell me
if it works.

one should be able to write:
    function (a) print("a="..a) end (123)

however this doesn't work in Lua4.0. Does it work in Lua5.0?


It does not, but

( function (a) print ("a="..a) end ) (123)

works.

Looking at the "Complete Syntax of Lua" this is just as
it should be. You need the extra parenthesis inorder to
convert from "exp" to "prefixexp".


		Eero

(btw. it is pretty cool that "Complete Syntax of Lua"  firs
on one page on the manual)