diff options
author | Andy Wingo <wingo@pobox.com> | 2018-05-08 11:49:46 +0200 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2018-05-08 11:49:46 +0200 |
commit | 41bc98985f39ed512594402cf150cebaff498656 (patch) | |
tree | dcc784d9ec9808e037c39c5f3e5ff9adb0db919e /libguile/eq.c | |
parent | 84cb7c45fdc6b310eff854ae0d1852dcbc9a4d60 (diff) | |
download | guile-41bc98985f39ed512594402cf150cebaff498656.tar.gz |
VM calls out to heap-numbers-equal? through intrinsics
* libguile/numbers.h:
* libguile/eq.c (scm_i_heap_numbers_equal_p): Change to return boolean
directly instead of tagged Scheme value.
(scm_eqv_p): Adapt caller of scm_i_heap_numbers_equal_p.
* libguile/intrinsics.c (scm_bootstrap_intrinsics):
* libguile/intrinsics.h (SCM_FOR_ALL_VM_INTRINSICS): Declare
heap-numbers-equal? intrinsic.
* libguile/vm-engine.c (heap-numbers-equal?): Call out through the
intrinsics table.
Diffstat (limited to 'libguile/eq.c')
-rw-r--r-- | libguile/eq.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/libguile/eq.c b/libguile/eq.c index daee4c02e..f1153f2cc 100644 --- a/libguile/eq.c +++ b/libguile/eq.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1995-1998,2000-2001,2003-2004,2006,2009-2011,2017 Free Software Foundation, Inc. +/* Copyright (C) 1995-1998,2000-2001,2003-2004,2006,2009-2011,2017,2018 Free Software Foundation, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License @@ -156,20 +156,20 @@ scm_i_fraction_equalp (SCM x, SCM y) SCM_FRACTION_DENOMINATOR (y)))); } -SCM +int scm_i_heap_numbers_equal_p (SCM x, SCM y) { if (SCM_IMP (x)) abort(); switch (SCM_TYP16 (x)) { case scm_tc16_big: - return scm_bigequal (x, y); + return scm_is_true (scm_bigequal (x, y)); case scm_tc16_real: - return scm_real_equalp (x, y); + return scm_is_true (scm_real_equalp (x, y)); case scm_tc16_complex: - return scm_complex_equalp (x, y); + return scm_is_true (scm_complex_equalp (x, y)); case scm_tc16_fraction: - return scm_i_fraction_equalp (x, y); + return scm_is_true (scm_i_fraction_equalp (x, y)); default: abort (); } @@ -229,7 +229,7 @@ SCM scm_eqv_p (SCM x, SCM y) default: break; case scm_tc7_number: - return scm_i_heap_numbers_equal_p (x, y); + return scm_from_bool (scm_i_heap_numbers_equal_p (x, y)); } return SCM_BOOL_F; } |