lua-users home
lua-l archive

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


>Is it allowed to save other data than the event-handlers in metatables?
>I need a simple way to assign userdata different 'types' (like bitmap, =
>font etc.).

Sure: metatables are ordinary tables. For instance, tostring looks into
them and see whether they contain a "__tostring" field. This is used by the
io library for error messages.
--lhf