From 1adad3382e607bd91a47d6411d6f23095c4c7234 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Fri, 25 Sep 2015 07:18:34 -0700 Subject: Fix two bugs in ifa macro. * share/txr/stdlib/ifa.tl (ifa): Misplaced parentheses in mapcar call were causing the lists of before and after temporary variables to come up empty, resulting in a misexpansion (in the case when the it-argument is a place). Also, before and after temporaries swapped in the expansion: afters were inserted before the it-argument and vice-versa. --- share/txr/stdlib/ifa.tl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'share') diff --git a/share/txr/stdlib/ifa.tl b/share/txr/stdlib/ifa.tl index c6a9abd2..aa406bbd 100644 --- a/share/txr/stdlib/ifa.tl +++ b/share/txr/stdlib/ifa.tl @@ -50,12 +50,12 @@ (is-place (place-form-p it-form e))) (let ((before-it [args 0..pos-candidate]) (after-it [args (succ pos-candidate)..:])) - (let* ((btemps (mapcar (ret (gensym) before-it))) - (atemps (mapcar (ret (gensym) after-it)))) + (let* ((btemps (mapcar (ret (gensym)) before-it)) + (atemps (mapcar (ret (gensym)) after-it))) ^(let (,*(zip btemps before-it)) (placelet ((it ,it-form)) (let (,*(zip atemps after-it)) - (if (,sym ,*atemps it ,*btemps) + (if (,sym ,*btemps it ,*atemps) ,then ,else)))))) (let* ((temps (mapcar (ret (gensym)) args)) (it-temp [temps pos-candidate])) -- cgit v1.2.3