lua-users home
lua-l archive

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


We do this for a long time, and modified tolua++ to support this :)

regards,
Xavier Wang.

2012/10/8 Rob Hoelz <rob@hoelz.ro>
Hi list,

I was thinking about this when I was out and about today: type() only
provides "raw" type information, and a lot of libraries are forced to
implement their own type information functions if a user wants more
information about the type of a value.  So I decided to start writing a
new library called typical:

https://github.com/hoelzro/lua-typical

Typical is *really* simple; on Lua values without a metatable, it just
calls _G.type.  If the value has a metatable, it checks for a __type
field in the metatable and uses that if found.  The typical library will
also include some more utility functions.

Obviously this is up to library and application developers to go along
with, so I wanted to get the community's feedback on this.  Do you
folks think this is a good or bad idea?  Any questions, comments, or
suggestions?

Thanks,
Rob