From 7c365a217c3d31a26c9a8eee754f9f95ecc51dde Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Georges=20Dup=C3=A9ron?= Date: Sun, 29 Jan 2017 20:05:21 +0100 Subject: [PATCH] Renamed has-*-scopes? --- main.rkt | 8 ++++---- scribblings/scope-operations.scrbl | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/main.rkt b/main.rkt index 196c4c0..2c335a8 100644 --- a/main.rkt +++ b/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)))) diff --git a/scribblings/scope-operations.scrbl b/scribblings/scope-operations.scrbl index d59f522..c95fda2 100644 --- a/scribblings/scope-operations.scrbl +++ b/scribblings/scope-operations.scrbl @@ -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].} \ No newline at end of file