1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-20 11:40:18 +02:00

* alist.c (scm_assq_remove_x, scm_assv_remove_x,

scm_assoc_remove_x): Remove all cells whose key is eq, eqv, or
equal (respectively) to the argument key, not all cells that are
eq, eqv, or equal to the first cell with the argument key.  Thanks
to Neil Jerram!
This commit is contained in:
Marius Vollmer 2000-07-23 11:50:05 +00:00
parent ff0fd4e408
commit 5d25385266

View file

@ -331,19 +331,19 @@ SCM_DEFINE (scm_assq_remove_x, "assq-remove!", 2, 0, 0,
(SCM alist, SCM key),
"@deffnx primitive assv-remove! alist key\n"
"@deffnx primitive assoc-remove! alist key\n"
"Delete any entry in @var{alist} associated with @var{key}, and return\n"
"Delete all entries in @var{alist} associated with @var{key}, and return\n"
"the resulting alist.")
#define FUNC_NAME s_scm_assq_remove_x
{
SCM handle;
handle = scm_sloppy_assq (key, alist);
if (SCM_CONSP (handle))
while (SCM_CONSP (handle))
{
return scm_delq_x (handle, alist);
alist = scm_delq_x (handle, alist);
handle = scm_sloppy_assq (key, alist);
}
else
return alist;
return alist;
}
#undef FUNC_NAME
@ -356,12 +356,12 @@ SCM_DEFINE (scm_assv_remove_x, "assv-remove!", 2, 0, 0,
SCM handle;
handle = scm_sloppy_assv (key, alist);
if (SCM_CONSP (handle))
while (SCM_CONSP (handle))
{
return scm_delv_x (handle, alist);
alist = scm_delq_x (handle, alist);
handle = scm_sloppy_assv (key, alist);
}
else
return alist;
return alist;
}
#undef FUNC_NAME
@ -374,12 +374,12 @@ SCM_DEFINE (scm_assoc_remove_x, "assoc-remove!", 2, 0, 0,
SCM handle;
handle = scm_sloppy_assoc (key, alist);
if (SCM_CONSP (handle))
while (SCM_CONSP (handle))
{
return scm_delete_x (handle, alist);
alist = scm_delq_x (handle, alist);
handle = scm_sloppy_assoc (key, alist);
}
else
return alist;
return alist;
}
#undef FUNC_NAME