4 ms·
I'm fine with an array type that supports this, but not as the default. I've been bitten in the past by code that ran error-free while giving incorrect output d
by dataflow 4y ago
I'm fine with an array type that supports this, but not as the default. I've been bitten in the past by code that ran error-free while giving incorrect output due to this feature suddenly making the indexing valid. I'd prefer it to be opt-in somehow so that the default behavior for negatives is invalid, not silently wrong yet valid behavior.
- signaru 4y agoMatlab has the opposite where your syntactically valid but mysteriously non-working code suddenly has a large array. EDIT: On the other hand, I think Matlab's array(end - number) indexing syntax is a good compromise of convenience and less error prone explicitness.
- qsi 4y agoYou can also overload end in Matlab for your custom classes as it's actually a method.