mirror of
https://gitlab.com/embeddable-common-lisp/ecl.git
synced 2026-01-18 23:32:17 -08:00
New function ecl_delete_eq
This commit is contained in:
parent
5fcd784bb9
commit
c2935cbb4f
2 changed files with 17 additions and 0 deletions
16
src/c/list.d
16
src/c/list.d
|
|
@ -1053,6 +1053,22 @@ ecl_remove_eq(cl_object x, cl_object l)
|
|||
return head;
|
||||
}
|
||||
|
||||
cl_object
|
||||
ecl_delete_eq(cl_object x, cl_object l)
|
||||
{
|
||||
cl_object head = l;
|
||||
cl_object *p = &head;
|
||||
while (!ECL_ATOM(l)) {
|
||||
if (ECL_CONS_CAR(l) == x) {
|
||||
*p = l = ECL_CONS_CDR(l);
|
||||
} else {
|
||||
p = &ECL_CONS_CDR(l);
|
||||
l = *p;
|
||||
}
|
||||
}
|
||||
return head;
|
||||
}
|
||||
|
||||
/* Added for use by the compiler, instead of open coding them. Beppe */
|
||||
cl_object
|
||||
ecl_assq(cl_object x, cl_object l)
|
||||
|
|
|
|||
|
|
@ -917,6 +917,7 @@ extern ECL_API cl_object ecl_assql(cl_object x, cl_object l);
|
|||
extern ECL_API cl_object ecl_assoc(cl_object x, cl_object l);
|
||||
extern ECL_API cl_object ecl_assqlp(cl_object x, cl_object l);
|
||||
extern ECL_API cl_object ecl_remove_eq(cl_object x, cl_object l);
|
||||
extern ECL_API cl_object ecl_delete_eq(cl_object x, cl_object l);
|
||||
#define si_cons_car cl_car
|
||||
#define si_cons_cdr cl_cdr
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue