lua-users home
lua-l archive

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

On Thu, Jun 09, 2011 at 04:25:32PM +0200, Roberto Ierusalimschy wrote:
> Just to focus the discussion, the point is not about Lua being or not
> different from C, but about Lua being or not different from IEEE 754.
> Seriously, I do not see what is the big problem. 

1.  David Kastrup's example: [-0] and [0] are different keys, but you can't 
    have both in the same table.

2.  [0/0] is a value, but not a legal table key in the current 5.1 and 5.2 
    Lua implementations.
> > NaN=0/0
> > t=table{[NaN]="Mary Poppins"}
> stdin:1: table index is NaN
> stack traceback:
>     stdin:1: in main chunk
>     [C]: in ?
    This contradicts the reference manual:
> The type table implements associative arrays, that is, arrays that can 
> be indexed not only with numbers, but with any value (except nil).

These points are either bugs that should be corrected, or quirks that should 
be documented.