[ruby-core:88670] [Ruby trunk Feature#15030] Have T_INTEGER constant for checking Integer types in C API

From: hanmac@...
Date: 2018-08-27 05:49:02 UTC
List: ruby-core #88670
Issue #15030 has been updated by Hanmac (Hans Mackowiak).


hm that is not that easy, while Fixnum and Bignum are deprecated on the ruby side,
on the C side they still exist

thats why a single T_INTEGER check might not work that way you want

----------------------------------------
Feature #15030: Have T_INTEGER constant for checking Integer types in C API
https://bugs.ruby-lang.org/issues/15030#change-73727

* Author: v0dro (Sameer Deshmukh)
* Status: Open
* Priority: Normal
* Assignee: 
* Target version: 
----------------------------------------
After Integer unification in Ruby 2.4, I think it makes sense to introduce a T_INTEGER 
type that helps in directly testing if a Ruby object is an Integer in C API.

For example, currently we need to write `RB_TYPE_P(obj, T_FIXNUM)` for this purpose. 
However since ruby 2.4 onwards deprecates Fixnum and Bignum, I think it makes sense
to have a `T_INTEGER` type so that one can write `RB_TYPE_P(obj, T_INTEGER)` directly
to test for both 64-bit and > 64-bit integers.



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

Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>

In This Thread

Prev Next