lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Tue, Mar 25, 2008 at 11:02 PM, Asko Kauppi <askok@dnainternet.net> wrote:
>
>  Ariel Manzur kirjoitti 25.3.2008 kello 23:03:
>
>
> > On Tue, Mar 25, 2008 at 5:51 PM, Asko Kauppi <askok@dnainternet.net>
>  > wrote:
>  >>
>  >> Ariel Manzur kirjoitti 25.3.2008 kello 22:06:
>  >>
>  >>
>  >>> On Tue, Mar 25, 2008 at 10:55 AM,  <askok@dnainternet.net> wrote:
>  >>> [...]
>  >>>> Before 2008, I used to have LNUM patch always return FP
>  >>>> results to an integer, if possible. This, however, slowed
>  >>>> down _all_ FP operations slightly, and was never feeling
>  >>>> 'right'. The current way does feel right for me, and I bet
>  >>>
>  >>> Is it possible to disable conversion from integers to FP too? (maybe
>  >>> with a compile time option).
>  >>
>  >> You mean to give an overflow error, or a round trip to negative
>  >> integers?
>  >
>  > No, I mean have it behave like this:
>  >
>  > 5 / 2 = 2
>  > 5.0 / 2 = 2.5
>  > 2.5 * 2 = 5.0
>  >
>  > like C basically, with no behind-the-scenes conversions at all.
>
>  LNUM patch was made to be 100% compatible with Lua. This wouldn't be
>  and I'm personally very happy with the "all numbers are just numbers"
>  way that Lua treats them.
>
>  If you really really want this, it can be done with syntax modders,
>  but it won't be Lua any more. In my opinion.

Not really, the above example was just an example, in the real world
those would all be variables, a syntax modder wouldn't have much to do
there.

>
>  -asko
>
>