[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Suggestion: "usertype()" function
- From: Miles Bader <miles@...>
- Date: Thu, 31 May 2012 13:03:56 +0900
Miles Bader <firstname.lastname@example.org> 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
>> 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.