diff options
Diffstat (limited to 'module/language/tree-il/primitives.scm')
-rw-r--r-- | module/language/tree-il/primitives.scm | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/module/language/tree-il/primitives.scm b/module/language/tree-il/primitives.scm index 98633f07a..8d9376042 100644 --- a/module/language/tree-il/primitives.scm +++ b/module/language/tree-il/primitives.scm @@ -210,11 +210,15 @@ (let ((y (const-exp y))) (and (number? y) (exact? y) (= y 1)))) (1+ x) - (if (and (const? x) - (let ((x (const-exp x))) - (and (number? y) (exact? x) (= x 1)))) - (1+ y) - (+ x y))) + (if (and (const? y) + (let ((y (const-exp y))) + (and (number? y) (exact? y) (= y -1)))) + (1- x) + (if (and (const? x) + (let ((x (const-exp x))) + (and (number? y) (exact? x) (= x 1)))) + (1+ y) + (+ x y)))) (x y z . rest) (+ x (+ y z . rest))) (define-primitive-expander * |