summaryrefslogtreecommitdiff
path: root/libguile/gc-mark.c
diff options
context:
space:
mode:
authorMarius Vollmer <mvo@zagadka.de>2003-11-18 19:59:53 +0000
committerMarius Vollmer <mvo@zagadka.de>2003-11-18 19:59:53 +0000
commitf92e85f7352174c9fe0ac0e67e6c38cfce923300 (patch)
treebc52293ad0d0d1770d35bd58a118744a80e86957 /libguile/gc-mark.c
parent9dd9857f77451a706052cae009d2fe7150373c5a (diff)
downloadguile-f92e85f7352174c9fe0ac0e67e6c38cfce923300.tar.gz
* print.c (scm_iprin1): Handle fractions.
* objects.h (scm_class_fraction): New. * objects.c (scm_class_fraction): New. (scm_class_of): Handle fractions. * hash.c (scm_hasher): Handle fractions. * numbers.c: New code for handling fraction all over the place. (scm_odd_p, scm_even_p): Handle inexact integers. (scm_rational_p): New function, same as scm_real_p. (scm_round_number, scm_truncate_number, scm_ceiling, scm_floor): New exact functions that replace the inexact 'dsubr' implementations. (scm_numerator, scm_denominator): New. * numbers.h (SCM_NUMP): Recognize fractions. (SCM_FRACTIONP, SCM_SLOPPY_FRACTIONP, SCM_FRACTION_NUMERATOR, SCM_FRACTION_DENOMINATOR, SCM_FRACTION_SET_NUMERATOR, SCM_FRACTION_SET_DENOMINATOR, SCM_FRACTION_REDUCED_BIT, SCM_FRACTION_REDUCED_SET, SCM_FRACTION_REDUCED_CLEAR, SCM_FRACTION_REDUCED): New. (scm_floor, scm_ceiling, scm_truncate_number, scm_round_number): New prototypes. (scm_make_ratio, scm_rationalize, scm_numerator, scm_denominator, scm_rational_p): New prototypes. (scm_i_dbl2num, scm_i_fraction2double, scm_i_fraction_equalp, scm_i_print_fraction): New prototypes. * goops.c (create_standard_classes): Create "<fraction>" class. * gc-mark.c (scm_gc_mark_dependencies): Handle fractions. * gc-card.c (scm_i_sweep_card): Include scm_tc16_fraction as a case in the switch, but do nothing for now. * eval.c (SCM_CEVAL, SCM_APPLY, call_dsubr_1): Convert fractions to doubles when calling 'dsubr' functions. * eq.c (scm_eqv_p, scm_equal_p): Handle fractions.
Diffstat (limited to 'libguile/gc-mark.c')
-rw-r--r--libguile/gc-mark.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libguile/gc-mark.c b/libguile/gc-mark.c
index 994d3aa88..10f1522e0 100644
--- a/libguile/gc-mark.c
+++ b/libguile/gc-mark.c
@@ -281,6 +281,12 @@ scm_gc_mark_dependencies (SCM p)
break;
case scm_tc7_number:
+ if (SCM_TYP16 (ptr) == scm_tc16_fraction)
+ {
+ scm_gc_mark (SCM_CELL_OBJECT_1 (ptr));
+ ptr = SCM_CELL_OBJECT_2 (ptr);
+ goto gc_mark_loop;
+ }
break;
case scm_tc7_wvect: