lua-users home
lua-l archive

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


On Mon, Apr 14, 2014 at 8:53 AM, Dirk Laurie <dirk.laurie@gmail.com> wrote:
> 2014-04-14 9:29 GMT+02:00 Tim Hill <drtimhill@gmail.com>:
>
>> .. it really comes down to two choices:
>>
>> 1 / (x^(-n) … invert the sign and do floating point division
>> -or-
>> error
>>
>> As Roberto said, work1 did the former, work2 the latter.
>
> >From a pedantic point of view, inverting the sign and doing
> integer division is the only consistent option.
>
> But from a practical point of view, particularly the non-breaking
> of existing programs, floating-point division is the only useful
> option.
>
> So which is more typical of The Lua Way: consistent but useless,
> or pragmatic and useful?

I agree with Roberto, consistent types is more important. If you
cannot tell if something will return float or int you can then no
longer reason about other stuff that depends on it. Anyone trying to
do static analysis on Lua code will have a hard time too.

Justin