mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-17 01:00:20 +02:00
Define `equal?' for pointer objects.
* libguile/eq.c (scm_equal_p): Handle pointer objects. * test-suite/tests/foreign.test ("make-pointer")["equal?", "equal? modulo finalizer", "not equal?"]: New tests.
This commit is contained in:
parent
fb5c4dc523
commit
cb2d8076ef
2 changed files with 15 additions and 1 deletions
|
@ -303,6 +303,9 @@ scm_equal_p (SCM x, SCM y)
|
|||
else
|
||||
goto generic_equal;
|
||||
}
|
||||
if (SCM_POINTER_P (x) && SCM_POINTER_P (y))
|
||||
return scm_from_bool (SCM_POINTER_VALUE (x) == SCM_POINTER_VALUE (y));
|
||||
|
||||
/* This ensures that types and scm_length are the same. */
|
||||
if (SCM_CELL_TYPE (x) != SCM_CELL_TYPE (y))
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue