Currently, we support indexing with floats in most places by rounding the float value to an integer. That's been called into question a number of times. There are three obvious behaviors we could go with here:
- Keep the current float-rounding approach for non-integer indices
- Only allow integer indices and throw a no method error when someone indexes with floats
- Hybrid: allow indexing with floats, but only if they're integer-valued.
We need to decide on this before v1.0; the safest approach is to disallow non-integer indexing, since that gives us the option of changing our minds later without breaking existing code.
Currently, we support indexing with floats in most places by rounding the float value to an integer. That's been called into question a number of times. There are three obvious behaviors we could go with here:
We need to decide on this before v1.0; the safest approach is to disallow non-integer indexing, since that gives us the option of changing our minds later without breaking existing code.