Renamed has-*-scopes?
This commit is contained in:
parent
c76663a689
commit
7c365a217c
8
main.rkt
8
main.rkt
|
@ -21,8 +21,8 @@
|
|||
intdef-scope?
|
||||
local-scope?
|
||||
top-scope?
|
||||
has-all-scopes?
|
||||
has-any-scope?)
|
||||
all-scopes-in?
|
||||
any-scope-in?)
|
||||
|
||||
(define scopes/c
|
||||
(->* (syntax?) ([or/c 'add 'remove 'flip]) syntax?))
|
||||
|
@ -116,10 +116,10 @@
|
|||
(-> (and/c (or/c syntax? scopes/c) single-scope?) boolean?)
|
||||
(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?)
|
||||
(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?)
|
||||
(not (zero-scopes? (scopes-intersect sc1 sc2))))
|
||||
|
|
|
@ -106,12 +106,12 @@
|
|||
@defproc[(top-scope? [sc (and/c (or/c syntax? scopes/c) single-scope?)])
|
||||
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?]{
|
||||
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].}
|
||||
|
||||
@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?]{
|
||||
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].}
|
Loading…
Reference in New Issue
Block a user