Project

General

Profile

Actions

Feature #15031

open

T_RANGE for testing whether object is a Range

Added by v0dro (Sameer Deshmukh) over 5 years ago. Updated over 5 years ago.

Status:
Open
Assignee:
-
Target version:
-
[ruby-core:88668]

Description

Range is an in-built type of Ruby and it would be better for C extension
writers if there existed a constant T_RANGE that could be directly used
for checking whether a VALUE is a Range.

Currently we need to write CLASS_OF(obj) == rb_cRange in order to make this
happen. Having a T_RANGE would help in making C code more idiomatic and fast
in some cases.

That way, one can write RB_TYPE_P(obj, T_RANGE).

Updated by ko1 (Koichi Sasada) over 5 years ago

rb_obj_is_range() can be accepted like rb_obj_is_proc and so on.
T_xxx shows data layout of RVALUE.

Updated by v0dro (Sameer Deshmukh) over 5 years ago

ko1 (Koichi Sasada) wrote:

rb_obj_is_range() can be accepted like rb_obj_is_proc and so on.
T_xxx shows data layout of RVALUE.

Sure :)

Actions

Also available in: Atom PDF

Like0
Like0Like0