Loading…
|
aef |
Added <, >, <= and >= operators as alternative to the subset? and sup…
…
…erset? method family |
a775f97
|
If you really want to let ruby-core accept patch, you should put this onto bugs.ruby-lang.org.
This opinion is new feature, so it probably doesn't be accepted in 2.0.
But it's possible on version if you got success matz's acceptance.
Good luck.
Just committed an equivalent patch, thanks.
Merged in r36853. (Since I already had an equivalent patch I didn't pull your commit)
Added <, >, <= and >= operators as alternative to the subset? and sup… …
…erset? method family
They simply serve as alternatives to the superset? and subset? method family.
Neither the Comparable mixin nor <=> is implemented by intention, because a comparison with a completely disjunct other set would result in an undefined result, which then would cause exceptions when sorting an array of sets for example.
I've also written a patch for rubyspec which tests the new methods and runs at least in MRI 1.8.7, 1.9.2 and 1.9.3. It is available here: https://github.com/aef/rubyspec