Re: Function as metatable (metafunctions?)
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: Function as metatable (metafunctions?)
- From: Dirk Laurie <dirk.laurie@...>
- Date: 2014年3月31日 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.