Some selective #:when (not ...)' -> #:unless ...'.

This commit is contained in:
Eli Barzilay 2011-09-14 16:53:45 -04:00
parent 55a8471838
commit 623c7493ed
14 changed files with 19 additions and 25 deletions

View File

@ -307,7 +307,7 @@
[else (error 'zo-parse "bad phase ~a body element: ~e" i sb)]))))
;; unexported:
(for/list ([l (in-list phase-data)]
#:when (not (void? (list-ref l 1))))
#:unless (void? (list-ref l 1)))
(let* ([phase (list-ref l 0)]
[indirect-syntax
;; could check: (list-ref l 2) should be size of vector:

View File

@ -122,8 +122,8 @@
(define (sub get-edges get-node get-node-time)
(for*/list ([edge (in-list (get-edges node))]
[sub (in-list (list (get-node edge)))] ; <-- hack...
#:when (not (or (eq? *-node sub) ; <-- ...for this
(memq sub hidden))))
#:unless (or (eq? *-node sub) ; <-- ...for this
(memq sub hidden)))
(define name (node-> 'sub-label sub))
(define local% (format-percent (get-node-time edge) total))
`("" "" "" "" "" "" "" ""

View File

@ -123,7 +123,7 @@
(define (vector-filter-not f v)
(one-arg-check f v 'vector-filter-not)
(list->vector (for/list ([i (in-vector v)] #:when (not (f i))) i)))
(list->vector (for/list ([i (in-vector v)] #:unless (f i)) i)))
(define (vector-count f v . vs)
(unless (and (procedure? f) (procedure-arity-includes? f (add1 (length vs))))

View File

@ -74,13 +74,8 @@
(define undocumented-exports
(for/list ([ex (in-list exports)]
#:when
(not (xref-binding->definition-tag
xref
(list what ex)
#f))
#:when
(not (skip-proc ex)))
#:unless (xref-binding->definition-tag xref (list what ex) #f)
#:unless (skip-proc ex))
ex))
(unless (null? undocumented-exports)

View File

@ -290,7 +290,7 @@
(set-info-need-run?! info #t))))
;; If any expected dependency changed, then we need a re-run:
(for ([i infos]
#:when (not (or (info-need-run? i) (not (info-build? i)))))
#:unless (or (info-need-run? i) (not (info-build? i))))
(let ([ch (ormap (lambda (i2)
(or (and (not (info? i2))
i2)

View File

@ -201,7 +201,7 @@ expressions are duplicated, and may be evaluated in different scopes.
(for ([id (in-list ids)]) (bound-id-table-set! idbm id #t))
(for/list ([(k v) (in-dict (declenv-table env))]
#:when (or (den:class? v) (den:magic-class? v) (den:parser? v))
#:when (not (bound-id-table-ref idbm k #f)))
#:unless (bound-id-table-ref idbm k #f))
k))
;; Conventions = (listof (list regexp DeclEntry))

View File

@ -932,7 +932,7 @@ END-OF-TESTS
;; split the tests
[ts (regexp-split #px"(?m:^)-+(?:$|\r?\n)" ts)])
(parameterize ([port-count-lines-enabled #t])
(for ([t ts] #:when (not (regexp-match? #px"^\\s*$" t)))
(for ([t ts] #:unless (regexp-match? #px"^\\s*$" t))
(let ([m (or (regexp-match #px"^(.*)\n\\s*(-\\S+->)\\s*\n(.*)$"
t)
(regexp-match #px"^(.*\\S)\\s+(-\\S+->)\\s+(\\S.*)$"

View File

@ -67,7 +67,7 @@
[actuals expecteds]
([actual (in-list actual-sorted)]
[expected (in-list actual-sorted)]
#:when (not (== actual expected)))
#:unless (== actual expected))
(values actual expected))])
(unless (and (null? actuals) (null? expecteds))
(with-check-info*

View File

@ -42,7 +42,7 @@
(mk-env e
(for/fold ([h l])
([(k v) (in-dict l)]
#:when (not (f (cons k v))))
#:unless (f (cons k v)))
(dict-remove h k)))]))
(r:define/cond-contract (make-empty-env dict)

View File

@ -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

View File

@ -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)))

View File

@ -163,9 +163,8 @@
(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))))
#: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)))])

View File

@ -79,7 +79,7 @@
(syntax-case stx []
[(_ def [name ...] expr)
(let* ([ids (syntax->list #'(name ...))])
(for ([bad (in-list ids)] #:when (not (identifier? bad)))
(for ([bad (in-list ids)] #:unless (identifier? bad))
(wrong-syntax bad "expected an identifier"))
(let*-values ([(bound unbound) (partition identifier-binding ids)])
(cond

View File

@ -160,7 +160,7 @@
[(_ [name ...] body ...)
(let* ([ids (syntax->list #'(name ...))])
(for ([id (in-list ids)] #:when (not (identifier? id)))
(for ([id (in-list ids)] #:unless (identifier? id))
(raise-syntax-error #f "expected an identifier" stx id))
(with-syntax ([(num ...)