summaryrefslogtreecommitdiffstats
path: root/share
diff options
context:
space:
mode:
Diffstat (limited to 'share')
-rw-r--r--share/txr/stdlib/compiler.tl10
1 files changed, 6 insertions, 4 deletions
diff --git a/share/txr/stdlib/compiler.tl b/share/txr/stdlib/compiler.tl
index 8652948f..4b3ee0df 100644
--- a/share/txr/stdlib/compiler.tl
+++ b/share/txr/stdlib/compiler.tl
@@ -526,12 +526,14 @@
(defmeth compiler comp-if (me oreg env form)
(match-case (cdr form)
- (@(require ((equal @a @b) . @rest)
+ (@(require ((@(and (or equal nequal) @op) @a @b) . @rest)
(or (eql-comparable a)
(eql-comparable b)))
- (let ((cf (if (or (eq-comparable a)
- (eq-comparable b))
- 'eq 'eql)))
+ (let* ((pos (eq op 'equal))
+ (cf (if (or (eq-comparable a)
+ (eq-comparable b))
+ (if pos 'eq 'neq)
+ (if pos'eql 'neql))))
me.(compile oreg env ^(if (,cf ,a ,b) ,*rest))))
((@(constantp @test) @then @else)
me.(compile oreg env (if (eval test) then else)))