Renamed has-*-scopes?

This commit is contained in:
Georges Dupéron 2017-01-29 20:05:21 +01:00
parent c76663a689
commit 7c365a217c
2 changed files with 6 additions and 6 deletions

View File

@ -21,8 +21,8 @@
intdef-scope? intdef-scope?
local-scope? local-scope?
top-scope? top-scope?
has-all-scopes? all-scopes-in?
has-any-scope?) any-scope-in?)
(define scopes/c (define scopes/c
(->* (syntax?) ([or/c 'add 'remove 'flip]) syntax?)) (->* (syntax?) ([or/c 'add 'remove 'flip]) syntax?))
@ -116,10 +116,10 @@
(-> (and/c (or/c syntax? scopes/c) single-scope?) boolean?) (-> (and/c (or/c syntax? scopes/c) single-scope?) boolean?)
(eq? (scope-kind sc) 'top)) (eq? (scope-kind sc) 'top))
(define/contract (has-all-scopes? sc1 sc2) (define/contract (all-scopes-in? sc1 sc2)
(-> (or/c syntax? scopes/c) (or/c syntax? scopes/c) boolean?) (-> (or/c syntax? scopes/c) (or/c syntax? scopes/c) boolean?)
(zero-scopes? (scopes-remove sc2 sc1))) (zero-scopes? (scopes-remove sc2 sc1)))
(define/contract (has-any-scope? sc1 sc2) (define/contract (any-scope-in? sc1 sc2)
(-> (or/c syntax? scopes/c) (or/c syntax? scopes/c) boolean?) (-> (or/c syntax? scopes/c) (or/c syntax? scopes/c) boolean?)
(not (zero-scopes? (scopes-intersect sc1 sc2)))) (not (zero-scopes? (scopes-intersect sc1 sc2))))

View File

@ -106,12 +106,12 @@
@defproc[(top-scope? [sc (and/c (or/c syntax? scopes/c) single-scope?)]) @defproc[(top-scope? [sc (and/c (or/c syntax? scopes/c) single-scope?)])
boolean?]{A shorthand for @racket[(eq? (scope-kind sc) 'top)]} boolean?]{A shorthand for @racket[(eq? (scope-kind sc) 'top)]}
@defproc[(has-all-scopes? [sc1 (or/c syntax? scopes/c)] @defproc[(all-scopes-in? [sc1 (or/c syntax? scopes/c)]
[sc2 (or/c syntax? scopes/c)]) boolean?]{ [sc2 (or/c syntax? scopes/c)]) boolean?]{
Predicate which returns @racket[#true] iff all the scopes contained within the Predicate which returns @racket[#true] iff all the scopes contained within the
set of scopes @racket[sc1] are present in the set of scopes @racket[sc2].} set of scopes @racket[sc1] are present in the set of scopes @racket[sc2].}
@defproc[(has-any-scope? [sc1 (or/c syntax? scopes/c)] @defproc[(any-scope-in? [sc1 (or/c syntax? scopes/c)]
[sc2 (or/c syntax? scopes/c)]) boolean?]{ [sc2 (or/c syntax? scopes/c)]) boolean?]{
Predicate which returns @racket[#true] iff any of the scopes contained within Predicate which returns @racket[#true] iff any of the scopes contained within
the set of scopes @racket[sc1] are present in the set of scopes @racket[sc2].} the set of scopes @racket[sc1] are present in the set of scopes @racket[sc2].}