From 3e3b203726e67d5135ab8611de79bcb224066665 Mon Sep 17 00:00:00 2001 From: Vincent St-Amour Date: Fri, 21 May 2010 10:59:50 -0400 Subject: [PATCH] Fixed a bug in typed Scheme's optimizer when using binary arithmetic operators in a unary fashion with floats. original commit: 762f108c04b78f14d851b6b93b5bf0c873658399 --- collects/typed-scheme/private/optimize.rkt | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/collects/typed-scheme/private/optimize.rkt b/collects/typed-scheme/private/optimize.rkt index 5542553e..ed63d737 100644 --- a/collects/typed-scheme/private/optimize.rkt +++ b/collects/typed-scheme/private/optimize.rkt @@ -60,11 +60,11 @@ (begin (log-optimization "unary float" #'op) #'(op.unsafe f.opt))) ;; unlike their safe counterparts, unsafe binary operators can only take 2 arguments - (pattern (#%plain-app op:float-binary-op f fs ...) + (pattern (#%plain-app op:float-binary-op f1 f2 fs ...) #:with opt (begin (log-optimization "binary float" #'op) - (for/fold ([o #'f.opt]) - ([e (syntax->list #'(fs.opt ...))]) + (for/fold ([o #'f1.opt]) + ([e (syntax->list #'(f2.opt fs.opt ...))]) #`(op.unsafe #,o #,e)))) (pattern (#%plain-app op:pair-unary-op p) #:with opt @@ -99,10 +99,10 @@ #:exists 'append) (current-output-port)))) (begin0 - (parameterize ([current-output-port port]) - (syntax-parse stx #:literal-sets (kernel-literals) - [e:opt-expr - (syntax/loc stx e.opt)])) + (parameterize ([current-output-port port]) + (syntax-parse stx #:literal-sets (kernel-literals) + [e:opt-expr + (syntax/loc stx e.opt)])) (if (and *log-optimizations?* *log-optimizatons-to-log-file?*) (close-output-port port)