lua-users home
lua-l archive

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


I can foresee a few problems caused by the wrap around behaviour:
It is the only true change in behaviour with the introduction of integers.

As mentioned elsewhere in this thread, there are a couple of ways that floats are silently converted to integers. (e.g. iterating keys in a table)

This means that code such as:

    t = { }
    t [ 0.0 ] = "foo"
    for k , v in pairs ( t ) do
        t [ k+2^65 ] = v
    end

Will completely change behaviour.
Though this is an esoteric example, I can brainstorm several manners in which this behaviour could sneak into my modules.

A 'solution' to this 'problem' is actually a bit hard to think up, I don't think wrap around is the behaviour that should happen here.
Intuition tells me a silent promotion to double might be the best choice; but this might not make sense when you're not on a 64/64 build.