[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Lua 5.3 work1 Considering math.isinteger or type()
- From: Miles Bader <miles@...>
- Date: Wed, 24 Jul 2013 13:41:06 +0900
Thijs Schreijer <thijs@thijsschreijer.nl> writes:
> Then I would rather have a single type() function and replace its
> number' return value with the new types. Big incompatibility but the
> new integer division operator already is. Incompatible but clean.
Predicates are actually _more_ clean, and yet aren't incompatible
("isnumber" and "isinteger"/"isfloat" can exist simultaneously).
If you are worried about function namespace pollution (I'm not,
particularly, but ...), it's also possible to use a predicate-style
solution with a separate type namespace, e.g. "istype(OBJ, TYPE)",
where TYPE is 'number', 'float', 'table', etc.
-miles
--
Rational, adj. Devoid of all delusions save those of observation, experience
and reflection.