diff --git a/collects/mzlib/scribblings/common.rkt b/collects/mzlib/scribblings/common.rkt index de100022c5..713a2f17c2 100644 --- a/collects/mzlib/scribblings/common.rkt +++ b/collects/mzlib/scribblings/common.rkt @@ -12,10 +12,13 @@ (define-syntax (mzlib stx) (syntax-case stx () - [(_ #:mode section name) + [(_ #:mode section name #:use-sources (src ...)) (with-syntax ([lib (string->symbol (format "mzlib/~a" (syntax-e #'name)))]) #'(begin (section #:style 'hidden (racket lib)) - (defmodule lib)))] - [(_ name) #'(mzlib #:mode section name)])) + (defmodule lib #:use-sources (src ...))))] + [(_ #:mode section name) + #'(mzlib #:mode section name #:use-sources ())] + [(_ name) + #'(mzlib #:mode section name #:use-sources ())])) diff --git a/collects/mzlib/scribblings/unit.scrbl b/collects/mzlib/scribblings/unit.scrbl index 20a5221a27..ce5afd608b 100644 --- a/collects/mzlib/scribblings/unit.scrbl +++ b/collects/mzlib/scribblings/unit.scrbl @@ -5,7 +5,7 @@ @(begin (define-syntax-rule (bind id) (begin - (require (for-label racket/unit)) + (require (for-label racket/base)) (define id (racket struct)))) (bind racket-struct) (define-syntax-rule (bindc id) @@ -14,7 +14,7 @@ (define id (racket struct/ctc)))) (bindc racket-struct/ctc)) -@mzlib[#:mode title unit] +@mzlib[#:mode title unit #:use-sources ((submod racket/unit compat))] @deprecated[@racketmodname[racket/unit]]{} @@ -28,8 +28,8 @@ The @racketmodname[mzlib/unit] library mostly re-provides -setters -constructor])]{ -A signature form like @racket-struct from @racketmodname[racket/unit], -but with a different syntax for the options that limit exports.} +A signature form like @racket-struct from @racketmodname[racket/base], +but with a different syntax for options that limit exports.} @defform/subs[(struct/ctc id ([field-id contract-expr] ...) omit-decl ...) ([omit-decl -type @@ -40,18 +40,18 @@ but with a different syntax for the options that limit exports.} A signature form like @racket-struct/ctc from @racketmodname[racket/unit], but with a different syntax for the options that limit exports.} -@deftogether[( -@defidform[struct~s] -@defidform[struct~s/ctc] -)]{ - -The same as @|racket-struct| and @|racket-struct/ctc| from -@racketmodname[racket/unit].} - @deftogether[( @defidform[struct~r] @defidform[struct~r/ctc] )]{ -Like @racket[struct~s] and @racket[struct~s/ctc], but the constructor is +The same as @|racket-struct| from @racketmodname[racket/base] and @|racket-struct/ctc| from +@racketmodname[racket/unit].} + +@deftogether[( +@defidform[struct~s] +@defidform[struct~s/ctc] +)]{ + +Like @racket[struct~r] and @racket[struct~r/ctc], but the constructor is named the same as the type, instead of with @racketidfont{make-} prefix.} diff --git a/collects/mzlib/unit.rkt b/collects/mzlib/unit.rkt index e5efa5b8e1..6079b0f64a 100644 --- a/collects/mzlib/unit.rkt +++ b/collects/mzlib/unit.rkt @@ -2,7 +2,7 @@ ;; deprecated library, see `racket/unit` -(require racket/unit +(require (except-in racket/unit struct/ctc) (submod racket/unit compat)) -(provide (except-out (all-from-out racket/unit) struct/ctc) +(provide (all-from-out racket/unit) (all-from-out (submod racket/unit compat))) diff --git a/collects/racket/unit.rkt b/collects/racket/unit.rkt index 3b8c588eef..e7c98b9a88 100644 --- a/collects/racket/unit.rkt +++ b/collects/racket/unit.rkt @@ -65,7 +65,7 @@ (module+ compat ;; export only for compatibility with `mzlib/unit` - (provide (protect-out struct)) + (provide (protect-out struct) struct/ctc) (define-signature-form (struct stx) (parameterize ((error-syntax stx)) @@ -551,7 +551,7 @@ stx)))) (module+ compat ;; export only for compatibility with `mzlib/unit` - (provide (protect-out struct~s/ctc)) + (provide (protect-out struct~s/ctc) struct~r/ctc) (define-signature-form (struct~s/ctc stx) (do-struct~/ctc stx #t))) diff --git a/collects/scheme/unit.rkt b/collects/scheme/unit.rkt index 567fcd0dbb..f0e3e8ea43 100644 --- a/collects/scheme/unit.rkt +++ b/collects/scheme/unit.rkt @@ -1,7 +1,7 @@ #lang racket/base -(require racket/unit +(require (except-in racket/unit struct/ctc) (submod racket/unit compat)) -(provide (except-out (all-from-out racket/unit) struct/ctc) +(provide (all-from-out racket/unit) (rename-out [struct~s struct] [struct~s/ctc struct/ctc])) diff --git a/collects/scribblings/scheme/scheme.scrbl b/collects/scribblings/scheme/scheme.scrbl index 59a8de5b42..97d756dcd9 100644 --- a/collects/scribblings/scheme/scheme.scrbl +++ b/collects/scribblings/scheme/scheme.scrbl @@ -6,11 +6,14 @@ (only-in scheme/class printable<%>) (only-in racket/class writable<%>) (only-in racket/base struct hash hasheq hasheqv in-directory local-require) + (only-in racket/unit struct/ctc) (only-in scheme/gui/base make-gui-namespace make-gui-empty-namespace) + (only-in mzlib/unit struct~s struct~s/ctc) scheme/gui/base scheme/sandbox)) @(define-syntax-rule (def-extras unit-struct + unit-struct/ctc make-base-namespace-id make-base-empty-namespace-id sandbox-namespace-specs-id @@ -19,12 +22,13 @@ pretty-print-id printable<%>-id) (begin - (require (for-label (only-in scheme struct) + (require (for-label (only-in scheme struct struct/ctc) (only-in racket/base make-base-namespace make-base-empty-namespace) (only-in racket/pretty pretty-print) racket/sandbox)) (define unit-struct (racket struct)) + (define unit-struct/ctc (racket struct/ctc)) (define make-base-namespace-id (racket make-base-namespace)) (define make-base-empty-namespace-id (racket make-base-empty-namespace)) (define sandbox-namespace-specs-id (racket sandbox-namespace-specs)) @@ -33,6 +37,7 @@ (define pretty-print-id (racket pretty-print)) (define printable<%>-id (racket printable<%>)))) @(def-extras unit-struct + unit-struct/ctc make-base-namespace-id make-base-empty-namespace-id sandbox-namespace-specs-id @@ -58,7 +63,7 @@ old name. A few @seclink["compat-exe"]{old executables} are also provided. @table-of-contents[] @compat-except[scheme racket]{, except based on @racketmodname[scheme/base] -instead of @racketmodname[racket/base], the @|unit-struct| from +instead of @racketmodname[racket/base], the @|unit-struct| and @|unit-struct/ctc| from @racketmodname[scheme/unit] is exported, @racketmodname[scheme/set] is not re-exported, @racketmodname[scheme/system] is not re-exported, @racket[pretty-print] is re-directed in as @@ -336,7 +341,13 @@ and @|make-module-evaluator-id| from @racketmodname[racket/sandbox].} @; @compat[scheme/trace racket/trace] @compat[scheme/trait racket/trait] @compat[scheme/udp racket/udp] -@compat[scheme/unit racket/unit] + +@compat-except[scheme/unit racket/unit]{, except that @|unit-struct| +and @|unit-struct/ctc| are @racket[struct~s] and +@racket[struct~s/ctc] from @racketmodname[mzlib/unit] instead of +@racket[struct] from @racket[racket/base] and @racket[struct/ctc] from +@racketmodname[racket/unit]} + @compat[scheme/unit-exptime racket/unit-exptime] @compat[scheme/unsafe/ops racket/unsafe/ops] @compat[scheme/vector racket/vector]