lua-users home
lua-l archive

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


>What's the difference between the lua_rawtag() and lua_tag() functions in
>4.1-alpha?

In Lua, userdata and tables can have user-defined tags. In 4.1, these are
now (finally!) called types. Types are identified in C by their tags and in
Lua by their names (and also tag, but tags will no get much use from now on
in Lua, only in C).

So, lua_tag returns the tag of a value,, which may be a user-define tag.
lua_rawtag is but returns the tag of the basic (raw) type of a value, that is
either userdata or tag. These raw values are defined in lua.h.
--lhf