Skip to content

Commit a339686

Browse files
committed
Revert assoc :key behavior for backward compatibility (euslisp#436 and euslisp#450)
1 parent 3fb35ee commit a339686

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Diff for: lisp/c/lists.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,8 @@ register pointer argv[];
334334
if (islist(target)) { /*ignore non-pair elements*/
335335
if (rassoc==NIL) temp=ccar(target);
336336
else temp=ccdr(target);
337-
if (key!=NIL) temp=call1(ctx,key,temp);
337+
if (key==NIL) temp=ccar(target);
338+
else temp=call1(ctx,key,target);
338339
if (ifnottest!=NIL) compare=(call1(ctx,ifnottest,temp)==NIL);
339340
else if (iftest!=NIL) compare=(call1(ctx,iftest,temp)!=NIL);
340341
else if (testnot!=NIL) compare=(call2(ctx,testnot,item,temp)==NIL);

0 commit comments

Comments
 (0)