lua-users home
lua-l archive

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


Well you have me convinced. 

regards
David B

Virgil Smith <Virgil@Nomadics.com> wrote:

>So why not kill two birds with one stone.
>Disallow metamethods on "simple" tables entirely.  Add a new type to the
>language for tables that can have metatables.  Tables with metatables (like
>full userdata) represent user defined types.
>
>The requested metamethods could then be added without risking performance
>degradation to tables in general (which is quite possibly a huge performance
>threat to Lua as a whole).
>
>OK, here's "the second bird".  If this new "extended table"(or whatever)
>type is given a C-API accessible void* then it can replace full userdata and
>simultaneously solve the per-userdata Lua-side value problem with no
>"weak-table issues" involved.