lua-users home
lua-l archive

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


2014-03-31 2:57 GMT+02:00 Thiago L. <fakedme@gmail.com>:

> So any chance of being able to setmetatable({},__index)?
> (even tho that's
> more like a metafunction than a metatable)
> I mean I can't set __metatable to a function so...

Not sure I understand the question — but

tbl = setmetatable({},{__index=default_values})

is a common idiom.