From 99d7ad56d954fff40b68066cca666f4486e0b3aa Mon Sep 17 00:00:00 2001 From: Robby Findler Date: Mon, 21 Dec 2015 09:35:39 -0600 Subject: [PATCH] clean up exports of racket/contract/combinator It used to have a (provide (except-out (all-from-out ) ...)) and various private functions leaked to the outside over the years. None of the ones removed in this commit were documented, so hopefully they weren't being used. But this is definitely not backwards compatible, so this commit is mostly about testing the waters --- racket/collects/racket/async-channel.rkt | 4 +- .../collects/racket/contract/combinator.rkt | 116 +++++++++++++----- .../collects/racket/private/class-c-old.rkt | 6 +- racket/collects/racket/stream.rkt | 4 +- 4 files changed, 94 insertions(+), 36 deletions(-) diff --git a/racket/collects/racket/async-channel.rkt b/racket/collects/racket/async-channel.rkt index 5c8b419d34..3216a69043 100644 --- a/racket/collects/racket/async-channel.rkt +++ b/racket/collects/racket/async-channel.rkt @@ -245,7 +245,7 @@ (struct base-async-channel/c (content)) (struct chaperone-async-channel/c base-async-channel/c () - #:property prop:custom-write custom-write-property-proc + #:property prop:custom-write contract-custom-write-property-proc #:property prop:chaperone-contract (build-chaperone-contract-property #:name async-channel/c-name @@ -255,7 +255,7 @@ #:projection (ho-projection chaperone-async-channel))) (struct impersonator-async-channel/c base-async-channel/c () - #:property prop:custom-write custom-write-property-proc + #:property prop:custom-write contract-custom-write-property-proc #:property prop:contract (build-contract-property #:name async-channel/c-name diff --git a/racket/collects/racket/contract/combinator.rkt b/racket/collects/racket/contract/combinator.rkt index 5072060024..4d7e43f5be 100644 --- a/racket/collects/racket/contract/combinator.rkt +++ b/racket/collects/racket/contract/combinator.rkt @@ -4,34 +4,93 @@ "private/guts.rkt" "private/blame.rkt") -(provide - (except-out (all-from-out "private/prop.rkt") - contract-struct-name - contract-struct-first-order - contract-struct-projection - contract-struct-val-first-projection - contract-struct-stronger? - contract-struct? - chaperone-contract-struct? - flat-contract-struct? - make-chaperone-contract - make-flat-contract - build-chaperone-contract-property - build-flat-contract-property) - - (except-out (all-from-out "private/guts.rkt") - check-flat-contract - check-flat-named-contract - make-predicate-contract - has-contract? - value-contract) - - (except-out (all-from-out "private/blame.rkt") make-blame) - (rename-out [-make-chaperone-contract make-chaperone-contract] - [-make-flat-contract make-flat-contract] - [-build-chaperone-contract-property build-chaperone-contract-property] - [-build-flat-contract-property build-flat-contract-property]) - skip-projection-wrapper?) +(provide prop:contract + prop:flat-contract + prop:chaperone-contract + + contract-property? + build-contract-property + + chaperone-contract-property? + + flat-contract-property? + + make-contract + + prop:opt-chaperone-contract + prop:opt-chaperone-contract? + prop:opt-chaperone-contract-get-test + + prop:orc-contract + prop:orc-contract? + prop:orc-contract-get-subcontracts + + prop:recursive-contract + prop:recursive-contract? + prop:recursive-contract-unroll + + prop:arrow-contract + prop:arrow-contract? + prop:arrow-contract-get-info + + coerce-contract + coerce-contracts + coerce-flat-contract + coerce-flat-contracts + coerce-chaperone-contract + coerce-chaperone-contracts + coerce-contract/f + + build-compound-type-name + + contract-stronger? + list-contract? + + contract-first-order + contract-first-order-passes? + + prop:contracted prop:blame + impersonator-prop:contracted impersonator-prop:blame + has-blame? value-blame + + ;; helpers for adding properties that check syntax uses + define/final-prop + define/subexpression-pos-prop + define/subexpression-pos-prop/name + + contract-continuation-mark-key + + (struct-out wrapped-extra-arg-arrow) + + blame? + blame-source + blame-positive + blame-negative + blame-contract + blame-value + blame-original? + blame-swapped? + blame-swap + blame-replace-negative ;; used for indy blame + blame-update ;; used for option contract transfers + blame-add-context + blame-add-unknown-context + blame-context + blame-add-missing-party + blame-missing-party? + raise-blame-error + current-blame-format + (struct-out exn:fail:contract:blame) + + (rename-out [custom-write-property-proc contract-custom-write-property-proc]) + + (rename-out [-make-chaperone-contract make-chaperone-contract] + [-make-flat-contract make-flat-contract] + [-build-chaperone-contract-property build-chaperone-contract-property] + [-build-flat-contract-property build-flat-contract-property]) + skip-projection-wrapper? + + blame-fmt->-string) (define skip-projection-wrapper? (make-parameter #f)) @@ -199,4 +258,3 @@ (λ (x) (x-acceptor x) x)))) - diff --git a/racket/collects/racket/private/class-c-old.rkt b/racket/collects/racket/private/class-c-old.rkt index 22e31cf62d..def3f5412e 100644 --- a/racket/collects/racket/private/class-c-old.rkt +++ b/racket/collects/racket/private/class-c-old.rkt @@ -947,7 +947,7 @@ absents absent-fields internal opaque? name) #:omit-define-syntaxes - #:property prop:custom-write custom-write-property-proc + #:property prop:custom-write contract-custom-write-property-proc #:property prop:contract (build-contract-property #:late-neg-projection class/c-late-neg-proj @@ -1382,7 +1382,7 @@ (base-instanceof/c-class-ctc that)))) (define-struct base-instanceof/c (class-ctc) - #:property prop:custom-write custom-write-property-proc + #:property prop:custom-write contract-custom-write-property-proc #:property prop:contract (build-contract-property #:late-neg-projection instanceof/c-late-neg-proj @@ -1484,7 +1484,7 @@ (contract-stronger? this-ctc that-ctc)))))) (define-struct base-object/c (methods method-contracts fields field-contracts) - #:property prop:custom-write custom-write-property-proc + #:property prop:custom-write contract-custom-write-property-proc #:property prop:contract (build-contract-property #:late-neg-projection instanceof/c-late-neg-proj diff --git a/racket/collects/racket/stream.rkt b/racket/collects/racket/stream.rkt index 18d0b17bf7..a34edf6071 100644 --- a/racket/collects/racket/stream.rkt +++ b/racket/collects/racket/stream.rkt @@ -272,7 +272,7 @@ (struct base-stream/c (content)) (struct chaperone-stream/c base-stream/c () - #:property prop:custom-write custom-write-property-proc + #:property prop:custom-write contract-custom-write-property-proc #:property prop:chaperone-contract (build-chaperone-contract-property #:name stream/c-name @@ -281,7 +281,7 @@ #:projection (ho-projection chaperone-stream))) (struct impersonator-stream/c base-stream/c () - #:property prop:custom-write custom-write-property-proc + #:property prop:custom-write contract-custom-write-property-proc #:property prop:contract (build-contract-property #:name stream/c-name