Actions
Feature #5574
closedMake arrays comparable
Feature #5574:
Make arrays comparable
Description
Why are arrays not comparable? Array already defines <=>, so it seems only natural to mix-in the Comparable module.
> [1, 2] < [1, 1] NoMethodError: undefined method `<' for [1, 2]:Array > Array.send(:include, Comparable) > [1, 2] < [1, 1] => false
This was already discussed in the mailing list a while ago and people agreed it would be useful:
Actions