lua-users home
lua-l archive

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


The difference between math.nan and nil is that you can perform arithmetic
on math.nan.

Actually, it would be sort of cool to have a NaN equivalent for other
operations. Call it NotAValue and perhaps it's actually the same as NaN. For
example:

    x = nil
    y = x.field
    
y is now equal to NotAValue.

That would, however, change the semantics with respect to error detection.

Mark