Hide Rational internal
I'd like to hide C-level Ratinal internal.
I made a patch to do it.
This is similar to [Feature #6083] for struct RBignum.
If the internal is hidden, we can change it without compatibility problem.
For example, we can use GMP.
The patch moves struct RRational and related macros to internal.h.
It also provides two accessors, rb_rational_num and rb_rational_den and
changes ext/bigdecimal/bigdecimal.c and ext/date/date_core.c to
use these accessors.
How do you think, tadf?
Updated by akr (Akira Tanaka) almost 7 years ago
- Status changed from Assigned to Closed
- % Done changed from 0 to 100
Applied in changeset r45976.
include/ruby/ruby.h: Hide Rational internal.
(RRational): Moved to internal.h
(RRATIONAL_SET_NUM): Moved to rational.c.
rational.c (rb_rational_num): New function.
include/ruby/intern.h (rb_rational_num): Declared.
ext/bigdecimal/bigdecimal.c: Follow the above change.
[ruby-core:60665] [Feature #9513]