Feature #8462

Module.remove_const inconsistant naming

Added by Kyle Decot 11 months ago. Updated 11 months ago.

[ruby-core:55198]
Status:Rejected
Priority:Normal
Assignee:-
Category:core
Target version:-

Description

The Module class in Ruby has several methods for dealing w/ constants:

constset
const
get
constdefined?
const
missing
remove_const

The last of which is inconsistently named. I propose that we deprecate this method and create a new one called constunset (as it's the counterpart to constset).

History

#1 Updated by Zachary Scott 11 months ago

  • Status changed from Open to Rejected

duplicate of #7414

#2 Updated by Charlie Somerville 11 months ago

zzak, I don't see how this is a duplicate of #7414. Did you accidentally post the wrong issue number?

#3 Updated by Zachary Scott 11 months ago

I may have overlooked this feature without a patch it's unclear what they
want so please reopen when you have a patch

On Sunday, June 2, 2013, charliesome (Charlie Somerville) wrote:

Issue #8462 has been updated by charliesome (Charlie Somerville).

zzak, I don't see how this is a duplicate of #7414. Did you accidentally

post the wrong issue number?

Feature #8462: Module.remove_const inconsistant naming
https://bugs.ruby-lang.org/issues/8462#change-39645

Author: kyledecot (Kyle Decot)
Status: Rejected
Priority: Normal
Assignee:
Category: core
Target version:

The Module class in Ruby has several methods for dealing w/ constants:

constset
const
get
constdefined?
const
missing
remove_const

The last of which is inconsistently named. I propose that we deprecate
this method and create a new one called constunset (as it's the
counterpart to const
set).

http://bugs.ruby-lang.org/

#4 Updated by Yukihiro Matsumoto 11 months ago

remove is a dangerous operation, thus named inconsistent, as removeinstancevariable etc.

Matz.

#5 Updated by Kyle Decot 11 months ago

I understand that it's a dangerous operation but how does naming it inconsistently make any less so other than making it difficult to find in the documentation? The fact that it's a private method I would think should be protection enough from accidental usage.

matz (Yukihiro Matsumoto) wrote:

remove is a dangerous operation, thus named inconsistent, as removeinstancevariable etc.

Matz.

#6 Updated by Kyle Decot 11 months ago

(Sorry for the duplicate post, this one can be deleted)

kyledecot (Kyle Decot) wrote:

I understand that it's a dangerous operation but how does naming it inconsistently make any less so other than making it difficult to find in the documentation? The fact that it's a private method I would think should be protection enough from accidental usage.

matz (Yukihiro Matsumoto) wrote:

remove is a dangerous operation, thus named inconsistent, as removeinstancevariable etc.

Matz.

Also available in: Atom PDF