lua-users home
lua-l archive

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


hi list,
I'm running into an odd situation that I don't understand.  The
following code compiles and runs as expected

built_ins = {__index = M}
setmetatable(built_ins, built_ins)

z = function() end

(setfenv(function() end, built_ins))()    -- <----- line 78


This code however (just one line commented out) compiles with the error below:

built_ins = {__index = M}
setmetatable(built_ins, built_ins)

-- z = function() end

(setfenv(function() end, built_ins))()    -- <----- line 78

runtime error loading module 'value' from file '/modules/value.lua':
	modules/value.lua:78: ambiguous syntax (function call x new statement) near '('

Any idea why?

thanks,
wes