From 13bd2d5bc9ebe7ddf2ce0db9fb9ca916cdea4b81 Mon Sep 17 00:00:00 2001 From: Guilherme Affonso Date: Fri, 16 Oct 2020 16:13:36 +0900 Subject: [PATCH] Fix assoc :key behavior --- lisp/c/lists.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lisp/c/lists.c b/lisp/c/lists.c index 0debff1bb..35e1c232c 100644 --- a/lisp/c/lists.c +++ b/lisp/c/lists.c @@ -360,8 +360,8 @@ register pointer argv[]; while (islist(alist)) { target=ccar(alist); if (islist(target)) { /*ignore non-pair elements*/ - if (key==NIL) temp=ccar(target); - else temp=call1(ctx,key,target); + temp=ccar(target); + if (key!=NIL) temp=call1(ctx,key,temp); if (testnot!=NIL) compare=(call2(ctx,testnot,item,temp)==NIL); else if (test==NIL || test==QEQ) compare=(item==temp); else if (test==QEQUAL) compare=(equal(item,temp)==T);