-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Set#===
as alias to Set#includes?
#5269
Add Set#===
as alias to Set#includes?
#5269
Conversation
This method is for convenience with using on `case` statement. Ruby 2.5 decides such a change, this commit follows it: https://bugs.ruby-lang.org/issues/13801
Please no, I'm against that change. It means this doesn't work: set1 = Set{1, 2, 3}
set2 = Set{3, 2, 1}
case set1
when set2
puts "Works!"
else
puts "Doesn't work!"
end With this PR it will print "Doesn't work!", totally unpredictable. There's also the thing that I never, ever have seen a set being used in a |
@asterite print |
Ooooooooh... I didn't see that. Yes, that's better than the Ruby version. So maybe it's good :-) |
But then, should |
IMO, ordered (indexed) collection should not be redefine And another thought: Why |
ping. |
@makenowjust Could some docs like in |
@bcardiff Added. |
8bbda51
to
96bf6a6
Compare
Thanks @makenowjust ! |
This method is for convenience with using on
case
statement.Ruby 2.5 decides such a change, this PR follows it. However IMO, this is more natural than current and useful.