From 63210828752c680a07eb724d59b086d5c32b23c3 Mon Sep 17 00:00:00 2001 From: Eli Barzilay Date: Wed, 14 Sep 2011 16:53:45 -0400 Subject: [PATCH] Some selective `#:when (not ...)' -> `#:unless ...'. original commit: 623c7493ed2bbf7c89caea877a7b94a5f4c42c73 --- collects/typed-racket/env/type-env-structs.rkt | 4 ++-- collects/typed-racket/optimizer/float.rkt | 2 +- collects/typed-racket/typecheck/tc-app.rkt | 2 +- collects/typed-racket/types/filter-ops.rkt | 7 +++---- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/collects/typed-racket/env/type-env-structs.rkt b/collects/typed-racket/env/type-env-structs.rkt index 30c6b048..2b346992 100644 --- a/collects/typed-racket/env/type-env-structs.rkt +++ b/collects/typed-racket/env/type-env-structs.rkt @@ -41,8 +41,8 @@ [(env l) (mk-env e (for/fold ([h l]) - ([(k v) (in-dict l)] - #:when (not (f (cons k v)))) + ([(k v) (in-dict l)] + #:unless (f (cons k v))) (dict-remove h k)))])) (r:define/cond-contract (make-empty-env dict) diff --git a/collects/typed-racket/optimizer/float.rkt b/collects/typed-racket/optimizer/float.rkt index 66022808..ed663f7e 100644 --- a/collects/typed-racket/optimizer/float.rkt +++ b/collects/typed-racket/optimizer/float.rkt @@ -116,7 +116,7 @@ (log-float-real-missed-opt this-syntax (for/list ([x (in-list (syntax->list #'(f1 f2 fs ...)))] - #:when (not (subtypeof? x -Flonum))) + #:unless (subtypeof? x -Flonum)) x))) ;; If an optimization was expected (whether it was safe or not doesn't matter), ;; report subexpressions doing expensive exact arithmetic (Exact-Rational and diff --git a/collects/typed-racket/typecheck/tc-app.rkt b/collects/typed-racket/typecheck/tc-app.rkt index 7f6744a9..b93a451d 100644 --- a/collects/typed-racket/typecheck/tc-app.rkt +++ b/collects/typed-racket/typecheck/tc-app.rkt @@ -177,7 +177,7 @@ [pt (in-list pos-tys)]) (tc-expr/check pa (ret pt))) (for ([n names] - #:when (not (memq n tnames))) + #:unless (memq n tnames)) (tc-error/delayed "unknown named argument ~a for class\nlegal named arguments are ~a" n (stringify tnames))) diff --git a/collects/typed-racket/types/filter-ops.rkt b/collects/typed-racket/types/filter-ops.rkt index eaaa9ef0..682315a2 100644 --- a/collects/typed-racket/types/filter-ops.rkt +++ b/collects/typed-racket/types/filter-ops.rkt @@ -163,10 +163,9 @@ (let-values ([(atomic not-atomic) (partition atomic-filter? result)]) (define not-atomic* (for/list ([p (in-list not-atomic)] - #:when - (not (for/or ([a (in-list atomic)]) - (implied-atomic? p a)))) - p)) + #:unless (for/or ([a (in-list atomic)]) + (implied-atomic? p a))) + p)) ;; `compact' takes care of implications between atomic props (apply mk (compact (append not-atomic* atomic) #f)))]) (match (car fs)