Feature #7359

#eql? and #equal? naming

Added by Alexander E. Fischer over 1 year ago. Updated over 1 year ago.

[ruby-core:49371]
Status:Rejected
Priority:Normal
Assignee:Yukihiro Matsumoto
Category:core
Target version:Next Major

Description

In my opinion the difference between @#eql?@ and @#equal?@ is really unintuitive. How about making their difference more obvious by giving one of them a more accurate name?

My proposal is to rename @#equal?@ to @#identic?@.

If you deprecate #equal? at the same time, maybe in the far future it can have a comeback as an alias for #eql? to make those people happy who dislike to use abbreviations just to reduce the character count by two and simultaneously making it harder to read in a classical sense.

If you like it, let me know. Then I will provide a patch.

History

#1 Updated by Yukihiro Matsumoto over 1 year ago

  • Status changed from Open to Rejected

Making them little more intuitive does not worth breaking millions of existing programs.

Matz.

#2 Updated by Thomas Sawyer over 1 year ago

"Making them little more intuitive does not worth breaking millions of existing programs."

That's true, but why does it have to be one or the other? Just,

alias identical? equal?

And let that be for a year or two while getting word out to people they should start to use #identical? instead of #equal? for future. After a year or two of that, add a warning to #equal?. And let that be for another couple of years. Only after that, in a new major version, e.g. Ruby 2.2, 2.3 or Ruby 3.0 or whatever, would #equal? actually change. Plenty of time for an orderly managed transition.

It may seem minor, but little things add up. Why reject what is clearly an improvement just b/c it requires a managed transition?

Also available in: Atom PDF