[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Function as metatable (metafunctions?)
- From: Dirk Laurie <dirk.laurie@...>
- Date: Mon, 31 Mar 2014 09:48:02 +0200
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.