Cosmo/examples/test.cosmo

16 lines
268 B
Plaintext
Raw Normal View History

2020-12-05 23:58:56 +00:00
// crafts a dummy proto
proto test
func __init(self) end
end
// instance of test
let obj = test()
test.__index = function(self, key)
print("__index called!")
if (key == "lol") then
return 9001
end
end
print(obj["lol"]) // should print 9001?