lua-users home
lua-l archive

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


2014-10-09 18:42 GMT+02:00 Marco Mastropaolo <marco@mastropaolo.com>:
> Hi everyone
> - I'm Marco Mastropaolo, a programmer who - for as a hobby - is trying to
> create a Lua interpreter in C# with the intent of an as much "clean room
> implementation" as feasible (that is, implementing my grammar, interpreter,
> VM etc. instead of plainly converting the standard ones). I know, weird
> hobby.
>
> For this reason, I'm trying to analyze those little details of the standard
> implementations which are not specified in the documentation..
>
> One thing I don't get is how Lua rounds numbers when performing operations
> on the standard library.
>
...
>> return select(2.5, 1, 2, 3, 4, 5, 6, 7)

This is illegal now.

Lua 5.3.0 (alpha)  Copyright (C) 1994-2014 Lua.org, PUC-Rio
> select(2.5, 1, 2, 3, 4, 5, 6, 7)
stdin:1: bad argument #1 to 'select' (number has no integer representation)
stack traceback:
    [C]: in function 'select'
    stdin:1: in main chunk
    [C]: in ?

In Lua 5.2.3, the manual does not say, i.e. what happens is
undefined.