lua-users home
lua-l archive

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



I'd suggest adding a "__typeof()" metamethod to Lua, similar to __tostring() but used by the 'type()' built-in function.

The reason? It could be used with userdata, to provide more information of the entity than just "userdata" does. For example, it could provide "enum/SDL_INIT", telling that the entity is an enumaration of logical type SDL_INIT.

The main benefit would be better error messages, and better type-wise expandability of Lua in general.

Please consider,
-asko