lua-users home
lua-l archive

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

Miles Bader <> writes:
>> However, it seems to me that there is one hole in this clean model:
>> the inability of a metatable to project a "type" into the Lua code
>> space.
> ...
>> Thoughts anyone?
> I think the entire concept of a "type()" function is sort of fragile,
> and really not what you want as a general interface.
> Something like type predicates would be much better.  So the trick is,
> assuming a standard set of type predicates, how do you extend them to
> work on user types?

... and of course they need not be real predicates, e.g. something like
"istype(OBJ, TYPENAME)" can offer the same functionality, maybe.


Conservative, n. A statesman enamored of existing evils, as opposed to a
Liberal, who wants to replace them with new ones.