[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Lua 5.3 work1 Considering math.isinteger or type()
- From: David Demelier <demelier.david@...>
- Date: Wed, 17 Jul 2013 10:10:03 +0200
As we have already discussed this, some of us on the lists think that
math.isfloat is great but should also reflect the opposite as
Joseph Manning and I thought this idea great as you only need to
remember there are math.is* to check the type. So you don't need to
think which one of the function is available.
This makes the library clear and adds a symmetry to the API.
However Thijs Schreijer also thougth about the functione type() that
should returns two values like this:
type(10) -> "number", "integer"
type(10.0) -> "number", "float"
This is not a bad idea, it will not break compatibility but adds a
second feature to determine the actual type of the integer. With this,
the discuss of keeping math.isfloat and adding math.isinteger will be
I just hope that one of these 2 solutions will be approved and added
for the final Lua 5.3