[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Suggestion: "usertype()" function
- From: Miles Bader <miles@...>
- Date: Thu, 31 May 2012 13:00:35 +0900
Tim Hill <email@example.com> 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?
Carefully crafted initial estimates reward you not only with
reduced computational effort, but also with understanding and
increased self-esteem. -- Numerical methods in C,
Chapter 9. "Root Finding and Nonlinear Sets of Equations"