[ create a new paste ] login | about

Link: http://codepad.org/Ssb4yFwP    [ raw code | output | fork ]

Lua, pasted on Feb 10:
1
2
3
4
5
6
7
8
9
10
11
12
13
local mt1 = {
    __index = { pie = "yummy" }
}

local mt2 = {
    __index = function(i) return i == "pie" and "yummy" end
}

local t1 = setmetatable({}, mt1)
local t2 = setmetatable({}, mt2)

print(next(t1))
print(next(t2))


Output:
1
2
nil
nil


Create a new paste based on this one


Comments: