On Sat, Aug 10, 2013 at 6:16 AM, John Hind <john.hind@zen.co.uk> wrote:
I like this a lot.
One possible extension is to follow the lead of luaL_checkudata surfacing
this test in Lua. So if a type is defined using a userdata with a metatable
stored under a type name in the registry (as the C API encourages):
type(x, "mytype")
checks if type is a userdata or table with a metatable equal to the table
stored in the registry under the key "mytype".
This allows for the test to work even if a "type" metavalue is not defined.
John,
Thanks man!
I love your idea. It's actually the problem that I set out to solve,
before I learned I would need the C-API to solve it.