diff --git a/collects/scribblings/reference/booleans.scrbl b/collects/scribblings/reference/booleans.scrbl index a18c1905d0..25f91ae50e 100644 --- a/collects/scribblings/reference/booleans.scrbl +++ b/collects/scribblings/reference/booleans.scrbl @@ -9,7 +9,9 @@ depend on a boolean value typically treat anything other than @racket[#f] as true. The @racket[#t] value is always @racket[eq?] to itself, and @racket[#f] is always @racket[eq?] to itself. -See also: @racket[and], @racket[or], @racket[andmap], @racket[ormap]. +@see-read-print["boolean" #:print "booleans"]{booleans} + +See also @racket[and], @racket[or], @racket[andmap], and @racket[ormap]. @defproc[(boolean? [v any/c]) boolean?]{ diff --git a/collects/scribblings/reference/bytes.scrbl b/collects/scribblings/reference/bytes.scrbl index a3fae2021c..9eee201572 100644 --- a/collects/scribblings/reference/bytes.scrbl +++ b/collects/scribblings/reference/bytes.scrbl @@ -22,6 +22,8 @@ A byte string can be used as a single-valued sequence (see @secref["sequences"]). The bytes of the string serve as elements of the sequence. See also @racket[in-bytes]. +@see-read-print["string"]{byte strings} + See also: @racket[immutable?]. @; ---------------------------------------- diff --git a/collects/scribblings/reference/chars.scrbl b/collects/scribblings/reference/chars.scrbl index e4c8f211ef..0e183a9bc1 100644 --- a/collects/scribblings/reference/chars.scrbl +++ b/collects/scribblings/reference/chars.scrbl @@ -18,6 +18,8 @@ Two characters are @racket[eqv?] if they correspond to the same scalar value. For each scalar value less than 256, character values that are @racket[eqv?] are also @racket[eq?]. +@see-read-print["character"]{characters} + @; ---------------------------------------- @section{Characters and Scalar Values} diff --git a/collects/scribblings/reference/data.scrbl b/collects/scribblings/reference/data.scrbl index 966bd5633a..2f0b7884b0 100644 --- a/collects/scribblings/reference/data.scrbl +++ b/collects/scribblings/reference/data.scrbl @@ -59,6 +59,8 @@ disappear when placed into a weak box (see @secref["weakbox"]) used as the key in a weak @tech{hash table} (see @secref["hashtables"]), or used as an ephemeron key (see @secref["ephemerons"]). +@see-read-print["symbol"]{symbols} + @defproc[(symbol? [v any/c]) boolean?]{Returns @racket[#t] if @racket[v] is a symbol, @racket[#f] otherwise. @@ -141,6 +143,8 @@ Two keywords are @racket[eq?] if and only if they print the same. Like symbols, keywords are only weakly held by the internal keyword table; see @secref["symbols"] for more information. +@see-read-print["keyword"]{keywords} + @defproc[(keyword? [v any/c]) boolean?]{ Returns @racket[#t] if @racket[v] is a keyword, @racket[#f] otherwise.} @@ -178,6 +182,8 @@ for each pair of keywords is the same as using A @deftech{box} is like a single-element vector, normally used as minimal mutable storage. +A literal or printed box starts with @litchar{#&}. @see-read-print["box"]{boxes} + @defproc[(box? [v any/c]) boolean?]{ Returns @racket[#t] if @racket[v] is a box, @racket[#f] otherwise.} diff --git a/collects/scribblings/reference/hashes.scrbl b/collects/scribblings/reference/hashes.scrbl index 15c16379ee..e48e9aa399 100644 --- a/collects/scribblings/reference/hashes.scrbl +++ b/collects/scribblings/reference/hashes.scrbl @@ -80,6 +80,9 @@ keys:}} If a key in an @racket[equal?]-based hash table is mutated hash table's behavior for insertion and lookup operations becomes unpredictable. +A literal or printed hash table starts with @litchar{#hash}, +@litchar{#hasheqv}, or +@litchar{#hasheq}. @see-read-print["hashtable"]{hash tables} @defproc[(hash? [v any/c]) boolean?]{ diff --git a/collects/scribblings/reference/mz.rkt b/collects/scribblings/reference/mz.rkt index d2e6cac114..4bacbf193b 100644 --- a/collects/scribblings/reference/mz.rkt +++ b/collects/scribblings/reference/mz.rkt @@ -1,137 +1,145 @@ -(module mz racket/base - (require scribble/struct - scribble/manual - scribble/eval - scribble/decode - racket/contract - "../icons.rkt") - - (provide (all-from-out scribble/manual) - (all-from-out scribble/eval) - (all-from-out racket/contract)) - - (require (for-label racket)) - (provide (for-label (all-from-out racket))) - - (provide mz-examples) - (define mz-eval (make-base-eval)) - (define-syntax mz-examples - (syntax-rules () - [(_ #:eval . rest) - (examples #:eval . rest)] - [(_ . rest) - (examples #:eval mz-eval . rest)])) - - (define AllUnix "Unix and Mac OS X") - (provide AllUnix) - - (provide note-lib) - (define-syntax note-lib - (syntax-rules () - [(_ lib #:use-sources (src ...) . more) - (begin - (declare-exporting lib racket #:use-sources (src ...)) - (defmodule*/no-declare (lib) - (t (make-collect-element - #f null - (lambda (ci) - (collect-put! ci `(racket-extra-lib ,'lib) (racketmodname lib)))) - "The bindings documented in this section are provided by the " - (racketmodname lib) - " and " - (racketmodname racket) - " libraries, but not " (racketmodname racket/base) - "." - . more)))] - [(_ lib . more) - (note-lib lib #:use-sources () . more)])) - - (provide note-init-lib) - (define-syntax note-init-lib - (syntax-rules () - [(_ lib #:use-sources (src ...) . more) - (begin - (declare-exporting lib racket/init #:use-sources (src ...)) - (defmodule*/no-declare (lib) - (t "The bindings documented in this section are provided by the " - (racketmodname lib) - " and " - (racketmodname racket/init) - " libraries, which means that they are available when " - " the Racket executable is started with no command-line arguments." - " They are not provided by " (racketmodname racket/base) - " or " (racketmodname racket) "." - . more)))] - [(_ lib . more) - (note-init-lib lib #:use-sources () . more)])) - - (provide note-lib-only) - (define-syntax note-lib-only - (syntax-rules () - [(_ lib #:use-sources (src ...) . more) - (defmodule lib #:use-sources (src ...) +#lang at-exp racket/base + +(require scribble/struct + scribble/manual + scribble/eval + scribble/decode + racket/contract + "../icons.rkt") + +(provide (all-from-out scribble/manual) + (all-from-out scribble/eval) + (all-from-out racket/contract)) + +(require (for-label racket)) +(provide (for-label (all-from-out racket))) + +(provide mz-examples) +(define mz-eval (make-base-eval)) +(define-syntax mz-examples + (syntax-rules () + [(_ #:eval . rest) + (examples #:eval . rest)] + [(_ . rest) + (examples #:eval mz-eval . rest)])) + +(define AllUnix "Unix and Mac OS X") +(provide AllUnix) + +(provide note-lib) +(define-syntax note-lib + (syntax-rules () + [(_ lib #:use-sources (src ...) . more) + (begin + (declare-exporting lib racket #:use-sources (src ...)) + (defmodule*/no-declare (lib) + (t (make-collect-element + #f null + (lambda (ci) + (collect-put! ci `(racket-extra-lib ,'lib) (racketmodname lib)))) + "The bindings documented in this section are provided by the " + (racketmodname lib) + " and " + (racketmodname racket) + " libraries, but not " (racketmodname racket/base) + "." + . more)))] + [(_ lib . more) + (note-lib lib #:use-sources () . more)])) + +(provide note-init-lib) +(define-syntax note-init-lib + (syntax-rules () + [(_ lib #:use-sources (src ...) . more) + (begin + (declare-exporting lib racket/init #:use-sources (src ...)) + (defmodule*/no-declare (lib) (t "The bindings documented in this section are provided by the " (racketmodname lib) - " library, not " (racketmodname racket/base) - " or " (racketmodname racket) - "." - . more))] - [(_ lib . more) - (note-lib-only lib #:use-sources () . more)])) + " and " + (racketmodname racket/init) + " libraries, which means that they are available when " + " the Racket executable is started with no command-line arguments." + " They are not provided by " (racketmodname racket/base) + " or " (racketmodname racket) "." + . more)))] + [(_ lib . more) + (note-init-lib lib #:use-sources () . more)])) - (define (*exnraise s) - (make-element #f (list s " exception is raised"))) - (define-syntax exnraise - (syntax-rules () - [(_ s) (*exnraise (racket s))])) - (define-syntax Exn - (syntax-rules () - [(_ s) (racket s)])) - (provide exnraise Exn) - - (provide margin-note/ref - refalso moreref Guide guideintro guidealso guidesecref - raco-doc) - - (define (margin-note/ref . s) - (apply margin-note - (decode-content (cons magnify s)))) - - (define (refalso tag . s) - (apply margin-note - (decode-content (append (list magnify (secref tag) " also provides information on ") - s - (list "."))))) - - (define (moreref tag . s) - (apply margin-note - (decode-content (append (list magnify (secref tag) " provides more information on ") - s - (list "."))))) - - (define (guidesecref s) - (secref #:doc '(lib "scribblings/guide/guide.scrbl") s)) - - (define (guideintro tag . s) - (apply margin-note - (decode-content (append (list finger (guidesecref tag) " in " Guide " introduces ") - s - (list "."))))) +(provide note-lib-only) +(define-syntax note-lib-only + (syntax-rules () + [(_ lib #:use-sources (src ...) . more) + (defmodule lib #:use-sources (src ...) + (t "The bindings documented in this section are provided by the " + (racketmodname lib) + " library, not " (racketmodname racket/base) + " or " (racketmodname racket) + "." + . more))] + [(_ lib . more) + (note-lib-only lib #:use-sources () . more)])) - (define (guidealso tag) - (apply margin-note - (decode-content (append (list finger "See also " (guidesecref tag) " in " Guide "."))))) - - (define Guide - (other-manual '(lib "scribblings/guide/guide.scrbl"))) +(define (*exnraise s) + (make-element #f (list s " exception is raised"))) +(define-syntax exnraise + (syntax-rules () + [(_ s) (*exnraise (racket s))])) +(define-syntax Exn + (syntax-rules () + [(_ s) (racket s)])) +(provide exnraise Exn) - (define raco-doc - '(lib "scribblings/raco/raco.scrbl")) - - (provide speed) - (define-syntax speed - (syntax-rules () - [(_ id what) - (t "An " (racket id) " application can provide better performance for " - (elem what) - " iteration when it appears directly in a " (racket for) " clause.")]))) +(provide margin-note/ref + refalso moreref Guide guideintro guidealso guidesecref + raco-doc) + +(define (margin-note/ref . s) + (apply margin-note + (decode-content (cons magnify s)))) + +(define (refalso tag . s) + (apply margin-note + (decode-content (append (list magnify (secref tag) " also provides information on ") + s + (list "."))))) + +(define (moreref tag . s) + (apply margin-note + (decode-content (append (list magnify (secref tag) " provides more information on ") + s + (list "."))))) + +(define (guidesecref s) + (secref #:doc '(lib "scribblings/guide/guide.scrbl") s)) + +(define (guideintro tag . s) + (apply margin-note + (decode-content (append (list finger (guidesecref tag) " in " Guide " introduces ") + s + (list "."))))) + +(define (guidealso tag) + (apply margin-note + (decode-content (append (list finger "See also " (guidesecref tag) " in " Guide "."))))) + +(define Guide + (other-manual '(lib "scribblings/guide/guide.scrbl"))) + +(define raco-doc + '(lib "scribblings/raco/raco.scrbl")) + +(provide see-read-print) +(define (see-read-print tag-part #:print [print-tag-part tag-part] vals) + @elem{See @secref[(string-append "parse-" tag-part)] + for information on @racket[read]ing + @|vals| and @secref[(string-append "print-" print-tag-part)] + for information on @racket[print]ing @|vals|.}) + +(provide speed) +(define-syntax speed + (syntax-rules () + [(_ id what) + (t "An " (racket id) " application can provide better performance for " + (elem what) + " iteration when it appears directly in a " (racket for) " clause.")])) diff --git a/collects/scribblings/reference/numbers.scrbl b/collects/scribblings/reference/numbers.scrbl index 57d9c108ed..a5ac42d59c 100644 --- a/collects/scribblings/reference/numbers.scrbl +++ b/collects/scribblings/reference/numbers.scrbl @@ -87,6 +87,8 @@ exact, and when they are @racket[=] (except for @racket[+nan.0], @racket[+nan.f] @racket[+0.0], @racket[+0.0f0], @racket[-0.0], and @racket[-0.0f0], as noted above). Two numbers are @racket[equal?] when they are @racket[eqv?]. +@see-read-print["number"]{numbers} + @local-table-of-contents[] @; ---------------------------------------- diff --git a/collects/scribblings/reference/pairs.scrbl b/collects/scribblings/reference/pairs.scrbl index 4ccc6386a3..2e677f1d8c 100644 --- a/collects/scribblings/reference/pairs.scrbl +++ b/collects/scribblings/reference/pairs.scrbl @@ -97,6 +97,8 @@ Cyclic data structures can be created using only immutable pairs via and using some number of @racket[cdr]s returns to the starting pair, then the pair is not a list. +@see-read-print["pair" #:print "pairs"]{pairs and lists} + @; ---------------------------------------- @section{Pair Constructors and Selectors} diff --git a/collects/scribblings/reference/printer.scrbl b/collects/scribblings/reference/printer.scrbl index 4a5ec9c927..62009bc9cc 100644 --- a/collects/scribblings/reference/printer.scrbl +++ b/collects/scribblings/reference/printer.scrbl @@ -97,7 +97,7 @@ Symbols @racket[print] the same as they @racket[write], unless @racket[print]ed form is prefixed with @litchar{'}. For the purposes of printing enclosing datatypes, a symbol is @tech{quotable}. -@section{Printing Numbers} +@section[#:tag "print-number"]{Printing Numbers} A @tech{number} prints the same way in @racket[write], @racket[display], and @racket[print] modes. For the purposes of printing enclosing @@ -126,7 +126,7 @@ determined by @racket[numerator] and @racket[denominator]). A negative @tech{exact number} prints with a @litchar{-} prefix on the printed form of the number's exact negation. -@section{Printing Booleans} +@section[#:tag "print-booleans"]{Printing Booleans} The @tech{boolean} constant @racket[#t] prints as @litchar{#true} or @litchar{#t} in all modes (@racket[display], @racket[write], and @racket[print]), @@ -219,7 +219,7 @@ always @tech{quotable}, a pair is @tech{quotable} when its @racket[car] and @racket[cdr] are @tech{quotable}, and a mutable list is never @tech{quotable}. -@section{Printing Strings} +@section[#:tag "print-string"]{Printing Strings} All @tech{strings} @racket[display] as their literal character sequences. @@ -419,7 +419,7 @@ When the @racket[print-box] parameter is set to @racket[#f], a box prints as @litchar{#} and counts as @tech{quotable}. -@section{Printing Characters} +@section[#:tag "print-character"]{Printing Characters} @tech{Characters} with the special names described in @secref["parse-character"] @racket[write] and @racket[print] using the @@ -439,7 +439,7 @@ For the purposes of printing enclosing datatypes, a character is @tech{quotable}. -@section{Printing Keywords} +@section[#:tag "print-keyword"]{Printing Keywords} @tech{Keywords} @racket[write], @racket[print], and @racket[display] the same as symbols (see @secref["print-symbol"]) except with a leading @@ -452,7 +452,7 @@ For the purposes of printing enclosing datatypes, a keyword is @tech{quotable}. -@section{Printing Regular Expressions} +@section[#:tag "print-regexp"]{Printing Regular Expressions} @tech{Regexp values} @racket[write], @racket[display], and @racket[print] starting with @litchar{#px} (for @racket[pregexp]-based regexps) or diff --git a/collects/scribblings/reference/regexps.scrbl b/collects/scribblings/reference/regexps.scrbl index c810e9858e..ed00b16b5d 100644 --- a/collects/scribblings/reference/regexps.scrbl +++ b/collects/scribblings/reference/regexps.scrbl @@ -54,6 +54,9 @@ compatible with Perl. In addition, Racket constants written with @litchar{#rx} or @litchar{#px} (see @secref["reader"]) produce compiled regexp values. +A literal or printed regular expression starts with @litchar{#rx} or +@litchar{#px}. @see-read-print["regexp"]{regular expressions} + The internal size of a regexp value is limited to 32 kilobytes; this limit roughly corresponds to a source string with 32,000 literal characters or 5,000 operators. diff --git a/collects/scribblings/reference/strings.scrbl b/collects/scribblings/reference/strings.scrbl index 2a88811bfd..1cd62544da 100644 --- a/collects/scribblings/reference/strings.scrbl +++ b/collects/scribblings/reference/strings.scrbl @@ -22,6 +22,8 @@ A string can be used as a single-valued sequence (see @secref["sequences"]). The characters of the string serve as elements of the sequence. See also @racket[in-string]. +@see-read-print["string"]{strings} + See also: @racket[immutable?], @racket[symbol->string], @racket[bytes->string/utf-8]. diff --git a/collects/scribblings/reference/vectors.scrbl b/collects/scribblings/reference/vectors.scrbl index 6dae2282a4..e2e21b5664 100644 --- a/collects/scribblings/reference/vectors.scrbl +++ b/collects/scribblings/reference/vectors.scrbl @@ -22,6 +22,10 @@ A vector can be used as a single-valued sequence (see @secref["sequences"]). The elements of the vector serve as elements of the sequence. See also @racket[in-vector]. +A literal or printed vector starts with @litchar{#(}, optionally with +a number between the @litchar{#} and +@litchar{(}. @see-read-print["vector" #:print "vectors"]{vectors} + @defproc[(vector? [v any/c]) boolean?]{ Returns @racket[#t] if @racket[v] is a vector, @racket[#f] otherwise.}