lua-users home
lua-l archive

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


On Wed, 15 Jan 2020 at 22:09, Sean Conner <sean@conman.org> wrote:
> > It is not the concept of meta information but that the mechanism is
> > exposed. So now Lua is forever tied to supporting the mechanism.
>
>   So in an ideal world, how would you have defined/implemented it?  You
> *have* to expose *something* for it to be useful.
>

Of course there is no ideal world and this is my opinion only. In my
experience exposing implementation details is always risky.

This is what probably happened:

1. We need to attach meta data to stuff.
2. We would like to reuse tables to store meta data.
3. Well why not allow users to set a table as meta table, problem solved.

I think it is 3) that is a problem. Because now Lua has no control
over what the user might do to the table.
We only needed an api to set the meta data. That way the
'implementation' would be hidden.

Regards