Project

General

Profile

Actions

Feature #7359

closed

#eql? and #equal? naming

Added by aef (Alexander E. Fischer) almost 12 years ago. Updated almost 12 years ago.

Status:
Rejected
Target version:
[ruby-core:49371]

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.

Updated by matz (Yukihiro Matsumoto) almost 12 years ago

  • Status changed from Open to Rejected

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

Matz.

Updated by trans (Thomas Sawyer) almost 12 years 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?

Actions

Also available in: Atom PDF

Like0
Like0Like0