lua-users home
lua-l archive

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


a metatable can be filled with whatever you want. I am currently using this
feature to implement a scheme similar to the proxy mechanism: a full
userdata comes with a metatable that contains __index and __nexindex
functions that get and set fields in the metatable itself (in addition to
fetching predefined members as well). That way, the full userdata can be
used as any regular table.

-----Message d'origine-----
De : Peter Hill [mailto:corwin@iinet.net.au]
Envoyé : mardi 18 février 2003 04:59
À : Multiple recipients of list
Objet : Couple of technical questions


(2) Why do metamethods have a double underscore prefix? That seems to imply
that the metatable will be filled with other, otherwise conflicting,
entries.

*cheers*
Peter Hill.

Ki: Contractors... high-paid leeches stealing our work.
Fooker: If you think of them as disposable employees, you'll feel much
better...