lua-users home
lua-l archive

RE: Userdata/Table Unification

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


> > - Many libraries need to store additional Lua objects along with
userdata
> > values and end up abusing the metatable or weak tables. This
complicates
> > type checking and/or garbage collection.
>
> Absolutely. I don't think unifying tables and userdatas alone provides
> a solution though: that data should be private. If __index and
> __newindex were changed to always be called, that would work since
> they could completely disallow access to a table (or to certain
> members), but that might get expensive.
Good point, but as this is a parallel issue for both userdata and tables
this should be a separate thread.
However, as I stated this a parallel issue between userdata and tables, and
as such is another example of how very similar userdata and tables are,
which is why they should be combined (improvement of orthogonality).

AltStyle によって変換されたページ (->オリジナル) /