Lexical jumps
This commit is contained in:
+5
-16
@@ -141,22 +141,11 @@ DEFUN(nth, "nth", (LispVal * n, LispVal *list), "(n list)", "") {
|
||||
return nth(XFIXNUM(n), list);
|
||||
}
|
||||
|
||||
DEFUN(member, "member", (LispVal * elt, LispVal *list, LispVal *pred),
|
||||
"(elt list &optional pred)", "") {
|
||||
if (NILP(pred) || pred == Qeq) {
|
||||
// fast case
|
||||
DOTAILS(rest, list) {
|
||||
CHECK_LISTP(rest);
|
||||
if (elt == XCAR(rest)) {
|
||||
return rest;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
DOTAILS(rest, list) {
|
||||
CHECK_LISTP(rest);
|
||||
if (!NILP(CALL(pred, elt, XCAR(rest)))) {
|
||||
return rest;
|
||||
}
|
||||
DEFUN(memq, "memq", (LispVal * elt, LispVal *list), "(elt list)", "") {
|
||||
DOTAILS(rest, list) {
|
||||
CHECK_LISTP(rest);
|
||||
if (elt == XCAR(rest)) {
|
||||
return rest;
|
||||
}
|
||||
}
|
||||
return Qnil;
|
||||
|
||||
Reference in New Issue
Block a user