Project

General

Profile

Feature #12739

deprecate_constant :Fixnum, :Bignum

Added by znz (Kazuhiro NISHIYAMA) almost 3 years ago. Updated about 2 months ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
[ruby-core:77219]

Description

How about class Object; deprecate_constant :Fixnum, :Bignum; end?

I don't mind either way.
Do you have any comment about it?


Related issues

Related to Ruby master - Feature #12005: Unify Fixnum and Bignum into IntegerClosedActions

Associated revisions

Revision 772fd010
Added by nobu (Nobuyoshi Nakada) almost 3 years ago

deprecate Fixnum and Bignum

  • numeric.c (Init_Numeric), bignum.c (Init_Bignum): deprecate Fixnum and Bignum. this may be reverted after previews. [Feature #12739]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56187 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 56187
Added by nobu (Nobuyoshi Nakada) almost 3 years ago

deprecate Fixnum and Bignum

  • numeric.c (Init_Numeric), bignum.c (Init_Bignum): deprecate Fixnum and Bignum. this may be reverted after previews. [Feature #12739]

Revision 56187
Added by nobu (Nobuyoshi Nakada) almost 3 years ago

deprecate Fixnum and Bignum

  • numeric.c (Init_Numeric), bignum.c (Init_Bignum): deprecate Fixnum and Bignum. this may be reverted after previews. [Feature #12739]

Revision 56187
Added by nobu (Nobuyoshi Nakada) almost 3 years ago

deprecate Fixnum and Bignum

  • numeric.c (Init_Numeric), bignum.c (Init_Bignum): deprecate Fixnum and Bignum. this may be reverted after previews. [Feature #12739]

Revision 56187
Added by nobu (Nobuyoshi Nakada) almost 3 years ago

deprecate Fixnum and Bignum

  • numeric.c (Init_Numeric), bignum.c (Init_Bignum): deprecate Fixnum and Bignum. this may be reverted after previews. [Feature #12739]

History

#1

Updated by znz (Kazuhiro NISHIYAMA) almost 3 years ago

  • Related to Feature #12005: Unify Fixnum and Bignum into Integer added

Updated by nobu (Nobuyoshi Nakada) almost 3 years ago

I tried this, found rake defines Fixnum::MAX which seems useless, and submitted a PR to rake.
But it fails on ruby 2.2 or earlier, due to incompatibility of Bundler 1.13.0.

#3

Updated by nobu (Nobuyoshi Nakada) almost 3 years ago

  • Status changed from Open to Closed

Applied in changeset r56187.


deprecate Fixnum and Bignum

  • numeric.c (Init_Numeric), bignum.c (Init_Bignum): deprecate Fixnum and Bignum. this may be reverted after previews. [Feature #12739]

Updated by robertgleeson (Robert Gleeson) about 2 years ago

znz (Kazuhiro NISHIYAMA) wrote:

How about class Object; deprecate_constant :Fixnum, :Bignum; end?

I don't mind either way.
Do you have any comment about it?

It would be nice to have constant_deprecated?.
To avoid all of these warnings while supporting <2.4 and >=2.4 i track what constants are deprecated in an array, and
then avoid using them or not by checking the array at runtime. It's bit of a pain..

Updated by robertgleeson (Robert Gleeson) about 2 years ago

robertgleeson (Robert Gleeson) wrote:

znz (Kazuhiro NISHIYAMA) wrote:

How about class Object; deprecate_constant :Fixnum, :Bignum; end?

I don't mind either way.
Do you have any comment about it?

It would be nice to have constant_deprecated?.
To avoid all of these warnings while supporting <2.4 and >=2.4 i track what constants are deprecated in an array, and
then avoid using them or not by checking the array at runtime. It's bit of a pain..

I realise my comment isn't clear, here's very simple code to show what i mean:

deprecated_constants = [:Fixnum, :TimeoutError, :Bignum, :FALSE, :TRUE, :NIL]
Object.constants.each do |constant|
const_get(constant) unless deprecated_constants.include?(constant)
end

the real code i have is more complex, but in essence this is the problem,
and deprecated_constants has to be maintained by me manually, which
will become out of date over time.

Updated by znz (Kazuhiro NISHIYAMA) about 2 years ago

Closed ticket should not be reused.
Please open new ticket.

Also available in: Atom PDF