lua-users home
lua-l archive

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


On 11/25/18, Philippe Verdy <verdy_p@wanadoo.fr> wrote:
> Note: math.floor() is not required toi return a native binary integer. It
> may return a variant type using integers for some ranges, and doubles
> outside the range. So even in this case the the inference would not help
> eliminate the necessary tests on the effective type of the variant... The

math.floor can return literally anything. It can be redefined.

In the case where it _isn't_, this is pointless pedantry since it's
not unreasonable to expect the compiler to be aware of (idioms
involving) the stdlib. (And vice versa.)

> Note that the ompiler must still be correct semantically (notably for
> handling exceptions/errors and pcall() correctly).

Pray tell, what does this entail under the pretext of _changing the
semantics_ to make things easier for the compiler?