[前][次][番号順一覧][スレッド一覧]

ruby-changes:42956

From: akr <ko1@a...>
Date: Tue, 17 May 2016 22:24:58 +0900 (JST)
Subject: [ruby-changes:42956] akr:r55030 (trunk): Describe Fixnum and Bignum integration in NEWS.

akr	2016-05-17 22:24:53 +0900 (Tue, 17 May 2016)

  New Revision: 55030

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=55030

  Log:
    Describe Fixnum and Bignum integration in NEWS.

  Modified files:
    trunk/NEWS
Index: NEWS
===================================================================
--- NEWS	(revision 55029)
+++ NEWS	(revision 55030)
@@ -46,6 +46,8 @@ with all sufficient information, see the https://github.com/ruby/ruby/blob/trunk/NEWS#L46
   * Integer#ceil, Integer#floor, and Integer#truncate now take an optional
     digits, as well as Integer#round.  [Feature #12245]
 
+  * Fixnum and Bignum are unified into Integer  [Feature #12005]
+
 * String
 
   * String.new(capacity: size) [Feature #12024]
@@ -84,6 +86,17 @@ with all sufficient information, see the https://github.com/ruby/ruby/blob/trunk/NEWS#L86
   Ruby's sum method should be mostly compatible but it is impossible to
   be perfectly compatible with all of them.
 
+* Fixnum and Bignum are unified into Integer  [Feature #12005]
+  Fixnum class and Bignum class is removed.
+  Integer class is changed from abstract class to concrete class.
+  For example, 0 is an instance of Integer: 0.class returns Integer.
+  The constants Fixnum and Bignum is bound to Integer.
+  So obj.kind_of?(Fixnum) works as obj.kind_of?(Integer).
+  At C-level, rb_cFixnum and rb_cBignum is same as rb_cInteger.
+  So, class based dispatch, such as klass == rb_cFixnum and
+  klass == rb_cBignum, should be changed to FIXNUM_P(obj) and
+  RB_TYPE_P(obj, T_BIGNUM).
+
 === Stdlib compatibility issues (excluding feature bug fixes)
 
 * Time

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]