[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Lua 5.3 work1 Considering math.isinteger or type()
- From: Eric Wing <ewmailing@...>
- Date: Thu, 25 Jul 2013 13:22:03 -0700
> Out of curiosity… as the 46 (and counting) messages in this thread haven't
> made it very clear, at least to me… why do we even care if a number is an
> integer, float, real, double, whatnot? Isn't the purpose of that int vs.
> float dichotomy to be purely an implementation detail? Wholly transparent?
> And a number stays a number? Irrespectively of internal representation? Or?
For me, knowing this is important for language binding/bridging.
Sometimes knowing the type is important for doing the more optimal
thing, and in a few cases doing the right thing. For example, in
Cocoa, I may need to know what the number type is to box it with the
correct incantation of NSNumber method constructors (i.e. is it a
double or integer).
It isn't the common case, but it does come up and this isn't a debug usage.
I see that the C API already has a lua_isinteger which suits my
particular needs already. However, if I implemented more of the
language bridge on the Lua side instead of the C side, this would be a
bigger issue for me.
Thanks,
Eric
--
Beginning iPhone Games Development
http://playcontrol.net/iphonegamebook/