lua-users home
lua-l archive

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


Aaron:

On Sun, Jun 16, 2019 at 1:21 AM Aaron B. <aaron@zadzmo.org> wrote:
> Francisco Olarte <folarte@peoplecall.com> wrote:
> > So, is there any problem with storing strange things in an object metatable?
> My database library SqlTable does exactly this, to prevent it's
> internal state information from colliding with the keys of data within
> the database.

I mainly use that to mark whether a wrapped object "implements" an
interface ( I have C++ object for each one and mark the metatables
with a LUD pointing to itself ( meta[klassLud]=klassLub ), which I
found easy to implement and let's me have some kind of
"inheritance"...

> It hasn't caused problems in Lua 5.1 through to 5.3, so it at least
> works well. If it's actually a good idea... I don't know.

... and I'm exactly there, just with only 5.3, but anyway, it's nice
knowing I'm not the only one having that kind of ideas ( and making
them work ). Thanks.

Francisco Olarte.



>
> --
> Aaron B. <aaron@zadzmo.org>
>