lua-users home
lua-l archive

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

On 17/05/2014 03:20, Mike Nelson wrote:
On 5/16/2014 4:18 PM, Andrew Starks wrote:
Test it yourself:

debug.setmetable(nil, { __index = nil})

Then the `.`  operator will behave like ?

I'm curious for the results.


This code doesn't work for me on a vanilla Lua 5.2 interpreter. The following code does:

debug.setmetatable(nil, { __index = function() end})

I haven't benckmarked it yet.

-- Mike

You don't need a function() end there, you can also use an empty {}