diff --git a/collects/algol60/algol60.scrbl b/collects/algol60/algol60.scrbl index 1f9dea2ba5..2da77a8a80 100644 --- a/collects/algol60/algol60.scrbl +++ b/collects/algol60/algol60.scrbl @@ -13,14 +13,14 @@ by Peter Naur. @section{Including Algol 60 Programs} Although Algol 60 is mainly provided as a DrRacket language, -@scheme[include-algol] supports limited use of Algol 60 programs in +@racket[include-algol] supports limited use of Algol 60 programs in larger programs. @defmodule[algol60/algol60] @defform[(include-algol path-string)]{ -Includes the Algol 60 program indicated by @scheme[path-string] as an +Includes the Algol 60 program indicated by @racket[path-string] as an expression in a Racket program. The included Algol 60 program is closed (i.e., it doesn't see any bindings in the included context), and the result is always @|void-const|.} @@ -28,7 +28,7 @@ and the result is always @|void-const|.} @section{Language} -The DrRacket and @scheme[include-algol] implementation departs from +The DrRacket and @racket[include-algol] implementation departs from the Algol 60 specification in the following minor ways: @(itemize (item "Strings are not permitted to contain nested quotes.") diff --git a/collects/browser/browser.scrbl b/collects/browser/browser.scrbl index a9bcf2456a..07ec592dda 100644 --- a/collects/browser/browser.scrbl +++ b/collects/browser/browser.scrbl @@ -77,7 +77,7 @@ return values are ignored. If the html file is being accessed as a @litchar{file:} url, the @racket[current-load-relative-directory] parameter is set to the -directory during the evaluation of the mzracket code (in both +directory during the evaluation of the mzscheme code (in both examples). The Racket code is executed through @racket[eval]. The @litchar{MZSCHEME} forms are disabled unless the web page is a diff --git a/collects/compiler/cffi.scrbl b/collects/compiler/cffi.scrbl index 15d3080824..3703fa4ead 100644 --- a/collects/compiler/cffi.scrbl +++ b/collects/compiler/cffi.scrbl @@ -35,13 +35,12 @@ (elem "conversions: (obvious and precise)")) @(define goesto 'rarr) - -@title{@scheme[c-lambda]: C FFI via @exec{raco ctool}} +@title{@racket[c-lambda]: C FFI via @exec{raco ctool}} @defmodule[compiler/cffi]{ -The @schememodname[compiler/cffi] module relies on a C compiler to +The @racketmodname[compiler/cffi] module relies on a C compiler to statically construct an interface to C code through directives embedded in a Racket program. The library implements a subset of @as-index{Gambit-C}'s foreign-function interface @cite["Feeley98"].} diff --git a/collects/config/config.scrbl b/collects/config/config.scrbl index f62ede14e5..c6a1eebb49 100644 --- a/collects/config/config.scrbl +++ b/collects/config/config.scrbl @@ -10,89 +10,89 @@ @defmodule[config]{ -The @schememodname[config] library specifies the location of +The @racketmodname[config] library specifies the location of directories (such as the main documentation directory) and also directory search paths (such as a list of directories to search for documentation).} -@bold{Note:} Instead of @scheme[require]ing -@schememodname[config] directly, use the -@schememodname[setup/dirs] library, which combines information from -@schememodname[config] and other sources. +@bold{Note:} Instead of @racket[require]ing +@racketmodname[config] directly, use the +@racketmodname[setup/dirs] library, which combines information from +@racketmodname[config] and other sources. -The @schememodname[config] module must export the following -values. In all cases where a @scheme[delay]ed value is expected for an -exported identifier, the value can be a @scheme[delay]ed @scheme[#f] +The @racketmodname[config] module must export the following +values. In all cases where a @racket[delay]ed value is expected for an +exported identifier, the value can be a @racket[delay]ed @racket[#f] to indicate the default. @defthing[doc-dir (promise/c (or/c path? string? bytes? false/c))]{ -A @scheme[delay]ed path, string, or byte string for the main +A @racket[delay]ed path, string, or byte string for the main documentation directory. It defaults to a @filepath{doc} sibling directory of the main collection directory.} @defthing[lib-dir (promise/c (or/c path? string? bytes? false/c))]{ -A @scheme[delay]ed path, string, or byte string for the main directory +A @racket[delay]ed path, string, or byte string for the main directory containing C libraries and build information; it defaults to a @filepath{lib} sibling directory of the main collection directory.} @defthing[dll-dir (promise/c (or/c path? string? bytes? false/c))]{ -A @scheme[delay]ed path, string, or byte string for a directory +A @racket[delay]ed path, string, or byte string for a directory containing Unix shared libraries for the main executable; it defaults to the main C-library directory} @defthing[include-dir (promise/c (or/c path? string? bytes? false/c))]{ -A @scheme[delay]ed path, string, or byte string for the main directory +A @racket[delay]ed path, string, or byte string for the main directory containing C header files; it defaults to an @filepath{include} sibling directory of the main collection directory.} @defthing[bin-dir (promise/c (or/c path? string? bytes? false/c))]{ -A @scheme[delay]ed path, string, or byte string for the main directory +A @racket[delay]ed path, string, or byte string for the main directory containing executables; it defaults to a @filepath{bin} sibling directory of the main collection directory.} @defthing[doc-search-dirs (promise/c (or/c path? string? bytes? false/c))]{ -A @scheme[delay]ed path, string, byte string, or @scheme[#f] -representing the search path for documentation; each @scheme[#f] in +A @racket[delay]ed path, string, byte string, or @racket[#f] +representing the search path for documentation; each @racket[#f] in the list, if any, is replaced with the default search path, which is the user- and version-specific @filepath{doc} directory followed by the main documentation directory.} @defthing[lib-search-dirs (promise/c (or/c path? string? bytes? false/c))]{ -Like @scheme[doc-search-dirs], but for directories containing C +Like @racket[doc-search-dirs], but for directories containing C libraries and other build information} @defthing[include-search-dirs(promise/c (or/c path? string? bytes? false/c))]{ -Like @scheme[doc-search-dirs], but for directories containing C header +Like @racket[doc-search-dirs], but for directories containing C header files} @defthing[absolute-installation? boolean?]{ -A (simple, non-@scheme[delay]ed) boolean that is @scheme[#t] if the -installation uses absolute path names, @scheme[#f] otherwise.} +A (simple, non-@racket[delay]ed) boolean that is @racket[#t] if the +installation uses absolute path names, @racket[#f] otherwise.} @defthing[cgc-suffix (promise/c (or/c string? false/c))]{ -A @scheme[delay]ed string used as the suffix (before the actual +A @racket[delay]ed string used as the suffix (before the actual suffix, such as @filepath{.exe}) for a @filepath{CGC} executable. Use Windows-style casing, and the string will be downcased as appropriate -(e.g., for a Unix binary name). A @scheme[#f] value means that if the +(e.g., for a Unix binary name). A @racket[#f] value means that if the @exec{mzscheme} binary identifies itself as CGC, then the suffix is -@scheme[""], otherwise it is @scheme["CGC"].} +@racket[""], otherwise it is @racket["CGC"].} @defthing[3m-suffix (promise/c (or/c string? false/c))]{ -Analogous to @scheme[cgc-suffix], but for 3m. A @scheme[#f] value +Analogous to @racket[cgc-suffix], but for 3m. A @racket[#f] value means that if the @filepath{mzscheme} binary identifies itself as CGC, -then the suffix is @scheme["3m"], otherwise it is @scheme[""].} +then the suffix is @racket["3m"], otherwise it is @racket[""].} @; ---------------------------------------------------------------------- @@ -108,17 +108,17 @@ normally takes precedence over the main collection directory). @defmodule[setup/configtab]{ -The @schememodname[setup/configtab] library defines a language module -that can be used to implement @schememodname[config].} +The @racketmodname[setup/configtab] library defines a language module +that can be used to implement @racketmodname[config].} -When @schememodname[setup/configtab] is used as a language module, the +When @racketmodname[setup/configtab] is used as a language module, the module body must consist of a sequence of -@schemeblock[(define _id _val)] +@racketblock[(define _id _val)] -declarations, where each @scheme[_id] is one of the names that the -@schememodname[config] library must export, and @scheme[_val] is +declarations, where each @racket[_id] is one of the names that the +@racketmodname[config] library must export, and @racket[_val] is an expression for the value (which will be automatically wrapped with -@scheme[delay] when needed). If a required export has no corresponding -@scheme[define], a definition with @scheme[#f] is inserted +@racket[delay] when needed). If a required export has no corresponding +@racket[define], a definition with @racket[#f] is inserted automatically. diff --git a/collects/datalog/scribblings/datalog.scrbl b/collects/datalog/scribblings/datalog.scrbl index 79d741441b..048fda4826 100644 --- a/collects/datalog/scribblings/datalog.scrbl +++ b/collects/datalog/scribblings/datalog.scrbl @@ -109,7 +109,7 @@ The following BNF describes the syntax of Datalog. (nonterm "constant")) (list (nonterm "constant") (nonterm "IDENTIFIER") - (nonterm "STRING")) + (nonterm "STRING")) ] The effect of running a Datalog program is to modify the database as directed @@ -143,7 +143,7 @@ All identifiers in @racketmodname[racket/base] are available for use as predicat The following is a program: @racketmod[datalog/sexp - + (! (edge a b)) (! (edge b c)) (! (edge c d)) diff --git a/collects/datalog/scribblings/racket.scrbl b/collects/datalog/scribblings/racket.scrbl index b0d2677f03..70f3b337ad 100644 --- a/collects/datalog/scribblings/racket.scrbl +++ b/collects/datalog/scribblings/racket.scrbl @@ -16,22 +16,22 @@ The Datalog database can be directly used by Racket programs through this API. @examples[#:eval the-eval (define family (make-theory)) - + (datalog family (! (parent joseph2 joseph1)) (! (parent joseph2 lucy)) (! (parent joseph3 joseph2))) - + (datalog family (? (parent X joseph2))) - + (datalog family (? (parent joseph2 X))) - + (datalog family (? (parent joseph2 X)) (? (parent X joseph2))) - + (datalog family (! (:- (ancestor A B) (parent A B))) @@ -46,7 +46,7 @@ The Datalog database can be directly used by Racket programs through this API. (let ([x 'joseph2]) (datalog family (? (parent x X)))) - + (datalog family (? (add1 1 :- X)))] @@ -57,11 +57,11 @@ The Datalog database can be directly used by Racket programs through this API. @defform[(datalog thy-expr stmt ...) #:contracts ([thy-expr theory/c])]{ Executes the statements on the theory given by @racket[thy-expr]. Returns the answers to the final query as a list of substitution dictionaries or returns @racket[empty]. } - + @defform[(datalog! thy-expr stmt ...) #:contracts ([thy-expr theory/c])]{ Executes the statements on the theory given by @racket[thy-expr]. Prints the answers to every query in the list of statements. Returns @racket[(void)]. } - + Statements are either assertions, retractions, or queries. @defform[(! clause)]{ Asserts the clause. } @@ -70,7 +70,7 @@ Statements are either assertions, retractions, or queries. @defform[(:- literal question ...)]{ A conditional clause. } @defform[(? question)]{ Queries the literal and prints the result literals. } - + Questions are either literals or external queries. Literals are represented as @racket[identifier] or @racket[(identifier term ...)]. External queries are represented as @racket[(identifier term ... :- term ...)], where @racket[identifier] is bound to a procedure that when given the first set of terms as arguments returns the second set of terms as values. diff --git a/collects/deinprogramm/scribblings/DMdA-advanced.scrbl b/collects/deinprogramm/scribblings/DMdA-advanced.scrbl index 689e54d52b..30aa6516d3 100644 --- a/collects/deinprogramm/scribblings/DMdA-advanced.scrbl +++ b/collects/deinprogramm/scribblings/DMdA-advanced.scrbl @@ -9,8 +9,8 @@ Abstraktion - fortgeschritten} that goes with the German textbook @italic{Die Macht der Abstraktion}. @declare-exporting[deinprogramm/DMdA-advanced] - -@schemegrammar*-DMdA[ + +@racketgrammar*-DMdA[ #:literals (define-record-procedures-2 set!) ( (define-record-procedures-2 id id id (field-spec ...)) @@ -23,11 +23,11 @@ Abstraktion - fortgeschritten} that goes with the German textbook string character (quoted ...) - @#,elem{@schemevalfont{'}@scheme[quoted]}] + @#,elem{@racketvalfont{'}@racket[quoted]}] ) ( (set! id expr) - (code:line @#,elem{@schemevalfont{'}@scheme[quoted]} (code:comment @#,seclink["advanced-quote"]{Quote-Literal})) + (code:line @#,elem{@racketvalfont{'}@racket[quoted]} (code:comment @#,seclink["advanced-quote"]{Quote-Literal})) ) ] @@ -38,10 +38,10 @@ Abstraktion - fortgeschritten} that goes with the German textbook @section[#:tag "advanced-quote"]{Quote-Literal} @deftogether[( -@defform/none[(unsyntax @elem{@schemevalfont{'}@scheme[quoted]})] +@defform/none[(unsyntax @elem{@racketvalfont{'}@racket[quoted]})] @defform[(quote quoted)] )]{ -Der Wert eines Quote-Literals hat die gleiche externe Repräsentation wie @scheme[quoted]. +Der Wert eines Quote-Literals hat die gleiche externe Repräsentation wie @racket[quoted]. } @section[#:tag "advanced-signatures"]{Signaturen} diff --git a/collects/deinprogramm/scribblings/DMdA-assignments.scrbl b/collects/deinprogramm/scribblings/DMdA-assignments.scrbl index 5cd9cfab55..16371e7047 100644 --- a/collects/deinprogramm/scribblings/DMdA-assignments.scrbl +++ b/collects/deinprogramm/scribblings/DMdA-assignments.scrbl @@ -12,7 +12,7 @@ Abstraktion mit Zuweisungen} to go with the German textbook @declare-exporting[deinprogramm/DMdA-assignments] -@schemegrammar*-DMdA[ +@racketgrammar*-DMdA[ #:literals (define-record-procedures-2 define-record-procedures-parametric-2 set!) ( (define-record-procedures-2 id id id (field-spec ...)) @@ -30,48 +30,48 @@ Abstraktion mit Zuweisungen} to go with the German textbook @prim-ops['(lib "DMdA-assignments.rkt" "deinprogramm") #'here] -@section{@scheme[define-record-procedures-2]} +@section{@racket[define-record-procedures-2]} @declare-exporting[deinprogramm/DMdA] @defform[(define-record-procedures-2 t c p (field-spec ...))]{ -Die @scheme[define-record-procedures-2]-Form ist eine Definition für -einen neuen Record-Typ. Dabei ist @scheme[t] der Name der Record-Signatur, -@scheme[c] der Name des Konstruktors, @scheme[p] der Name des -Prädikats. Jedes @scheme[field-spec] kann entweder der Name eines Selektors -oder ein Paar @scheme[(id id)] aus dem Namen eines Selektors und dem Namen eines +Die @racket[define-record-procedures-2]-Form ist eine Definition für +einen neuen Record-Typ. Dabei ist @racket[t] der Name der Record-Signatur, +@racket[c] der Name des Konstruktors, @racket[p] der Name des +Prädikats. Jedes @racket[field-spec] kann entweder der Name eines Selektors +oder ein Paar @racket[(id id)] aus dem Namen eines Selektors und dem Namen eines Mutators sein. } -@section{@scheme[define-record-procedures-parametric-2]} +@section{@racket[define-record-procedures-parametric-2]} @declare-exporting[deinprogramm/DMdA] @defform[(define-record-procedures-parametric-2 t cc c p (field-spec1 ...))]{ -Diese Form ist wie @scheme[define-record-procedures-2], nur parametrisch -wie @scheme[define-record-procedures-parametric]. Außerdem +Diese Form ist wie @racket[define-record-procedures-2], nur parametrisch +wie @racket[define-record-procedures-parametric]. Außerdem werden die Signaturen für die Feldinhalte, anders als bei -@scheme[define-record-procedures-parametric], sofort bei der +@racket[define-record-procedures-parametric], sofort bei der Konstruktion überprüft und nicht erst beim Aufruf eines Selektors. } -@section{@scheme[begin]} +@section{@racket[begin]} @declare-exporting[deinprogramm/DMdA] @defform[(begin expr expr ...)]{ -Bei der Auswertung eines @scheme[begin]-Ausdrucks werden nacheinander +Bei der Auswertung eines @racket[begin]-Ausdrucks werden nacheinander die Operanden ausgewertet. Der Wert des letzten Ausdrucks wird der -Wert des @scheme[begin]-Ausdrucks. +Wert des @racket[begin]-Ausdrucks. } -@section{@scheme[set!]} +@section{@racket[set!]} @declare-exporting[deinprogramm/DMdA] @defform[(set! id expr)]{ -Ein @scheme[set!]-Ausdruck ist eine Zuweisung, und ändert den Inhalt -der Zelle, die an @scheme[id] gebunden ist, auf den Wert von @scheme[expr]. +Ein @racket[set!]-Ausdruck ist eine Zuweisung, und ändert den Inhalt +der Zelle, die an @racket[id] gebunden ist, auf den Wert von @racket[expr]. } @section[#:tag "assignments-signatures"]{Signaturen} @@ -80,21 +80,21 @@ der Zelle, die an @scheme[id] gebunden ist, auf den Wert von @scheme[expr]. @defidform[unspecific]{ Signatur für unspezifische Werte, die unwichtig sind - typischerweise für die -Rückgabewerte von Operationen, die nur Seiteneffekte haben wie @scheme[set!] -oder @scheme[write-string]. +Rückgabewerte von Operationen, die nur Seiteneffekte haben wie @racket[set!] +oder @racket[write-string]. } @section[#:tag "advanced-definitions"]{Definitionen} @declare-exporting[deinprogramm/DMdA-deflam] @defform[(define id expr)]{Diese Form ist wie in den unteren -Sprachebenen, mit dem Unterschied, dass an @scheme[id] mit -@scheme[set!] zugewiesen werden kann.} +Sprachebenen, mit dem Unterschied, dass an @racket[id] mit +@racket[set!] zugewiesen werden kann.} -@section[#:tag "advanced-lambda"]{@scheme[lambda]} +@section[#:tag "advanced-lambda"]{@racket[lambda]} @declare-exporting[deinprogramm/DMdA-deflam] -@defform[(lambda (id id ... . id) expr)]{Bei @scheme[lambda] ist in +@defform[(lambda (id id ... . id) expr)]{Bei @racket[lambda] ist in dieser Sprachebene in einer Form zulässig, die es erlaubt, eine Prozedur mit einer variablen Anzahl von Paramern zu erzeugen: Alle Parameter vor dem Punkt funktionieren wie gewohnt und werden jeweils diff --git a/collects/deinprogramm/scribblings/DMdA-beginner.scrbl b/collects/deinprogramm/scribblings/DMdA-beginner.scrbl index f4011175ec..b6ac1886f8 100644 --- a/collects/deinprogramm/scribblings/DMdA-beginner.scrbl +++ b/collects/deinprogramm/scribblings/DMdA-beginner.scrbl @@ -11,7 +11,7 @@ Macht der Abstraktion}. @declare-exporting[deinprogramm/DMdA-beginner #:use-sources (deinprogramm/DMdA deinprogramm/define-record-procedures)] -@schemegrammar*-DMdA[ +@racketgrammar*-DMdA[ #:literals () () () () ] @@ -25,27 +25,27 @@ Macht der Abstraktion}. @section{Definitionen} @defform[(define id expr)]{ -Diese Form ist eine Definition, und bindet @scheme[id] als -globalen Namen an den Wert von @scheme[exp].} +Diese Form ist eine Definition, und bindet @racket[id] als +globalen Namen an den Wert von @racket[exp].} @section{Record-Typ-Definitionen} @defform[(define-record-procedures t c p (s1 ...))]{ -Die @scheme[define-record-procedures]-Form ist eine Definition -für einen neuen Record-Typ. Dabei ist @scheme[t] der Name der Record-Signatur, -@scheme[c] der Name des Konstruktors, @scheme[p] -der Name des Prädikats, und die @scheme[si] sind die +Die @racket[define-record-procedures]-Form ist eine Definition +für einen neuen Record-Typ. Dabei ist @racket[t] der Name der Record-Signatur, +@racket[c] der Name des Konstruktors, @racket[p] +der Name des Prädikats, und die @racket[si] sind die Namen der Selektoren.} @section[#:tag "application"]{Prozedurapplikation} @defform/none[(expr expr ...)]{ Dies ist eine Prozeduranwendung oder Applikation. -Alle @scheme[expr]s werden ausgewertet: +Alle @racket[expr]s werden ausgewertet: Der Operator (also der erste Ausdruck) muß eine Prozedur ergeben, die genauso viele Argumente -akzeptieren kann, wie es Operanden, also weitere @scheme[expr]s gibt. +akzeptieren kann, wie es Operanden, also weitere @racket[expr]s gibt. Die Anwendung wird dann ausgewertet, indem der Rumpf der Applikation ausgewertet wird, nachdem die Parameter der Prozedur durch die Argumente, also die Werte der @@ -53,15 +53,15 @@ Operanden ersetzt wurden.} @; @defform[(#%app id expr expr ...)]{ @; -@; Eine Prozedurapplikation kann auch mit @scheme[#%app] geschrieben +@; Eine Prozedurapplikation kann auch mit @racket[#%app] geschrieben @; werden, aber das macht eigentlich niemand.} -@section{@scheme[#t] and @scheme[#f]} +@section{@racket[#t] and @racket[#f]} @as-index{@litchar{#t}} ist das Literal für den booleschen Wert "wahr", @as-index{@litchar{#f}} das Literal für den booleschen Wert "falsch". -@section{@scheme[lambda]} +@section{@racket[lambda]} @defform[(lambda (id ...) expr)]{ Ein Lambda-Ausdruck ergibt bei der Auswertung eine neue Prozedur.} @@ -70,69 +70,69 @@ Ein Lambda-Ausdruck ergibt bei der Auswertung eine neue Prozedur.} @defform/none[id]{ Eine Variable bezieht sich auf die, von innen nach -außen suchend, nächstgelegene Bindung durch @scheme[lambda], @scheme[let], @scheme[letrec], oder -@scheme[let*]. Falls es keine solche lokale Bindung gibt, muß es eine +außen suchend, nächstgelegene Bindung durch @racket[lambda], @racket[let], @racket[letrec], oder +@racket[let*]. Falls es keine solche lokale Bindung gibt, muß es eine Definition oder eine eingebaute Bindung mit dem entsprechenden Namen geben. Die Auswertung des Namens ergibt dann den entsprechenden Wert. } -@section{@scheme[cond]} +@section{@racket[cond]} @defform[(cond (expr expr) ... (expr expr))]{ -Ein @scheme[cond]-Ausdruck bildet eine Verzweigung, die aus mehreren +Ein @racket[cond]-Ausdruck bildet eine Verzweigung, die aus mehreren Zweigen besteht. Jeder Zweig besteht aus einem Test und einem Ausdruck. Bei der Auswertung werden die Zweige nacheinander abgearbeitet. Dabei wird jeweils zunächst der Test ausgewertet, der jeweils einen booleschen Wert ergeben müssen. Beim -ersten Test, der @scheme[#t] ergibt, wird der Wert des Ausdrucks des Zweigs zum -Wert der gesamten Verzweigung. Wenn kein Test @scheme[#t] ergibt, wird das +ersten Test, der @racket[#t] ergibt, wird der Wert des Ausdrucks des Zweigs zum +Wert der gesamten Verzweigung. Wenn kein Test @racket[#t] ergibt, wird das Programm mit einer Fehlermeldung abgebrochen. } @defform/none[#:literals (cond else) (cond (expr expr) ... (else expr))]{ Die Form des cond-Ausdrucks ist ähnlich zur vorigen, mit der - Ausnahme, daß in dem Fall, in dem kein Test @scheme[#t] ergibt, der Wert des - letzten Ausdruck zum Wert der @scheme[cond]-Form wird. + Ausnahme, daß in dem Fall, in dem kein Test @racket[#t] ergibt, der Wert des + letzten Ausdruck zum Wert der @racket[cond]-Form wird. } @defidform[else]{ -Das Schlüsselwort @scheme[else] kann nur in @scheme[cond] benutzt werden.} +Das Schlüsselwort @racket[else] kann nur in @racket[cond] benutzt werden.} @; ---------------------------------------------------------------------- -@section{@scheme[if]} +@section{@racket[if]} @defform[(if expr expr expr)]{ -Eine @scheme[if]-Form ist eine binäre Verzweigung. Bei der Auswertung wird +Eine @racket[if]-Form ist eine binäre Verzweigung. Bei der Auswertung wird zunächst der erste Operand ausgewertet (der Test), der einen -booleschen Wert ergeben muß. Ergibt er @scheme[#t], wird der Wert des zweiten -Operanden (die Konsequente) zum Wert der @scheme[if]-Form, bei @scheme[#f] der Wert des +booleschen Wert ergeben muß. Ergibt er @racket[#t], wird der Wert des zweiten +Operanden (die Konsequente) zum Wert der @racket[if]-Form, bei @racket[#f] der Wert des dritten Operanden (die Alternative). } @; ---------------------------------------------------------------------- -@section{@scheme[and]} +@section{@racket[and]} @defform[(and expr ...)]{ -Bei der Auswertung eines @scheme[and]-Ausdrucks werden nacheinander die +Bei der Auswertung eines @racket[and]-Ausdrucks werden nacheinander die Operanden (die boolesche Werte ergeben müssen) ausgewertet. Ergibt -einer @scheme[#f], ergibt auch der and-Ausdruck @scheme[#f]; wenn alle -Operanden @scheme[#t] ergeben, ergibt auch der @scheme[and]-Ausdruck -@scheme[#t]. +einer @racket[#f], ergibt auch der and-Ausdruck @racket[#f]; wenn alle +Operanden @racket[#t] ergeben, ergibt auch der @racket[and]-Ausdruck +@racket[#t]. } @; ---------------------------------------------------------------------- -@section{@scheme[or]} +@section{@racket[or]} @defform[(or expr ...)]{ -Bei der Auswertung eines @scheme[or]-Ausdrucks werden nacheinander die +Bei der Auswertung eines @racket[or]-Ausdrucks werden nacheinander die Operanden (die boolesche Werte ergeben müssen) ausgewertet. Ergibt -einer @scheme[#t], ergibt auch der or-Ausdruck @scheme[#t]; wenn alle Operanden @scheme[#f] -ergeben, ergibt auch der @scheme[or]-Ausdruck @scheme[#f]. +einer @racket[#t], ergibt auch der or-Ausdruck @racket[#t]; wenn alle Operanden @racket[#f] +ergeben, ergibt auch der @racket[or]-Ausdruck @racket[#f]. } @section{Signaturen} @@ -141,14 +141,14 @@ Signaturen können statt der Verträge aus dem Buch geschrieben werden: Während Verträge reine Kommentare sind, überprüft DrRacket Signaturen und meldet etwaige Verletzungen. -@subsection{@scheme[signature]} +@subsection{@racket[signature]} @defform[(signature sig)]{ -Diese Form liefert die Signatur mit der Notation @scheme[sig]. +Diese Form liefert die Signatur mit der Notation @racket[sig]. } @subsection{Signaturdeklaration} @defform[(: id sig)]{ -Diese Form erklärt @scheme[sig] zur gültigen Signatur für @scheme[id]. +Diese Form erklärt @racket[sig] zur gültigen Signatur für @racket[id]. } @subsection{Eingebaute Signaturen} @@ -202,33 +202,33 @@ Signatur für Signaturen.} @defidform[property]{ Signatur für Eigenschaften.} -@subsection{@scheme[predicate]} +@subsection{@racket[predicate]} @defform[(predicate expr)]{ -Bei dieser Signatur muß @scheme[expr] als Wert ein Prädikat haben, also -eine Prozedur, die einen beliebigen Wert akzeptiert und entweder @scheme[#t] -oder @scheme[#f] zurückgibt. +Bei dieser Signatur muß @racket[expr] als Wert ein Prädikat haben, also +eine Prozedur, die einen beliebigen Wert akzeptiert und entweder @racket[#t] +oder @racket[#f] zurückgibt. Die Signatur ist dann für einen Wert gültig, wenn das Prädikat, darauf angewendet, -@scheme[#t] ergibt. +@racket[#t] ergibt. } -@subsection{@scheme[one-of]} +@subsection{@racket[one-of]} @defform[(one-of expr ...)]{ Diese Signatur ist für einen Wert gültig, wenn er gleich dem Wert eines -der @scheme[expr] ist. +der @racket[expr] ist. } -@subsection{@scheme[mixed]} +@subsection{@racket[mixed]} @defform[(mixed sig ...)]{ Diese Signatur ist für einen Wert gültig, wenn er für eine der Signaturen -@scheme[sig] gültig ist. +@racket[sig] gültig ist. } @subsection[#:tag "proc-signature"]{Prozedur-Signatur} @defidform[->]{ @defform/none[(sig ... -> sig)]{ Diese Signatur ist dann für einen Wert gültig, wenn dieser eine -Prozedur ist. Er erklärt außerdem, daß die Signaturen vor dem @scheme[->] -für die Argumente der Prozedur gelten und die Signatur nach dem @scheme[->] +Prozedur ist. Er erklärt außerdem, daß die Signaturen vor dem @racket[->] +für die Argumente der Prozedur gelten und die Signatur nach dem @racket[->] für den Rückgabewert. }} } @@ -241,80 +241,80 @@ für den Rückgabewert. Dies ist eine Signaturvariable: sie steht für eine Signatur, die für jeden Wert gültig ist. } -@subsection{@scheme[combined]} +@subsection{@racket[combined]} @defform[(combined sig ...)]{ Diese Signatur ist für einen Wert gültig, wenn sie für alle der Signaturen -@scheme[sig] gültig ist. +@racket[sig] gültig ist. } @section{Testfälle} @defform[(check-expect expr expr)]{ -Dieser Testfall überprüft, ob der erste @scheme[expr] den gleichen -Wert hat wie der zweite @scheme[expr], wobei das zweite @scheme[expr] +Dieser Testfall überprüft, ob der erste @racket[expr] den gleichen +Wert hat wie der zweite @racket[expr], wobei das zweite @racket[expr] meist ein Literal ist.} @defform[(check-within expr expr expr)]{ -Wie @scheme[check-expect], aber mit einem weiteren Ausdruck, -der als Wert eine Zahl @scheme[_delta] hat. Der Testfall überprüft, daß jede Zahl im Resultat -des ersten @scheme[expr] maximal um @scheme[_delta] -von der entsprechenden Zahl im zweiten @scheme[expr] abweicht.} +Wie @racket[check-expect], aber mit einem weiteren Ausdruck, +der als Wert eine Zahl @racket[_delta] hat. Der Testfall überprüft, daß jede Zahl im Resultat +des ersten @racket[expr] maximal um @racket[_delta] +von der entsprechenden Zahl im zweiten @racket[expr] abweicht.} @defform[(check-member-of expr expr ...)]{ -Ähnlich wie @scheme[check-expect]: Der Testfall überprüft, daß das Resultat +Ähnlich wie @racket[check-expect]: Der Testfall überprüft, daß das Resultat des ersten Operanden gleich dem Wert eines der folgenden Operanden ist.} @defform[(check-range expr expr expr)]{ -Ähnlich wie @scheme[check-expect]: Alle drei Operanden müssen +Ähnlich wie @racket[check-expect]: Alle drei Operanden müssen Zahlen sein. Der Testfall überprüft, ob die erste Zahl zwischen der zweiten und der dritten liegt (inklusive).} @defform[(check-error expr expr)]{ -Dieser Testfall überprüft, ob der erste @scheme[expr] einen Fehler produziert, +Dieser Testfall überprüft, ob der erste @racket[expr] einen Fehler produziert, wobei die Fehlermeldung der Zeichenkette entspricht, die der Wert des zweiten -@scheme[expr] ist.} +@racket[expr] ist.} @defform[(check-property expr)]{ Dieser Testfall überprüft experimentell, ob die @tech{Eigenschaft} -@scheme[expr] erfüllt ist. Dazu werden zufällige Werte für die mit -@scheme[for-all] quantifizierten Variablen eingesetzt: Damit wird +@racket[expr] erfüllt ist. Dazu werden zufällige Werte für die mit +@racket[for-all] quantifizierten Variablen eingesetzt: Damit wird überprüft, ob die Bedingung gilt. -@emph{Wichtig:} @scheme[check-property] funktioniert nur für +@emph{Wichtig:} @racket[check-property] funktioniert nur für Eigenschaften, bei denen aus den Signaturen sinnvoll Werte generiert werden können. Dies ist für die meisten eingebauten Signaturen der -Fall, aber nicht für Signaturvariablen und Signaturen, die mit @scheme[predicate] -erzeugt wurden. In diesen Fällen erzeugt @scheme[check-property] eine Fehlermeldung. +Fall, aber nicht für Signaturvariablen und Signaturen, die mit @racket[predicate] +erzeugt wurden. In diesen Fällen erzeugt @racket[check-property] eine Fehlermeldung. } @section{Parametrische Record-Typ-Definitionen} @defform[(define-record-procedures-parametric t cc c p (s1 ...))]{ -Die @scheme[define-record-procedures-parametric] ist wie -@scheme[define-record-procedures]. Zusäzlich wird der Bezeichner -@scheme[cc] an einen Signaturkonstruktor gebunden: Dieser akzeptiert +Die @racket[define-record-procedures-parametric] ist wie +@racket[define-record-procedures]. Zusäzlich wird der Bezeichner +@racket[cc] an einen Signaturkonstruktor gebunden: Dieser akzeptiert für jedes Feld eine Feld-Signatur und liefert eine Signatur, die nur -Records des Record-Typs @scheme[t] erfüllen, bei dem die Feldinhalte +Records des Record-Typs @racket[t] erfüllen, bei dem die Feldinhalte die Feld-Signaturen erfüllen. Beispiel: -@schemeblock[ +@racketblock[ (define-record-procedures-parametric pare pare-of make-pare pare? (pare-one pare-two)) ] -Dann ist @scheme[(pare-of integer string)] die Signatur für -@scheme[pare]-Records, bei dem die Feldinhalte die Signaturen -@scheme[integer] bzw. @scheme[string] erfüllen müssen. +Dann ist @racket[(pare-of integer string)] die Signatur für +@racket[pare]-Records, bei dem die Feldinhalte die Signaturen +@racket[integer] bzw. @racket[string] erfüllen müssen. Die Signaturen für die Feldinhalte werden erst überprüft, wenn ein Selektor aufgerufen wird. @@ -322,15 +322,15 @@ Selektor aufgerufen wird. @; ---------------------------------------------------------------------- -@; @section{@scheme[require]} +@; @section{@racket[require]} @; @; @defform[(require string)]{ @; -@; Diese Form macht die Definitionen des durch @scheme[string] spezifizierten Moduls -@; verfügbar. Dabei bezieht sich @scheme[string] auf eine Datei relativ zu der Datei, -@; in der die @scheme[require]-Form steht. +@; Diese Form macht die Definitionen des durch @racket[string] spezifizierten Moduls +@; verfügbar. Dabei bezieht sich @racket[string] auf eine Datei relativ zu der Datei, +@; in der die @racket[require]-Form steht. @; -@; Dabei ist @scheme[string] leicht eingeschränkt, um Portabilitätsprobleme zu vermeiden: +@; Dabei ist @racket[string] leicht eingeschränkt, um Portabilitätsprobleme zu vermeiden: @; @litchar{/} ist der Separator für Unterverzeichnisse,, @litchar{.} bedeutet das aktuelle @; Verzeichnis, @litchar{..} meint das übergeordnete Verzeichnis, Pfadelemente @; können nur @litchar{a} bis @litchar{z} (groß oder klein), @@ -342,7 +342,7 @@ Selektor aufgerufen wird. @; @defform/none[#:literals (require) @; (require module-id)]{ @; -@; Diese Form macht eine eingebaute Library mit dem Namen @scheme[module-id] verfügbar.} +@; Diese Form macht eine eingebaute Library mit dem Namen @racket[module-id] verfügbar.} @; @; @defform/none[#:literals (require lib) @; (require (lib string string ...))]{ @@ -350,10 +350,10 @@ Selektor aufgerufen wird. @; Diese Form macht die Definitionen eines Moduls in einer installierten Bibliothek @; verfügbar. @; Der erste -@; @scheme[string] ist der Name der Datei des Moduls, und die restlichen -@; @scheme[string]s bezeichnen die Collection (und Sub-Collection undsoweiter), -@; in der die Datei installiert ist. Jede @scheme[string] ist ebenso eingeschränkt -@; wie bei @scheme[(require string)].} +@; @racket[string] ist der Name der Datei des Moduls, und die restlichen +@; @racket[string]s bezeichnen die Collection (und Sub-Collection undsoweiter), +@; in der die Datei installiert ist. Jede @racket[string] ist ebenso eingeschränkt +@; wie bei @racket[(require string)].} @; @; @; @defform/none[#:literals (require planet) @@ -371,7 +371,7 @@ Scheme-Ausdruck, die experimentell überprüft werden kann. Der einfachste Fall einer Eigenschaft ist ein boolescher Ausdruck. Die folgende Eigenschaft gilt immer: -@schemeblock[ +@racketblock[ (= 1 1) ] @@ -379,17 +379,17 @@ Es ist auch möglich, in einer Eigenschaft Variablen zu verwenden, für die verschiedene Werte eingesetzt werden. Dafür müssen die Variablen gebunden und @deftech{quantifiziert} werden, d.h. es muß festgelegt werden, welche Signatur die Werte der Variable erfüllen sollen. -Eigenschaften mit Variablen werden mit der @scheme[for-all]-Form erzeugt: +Eigenschaften mit Variablen werden mit der @racket[for-all]-Form erzeugt: @defform[(for-all ((id sig) ...) expr)]{ -Dies bindet die Variablen @scheme[id] in der Eigenschaft -@scheme[expr]. Zu jeder Variable gehört eine Signatur -@scheme[sig], der von den Werten der Variable erfüllt werden +Dies bindet die Variablen @racket[id] in der Eigenschaft +@racket[expr]. Zu jeder Variable gehört eine Signatur +@racket[sig], der von den Werten der Variable erfüllt werden muß. Beispiel: -@schemeblock[ +@racketblock[ (for-all ((x integer)) (= x (/ (* x 2) 2))) ] @@ -397,40 +397,40 @@ Beispiel: @defform[(expect expr expr)]{ -Ein @scheme[expect]-Ausdruck ergibt eine Eigenschaft, die dann gilt, -wenn die Werte von @scheme[expr] und @scheme[expr] gleich sind, im -gleichen Sinne wie bei @scheme[check-expect].} +Ein @racket[expect]-Ausdruck ergibt eine Eigenschaft, die dann gilt, +wenn die Werte von @racket[expr] und @racket[expr] gleich sind, im +gleichen Sinne wie bei @racket[check-expect].} @defform[(expect-within expr expr expr)]{ -Wie @scheme[expect], aber entsprechend @scheme[check-within] mit einem -weiteren Ausdruck, der als Wert eine Zahl @scheme[_delta] hat. Die +Wie @racket[expect], aber entsprechend @racket[check-within] mit einem +weiteren Ausdruck, der als Wert eine Zahl @racket[_delta] hat. Die resultierende Eigenschaft gilt, wenn jede Zahl im Resultat des ersten -@scheme[expr] maximal um @scheme[_delta] von der entsprechenden Zahl -im zweiten @scheme[expr] abweicht.} +@racket[expr] maximal um @racket[_delta] von der entsprechenden Zahl +im zweiten @racket[expr] abweicht.} @defform[(expect-member-of expr expr ...)]{ -Wie @scheme[expect], aber entsprechend @scheme[check-member-of] mit +Wie @racket[expect], aber entsprechend @racket[check-member-of] mit weiteren Ausdrücken, die mit dem ersten verglichen werden. Die resultierende Eigenschaft gilt, wenn das erste Argument gleich einem der anderen Argumente ist.} @defform[(expect-range expr expr expr)]{ -Wie @scheme[expect], aber entsprechend @scheme[check-range]: Die +Wie @racket[expect], aber entsprechend @racket[check-range]: Die Argumente müssen Zahlen sein. Die Eigenschaft gilt, wenn die erste Zahl zwischen der zweiten und dritten Zahl liegt (inklusive).} @defform[(==> expr expr)]{ Der erste Operand ist ein boolescher Ausdruck, der zweite Operand eine -Eigenschaft: @scheme[(==> c p)] legt fest, daß die Eigenschaft -@scheme[p] nur erfüllt sein muß, wenn @scheme[c] (die -@emph{Bedingung}) @scheme[#t] ergibt, also erfüllt ist.} +Eigenschaft: @racket[(==> c p)] legt fest, daß die Eigenschaft +@racket[p] nur erfüllt sein muß, wenn @racket[c] (die +@emph{Bedingung}) @racket[#t] ergibt, also erfüllt ist.} -@schemeblock[ +@racketblock[ (for-all ((x integer)) (==> (even? x) (= x (* 2 (/ x 2))))) diff --git a/collects/deinprogramm/scribblings/DMdA-lib.scrbl b/collects/deinprogramm/scribblings/DMdA-lib.scrbl index 28b3b13712..a115f11aa3 100644 --- a/collects/deinprogramm/scribblings/DMdA-lib.scrbl +++ b/collects/deinprogramm/scribblings/DMdA-lib.scrbl @@ -23,7 +23,7 @@ Macht der Abstraktion}}. @defmodule[deinprogramm/DMdA-beginner] -Das Modul @schememodname[deinprogramm/DMdA-beginner] implementiert die +Das Modul @racketmodname[deinprogramm/DMdA-beginner] implementiert die Anfängersprache für @|DMdA|; siehe @DMdA-ref["DMdA-beginner"]. @; ------------------------------------------------------------ @@ -31,7 +31,7 @@ Anfängersprache für @|DMdA|; siehe @DMdA-ref["DMdA-beginner"]. @defmodule[deinprogramm/DMdA-vanilla] -Das Modul @schememodname[deinprogramm/DMdA-vanilla] implementiert die +Das Modul @racketmodname[deinprogramm/DMdA-vanilla] implementiert die Standardsprache für @|DMdA|; siehe @DMdA-ref["DMdA-vanilla"]. @; ------------------------------------------------------------ @@ -39,7 +39,7 @@ Standardsprache für @|DMdA|; siehe @DMdA-ref["DMdA-vanilla"]. @defmodule[deinprogramm/DMdA-assignments] -Das Modul @schememodname[deinprogramm/DMdA-assignments] implementiert +Das Modul @racketmodname[deinprogramm/DMdA-assignments] implementiert die Sprachebene für @|DMdA| mit Zuweisungen und Mutationen; siehe @DMdA-ref["DMdA-assignments"]. @@ -48,6 +48,6 @@ die Sprachebene für @|DMdA| mit Zuweisungen und Mutationen; siehe @defmodule[deinprogramm/DMdA-advanced] -Das Modul @schememodname[deinprogramm/DMdA-advanced] implementiert +Das Modul @racketmodname[deinprogramm/DMdA-advanced] implementiert die fortgeschrittene Sprachebene für @|DMdA|; siehe @DMdA-ref["DMdA-advanced"]. diff --git a/collects/deinprogramm/scribblings/DMdA-vanilla.scrbl b/collects/deinprogramm/scribblings/DMdA-vanilla.scrbl index dbef70995c..06f63465e4 100644 --- a/collects/deinprogramm/scribblings/DMdA-vanilla.scrbl +++ b/collects/deinprogramm/scribblings/DMdA-vanilla.scrbl @@ -11,7 +11,7 @@ Abstraktion}. @declare-exporting[deinprogramm/DMdA-vanilla #:use-sources (deinprogramm/DMdA)] -@schemegrammar*-DMdA[ +@racketgrammar*-DMdA[ #:literals () () () () ] @@ -22,55 +22,55 @@ Abstraktion}. @section[#:tag "signatures-vanilla"]{Signaturen} -@subsection{@scheme[list-of]} +@subsection{@racket[list-of]} @defform[(list-of sig)]{ Diese Signatur ist dann für einen Wert gültig, wenn dieser eine Liste ist, -für dessen Elemente @scheme[sig] gültig ist. +für dessen Elemente @racket[sig] gültig ist. } -@section{@scheme[let], @scheme[letrec] und @scheme[let*]} +@section{@racket[let], @racket[letrec] und @racket[let*]} @defform[(let ((id expr) ...) expr)]{ -Bei einem @scheme[let]-Ausdruck werden zunächst die @scheme[expr]s aus -den @scheme[(id expr)]-Paaren ausgewertet. Ihre Werte werden dann im -Rumpf-@scheme[expr] für die Namen @scheme[id] eingesetzt. Dabei können +Bei einem @racket[let]-Ausdruck werden zunächst die @racket[expr]s aus +den @racket[(id expr)]-Paaren ausgewertet. Ihre Werte werden dann im +Rumpf-@racket[expr] für die Namen @racket[id] eingesetzt. Dabei können sich die Ausdrücke nicht auf die Namen beziehen. -@schemeblock[ +@racketblock[ (define a 3) (let ((a 16) (b a)) (+ b a)) => 19] -Das Vorkommen von @scheme[a] in der Bindung von @scheme[b] bezieht -sich also auf das @scheme[a] aus der Definition, nicht das @scheme[a] -aus dem @scheme[let]-Ausdruck. +Das Vorkommen von @racket[a] in der Bindung von @racket[b] bezieht +sich also auf das @racket[a] aus der Definition, nicht das @racket[a] +aus dem @racket[let]-Ausdruck. } @defform[(letrec ((id expr) ...) expr)]{ -Ein @scheme[letrec]-Ausdruck ist -ähnlich zum entsprechenden @scheme[let]-Ausdruck, mit dem Unterschied, daß sich -die @scheme[expr]s aus den Bindungen auf die gebundenen Namen beziehen +Ein @racket[letrec]-Ausdruck ist +ähnlich zum entsprechenden @racket[let]-Ausdruck, mit dem Unterschied, daß sich +die @racket[expr]s aus den Bindungen auf die gebundenen Namen beziehen dürfen.} @defform[(let* ((id expr) ...) expr)]{ -Ein @scheme[let*]-Ausdruck ist ähnlich zum entsprechenden -@scheme[let]-Ausdruck, mit dem Unterschied, daß sich die @scheme[expr]s +Ein @racket[let*]-Ausdruck ist ähnlich zum entsprechenden +@racket[let]-Ausdruck, mit dem Unterschied, daß sich die @racket[expr]s aus den Bindungen auf die Namen beziehen dürfen, die jeweils vor dem -@scheme[expr] gebunden wurden. Beispiel: +@racket[expr] gebunden wurden. Beispiel: -@schemeblock[ +@racketblock[ (define a 3) (let* ((a 16) (b a)) (+ b a)) => 32] -Das Vorkommen von @scheme[a] in der Bindung von @scheme[b] bezieht -sich also auf das @scheme[a] aus dem @scheme[let*]-Ausdruck, nicht das -@scheme[a] aus der globalen Definition. +Das Vorkommen von @racket[a] in der Bindung von @racket[b] bezieht +sich also auf das @racket[a] aus dem @racket[let*]-Ausdruck, nicht das +@racket[a] aus der globalen Definition. } @section[#:tag "vanilla-prim-op"]{Primitive Operationen} diff --git a/collects/deinprogramm/scribblings/image.scrbl b/collects/deinprogramm/scribblings/image.scrbl index b66769851e..84380a7307 100644 --- a/collects/deinprogramm/scribblings/image.scrbl +++ b/collects/deinprogramm/scribblings/image.scrbl @@ -20,37 +20,37 @@ Zusätzliche Prozeduren erlauben die Komposition von Bildern. @section{Bilder} @defthing[image signature]{ -Ein @deftech{Bild} (Name: @scheme[image]) ist die Repräsentation eines Bildes. +Ein @deftech{Bild} (Name: @racket[image]) ist die Repräsentation eines Bildes. } @defthing[empty-image image]{ Ein leeres Bild mit Breite und Höhe 0. } -@defthing[image? (any -> boolean?)]{Der Aufruf @scheme[(image? x)] stellt fest, ob @scheme[x] ein Bild ist.} +@defthing[image? (any -> boolean?)]{Der Aufruf @racket[(image? x)] stellt fest, ob @racket[x] ein Bild ist.} @;----------------------------------------------------------------------------- @section[#:tag "modes-colors"]{Modi und Farben} @defthing[mode signature]{ -@scheme[(one-of "solid" "outline")] +@racket[(one-of "solid" "outline")] -Ein Modus (Name: @scheme[mode]) legt fest, ob die Darstellung einer Form diese füllt +Ein Modus (Name: @racket[mode]) legt fest, ob die Darstellung einer Form diese füllt oder nur einen Umriss zeichnet.} @defthing[octet signature]{ -@scheme[(combined natural (predicate (lambda (n) (<= n 255))))] +@racket[(combined natural (predicate (lambda (n) (<= n 255))))] -Ein Oktet (Name: @scheme[octet]) ist eine natürliche Zahl zwischen 0 und 255.} +Ein Oktet (Name: @racket[octet]) ist eine natürliche Zahl zwischen 0 und 255.} @defthing[rgb-color signature]{ -Eine @deftech{RGB-Farbe} ist eine Farbe (Name: @scheme[color], die vom -Record-Konstruktor @scheme[make-color] zurückgegeben wird: +Eine @deftech{RGB-Farbe} ist eine Farbe (Name: @racket[color], die vom +Record-Konstruktor @racket[make-color] zurückgegeben wird: } @defthing[make-color (octet octet octet -> rgb-color)]{ Eine @tech{RGB-Farbe} beschreibt eine Farbe mit den roten, blauen und grünen Anteilen, -also z.B. @scheme[(make-color 100 200 30)].} +also z.B. @racket[(make-color 100 200 30)].} @defthing[color-red (color -> octet)]{ liefert den Rot-Anteil einer RGB-Farbe.} @@ -63,22 +63,22 @@ also z.B. @scheme[(make-color 100 200 30)].} stellt fest, ob ein Objekt eine @tech{RGB-Farbe} ist.} @defthing[image-color signature]{ -@scheme[(mixed string rgb-color)] +@racket[(mixed string rgb-color)] -Eine @deftech{Farbe} (Name: @scheme[image-color]) ist eine Zeichenkette aus einer Farbbezeichnung -(z.B. @scheme["blue"]) oder eine @tech{RGB-Farbe}.} +Eine @deftech{Farbe} (Name: @racket[image-color]) ist eine Zeichenkette aus einer Farbbezeichnung +(z.B. @racket["blue"]) oder eine @tech{RGB-Farbe}.} @defthing[image-color? (any -> boolean?)]{ stellt fest, ob ein Objekt eine @tech{Farbe} ist.} @defthing[alpha-rgb-color signature]{ -Eine @deftech{Alpha/RGB-Farbe} ist eine Farbe (Name: @scheme[color], die vom -Record-Konstruktor @scheme[make-alpha-color] zurückgegeben wird: +Eine @deftech{Alpha/RGB-Farbe} ist eine Farbe (Name: @racket[color], die vom +Record-Konstruktor @racket[make-alpha-color] zurückgegeben wird: } @defthing[make-alpha-color (octet octet octet octet -> alpha-color)]{ Eine @tech{Alpha/RGB-Farbe} beschreibt eine Farbe mit den Alpha-, roten, -blaue und grünen Anteilen, also z.B. @scheme[(make-color 50 100 200 +blaue und grünen Anteilen, also z.B. @racket[(make-color 50 100 200 30)]. Der Alpha-Anteil beschreibt, wie durchsichtig die Farbe ist.} @defthing[alpha-color-red (color -> octet)]{ @@ -101,37 +101,37 @@ stellt fest, ob ein Objekt eine @tech{Alpha/RGB-Farbe} ist.} Die folgenden Prozeduren erzeugen Bilder mit einfachen geometrischen Formen: @defthing[rectangle (natural natural mode image-color -> image)]{ - Der Aufruf @scheme[(rectangle w h m c)] - erzeugt ein Rechteck mit Breite @scheme[w] und Höhe @scheme[h], gefüllt mit Modus - @scheme[m] und in Farbe @scheme[c].} + Der Aufruf @racket[(rectangle w h m c)] + erzeugt ein Rechteck mit Breite @racket[w] und Höhe @racket[h], gefüllt mit Modus + @racket[m] und in Farbe @racket[c].} @defthing[circle (natural mode image-color -> image)]{ - Der Aufruf @scheme[(circle r m c)] - erzeugt einen Kreis oder eine Scheibe mit Radius @scheme[r], gefüllt mit Modus - @scheme[m] und in Farbe @scheme[c].} + Der Aufruf @racket[(circle r m c)] + erzeugt einen Kreis oder eine Scheibe mit Radius @racket[r], gefüllt mit Modus + @racket[m] und in Farbe @racket[c].} @defthing[ellipse (natural natural mode image-color -> image)]{ - Der Aufruf @scheme[(ellipse w h m c)] - erzeugt eine Ellipse mit Breite @scheme[w] und Höhe @scheme[h], gefüllt mit Modus - @scheme[m] und in Farbe @scheme[c].} + Der Aufruf @racket[(ellipse w h m c)] + erzeugt eine Ellipse mit Breite @racket[w] und Höhe @racket[h], gefüllt mit Modus + @racket[m] und in Farbe @racket[c].} @defthing[triangle (integer mode image-color -> image)]{ - Der Aufruf @scheme[(triangle s m c)] + Der Aufruf @racket[(triangle s m c)] erzeugt ein nach oben zeigendes gleichseitiges Dreieck, wobei - @scheme[s] die Seitenlänge angibt, gefüllt mit Modus - @scheme[m] und in Farbe @scheme[c].} + @racket[s] die Seitenlänge angibt, gefüllt mit Modus + @racket[m] und in Farbe @racket[c].} @defthing[line (natural natural number number number number image-color -> image)]{ - Der Aufruf @scheme[(line w h sx sy ex ey c)] - erzeugt ein Bild mit einer farbigen Strecke, wobei @scheme[w] die Breite und @scheme[h] die Höhe des Bilds, - sowie @scheme[sx] die X- und @scheme[sx] die Y-Koordinate des Anfangspunkts und - @scheme[ex] die X- und @scheme[ey] die Y-Koordinate des Endpunkts angeben, gefüllt mit Modus - @scheme[m] und in Farbe @scheme[c].} + Der Aufruf @racket[(line w h sx sy ex ey c)] + erzeugt ein Bild mit einer farbigen Strecke, wobei @racket[w] die Breite und @racket[h] die Höhe des Bilds, + sowie @racket[sx] die X- und @racket[sx] die Y-Koordinate des Anfangspunkts und + @racket[ex] die X- und @racket[ey] die Y-Koordinate des Endpunkts angeben, gefüllt mit Modus + @racket[m] und in Farbe @racket[c].} @defthing[text (string natural image-color -> image)]{ - Der Aufruf @scheme[(text s f c)] - erzeugt ein Bild mit Text @scheme[s], - wobei die Buchstaben die Größe @scheme[f] haben, in Farbe @scheme[c]} + Der Aufruf @racket[(text s f c)] + erzeugt ein Bild mit Text @racket[s], + wobei die Buchstaben die Größe @racket[f] haben, in Farbe @racket[c]} Außerdem können beliebige Bitmap-Bilder in ein Scheme-Programm eingeklebt werden. @@ -143,18 +143,18 @@ Zwei Eigenschaften von Bildern sind für ihre Manipulation nützlich, nämlich Breite und Höhe: @defthing[image-width (image -> natural)]{ - liefert die Breite von @scheme[i] in Pixeln.} + liefert die Breite von @racket[i] in Pixeln.} @defthing[image-height (image -> natural)]{ - liefert die Höhe von @scheme[i] in Pixeln.} + liefert die Höhe von @racket[i] in Pixeln.} @defthing[image-inside? (image image -> boolean)]{ -Der Aufruf @scheme[(image-inside? i1 i2)] stellt fest, ob das Bild -@scheme[i2] im Bild @scheme[i1] enthalten ist.} +Der Aufruf @racket[(image-inside? i1 i2)] stellt fest, ob das Bild +@racket[i2] im Bild @racket[i1] enthalten ist.} @defthing[find-image (image image -> posn)]{ -Der Aufruf @scheme[(find-image i1 i2)] findet die Position von @scheme[i2] -im Bild @scheme[i1] (in dem es vorkommen muss).} +Der Aufruf @racket[(find-image i1 i2)] findet die Position von @racket[i2] +im Bild @racket[i1] (in dem es vorkommen muss).} @;----------------------------------------------------------------------------- @section[#:tag "composition"]{Bilder zusammensetzen} @@ -162,87 +162,87 @@ im Bild @scheme[i1] (in dem es vorkommen muss).} The nächste Gruppe von Prozeduren baut aus Bildern neue Bilder: @defthing[h-place signature]{ -@scheme[(mixed integer (one-of "left" "right" "center"))] +@racket[(mixed integer (one-of "left" "right" "center"))] -Eine @deftech{horizontale Positionsangabe} (Name: @scheme[h-place]) +Eine @deftech{horizontale Positionsangabe} (Name: @racket[h-place]) gibt an, wie zwei Bilder horizontal zueinander positioniert werden -Im ersten Fall, wenn es sich um eine Zahl @scheme[x] handelt, wird das -zweite Bild @scheme[x] Pixel vom linken Rand auf das erste gelegt. +Im ersten Fall, wenn es sich um eine Zahl @racket[x] handelt, wird das +zweite Bild @racket[x] Pixel vom linken Rand auf das erste gelegt. Die drei Fälle mit Zeichenketten sagen, daß die Bilder am linken Rand bzw. am rechten Rand bündig plaziert werden, bzw. das zweite Bild horizontal in die Mitte des ersten gesetzt wird.} @defthing[v-place signature]{ -@scheme[(mixed integer (one-of "top" "bottom" "center"))] +@racket[(mixed integer (one-of "top" "bottom" "center"))] -Eine @deftech{vertikale Positionsangabe} (Name: @scheme[v-place]) +Eine @deftech{vertikale Positionsangabe} (Name: @racket[v-place]) gibt an, wie zwei Bilder vertikal zueinander positioniert werden -Im ersten Fall, wenn es sich um eine Zahl @scheme[y] handelt, wird das -zweite Bild @scheme[y] Pixel vom oberen Rand auf das erste gelegt. +Im ersten Fall, wenn es sich um eine Zahl @racket[y] handelt, wird das +zweite Bild @racket[y] Pixel vom oberen Rand auf das erste gelegt. Die drei Fälle mit Zeichenketten sagen, daß die Bilder am oberen Rand bzw. am unteren Rand bündig plaziert werden, bzw. das zweite Bild vertikal in die Mitte des ersten gesetzt wird. } @defthing[h-mode signature]{ -@scheme[(one-of "left" "right" "center")] -Eine @deftech{horizontale Justierungsangabe} (Name: @scheme[h-mode]) +@racket[(one-of "left" "right" "center")] +Eine @deftech{horizontale Justierungsangabe} (Name: @racket[h-mode]) gibt an, ob zwei Bilder, die übereinander angeordnet werden, entlang der linken Kante, der rechten Kante oder der Mitte angeordnet werden. } @defthing[v-mode signature]{ -@scheme[(one-of "top" "bottom" "center")] +@racket[(one-of "top" "bottom" "center")] -Eine @deftech{vertikale Justierungsangabe} (Name: @scheme[V-mode]) +Eine @deftech{vertikale Justierungsangabe} (Name: @racket[V-mode]) gibt an, ob zwei Bilder, die nebenander angeordnet werden, entlang der oberen Kante, der untern Kante oder der Mitte angeordnet werden.} @defthing[overlay (image image h-place v-place -> image)]{ - Der Aufruf @scheme[(overlay img other h v)] - legt zweite Bild @scheme[other] auf das erste @scheme[img]. Die beiden anderen Argumente geben an, wie + Der Aufruf @racket[(overlay img other h v)] + legt zweite Bild @racket[other] auf das erste @racket[img]. Die beiden anderen Argumente geben an, wie die beiden Bilder zueinander positioniert werden.} @defthing[beside (image image v-mode -> image)]{ - Der Aufruf @scheme[(beside img other v)] - ordnet die beiden Bilder entsprechend des @scheme[v]-Arguments + Der Aufruf @racket[(beside img other v)] + ordnet die beiden Bilder entsprechend des @racket[v]-Arguments nebeneinander an.} @defthing[above (image image h-mode -> image)]{ - Der Aufruf @scheme[(img other h -> image)] - ordnet die beiden Bilder entsprechend des @scheme[h]-Arguments + Der Aufruf @racket[(img other h -> image)] + ordnet die beiden Bilder entsprechend des @racket[h]-Arguments übereinander an.} @defthing[clip (image natural natural natural natural -> image)]{ - Der Aufruf @scheme[(clip img x y w h)] - liefert das Teilrechteck des Bildes @scheme[img] - bei (@scheme[x], @scheme[y]), Breite @scheme[w] und Höhe @scheme[h].} + Der Aufruf @racket[(clip img x y w h)] + liefert das Teilrechteck des Bildes @racket[img] + bei (@racket[x], @racket[y]), Breite @racket[w] und Höhe @racket[h].} @defthing[pad (image natural natural natural natural -> image)]{ - Der Aufruf @scheme[(pad img l r t b)] - fügt an den Seiten von @scheme[img] noch transparenten Leerraum an: - @scheme[l] Pixel links, @scheme[r] Pixel rechts, @scheme[t] Pixel oben und - @scheme[b] Pixel unten.} + Der Aufruf @racket[(pad img l r t b)] + fügt an den Seiten von @racket[img] noch transparenten Leerraum an: + @racket[l] Pixel links, @racket[r] Pixel rechts, @racket[t] Pixel oben und + @racket[b] Pixel unten.} @;----------------------------------------------------------------------------- @section[#:tag "from-pixels"]{Bilder aus Pixeln konstruieren} @defthing[color-list->image ((list-of color) natural natural -> image)]{ - Der Aufruf @scheme[(color-list->image lis w h)] stellt ein Bild mit - Breite @scheme[w] und Höhe @scheme[h] her, in dem die Pixel die - Farben aus der Liste @scheme[lis] (welche die Länge @scheme[(* w h)] + Der Aufruf @racket[(color-list->image lis w h)] stellt ein Bild mit + Breite @racket[w] und Höhe @racket[h] her, in dem die Pixel die + Farben aus der Liste @racket[lis] (welche die Länge @racket[(* w h)] haben muß) haben.} @defthing[image->color-list (image -> (list-of rgb-color))]{ Diese Prozedur liefert eine Liste der RGB-Farben der Pixel eines Bildes.} @defthing[alpha-color-list->image ((list-of alpha-rgb-color) natural natural -> image)]{ - Der Aufruf @scheme[(color-list->image lis w h)] stellt ein Bild mit - Breite @scheme[w] und Höhe @scheme[h] her, in dem die Pixel die - Farben aus der Liste @scheme[lis] (welche die Länge @scheme[(* w h)] + Der Aufruf @racket[(color-list->image lis w h)] stellt ein Bild mit + Breite @racket[w] und Höhe @racket[h] her, in dem die Pixel die + Farben aus der Liste @racket[lis] (welche die Länge @racket[(* w h)] haben muß) haben.} @defthing[image->alpha-color-list (image -> (list-of rgb-color))]{ diff --git a/collects/deinprogramm/scribblings/ka.scrbl b/collects/deinprogramm/scribblings/ka.scrbl index 854e162545..00643707fe 100644 --- a/collects/deinprogramm/scribblings/ka.scrbl +++ b/collects/deinprogramm/scribblings/ka.scrbl @@ -37,10 +37,10 @@ die möglichen Werte also in feste Kategorien sortiert werden können, steht im Rumpf eine Verzweigung. Die Anzahl der Zweige entspricht der Anzahl der Kategorien. -Die Schablone für eine Prozedur @scheme[proc], deren Argument zu einer Sorte gehört, +Die Schablone für eine Prozedur @racket[proc], deren Argument zu einer Sorte gehört, die @italic{n} Kategorien hat, sieht folgendermaßen aus: -@schemeblock[ +@racketblock[ (: proc (sig -> ...)) (define proc (lambda (a) @@ -49,16 +49,16 @@ die @italic{n} Kategorien hat, sieht folgendermaßen aus: ... (#,(elem (scheme test) (subscript "n")) ...)))) ] -Dabei ist @scheme[sig] die Signatur, den die Elemente der Sorte erfüllen müssen. +Dabei ist @racket[sig] die Signatur, den die Elemente der Sorte erfüllen müssen. Die @elem[(scheme test) (subscript "i")] müssen Tests sein, welche die einzelnen Kategorien erkennen. Sie sollten alle Kategorien abdecken. -Der letzte Zweig kann auch ein @scheme[else]-Zweig sein, falls -klar ist, daß @scheme[a] zum letzten Fall gehört, wenn alle vorherigen -@elem[(scheme test) (subscript "i")] @scheme[#f] ergeben haben. +Der letzte Zweig kann auch ein @racket[else]-Zweig sein, falls +klar ist, daß @racket[a] zum letzten Fall gehört, wenn alle vorherigen +@elem[(scheme test) (subscript "i")] @racket[#f] ergeben haben. Anschließend werden die Zweige vervollständigt. -Bei Fallunterscheidungen mit zwei Kategorien kann auch @scheme[if] -statt @scheme[cond] verwendet werden. +Bei Fallunterscheidungen mit zwei Kategorien kann auch @racket[if] +statt @racket[cond] verwendet werden. @section{zusammengesetzte Daten} Wenn bei der Datenanalyse zusammengesetzte Daten vorkommen, stellen @@ -66,23 +66,23 @@ Sie zunächst fest, welche Komponenten zu welchen Sorten gehören. Schreiben Sie dann eine Datendefinition, die mit folgenden Worten anfängt: -@schemeblock[ -(code:comment @#,t{Ein @scheme[x] besteht aus / hat:}) -(code:comment @#,t{- @scheme[#,(elem (scheme Feld) (subscript "1"))] @scheme[(#,(elem (scheme sig) (subscript "1")))]}) +@racketblock[ +(code:comment @#,t{Ein @racket[x] besteht aus / hat:}) +(code:comment @#,t{- @racket[#,(elem (scheme Feld) (subscript "1"))] @racket[(#,(elem (scheme sig) (subscript "1")))]}) (code:comment @#,t{...}) -(code:comment @#,t{- @scheme[#,(elem (scheme Feld) (subscript "n"))] @scheme[(#,(elem (scheme sig) (subscript "n")))]}) +(code:comment @#,t{- @racket[#,(elem (scheme Feld) (subscript "n"))] @racket[(#,(elem (scheme sig) (subscript "n")))]}) ] -Dabei ist @scheme[x] ein umgangssprachlicher Name für die Sorte +Dabei ist @racket[x] ein umgangssprachlicher Name für die Sorte (``Schokokeks''), die @elem[(scheme Feld) (subscript "i")] sind umgangssprachliche Namen und kurze Beschreibungen der Komponenten und die @elem[(scheme sig) (subscript "i")] die dazugehörigen Signaturen. Übersetzen Sie die Datendefinition in eine Record-Definition, indem Sie -auch Namen für die Record-Signatur @scheme[sig], Konstruktor @scheme[constr], -Prädikat @scheme[pred?] und die Selektoren @elem[(scheme select) (subscript "i")] +auch Namen für die Record-Signatur @racket[sig], Konstruktor @racket[constr], +Prädikat @racket[pred?] und die Selektoren @elem[(scheme select) (subscript "i")] wählen: -@schemeblock[ +@racketblock[ (define-record-procedures sig constr pred? (#,(elem (scheme select) (subscript "1")) ... #,(elem (scheme select) (subscript "n")))) @@ -91,13 +91,13 @@ wählen: Schreiben Sie außerdem eine Signatur für den Konstruktor der Form: -@schemeblock[ +@racketblock[ (: constr (#,(elem (scheme sig) (subscript "1")) ... #,(elem (scheme sig) (subscript "n")) -> sig)) ] Ggf. schreiben Sie außerdem Signaturen für das Prädikat und die Selektoren: -@schemeblock[ +@racketblock[ (: pred? (any -> boolean)) (: #,(elem (scheme select) (subscript "1")) (sig -> #,(elem (scheme sig) (subscript "1")))) ... @@ -109,8 +109,8 @@ Wenn ein Argument einer Prozedur zusammengesetzt ist, stellen Sie zunächst fest, von welchen Komponenten des Records das Ergebnis der Prozeduren abhängt. -Schreiben Sie dann für jede Komponente @scheme[(select a)] in die -Schablone, wobei @scheme[select] der Selektor der Komponente und @scheme[a] der Name +Schreiben Sie dann für jede Komponente @racket[(select a)] in die +Schablone, wobei @racket[select] der Selektor der Komponente und @racket[a] der Name des Parameters der Prozedur ist. Vervollständigen Sie die Schablone, indem Sie einen Ausdruck @@ -124,23 +124,23 @@ enthält einen Aufruf des Konstruktors des zugehörigen Record-Typs. Wenn bei der Datenanalyse gemischte Daten auftauchen, schreiben Sie eine Datendefinition der Form: -@schemeblock[ -(code:comment @#,t{Ein @scheme[x] ist eins der Folgenden:}) +@racketblock[ +(code:comment @#,t{Ein @racket[x] ist eins der Folgenden:}) (code:comment @#,t{- @elem[(scheme Sorte) (subscript "1")] (@elem[(scheme sig) (subscript "1")])}) (code:comment @#,t{...}) (code:comment @#,t{- @elem[(scheme Sorte) (subscript "n")] (@elem[(scheme sig) (subscript "n")])}) -(code:comment @#,t{Name: @scheme[sig]}) +(code:comment @#,t{Name: @racket[sig]}) ] Dabei sind die @elem[(scheme Sorte) (subscript "i")] umgangssprachliche Namen für die möglichen Sorten, die ein Wert aus diesen gemischten Daten annehmen kann. Die @elem[(scheme sig) (subscript "i")] sind die zu den Sorten -gehörenden Signaturen. Der Name @scheme[sig] ist für die Verwendung als +gehörenden Signaturen. Der Name @racket[sig] ist für die Verwendung als Signatur. Aus der Datendefinition entsteht eine Signaturdefinition folgender Form: -@schemeblock[ +@racketblock[ (define sig (signature (mixed #,(elem (scheme sig) (subscript "1")) @@ -153,7 +153,7 @@ Wenn die Prädikate für die einzelnen Sorten @elem[(scheme pred?) Schablone für eine Prozedur, die gemischte Daten konsumiert, die folgende Form: -@schemeblock[ +@racketblock[ (: proc (sig -> ...)) (define proc @@ -172,7 +172,7 @@ Konstruktionsanleitungen der einzelnen Sorten ausgefüllt. Eine Prozedur, die eine Liste konsumiert, hat die folgende Schablone: -@schemeblock[ +@racketblock[ (: proc ((list-of elem) -> ...)) (define proc @@ -184,18 +184,18 @@ Schablone: ... (proc (rest lis)) ...)))) ] -Dabei ist @scheme[elem] die Signatur für die Elemente der Liste. Dies -kann eine Signaturvariable (@scheme[%a], @scheme[%b], ...) sein, falls +Dabei ist @racket[elem] die Signatur für die Elemente der Liste. Dies +kann eine Signaturvariable (@racket[%a], @racket[%b], ...) sein, falls die Prozedur unabhängig von der Signatur der Listenelemente ist. -Füllen Sie in der Schablone zuerst den @scheme[empty?]-Zweig aus. +Füllen Sie in der Schablone zuerst den @racket[empty?]-Zweig aus. Vervollständigen Sie dann den anderen Zweig unter der Annahme, daß -der rekursive Aufruf @scheme[(proc (rest lis))] das gewünschte +der rekursive Aufruf @racket[(proc (rest lis))] das gewünschte Ergebnis für den Rest der Liste liefert. Beispiel: -@schemeblock[ +@racketblock[ (: list-sum ((list-of number) -> number)) (define list-sum @@ -212,7 +212,7 @@ Beispiel: Eine Prozedur, die natürliche Zahlen konsumiert, hat die folgende Schablone: -@schemeblock[ +@racketblock[ (: proc (natural -> ...)) (define proc @@ -224,12 +224,12 @@ Schablone: Füllen Sie in der Schablone zuerst den 0-Zweig aus. Vervollständigen Sie dann den anderen Zweig unter der Annahme, daß der rekursive Aufruf -@scheme[(proc (- n 1))] das gewünschte Ergebnis für @scheme[n]-1 +@racket[(proc (- n 1))] das gewünschte Ergebnis für @racket[n]-1 liefert. Beispiel: -@schemeblock[ +@racketblock[ (: factorial (natural -> natural)) (define factorial @@ -244,7 +244,7 @@ Beispiel: Eine Prozedur mit Akkumulator, die Listen konsumiert, hat die folgende Schablone: -@schemeblock[ +@racketblock[ (: proc ((list-of elem) -> ...)) (define proc @@ -262,17 +262,17 @@ folgende Schablone: (... (first lis) ... acc ...)))))) ] -Hier ist @scheme[proc] der Name der zu definierenden Prozedur und -@scheme[proc-helper] der Name der Hilfsprozedur mit Akkumulator. Der -Anfangswert für den Akkumulator ist der Wert von @scheme[z]. Die Signatur @scheme[sig] +Hier ist @racket[proc] der Name der zu definierenden Prozedur und +@racket[proc-helper] der Name der Hilfsprozedur mit Akkumulator. Der +Anfangswert für den Akkumulator ist der Wert von @racket[z]. Die Signatur @racket[sig] ist die Signatur für den Akkumulator. Der -Ausdruck @scheme[(... (first lis) ... acc ...)] -macht aus dem alten Zwischenergebnis @scheme[acc] das neue +Ausdruck @racket[(... (first lis) ... acc ...)] +macht aus dem alten Zwischenergebnis @racket[acc] das neue Zwischenergebnis. Beispiel: -@schemeblock[ +@racketblock[ (: invert ((list-of %a) -> (list-of %a))) (define invert @@ -293,7 +293,7 @@ Beispiel: Eine Prozedur mit Akkumulator, die natürliche Zahlen konsumiert, hat die folgende Schablone: -@schemeblock[ +@racketblock[ (: proc (natural -> ...)) (define proc @@ -307,13 +307,13 @@ folgende Schablone: (proc-helper (- n 1) (... acc ...))))) ] -Dabei ist @scheme[z] das gewünschte Ergebnis für @scheme[n] = 0. Der -Ausdruck @scheme[(... acc ...)] muß den neuen Wert für den +Dabei ist @racket[z] das gewünschte Ergebnis für @racket[n] = 0. Der +Ausdruck @racket[(... acc ...)] muß den neuen Wert für den Akkumulator berechnen. Beispiel: -@schemeblock[ +@racketblock[ (: ! (natural -> natural)) (define ! @@ -332,24 +332,24 @@ Falls ein Wert Zustand enthalten soll, schreiben Sie eine Datendefinition wie bei zusammengesetzten Daten. Schreiben Sie dann eine Record-Definition mit -@scheme[define-record-procedures-2] und legen Sie dabei fest, welche +@racket[define-record-procedures-2] und legen Sie dabei fest, welche Bestandteile veränderbar sein sollen. Geben Sie Mutatoren für die -betroffenen Felder an. Wenn der Selektor für das Feld @scheme[select] -heißt, sollte der Mutator i.d.R. @scheme[set-select!] heißen. Die Form -sieht folgendermaßen aus, wobei an der Stelle @scheme[k] ein +betroffenen Felder an. Wenn der Selektor für das Feld @racket[select] +heißt, sollte der Mutator i.d.R. @racket[set-select!] heißen. Die Form +sieht folgendermaßen aus, wobei an der Stelle @racket[k] ein veränderbares Feld steht: -@schemeblock[ +@racketblock[ (define-record-procedures-2 sig constr pred? (#,(elem (scheme select) (subscript "1")) ... (#,(elem (scheme s) (subscript "k")) #,(elem (scheme mutate) (subscript "k"))) ... #,(elem (scheme s) (subscript "n")))) ] In der Schablone für Prozeduren, die den Zustand eines -Record-Arguments @scheme[r] ändern, benutzen Sie den dazugehörigen Mutator -@elem[(scheme mutate) (subscript "k")] Wenn @scheme[a] der Ausdruck für den neuen Wert der Komponente ist, -sieht der Aufruf folgendermaßen aus: @scheme[(#,(elem (scheme mutate) (subscript "k")) r a)]. +Record-Arguments @racket[r] ändern, benutzen Sie den dazugehörigen Mutator +@elem[(scheme mutate) (subscript "k")] Wenn @racket[a] der Ausdruck für den neuen Wert der Komponente ist, +sieht der Aufruf folgendermaßen aus: @racket[(#,(elem (scheme mutate) (subscript "k")) r a)]. Um mehrere Komponenten in einer Prozedur zu verändern, oder um einen sinnvollen Rückgabewert nach einer Mutation zu liefern, benutzen Sie -@scheme[begin]. +@racket[begin]. diff --git a/collects/deinprogramm/scribblings/line3d.scrbl b/collects/deinprogramm/scribblings/line3d.scrbl index b6a341bd1f..d55a2bd9d5 100644 --- a/collects/deinprogramm/scribblings/line3d.scrbl +++ b/collects/deinprogramm/scribblings/line3d.scrbl @@ -22,21 +22,21 @@ Dieses teachpack definiert Prozeduren für lineare Algebra und 3D-Rendering: @declare-exporting[teachpack/deinprogramm/line3d] @defthing[render-scene (natural natural (list-of line3d) matrix4x4 -> image)]{ - Der Aufruf @scheme[(render-scene width height scene camera-matrix)]erzeugt die Szene - in ein Bild mit Breite @scheme[width] und Höhe @scheme[height]. Position, - Orientierung und Projektion werden durch die @scheme[camera-matrix] festgelegt. + Der Aufruf @racket[(render-scene width height scene camera-matrix)]erzeugt die Szene + in ein Bild mit Breite @racket[width] und Höhe @racket[height]. Position, + Orientierung und Projektion werden durch die @racket[camera-matrix] festgelegt. } @defthing[create-camera-matrix (vec3 vec3 number natural natural -> matrix4x4)]{ - Der Aufruf @scheme[(create-camera-matrix position lookat vertical-fov width height)] - erzeugt eine 4x4 Matrix. Diese kodiert eine Kamera an der Position @scheme[position], die - auf die Position @scheme[lookat] schaut. - @scheme[vertical-fov] bezeichnet das @deftech{vertikale Feld} der Szene. + Der Aufruf @racket[(create-camera-matrix position lookat vertical-fov width height)] + erzeugt eine 4x4 Matrix. Diese kodiert eine Kamera an der Position @racket[position], die + auf die Position @racket[lookat] schaut. + @racket[vertical-fov] bezeichnet das @deftech{vertikale Feld} der Szene. } Zum Beispiel: -@schemeblock[ +@racketblock[ (code:comment @#,t{scene-data (simple box example)}) (define box (create-box 1.0 1.0 1.0 "brown")) @@ -56,156 +56,156 @@ Zum Beispiel: @section[#:tag "3Dvectors"]{3D-Vektoren} @defthing[vec3 signature]{ - Ein @deftech{3D-Vektor} (Name: @scheme[vec3]) ist ein Record, der durch den Aufruf @scheme[make-vec3] erstellt wird. + Ein @deftech{3D-Vektor} (Name: @racket[vec3]) ist ein Record, der durch den Aufruf @racket[make-vec3] erstellt wird. } @defthing[make-vec3 (number number number -> vec3)]{ - @scheme[(make-vec3 x y z)] erstellt einen Vektor (x,y,z). + @racket[(make-vec3 x y z)] erstellt einen Vektor (x,y,z). } @defthing[add-vec3 (vec3 vec3 -> vec3)]{ - @scheme[(add-vec3 a b)] gibt die Summe von @scheme[a] und @scheme[b] zurück. + @racket[(add-vec3 a b)] gibt die Summe von @racket[a] und @racket[b] zurück. } @defthing[sub-vec3 (vec3 vec3 -> vec3)]{ - @scheme[(sub-vec3 a b)] gibt die Differenz zwischen @scheme[a] und @scheme[b] zurück. + @racket[(sub-vec3 a b)] gibt die Differenz zwischen @racket[a] und @racket[b] zurück. } @defthing[mult-vec3 (vec3 number -> vec3)]{ - @scheme[(mult-vec3 a s)] gibt den das Produkt von @scheme[a] und @scheme[s] zurück. + @racket[(mult-vec3 a s)] gibt den das Produkt von @racket[a] und @racket[s] zurück. } @defthing[div-vec3 (vec3 number -> vec3)]{ - @scheme[(div-vec3 a s)] gibt den das Produkt von @scheme[a] und dem Kehrwert von @scheme[s] zurück. + @racket[(div-vec3 a s)] gibt den das Produkt von @racket[a] und dem Kehrwert von @racket[s] zurück. } @defthing[dotproduct-vec3 (vec3 vec3 -> number)]{ - @scheme[(dotproduct-vec3 a b)] gibt das Produkt von @scheme[a] und @scheme[b] zurück. + @racket[(dotproduct-vec3 a b)] gibt das Produkt von @racket[a] und @racket[b] zurück. } @defthing[normQuad-vec3 (vec3 -> number)]{ - @scheme[(normQuad-vec3 a)] gibt die quadrierte Norm/Länge |@scheme[a]|² eines Vektors @scheme[a] zurück (Quadrat der Euklidischen Norm.) + @racket[(normQuad-vec3 a)] gibt die quadrierte Norm/Länge |@racket[a]|² eines Vektors @racket[a] zurück (Quadrat der Euklidischen Norm.) } @defthing[norm-vec3 (vec3 -> number)]{ - @scheme[(norm-vec3 a)] gibt die Norm/Länge |@scheme[a]| eines Vektors a zurück (Euklidische Norm.) + @racket[(norm-vec3 a)] gibt die Norm/Länge |@racket[a]| eines Vektors a zurück (Euklidische Norm.) } @defthing[normalize-vec3 (vec3 -> vec3)]{ - @scheme[(normalize-vec3 a)] normalisiert @scheme[a]. + @racket[(normalize-vec3 a)] normalisiert @racket[a]. } @defthing[crossproduct-vec3 (vec3 vec3-> vec3)]{ - @scheme[(crossproduct-vec3 a b)] gibt das Kreuzprodukt von @scheme[a] -und @scheme[b] zurück (einen Vektor der senkrecht auf @scheme[a] und @scheme[b] steht). + @racket[(crossproduct-vec3 a b)] gibt das Kreuzprodukt von @racket[a] +und @racket[b] zurück (einen Vektor der senkrecht auf @racket[a] und @racket[b] steht). } @;------------------------------------------------------------------------------------- @section[#:tag "4Dvectors"]{4D-Vektoren} @defthing[vec4 signature]{ - Ein @deftech{4D-Vektor} @scheme[vec4] ist ein 4D-Vektor. Folgende Prozeduren werden bereitgestellt: + Ein @deftech{4D-Vektor} @racket[vec4] ist ein 4D-Vektor. Folgende Prozeduren werden bereitgestellt: } @defthing[make-vec4 (number number number number -> vec4)]{ - @scheme[(make-vec4 a b c d)] erzeugt einen Vektor aus @scheme[a], @scheme[b], @scheme[c] und @scheme[d]. + @racket[(make-vec4 a b c d)] erzeugt einen Vektor aus @racket[a], @racket[b], @racket[c] und @racket[d]. } @defthing[add-vec4 (vec4 vec4 -> vec4)]{ -@scheme[(add-vec4 a b)] gibt die Summe von @scheme[a] und @scheme[b] zurück. +@racket[(add-vec4 a b)] gibt die Summe von @racket[a] und @racket[b] zurück. } @defthing[sub-vec4 (vec4 vec4 -> vec4)]{ - @scheme[(sub-vec4 a b)] gibt die Differenz zwischen @scheme[a] und @scheme[b] zurück. + @racket[(sub-vec4 a b)] gibt die Differenz zwischen @racket[a] und @racket[b] zurück. } @defthing[mult-vec4 (vec4 number -> vec4)]{ - @scheme[(mult-vec4 a s)] gibt den das Produkt von @scheme[a] und @scheme[s] zurück. + @racket[(mult-vec4 a s)] gibt den das Produkt von @racket[a] und @racket[s] zurück. } @defthing[div-vec4 (vec4 number -> vec4)]{ - @scheme[(div-vec4 a s)] gibt den das Produkt von @scheme[a] und dem Kehrwert von @scheme[s] zurück. + @racket[(div-vec4 a s)] gibt den das Produkt von @racket[a] und dem Kehrwert von @racket[s] zurück. } @defthing[dotproduct-vec4 (vec3 vec4 -> number)]{ - @scheme[(dotproduct-vec4 a b)] gibt die quadrierte Norm/Länge |@scheme[a]|² eines Vektors @scheme[a] zurück (Quadrat der Euklidischen Norm.) + @racket[(dotproduct-vec4 a b)] gibt die quadrierte Norm/Länge |@racket[a]|² eines Vektors @racket[a] zurück (Quadrat der Euklidischen Norm.) } @defthing[normQuad-vec4 (vec4 -> number)]{ - @scheme[(normQuad-vec4 a)] gibt die quadrierte Norm/Länge |@scheme[a]|² eines Vektors @scheme[a] zurück (Quadrat der Euklidischen Norm.) + @racket[(normQuad-vec4 a)] gibt die quadrierte Norm/Länge |@racket[a]|² eines Vektors @racket[a] zurück (Quadrat der Euklidischen Norm.) } @defthing[norm-vec4 (vec4 -> number)]{ - @scheme[(norm-vec4 a)] gibt die Norm/Länge |a| eines Vektors a zurück (Euklidische Norm) + @racket[(norm-vec4 a)] gibt die Norm/Länge |a| eines Vektors a zurück (Euklidische Norm) } @defthing[normalize-vec4 (vec4 -> vec4)]{ - @scheme[(normalize-vec4 a)] normalisiert @scheme[a]. + @racket[(normalize-vec4 a)] normalisiert @racket[a]. } @defthing[expand-vec3 (vec3 number -> vec4)]{ - @scheme[(expand-vec3 a s)] gibt den 4D-Vektor mit @scheme[s] als letze Komponente zurück (erweitert @scheme[a] mit @scheme[s]). + @racket[(expand-vec3 a s)] gibt den 4D-Vektor mit @racket[s] als letze Komponente zurück (erweitert @racket[a] mit @racket[s]). } @;------------------------------------------------------------------------------------- @section[#:tag "4x4matrix"]{4x4 Matrizen} @defthing[matrix4x4 signature]{ - Eine @deftech{Matrix} @scheme[matrix4x4] ist ein Record, der durch den Aufruf @scheme[make-matrix4x4] erstellt wird. + Eine @deftech{Matrix} @racket[matrix4x4] ist ein Record, der durch den Aufruf @racket[make-matrix4x4] erstellt wird. } @defthing[make-matrix4x4 (vec4 vec4 vec4 vec4 -> matrix4x4)]{ - @scheme[(make-matrix4x4 a b c d)] erstellt eine Matrix aus @scheme[a], @scheme[b], @scheme[c] und @scheme[d]. + @racket[(make-matrix4x4 a b c d)] erstellt eine Matrix aus @racket[a], @racket[b], @racket[c] und @racket[d]. } @defthing[create-matrix4x4 (vec3 vec3 vec3 vec3 -> matrix4x4)]{ - @scheme[(create-matrix4x4 a b c d)] erweitert jeden Vektor in einen 4D-Vektor und kombiniert diese zu - einer Matrix @scheme[a], @scheme[b], @scheme[c] und @scheme[d], wobei - @scheme[a], @scheme[b], @scheme[c] mit 0 und @scheme[d] mit 1 erweitert wird, um eine homogene Matrix zu erzeugen. + @racket[(create-matrix4x4 a b c d)] erweitert jeden Vektor in einen 4D-Vektor und kombiniert diese zu + einer Matrix @racket[a], @racket[b], @racket[c] und @racket[d], wobei + @racket[a], @racket[b], @racket[c] mit 0 und @racket[d] mit 1 erweitert wird, um eine homogene Matrix zu erzeugen. } @defthing[transpose-matrix4x4 (matrix4x4 -> matrix4x)]{ - @scheme[(transpose-matrix4x4 m)] erstellt die transponierte Matrix @scheme[m]^@scheme[T]. + @racket[(transpose-matrix4x4 m)] erstellt die transponierte Matrix @racket[m]^@racket[T]. } @defthing[multiply-matrix-vec4 (matrix vec4 -> vec4)]{ - @scheme[(multiply-matrix-vec4 m v)] gibt die Matrix @scheme[m]@scheme[v] zurück. Die @scheme[w]-Komponente ist nicht normalisiert. + @racket[(multiply-matrix-vec4 m v)] gibt die Matrix @racket[m]@racket[v] zurück. Die @racket[w]-Komponente ist nicht normalisiert. } @defthing[transform-vec3 (matrix4x4 vec3 -> vec3)]{ - @scheme[(transform-vec3 m v)] erweitert @scheme[v] mit 1, multipliziert @scheme[m] mit @scheme[v] und dividiert das Ergebnis mit @scheme[w]. + @racket[(transform-vec3 m v)] erweitert @racket[v] mit 1, multipliziert @racket[m] mit @racket[v] und dividiert das Ergebnis mit @racket[w]. } @defthing[multiply-matrix (matrix4x4 matrix4x4 -> matrix4x4)]{ - @scheme[(multiply-matrix a b)] gibt die Matrix @scheme[a]*@scheme[b] zurück. + @racket[(multiply-matrix a b)] gibt die Matrix @racket[a]*@racket[b] zurück. } @defthing[create-translation-matrix (vec3 -> matrix4x4)]{ - @scheme[(create-translation-matrix v)] gibt die Translations-Matrix zurück. + @racket[(create-translation-matrix v)] gibt die Translations-Matrix zurück. } @defthing[create-rotation-x-matrix (number -> matrix4x4)]{ - @scheme[(create-rotation-x-matrix a)] gibt eine Rotations-Matrix zurück die um die X-Achse mit dem Winkel @scheme[a] rotiert. + @racket[(create-rotation-x-matrix a)] gibt eine Rotations-Matrix zurück die um die X-Achse mit dem Winkel @racket[a] rotiert. } @defthing[create-rotation-y-matrix (number -> matrix4x4)]{ - @scheme[(create-rotation-y-matrix a)] gibt eine Rotations-Matrix zurück die um die Y-Achse mit dem Winkel @scheme[a] rotiert. + @racket[(create-rotation-y-matrix a)] gibt eine Rotations-Matrix zurück die um die Y-Achse mit dem Winkel @racket[a] rotiert. } @defthing[create-rotation-z-matrix (number -> matrix4x4)]{ - @scheme[(create-rotation-z-matrix a)] gibt eine Rotations-Matrix zurück die um die Z-Achse mit dem Winkel @scheme[a] rotiert. + @racket[(create-rotation-z-matrix a)] gibt eine Rotations-Matrix zurück die um die Z-Achse mit dem Winkel @racket[a] rotiert. } @defthing[create-lookat-matrix (vec3 vec3 vec3 -> matrix4x4)]{ - @scheme[(create-lookat-matrix pos lookat up)] gibt eine Kameramatrix. Ursprungspunkt ist @scheme[pos], die Z-Achse zeigt auf @scheme[lookat]. + @racket[(create-lookat-matrix pos lookat up)] gibt eine Kameramatrix. Ursprungspunkt ist @racket[pos], die Z-Achse zeigt auf @racket[lookat]. } @defthing[create-projection-matrix (number -> matrix4x4)]{ - @scheme[(create-projection-matrix vertical-fov/2)] erzeugt eine Projektions-Matrix. @scheme[vertical-fov]/2 gibt den vertikalen Winkel der Ansicht dividiert durch 2 an. + @racket[(create-projection-matrix vertical-fov/2)] erzeugt eine Projektions-Matrix. @racket[vertical-fov]/2 gibt den vertikalen Winkel der Ansicht dividiert durch 2 an. } @defthing[create-viewport-matrix (natural natural -> matrix4x4)]{ - @scheme[(create-viewport-matrix width height)] gibt einen Ausschnitt an. + @racket[(create-viewport-matrix width height)] gibt einen Ausschnitt an. } @;------------------------------------------------------------------------------------- @@ -213,12 +213,12 @@ und @scheme[b] zurück (einen Vektor der senkrecht auf @scheme[a] und @scheme[b] @defthing[line3d signature]{ - Eine @deftech{3d-Linie} @scheme[line3d] ist ein Record, der durch den Aufruf @scheme[make-line3d] erstellt wird und eine farbige Linie zwischen zwei Punkten + Eine @deftech{3d-Linie} @racket[line3d] ist ein Record, der durch den Aufruf @racket[make-line3d] erstellt wird und eine farbige Linie zwischen zwei Punkten im 3-dimensionalen Raum darstellt. } @defthing[make-line3d (vec3 vec3 color -> line3d)]{ - @scheme[(make-line3d a b col)] erstellt eine 3D-Linie zwischen Punkt @scheme[a] und Punkt @scheme[b] mit der Farbe @scheme[col]. + @racket[(make-line3d a b col)] erstellt eine 3D-Linie zwischen Punkt @racket[a] und Punkt @racket[b] mit der Farbe @racket[col]. } @defthing[line3d-a (line3d -> vec3)]{ @@ -231,10 +231,10 @@ und @scheme[b] zurück (einen Vektor der senkrecht auf @scheme[a] und @scheme[b] extrahiert die Farbe einer 3D-Linie.} @defthing[create-box (number number number color -> (list-of line3d))]{ - @scheme[(create-box width height depth color)] erstellt eine Box am Punkt (0,0,0) in den angebenen Ausmaßen. + @racket[(create-box width height depth color)] erstellt eine Box am Punkt (0,0,0) in den angebenen Ausmaßen. } @defthing[transform-primitive-list ((list-of line3d) matrix4x4 -> (list-of line3d))]{ - @scheme[(transform-primitive-list scene transformationr)] wendet @scheme[transformation] auf alle Punkte der Linien in @scheme[scene] an und gibt + @racket[(transform-primitive-list scene transformationr)] wendet @racket[transformation] auf alle Punkte der Linien in @racket[scene] an und gibt diese zurück. } diff --git a/collects/deinprogramm/scribblings/sound.scrbl b/collects/deinprogramm/scribblings/sound.scrbl index c596a583ab..3703bdf010 100644 --- a/collects/deinprogramm/scribblings/sound.scrbl +++ b/collects/deinprogramm/scribblings/sound.scrbl @@ -19,12 +19,12 @@ Rechner. @defthing[play-sound-file (string -> unspecific)]{ Der Aufruf -@scheme[(play-sound-file f)] spielt die Audio-Datei mit dem Namen -@scheme[f] ab.} +@racket[(play-sound-file f)] spielt die Audio-Datei mit dem Namen +@racket[f] ab.} @defthing[background-play-sound-file (string -> unspecific)]{ Der Aufruf -@scheme[(background-play-sound-file f)] spielt die Audio-Datei mit dem Namen -@scheme[f] im Hintergrund ab, also ohne dass das Scheme-Programm anhält.} +@racket[(background-play-sound-file f)] spielt die Audio-Datei mit dem Namen +@racket[f] im Hintergrund ab, also ohne dass das Scheme-Programm anhält.} diff --git a/collects/deinprogramm/scribblings/std-grammar.rkt b/collects/deinprogramm/scribblings/std-grammar.rkt index d0b5175e2e..b4ca220b9c 100644 --- a/collects/deinprogramm/scribblings/std-grammar.rkt +++ b/collects/deinprogramm/scribblings/std-grammar.rkt @@ -5,16 +5,16 @@ (for-label deinprogramm/DMdA-beginner)) (provide prim-nonterms - schemegrammar*-DMdA) + racketgrammar*-DMdA) (define ex-str "Dies ist eine Zeichenkette, die \" enthält.") -(define-syntax-rule (schemegrammar*-DMdA +(define-syntax-rule (racketgrammar*-DMdA #:literals (lit ...) - (def-rule ...) - (prod ...) + (def-rule ...) + (prod ...) (expr-rule ...)) - (schemegrammar* + (racketgrammar* #:literals (define define-record-procedures lambda cond if and or let letrec let* begin #;require lib planet check-expect check-within check-error @@ -24,7 +24,7 @@ (... [program (code:line def-or-expr ...)]) [def-or-expr definition expr - test-case + test-case #;library-require] [definition @#,scheme[(define id expr)] @#,scheme[(define-record-procedures id id id (id (... ...)))] @@ -80,7 +80,7 @@ (make-splice (list -@t{Ein @scheme[_id] ist eine Folge von Zeichen, die weder Leerzeichen +@t{Ein @racket[_id] ist eine Folge von Zeichen, die weder Leerzeichen noch eins der folgenden Zeichen enthält:} @t{@hspace[2] @litchar{"} @litchar{,} @litchar{'} @litchar{`} @@ -88,10 +88,10 @@ noch eins der folgenden Zeichen enthält:} @litchar["{"] @litchar["}"] @litchar{|} @litchar{;} @litchar{#}} -@t{Ein @scheme[_number] ist eine Zahl wie z.B. @scheme[123], @scheme[3/2] oder -@scheme[5.5].} +@t{Ein @racket[_number] ist eine Zahl wie z.B. @racket[123], @racket[3/2] oder +@racket[5.5].} -@t{Ein @scheme[_string] ist eine Zeichenkette, und durch ein Paar von @litchar{"} umschlossen. -So sind z.B. @scheme["abcdef"], -@scheme["This is a string"] und @scheme[#,ex-str] Zeichenketten.} +@t{Ein @racket[_string] ist eine Zeichenkette, und durch ein Paar von @litchar{"} umschlossen. +So sind z.B. @racket["abcdef"], +@racket["This is a string"] und @racket[#,ex-str] Zeichenketten.} ))) diff --git a/collects/deinprogramm/scribblings/turtle.scrbl b/collects/deinprogramm/scribblings/turtle.scrbl index db3f5721cd..9fa3cf5534 100644 --- a/collects/deinprogramm/scribblings/turtle.scrbl +++ b/collects/deinprogramm/scribblings/turtle.scrbl @@ -20,9 +20,9 @@ Zeichnen wird dabei durch das Bewegen einer virtuellen Schildkröte Befehle bewegt werden: @itemize[ - @item{@scheme[(move n)] Bewegt die Schildkröte um @scheme[n] Pixel ohne zu zeichnen.} - @item{@scheme[(draw n)] Bewegt die Schildkröte um @scheme[n] Pixel und zeichnet dabei.} - @item{@scheme[(turn n)] Dreht die Schildkröte um n Grad im Uhrzeigersinn.} + @item{@racket[(move n)] Bewegt die Schildkröte um @racket[n] Pixel ohne zu zeichnen.} + @item{@racket[(draw n)] Bewegt die Schildkröte um @racket[n] Pixel und zeichnet dabei.} + @item{@racket[(turn n)] Dreht die Schildkröte um n Grad im Uhrzeigersinn.} ] Wir stellen jetzt ein Teachpack für DrRacket vor, mit dessen Hilfe @@ -32,9 +32,9 @@ solche Turtle-Grafiken erstellt werden können. Unser Ziel ist es, in diesem Tutorial ein Quadrat mithilfe der Prozeduren des Teachpacks zu zeichnen. Aus diesem Grund müssen wir -zunächst mit der Prozedur @scheme[draw] eine Linie nach rechts malen. Die +zunächst mit der Prozedur @racket[draw] eine Linie nach rechts malen. Die initiale Ausgansposition der Turtle ist in der Bildmitte mit Blick -nach rechts. Mit @scheme[(draw 20)] bewegen wir die Turtle dann 20 Pixel nach +nach rechts. Mit @racket[(draw 20)] bewegen wir die Turtle dann 20 Pixel nach rechts und zeichnen dabei. Um das resultierende Bild zu sehen ist, müssen wir die Turtle mittels der Prozedur run laufen lassen. Die restlichen Parameter für run sind die Höhe und die Breite des Bildes @@ -42,7 +42,7 @@ sowie die Farbe, in der gezeichnet werden soll. Geben Sie also folgenden Befehl in die REPL ein, um Ihre erste Turtle-Grafik zu erstellen: -@schemeblock[ +@racketblock[ (run (draw 20) 100 100 "red") ] @@ -53,14 +53,14 @@ Sie erhalten dann eine Ausgabe wie die folgende: Nun vervollständigen wir die Linie zu einem rechten Winkel: wir drehen die Turtle um 90° nach rechts und zeichnen dann eine Line der Länge 20 Pixel nach unten. Zum Drehen einer Turtle verwenden wir die Prozedur -@scheme[turn]. +@racket[turn]. Da wir ein Quadrat aus zwei rechten Winkeln zusammensetzen können, abstrahieren wir über das Zeichnen des rechten Winkels. Dazu schreiben -wir eine Prozedur @scheme[right-angle] die als Parameter eine Turtle +wir eine Prozedur @racket[right-angle] die als Parameter eine Turtle erhält: -@schemeblock[ +@racketblock[ (: right-angle (turtle -> turtle)) (define right-angle (lambda (t1) @@ -78,7 +78,7 @@ Um das Quadrat komplett zu zeichnen, sollen nun zwei rechte Winkel verwendet werden. Wir zeichnen also einen rechten Winkel, drehen uns um 90° nach rechts, und zeichnen einen zweiten rechten Winkel. -@schemeblock[ +@racketblock[ (: square (turtle -> turtle)) (define square (lambda (t1) @@ -95,27 +95,27 @@ So sieht das Ergebnis aus: @subsection{Verbesserungen} An dem Beispiel ist leicht zu sehen, dass es zum Zeichnen mit Hilfe -von Turtle-Grafik oft erforderlich ist, Zwischenwerte wie @scheme[t1], -@scheme[t2] etc., an die nächste Prozedur weiterzureichen, die Werte +von Turtle-Grafik oft erforderlich ist, Zwischenwerte wie @racket[t1], +@racket[t2] etc., an die nächste Prozedur weiterzureichen, die Werte ansonsten aber nicht weiterverwendet werden. Beispielsweise werden in -der obigen Definition von square die Variablen @scheme[t1], ..., -@scheme[t4] nur gebraucht, um die Prozeduren @scheme[right-angle], -@scheme[(turn -90)] und @scheme[right-angle] hintereinander +der obigen Definition von square die Variablen @racket[t1], ..., +@racket[t4] nur gebraucht, um die Prozeduren @racket[right-angle], +@racket[(turn -90)] und @racket[right-angle] hintereinander auszuführen. Um solche Fälle einfach programmieren zu können, enthält das -Turtle-Teachpack die Prozedur @scheme[sequence]. Damit können wir eine -zu @scheme[right-angle] äquivalente Version wesentlicher einfacher +Turtle-Teachpack die Prozedur @racket[sequence]. Damit können wir eine +zu @racket[right-angle] äquivalente Version wesentlicher einfacher aufschreiben: -@schemeblock[ +@racketblock[ (define right-angle2 (sequence (draw 20) (turn -90) (draw 20))) ] -Ebenso wie @scheme[right-angle] können wir square leichter schreiben als: +Ebenso wie @racket[right-angle] können wir square leichter schreiben als: -@schemeblock[ +@racketblock[ (define square2 (sequence right-angle (turn -90) right-angle)) ] @@ -135,7 +135,7 @@ so ändert dies die Farbe mit der gezeichnet wird. Folgender Code -@schemeblock[ +@racketblock[ (define square3 (sequence right-angle (turn -90) (set-color "blue") right-angle)) ] @@ -173,6 +173,6 @@ der gezeichnet wird. @defthing[sequence ((turtle -> turtle) ... -> (turtle -> turtle))]{ Diese Prozedur nimmt eine beliebige Anzahl von Turtle-Veränderungen -(d.h. Prozeduren mit Signatur @scheme[turtle -> turtle]) und erstellt +(d.h. Prozeduren mit Signatur @racket[turtle -> turtle]) und erstellt eine neue Prozedur, die die Veränderungen der Reihe nach von links nach rechts abarbeitet.} diff --git a/collects/deinprogramm/scribblings/world.scrbl b/collects/deinprogramm/scribblings/world.scrbl index 2be1872b45..bf95c2a52d 100644 --- a/collects/deinprogramm/scribblings/world.scrbl +++ b/collects/deinprogramm/scribblings/world.scrbl @@ -19,60 +19,60 @@ Es enthält alle Prozeduren aus dem @declare-exporting[teachpack/deinprogramm/world #:use-sources (deinprogramm/world)] @defthing[world signature]{ -Eine @deftech{Welt} (Name: @scheme[world]) ist die Repräsentation des Zustands, +Eine @deftech{Welt} (Name: @racket[world]) ist die Repräsentation des Zustands, der durch die Animation abgebildet wird. } @defthing[mouse-event-kind signature]{ -@scheme[(one-of "enter" "leave" "motion" "left-down" "left-up" "middle-down" "middle-up" "right-down" "right-up")] +@racket[(one-of "enter" "leave" "motion" "left-down" "left-up" "middle-down" "middle-up" "right-down" "right-up")] -Eine @deftech{Mausereignis-Art} (Name: @scheme[mouse-event-kind]) +Eine @deftech{Mausereignis-Art} (Name: @racket[mouse-event-kind]) bezeichnet die Art eines Maus-Ereignisses: -@scheme["enter"] bedeutet, daß der Mauszeiger gerade -in das Fenster hinein bewegt wurde. @scheme["leave"] bedeutet, daß der +@racket["enter"] bedeutet, daß der Mauszeiger gerade +in das Fenster hinein bewegt wurde. @racket["leave"] bedeutet, daß der Mauszeiger gerade aus dem Fenster heraus bewegt wurde. -@scheme["motion"] bedeutet, daß der Mauszeiger innerhalb des +@racket["motion"] bedeutet, daß der Mauszeiger innerhalb des Fensters bewegt wurde. Die anderen Zeichenketten bedeuten, daß der entsprechende Mausknopf gedrückt oder losgelassen wurde.} @defthing[big-bang (natural natural number world -> (one-of #t))]{ -Der Aufruf @scheme[(big-bang w h n w)] -erzeugt eine Leinwand mit Breite @scheme[w] und Höhe -@scheme[h], startet die Uhr, die alle @scheme[n] Sekunden -tickt, und macht @scheme[w] zur ersten Welt.} +Der Aufruf @racket[(big-bang w h n w)] +erzeugt eine Leinwand mit Breite @racket[w] und Höhe +@racket[h], startet die Uhr, die alle @racket[n] Sekunden +tickt, und macht @racket[w] zur ersten Welt.} @defthing[on-tick-event ((world -> world) -> (one-of #t))]{ -Der Aufruf @scheme[(on-tick-event tock)] -meldet @scheme[tock] +Der Aufruf @racket[(on-tick-event tock)] +meldet @racket[tock] als Prozedur an, die bei jedem Uhren-Tick aufgerufen wird, um aus der alten Welt eine neue zu machen.} @defthing[on-key-event ((world string -> world) -> (one-of #t))]{ -Der Aufruf @scheme[(on-key-event change)] -meldet @scheme[change] +Der Aufruf @racket[(on-key-event change)] +meldet @racket[change] als Prozedur an, die bei jedem Tastendruck aufgerufen wird, um aus der alten Welt eine neue zu machen. Dabei wird als Argument eine Zeichenkette übergeben, welche die Taste darstellt, also -@scheme["a"] für die A-Taste etc., sowie @scheme["up"], -@scheme["down"], @scheme["left"], und @scheme["right"] -für die entsprechenden Pfeiltasten und @scheme["wheel-up"] für die -Bewegung des Mausrads nach oben und @scheme["wheel-down"] für die +@racket["a"] für die A-Taste etc., sowie @racket["up"], +@racket["down"], @racket["left"], und @racket["right"] +für die entsprechenden Pfeiltasten und @racket["wheel-up"] für die +Bewegung des Mausrads nach oben und @racket["wheel-down"] für die Bewegung des Mausrads nach unten.} @defthing[on-mouse-event ((world natural natural mouse-event-kind -> world) -> (one-of #t))]{ -Der Aufruf @scheme[(on-mouse-event change)] -meldet @scheme[change] +Der Aufruf @racket[(on-mouse-event change)] +meldet @racket[change] als Prozedur an, die bei jedem Mausereignis aufgerufen wird, um aus -der alten Welt eine neue zu machen. Die @scheme[change]-Prozedur -wird als @scheme[(change w x y k)] aufgerufen. Dabei ist @scheme[w] -die alte Welt, @scheme[x] und @scheme[y] die Koordinaten des -Mauszeigers, und @scheme[k] die Art des Mausereignisses.} +der alten Welt eine neue zu machen. Die @racket[change]-Prozedur +wird als @racket[(change w x y k)] aufgerufen. Dabei ist @racket[w] +die alte Welt, @racket[x] und @racket[y] die Koordinaten des +Mauszeigers, und @racket[k] die Art des Mausereignisses.} @defthing[on-redraw ((world -> image) -> (one-of #t))]{ -Der Aufruf @scheme[(world->image world->image)] +Der Aufruf @racket[(world->image world->image)] meldet die -Prozedur @scheme[world->image] an, die aus einer Welt +Prozedur @racket[world->image] an, die aus einer Welt ein Bild macht, das auf der Leinwand dargestellt wird.} @defthing[end-of-time (string -> world)]{ diff --git a/collects/drracket/private/language-object-contract.rkt b/collects/drracket/private/language-object-contract.rkt index ba650c66dc..b149f0d2bb 100644 --- a/collects/drracket/private/language-object-contract.rkt +++ b/collects/drracket/private/language-object-contract.rkt @@ -88,5 +88,5 @@ #`(provide/doc (thing-doc id contract? - ((reconstitute (schemeblock #,ctc) provide?))))) + ((reconstitute (racketblock #,ctc) provide?))))) '()))))])) diff --git a/collects/drracket/tool-lib.rkt b/collects/drracket/tool-lib.rkt index 71078bdee6..7be9ece5c6 100644 --- a/collects/drracket/tool-lib.rkt +++ b/collects/drracket/tool-lib.rkt @@ -96,7 +96,7 @@ all of the names in the tools library, for use defining keybindings See @racket[read-language] for more details on how language's specify how to opt out. DrRacket will invoke the @tt{get-info} proc from @racket[read-language] with - @indexed-scheme['drscheme:opt-out-toolbar-buttons]. If the result is a list of symbols, the + @indexed-racket['drscheme:opt-out-toolbar-buttons]. If the result is a list of symbols, the listed symbols are opted out. If the result is @racket[#f], all buttons are opted out. The default is the empty list, meaning that all opt-out buttons appear. }) @@ -425,7 +425,7 @@ all of the names in the tools library, for use defining keybindings It looks for both stack trace information in the continuation marks both via the - @schememodname[errortrace/errortrace-key] + @racketmodname[errortrace/errortrace-key] module and via @racket[continuation-mark-set->context]. @@ -1139,9 +1139,8 @@ all of the names in the tools library, for use defining keybindings is initialized to. If unsure of a default, the currently set language in the user's preferences can be obtained via: - @schemeblock[ - (preferences:get (drracket:language-configuration:get-settings-preferences-symbol)) - ] + @racketblock[ + (preferences:get (drracket:language-configuration:get-settings-preferences-symbol))] The @racket[parent] argument is used as the parent to the dialog. diff --git a/collects/dynext/dynext.scrbl b/collects/dynext/dynext.scrbl index 2e5a22491c..4a4fe52cd6 100644 --- a/collects/dynext/dynext.scrbl +++ b/collects/dynext/dynext.scrbl @@ -32,9 +32,9 @@ platform-specific C compiler and linker. any/c]{ Compiles the given input file (C source) to the given output file (a -compiled-object file). The @scheme[quiet?] argument indicates whether +compiled-object file). The @racket[quiet?] argument indicates whether command should be echoed to the current output port. The -@scheme[include-dirs] argument is a list of directories to search for +@racket[include-dirs] argument is a list of directories to search for include files; the Racket installation's @filepath{include} directories are added automatically.} @@ -53,7 +53,7 @@ The default is set by searching for an executable using the defined (and the latter takes precedence). On Windows, the search looks for @filepath{cl.exe}, then @filepath{gcc.exe}, then @filepath{bcc32.exe} (Borland). On Unix, it looks for -@filepath{gcc}, then @filepath{cc}. A @scheme[#f] value indicates that +@filepath{gcc}, then @filepath{cc}. A @racket[#f] value indicates that no compiler could be found.} @defparam[current-extension-compiler-flags @@ -62,14 +62,14 @@ no compiler could be found.} (-> (or/c null? (listof string?)))))]{ A parameter that determines strings passed to the compiler as flags. -See also @scheme[expand-for-compile-variant]. +See also @racket[expand-for-compile-variant]. -On Windows, the default is @scheme[(list "/c" "/O2" "/MT" -_3m-flag-thunk)] for @filepath{cl.exe}, or @scheme[(list "-c" "-O2" +On Windows, the default is @racket[(list "/c" "/O2" "/MT" +_3m-flag-thunk)] for @filepath{cl.exe}, or @racket[(list "-c" "-O2" "-fPIC" _3m-flag-thunk)] for @filepath{gcc.exe} and -@filepath{bcc32.exe}, where @scheme[_3m-flag-thunk] returns -@scheme[(list "-DMZ_PRECISE_GC")] for the 3m variant and null for the -CGC variant. On Unix, the default is usually @scheme[(list "-c" +@filepath{bcc32.exe}, where @racket[_3m-flag-thunk] returns +@racket[(list "-DMZ_PRECISE_GC")] for the 3m variant and null for the +CGC variant. On Unix, the default is usually @racket[(list "-c" "-O2" "-fPIC" _3m-flag-thunk)]. If the @envvar{CFLAGS} or @envvar{MZSCHEME_DYNEXT_COMPILER_FLAGS} environment variable is defined (the latter takes precedence), then its value is parsed as a @@ -84,10 +84,10 @@ A parameter the processes include-path inputs to the compiler; the parameter values takes an include directory path and returns a list of strings for the command line. -On Windows, the default converts @scheme["dir"] to @scheme[(list -"/Idir")] for @filepath{cl.exe}, @scheme[(list "-Idir")] for +On Windows, the default converts @racket["dir"] to @racket[(list +"/Idir")] for @filepath{cl.exe}, @racket[(list "-Idir")] for @filepath{gcc.exe} and @filepath{bcc32.exe}. On Unix, the default -converts @scheme["dir"] to @scheme[(list "-Idir")]. If the +converts @racket["dir"] to @racket[(list "-Idir")]. If the @envvar{CFLAGS} environment variable is defined, then its value is parsed as a list of flags that is appended before the defaults.} @@ -98,7 +98,7 @@ parsed as a list of flags that is appended before the defaults.} A parameter that processes inputs to the compiler; the parameter's values takes an input file path and returns a list of strings for the -command line. The default is @scheme[list].} +command line. The default is @racket[list].} @defparam[current-make-compile-output-strings @@ -109,10 +109,10 @@ A parameter that processes outputs specified for the compiler; the parameter's value takes an output file path and returns a list of strings for the command line. -On Windows, the default converts @scheme["file"] to @scheme[(list -"/Fofile")] for @filepath{cl.exe}, or to @scheme[(list "-o" "file")] +On Windows, the default converts @racket["file"] to @racket[(list +"/Fofile")] for @filepath{cl.exe}, or to @racket[(list "-o" "file")] for @filepath{gcc.exe} and @filepath{bcc32.exe}. On Unix, the -default converts @scheme["file"] to @scheme[(list "-o" "file")].} +default converts @racket["file"] to @racket[(list "-o" "file")].} @defparam[current-extension-preprocess-flags @@ -121,11 +121,11 @@ default converts @scheme["file"] to @scheme[(list "-o" "file")].} A parameters that specifies flags to the compiler preprocessor, instead of to the compiler proper; use these flags for preprocessing -instead of @scheme[current-extension-compiler-flags]. +instead of @racket[current-extension-compiler-flags]. -The defaults are similar to @scheme[current-extension-compiler-flags], -but with @scheme["/E"] (Windows @filepath{cl.exe}) or @scheme["-E"] -and without non-@scheme["-D"] flags.} +The defaults are similar to @racket[current-extension-compiler-flags], +but with @racket["/E"] (Windows @filepath{cl.exe}) or @racket["-E"] +and without non-@racket["-D"] flags.} @defparam[compile-variant @@ -133,7 +133,7 @@ and without non-@scheme["-D"] flags.} (one-of/c 'normal 'cgc '3m)]{ A parameter that indicates the target for compilation, where -@scheme['normal] is an alias for the result of @scheme[(system-type +@racket['normal] is an alias for the result of @racket[(system-type 'gc)]} @@ -146,16 +146,16 @@ particular known compiler. The acceptable names are platforms-specific: @itemize[ -@item{Unix: @scheme['cc] or @scheme['gcc]} -@item{Windows: @scheme['gcc], @scheme['msvc], or @scheme['borland]} -@item{MacOS: @scheme['cw]} +@item{Unix: @racket['cc] or @racket['gcc]} +@item{Windows: @racket['gcc], @racket['msvc], or @racket['borland]} +@item{MacOS: @racket['cw]} ]} @defproc[(get-standard-compilers) (listof symbol?)]{ Returns a list of standard compiler names for the current platform. See -@scheme[use-standard-compiler].} +@racket[use-standard-compiler].} @defproc[(expand-for-compile-variant (l (listof (or/c path-string? (-> (listof string?)))))) any]{ @@ -172,7 +172,7 @@ depending on the current compile variant.} @defsignature[dynext:compile^ ()] -Includes everything exported by the @schememodname[dynext/compile] module. +Includes everything exported by the @racketmodname[dynext/compile] module. @subsection[#:tag "compile-unit"]{Unit} @@ -180,7 +180,7 @@ Includes everything exported by the @schememodname[dynext/compile] module. @defthing[dynext:compile@ unit?]{ -Imports nothing, exports @scheme[dynext:compile^].} +Imports nothing, exports @racket[dynext:compile^].} @; ---------------------------------------------------------------------- @@ -191,11 +191,11 @@ Imports nothing, exports @scheme[dynext:compile^].} @defproc[(link-extension (quiet? any/c) (input-files (listof path-string?)) (output-file path-string?)) any]{ Links object files to create an extension (normally of a form that can -be loaded with @scheme[load-extension]). +be loaded with @racket[load-extension]). -The @scheme[quiet?] argument indicates whether command should be -echoed to the current output port. The @scheme[input-files] argument -is list of compiled object filenames, and @scheme[output-file] is the +The @racket[quiet?] argument indicates whether command should be +echoed to the current output port. The @racket[input-files] argument +is list of compiled object filenames, and @racket[output-file] is the destination extension filename.} @@ -214,7 +214,7 @@ The default is set by searching for an executable using the @filepath{cl.exe}, then @filepath{ld.exe} (gcc), then @filepath{ilink32.exe} (Borland). On Cygwin, Solaris, FreeBSD 2.x, or HP/UX, it looks for @filepath{ld}. On other Unix variants, it -looks for @filepath{cc}. @scheme[#f] indicates that no linker could be +looks for @filepath{cc}. @racket[#f] indicates that no linker could be found.} @defparam[current-extension-linker-flags @@ -222,10 +222,10 @@ found.} (listof (or/c path-string? (-> (listof string?))))]{ A parameter that determines flags provided to the linker. See also -@scheme[expand-for-link-variant]. +@racket[expand-for-link-variant]. -On Windows, default is @scheme[(list "/LD")] for @filepath{cl.exe}, -@scheme[(list "--dll")] for @filepath{ld.exe}, and @scheme[(list +On Windows, default is @racket[(list "/LD")] for @filepath{cl.exe}, +@racket[(list "--dll")] for @filepath{ld.exe}, and @racket[(list "/Tpd" "/c")] for @filepath{ilink32.exe}. On Unix, the default varies greatly among platforms. If the @envvar{LDFLAGS} or @envvar{MZSCHEME_DYNEXT_LINKER_FLAGS} (the latter takes precedence) @@ -238,7 +238,7 @@ strings that is appended before the defaults.} A parameter that processes linker input arguments; the parameter value takes an input file path and returns a list of strings for the command -line. The default is @scheme[list].} +line. The default is @racket[list].} @defparam[current-make-link-output-strings proc @@ -248,28 +248,28 @@ A parameter that processes linker output arguments; the parameter value takes an output file path and returns a list of strings for the command line. -On Windows, the default converts @scheme["file"] to @scheme[(list -"/Fefile")] for @filepath{cl.exe}, something like @scheme[(list "-e" +On Windows, the default converts @racket["file"] to @racket[(list +"/Fefile")] for @filepath{cl.exe}, something like @racket[(list "-e" "_dll_entry@12" "-o" "file")] for @filepath{ld.exe}, and something complex for @filepath{ilink32.exe}. On Unix, the default converts -@scheme["file"] to @scheme[(list "-o" "file")].} +@racket["file"] to @racket[(list "-o" "file")].} @defparam[current-standard-link-libraries libs (listof (or/c path-string? (-> (listof string?))))]{ A parameter that determines libraries supplied to the linker, in -addition to other inputs. See also @scheme[expand-for-link-variant]. +addition to other inputs. See also @racket[expand-for-link-variant]. For most platforms, the default is -@schemeblock[(list (build-path (collection-path "mzscheme" "lib") +@racketblock[(list (build-path (collection-path "mzscheme" "lib") (system-library-subpath) (_mzdyn-thunk)))] -where @scheme[_mzdyn-thunk] produces @scheme[(list "mzdyn.o")] for the -@scheme['cgc] variant and @scheme[(list "mzdyn3m.o")] for the -@scheme['3m] variant. See also @scheme[current-use-mzdyn]).} +where @racket[_mzdyn-thunk] produces @racket[(list "mzdyn.o")] for the +@racket['cgc] variant and @racket[(list "mzdyn3m.o")] for the +@racket['3m] variant. See also @racket[current-use-mzdyn]).} @defparam[current-use-mzdyn use-mzdyn? @@ -277,15 +277,15 @@ where @scheme[_mzdyn-thunk] produces @scheme[(list "mzdyn.o")] for the A parameter that determines whether the default standard link libraries include the @filepath{mzdyn} library which allows the -resulting file to be loaded via @scheme[load-extension]. Defaults to -@scheme[#t].} +resulting file to be loaded via @racket[load-extension]. Defaults to +@racket[#t].} @defparam[link-variant variant-symbol (one-of/c 'normal 'cgc '3m)]{ A parameter that indicates the target for linking, where -@scheme['normal] is an alias for the result of @scheme[(system-type +@racket['normal] is an alias for the result of @racket[(system-type 'gc)].} @@ -303,7 +303,7 @@ particular known linker.} (-> (listof string?)))))) any]{ -The same as @scheme[expand-for-compile-variant].} +The same as @racket[expand-for-compile-variant].} @subsection[#:tag "link-sig"]{Signature} @@ -312,7 +312,7 @@ The same as @scheme[expand-for-compile-variant].} @defsignature[dynext:link^ ()] -Includes everything exported by the @schememodname[dynext/link] module. +Includes everything exported by the @racketmodname[dynext/link] module. @subsection[#:tag "link-unit"]{Unit} @@ -320,7 +320,7 @@ Includes everything exported by the @schememodname[dynext/link] module. @defthing[dynext:link@ unit?]{ -Imports nothing, exports @scheme[dynext:link^].} +Imports nothing, exports @racket[dynext:link^].} @; ---------------------------------------------------------------------- @@ -330,63 +330,63 @@ Imports nothing, exports @scheme[dynext:link^].} @defproc[(append-zo-suffix (s (or/c string? path?))) path?]{ -Appends the @filepath{.zo} file suffix to @scheme[s], returning a +Appends the @filepath{.zo} file suffix to @racket[s], returning a path. The existing suffix, if any, is preserved and converted as with -@scheme[path-add-suffix].} +@racket[path-add-suffix].} @defproc[(append-object-suffix (s path-string?)) path?]{ Appends the platform-standard compiled object file suffix to -@scheme[s], returning a path.} +@racket[s], returning a path.} @defproc[(append-c-suffix (s path-string?)) path?]{ -Appends the platform-standard C source-file suffix to @scheme[s], +Appends the platform-standard C source-file suffix to @racket[s], returning a path.} @defproc[(append-constant-pool-suffix (s (or/c string? path?))) path?]{ -Appends the constant-pool file suffix @filepath{.kp} to @scheme[s], +Appends the constant-pool file suffix @filepath{.kp} to @racket[s], returning a path.} @defproc[(append-extension-suffix (s (or/c string? path?))) path?]{ Appends the platform-standard dynamic-extension file suffix to -@scheme[s], returning a path.} +@racket[s], returning a path.} @defproc[(extract-base-filename/ss (s path-string?) (program any/c #f)) (or/c path? false/c)]{ -Strips the Racket file suffix from @scheme[s] and returns a stripped -path. Unlike the other functions below, when @scheme[program] is not -@scheme[#f], then any suffix (including no suffix) is allowed. If -@scheme[s] is not a Racket file and @scheme[program] is @scheme[#f], -@scheme[#f] is returned.} +Strips the Racket file suffix from @racket[s] and returns a stripped +path. Unlike the other functions below, when @racket[program] is not +@racket[#f], then any suffix (including no suffix) is allowed. If +@racket[s] is not a Racket file and @racket[program] is @racket[#f], +@racket[#f] is returned.} @defproc[(extract-base-filename/c (s path-string?) (program any/c #f)) (or/c path? false/c)]{ -Strips the Racket file suffix from @scheme[s] and -returns a stripped path. If @scheme[s] is not a Racket file name and -@scheme[program] is a symbol, and error is signaled. If @scheme[s] is -not a Racket file and @scheme[program] is @scheme[#f], @scheme[#f] is +Strips the Racket file suffix from @racket[s] and +returns a stripped path. If @racket[s] is not a Racket file name and +@racket[program] is a symbol, and error is signaled. If @racket[s] is +not a Racket file and @racket[program] is @racket[#f], @racket[#f] is returned.} @defproc[(extract-base-filename/kp (s path-string?) (program any/c #f)) (or/c path? false/c)]{ -Same as @scheme[extract-base-filename/c], but for constant-pool +Same as @racket[extract-base-filename/c], but for constant-pool files.} @defproc[(extract-base-filename/o (s path-string?) (program any/c #f)) (or/c path? false/c)]{ -Same as @scheme[extract-base-filename/c], but for compiled-object +Same as @racket[extract-base-filename/c], but for compiled-object files.} @defproc[(extract-base-filename/ext (s path-string?) (program any/c #f)) (or/c path? false/c)]{ -Same as @scheme[extract-base-filename/c], but for extension files.} +Same as @racket[extract-base-filename/c], but for extension files.} @subsection[#:tag "file-sig"]{Signature} @@ -395,7 +395,7 @@ Same as @scheme[extract-base-filename/c], but for extension files.} @defsignature[dynext:file^ ()] -Includes everything exported by the @schememodname[dynext/file] module. +Includes everything exported by the @racketmodname[dynext/file] module. @subsection[#:tag "file-unit"]{Unit} @@ -403,5 +403,5 @@ Includes everything exported by the @schememodname[dynext/file] module. @defthing[dynext:file@ unit?]{ -Imports nothing, exports @scheme[dynext:file^].} +Imports nothing, exports @racket[dynext:file^].} diff --git a/collects/embedded-gui/scribblings/aligned-pasteboard.scrbl b/collects/embedded-gui/scribblings/aligned-pasteboard.scrbl index 5e878d76a4..7b5dd3acab 100644 --- a/collects/embedded-gui/scribblings/aligned-pasteboard.scrbl +++ b/collects/embedded-gui/scribblings/aligned-pasteboard.scrbl @@ -3,4 +3,4 @@ @defclass/title[aligned-pasteboard% pasteboard% (alignment-parent<%>)]{ -Acts as the top of an @scheme[alignment<%>] tree.} +Acts as the top of an @racket[alignment<%>] tree.} diff --git a/collects/embedded-gui/scribblings/alignment.scrbl b/collects/embedded-gui/scribblings/alignment.scrbl index 8961eceefc..2f141975c4 100644 --- a/collects/embedded-gui/scribblings/alignment.scrbl +++ b/collects/embedded-gui/scribblings/alignment.scrbl @@ -16,7 +16,7 @@ Tells the alignment that its sizes should be calculated.} [width (and/c real? (not/c negative?))] [height (and/c real? (not/c negative?))]) void?]{ Tells itself to align its children on the pasteboard -in the given rectangle defined by @scheme[width], @scheme[height] and a top +in the given rectangle defined by @racket[width], @racket[height] and a top left corner point given as offsets into the pasteboards top left corner.} @@ -30,7 +30,7 @@ The minimum height this alignment must be.} @defmethod*[([(stretchable-width) boolean?] [(stretchable-width [value boolean?]) void?])]{ - + Gets/sets the property of stretchability in the x dimension.} @defmethod*[([(stretchable-height) boolean?] diff --git a/collects/embedded-gui/scribblings/button-snip.scrbl b/collects/embedded-gui/scribblings/button-snip.scrbl index 5915a10e97..622f8449aa 100644 --- a/collects/embedded-gui/scribblings/button-snip.scrbl +++ b/collects/embedded-gui/scribblings/button-snip.scrbl @@ -8,11 +8,11 @@ A clickable button with a bitmap label. @defconstructor[([images (cons/c path-string? path-string?)] [callback ((is-a?/c button-snip%) (is-a?/c event%) . -> . void?)])]{ -The @scheme[images] argument is a pair filenames to be load as the +The @racket[images] argument is a pair filenames to be load as the button-label image, where the first is the image for when the button is at rest, and the second is the image for the button while its pressed. -The @scheme[callback] is called when the button is clicked.} +The @racket[callback] is called when the button is clicked.} } diff --git a/collects/embedded-gui/scribblings/dllist.scrbl b/collects/embedded-gui/scribblings/dllist.scrbl index d7af53e301..4b050bbad8 100644 --- a/collects/embedded-gui/scribblings/dllist.scrbl +++ b/collects/embedded-gui/scribblings/dllist.scrbl @@ -17,12 +17,12 @@ Gets/sets the previous item in the list.} @defmethod[(for-each [f ((is-a?/c dllist<%>) . -> . void?)]) void?]{ -Applies @scheme[f] to every element of the dllist.} +Applies @racket[f] to every element of the dllist.} @defmethod[(map-to-list [f ((is-a?/c dllist<%>) . -> . any/c)]) (listof any/c)]{ -Creates a Scheme list by applying @scheme[f] to every element +Creates a Scheme list by applying @racket[f] to every element of @this-obj[].} } diff --git a/collects/embedded-gui/scribblings/embedded-button.scrbl b/collects/embedded-gui/scribblings/embedded-button.scrbl index 7560ee99b5..73d4675e78 100644 --- a/collects/embedded-gui/scribblings/embedded-button.scrbl +++ b/collects/embedded-gui/scribblings/embedded-button.scrbl @@ -8,11 +8,11 @@ A clickable button with a bitmap label. @defconstructor[([images (cons/c path-string? path-string?)] [callback ((is-a?/c button-snip%) (is-a?/c event%) . -> . void?)])]{ -The @scheme[images] argument is a pair filenames to be load as the +The @racket[images] argument is a pair filenames to be load as the button-label image, where the first is the image for when the button is at rest, and the second is the image for the button while its pressed. -The @scheme[callback] is called when the button is clicked.} +The @racket[callback] is called when the button is clicked.} } diff --git a/collects/embedded-gui/scribblings/embedded-gui.scrbl b/collects/embedded-gui/scribblings/embedded-gui.scrbl index 347097ef23..e394d9dda7 100644 --- a/collects/embedded-gui/scribblings/embedded-gui.scrbl +++ b/collects/embedded-gui/scribblings/embedded-gui.scrbl @@ -1,16 +1,16 @@ #lang scribble/doc @(require "common.rkt" (for-label framework)) -@title{@bold{Embedded GUI}: Widgets within @scheme[editor<%>]} +@title{@bold{Embedded GUI}: Widgets within @racket[editor<%>]} @author["Mike T. McHenry"] @defmodule[embedded-gui] -The @schememodname[embedded-gui] library provides a class hierarchy -for creating graphical boxes within @scheme[editor<%>] objects with -geometry management that mirrors that of @scheme[vertical-panel%] and -@scheme[horizontal-panel%]. +The @racketmodname[embedded-gui] library provides a class hierarchy +for creating graphical boxes within @racket[editor<%>] objects with +geometry management that mirrors that of @racket[vertical-panel%] and +@racket[horizontal-panel%]. @table-of-contents[] @@ -24,10 +24,10 @@ geometry management that mirrors that of @scheme[vertical-panel%] and @defmixin[stretchable-editor-snip-mixin (editor-snip%) (stretchable-snip<%>)]{ - Extends an editor snip the @scheme[stretchable-snip<%>] interface, + Extends an editor snip the @racket[stretchable-snip<%>] interface, which allows it to be stretched to fit an - @scheme[alignment-parent<%>]'s allotted width. Stretchable snips are - useful as the snip of a @scheme[snip-wrapper%] } + @racket[alignment-parent<%>]'s allotted width. Stretchable snips are + useful as the snip of a @racket[snip-wrapper%] } @defclass[stretchable-editor-snip% editor-snip% (stretchable-editor-snip-mixin editor-snip%)]{ @@ -41,11 +41,11 @@ geometry management that mirrors that of @scheme[vertical-panel%] and @defproc[(fixed-width-label-snip [possible-labels (listof string?)]) (subclass?/c snip%)]{ - Returns a subclass of @scheme[snip%] that takes a single + Returns a subclass of @racket[snip%] that takes a single initialization argument. The argument provided when instantiating the - class must be a member of @scheme[possible-labels]; the given label + class must be a member of @racket[possible-labels]; the given label is displayed by the snip, but the snip is sized to match the longest - of the labels in @scheme[possible-labels]. + of the labels in @racket[possible-labels]. In other words, the resulting class helps align multiple GUI elements t hat are labeled from a particular set of strings.} @@ -53,11 +53,11 @@ t hat are labeled from a particular set of strings.} @definterface[tabbable-text<%> ()]{ - An interface for tabbing between embedded @scheme[text%]s. + An interface for tabbing between embedded @racket[text%]s. @defmethod[(set-caret-owner) void?]{ - Moves the caret into the @scheme[tabbable-text<%>].} + Moves the caret into the @racket[tabbable-text<%>].} @defmethod[(set-ahead) void?]{ @@ -70,15 +70,15 @@ t hat are labeled from a particular set of strings.} @defmixin[tabbable-text-mixin (editor:keymap<%>) (tabbable-text<%>)]{ - Adds the @scheme[tabbable-text<%>] interface to an - @scheme[editor:text%] class, where instantiation installs key + Adds the @racket[tabbable-text<%>] interface to an + @racket[editor:text%] class, where instantiation installs key bindings to tab ahead and backward} @defproc[(set-tabbing [a-text (is-a?/c tabbable-text<%>)] ...) void?]{ -Sets the tabbing order of @scheme[tabbable-text<%>]s by setting each +Sets the tabbing order of @racket[tabbable-text<%>]s by setting each text's @method[tabbable-text<%> set-ahead] and @method[tabbable-text<%> set-back] thunks to point to its neighbor in the argument list.} @@ -86,13 +86,13 @@ the argument list.} @defmixin[grey-editor-snip-mixin (editor-snip%) ()]{ - Gives an @scheme[editor-snip%] a colored background indicating that + Gives an @racket[editor-snip%] a colored background indicating that is disabled. The editor is not disabled by the mixin however, and must be locked separately.} @defmixin[grey-editor-mixin (editor<%>) ()]{ - Gives an @scheme[editor<%>] a colored background indicating that is + Gives an @racket[editor<%>] a colored background indicating that is disabled. The editor is not disabled by the mixin however, and must be locked separately.} @@ -105,8 +105,8 @@ the argument list.} @defmixin[cue-text-mixin (text%) ()]{ - Gives a @scheme[text%] an instantiation argument of a string that is - displayed in the @scheme[text%] initially in grey; the text + Gives a @racket[text%] an instantiation argument of a string that is + displayed in the @racket[text%] initially in grey; the text disappears when the text gets focus. This technique is useful for labeling texts without needing to take up space.} diff --git a/collects/embedded-gui/scribblings/embedded-message.scrbl b/collects/embedded-gui/scribblings/embedded-message.scrbl index bcf1950a80..8ae8cd95ea 100644 --- a/collects/embedded-gui/scribblings/embedded-message.scrbl +++ b/collects/embedded-gui/scribblings/embedded-message.scrbl @@ -8,4 +8,4 @@ A static text label. @defconstructor[([parent (is-a?/c alignment-parent<%>)] [label string?])]{ -Creates a static control that displays @scheme[label].}} +Creates a static control that displays @racket[label].}} diff --git a/collects/embedded-gui/scribblings/embedded-text-button.scrbl b/collects/embedded-gui/scribblings/embedded-text-button.scrbl index f246eece2d..8e9f3e49d8 100644 --- a/collects/embedded-gui/scribblings/embedded-text-button.scrbl +++ b/collects/embedded-gui/scribblings/embedded-text-button.scrbl @@ -8,6 +8,6 @@ A button with a text label. @defconstructor[([label string?] [callback ((is-a?/c text-button-snip%) (is-a?/c event%) . -> . void?)])]{ -The @scheme[callback] is called when the button is clicked.} +The @racket[callback] is called when the button is clicked.} } diff --git a/collects/embedded-gui/scribblings/embedded-toggle-button.scrbl b/collects/embedded-gui/scribblings/embedded-toggle-button.scrbl index 2b0caa78f8..67f6e8983e 100644 --- a/collects/embedded-gui/scribblings/embedded-toggle-button.scrbl +++ b/collects/embedded-gui/scribblings/embedded-toggle-button.scrbl @@ -3,7 +3,7 @@ @defclass/title[embedded-toggle-button% snip-wrapper% (alignment<%>)]{ -A @scheme[check-box%]-like control that a user can toggle between +A @racket[check-box%]-like control that a user can toggle between checked and unchecked states. @defconstructor[([images-off (cons/c path-string? path-string?)] @@ -12,17 +12,17 @@ checked and unchecked states. [turn-off ((is-a?/c toggle-button-snip%) (is-a?/c event%) . -> . void?)] [state (symbols 'on 'off) 'on])]{ -The @scheme[images-off] argument is a pair filenames to be load as the +The @racket[images-off] argument is a pair filenames to be load as the button-label image, where the first is the image for when the button is at rest, and the second is the image for the button while its pressed---in both cases when the button is not checked by the -user. The @scheme[images-on] argument similarly determines the images +user. The @racket[images-on] argument similarly determines the images for then the button is checked. -The @scheme[turn-on] and @scheme[turn-off] callbacks are invoked when +The @racket[turn-on] and @racket[turn-off] callbacks are invoked when the button changes to checked or unchecked, respectively. -The @scheme[state] argument determines whether the button is initially +The @racket[state] argument determines whether the button is initially checked.} } diff --git a/collects/embedded-gui/scribblings/horizontal-alignment.scrbl b/collects/embedded-gui/scribblings/horizontal-alignment.scrbl index f08bf7450e..75f73d9576 100644 --- a/collects/embedded-gui/scribblings/horizontal-alignment.scrbl +++ b/collects/embedded-gui/scribblings/horizontal-alignment.scrbl @@ -8,5 +8,5 @@ [after (or/c (is-a?/c alignment<%>) false/c) #f])]{ Inserts a new horizontal-alignment container into -@scheme[parent]---optionally after a given container also in -@scheme[parent]. The new container can be initially shown or hidden.}} +@racket[parent]---optionally after a given container also in +@racket[parent]. The new container can be initially shown or hidden.}} diff --git a/collects/embedded-gui/scribblings/snip-procs.scrbl b/collects/embedded-gui/scribblings/snip-procs.scrbl index 51f3a96c53..027fdced2f 100644 --- a/collects/embedded-gui/scribblings/snip-procs.scrbl +++ b/collects/embedded-gui/scribblings/snip-procs.scrbl @@ -28,8 +28,8 @@ The pasteboard that contains the snip.} [snip (is-a?/c snip%)]) any/c]{ -Applies @scheme[f] to all snips in the parent of @scheme[snip], -starting with @scheme[snip].} +Applies @racket[f] to all snips in the parent of @racket[snip], +starting with @racket[snip].} @defproc[(for-each-snip [f ((is-a?/c snip%) . -> . any/c)] [first-snip (is-a?/c snip%)] @@ -37,9 +37,9 @@ starting with @scheme[snip].} void?]{ Applies the function to each snip in the parent of -@scheme[first-snip], starting with @scheme[first-snip]. If -@scheme[more] lists are supplied, they are used for extra arguments to -@scheme[f], just like extra lists provided to @scheme[for-each].} +@racket[first-snip], starting with @racket[first-snip]. If +@racket[more] lists are supplied, they are used for extra arguments to +@racket[f], just like extra lists provided to @racket[for-each].} @defproc[(map-snip [f ((is-a?/c snip%) . -> . any/c)] [first-snip (is-a?/c snip%)] @@ -47,10 +47,10 @@ Applies the function to each snip in the parent of void?]{ Applies the function to each snip in the parent of -@scheme[first-snip], starting with @scheme[first-snip], and -accumulates the results into a list. If @scheme[more] lists are -supplied, they are used for extra arguments to @scheme[f], just like -extra lists provided to @scheme[map].} +@racket[first-snip], starting with @racket[first-snip], and +accumulates the results into a list. If @racket[more] lists are +supplied, they are used for extra arguments to @racket[f], just like +extra lists provided to @racket[map].} @defproc[(stretchable-width? [snip (is-a?/c snip%)]) boolean?]{ diff --git a/collects/embedded-gui/scribblings/snip-wrapper.scrbl b/collects/embedded-gui/scribblings/snip-wrapper.scrbl index f14eee31df..f74fc4ae5a 100644 --- a/collects/embedded-gui/scribblings/snip-wrapper.scrbl +++ b/collects/embedded-gui/scribblings/snip-wrapper.scrbl @@ -3,10 +3,10 @@ @defclass/title[snip-wrapper% dllist<%> (alignment<%>)]{ -Adapts an arbitrary @scheme[snip<%>] to work in an alignment +Adapts an arbitrary @racket[snip<%>] to work in an alignment container. @defconstructor[([parent (is-a?/c alignment-parent<%>)] [snip (is-a?/c snip%)])]{ -Adds @scheme[snip] to @scheme[parent].}} +Adds @racket[snip] to @racket[parent].}} diff --git a/collects/embedded-gui/scribblings/stretchable-snip.scrbl b/collects/embedded-gui/scribblings/stretchable-snip.scrbl index 2a4eca06bb..a0d7a8fc26 100644 --- a/collects/embedded-gui/scribblings/stretchable-snip.scrbl +++ b/collects/embedded-gui/scribblings/stretchable-snip.scrbl @@ -4,8 +4,8 @@ @definterface/title[stretchable-snip<%> ()]{ Must be implemented by any snip class whose objects will be -stretchable when inserted into an @scheme[aligned-pasteboard<%>] -within a @scheme[snip-wrapper%]. +stretchable when inserted into an @racket[aligned-pasteboard<%>] +within a @racket[snip-wrapper%]. @defmethod[(get-aligned-min-width) (and/c real? (not/c negative?))]{ diff --git a/collects/embedded-gui/scribblings/text-button-snip.scrbl b/collects/embedded-gui/scribblings/text-button-snip.scrbl index a6567306e0..9ec63966dc 100644 --- a/collects/embedded-gui/scribblings/text-button-snip.scrbl +++ b/collects/embedded-gui/scribblings/text-button-snip.scrbl @@ -8,6 +8,6 @@ A button with a text label. @defconstructor[([label string?] [callback ((is-a?/c text-button-snip%) (is-a?/c event%) . -> . void)])]{ -The @scheme[callback] is called when the button is clicked.} +The @racket[callback] is called when the button is clicked.} } diff --git a/collects/embedded-gui/scribblings/toggle-button-snip.scrbl b/collects/embedded-gui/scribblings/toggle-button-snip.scrbl index 3f6a4eceed..db4fb20a56 100644 --- a/collects/embedded-gui/scribblings/toggle-button-snip.scrbl +++ b/collects/embedded-gui/scribblings/toggle-button-snip.scrbl @@ -3,7 +3,7 @@ @defclass/title[toggle-button-snip% snip% ()]{ -A @scheme[check-box%]-like control that a user can toggle between +A @racket[check-box%]-like control that a user can toggle between checked and unchecked states. @defconstructor[([images-off (cons/c path-string? path-string?)] @@ -12,17 +12,17 @@ checked and unchecked states. [turn-off ((is-a?/c toggle-button-snip%) (is-a?/c event%) . -> . void?)] [state (symbols 'on 'off) 'on])]{ -The @scheme[images-off] argument is a pair filenames to be load as the +The @racket[images-off] argument is a pair filenames to be load as the button-label image, where the first is the image for when the button is at rest, and the second is the image for the button while its pressed---in both cases when the button is not checked by the -user. The @scheme[images-on] argument similarly determines the images +user. The @racket[images-on] argument similarly determines the images for then the button is checked. -The @scheme[turn-on] and @scheme[turn-off] callbacks are invoked when +The @racket[turn-on] and @racket[turn-off] callbacks are invoked when the button changes to checked or unchecked, respectively. -The @scheme[state] argument determines whether the button is initially +The @racket[state] argument determines whether the button is initially checked.} } diff --git a/collects/embedded-gui/scribblings/vertical-alignment.scrbl b/collects/embedded-gui/scribblings/vertical-alignment.scrbl index 63814dee25..146a83eda1 100644 --- a/collects/embedded-gui/scribblings/vertical-alignment.scrbl +++ b/collects/embedded-gui/scribblings/vertical-alignment.scrbl @@ -8,5 +8,5 @@ [after (or/c (is-a?/c alignment<%>) false/c) #f])]{ Inserts a new vertical-alignment container into -@scheme[parent]---optionally after a given container also in -@scheme[parent]. The new container can be initially shown or hidden.}} +@racket[parent]---optionally after a given container also in +@racket[parent]. The new container can be initially shown or hidden.}} diff --git a/collects/eopl/eopl.scrbl b/collects/eopl/eopl.scrbl index 8f21878ba2..3a9d5e4f5e 100644 --- a/collects/eopl/eopl.scrbl +++ b/collects/eopl/eopl.scrbl @@ -37,14 +37,14 @@ The @italic{Essentials of Programming Languages} language in DrRacket provides a subset of functions and syntactic forms of -@schememodname[mzscheme]---mostly the ones that correspond to -@scheme[r5rs] forms. See below for a complete list. The +@racketmodname[mzscheme]---mostly the ones that correspond to +@racket[r5rs] forms. See below for a complete list. The language is intended for use with the textbook @cite["EoPL"]. @defmodulelang[eopl #:use-sources (eopl/eopl)] -The following bindings are re-@scheme[provide]d from -@schememodname[mzscheme]: +The following bindings are re-@racket[provide]d from +@racketmodname[mzscheme]: @reprovide[ make-parameter @@ -111,22 +111,22 @@ The following bindings are re-@scheme[provide]d from (variant-id (field-id predicate-expr) ...) ...)]{ - Defines the datatype @scheme[id] and a function - @scheme[predicate-id] that returns @scheme[#t] for instances of the - datatype, and @scheme[#f] for any other value. + Defines the datatype @racket[id] and a function + @racket[predicate-id] that returns @racket[#t] for instances of the + datatype, and @racket[#f] for any other value. - Each @scheme[variant-id] is defined as a constructor function that + Each @racket[variant-id] is defined as a constructor function that creates an instance of the datatype; the constructor takes as many - arguments as the variant's @scheme[field-id]s, and each argument is + arguments as the variant's @racket[field-id]s, and each argument is checked by applying the function produced by the variant's - @scheme[predicate-expr]. + @racket[predicate-expr]. In DrScheme v209 and older, when constructor-based printing was - used, variant instances were printed with a @scheme[make-] prefix + used, variant instances were printed with a @racket[make-] prefix before the variant name. Thus, for compatibility, in addition to - @scheme[variant-id], @scheme[make-variant-id] is also defined for - each @scheme[variant-id] (to the same constructor as - @scheme[variant-id]).} + @racket[variant-id], @racket[make-variant-id] is also defined for + each @racket[variant-id] (to the same constructor as + @racket[variant-id]).} @defform*[#:literals (else) [(cases datatype-id expr @@ -137,9 +137,9 @@ The following bindings are re-@scheme[provide]d from ... (else result-expr ...))]]{ - Branches on the datatype instance produced by @scheme[expr], which - must be an instance of the specified @scheme[datatype-id] that is - defined with @scheme[define-datatype].} + Branches on the datatype instance produced by @racket[expr], which + must be an instance of the specified @racket[datatype-id] that is + defined with @racket[define-datatype].} @deftogether[( @defidform[sllgen:make-string-scanner] @@ -167,7 +167,7 @@ The following bindings are re-@scheme[provide]d from @defproc[(eopl:printf (form string?) (v any/c) ...) void?] @defproc[(eopl:pretty-print (v any/c) (port output-port? (current-output-port))) void?])]{ - Same as @schememodname[scheme/base]'s @scheme[printf] and @scheme[pretty-print].} + Same as @racketmodname[scheme/base]'s @racket[printf] and @racket[pretty-print].} @deftogether[( @defproc[((list-of (pred (any/c . -> . any)) ...+) (x any/c)) boolean?] @@ -182,7 +182,7 @@ The following bindings are re-@scheme[provide]d from @defform[(time expr)]{ - Evaluates @scheme[expr], and prints timing information before returning the + Evaluates @racket[expr], and prints timing information before returning the result.} @defproc[(collect-garbage) void?]{ @@ -193,19 +193,19 @@ The following bindings are re-@scheme[provide]d from @defform[(trace id ...)] @defform[(untrace id ...)])]{ - For debugging: @scheme[trace] redefines each @scheme[id] at the top + For debugging: @racket[trace] redefines each @racket[id] at the top level (bound to a procedure) so that it prints arguments on entry - and results on exit. The @scheme[untrace] form reverses the action - of @scheme[trace] for the given @scheme[id]s. + and results on exit. The @racket[untrace] form reverses the action + of @racket[trace] for the given @racket[id]s. Tracing a function causes tail-calls in the original function to become non-tail calls.} @defform[(provide provide-spec ...)]{ - Useful only with a module that uses @schememodname[eopl] as a + Useful only with a module that uses @racketmodname[eopl] as a language: exports identifiers from the module. See @mzscheme-provide - from @schememodname[mzscheme] for more information.} + from @racketmodname[mzscheme] for more information.} @defthing[eopl:error-stop (-> any/c)]{ @@ -213,15 +213,15 @@ The following bindings are re-@scheme[provide]d from mutate this variable to install an exception-handling thunk. Typically, the handler thunk escapes through a continuation. - The @schememodname[eopl] library sets this variable to - @scheme[#f] in the current namespace when it executes.} + The @racketmodname[eopl] library sets this variable to + @racket[#f] in the current namespace when it executes.} @defproc[(install-eopl-exception-handler) void?]{ Sets an exception handler to one that checks - @scheme[eopl:error-stop]. + @racket[eopl:error-stop]. - The @schememodname[eopl] library calls this function when it + The @racketmodname[eopl] library calls this function when it executes.} @(bibliography diff --git a/collects/errortrace/scribblings/errortrace.scrbl b/collects/errortrace/scribblings/errortrace.scrbl index 768e136cbd..007b50e400 100644 --- a/collects/errortrace/scribblings/errortrace.scrbl +++ b/collects/errortrace/scribblings/errortrace.scrbl @@ -28,12 +28,12 @@ Then, @itemize[ @item{If your program has a module file @nonterm{prog}, run it with - + @commandline{racket -l errortrace -t @nonterm{prog}}} @item{If you program is a non-module top-level sequence of definitions and expressions, you can instead add - @schemeblock[(require errortrace)] + @racketblock[(require errortrace)] to the beginning of the program or start Racket with the @Flag{l} option before the arguments to load your program: @commandline{racket -l errortrace ...}} @@ -44,17 +44,17 @@ Then, @commandline{racket -i -l errortrace}} ] -After starting @schememodname[errortrace] in one of these ways, when an +After starting @racketmodname[errortrace] in one of these ways, when an exception occurs, the exception handler something like a stack trace with most recent contexts first. -The @schememodname[errortrace] module is strange: Don't import it -into another module. Instead, the @schememodname[errortrace] +The @racketmodname[errortrace] module is strange: Don't import it +into another module. Instead, the @racketmodname[errortrace] module is meant to be invoked from the top-level, so that it can install an evaluation handler, exception handler, etc. -To reuse parts of the code of @schememodname[errortrace], import -@schememodname[errortrace/errortrace-lib]. That library contains all +To reuse parts of the code of @racketmodname[errortrace], import +@racketmodname[errortrace/errortrace-lib]. That library contains all of the bindings described here, but does not set the compilation handler or the error display handler. @@ -63,21 +63,21 @@ handler or the error display handler. @section[#:tag "installing-errortrace"]{Installing Errortrace} Invoking the -@schememodname[errortrace] module sets the compilation +@racketmodname[errortrace] module sets the compilation handler to instrument Racket source code. It also sets the error display handler to report source information for an exception, and it -sets the @scheme[use-compiled-file-paths] parameter to trigger the use +sets the @racket[use-compiled-file-paths] parameter to trigger the use of Errortrace-specific @filepath{.zo} files. - NOTE: @schememodname[errortrace] has no effect on code + NOTE: @racketmodname[errortrace] has no effect on code loaded as compiled byte code (i.e., from a @filepath{.zo} file) or native code (i.e., from a @filepath{.dll}, @filepath{.so} or @filepath{.dylib} file). You can use the @DFlag{mode errortrace} flag to @exec{setup-plt} to create @filepath{.zo} files with Errortrace information. -Explicitly requiring @schememodname[errortrace] within a module is -generally a bad idea, since @schememodname[errortrace] sets various +Explicitly requiring @racketmodname[errortrace] within a module is +generally a bad idea, since @racketmodname[errortrace] sets various parameters. @; --------------------------------------------- @@ -86,24 +86,24 @@ parameters. @defmodule[errortrace #:use-sources (errortrace/errortrace-lib)] See @secref["quick-instructions"] for information on starting with -@schememodname[errortrace]. This chapter provides information on the -configuration of @schememodname[errortrace] after it is loaded and +@racketmodname[errortrace]. This chapter provides information on the +configuration of @racketmodname[errortrace] after it is loaded and installed. -Don't import @schememodname[errortrace] into another module and expect -it to work on that module. Instead, the @schememodname[errortrace] +Don't import @racketmodname[errortrace] into another module and expect +it to work on that module. Instead, the @racketmodname[errortrace] module is meant to be invoked from the top-level (as described in @secref["quick-instructions"]) so it can install handlers. The functions documented in this chapter then can be used at the top-level. The functions also can be accessed by importing -@schememodname[errortrace/errortrace-lib], which does not install any +@racketmodname[errortrace/errortrace-lib], which does not install any handlers. -As a language name, @schememodname[errortrace] chains to another -language that is specified immediately after @schememodname[at-exp], +As a language name, @racketmodname[errortrace] chains to another +language that is specified immediately after @racketmodname[at-exp], but instruments the module for debugging in the same way as if -@schememodname[errortrace] is required before loading the module from -source. Using the @schememodname[errortrace] meta-language is one way +@racketmodname[errortrace] is required before loading the module from +source. Using the @racketmodname[errortrace] meta-language is one way to ensure that debugging instrumentation is present when the module is compiled.} @@ -111,32 +111,32 @@ compiled.} @subsection[#:tag "instrumentation-and-profiling"]{Instrumentation and Profiling} -By default, @schememodname[errortrace] only instruments for +By default, @racketmodname[errortrace] only instruments for stack-trace-on-exception. Profiling and coverage need to be enabled separately. @defboolparam[instrumenting-enabled on?]{ A parameter that determines whether tracing instrumentation is -enabled, @scheme[#t] by default. Affects only the way that source code is +enabled, @racket[#t] by default. Affects only the way that source code is compiled, not the way that exception information is reported. The instrumentation for storing exception information slows most programs by a factor of 2 or 3.} @defboolparam[profiling-enabled on?]{ -Errortrace's profiling instrumentation is @scheme[#f] by default. To use it, -you also need to ensure that @scheme[instrumenting-enabled] is on. +Errortrace's profiling instrumentation is @racket[#f] by default. To use it, +you also need to ensure that @racket[instrumenting-enabled] is on. Also, profiling only records information about the time taken on the thread that compiled the code (more precisely, the thread that instruments the code via -the @scheme[errortrace-compile-handler]). +the @racket[errortrace-compile-handler]). } @defboolparam[profiling-record-enabled on?]{ Enables/disables the recording of profiling info for the instrumented code. -The default is @scheme[#t]. +The default is @racket[#t]. Profiling information is accumulated in a hash table. If a procedure is redefined, new profiling information is accumulated for the new @@ -148,15 +148,15 @@ exception-information instrumentation. } @defproc[(output-profile-results [paths? any/c] [sort-time? any/c]) void?]{ - -Gets the current profile results using @scheme[get-profile-results] and + +Gets the current profile results using @racket[get-profile-results] and displays them. It optionally shows paths information (if it is recorded), and sorts by either time or call counts.} @defproc[(get-profile-results [thd thread? (current-thread)]) list?]{ Returns a list of lists that contain all profiling information accumulated -so far (for the thread @scheme[thd]): +so far (for the thread @racket[thd]): @itemize[ @item{the number of times a procedure was called.} @@ -166,23 +166,23 @@ so far (for the thread @scheme[thd]): within the procedure, but not including time consumed by a tail-call from the procedure).} - @item{an inferred name (or @scheme[#f]) for the procedure.} + @item{an inferred name (or @racket[#f]) for the procedure.} @item{the procedure's source in the form of a syntax object (which might, in turn, provide a source location file and position).} @item{optionally, a list of unique call paths (i.e. stack traces) - recorded if @scheme[profile-paths-enabled] is set to @scheme[#t]. + recorded if @racket[profile-paths-enabled] is set to @racket[#t]. Each call path is a pair of @itemize[ @item{a count (the number of times the path occurred), and} - + @item{a list containing two-element lists. Each two-element list contains @itemize[ @item{the calling procedure's name or source expression, and} - @item{the calling procedure's source file or @scheme[#f].}] + @item{the calling procedure's source file or @racket[#f].}] } ] Collecting this information is relatively expensive.} @@ -191,7 +191,7 @@ so far (for the thread @scheme[thd]): @defboolparam[profile-paths-enabled on?]{ Enables/disables collecting path information for profiling. The default is -@scheme[#f], but setting the parameter to @scheme[#t] immediately affects +@racket[#f], but setting the parameter to @racket[#t] immediately affects all procedures instrumented for profiling information.} @defproc[(clear-profile-results) void?]{ @@ -211,13 +211,13 @@ annotations that the profiler uses, so only function bodies are counted. To see the difference between the two approaches, try this program: -@schemeblock[(define (foo x) (if x 1 2)) +@racketblock[(define (foo x) (if x 1 2)) (equal? (foo #t) 1)] The first approach will produce exact results, but it is more expensive; use it when you want to know how covered your code is (when the expected counts are small). The second approach produces coarser -results (which, in the above case, will miss the @scheme[2] expression), +results (which, in the above case, will miss the @racket[2] expression), but is less expensive; use it when you want to use the counts for profiling (when the expected counts are large). @@ -227,19 +227,19 @@ profiling (when the expected counts are large). Parameters that determine if the first (exact coverage) or second (profiler-based coverage) are enabled. Remember that setting -@scheme[instrumenting-enabled] to @scheme[#f] also disables both.} +@racket[instrumenting-enabled] to @racket[#f] also disables both.} @defproc[(get-coverage) (listof (cons/c syntax? boolean?))]{ Returns a list of pairs, one for each instrumented expression. The -first element of the pair is a @scheme[syntax?] object (usually containing +first element of the pair is a @racket[syntax?] object (usually containing source location information) for the original expression, and the second element of the pair indicates if the code has been executed. This list is snapshot of the current state of the computation.} @defproc[(get-execute-counts) (list (cons/c syntax? number?))])]{ Returns a list of pairs, one for each instrumented expression. The -first element of the pair is a @scheme[syntax?] object (usually containing +first element of the pair is a @racket[syntax?] object (usually containing source location information) for the original expression, and the second element of the pair is the number of times that the expression has been evaluated. @@ -255,16 +255,16 @@ This list is snapshot of the current state of the computation.} [display-string (or/c string? #t #f) "^.,"]) void?])]{ -Writes the named file to the @scheme[current-output-port], inserting an +Writes the named file to the @racket[current-output-port], inserting an additional line between each source line to reflect execution counts -(as reported by @scheme[get-coverage-counts] or @scheme[get-execute-counts]). -The optional @scheme[display-string] is used for the annotation: the first +(as reported by @racket[get-coverage-counts] or @racket[get-execute-counts]). +The optional @racket[display-string] is used for the annotation: the first character is used for expressions that were visited 0 times, the second character for 1 time, ..., and the last character for expressions that were visited more times. It can also be -@scheme[#f] for a minimal display, @scheme["#."], or, in -the case of @scheme[annotate-executed-file], -@scheme[#t] for a maximal display, @scheme["0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"]. +@racket[#f] for a minimal display, @racket["#."], or, in +the case of @racket[annotate-executed-file], +@racket[#t] for a maximal display, @racket["0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"]. } @defparam[test-coverage-info ht hasheq?]{ @@ -275,17 +275,17 @@ the case of @scheme[annotate-executed-file], @subsection[#:tag "other-errortrace-bindings"]{Other Errortrace Bindings} -The @schememodname[errortrace] module also exports: +The @racketmodname[errortrace] module also exports: @defproc[(print-error-trace [output-port output-port?] [exn exn?]) void?]{ -The @scheme[print-error-trace] procedure takes a port and exception and +The @racket[print-error-trace] procedure takes a port and exception and prints the Errortrace-collected debugging information contained in the exception. It is used by the exception handler installed by Errortrace.} @defparam[error-context-display-depth d integer?]{The -@scheme[error-context-display-depth] parameter controls how much context +@racket[error-context-display-depth] parameter controls how much context Errortrace's exception handler displays. The default value is 10,000.} @@ -295,8 +295,8 @@ Errortrace's exception handler displays. The default value is 10,000.} @defmodule[errortrace/errortrace-lib]{ -The @schememodname[errortrace/errortrace-lib] module exports all of the -exports of @schememodname[errortrace], plus a few more. It does +The @racketmodname[errortrace/errortrace-lib] module exports all of the +exports of @racketmodname[errortrace], plus a few more. It does not install any handlers.} The additional exports are as follows: @@ -304,29 +304,29 @@ The additional exports are as follows: @defproc[(errortrace-compile-handler (stx any/c) (immediate-eval? any/c)) compiled-expression?]{ -Compiles @scheme[stx] using the compilation handler that was active -when the @schememodname[errortrace/errortrace-lib] module was +Compiles @racket[stx] using the compilation handler that was active +when the @racketmodname[errortrace/errortrace-lib] module was executed, but first instruments the code for Errortrace information. The code is instrumented only if -@schemeblock[(namespace-module-registry (current-namespace))] +@racketblock[(namespace-module-registry (current-namespace))] is the same as when the -@schememodname[errortrace/errortrace-lib] module was executed. This +@racketmodname[errortrace/errortrace-lib] module was executed. This procedure is suitable for use as a compilation handler via -@scheme[current-compile].} +@racket[current-compile].} @defproc[(make-errortrace-compile-handler) (-> any/c any/c compiled-expression)]{ Produces a compile handler that is like -@scheme[errortrace-compile-handler], except that the code that +@racket[errortrace-compile-handler], except that the code that it produces is instrumented if the value of -@schemeblock[(namespace-module-registry (current-namespace))] +@racketblock[(namespace-module-registry (current-namespace))] is the same as when the original thunk is invoked. In addition, when the thunk is invoked, it uses -@scheme[namespace-attach-module] to attach the -@schememodname[errortrace/errortrace-key] module and the -@schememodname['#%kernel] module to the @scheme[current-namespace]. +@racket[namespace-attach-module] to attach the +@racketmodname[errortrace/errortrace-key] module and the +@racketmodname['#%kernel] module to the @racket[current-namespace]. } @defproc[(errortrace-error-display-handler (string string?) (exn exn?)) void?]{ @@ -337,18 +337,18 @@ for use as an error display handler.} @defproc[(errortrace-annotate (stx any/c)) any/c]{ Macro-expands and instruments the given top-level form. If the form is -a module named @schemeidfont{errortrace-key}, no instrumentation is +a module named @racketidfont{errortrace-key}, no instrumentation is applied. This annotation function is used by -@scheme[errortrace-compile-handler].} +@racket[errortrace-compile-handler].} @defproc[(annotate-top [stx any/c][phase-level exact-integer?]) any/c]{ -Like @scheme[errortrace-annotate], but given an explicit phase level -for @scheme[stx]; @scheme[(namespace-base-phase)] is typically the -right value for the @scheme[phase-level] argument. +Like @racket[errortrace-annotate], but given an explicit phase level +for @racket[stx]; @racket[(namespace-base-phase)] is typically the +right value for the @racket[phase-level] argument. -Unlike @scheme[errortrace-annotate], there no special case for -a module named @scheme[errortrace-key]. Also, if @scheme[stx] is a module +Unlike @racket[errortrace-annotate], there no special case for +a module named @racket[errortrace-key]. Also, if @racket[stx] is a module declaration, it is not enriched with imports to explicitly load Errortrace run-time support.} @@ -356,19 +356,19 @@ Errortrace run-time support.} @section[#:tag "stacktrace"]{Re-using Errortrace Stack Tracing} -@(define-syntax-rule (schemein id) (sigelem stacktrace-imports^ id)) -@(define-syntax-rule (schemeout id) (sigelem stacktrace^ id)) +@(define-syntax-rule (racketin id) (sigelem stacktrace-imports^ id)) +@(define-syntax-rule (racketout id) (sigelem stacktrace^ id)) @defmodule[errortrace/stacktrace]{ The errortrace collection also includes a -@schememodname[errortrace/stacktrace] library. It exports -the @scheme[stacktrace@] unit, its import signature -@scheme[stacktrace-imports^], and its export signature -@scheme[stacktrace^].} +@racketmodname[errortrace/stacktrace] library. It exports +the @racket[stacktrace@] unit, its import signature +@racket[stacktrace-imports^], and its export signature +@racket[stacktrace^].} @defthing[stacktrace@ unit?]{ -Imports @scheme[stacktrace-imports^] and exports @scheme[stacktrace^].} +Imports @racket[stacktrace-imports^] and exports @racket[stacktrace^].} @defsignature[stacktrace^ ()]{ @@ -378,11 +378,11 @@ Imports @scheme[stacktrace-imports^] and exports @scheme[stacktrace^].} @defproc[(annotate-top (stx syntax?) (phase-level exact-integer?)) syntax?])]{ Annotate expressions with errortrace information. The -@schemeout[annotate-top] function should be called with a top-level -expression, and @schemeout[annotate] should be called with a nested -expression (e.g., by @schemein[initialize-profile-point]). The -@scheme[phase-level] argument indicates the phase level of the -expression, typically @scheme[(namespace-base-phase)] for a top-level +@racketout[annotate-top] function should be called with a top-level +expression, and @racketout[annotate] should be called with a nested +expression (e.g., by @racketin[initialize-profile-point]). The +@racket[phase-level] argument indicates the phase level of the +expression, typically @racket[(namespace-base-phase)] for a top-level expression.} @deftogether[( @@ -390,17 +390,17 @@ expression.} @defproc[(st-mark-source (st-mark st-mark?)) syntax?] @defproc[(st-mark-bindings (st-mark st-mark?)) list?])]{ -The @schemeout[st-mark-source] and @schemeout[st-mark-bindings] +The @racketout[st-mark-source] and @racketout[st-mark-bindings] functions extract information from a particular kind of value. -The value must be created by @schemeout[make-st-mark] -(the shape of the value is guaranteed to be writable and not to be @scheme[#f], but otherwise unspecified). -The @scheme[make-st-mark] function returns @scheme[#f] when there is +The value must be created by @racketout[make-st-mark] +(the shape of the value is guaranteed to be writable and not to be @racket[#f], but otherwise unspecified). +The @racket[make-st-mark] function returns @racket[#f] when there is no source location information in the syntax object. -The @schemeout[st-mark-source] extracts the value originally provided to -the expression-maker, and @schemeout[st-mark-bindings] returns local +The @racketout[st-mark-source] extracts the value originally provided to +the expression-maker, and @racketout[st-mark-bindings] returns local binding information (if available) as a list of two element (syntax? -any/c) lists. The @schemeout[st-mark-bindings] function is currently -hardwired to return @scheme[null]. } +any/c) lists. The @racketout[st-mark-bindings] function is currently +hardwired to return @racket[null]. } } @@ -408,8 +408,8 @@ hardwired to return @scheme[null]. } @defproc[(with-mark (source-stx any/c) (dest-stx any/c)) any/c]{ -Called by @schemeout[annotate] and @schemeout[annotate-top] to wrap -expressions with @scheme[with-continuation-mark]. The first argument +Called by @racketout[annotate] and @racketout[annotate-top] to wrap +expressions with @racket[with-continuation-mark]. The first argument is the source expression and the second argument is the expression to be wrapped.} @@ -418,24 +418,24 @@ be wrapped.} Determines if the test coverage annotation is inserted into the code. This parameter controls how compilation happens---it does not affect the dynamic behavior of the already compiled code. If the parameter is set, -code generated by @schemein[test-covered] are inserted into the code (and -@schemein[initialize-test-coverage-point] is called during compilation). -If not, no calls to @scheme[test-covered] code are inserted.} +code generated by @racketin[test-covered] are inserted into the code (and +@racketin[initialize-test-coverage-point] is called during compilation). +If not, no calls to @racket[test-covered] code are inserted.} @defproc[(test-covered (stx any/c)) (or/c syntax? (-> void?) #f)]{ This is called during compilation of the program with an expression for each point in the program that was passed to -@schemein[initialize-test-coverage-point]. +@racketin[initialize-test-coverage-point]. -If the result is @scheme[#f], this program point is not instrumented. If +If the result is @racket[#f], this program point is not instrumented. If the result is syntax, it is inserted into the code, and if it is a thunk, the thunk is inserted into the code in an application (using the thunk directly, as a 3D value). In either case, the syntax or the thunk should register that the relevant point was covered. Note: using a thunk tends to be slow. Current uses in the Racket code -will create a mutable pair in @scheme[initialize-test-coverage-point], -and @scheme[test-covered] returns syntax that will set its mcar. (This +will create a mutable pair in @racket[initialize-test-coverage-point], +and @racket[test-covered] returns syntax that will set its mcar. (This makes the resulting overhead about 3 times smaller.)} @defproc[(initialize-test-coverage-point (stx any/c)) void?]{ @@ -452,7 +452,7 @@ Only used for profiling paths.} Determines if profiling information is currently collected (affects the behavior of compiling the code---does not affect running code). -If this always returns @scheme[#f], the other profiling functions are +If this always returns @racket[#f], the other profiling functions are never called.} @defproc[(initialize-profile-point (key any/c) @@ -470,8 +470,8 @@ this expression.} Called when some profiled code is about to be executed. If the result is a number, it is expected to be the current number of -milliseconds. @scheme[key] is unique to this fragment of code---it is -the same key passed to @schemein[initialize-profile-point] for this code +milliseconds. @racket[key] is unique to this fragment of code---it is +the same key passed to @racketin[initialize-profile-point] for this code fragment.} @defproc[(register-profile-done (key any/c) @@ -480,19 +480,19 @@ fragment.} This function is called when some profiled code is finished executing. -Note that @schemein[register-profile-start] and -@schemein[register-profile-done] can be called in a nested manner; in -this case, the result of @schemein[register-profile-start] should be -@scheme[#f].} +Note that @racketin[register-profile-start] and +@racketin[register-profile-done] can be called in a nested manner; in +this case, the result of @racketin[register-profile-start] should be +@racket[#f].} } @section{Errortrace Key} @defmodule[errortrace/errortrace-key] -This module depends only on @schememodname['#%kernel]. +This module depends only on @racketmodname['#%kernel]. @defthing[errortrace-key symbol?]{ - A key used by errortrace via @scheme[with-continuation-mark] to + A key used by errortrace via @racket[with-continuation-mark] to record stack information. } diff --git a/collects/file/scribblings/convertible.scrbl b/collects/file/scribblings/convertible.scrbl index 3170bc3184..d237754929 100644 --- a/collects/file/scribblings/convertible.scrbl +++ b/collects/file/scribblings/convertible.scrbl @@ -6,7 +6,7 @@ @defmodule[file/convertible] -The @schememodname[file/convertible] library provides a protocol to +The @racketmodname[file/convertible] library provides a protocol to mediate between providers of data in different possible formats and consumers of the formats. For example, a datatype that implements @racket[prop:convertible] might be able to convert itself to a GIF or @@ -19,13 +19,13 @@ should be considered standard: @itemlist[ #:style 'compact - @item{@scheme['text] --- a string for human-readable text} - @item{@scheme['gif-bytes] --- a byte string containing a GIF image encoding} - @item{@scheme['png-bytes] --- a byte string containing a PNG image encoding} - @item{@scheme['ps-bytes] --- a byte string containing a PostScript document} - @item{@scheme['eps-bytes] --- a byte string containing an Encapsulated PostScript document} - @item{@scheme['pdf-bytes] --- a byte string containing a PDF document} - @item{@scheme['pdf-bytes+bounds] --- a list containing a byte string and four numbers; + @item{@racket['text] --- a string for human-readable text} + @item{@racket['gif-bytes] --- a byte string containing a GIF image encoding} + @item{@racket['png-bytes] --- a byte string containing a PNG image encoding} + @item{@racket['ps-bytes] --- a byte string containing a PostScript document} + @item{@racket['eps-bytes] --- a byte string containing an Encapsulated PostScript document} + @item{@racket['pdf-bytes] --- a byte string containing a PDF document} + @item{@racket['pdf-bytes+bounds] --- a list containing a byte string and four numbers; the byte string contains a PDF document and the four numbers are sizing information for the PDF document, namely the width, height, ascent and descent in that order} ] diff --git a/collects/file/scribblings/gif.scrbl b/collects/file/scribblings/gif.scrbl index dd1904c8e2..29befe5225 100644 --- a/collects/file/scribblings/gif.scrbl +++ b/collects/file/scribblings/gif.scrbl @@ -7,29 +7,29 @@ @defmodule[file/gif] -The @schememodname[file/gif] library provides functions for +The @racketmodname[file/gif] library provides functions for writing GIF files to a stream, including GIF files with multiple images and controls (such as animated GIFs). -A GIF stream is created by @scheme[gif-start], and then individual -images are written with @scheme[gif-add-image]. Optionally, -@scheme[gif-add-control] inserts instructions for rendering the -images. The @scheme[gif-end] function ends the GIF stream. +A GIF stream is created by @racket[gif-start], and then individual +images are written with @racket[gif-add-image]. Optionally, +@racket[gif-add-control] inserts instructions for rendering the +images. The @racket[gif-end] function ends the GIF stream. A GIF stream can be in any one of the following states: @itemize[ - @item{@scheme['init] : no images or controls have been added to the + @item{@racket['init] : no images or controls have been added to the stream} - @item{@scheme['image-or-control] : another image or control can be + @item{@racket['image-or-control] : another image or control can be written} - @item{@scheme['image] : another image can be written (but not a + @item{@racket['image] : another image can be written (but not a control, since a control was written)} - @item{@scheme['done] : nothing more can be added} + @item{@racket['done] : nothing more can be added} ] diff --git a/collects/file/scribblings/gunzip.scrbl b/collects/file/scribblings/gunzip.scrbl index ae43c7eb0c..e63ede6c84 100644 --- a/collects/file/scribblings/gunzip.scrbl +++ b/collects/file/scribblings/gunzip.scrbl @@ -3,7 +3,7 @@ @title[#:tag "gunzip"]{@exec{gzip} Decompression} -@defmodule[file/gunzip]{The @schememodname[file/gunzip] library provides +@defmodule[file/gunzip]{The @racketmodname[file/gunzip] library provides utilities to decompress archive files in @exec{gzip} format, or simply to deccompress data using the @exec{pkzip} ``inflate'' method.} @@ -14,36 +14,36 @@ to deccompress data using the @exec{pkzip} ``inflate'' method.} void?]{ Extracts data that was compressed using the @exec{gzip} utility (or -@scheme[gzip] function), writing the uncompressed data directly to a -file. The @scheme[file] argument is the name of the file containing +@racket[gzip] function), writing the uncompressed data directly to a +file. The @racket[file] argument is the name of the file containing compressed data. The default output file name is the original name of -the compressed file as stored in @scheme[file]. If a file by this name +the compressed file as stored in @racket[file]. If a file by this name exists, it will be overwritten. If no original name is stored in the -source file, @scheme["unzipped"] is used as the default output file +source file, @racket["unzipped"] is used as the default output file name. -The @scheme[output-name-filter] procedure is applied to two +The @racket[output-name-filter] procedure is applied to two arguments---the default destination file name and a boolean that is -@scheme[#t] if this name was read from @scheme[file]---before the +@racket[#t] if this name was read from @racket[file]---before the destination file is created. The return value of the file is used as the actual destination file name (to be opened with the -@scheme['truncate] flag of @scheme[open-output-file]). +@racket['truncate] flag of @racket[open-output-file]). If the compressed data turns out to be corrupted, the -@scheme[exn:fail] exception is raised.} +@racket[exn:fail] exception is raised.} @defproc[(gunzip-through-ports [in input-port?] [out output-port?]) void?]{ -Reads the port @scheme[in] for compressed data that was created using +Reads the port @racket[in] for compressed data that was created using the @exec{gzip} utility, writing the uncompressed data to the port -@scheme[out]. +@racket[out]. If the compressed data turns out to be corrupted, the -@scheme[exn:fail] exception is raised. The unzipping process may peek -further into @scheme[in] than needed to decompress the data, but it +@racket[exn:fail] exception is raised. The unzipping process may peek +further into @racket[in] than needed to decompress the data, but it will not consume the unneeded bytes.} @@ -51,12 +51,12 @@ will not consume the unneeded bytes.} [out output-port?]) void?]{ -Reads @exec{pkzip}-format ``deflated'' data from the port @scheme[in] +Reads @exec{pkzip}-format ``deflated'' data from the port @racket[in] and writes the uncompressed (``inflated'') data to the port -@scheme[out]. The data in a file created by @exec{gzip} uses this +@racket[out]. The data in a file created by @exec{gzip} uses this format (preceded with some header information). If the compressed data turns out to be corrupted, the -@scheme[exn:fail] exception is raised. The inflate process may peek -further into @scheme[in] than needed to decompress the data, but it +@racket[exn:fail] exception is raised. The inflate process may peek +further into @racket[in] than needed to decompress the data, but it will not consume the unneeded bytes.} diff --git a/collects/file/scribblings/gzip.scrbl b/collects/file/scribblings/gzip.scrbl index c245fbd541..9aa4d90f59 100644 --- a/collects/file/scribblings/gzip.scrbl +++ b/collects/file/scribblings/gzip.scrbl @@ -3,7 +3,7 @@ @title[#:tag "gzip"]{@exec{gzip} Compression and File Creation} -@defmodule[file/gzip]{The @schememodname[file/gzip] library provides +@defmodule[file/gzip]{The @racketmodname[file/gzip] library provides utilities to create archive files in @exec{gzip} format, or simply to compress data using the @exec{pkzip} ``deflate'' method.} @@ -12,9 +12,9 @@ compress data using the @exec{pkzip} ``deflate'' method.} void?]{ Compresses data to the same format as the @exec{gzip} utility, writing -the compressed data directly to a file. The @scheme[in-file] argument +the compressed data directly to a file. The @racket[in-file] argument is the name of the file to compress. If the file named by -@scheme[out-file] exists, it will be overwritten.} +@racket[out-file] exists, it will be overwritten.} @defproc[(gzip-through-ports [in input-port?] @@ -23,13 +23,13 @@ is the name of the file to compress. If the file named by [timestamp exact-integer?]) void?]{ -Reads the port @scheme[in] for data and compresses it to @scheme[out], +Reads the port @racket[in] for data and compresses it to @racket[out], outputting the same format as the @exec{gzip} utility. The -@scheme[orig-filename] string is embedded in this output; -@scheme[orig-filename] can be @scheme[#f] to omit the filename from -the compressed stream. The @scheme[timestamp] number is also embedded +@racket[orig-filename] string is embedded in this output; +@racket[orig-filename] can be @racket[#f] to omit the filename from +the compressed stream. The @racket[timestamp] number is also embedded in the output stream, as the modification date of the original file -(in Unix seconds, as @scheme[file-or-directory-modify-seconds] would +(in Unix seconds, as @racket[file-or-directory-modify-seconds] would report on Unix).} @@ -39,11 +39,11 @@ report on Unix).} exact-nonnegative-integer? exact-nonnegative-integer?)]{ -Writes @exec{pkzip}-format ``deflated'' data to the port @scheme[out], -compressing data from the port @scheme[in]. The data in a file +Writes @exec{pkzip}-format ``deflated'' data to the port @racket[out], +compressing data from the port @racket[in]. The data in a file created by @exec{gzip} uses this format (preceded with header information). -The result is three values: the number of bytes read from @scheme[in], -the number of bytes written to @scheme[out], and a cyclic redundancy +The result is three values: the number of bytes read from @racket[in], +the number of bytes written to @racket[out], and a cyclic redundancy check (CRC) value for the input.} diff --git a/collects/file/scribblings/sha1.scrbl b/collects/file/scribblings/sha1.scrbl index 9290e7648e..fcd264556b 100644 --- a/collects/file/scribblings/sha1.scrbl +++ b/collects/file/scribblings/sha1.scrbl @@ -13,10 +13,10 @@ See @racketmodname[openssl/sha1] for a faster implementation. @defproc[(sha1 [in input-port]) string?]{ Returns a 40-character string that represents the SHA-1 hash (in -hexadecimal notation) of the content from @scheme[in], consuming all -of the input from @scheme[in] until an end-of-file. +hexadecimal notation) of the content from @racket[in], consuming all +of the input from @racket[in] until an end-of-file. -The @scheme[sha1] function composes @scheme[bytes->hex-string] with +The @racket[sha1] function composes @racket[bytes->hex-string] with @racket[sha1-bytes]. @examples[ @@ -27,7 +27,7 @@ The @scheme[sha1] function composes @scheme[bytes->hex-string] with @defproc[(sha1-bytes [in input-port]) bytes?]{ Returns a 20-byte byte string that represents the SHA-1 hash of the -content from @scheme[in], consuming all of the input from @scheme[in] +content from @racket[in], consuming all of the input from @racket[in] until an end-of-file. @examples[ @@ -38,5 +38,5 @@ until an end-of-file. @defproc[(bytes->hex-string [bstr bytes?]) string?]{ Converts the given byte string to a string representation, where each -byte in @scheme[bstr] is converted to its two-digit hexadecimal +byte in @racket[bstr] is converted to its two-digit hexadecimal representation in the resulting string.} diff --git a/collects/file/scribblings/tar.scrbl b/collects/file/scribblings/tar.scrbl index 2f1eeb4ba8..33e6069ee6 100644 --- a/collects/file/scribblings/tar.scrbl +++ b/collects/file/scribblings/tar.scrbl @@ -3,7 +3,7 @@ @title[#:tag "tar"]{@exec{tar} File Creation} -@defmodule[file/tar]{The @schememodname[file/tar] library provides +@defmodule[file/tar]{The @racketmodname[file/tar] library provides utilities to create archive files in USTAR format, like the archive that the Unix utility @exec{pax} generates. The USTAR format imposes limits on path lengths. The resulting archives contain only @@ -14,26 +14,26 @@ is always ``root.''} @defproc[(tar [tar-file path-string?][path path-string?] ...) exact-nonnegative-integer?]{ -Creates @scheme[tar-file], which holds the complete content of all -@scheme[path]s. The given @scheme[path]s are all expected to be +Creates @racket[tar-file], which holds the complete content of all +@racket[path]s. The given @racket[path]s are all expected to be relative path names of existing directories and files (i.e., relative to the current directory). If a nested path is provided as a -@scheme[path], its ancestor directories are also added to the +@racket[path], its ancestor directories are also added to the resulting tar file, up to the current directory (using -@scheme[pathlist-closure]).} +@racket[pathlist-closure]).} @defproc[(tar->output [paths (listof path?)] [out output-port? (current-output-port)]) exact-nonnegative-integer?]{ -Packages each of the given @scheme[paths] in a @exec{tar} format -archive that is written directly to the @scheme[out]. The specified -@scheme[paths] are included as-is; if a directory is specified, its +Packages each of the given @racket[paths] in a @exec{tar} format +archive that is written directly to the @racket[out]. The specified +@racket[paths] are included as-is; if a directory is specified, its content is not automatically added, and nested directories are added without parent directories.} @defproc[(tar-gzip [tar-file path-string?] [paths path-string?] ...) void?]{ -Like @scheme[tar], but compresses the resulting file with @scheme[gzip]. +Like @racket[tar], but compresses the resulting file with @racket[gzip]. } diff --git a/collects/file/scribblings/zip.scrbl b/collects/file/scribblings/zip.scrbl index 151a55ac6b..25a967016d 100644 --- a/collects/file/scribblings/zip.scrbl +++ b/collects/file/scribblings/zip.scrbl @@ -3,24 +3,24 @@ @title[#:tag "zip"]{@exec{zip} File Creation} -@defmodule[file/zip]{The @schememodname[file/zip] library provides +@defmodule[file/zip]{The @racketmodname[file/zip] library provides utilities to create @exec{zip} archive files, which are compatible with both Windows and Unix (including Mac OS X) unpacking. The actual -compression is implemented by @scheme[deflate].} +compression is implemented by @racket[deflate].} @defproc[(zip [zip-file path-string?][path path-string?] ...) void?]{ -Creates @scheme[zip-file], which holds the complete content of all -@scheme[path]s. The given @scheme[path]s are all expected to be +Creates @racket[zip-file], which holds the complete content of all +@racket[path]s. The given @racket[path]s are all expected to be relative path names of existing directories and files (i.e., relative to the current directory). If a nested path is provided as a -@scheme[path], its ancestor directories are also added to the +@racket[path], its ancestor directories are also added to the resulting zip file, up to the current directory (using -@scheme[pathlist-closure]). Files are packaged as usual for +@racket[pathlist-closure]). Files are packaged as usual for @exec{zip} files, including permission bits for both Windows and Unix (including Mac OS X). The permission bits are determined by -@scheme[file-or-directory-permissions], which does not preserve the +@racket[file-or-directory-permissions], which does not preserve the distinction between owner/group/other permissions. Also, symbolic links are always followed.} @@ -29,16 +29,16 @@ links are always followed.} [out output-port? (current-output-port)]) void?]{ -Zips each of the given @scheme[paths], and packages it as a zip -``file'' that is written directly to @scheme[out]. Unlike -@scheme[zip], the specified @scheme[paths] are included as-is; if a +Zips each of the given @racket[paths], and packages it as a zip +``file'' that is written directly to @racket[out]. Unlike +@racket[zip], the specified @racket[paths] are included as-is; if a directory is specified, its content is not automatically added, and nested directories are added without parent directories.} @defboolparam[zip-verbose on?]{ -A parameter that controls output during a @scheme[zip] -operation. Setting this parameter to a true value causes @scheme[zip] -to display to @scheme[(current-error-port)] the filename that is +A parameter that controls output during a @racket[zip] +operation. Setting this parameter to a true value causes @racket[zip] +to display to @racket[(current-error-port)] the filename that is currently being compressed.} diff --git a/collects/framework/gui-utils.rkt b/collects/framework/gui-utils.rkt index 6faa0923b1..52d3659abe 100644 --- a/collects/framework/gui-utils.rkt +++ b/collects/framework/gui-utils.rkt @@ -39,9 +39,7 @@ ;; quote-literal-label: string -> string (define (quote-literal-label a-str) (trim-string (regexp-replace* #rx"(&)" a-str "\\1\\1") - maximum-string-label-length)) - - + maximum-string-label-length)) ;; selected-text-color : color (define selected-text-color (send the-color-database find-color "black")) @@ -302,7 +300,7 @@ (λ (str) ((string-length str) . <= . size)))]) @{Constructs a string whose size is less - than @scheme[size] by trimming the @scheme[str] + than @racket[size] by trimming the @racket[str] and inserting an ellispses into it.}) (proc-doc @@ -334,12 +332,12 @@ gui-utils:cancel-on-right? (-> boolean?) () - @{Returns @scheme[#t] if cancel should be on the right-hand side (or below) - in a dialog and @scheme[#f] otherwise. + @{Returns @racket[#t] if cancel should be on the right-hand side (or below) + in a dialog and @racket[#f] otherwise. - Just returns what @scheme[system-position-ok-before-cancel?] does. + Just returns what @racket[system-position-ok-before-cancel?] does. - See also @scheme[gui-utils:ok/cancel-buttons].}) + See also @racket[gui-utils:ok/cancel-buttons].}) (proc-doc/names gui-utils:ok/cancel-buttons (->* ((is-a?/c area-container<%>) @@ -365,12 +363,12 @@ The first result is be the OK button and the second is the cancel button. - By default, the confirmation action button has the @scheme['(border)] style, + By default, the confirmation action button has the @racket['(border)] style, meaning that hitting return in the dialog will trigger the confirmation action. The @racket[confirm-style] argument can override this behavior, tho. See @racket[button%] for the precise list of allowed styles. - See also @scheme[gui-utils:cancel-on-right?].}) + See also @racket[gui-utils:cancel-on-right?].}) (proc-doc/names gui-utils:next-untitled-name @@ -390,13 +388,13 @@ The first case in the case lambda returns the current delay in seconds before a watch cursor is shown, - when either @scheme[gui-utils:local-busy-cursor] or - @scheme[gui-utils:show-busy-cursor] is called. + when either @racket[gui-utils:local-busy-cursor] or + @racket[gui-utils:show-busy-cursor] is called. The second case in the case lambda Sets the delay, in seconds, before a watch cursor is shown, when - either @scheme[gui-utils:local-busy-cursor] or - @scheme[gui-utils:show-busy-cursor] is called.}) + either @racket[gui-utils:local-busy-cursor] or + @racket[gui-utils:show-busy-cursor] is called.}) (proc-doc/names gui-utils:show-busy-cursor (->* ((-> any/c)) @@ -404,12 +402,12 @@ any/c) ((thunk) ((delay (gui-utils:cursor-delay)))) - @{Evaluates @scheme[(thunk)] with a watch cursor. The argument - @scheme[delay] specifies the amount of time before the watch cursor is - opened. Use @scheme[gui-utils:cursor-delay] to set this value + @{Evaluates @racket[(thunk)] with a watch cursor. The argument + @racket[delay] specifies the amount of time before the watch cursor is + opened. Use @racket[gui-utils:cursor-delay] to set this value to all calls. - This function returns the result of @scheme[thunk].}) + This function returns the result of @racket[thunk].}) (proc-doc/names gui-utils:delay-action (real? @@ -424,7 +422,7 @@ to appear after 2 seconds and the action may or may not take more than two seconds, use this pattern: - @schemeblock[(let ([close-down + @racketblock[(let ([close-down (gui-utils:delay-action 2 (λ () .. init watch cursor ...) @@ -432,11 +430,11 @@ ;; .. do action ... (close-down))] - Creates a thread that waits @scheme[delay-time]. After @scheme[delay-time] + Creates a thread that waits @racket[delay-time]. After @racket[delay-time] has elapsed, if the result thunk has @italic{not} been called, call - @scheme[open]. Then, when the result thunk is called, call - @scheme[close]. The function @scheme[close] will only be called if - @scheme[open] has been called.}) + @racket[open]. Then, when the result thunk is called, call + @racket[close]. The function @racket[close] will only be called if + @racket[open] has been called.}) (proc-doc/names gui-utils:local-busy-cursor @@ -447,13 +445,13 @@ any/c) ((window thunk) ((delay (gui-utils:cursor-delay)))) - @{Evaluates @scheme[(thunk)] with a watch cursor in @scheme[window]. If - @scheme[window] is @scheme[#f], the watch cursor is turned on globally. - The argument @scheme[delay] specifies the amount of time before the watch - cursor is opened. Use @scheme[gui-utils:cursor-delay] + @{Evaluates @racket[(thunk)] with a watch cursor in @racket[window]. If + @racket[window] is @racket[#f], the watch cursor is turned on globally. + The argument @racket[delay] specifies the amount of time before the watch + cursor is opened. Use @racket[gui-utils:cursor-delay] to set this value for all uses of this function. - The result of this function is the result of @scheme[thunk].}) + The result of this function is the result of @racket[thunk].}) (proc-doc/names gui-utils:unsaved-warning @@ -473,17 +471,17 @@ @{This displays a dialog that warns the user of a unsaved file. - The string, @scheme[action], indicates what action is about to + The string, @racket[action], indicates what action is about to take place, without saving. For example, if the application - is about to close a file, a good action is @scheme["Close" "Anyway"]. + is about to close a file, a good action is @racket["Close" "Anyway"]. The result symbol indicates the user's choice. If - @scheme[can-save-now?] is @scheme[#f], this function does not + @racket[can-save-now?] is @racket[#f], this function does not give the user the ``Save'' option and thus will not return - @scheme['save]. + @racket['save]. - If @scheme[cancel?] is @scheme[#t] there is a cancel button - in the dialog and the result may be @scheme['cancel]. If it - is @scheme[#f], then there is no cancel button, and @scheme['cancel] + If @racket[cancel?] is @racket[#t] there is a cancel button + in the dialog and the result may be @racket['cancel]. If it + is @racket[#f], then there is no cancel button, and @racket['cancel] will not be the result of the function. }) @@ -514,30 +512,30 @@ dialog opens a message box asking the user to actually choose one of the two options. - The dialog will contain the string @scheme[message] and two buttons, - labeled with the @scheme[true-choice] and the @scheme[false-choice]. If the - user clicks on @scheme[true-choice] @scheme[#t] is returned. If the user - clicks on @scheme[false-choice], @scheme[#f] is returned. + The dialog will contain the string @racket[message] and two buttons, + labeled with the @racket[true-choice] and the @racket[false-choice]. If the + user clicks on @racket[true-choice] @racket[#t] is returned. If the user + clicks on @racket[false-choice], @racket[#f] is returned. - The argument @scheme[default-result] determines how closing the window is - treated. If the argument is @scheme['disallow-close], closing the window + The argument @racket[default-result] determines how closing the window is + treated. If the argument is @racket['disallow-close], closing the window is not allowed. If it is anything else, that value is returned when the user closes the window. - If @scheme[gui-utils:cancel-on-right?] - returns @scheme[#t], the false choice is on the right. + If @racket[gui-utils:cancel-on-right?] + returns @racket[#t], the false choice is on the right. Otherwise, the true choice is on the right. - The @scheme[style] parameter is (eventually) passed to - @scheme[message] + The @racket[style] parameter is (eventually) passed to + @racket[message] as an icon in the dialog. - If @scheme[checkbox-proc] is given, it should be a procedure that behaves + If @racket[checkbox-proc] is given, it should be a procedure that behaves like a parameter for getting/setting a boolean value. The intention for this value is that it can be used to disable the dialog. When it is - given, a checkbox will appear with a @scheme[checkbox-label] label - (defaults to the @scheme[dont-ask-again] string constant), and that - checkbox value will be sent to the @scheme[checkbox-proc] when the dialog + given, a checkbox will appear with a @racket[checkbox-label] label + (defaults to the @racket[dont-ask-again] string constant), and that + checkbox value will be sent to the @racket[checkbox-proc] when the dialog is closed. Note that the dialog will always pop-up --- it is the caller's responsibility to avoid the dialog if not needed.}) @@ -550,13 +548,13 @@ ((white-on-black? #f))) @{This delta is designed for use with @method[text set-clickback]. - Use it as one of the @scheme[style-delta%] argument to + Use it as one of the @racket[style-delta%] argument to @method[text% set-clickback]. - If @scheme[white-on-black?] is true, the function returns + If @racket[white-on-black?] is true, the function returns a delta suitable for use on a black background. - See also @scheme[gui-utils:get-clickback-delta].}) + See also @racket[gui-utils:get-clickback-delta].}) (proc-doc/names gui-utils:get-clickback-delta @@ -569,8 +567,8 @@ Use the result of this function as the style for the region text where the clickback is set. - If @scheme[white-on-black?] is true, the function returns + If @racket[white-on-black?] is true, the function returns a delta suitable for use on a black background. See also - @scheme[gui-utils:get-clicked-clickback-delta].})) + @racket[gui-utils:get-clicked-clickback-delta].})) diff --git a/collects/framework/main.rkt b/collects/framework/main.rkt index 7c577af453..fb73b3270d 100644 --- a/collects/framework/main.rkt +++ b/collects/framework/main.rkt @@ -69,7 +69,7 @@ (proc-doc/names text:range? (-> any/c boolean?) (arg) - @{Determines if @scheme[arg] is an instance of the @tt{range} struct.}) + @{Determines if @racket[arg] is an instance of the @tt{range} struct.}) (proc-doc/names text:range-start @@ -108,16 +108,16 @@ (parameter/c string?) suffix @{A string that is inserted after a completion is inserted by a - @scheme[text:autocomplete] instance. + @racket[text:autocomplete] instance. - Defaults to @scheme[""].}) + Defaults to @racket[""].}) (parameter-doc text:autocomplete-limit (parameter/c (and/c integer? exact? positive?)) count @{Controls the number of completions visible at a time in the menu produced - by @scheme[text:autocomplete] instances. + by @racket[text:autocomplete] instances. Defaults to 15.}) @@ -125,38 +125,38 @@ text:get-completions/manuals (-> (or/c false/c (listof symbol?)) (listof string?)) (manuals) - @{Returns the list of keywords for the manuals from @scheme[manuals] by + @{Returns the list of keywords for the manuals from @racket[manuals] by extracting all of the documented exports of the manuals. The symbols are meant to be module paths, e.g., the quoted form of the argument to - @scheme[require]. + @racket[require]. - If @scheme[manuals] is false, then all of the documented names are used.}) + If @racket[manuals] is false, then all of the documented names are used.}) (proc-doc/names text:lookup-port-name (-> symbol? (or/c (is-a?/c editor:basic<%>) false/c)) (manuals) @{Returns the editor instance whose port-name matches the given symbol. - If no editor can be found, then returns @scheme[false].}) + If no editor can be found, then returns @racket[false].}) (proc-doc/names number-snip:make-repeating-decimal-snip (number? boolean? . -> . (is-a?/c snip%)) (num show-prefix?) - @{Makes a number snip that shows the decimal expansion for @scheme[number]. + @{Makes a number snip that shows the decimal expansion for @racket[number]. The boolean indicates if a @litchar{#e} prefix appears on the number. - See also @scheme[number-snip:make-fraction-snip].}) + See also @racket[number-snip:make-fraction-snip].}) (proc-doc/names number-snip:make-fraction-snip (number? boolean? . -> . (is-a?/c snip%)) (num show-prefix-in-decimal-view?) - @{Makes a number snip that shows a fractional view of @scheme[number]. + @{Makes a number snip that shows a fractional view of @racket[number]. The boolean indicates if a @litchar{#e} prefix appears on the number, when shown in the decimal state. - See also @scheme[number-snip:make-repeating-decimal-snip].}) + See also @racket[number-snip:make-repeating-decimal-snip].}) (thing-doc comment-box:snipclass @@ -167,13 +167,13 @@ version:add-spec (any/c any/c . -> . void?) (spec revision) - @{The two values are appended to the version string. @scheme[write] is used + @{The two values are appended to the version string. @racket[write] is used to transform them to strings. For example: - @scheme[(version:add-spec 's 1)] + @racket[(version:add-spec 's 1)] in version 205 will make the version string be @litchar{205s1}. The - symbols @scheme['f] and @scheme['d] were used internally for framework and + symbols @racket['f] and @racket['d] were used internally for framework and drscheme revisions in the past.}) (proc-doc/names @@ -181,17 +181,17 @@ (-> string?) () @{This function returns a string describing the version of this application. - See also @scheme[version:add-spec].}) + See also @racket[version:add-spec].}) (parameter-doc application:current-app-name (parameter/c string?) name @{This is a parameter specifying the name of the current application. It is - used in the help menu (see @scheme[frame:standard-menus%]) and in frame - titles (see @scheme[frame:editor%]). The first case in the case-lambda + used in the help menu (see @racket[frame:standard-menus%]) and in frame + titles (see @racket[frame:editor%]). The first case in the case-lambda returns the current name, and the second case in the case-lambda sets the - name of the application to @scheme[name].}) + name of the application to @racket[name].}) (proc-doc/names preferences:put-preferences/gui @@ -199,7 +199,7 @@ (listof any/c) any) (name-list val-list) - @{Like @scheme[put-preferences], but has more sophisticated error handling. + @{Like @racket[put-preferences], but has more sophisticated error handling. In particular, it @itemize[ @item{waits for three consecutive failures before informing the user} @@ -216,7 +216,7 @@ any/c) ((sym) ((default (λ () (error 'get-preference/gui "unknown pref ~s" sym))))) - @{Like @scheme[get-preference], but has more sophisticated error handling. + @{Like @racket[get-preference], but has more sophisticated error handling. In particular, it passes a @racket[#:timeout-lock-there] argument that informs the user that the preferences file is locked (and offers the alternative of not showing the message again).}) @@ -236,20 +236,20 @@ (send parent get-children)))))]) void?) (labels f) - @{@scheme[preferences:add-preference-panel] adds the result of @scheme[f] - with name @scheme[labels] to the preferences dialog box. + @{@racket[preferences:add-preference-panel] adds the result of @racket[f] + with name @racket[labels] to the preferences dialog box. The labels determine where this preference panel is placed in the dialog. If the list is just one string, the preferences panel is placed at the top level of the dialog. If there are more strings, a hierarchy of nested panels is created and the new panel is added at the end. If multiple calls - to @scheme[preferences:add-preference-panel] pass the same prefix of + to @racket[preferences:add-preference-panel] pass the same prefix of strings, those panels are placed in the same children. When the preference dialog is opened for the first time, the function - @scheme[f] is called with a panel, and @scheme[f] is expected to add a new + @racket[f] is called with a panel, and @racket[f] is expected to add a new child panel to it and add whatever preferences configuration controls it - wants to that panel. Then, @scheme[f]'s should return the panel it added.}) + wants to that panel. Then, @racket[f]'s should return the panel it added.}) (proc-doc/names preferences:add-editor-checkbox-panel @@ -279,14 +279,14 @@ preferences:add-to-warnings-checkbox-panel (((is-a?/c vertical-panel%) . -> . void?) . -> . void?) (proc) - @{Saves @scheme[proc] until the preferences panel is created, when it is + @{Saves @racket[proc] until the preferences panel is created, when it is called with the Misc. panel to add new children to the panel.}) (proc-doc/names preferences:add-to-scheme-checkbox-panel (((is-a?/c vertical-panel%) . -> . void?) . -> . void?) (proc) - @{Saves @scheme[proc] until the preferences panel is created, when it is + @{Saves @racket[proc] until the preferences panel is created, when it is called with the Racket preferences panel to add new children to the panel.}) @@ -294,7 +294,7 @@ preferences:add-to-editor-checkbox-panel (((is-a?/c vertical-panel%) . -> . void?) . -> . void?) (proc) - @{Saves @scheme[proc] until the preferences panel is created, when it is + @{Saves @racket[proc] until the preferences panel is created, when it is called with the editor preferences panel to add new children to the panel.}) @@ -302,7 +302,7 @@ preferences:add-to-general-checkbox-panel (((is-a?/c vertical-panel%) . -> . void?) . -> . void?) (proc) - @{Saves @scheme[proc] until the preferences panel is created, when it is + @{Saves @racket[proc] until the preferences panel is created, when it is called with the general preferences panel to add new children to the panel.}) @@ -328,20 +328,20 @@ preferences:add-on-close-dialog-callback ((-> void?) . -> . void?) (cb) - @{Registers @scheme[cb]. Next time the user clicks the OK button the - preferences dialog, all of the @scheme[cb] functions are called, assuming + @{Registers @racket[cb]. Next time the user clicks the OK button the + preferences dialog, all of the @racket[cb] functions are called, assuming that each of the callbacks passed to - @scheme[preferences:add-can-close-dialog-callback] succeed.}) + @racket[preferences:add-can-close-dialog-callback] succeed.}) (proc-doc/names preferences:add-can-close-dialog-callback ((-> boolean?) . -> . void?) (cb) - @{Registers @scheme[cb]. Next time the user clicks the OK button the - preferences dialog, all of the @scheme[cb] functions are called. If any of - them return @scheme[#f], the dialog is not closed. + @{Registers @racket[cb]. Next time the user clicks the OK button the + preferences dialog, all of the @racket[cb] functions are called. If any of + them return @racket[#f], the dialog is not closed. - See also @scheme[preferences:add-on-close-dialog-callback].}) + See also @racket[preferences:add-on-close-dialog-callback].}) (proc-doc/names autosave:register @@ -350,8 +350,8 @@ . -> . void?) (obj) - @{Adds @scheme[obj] to the list of objects to be autosaved. When it is time - to autosave, the @scheme[do-autosave] method of the object is called. This + @{Adds @racket[obj] to the list of objects to be autosaved. When it is time + to autosave, the @racket[do-autosave] method of the object is called. This method is responsible for performing the autosave. There is no need to de-register an object because the autosaver keeps a @@ -372,18 +372,18 @@ exit:exiting? (-> boolean?) () - @{Returns @scheme[#t] to indicate that an exit operation is taking place. + @{Returns @racket[#t] to indicate that an exit operation is taking place. Does not indicate that the app will actually exit, since the user may cancel the exit. - See also @scheme[exit:insert-on-callback] and - @scheme[exit:insert-can?-callback].}) + See also @racket[exit:insert-on-callback] and + @racket[exit:insert-can?-callback].}) (proc-doc/names exit:set-exiting (boolean? . -> . void?) (exiting?) - @{Sets a flag that affects the result of @scheme[exit:exiting?].}) + @{Sets a flag that affects the result of @racket[exit:exiting?].}) (proc-doc/names exit:insert-on-callback @@ -391,7 +391,7 @@ (callback) @{Adds a callback to be called when exiting. This callback must not fail. If a callback should stop an exit from happening, use - @scheme[exit:insert-can?-callback].}) + @racket[exit:insert-can?-callback].}) (proc-doc/names exit:insert-can?-callback @@ -399,7 +399,7 @@ (callback) @{Use this function to add a callback that determines if an attempted exit can proceed. This callback should not clean up any state, since another - callback may veto the exit. Use @scheme[exit:insert-on-callback] for + callback may veto the exit. Use @racket[exit:insert-on-callback] for callbacks that clean up state.}) (proc-doc/names @@ -407,29 +407,29 @@ (-> boolean?) () @{Calls the ``can-callbacks'' and returns their results. See - @scheme[exit:insert-can?-callback] for more information.}) + @racket[exit:insert-can?-callback] for more information.}) (proc-doc/names exit:on-exit (-> void?) () - @{Calls the ``on-callbacks''. See @scheme[exit:insert-on-callback] for more + @{Calls the ``on-callbacks''. See @racket[exit:insert-on-callback] for more information.}) (proc-doc/names exit:exit (-> any) () - @{@scheme[exit:exit] performs four actions: + @{@racket[exit:exit] performs four actions: @itemize[ - @item{sets the result of the @scheme[exit:exiting?] function to - @scheme[#t].} - @item{invokes the exit-callbacks, with @scheme[exit:can-exit?] if none of - the ``can?'' callbacks return @scheme[#f],} - @item{invokes @scheme[exit:on-exit] and then} - @item{queues a callback that calls @scheme[exit] (a racket procedure) - and (if @scheme[exit] returns) sets the result of - @scheme[exit:exiting?] back to @scheme[#t].}]}) + @item{sets the result of the @racket[exit:exiting?] function to + @racket[#t].} + @item{invokes the exit-callbacks, with @racket[exit:can-exit?] if none of + the ``can?'' callbacks return @racket[#f],} + @item{invokes @racket[exit:on-exit] and then} + @item{queues a callback that calls @racket[exit] (a racket procedure) + and (if @racket[exit] returns) sets the result of + @racket[exit:exiting?] back to @racket[#t].}]}) (proc-doc/names exit:user-oks-exit @@ -442,43 +442,43 @@ path-utils:generate-autosave-name (string? . -> . string?) (filename) - @{Generates a name for an autosave file from @scheme[filename].}) + @{Generates a name for an autosave file from @racket[filename].}) (proc-doc/names path-utils:generate-backup-name (path? . -> . path?) (filename) - @{Generates a name for an backup file from @scheme[filename].}) + @{Generates a name for an backup file from @racket[filename].}) (parameter-doc finder:dialog-parent-parameter (parameter/c (or/c false/c (is-a?/c dialog%) (is-a?/c frame%))) parent @{This parameter determines the parent of the dialogs created by - @scheme[finder:get-file], @scheme[finder:put-file], - @scheme[finder:common-get-file], @scheme[finder:common-put-file], - @scheme[finder:common-get-file-list], @scheme[finder:std-get-file], - and @scheme[finder:std-put-file].}) + @racket[finder:get-file], @racket[finder:put-file], + @racket[finder:common-get-file], @racket[finder:common-put-file], + @racket[finder:common-get-file-list], @racket[finder:std-get-file], + and @racket[finder:std-put-file].}) (parameter-doc finder:default-extension (parameter/c string?) extension @{This parameter controls the default extension for the framework's - @scheme[finder:put-file] dialog. Its value gets passed as the - @scheme[default-extension] argument to @scheme[put-file]. + @racket[finder:put-file] dialog. Its value gets passed as the + @racket[default-extension] argument to @racket[put-file]. - Its default value is @scheme[""].}) + Its default value is @racket[""].}) (parameter-doc finder:default-filters (parameter/c (listof (list/c string? string?))) filters @{This parameter controls the default filters for the framework's - @scheme[finder:put-file] dialog. Its value gets passed as the - @scheme[default-filters] argument to @scheme[put-file]. + @racket[finder:put-file] dialog. Its value gets passed as the + @racket[default-filters] argument to @racket[put-file]. - Its default value is @scheme['(("Any" "*.*"))].}) + Its default value is @racket['(("Any" "*.*"))].}) (proc-doc/names finder:common-put-file @@ -500,7 +500,7 @@ (filter-msg "That filename does not have the right form.") (parent (finder:dialog-parent-parameter)))) @{This procedure queries the user for a single filename, using a - platform-independent dialog box. Consider using @scheme[finder:put-file] + platform-independent dialog box. Consider using @racket[finder:put-file] instead of this function.}) (proc-doc/names @@ -520,7 +520,7 @@ (parent #f))) @{This procedure queries the user for a single filename, using a platform-independent dialog box. Consider using - @scheme[finder:get-file] instead of this function.}) + @racket[finder:get-file] instead of this function.}) (proc-doc/names finder:std-put-file @@ -542,7 +542,7 @@ (filter-msg "That filename does not have the right form.") (parent (finder:dialog-parent-parameter)))) @{This procedure queries the user for a single filename, using a - platform-dependent dialog box. Consider using @scheme[finder:put-file] + platform-dependent dialog box. Consider using @racket[finder:put-file] instead of this function.}) (proc-doc/names @@ -561,7 +561,7 @@ (filter-msg "That filename does not have the right form.") (parent #f))) @{This procedure queries the user for a single filename, using a - platform-dependent dialog box. Consider using @scheme[finder:get-file] + platform-dependent dialog box. Consider using @racket[finder:get-file] instead of this function.}) (proc-doc/names @@ -585,9 +585,9 @@ (parent (finder:dialog-parent-parameter)))) @{Queries the user for a filename. - If the result of @scheme[(preferences:get 'framework:file-dialogs)] is - @scheme['std] this calls @scheme[finder:std-put-file], and if it is - @scheme['common], @scheme[finder:common-put-file] is called.}) + If the result of @racket[(preferences:get 'framework:file-dialogs)] is + @racket['std] this calls @racket[finder:std-put-file], and if it is + @racket['common], @racket[finder:common-put-file] is called.}) (proc-doc/names finder:get-file @@ -606,9 +606,9 @@ (parent #f))) @{Queries the user for a filename. - If the result of @scheme[(preferences:get 'framework:file-dialogs)] is - @scheme['std] this calls @scheme[finder:std-get-file], and if it is - @scheme['common], @scheme[finder:common-get-file] is called.}) + If the result of @racket[(preferences:get 'framework:file-dialogs)] is + @racket['std] this calls @racket[finder:std-get-file], and if it is + @racket['common], @racket[finder:common-get-file] is called.}) (proc-doc/names finder:common-get-file-list @@ -632,7 +632,7 @@ frame:setup-size-pref (symbol? number? number? . -> . void) (size-pref-sym width height) - @{Initializes a preference for the @scheme[frame:size-pref] mixin. + @{Initializes a preference for the @racket[frame:size-pref] mixin. The first argument should be the preferences symbol, and the second and third should be the default width and height, respectively.}) @@ -644,12 +644,12 @@ void?) ((menu menu-item%) ((func void))) - @{Inserts three menu items into @scheme[menu], one that inserts a text box, + @{Inserts three menu items into @racket[menu], one that inserts a text box, one that inserts a pasteboard box, and one that inserts an image into the - currently focused editor (if there is one). Uses @scheme[menu-item%] as + currently focused editor (if there is one). Uses @racket[menu-item%] as the class for the menu items. - Calls @scheme[func] right after inserting each menu item.}) + Calls @racket[func] right after inserting each menu item.}) (proc-doc/names frame:reorder-menus @@ -677,20 +677,20 @@ (is-a?/c bitmap%)))) icon-spec @{The value of this parameter is used by the initialization code of - @scheme[frame:basic-mixin]. + @racket[frame:basic-mixin]. @itemize[ - @item{If it is @scheme[#f], then its value is ignored.} - @item{If it is a @scheme[bitmap%], then the @method[frame% set-icon] is + @item{If it is @racket[#f], then its value is ignored.} + @item{If it is a @racket[bitmap%], then the @method[frame% set-icon] is called with the bitmap, the result of invoking the - @scheme[bitmap% get-loaded-mask] method, and @scheme['both].} + @racket[bitmap% get-loaded-mask] method, and @racket['both].} @item{If it is a pair of bitmaps, then the @method[frame% set-icon] method is invoked twice, once with each bitmap in the pair. The first bitmap is passed (along with the result of its - @scheme[bitmap% get-loaded-mask]) and @scheme['small], and then the + @racket[bitmap% get-loaded-mask]) and @racket['small], and then the second bitmap is passed (also along with the result of its - @scheme[bitmap% get-loaded-mask]) and @scheme['large].}] + @racket[bitmap% get-loaded-mask]) and @racket['large].}] - Defaults to @scheme[#f].}) + Defaults to @racket[#f].}) (proc-doc/names group:get-the-frame-group @@ -702,7 +702,7 @@ group:on-close-action (-> void?) () - @{See also @scheme[group:can-close-check]. + @{See also @racket[group:can-close-check]. Call this function from the @method[top-level-window<%> can-close?] callback of a frame in order for the group to properly close the @@ -712,7 +712,7 @@ group:can-close-check (-> boolean?) () - @{See also @scheme[group:on-close-action]. + @{See also @racket[group:on-close-action]. Call this function from the @method[top-level-window<%> can-close?] callback of a frame in order for the group to properly close the @@ -760,12 +760,12 @@ (name pred handler) @{This function inserts a format handler. - The string, @scheme[name] names the format handler for use with - @scheme[handler:find-named-format-handler]. If @scheme[pred] is a string, + The string, @racket[name] names the format handler for use with + @racket[handler:find-named-format-handler]. If @racket[pred] is a string, it is matched with the extension of a filename by - @scheme[handler:find-format-handler]. If @scheme[pred] is a list of + @racket[handler:find-format-handler]. If @racket[pred] is a list of strings, they are each matched with the extension of a filename by - @scheme[handler:find-format-handler]. If it is a function, the filename is + @racket[handler:find-format-handler]. If it is a function, the filename is applied to the function and the functions result determines if this is the handler to use. @@ -777,18 +777,18 @@ (string? . -> . (path? . -> . (is-a?/c frame:editor<%>))) (name) @{This function selects a format handler. See also - @scheme[handler:insert-format-handler]. + @racket[handler:insert-format-handler]. - It finds a handler based on @scheme[name].}) + It finds a handler based on @racket[name].}) (proc-doc/names handler:find-format-handler (path? . -> . (path? . -> . (is-a?/c frame:editor<%>))) (filename) @{This function selects a format handler. See also - @scheme[handler:insert-format-handler]. + @racket[handler:insert-format-handler]. - It finds a handler based on @scheme[filename].}) + It finds a handler based on @racket[filename].}) (proc-doc/names handler:edit-file @@ -800,29 +800,29 @@ (λ () ((handler:current-create-new-window) filename))))) @{This function creates a frame or re-uses an existing frame to edit a file. - If the preference @scheme['framework:open-here] is set to @scheme[#t], and - @scheme[(send (group:get-the-frame-group) get-open-here-frame)] returns a + If the preference @racket['framework:open-here] is set to @racket[#t], and + @racket[(send (group:get-the-frame-group) get-open-here-frame)] returns a frame, the @method[frame:open-here<%> open-here] method of that frame is used to load the file in the existing frame. Otherwise, it invokes the appropriate format handler to open the file (see - @scheme[handler:insert-format-handler]). + @racket[handler:insert-format-handler]). @itemize[ - @item{If @scheme[filename] is a string, this function checks the result - of @scheme[group:get-the-frame-group] to see if the - @scheme[filename] is already open by a frame in the group. + @item{If @racket[filename] is a string, this function checks the result + of @racket[group:get-the-frame-group] to see if the + @racket[filename] is already open by a frame in the group. @itemize[ @item{If so, it returns the frame.} @item{If not, this function calls - @scheme[handler:find-format-handler] with - @scheme[filename]. + @racket[handler:find-format-handler] with + @racket[filename]. @itemize[ @item{If a handler is found, it is applied to - @scheme[filename] and its result is the final + @racket[filename] and its result is the final result.} - @item{If not, @scheme[make-default] is used.}]}]} - @item{If @scheme[filename] is @scheme[#f], @scheme[make-default] is + @item{If not, @racket[make-default] is used.}]}]} + @item{If @racket[filename] is @racket[#f], @racket[make-default] is used.}]}) (parameter-doc @@ -833,7 +833,7 @@ windows. The default setting is this: - @schemeblock[(λ (filename) + @racketblock[(λ (filename) (let ([frame (make-object frame:text-info-file% filename)]) (send frame show #t) frame))]}) @@ -846,11 +846,11 @@ (() ((dir #f))) @{This function queries the user for a filename and opens the file for - editing. It uses @scheme[handler:edit-file] to open the file, once the + editing. It uses @racket[handler:edit-file] to open the file, once the user has chosen it. - Calls @scheme[finder:get-file] and @scheme[handler:edit-file], passing - along @scheme[dir].}) + Calls @racket[finder:get-file] and @racket[handler:edit-file], passing + along @racket[dir].}) (proc-doc/names handler:install-recent-items @@ -858,7 +858,7 @@ (menu) @{This function deletes all of the items in the given menu and adds one menu item for each recently opened file. These menu items, when selected, call - @scheme[handler:edit-file] with the filename of the recently opened file. + @racket[handler:edit-file] with the filename of the recently opened file. The menu's size is limited to 10.}) @@ -867,7 +867,7 @@ ((implementation?/c frame:standard-menus<%>) . -> . void?) (frame) @{Sets the superclass for the recently opened files frame. It must be - derived from @scheme[frame:standard-menus].}) + derived from @racket[frame:standard-menus].}) (proc-doc/names handler:add-to-recent @@ -879,104 +879,104 @@ handler:set-recent-position (path? number? number? . -> . void?) (filename start end) - @{Sets the selection of the recently opened file to @scheme[start] and - @scheme[end].}) + @{Sets the selection of the recently opened file to @racket[start] and + @racket[end].}) (proc-doc/names handler:size-recently-opened-files (number? . -> . void?) (num) - @{Sizes the @scheme['framework:recently-opened-files/pos] preference list - length to @scheme[num].}) + @{Sizes the @racket['framework:recently-opened-files/pos] preference list + length to @racket[num].}) (proc-doc/names icon:get-paren-highlight-bitmap (-> (is-a?/c bitmap%)) () - @{This returns the parenthesis highlight @scheme[bitmap%]. It is only used + @{This returns the parenthesis highlight @racket[bitmap%]. It is only used on black and white screens.}) (proc-doc/names icon:get-eof-bitmap (-> (is-a?/c bitmap%)) () - @{This returns the @scheme[bitmap%] used for the clickable ``eof'' icon from - @scheme[text:ports].}) + @{This returns the @racket[bitmap%] used for the clickable ``eof'' icon from + @racket[text:ports].}) (proc-doc/names icon:get-autowrap-bitmap (-> (is-a?/c bitmap%)) () - @{This returns the autowrap's @scheme[bitmap%]. + @{This returns the autowrap's @racket[bitmap%]. - The bitmap may not respond @scheme[#t] to the @method[bitmap% ok?] + The bitmap may not respond @racket[#t] to the @method[bitmap% ok?] method.}) (proc-doc/names icon:get-lock-bitmap (-> (is-a?/c bitmap%)) () - @{This returns the lock's @scheme[bitmap]. + @{This returns the lock's @racket[bitmap]. - The bitmap may not respond @scheme[#t] to the @method[bitmap% ok?] + The bitmap may not respond @racket[#t] to the @method[bitmap% ok?] method.}) (proc-doc/names icon:get-unlock-bitmap (-> (is-a?/c bitmap%)) () - @{This returns the reset unlocked @scheme[bitmap]. + @{This returns the reset unlocked @racket[bitmap]. - The bitmap may not respond @scheme[#t] to the @method[bitmap% ok?] + The bitmap may not respond @racket[#t] to the @method[bitmap% ok?] method.}) (proc-doc/names icon:get-anchor-bitmap (-> (is-a?/c bitmap%)) () - @{This returns the anchor's @scheme[bitmap]. + @{This returns the anchor's @racket[bitmap]. - The bitmap may not respond @scheme[#t] to the @method[bitmap% ok?] + The bitmap may not respond @racket[#t] to the @method[bitmap% ok?] method.}) (proc-doc/names icon:get-left/right-cursor (-> (is-a?/c cursor%)) () - @{This function returns a @scheme[cursor%] object that indicates left/right + @{This function returns a @racket[cursor%] object that indicates left/right sizing is possible, for use with columns inside a window. - The cursor may not respond @scheme[#t] to the @method[cursor% ok?] + The cursor may not respond @racket[#t] to the @method[cursor% ok?] method.}) (proc-doc/names icon:get-up/down-cursor (-> (is-a?/c cursor%)) () - @{This function returns a @scheme[cursor%] object that indicates up/down + @{This function returns a @racket[cursor%] object that indicates up/down sizing is possible, for use with columns inside a window. - The cursor may not respond @scheme[#t] to the @method[cursor% ok?] + The cursor may not respond @racket[#t] to the @method[cursor% ok?] method.}) (proc-doc/names icon:get-gc-on-bitmap (-> (is-a?/c bitmap%)) () - @{This returns a bitmap to be displayed in an @scheme[frame:info<%>] frame + @{This returns a bitmap to be displayed in an @racket[frame:info<%>] frame when garbage collection is taking place. - The bitmap may not respond @scheme[#t] to the @method[bitmap% ok?] + The bitmap may not respond @racket[#t] to the @method[bitmap% ok?] method.}) (proc-doc/names icon:get-gc-off-bitmap (-> (is-a?/c bitmap%)) () - @{This returns a bitmap to be displayed in an @scheme[frame:info<%>] frame + @{This returns a bitmap to be displayed in an @racket[frame:info<%>] frame when garbage collection is not taking place. - The bitmap may not respond @scheme[#t] to the @method[bitmap% ok?] + The bitmap may not respond @racket[#t] to the @method[bitmap% ok?] method.}) (proc-doc/names @@ -984,19 +984,19 @@ (-> any/c any) (user-keybindings-path) @{Removes the keymap previously added by - @scheme[keymap:add-user-keybindings-file].}) + @racket[keymap:add-user-keybindings-file].}) (proc-doc/names keymap:add-user-keybindings-file (-> any/c any) (user-keybindings-path-or-require-spec) - @{Chains the keymap defined by @scheme[user-keybindings-path-or-require-spec] - to the global keymap, returned by @scheme[keymap:get-global]. + @{Chains the keymap defined by @racket[user-keybindings-path-or-require-spec] + to the global keymap, returned by @racket[keymap:get-global]. - If @scheme[user-keybindings-path-or-require-spec] is a path, the module is + If @racket[user-keybindings-path-or-require-spec] is a path, the module is loaded directly from that path. Otherwise, - @scheme[user-keybindings-path-or-require-spec] is treated like an argument - to @scheme[require].}) + @racket[user-keybindings-path-or-require-spec] is treated like an argument + to @racket[require].}) (parameter-doc keymap:add-to-right-button-menu @@ -1006,34 +1006,34 @@ (is-a?/c event%) void?)) proc - @{When the keymap that @scheme[keymap:get-global] returns is installed into + @{When the keymap that @racket[keymap:get-global] returns is installed into an editor, this parameter's value is used for right button clicks. Before calling this procedure, the function - @scheme[append-editor-operation-menu-items] is called. + @racket[append-editor-operation-menu-items] is called. - See also @scheme[keymap:add-to-right-button-menu/before].}) + See also @racket[keymap:add-to-right-button-menu/before].}) (parameter-doc keymap:add-to-right-button-menu/before (parameter/c (-> (is-a?/c popup-menu%) (is-a?/c editor<%>) (is-a?/c event%) void?)) proc - @{When the keymap that @scheme[keymap:get-global] returns is installed into + @{When the keymap that @racket[keymap:get-global] returns is installed into an editor, this function is called for right button clicks. After calling this procedure, the function - @scheme[append-editor-operation-menu-items] is called. + @racket[append-editor-operation-menu-items] is called. - See also @scheme[keymap:add-to-right-button-menu].}) + See also @racket[keymap:add-to-right-button-menu].}) (proc-doc/names keymap:call/text-keymap-initializer ((-> any/c) . -> . any/c) (thunk-proc) - @{This function parameterizes the call to @scheme[thunk-proc] by setting the + @{This function parameterizes the call to @racket[thunk-proc] by setting the keymap-initialization procedure (see - @scheme[current-text-keymap-initializer]) to install the framework's + @racket[current-text-keymap-initializer]) to install the framework's standard text bindings.}) (proc-doc/names @@ -1042,7 +1042,7 @@ (keybinding-string) @{Returns a string that denotes the same keybindings as the input string, except that it is in canonical form; two canonical keybinding strings can - be compared with @scheme[string=?].}) + be compared with @racket[string=?].}) (proc-doc/names keymap:get-editor @@ -1052,16 +1052,16 @@ these keys: @itemize[ - @item{@scheme["z"]: undo} - @item{@scheme["y"]: redo} - @item{@scheme["x"]: cut} - @item{@scheme["c"]: copy} - @item{@scheme["v"]: paste} - @item{@scheme["a"]: select all}] + @item{@racket["z"]: undo} + @item{@racket["y"]: redo} + @item{@racket["x"]: cut} + @item{@racket["c"]: copy} + @item{@racket["v"]: paste} + @item{@racket["a"]: select all}] where each key is prefixed with the menu-shortcut key, based on the - platform. Under Unix, the shortcut is @scheme["a:"]; under windows the - shortcut key is @scheme["c:"] and under MacOS, the shortcut key is - @scheme["d:"].}) + platform. Under Unix, the shortcut is @racket["a:"]; under windows the + shortcut key is @racket["c:"] and under MacOS, the shortcut key is + @racket["d:"].}) (proc-doc/names keymap:get-file @@ -1074,14 +1074,14 @@ (-> (is-a?/c keymap%)) () @{This returns a keymap that contains all of the keybindings in the keymaps - loaded via @scheme[keymap:add-user-keybindings-file]}) + loaded via @racket[keymap:add-user-keybindings-file]}) (proc-doc/names keymap:get-global (-> (is-a?/c keymap%)) () @{This returns a keymap for general operations. See - @scheme[keymap:setup-global] for a list of the bindings this keymap + @racket[keymap:setup-global] for a list of the bindings this keymap contains.}) (proc-doc/names @@ -1100,8 +1100,8 @@ Takes a keymap, a base key specification, and a function name; it prefixes the base key with all ``meta'' combination prefixes, and installs the new combinations into the keymap. For example, - @scheme[(keymap:send-map-function-meta keymap "a" func)] maps - @scheme["m:a"] and @scheme["ESC;a"] to @scheme[func].}) + @racket[(keymap:send-map-function-meta keymap "a" func)] maps + @racket["m:a"] and @racket["ESC;a"] to @racket[func].}) (proc-doc/names keymap:send-map-function-meta @@ -1109,43 +1109,43 @@ (keymap key func) @{@index{Meta} Most keyboard and mouse mappings are inserted into a keymap by calling the keymap's @method[keymap% map-function] method. However, - ``meta'' combinations require special attention. The @scheme["m:"] prefix + ``meta'' combinations require special attention. The @racket["m:"] prefix recognized by @method[keymap% map-function] applies only to the Meta key that exists on some keyboards. By convention, however, ``meta'' combinations can also be accessed by using ``ESC'' as a prefix. This procedure binds all of the key-bindings obtained by prefixing - @scheme[key] with a meta-prefix to @scheme[func] in @scheme[keymap].}) + @racket[key] with a meta-prefix to @racket[func] in @racket[keymap].}) (proc-doc/names keymap:setup-editor ((is-a?/c keymap%) . -> . void?) (keymap) @{This sets up the input keymap with the bindings described in - @scheme[keymap:get-editor].}) + @racket[keymap:get-editor].}) (proc-doc/names keymap:setup-file ((is-a?/c keymap%) . -> . void?) (keymap) - @{This extends a @scheme[keymap%] with the bindings for files.}) + @{This extends a @racket[keymap%] with the bindings for files.}) (proc-doc/names keymap:setup-global ((is-a?/c keymap%) . -> . void?) (keymap) - @{This function extends a @scheme[keymap%] with the following functions: + @{This function extends a @racket[keymap%] with the following functions: @itemize[ - @item{@mapdesc[ring-bell any] --- Rings the bell (using @scheme[bell]) + @item{@mapdesc[ring-bell any] --- Rings the bell (using @racket[bell]) and removes the search panel from the frame, if there.} @item{@mapdesc[save-file key] --- Saves the buffer. If the buffer has no - name, then @scheme[finder:put-file]@index["finder:put-file"] is + name, then @racket[finder:put-file]@index["finder:put-file"] is invoked.} @item{@mapdesc[save-file-as key] --- Calls - @scheme[finder:put-file]@index["finder:put-file"] to save the + @racket[finder:put-file]@index["finder:put-file"] to save the buffer.} @item{@mapdesc[load-file key] --- Invokes - @scheme[finder:open-file]@index["finder:open-file"].} + @racket[finder:open-file]@index["finder:open-file"].} @item{@mapdesc[find-string key] --- Opens the search buffer at the bottom of the frame, unless it is already open, in which case it searches for the text in the search buffer.} @@ -1292,7 +1292,7 @@ keymap:setup-search ((is-a?/c keymap%) . -> . void?) (keymap) - @{This extends a @scheme[keymap%] with the bindings for searching.}) + @{This extends a @racket[keymap%] with the bindings for searching.}) (proc-doc/names keymap:set-chained-keymaps @@ -1301,8 +1301,8 @@ . -> . void?) (keymap children-keymaps) - @{Sets @scheme[keymap]'s chained keymaps to @scheme[children-keymaps], - unchaining any keymaps that are currently chained to @scheme[keymap].}) + @{Sets @racket[keymap]'s chained keymaps to @racket[children-keymaps], + unchaining any keymaps that are currently chained to @racket[keymap].}) (proc-doc/names keymap:remove-chained-keymap @@ -1311,14 +1311,14 @@ . -> . void?) (editor keymap) - @{Removes @scheme[keymap] from the keymaps chained to @scheme[editor]. - Also (indirectly) removes all keymaps chained to @scheme[keymap] from - @scheme[editor], since they are removed when unchaining @scheme[keymap] + @{Removes @racket[keymap] from the keymaps chained to @racket[editor]. + Also (indirectly) removes all keymaps chained to @racket[keymap] from + @racket[editor], since they are removed when unchaining @racket[keymap] itself. - Each of the keymaps chained to @scheme[editor] must be an - @scheme[keymap:aug-keymap%] and @scheme[keymap] cannot be the result of - @scheme[(send editor get-keymap)] That is, @scheme[keymap] must be chained + Each of the keymaps chained to @racket[editor] must be an + @racket[keymap:aug-keymap%] and @racket[keymap] cannot be the result of + @racket[(send editor get-keymap)] That is, @racket[keymap] must be chained to some keymap attached to the editor.}) (proc-doc/names @@ -1328,16 +1328,16 @@ boolean?) ((text) ((start 0) (end #f))) - @{Determines if the range in the editor from @scheme[start] to @scheme[end] - in @scheme[text] has at least one complete s-expression and there are no - incomplete s-expressions. If @scheme[end] is @scheme[#f], it defaults to - the last position of the @scheme[text]. The designation ``complete'' is + @{Determines if the range in the editor from @racket[start] to @racket[end] + in @racket[text] has at least one complete s-expression and there are no + incomplete s-expressions. If @racket[end] is @racket[#f], it defaults to + the last position of the @racket[text]. The designation ``complete'' is defined to be something that does not cause @racket[read] to raise a @racket[exn:fail:read:eof?] exception, so there may be all kinds of strange read-level (not to speak of parse level) errors in the expressions. The implementation of this function creates a port with - @scheme[open-input-text-editor] and then uses @racket[read] to parse the + @racket[open-input-text-editor] and then uses @racket[read] to parse the range of the buffer.}) (proc-doc/names @@ -1367,10 +1367,10 @@ colorer uses for Racket mode coloring) to their colors. These symbols are suitable for input to - @scheme[scheme:short-sym->pref-name] and - @scheme[scheme:short-sym->style-name]. + @racket[scheme:short-sym->pref-name] and + @racket[scheme:short-sym->style-name]. - See also @scheme[scheme:get-white-on-black-color-prefs-table].}) + See also @racket[scheme:get-white-on-black-color-prefs-table].}) (proc-doc/names scheme:get-white-on-black-color-prefs-table @@ -1380,66 +1380,66 @@ colorer uses for Racket mode coloring) to their colors when the user chooses the white-on-black mode in the preferences dialog. - See also @scheme[scheme:get-color-prefs-table].}) + See also @racket[scheme:get-color-prefs-table].}) (proc-doc/names scheme:short-sym->pref-name (symbol? . -> . symbol?) (short-sym) @{Builds the symbol naming the preference from one of the symbols in the - table returned by @scheme[scheme:get-color-prefs-table].}) + table returned by @racket[scheme:get-color-prefs-table].}) (proc-doc/names scheme:short-sym->style-name (symbol? . -> . string?) (short-sym) @{Builds the symbol naming the editor style from one of the symbols in the - table returned by @scheme[scheme:get-color-prefs-table]. This style is a + table returned by @racket[scheme:get-color-prefs-table]. This style is a named style in the style list returned by - @scheme[editor:get-standard-style-list].}) + @racket[editor:get-standard-style-list].}) (proc-doc/names scheme:get-wordbreak-map (-> (is-a?/c editor-wordbreak-map%)) () - @{This method returns a @scheme[editor-wordbreak-map%] that is suitable for + @{This method returns a @racket[editor-wordbreak-map%] that is suitable for Racket.}) (proc-doc/names scheme:init-wordbreak-map ((is-a?/c keymap%) . -> . void?) (key) - @{Initializes the workdbreak map for @scheme[keymap].}) + @{Initializes the workdbreak map for @racket[keymap].}) (proc-doc/names scheme:setup-keymap ((is-a?/c keymap%) . -> . void?) (keymap) - @{Initializes @scheme[keymap] with Racket-mode keybindings.}) + @{Initializes @racket[keymap] with Racket-mode keybindings.}) (proc-doc/names editor:set-default-font-color (-> (is-a?/c color%) void?) (color) @{Sets the color of the style named - @scheme[editor:get-default-color-style-name].}) + @racket[editor:get-default-color-style-name].}) (proc-doc/names editor:get-default-color-style-name (-> string?) () @{The name of the style (in the list returned by - @scheme[editor:get-standard-style-list]) that holds the default color.}) + @racket[editor:get-standard-style-list]) that holds the default color.}) (proc-doc/names editor:set-standard-style-list-delta (string? (is-a?/c style-delta%) . -> . void?) (name delta) - @{Finds (or creates) the style named by @scheme[name] in the result of - @scheme[editor:get-standard-style-list] and sets its delta to - @scheme[delta]. + @{Finds (or creates) the style named by @racket[name] in the result of + @racket[editor:get-standard-style-list] and sets its delta to + @racket[delta]. - If the style named by @scheme[name] is already in the style list, it must + If the style named by @racket[name] is already in the style list, it must be a delta style.}) (proc-doc/names @@ -1447,7 +1447,7 @@ (-> any) () @{Installs the font preference callbacks that update the style list returned - by @scheme[editor:get-standard-style-list] based on the font preference + by @racket[editor:get-standard-style-list] based on the font preference symbols.}) (proc-doc/names @@ -1455,15 +1455,15 @@ (-> (is-a?/c style-list%)) () @{Returns a style list that is used for all instances of - @scheme[editor:standard-style-list%].}) + @racket[editor:standard-style-list%].}) (proc-doc/names editor:add-after-user-keymap (-> (is-a?/c keymap%) (listof (is-a?/c keymap%)) (listof (is-a?/c keymap%))) (keymap keymaps) - @{Returns a list that contains all of the keymaps in @scheme[keymaps], in the - same relative order, but also with @scheme[keymap], where @scheme[keymap] - is now the first keymap after @scheme[keymap:get-user] (if that keymap is + @{Returns a list that contains all of the keymaps in @racket[keymaps], in the + same relative order, but also with @racket[keymap], where @racket[keymap] + is now the first keymap after @racket[keymap:get-user] (if that keymap is in the list.)}) (proc-doc/names @@ -1534,25 +1534,25 @@ color-model:xyz? (any/c . -> . boolean?) (val) - @{Determines if @scheme[val] an xyz color record.}) + @{Determines if @racket[val] an xyz color record.}) (proc-doc/names color-model:xyz-x (color-model:xyz? . -> . number?) (xyz) - @{Extracts the x component of @scheme[xyz].}) + @{Extracts the x component of @racket[xyz].}) (proc-doc/names color-model:xyz-y (color-model:xyz? . -> . number?) (xyz) - @{Extracts the y component of @scheme[xyz].}) + @{Extracts the y component of @racket[xyz].}) (proc-doc/names color-model:xyz-z (color-model:xyz? . -> . number?) (xyz) - @{Extracts the z component of @scheme[xyz].}) + @{Extracts the z component of @racket[xyz].}) (proc-doc/names color-prefs:set-default/color-scheme @@ -1564,8 +1564,8 @@ @{Registers a preference whose value will be updated when the user clicks on one of the color scheme default settings in the preferences dialog. - Also calls @scheme[preferences:set-default] and - @scheme[preferences:set-un/marshall] with appropriate arguments to register + Also calls @racket[preferences:set-default] and + @racket[preferences:set-un/marshall] with appropriate arguments to register the preference.}) (proc-doc/names @@ -1578,26 +1578,26 @@ ((white-on-black-color #f) (background #f))) @{This function registers a color preference and initializes the style list - returned from @scheme[editor:get-standard-style-list]. In particular, it - calls @scheme[preferences:set-default] and - @scheme[preferences:set-un/marshall] to install the pref for - @scheme[pref-name], using @scheme[color/sd] as the default color. The - preference is bound to a @scheme[style-delta%], and initially the - @scheme[style-delta%] changes the foreground color to @scheme[color/sd], - unless @scheme[color/sd] is a style delta already, in which case it is just + returned from @racket[editor:get-standard-style-list]. In particular, it + calls @racket[preferences:set-default] and + @racket[preferences:set-un/marshall] to install the pref for + @racket[pref-name], using @racket[color/sd] as the default color. The + preference is bound to a @racket[style-delta%], and initially the + @racket[style-delta%] changes the foreground color to @racket[color/sd], + unless @racket[color/sd] is a style delta already, in which case it is just used directly. Then, it calls - @scheme[editor:set-standard-style-list-delta] passing the - @scheme[style-name] and the current value of the preference - @scheme[pref-name]. + @racket[editor:set-standard-style-list-delta] passing the + @racket[style-name] and the current value of the preference + @racket[pref-name]. - Finally, it adds calls @scheme[preferences:add-callback] to set a callback - for @scheme[pref-name] that updates the style list when the preference + Finally, it adds calls @racket[preferences:add-callback] to set a callback + for @racket[pref-name] that updates the style list when the preference changes. - If @scheme[white-on-black-color] is not @scheme[#f], then the color of the - @scheme[color/sd] argument is used in combination with - @scheme[white-on-black-color] to register this preference with - @scheme[color-prefs:set-default/color-scheme]. + If @racket[white-on-black-color] is not @racket[#f], then the color of the + @racket[color/sd] argument is used in combination with + @racket[white-on-black-color] to register this preference with + @racket[color-prefs:set-default/color-scheme]. If either @racket[background] is not @racket[#f], then it is used to construct the default background color @@ -1610,14 +1610,14 @@ (-> void?) () @{Adds a preferences panel that configures the background color for - @scheme[editor:basic-mixin].}) + @racket[editor:basic-mixin].}) (proc-doc/names color-prefs:add-to-preferences-panel (string? ((is-a?/c vertical-panel%) . -> . void?) . -> . void?) (name func) - @{Calls @scheme[func] with the subpanel of the preferences coloring panel - that corresponds to @scheme[name].}) + @{Calls @racket[func] with the subpanel of the preferences coloring panel + that corresponds to @racket[name].}) (proc-doc/names color-prefs:build-color-selection-panel @@ -1628,12 +1628,12 @@ ((background? #f))) @{Builds a panel with a number of controls for configuring a font: its color (including a background configuration if @racket[background] is @racket[#t]) - and check boxes for bold, italic, and underline. The @scheme[parent] - argument specifies where the panel will be placed. The @scheme[pref-sym] - should be a preference (suitable for use with @scheme[preferences:get] and - @scheme[preferences:set]). The @scheme[style-name] specifies the name of a + and check boxes for bold, italic, and underline. The @racket[parent] + argument specifies where the panel will be placed. The @racket[pref-sym] + should be a preference (suitable for use with @racket[preferences:get] and + @racket[preferences:set]). The @racket[style-name] specifies the name of a style in the style list returned from - @scheme[editor:get-standard-style-list] and @scheme[example-text] is shown + @racket[editor:get-standard-style-list] and @racket[example-text] is shown in the panel so users can see the results of their configuration.}) (proc-doc/names @@ -1646,19 +1646,19 @@ color-prefs:unmarshall-style-delta (-> printable/c (or/c false/c (is-a?/c style-delta%))) (marshalled-style-delta) - @{Builds a style delta from its printed representation. Returns @scheme[#f] + @{Builds a style delta from its printed representation. Returns @racket[#f] if the printed form cannot be parsed.}) (proc-doc/names color-prefs:white-on-black (-> any) () - @{Sets the colors registered by @scheme[color-prefs:register-color-preference] + @{Sets the colors registered by @racket[color-prefs:register-color-preference] to their white-on-black variety.}) (proc-doc/names color-prefs:black-on-white (-> any) () - @{Sets the colors registered by @scheme[color-prefs:register-color-preference] + @{Sets the colors registered by @racket[color-prefs:register-color-preference] to their black-on-white variety.})) diff --git a/collects/framework/private/gen-standard-menus.rkt b/collects/framework/private/gen-standard-menus.rkt index 7e60302278..86fd7df41e 100644 --- a/collects/framework/private/gen-standard-menus.rkt +++ b/collects/framework/private/gen-standard-menus.rkt @@ -155,7 +155,7 @@ [(an-item? x) (pop-out `@defmethod[(,(an-item->get-item-name x)) (or/c false/c (is-a?/c menu-item%))]{ - This method returns the @scheme[menu-item%] object corresponding + This method returns the @racket[menu-item%] object corresponding to this menu item, if it has been created (as controlled by @method[frame:standard-menus<%> ,(an-item->create-menu-item-name x)]).}) @@ -163,8 +163,8 @@ `@defmethod[(,(an-item->create-menu-item-name x)) boolean?]{ The result of this method determines if the corresponding menu item is created. Override it to control the creation of the menu item. - - Defaults to @scheme[,(an-item-create x)].}) + + Defaults to @racket[,(an-item-create x)].}) (match (an-item-proc x) [`(λ (,item-name ,evt-name) ,bodies ...) @@ -173,7 +173,7 @@ [,item-name (is-a?/c menu-item%)] [,evt-name (is-a?/c control-event%)]) void?]{ - Defaults to @schemeblock[,(if (= 1 (length bodies)) + Defaults to @racketblock[,(if (= 1 (length bodies)) (car bodies) `(begin ,@bodies))] })]) @@ -182,21 +182,21 @@ (pop-out `@defmethod[(,(an-item->on-demand-name x) [,item-name (is-a?/c menu-item%)]) void?]{ The menu item's on-demand proc calls this method. - - Defaults to @schemeblock[,body]})]) + + Defaults to @racketblock[,body]})]) (pop-out - `@defmethod[(,(an-item->string-name x)) string?]{ - The result of this method is used as the name of the @scheme[menu-item%]. - - Defaults to @scheme[,(an-item-menu-string x)].}) + `@defmethod[(,(an-item->string-name x)) string?]{ + The result of this method is used as the name of the @racket[menu-item%]. + + Defaults to @racket[,(an-item-menu-string x)].}) (pop-out `@defmethod[(,(an-item->help-string-name x)) string?]{ The result of this method is used as the help string - when the @scheme[menu-item%] object is created. - - Defaults to @scheme[,(an-item-help-string x)].})])) + when the @racket[menu-item%] object is created. + + Defaults to @racket[,(an-item-help-string x)].})])) items) (display docs-footer-text port)) @@ -282,6 +282,7 @@ ;; THIS FILE IS GENERATED. DO NOT EDIT. @definterface[frame:standard-menus<%> (frame:basic<%>)]{ - + + -- ) diff --git a/collects/framework/private/standard-menus-items.rkt b/collects/framework/private/standard-menus-items.rkt index bf06769351..7620c70f2f 100644 --- a/collects/framework/private/standard-menus-items.rkt +++ b/collects/framework/private/standard-menus-items.rkt @@ -155,7 +155,7 @@ The result of this method is used as the class for creating the menu items in this frame. - Defaultly returns @scheme[menu:can-restore-menu-item].})) + Defaultly returns @racket[menu:can-restore-menu-item].})) (make-generic-method 'get-checkable-menu-item% '(λ () menu:can-restore-checkable-menu-item%) (list @@ -163,7 +163,7 @@ The result of this method is used as the class for creating checkable menu items in this class. - Defaultly returns @scheme[menu:can-restore-checkable-menu-item].})) + Defaultly returns @racket[menu:can-restore-checkable-menu-item].})) (make-generic-method 'get-file-menu diff --git a/collects/framework/test.rkt b/collects/framework/test.rkt index cfad76ac1a..fe4bf793ca 100644 --- a/collects/framework/test.rkt +++ b/collects/framework/test.rkt @@ -854,7 +854,7 @@ (λ (c) (eq? c btn)))))) void?) (button) - @{Simulates pushing @scheme[button]. If a string is supplied, the + @{Simulates pushing @racket[button]. If a string is supplied, the primitive searches for a button labelled with that string in the active frame. Otherwise, it pushes the button argument.}) @@ -862,52 +862,52 @@ test:set-radio-box! (-> (or/c string? regexp? (is-a?/c radio-box%)) (or/c string? number?) void?) (radio-box state) - @{Sets the radio-box to the label matching @scheme[state]. If @scheme[state] is a + @{Sets the radio-box to the label matching @racket[state]. If @racket[state] is a string, this function finds the choice with that label. If it is a regexp, this function finds the first choice whose label matches the regexp. If it is a number, it uses the number as an index into the state. If the number is out of range or if the label isn't in the radio box, an exception is raised. - If @scheme[radio-box] is a string, this function searches for a - @scheme[radio-box%] object with a label matching that string, - otherwise it uses @scheme[radio-box] itself.}) + If @racket[radio-box] is a string, this function searches for a + @racket[radio-box%] object with a label matching that string, + otherwise it uses @racket[radio-box] itself.}) (proc-doc/names test:set-radio-box-item! (-> (or/c string? regexp?) void?) (entry) - @{Finds a @scheme[radio-box%] that has a label matching @scheme[entry] - and sets the radio-box to @scheme[entry].}) + @{Finds a @racket[radio-box%] that has a label matching @racket[entry] + and sets the radio-box to @racket[entry].}) (proc-doc/names test:set-check-box! (-> (or/c string? (is-a?/c check-box%)) boolean? void?) (check-box state) - @{Clears the @scheme[check-box%] item if @scheme[state] is @scheme[#f], and sets it + @{Clears the @racket[check-box%] item if @racket[state] is @racket[#f], and sets it otherwise. - If @scheme[check-box] is a string, - this function searches for a @scheme[check-box%] with a label matching that string, - otherwise it uses @scheme[check-box] itself.}) + If @racket[check-box] is a string, + this function searches for a @racket[check-box%] with a label matching that string, + otherwise it uses @racket[check-box] itself.}) (proc-doc/names test:set-choice! (-> (or/c string? (is-a?/c choice%)) (or/c string? (and/c number? exact? integer? positive?)) void?) (choice str) - @{Selects @scheme[choice]'s item @scheme[str]. If @scheme[choice] is a string, - this function searches for a @scheme[choice%] with a label matching - that string, otherwise it uses @scheme[choice] itself.}) + @{Selects @racket[choice]'s item @racket[str]. If @racket[choice] is a string, + this function searches for a @racket[choice%] with a label matching + that string, otherwise it uses @racket[choice] itself.}) (proc-doc/names test:set-list-box! (-> (or/c string? (is-a?/c list-box%)) (or/c string? (and/c number? exact? integer? positive?)) void?) (choice str) - @{Selects @scheme[list-box]'s item @scheme[str]. If @scheme[list-box] is a string, - this function searches for a @scheme[list-box%] with a label matching - that string, otherwise it uses @scheme[list-box] itself.}) + @{Selects @racket[list-box]'s item @racket[str]. If @racket[list-box] is a string, + this function searches for a @racket[list-box%] with a label matching + that string, otherwise it uses @racket[list-box] itself.}) (proc-doc/names test:keystroke @@ -916,19 +916,19 @@ void?) ((key) ((modifier-list null))) - @{This function simulates a user pressing a key. The argument, @scheme[key], + @{This function simulates a user pressing a key. The argument, @racket[key], is just like the argument to the @method[key-event% get-key-code] - method of the @scheme[key-event%] class. + method of the @racket[key-event%] class. @italic{Note:} - To send the ``Enter'' key, use @scheme[#\return], - not @scheme[#\newline]. + To send the ``Enter'' key, use @racket[#\return], + not @racket[#\newline]. - The @scheme['shift] or @scheme['noshift] modifier is implicitly set from @scheme[key], - but is overridden by the argument list. The @scheme['shift] modifier is + The @racket['shift] or @racket['noshift] modifier is implicitly set from @racket[key], + but is overridden by the argument list. The @racket['shift] modifier is set for any capitol alpha-numeric letters and any of the following characters: - @schemeblock[ + @racketblock[ #\? #\: #\~ #\\ #\| #\< #\> #\{ #\} #\[ #\] #\( #\) #\! #\@ #\# #\$ #\% #\^ #\& #\* #\_ #\+ @@ -940,7 +940,7 @@ test:menu-select (string? string? . -> . void?) (menu item) - @{Selects the menu-item named @scheme[item] in the menu named @scheme[menu]. + @{Selects the menu-item named @racket[item] in the menu named @racket[menu]. @italic{Note:} The string for the menu item does not include its keyboard equivalent. @@ -958,17 +958,17 @@ ((button x y) ((modifiers null))) @{Simulates a mouse click at the coordinate (x,y) in the currently - focused @scheme[window], assuming that it supports the + focused @racket[window], assuming that it supports the @method[canvas<%> on-event] method. - Use @scheme[test:button-push] to click on a button. + Use @racket[test:button-push] to click on a button. - On the Macintosh, @scheme['right] corresponds to holding down the command - modifier key while clicking and @scheme['middle] cannot be generated. + On the Macintosh, @racket['right] corresponds to holding down the command + modifier key while clicking and @racket['middle] cannot be generated. - Under Windows, @scheme['middle] can only be generated if the user has a + Under Windows, @racket['middle] can only be generated if the user has a three button mouse. - The modifiers later in the list @scheme[modifiers] take precedence over + The modifiers later in the list @racket[modifiers] take precedence over ones that appear earlier.}) (proc-doc/names @@ -979,7 +979,7 @@ ((msec) ()) @{See also @secref{test:actions-completeness}. The first case in the case-lambda sets - the run interval to @scheme[msec] milliseconds and the second + the run interval to @racket[msec] milliseconds and the second returns the current setting.}) (parameter-doc @@ -991,7 +991,7 @@ (see also @secref[#:doc '(lib "scribblings/gui/gui.scrbl") "eventspaceinfo"]) are considered when finding the frontmost frame. The first case - sets the parameter to @scheme[func]. The procedure @scheme[func] will be + sets the parameter to @racket[func]. The procedure @racket[func] will be invoked with no arguments to determine the eventspaces to consider when finding the frontmost frame for simulated user events. The second case @@ -1011,8 +1011,8 @@ (-> (is-a?/c top-level-window<%>) void?) (tlw) @{Use this function to simulate clicking on the close box of a frame. - Closes @scheme[tlw] with this expression: - @schemeblock[ + Closes @racket[tlw] with this expression: + @racketblock[ (when (send tlw can-close?) (send tlw on-close) (send tlw show #f))]}) @@ -1021,10 +1021,10 @@ test:top-level-focus-window-has? (-> (-> (is-a?/c area<%>) boolean?) boolean?) (test) - @{Calls @scheme[test] for each child of the top-level-focus-frame - and returns @scheme[#t] if @scheme[test] ever does, otherwise - returns @scheme[#f]. If there - is no top-level-focus-window, returns @scheme[#f].}) + @{Calls @racket[test] for each child of the top-level-focus-frame + and returns @racket[#t] if @racket[test] ever does, otherwise + returns @racket[#f]. If there + is no top-level-focus-window, returns @racket[#f].}) (proc-doc @@ -1041,6 +1041,4 @@ test:run-one (-> (-> void?) void?) (f) - @{Runs the function @scheme[f] as if it was a simulated event.})) - - + @{Runs the function @racket[f] as if it was a simulated event.})) diff --git a/collects/frtime/scribblings/frtime.scrbl b/collects/frtime/scribblings/frtime.scrbl index 221bbe6947..97532907b9 100644 --- a/collects/frtime/scribblings/frtime.scrbl +++ b/collects/frtime/scribblings/frtime.scrbl @@ -16,12 +16,12 @@ @author["Greg Cooper"] -The @schememodname[frtime] language supports declarative construction of +The @racketmodname[frtime] language supports declarative construction of reactive systems in a syntax very similar to that of Racket. To interact with FrTime, select @onscreen{FrTime} from the @onscreen{Choose Language} menu. You can also make FrTime the language for a module: -@schemeblock[ +@racketblock[ (module frtime )] @@ -31,45 +31,45 @@ You can also make FrTime the language for a module: @defthing[undefined any/c]{stands for an undefined value.} -@defproc[(undefined? [val any/c]) boolean?]{return @scheme[#t] iff -@scheme[val] is @scheme[undefined].} +@defproc[(undefined? [val any/c]) boolean?]{return @racket[#t] iff +@racket[val] is @racket[undefined].} -@defproc[(behavior? [val any/c]) boolean?]{returns @scheme[#t] iff -@scheme[val] is a behavior (a time-varying value whose current value can be +@defproc[(behavior? [val any/c]) boolean?]{returns @racket[#t] iff +@racket[val] is a behavior (a time-varying value whose current value can be projected at any time).} -@defproc[(event? [val any/c]) boolean?]{returns @scheme[#t] iff -@scheme[val] is an event (a time-varying stream of values that can occur +@defproc[(event? [val any/c]) boolean?]{returns @racket[#t] iff +@racket[val] is an event (a time-varying stream of values that can occur at arbitrary times).} -@defproc[(signal? [val any/c]) boolean?]{returns @scheme[#t] iff val -is a signal. @scheme[(signal? v)] is equivalent to @scheme[(or +@defproc[(signal? [val any/c]) boolean?]{returns @racket[#t] iff val +is a signal. @racket[(signal? v)] is equivalent to @racket[(or (behavior? v) (event? v))].} @defthing[seconds behavior?]{updates approximately once per second -with the value of @scheme[(current-seconds)].} +with the value of @racket[(current-seconds)].} @defthing[milliseconds behavior?]{updates frequently with the value of -@scheme[(current-inexact-milliseconds)].} +@racket[(current-inexact-milliseconds)].} @defthing[never-e event?]{is an event that never occurs.} @section{Defining Custom Input Signals} @defproc[(new-cell [init-expr signal? undefined]) signal? ]{returns a -signal whose values initially track that of @scheme[init-expr], but -that may be rewired to a different signal by @scheme[set-cell!].} +signal whose values initially track that of @racket[init-expr], but +that may be rewired to a different signal by @racket[set-cell!].} @defproc[(set-cell! [cell signal?] [val signal?]) void?]{rewires -@scheme[cell] (which must have been created by @scheme[new-cell]) to -take on the value(s) of @scheme[val].} +@racket[cell] (which must have been created by @racket[new-cell]) to +take on the value(s) of @racket[val].} @defproc[(event-receiver) event?]{returns an event stream that can be -triggered imperatively by @scheme[send-event].} +triggered imperatively by @racket[send-event].} @defproc[(send-event [rcvr event?] [val any/c]) void?]{emits -@scheme[val] on @scheme[rcvr] (which must have been created by -@scheme[event-receiver]).} +@racket[val] on @racket[rcvr] (which must have been created by +@racket[event-receiver]).} @section{Signal-Processing Procedures} @@ -77,32 +77,32 @@ triggered imperatively by @scheme[send-event].} a behavior or constant.} @defproc[(delay-by [val behavior?] [duration number?]) -behavior?]{delays @scheme[val] by @scheme[duration] milliseconds.} +behavior?]{delays @racket[val] by @racket[duration] milliseconds.} @defproc[(integral [val (or/c number? behavior?)]) behavior?]{computes -a numeric approximation of the integral of @scheme[val] with respect +a numeric approximation of the integral of @racket[val] with respect to time (measured in milliseconds).} @defproc[(derivative [val behavior?]) behavior?]{computes a numeric -approximation of the derivative of @scheme[val] with respect to time.} +approximation of the derivative of @racket[val] with respect to time.} @deftogether[( @defproc[(map-e [proc (-> any/c any)] [ev event?]) event?] @defproc[([ev event?] . ==> . [proc (-> any/c any)]) event?] -)]{returns an event stream that fires whenever @scheme[ev] fires, whose -values are transformed by application of @scheme[proc].} +)]{returns an event stream that fires whenever @racket[ev] fires, whose +values are transformed by application of @racket[proc].} @deftogether[( @defproc[(filter-e [pred (-> any/c boolean?)] [ev event?]) event?] @defproc[([ev event?] . =#> . [pred (-> any/c boolean?)]) event?])]{ returns an event stream that passes through only the values from -@scheme[ev] for which @scheme[pred] returns @scheme[#t].} +@racket[ev] for which @racket[pred] returns @racket[#t].} @defproc[(merge-e [ev event?] ...) event?]{merges all of the input event sources into a single event source.} @defproc[(once-e [ev event?]) event?]{returns an event source that -carries only the first occurrence of @scheme[ev]. (The rest are +carries only the first occurrence of @racket[ev]. (The rest are filtered out.)} @defproc[(changes [val behavior?]) event?]{returns an event source @@ -110,12 +110,12 @@ that occurs each time the argument behavior changes. The value of the occurrence is the behavior's new value.} @defproc[(hold [ev event?] [init any/c undefined]) behavior?]{ -constructs a behavior that starts out as @scheme[init] and then -takes on the last value produced by @scheme[ev]} +constructs a behavior that starts out as @racket[init] and then +takes on the last value produced by @racket[ev]} @defproc[(switch [ev event?] [init behavior? undefined]) -behavior?]{returns a behavior that starts as @scheme[init]. Each time -@scheme[ev] yields a (potentially time-varying) value, the behavior +behavior?]{returns a behavior that starts as @racket[init]. Each time +@racket[ev] yields a (potentially time-varying) value, the behavior switches to that value.} @defproc[(accum-e [ev event?] [init any/c]) event?]{constructs an event source @@ -123,34 +123,34 @@ by accumulating changes (carried by the given event source) over an initial value.} @defproc[(accum-b [ev event?] [init any/c]) behavior?]{combines functionality -from @scheme[accum-e] and @scheme[hold] to construct a behavior. -@scheme[(accum-b ev init)] is equivalent to @scheme[(hold init +from @racket[accum-e] and @racket[hold] to construct a behavior. +@racket[(accum-b ev init)] is equivalent to @racket[(hold init (accum-e ev init))].} @defproc[(collect-e [ev event?] [init any/c] [proc (-> any/c any/c -any)]) event?]{is similar to @scheme[accum-e], except the transformer +any)]) event?]{is similar to @racket[accum-e], except the transformer function is fixed and is applied to the event occurrence and the current accumulator (in that order).} @defproc[(collect-b [ev event?] [init any/c] [proc (-> any/c any/c any)]) behavior?]{is similar to -@scheme[collect-e] in the same way as @scheme[accum-b] is similar to -@scheme[accum-e].} +@racket[collect-e] in the same way as @racket[accum-b] is similar to +@racket[accum-e].} @defproc[(when-e [val behavior?]) event?]{returns an event stream that -carries an occurrence each time @scheme[val] changes from @scheme[#f] to +carries an occurrence each time @racket[val] changes from @racket[#f] to anything else.} @defproc[(lift-strict [proc (-> [arg any/c] ... any)] [val any/c] ...) any]{provides a mechanism for applying ordinary Scheme primitives to -behaviors. If any of the @scheme[val]s are behaviors, returns a -behavior whose current value is always equal to @scheme[(proc +behaviors. If any of the @racket[val]s are behaviors, returns a +behavior whose current value is always equal to @racket[(proc (value-now arg) ...)]. In FrTime, many Racket primitives are implicitly lifted.} The following forms allow importation of lifted procedures that aren't included in the basic FrTime language. -@schemeblock[ +@racketblock[ (require (lifted module-spec proc-name ...) ...) (require (lifted:nonstrict module-spec proc-name ...) ...) ] @@ -182,9 +182,9 @@ included in the basic FrTime language. [stretchable-width any/c #t] [stretchable-height any/c #t] [shown any/c #f])]{ -The constructor arguments are as in @scheme[frame%], except that @scheme[shown] -@scheme[label], @scheme[enabled], @scheme[stretchable-width], and -@scheme[stretchable-height] may be time-varying.} +The constructor arguments are as in @racket[frame%], except that @racket[shown] +@racket[label], @racket[enabled], @racket[stretchable-width], and +@racket[stretchable-height] may be time-varying.} } @defclass[ft-message% message% (control<%>)]{ @@ -194,7 +194,7 @@ The constructor arguments are as in @scheme[frame%], except that @scheme[shown] [parent (or/c (is-a?/c frame%) (is-a?/c dialog%) (is-a?/c panel%) (is-a?/c pane%))] [style (listof (one-of/c 'deleted)) null] - [font (is-a?/c font%) @scheme[normal-control-font]] + [font (is-a?/c font%) @racket[normal-control-font]] [enabled (or/c any/c behavior?) #t] [vert-margin (integer-in 0 1000) 2] [horiz-margin (integer-in 0 1000) 2] @@ -202,9 +202,9 @@ The constructor arguments are as in @scheme[frame%], except that @scheme[shown] [min-height (integer-in 0 10000) _graphical-minimum-height] [stretchable-width any/c #f] [stretchable-height any/c #f])]{The constructor -arguments are the same as in @scheme[message%], except that -@scheme[label], @scheme[enabled], @scheme[stretchable-width], and -@scheme[stretchable-height] may be time-varying.}} +arguments are the same as in @racket[message%], except that +@racket[label], @racket[enabled], @racket[stretchable-width], and +@racket[stretchable-height] may be time-varying.}} @defclass[ft-button% button% (control<%>)]{ @@ -212,7 +212,7 @@ arguments are the same as in @scheme[message%], except that [parent (or/c (is-a?/c frame%) (is-a?/c dialog%) (is-a?/c panel%) (is-a?/c pane%))] [style (one-of/c 'border 'deleted) null] - [font (is-a?/c font%) @scheme[normal-control-font]] + [font (is-a?/c font%) @racket[normal-control-font]] [enabled any/c #t] [vert-margin (integer-in 0 1000) 2] [horiz-margin (integer-in 0 1000) 2] @@ -220,9 +220,9 @@ arguments are the same as in @scheme[message%], except that [min-height (integer-in 0 10000) _graphical-minimum-height] [stretchable-width any/c #f] [stretchable-height any/c #f])]{The constructor -arguments are the same as in @scheme[message%], except that -@scheme[label], @scheme[enabled], @scheme[stretchable-width], and -@scheme[stretchable-height] may be time-varying.} +arguments are the same as in @racket[message%], except that +@racket[label], @racket[enabled], @racket[stretchable-width], and +@racket[stretchable-height] may be time-varying.} @defmethod[(get-value-e) event?]{returns an event stream that yields a value whenever the user clicks the button.} @@ -235,7 +235,7 @@ value whenever the user clicks the button.} (is-a?/c panel%) (is-a?/c pane%))] [style (listof (one-of/c 'deleted)) null] [value any/c #f] - [font (is-a?/c font%) @scheme[normal-control-font]] + [font (is-a?/c font%) @racket[normal-control-font]] [enabled any/c #t] [vert-margin (integer-in 0 1000) 2] [horiz-margin (integer-in 0 1000) 2] @@ -244,10 +244,10 @@ value whenever the user clicks the button.} [stretchable-width any/c #f] [stretchable-height any/c #f] [value-set event? never-e])]{The constructor arguments -are the same as in @scheme[check-box%], except that @scheme[label], -@scheme[enabled], @scheme[stretchable-width], and -@scheme[stretchable-height] may be time-varying. Also, any occurrence -on @scheme[value-set] sets the check box's state to that of the event value.} +are the same as in @racket[check-box%], except that @racket[label], +@racket[enabled], @racket[stretchable-width], and +@racket[stretchable-height] may be time-varying. Also, any occurrence +on @racket[value-set] sets the check box's state to that of the event value.} @defmethod[(get-value-b) behavior?]{returns a value that always reflects the current state of the check box.} @@ -274,10 +274,10 @@ the current state of the check box.} [stretchable-width any/c (memq 'horizontal style)] [stretchable-height any/c (memq 'vertical style)] [value-set event? never-e])]{The constructor arguments -are the same as in @scheme[check-box%], except that @scheme[label], -@scheme[enabled], @scheme[stretchable-width], and -@scheme[stretchable-height] may be time-varying. Also, any occurrence -on @scheme[value-set] sets the slider's state to that of the event value.} +are the same as in @racket[check-box%], except that @racket[label], +@racket[enabled], @racket[stretchable-width], and +@racket[stretchable-height] may be time-varying. Also, any occurrence +on @racket[value-set] sets the slider's state to that of the event value.} @defmethod[(get-value-b) behavior?]{returns a value that always reflects the current state of the slider.} @@ -293,7 +293,7 @@ the current state of the slider.} 'vertical-label 'horizontal-label 'deleted)) '(single)] - [font (is-a?/c font%) @scheme[normal-control-font]] + [font (is-a?/c font%) @racket[normal-control-font]] [enabled any/c #t] [vert-margin (integer-in 0 1000) 2] [horiz-margin (integer-in 0 1000) 2] @@ -302,10 +302,10 @@ the current state of the slider.} [stretchable-width any/c #t] [stretchable-height any/c (memq 'multiple style)] [value-set event? never-e])]{The -constructor arguments are the same as in @scheme[check-box%], except -that @scheme[label], @scheme[enabled], @scheme[stretchable-width], and -@scheme[stretchable-height] may be time-varying. Also, any occurrence -on @scheme[value-set] sets the text field's state to that of the event +constructor arguments are the same as in @racket[check-box%], except +that @racket[label], @racket[enabled], @racket[stretchable-width], and +@racket[stretchable-height] may be time-varying. Also, any occurrence +on @racket[value-set] sets the text field's state to that of the event value.} @defmethod[(get-value-b) behavior?]{returns a value that always reflects @@ -332,10 +332,10 @@ the current state of the text field.} [stretchable-width any/c #f] [stretchable-height any/c #f] [value-set event? never-e])]{The -constructor arguments are the same as in @scheme[check-box%], except -that @scheme[label], @scheme[enabled], @scheme[stretchable-width], and -@scheme[stretchable-height] may be time-varying. Also, any occurrence -on @scheme[value-set] sets the text field's state to that of the event +constructor arguments are the same as in @racket[check-box%], except +that @racket[label], @racket[enabled], @racket[stretchable-width], and +@racket[stretchable-height] may be time-varying. Also, any occurrence +on @racket[value-set] sets the text field's state to that of the event value.} @defmethod[(get-selection-b) behavior?]{returns a value that always reflects the currently selected element in the radio box.} @@ -350,7 +350,7 @@ the currently selected element in the radio box.} 'deleted)) null] [selection exact-nonnegative-integer? 0] - [font (is-a?/c font%) @scheme[normal-control-font]] + [font (is-a?/c font%) @racket[normal-control-font]] [enabled any/c #t] [vert-margin (integer-in 0 1000) 2] [horiz-margin (integer-in 0 1000) 2] @@ -359,10 +359,10 @@ the currently selected element in the radio box.} [stretchable-width any/c #f] [stretchable-height any/c #f] [value-set event? never-e])]{The -constructor arguments are the same as in @scheme[check-box%], except -that @scheme[label], @scheme[enabled], @scheme[stretchable-width], and -@scheme[stretchable-height] may be time-varying. Also, any occurrence -on @scheme[value-set] sets the text field's state to that of the event +constructor arguments are the same as in @racket[check-box%], except +that @racket[label], @racket[enabled], @racket[stretchable-width], and +@racket[stretchable-height] may be time-varying. Also, any occurrence +on @racket[value-set] sets the text field's state to that of the event value.} @defmethod[(get-selection-b) behavior?]{returns a value that always reflects the currently selected element in the choice control.} @@ -378,8 +378,8 @@ the currently selected element in the choice control.} 'deleted)) '(single)] [selection (or/c exact-nonnegative-integer? false/c) #f] - [font (is-a?/c font%) @scheme[view-control-font]] - [label-font (is-a?/c font%) @scheme[normal-control-font]] + [font (is-a?/c font%) @racket[view-control-font]] + [label-font (is-a?/c font%) @racket[normal-control-font]] [enabled any/c #t] [vert-margin (integer-in 0 1000) 2] [horiz-margin (integer-in 0 1000) 2] @@ -388,10 +388,10 @@ the currently selected element in the choice control.} [stretchable-width any/c #t] [stretchable-height any/c #t] [value-set event? never-e])]{The -constructor arguments are the same as in @scheme[check-box%], except -that @scheme[label], @scheme[enabled], @scheme[stretchable-width], and -@scheme[stretchable-height] may be time-varying. Also, any occurrence -on @scheme[value-set] sets the text field's state to that of the event +constructor arguments are the same as in @racket[check-box%], except +that @racket[label], @racket[enabled], @racket[stretchable-width], and +@racket[stretchable-height] may be time-varying. Also, any occurrence +on @racket[value-set] sets the text field's state to that of the event value.} @defmethod[(get-selection-b) behavior?]{returns a value that always reflects the primary selection in the list box.} @@ -407,34 +407,34 @@ To run the following animation/GUI demos, simply set the language level to FrTime, open the corresponding file, and Execute. See the demo source code for more information. -@scheme[orbit-mouse.rkt] : A collection of balls that move in circles +@filepath{orbit-mouse.rkt} : A collection of balls that move in circles around the mouse pointer. -@scheme[piston.rkt] : Simulation of a piston/cylinder. +@filepath{piston.rkt} : Simulation of a piston/cylinder. -@scheme[rotation.rkt] : Balls moving in circles. +@filepath{rotation.rkt} : Balls moving in circles. -@scheme[delay-mouse.rkt] : A trail of balls following the mouse. +@filepath{delay-mouse.rkt} : A trail of balls following the mouse. -@scheme[ball-on-string.rkt] : A ball chasing the mouse. +@filepath{ball-on-string.rkt} : A ball chasing the mouse. -@scheme[pong.rkt] : A simple pong/air-hockey game. The left paddle moves with +@filepath{pong.rkt} : A simple pong/air-hockey game. The left paddle moves with numeric keypad; the right paddle moves with the mouse. The 'r' key resets the score. -@scheme[pizza.rkt] : A simple "pizza ordering" user interface based on an HtDP +@filepath{pizza.rkt} : A simple "pizza ordering" user interface based on an HtDP exercise. -@scheme[calculator.rkt] : A simple calculator interface, also based on an HtDP +@filepath{calculator.rkt} : A simple calculator interface, also based on an HtDP exercise except that the result updates continuously as the arguments and operator change. The next three animation examples are courtesy of Robb Cutler: -@scheme[analog-clock.rkt] : An animated real-time clock. A slider adjusts the +@filepath{analog-clock.rkt} : An animated real-time clock. A slider adjusts the radius of the face. Click and drag to move the face around. -@scheme[growing-points.rkt] : A field of points that grow as the mouse +@filepath{growing-points.rkt} : A field of points that grow as the mouse approaches. -@scheme[needles.rkt] : A field of needles that point at the mouse. +@filepath{needles.rkt} : A field of needles that point at the mouse. diff --git a/collects/games/cards/cards.scrbl b/collects/games/cards/cards.scrbl index 1fc6e3ddcc..0128e221df 100644 --- a/collects/games/cards/cards.scrbl +++ b/collects/games/cards/cards.scrbl @@ -5,7 +5,7 @@ @title{@bold{Cards}: Virtual Playing Cards Library} -@defmodule[games/cards]{The @schememodname[games/cards] +@defmodule[games/cards]{The @racketmodname[games/cards] module provides a toolbox for creating cards games.} @; ---------------------------------------------------------------------- @@ -16,10 +16,10 @@ module provides a toolbox for creating cards games.} [h exact-nonnegative-integer? 3]) table<%>]{ -Returns a table. The table is named by @scheme[title], and it is -@scheme[w] cards wide and @scheme[h] cards high (assuming a standard +Returns a table. The table is named by @racket[title], and it is +@racket[w] cards wide and @racket[h] cards high (assuming a standard card of 71 by 96 pixels). The table is not initially shown; -@scheme[(send table show #t)] shows it.} +@racket[(send table show #t)] shows it.} @defproc[(make-deck) (listof card<%>)]{ @@ -43,12 +43,12 @@ the same size.} @defproc[(shuffle-list [lst list?] [n exact-nonnegative-integer?]) list?]{ -Shuffles the given @scheme[lst] @scheme[n] times, returning the new +Shuffles the given @racket[lst] @racket[n] times, returning the new list. Shuffling simulates an actual shuffle: the list is split into halves which are merged back together by repeatedly pulling the top card off one of the halves, randomly selecting one half or the other. According to some mathematical theorem, 7 is a large enough -@scheme[n] to get a perfect shuffle.} +@racket[n] to get a perfect shuffle.} @; ---------------------------------------------------------------------- @section{Regions and Buttons} @@ -61,22 +61,22 @@ other. According to some mathematical theorem, 7 is a large enough [(callback #:mutable) (or/c ((listof (is-a?/c card<%>)) . -> . any) false/c)])]{ -The @scheme[x], @scheme[y], @scheme[w], and @scheme[h] fields +The @racket[x], @racket[y], @racket[w], and @racket[h] fields determine the region's location on the table. -When @scheme[label] is a string, it is drawn in the region in 12-pixel +When @racket[label] is a string, it is drawn in the region in 12-pixel text, centered horizontally and 5 pixels down from the region's top -outline. If label is @scheme[#f], no label or box is drawn for the +outline. If label is @racket[#f], no label or box is drawn for the region. -The @scheme[callback] procedure takes a list of cards that were -dragged to the region; if callback is @scheme[#f], the region is not +The @racket[callback] procedure takes a list of cards that were +dragged to the region; if callback is @racket[#f], the region is not active (i.e., dragging cards to the region doesn't highlight the region box). The region remains hilited until the callback returns. The only available mutator on the structure is -@scheme[set-region-callback!]. The structure created by -@scheme[make-region] actually has extra hidden fields.} +@racket[set-region-callback!]. The structure created by +@racket[make-region] actually has extra hidden fields.} @defproc[(make-button-region [x real?] [y real?] @@ -87,7 +87,7 @@ The only available mutator on the structure is false/c)]) region?]{ -Returns a region like one made by @scheme[make-region], but the is +Returns a region like one made by @racket[make-region], but the is drawn slightly differently and it reacts differently to cards and the mouse. The label is drawn in the middle of the box instead of at the top, and the callback is called with no arguments when the user @@ -102,13 +102,13 @@ Returns a region like one made by @scheme[make-region], but the is region?]{ Returns a region that does not respond to mouse clicks, but which has - a general paint callback. The @scheme[paint-callback] function is + a general paint callback. The @racket[paint-callback] function is called with a drawing context, x and y offsets, and the width and - height (which are always @scheme[w] and @scheme[h]). The x and y - offsets can be different than the supplied @scheme[x] and @scheme[y] + height (which are always @racket[w] and @racket[h]). The x and y + offsets can be different than the supplied @racket[x] and @racket[y] when part of the table is drawn offscreen. Regions are painted in the order that they are added to a table, and all regions are painted - before any card. The @scheme[paint-callback] procedure should not + before any card. The @racket[paint-callback] procedure should not assume a particular state for the drawing context (i.e.,current brush or pen), and it should restore any modified drawing context state before returning.} @@ -123,7 +123,7 @@ Returns a region like one made by @scheme[make-region], but the is (un)hilited as the user drags a set of cards to the region. The callback is provided two arguments: a boolean indicating whether the region is hilited, and the list of cards being dragged. Like - region-callback, the default is @scheme[#f], which indicates that the + region-callback, the default is @racket[#f], which indicates that the region has no interactive callback (but does not affect whether the region is hilited as cards are dragged). The final unhilite (when cards are potentially delivered) does not trigger this callback.} @@ -133,22 +133,22 @@ Returns a region like one made by @scheme[make-region], but the is (boolean? (listof (is-a?/c card<%>)) . -> . any)]{ Gets the current callback that is installed via - @scheme[set-region-interaction-callback!].} + @racket[set-region-interaction-callback!].} @; ---------------------------------------------------------------------- @section{Table Methods} @definterface[table<%> (frame%)]{ -Create an instance with @scheme[make-table]. +Create an instance with @racket[make-table]. @defmethod[(add-card [card (is-a?/c card<%>)] [x real?] [y real?]) void?]{ - Adds @scheme[card] to the table with its top-left corner at - (@scheme[x], @scheme[y]) in table pixels.} + Adds @racket[card] to the table with its top-left corner at + (@racket[x], @racket[y]) in table pixels.} @defmethod[(add-cards [cards (listof (is-a?/c card<%>))] [x real?] @@ -158,39 +158,39 @@ Create an instance with @scheme[make-table]. (lambda (i) (values 0 0))]) void?]{ - Adds a list of cards at (@scheme[x], @scheme[y]). The optional - @scheme[offset-proc] procedure is called with an index @scheme[_i] - (counting from 0) and should return two values: @scheme[_dx] and - @scheme[_dy]; the @scheme[_i]th card is the placed at @scheme[(+ x - +dx)] and @scheme[(+ y _dy)]. The cards are added in order on top of + Adds a list of cards at (@racket[x], @racket[y]). The optional + @racket[offset-proc] procedure is called with an index @racket[_i] + (counting from 0) and should return two values: @racket[_dx] and + @racket[_dy]; the @racket[_i]th card is the placed at @racket[(+ x + +dx)] and @racket[(+ y _dy)]. The cards are added in order on top of cards already one the table such that the first card in - @scheme[cards] is topmost.} + @racket[cards] is topmost.} @defmethod[(add-cards-to-region [cards (listof (is-a?/c card<%>))] [region? r]) void?]{ - Adds @scheme[cards] to fill the region @scheme[r], fanning them out - bottom-right to top-left, assuming that all cards in @scheme[cards] - have the same width and height. The region @scheme[r] does not have + Adds @racket[cards] to fill the region @racket[r], fanning them out + bottom-right to top-left, assuming that all cards in @racket[cards] + have the same width and height. The region @racket[r] does not have to be added to the table.} @defmethod[(remove-card [card (is-a?/c card<%>)]) void?]{ -Removes @scheme[card] from the table.} +Removes @racket[card] from the table.} @defmethod[(remove-cards [cards (listof (is-a?/c card<%>))]) void?]{ - Removes @scheme[cards] from the table.} + Removes @racket[cards] from the table.} @defmethod[(move-card [card (is-a?/c card<%>)] [x real?] [y real?]) void?]{ - Moves @scheme[card], which must be on the same already. The movement + Moves @racket[card], which must be on the same already. The movement of the cards is animated. If the cards are in snap-back-after-move mode and a drag is active, snapping back will use the new location.} @@ -211,23 +211,23 @@ Removes @scheme[card] from the table.} void?]{ Like @method[table<%> add-cards-to-region], but moves cards that are - already on the table like @scheme[move-card]. All of the cards are + already on the table like @racket[move-card]. All of the cards are moved at once.} @defmethod*[([(flip-card [card (is-a?/c card<%>)]) void?] [(flip-cards [cards (listof (is-a?/c card<%>))]) void?])]{ - Flips @scheme[card] or all @scheme[cards] over (at once) with + Flips @racket[card] or all @racket[cards] over (at once) with animation.} @defmethod*[([(card-face-up [card (is-a?/c card<%>)]) void?] [(cards-face-up [cards (listof (is-a?/c card<%>))]) void?] [(card-face-down [card (is-a?/c card<%>)]) void?] [(cards-face-down [cards (listof (is-a?/c card<%>))]) void?])]{ - - Like @method[table<%> flip-cards], but only for @scheme[card] or - elements of @scheme[cards] that are currently face down/up.} + + Like @method[table<%> flip-cards], but only for @racket[card] or + elements of @racket[cards] that are currently face down/up.} @defmethod*[([(rotate-card [card (is-a?/c card<%>)] [mode (or/c 'cw 'ccw 0 90 -90 180 -180 270 -270 360)]) @@ -236,23 +236,23 @@ Removes @scheme[card] from the table.} [mode (or/c 'cw 'ccw 0 90 -90 180 -180 270 -270 360)]) void?])]{ - Rotates @scheme[card] or all @scheme[cards] (at once, currently + Rotates @racket[card] or all @racket[cards] (at once, currently without animation, but animation may be added in the future). The center of each card is kept in place, except that the card is moved as necessary to keep it on the table. See @xmethod[card<%> - rotate] for information on @scheme[mode].} + rotate] for information on @racket[mode].} @defmethod*[([(card-to-front [card (is-a?/c card<%>)]) void?] [(card-to-back [card (is-a?/c card<%>)]) void?])]{ - Moves @scheme[card] before/behind of all other cards.} + Moves @racket[card] before/behind of all other cards.} @defmethod[(stack-cards [cards (listof (is-a?/c card<%>))]) void?]{ - The first card in @scheme[cards] is not moved; the second card is + The first card in @racket[cards] is not moved; the second card is moved to follow immediately behind the first one, then - @method[table<%> stack-cards] is called on @scheme[(cdr cards)]. If - @scheme[cards] is empty or contains only one card, no action is + @method[table<%> stack-cards] is called on @racket[(cdr cards)]. If + @racket[cards] is empty or contains only one card, no action is taken.} @defmethod[(card-location [card (is-a?/c card<%>)]) @@ -276,17 +276,17 @@ Removes @scheme[card] from the table.} Starts/ends a sequence of card or region changes that won't be animated or updated until the end of the sequence. Sequences can be - nested via matching @schemeidfont{begin-}/@schemeidfont{end-} pairs.} - + nested via matching @racketidfont{begin-}/@racketidfont{end-} pairs.} + @defmethod[(add-region [r region?]) void]{ - Adds the region @scheme[r] to the table; regions are drawn in the + Adds the region @racket[r] to the table; regions are drawn in the order that they are added to the table, and when a region added later is hilighted, it can obscure regions added earlier.} @defmethod[(remove-region [r region?]) void]{ - Removes the region @scheme[r] from the table.} + Removes the region @racket[r] from the table.} @defmethod*[([(hilite-region [r region?]) void?] [(unhilite-region [r region?]) void?])]{ @@ -298,36 +298,36 @@ Removes @scheme[card] from the table.} void?]{ Sets the way that a mouse click is handled for a particular button - indicated by @scheme[which]. The @scheme[action] argument must be one + indicated by @racket[which]. The @racket[action] argument must be one of the following: @itemize[ - @item{@scheme['drag/one] --- drag only the clicked-on card.} + @item{@racket['drag/one] --- drag only the clicked-on card.} - @item{@scheme['drag-raise/one] --- like drag/one, but raise the + @item{@racket['drag-raise/one] --- like drag/one, but raise the card to the top on a click.} - @item{@scheme['drag/above] --- drag the card along with any card + @item{@racket['drag/above] --- drag the card along with any card on top of the card (i.e., more towards the front and overlapping with the card). The on-top-of relation is closed transitively.} - @item{@scheme['drag-raise/above] --- like @scheme['drag/above], + @item{@racket['drag-raise/above] --- like @racket['drag/above], but raises.} - @item{@scheme['drag-below] --- drag the card along with any card + @item{@racket['drag-below] --- drag the card along with any card underneath the card (i.e., more towards the back and overlapping with the card). The underneath relation is closed transitively.} - @item{@scheme['drag-raise/below] --- like @scheme['drag/below], + @item{@racket['drag-raise/below] --- like @racket['drag/below], but raises.} ] - The initial settings are: @scheme['drag-raise/above] for - @scheme['left], @scheme['drag/one] for @scheme['middle], and - @scheme['drag/below] for @scheme['right].} + The initial settings are: @racket['drag-raise/above] for + @racket['left], @racket['drag/one] for @racket['middle], and + @racket['drag/below] for @racket['right].} @defmethod[(set-double-click-action [proc ((is-a?/c card<%>) . -> . any)]) @@ -374,10 +374,10 @@ Removes @scheme[card] from the table.} Adds a @onscreen{Help} button to the given pane, where clicking the button opens a new window to display @filepath{doc.txt} from the given - collection. The @scheme[str] argument is used for the help window - title. If @scheme[tt?] is true, then @filepath{doc.txt} is displayed - verbatim, otherwise it is formatted as for @scheme[show-help] from - @schememodname[games/show-help].} + collection. The @racket[str] argument is used for the help window + title. If @racket[tt?] is true, then @filepath{doc.txt} is displayed + verbatim, otherwise it is formatted as for @racket[show-help] from + @racketmodname[games/show-help].} @defmethod[(add-scribble-button [pane (is-a?/c area-container<%>)] [mod-path module-path?] @@ -386,7 +386,7 @@ Removes @scheme[card] from the table.} Adds a @onscreen{Help} button to the given pane, where clicking the button opens Scribble-based documentation, as with - @scheme[show-scribbling] from @schememodname[games/show-scribbling].} + @racket[show-scribbling] from @racketmodname[games/show-scribbling].} } @@ -395,7 +395,7 @@ Removes @scheme[card] from the table.} @definterface[card<%> ()]{ -Create instances with @scheme[make-deck] or @scheme[make-card]. +Create instances with @racket[make-deck] or @racket[make-card]. @defmethod[(card-width) exact-nonnegative-integer?]{ @@ -422,62 +422,62 @@ Create instances with @scheme[make-deck] or @scheme[make-card]. @defmethod[(face-down?) boolean?]{ - Returns @scheme[#t] if the card is currently face down.} + Returns @racket[#t] if the card is currently face down.} @defmethod[(rotate [mode (or/c 'cw 'ccw 0 90 -90 180 -180 270 -270 360)]) void?]{ Rotates the card. Unlike using the @xmethod[table<%> rotate-card] method, the card's top-left position is kept in place. - If @scheme[mode] is @scheme['cw], the card is - rotated clockwise; if @scheme[mode] is @scheme['ccw], the card is - rotated counter-clockwise; if @scheme[mode] is one of the allowed + If @racket[mode] is @racket['cw], the card is + rotated clockwise; if @racket[mode] is @racket['ccw], the card is + rotated counter-clockwise; if @racket[mode] is one of the allowed numbers, the card is rotated the corresponding amount in degrees counter-clockwise.} @defmethod[(orientation) (or/c 0 90 180 270)]{ - Returns the orientation of the card, where @scheme[0] corresponds to - its initial state, @scheme[90] is rotated 90 degrees counter-clockwise, and so on.} + Returns the orientation of the card, where @racket[0] corresponds to + its initial state, @racket[90] is rotated 90 degrees counter-clockwise, and so on.} @defmethod[(get-suit-id) any/c]{ - Normally returns @scheme[1], @scheme[2], @scheme[3], or @scheme[4] + Normally returns @racket[1], @racket[2], @racket[3], or @racket[4] (see @method[card<%> get-suit] for corresponding suit names), but the - result can be anything for a card created by @scheme[make-card].} + result can be anything for a card created by @racket[make-card].} @defmethod[(get-suit) symbol?]{ - Returns @scheme['clubs], @scheme['diamonds], @scheme['hearts], - @scheme['spades], or @scheme['unknown], depending on whether - @method[card<%> get-suit-id] returns @scheme[1], @scheme[2], - @scheme[3], @scheme[4], or something else.} + Returns @racket['clubs], @racket['diamonds], @racket['hearts], + @racket['spades], or @racket['unknown], depending on whether + @method[card<%> get-suit-id] returns @racket[1], @racket[2], + @racket[3], @racket[4], or something else.} @defmethod[(get-value) any/c]{ - Normally returns @scheme[1] (Ace), @scheme[2], ... @scheme[10], - @scheme[11] (Jack), @scheme[12] (Queen), or @scheme[13] (King), but - the result can be anything for a card created by @scheme[make-card].} + Normally returns @racket[1] (Ace), @racket[2], ... @racket[10], + @racket[11] (Jack), @racket[12] (Queen), or @racket[13] (King), but + the result can be anything for a card created by @racket[make-card].} @defmethod*[([(user-can-flip) boolean?] [(user-can-flip [can? any/c]) void?])]{ Gets/sets whether the user can flip the card interactively, usually - by double-clicking it. Initially @scheme[#t].} + by double-clicking it. Initially @racket[#t].} @defmethod*[([(user-can-move) boolean?] [(user-can-move [can? any/c]) void?])]{ Gets/sets whether the user can move the card interactively, usually by dragging it. Disabling moves has the side-effect of disabling - raises and double-clicks. Initially @scheme[#t].} + raises and double-clicks. Initially @racket[#t].} @defmethod*[([(snap-back-after-move) boolean?] [(snap-back-after-move [on? any/c]) void?])]{ Assuming user can move the card interactively, gets/sets whether the card stays where the user dragged it or snaps back to its original - place. Initially @scheme[#f]. + place. Initially @racket[#f]. A region's @italic{interactive} callback can disable snap-back for a card so that the card can be delivered to the region. (A region's @@ -487,18 +487,18 @@ Create instances with @scheme[make-deck] or @scheme[make-card]. [(stay-in-region [r (or/c region? false/c)]) void?])]{ - Gets/sets a constraining region @scheme[r]. If @scheme[r] is not - @scheme[#f], the user cannot move the card out of @scheme[r]. - Initially @scheme[#f].} + Gets/sets a constraining region @racket[r]. If @racket[r] is not + @racket[#f], the user cannot move the card out of @racket[r]. + Initially @racket[#f].} @defmethod*[([(home-region) (or/c region? false/c)] [(home-region [r (or/c region? false/c)]) void?])]{ - Gets/sets a home region @scheme[r]. If @scheme[r] is not @scheme[#f], + Gets/sets a home region @racket[r]. If @racket[r] is not @racket[#f], then the user can move the card freely within the region, but it snaps back if moved completely out of the region. If moved partly out of the region, the card is moved enough to get completely back - in. Initially @scheme[#f]. + in. Initially @racket[#f]. A region's @italic{interactive} callback can disable snap-back for a card so that the card can be delivered to the region. (A region's diff --git a/collects/games/chat-noir/chat-noir-literate.rkt b/collects/games/chat-noir/chat-noir-literate.rkt index 3139f20edf..dcf6691bff 100644 --- a/collects/games/chat-noir/chat-noir-literate.rkt +++ b/collects/games/chat-noir/chat-noir-literate.rkt @@ -42,7 +42,7 @@ the Chat Noir game in a @section{Overview} Chat Noir is implemented using @link["http://www.htdp.org/"]{HtDP}'s universe -library: @schememodname[2htdp/universe] +library: @racketmodname[2htdp/universe] (although it only uses the ``world'' portions of that library). The program is divided up into six parts: the world data definition, an implementation of breadth-first search, @@ -65,7 +65,7 @@ and some code that builds an initial world and starts the game. ] Each section also comes with a series of test cases that are collected into the -@scheme[] +@racket[] chunk at the end of the program. @chunk[ @@ -77,8 +77,8 @@ chunk at the end of the program. ] -Each test case uses either @scheme[test], a simple form that accepts two -arguments and compares them with @scheme[equal?], or @scheme[test/set] +Each test case uses either @racket[test], a simple form that accepts two +arguments and compares them with @racket[equal?], or @racket[test/set] which accepts two lists and compares them as if they were sets. In general, most of the test cases are left to the end of the document, organized @@ -98,7 +98,7 @@ construct empty worlds and test cases for them. @chunk[ ] -The main structure definition is the @scheme[world] struct. +The main structure definition is the @racket[world] struct. @chunk[ (define-struct/contract world ([board (listof cell?)] @@ -121,50 +121,50 @@ It consists of a structure with six fields: @tt{cell}s, one for each circle on the game. } -@item{@tt{cat}: a @scheme[posn] indicating the position of the cat - (interpreting the @scheme[posn] in the way that they are interpreted +@item{@tt{cat}: a @racket[posn] indicating the position of the cat + (interpreting the @racket[posn] in the way that they are interpreted for the @tt{board} field),} @item{@tt{state}: the state of the game, which can be one of @itemize[ - @item{@scheme['playing], indicating that the game is still going; this is the + @item{@racket['playing], indicating that the game is still going; this is the initial state.} - @item{@scheme['cat-won], indicating that the game is over and the + @item{@racket['cat-won], indicating that the game is over and the cat won, or} - @item{@scheme['cat-lost], indicating that the game is over and the + @item{@racket['cat-lost], indicating that the game is over and the cat lost.}]} @item{@tt{size}: an odd natural number indicating the size of the board} -@item{@tt{mouse-posn}: a @scheme[posn] for the location of the - mouse (or @scheme[#f] if the mouse is not in the window), and} +@item{@tt{mouse-posn}: a @racket[posn] for the location of the + mouse (or @racket[#f] if the mouse is not in the window), and} @item{@tt{h-down?}: a boolean indicating if the @tt{h} key is being pushed down.} ] -A @scheme[cell] is a structure with two fields: +A @racket[cell] is a structure with two fields: @chunk[ (define-struct/contract cell ([p posn?] [blocked? boolean?]) #:transparent)] - + The coordinates of -the @scheme[posn] in the first field +the @racket[posn] in the first field indicate a position on the hexagonal grid. This program reprsents the hexagon grid as a series of rows that are offset from each other by 1/2 the size of the each cell. The @tt{y} field -of the @scheme[posn] refers to the row of the cell, and the @tt{x} +of the @racket[posn] refers to the row of the cell, and the @tt{x} coordinate the position in the row. This means that, for example, -@scheme[(make-posn 1 0)] is centered above @scheme[(make-posn 1 0)] -and @scheme[(make-posn 1 1)]. +@racket[(make-posn 1 0)] is centered above @racket[(make-posn 1 0)] +and @racket[(make-posn 1 1)]. The boolean in the @tt{blocked?} field indicates if the cell has been clicked on, thus blocking the cat from stepping there. -The @scheme[empty-board] function builds a list of @scheme[cell]s +The @racket[empty-board] function builds a list of @racket[cell]s that correspond to an empty board. For example, here's what an empty 7x7 board looks like, as a list of cells. @@ -189,7 +189,7 @@ their left-most cells. And here is how that board looks as a list of cells. @chunk[ - + (test (empty-board 3) (list (make-cell (make-posn 0 1) #f) @@ -200,13 +200,13 @@ And here is how that board looks as a list of cells. (make-cell (make-posn 2 1) #f) (make-cell (make-posn 2 2) #f)))] -The @scheme[empty-board] function consists -of two (nested) calls to @scheme[build-list] +The @racket[empty-board] function consists +of two (nested) calls to @racket[build-list] that build a list of lists of cells, one for -each pair of coordinates between @scheme[0] -and @scheme[board-size]. Then, @scheme[append] +each pair of coordinates between @racket[0] +and @racket[board-size]. Then, @racket[append] flattens the nested lists and the -@scheme[filter] expression removes the corners. +@racket[filter] expression removes the corners. @chunk[ (define/contract (empty-board board-size) @@ -237,13 +237,13 @@ flattens the nested lists and the Building an empty world is simply a matter of building an empty board, finding the initial position of the cat and filling -in all of the fields of the @scheme[world] struct. -For example, this is the empty world of size @scheme[3]. -It puts the cat at @scheme[(make-posn 1 1)], -sets the state to @scheme['playing], records the -size @scheme[3], and sets the current mouse position -to @scheme[#f] and the state of the ``h'' key to -@scheme[#f]. +in all of the fields of the @racket[world] struct. +For example, this is the empty world of size @racket[3]. +It puts the cat at @racket[(make-posn 1 1)], +sets the state to @racket['playing], records the +size @racket[3], and sets the current mouse position +to @racket[#f] and the state of the ``h'' key to +@racket[#f]. @chunk[ @@ -256,7 +256,7 @@ to @scheme[#f] and the state of the ``h'' key to #f))] -The @scheme[empty-world] function +The @racket[empty-world] function generalizes the example by computing the cats initial position as the center spot on the board. @@ -273,16 +273,16 @@ cats initial position as the center spot on the board. #f #f))] -The @scheme[add-n-random-blocked-cells] function accepts a list of cells -and returns a new list of cells where @scheme[n] of the unblocked cells -in @scheme[all-cells] are now blocked. +The @racket[add-n-random-blocked-cells] function accepts a list of cells +and returns a new list of cells where @racket[n] of the unblocked cells +in @racket[all-cells] are now blocked. -If @scheme[n] is zero, of course, no more cells should be blocked, -so the result is just @scheme[all-cells]. Otherwise, -the function computes @scheme[unblocked-cells], a list of all +If @racket[n] is zero, of course, no more cells should be blocked, +so the result is just @racket[all-cells]. Otherwise, +the function computes @racket[unblocked-cells], a list of all of the unblocked cells (except the cat's initial location), and then randomly picks a cell from it, -calling @scheme[block-cell] to actually block that cell. +calling @racket[block-cell] to actually block that cell. @chunk[ (define/contract (add-n-random-blocked-cells n all-cells board-size) @@ -309,9 +309,9 @@ calling @scheme[block-cell] to actually block that cell. board-size))]))] -The @scheme[block-cell] function accepts a @scheme[posn] -and a list of @scheme[cell] structs and updates the -relevant cell, setting its @tt{blocked?} field to @scheme[#t]. +The @racket[block-cell] function accepts a @racket[posn] +and a list of @racket[cell] structs and updates the +relevant cell, setting its @tt{blocked?} field to @racket[#t]. @chunk[ (define/contract (block-cell to-block board) @@ -325,7 +325,7 @@ relevant cell, setting its @tt{blocked?} field to @scheme[#t]. The cat's move decision is based on a breadth-first search of a graph. The graph's nodes are the cells on the board plus a special -node called @scheme['boundary] that is adjacent to every cell +node called @racket['boundary] that is adjacent to every cell on the boundary of the graph. In addition to the boundary edges, there are edges between each pair of adjacent cells, unless one of the cells is @@ -343,21 +343,21 @@ details of how the graph connectivity is computed from the board to the next sec ] -The breadth-first function constructs a @scheme[distance-map], -which is a list of @scheme[dist-cell] structs: +The breadth-first function constructs a @racket[distance-map], +which is a list of @racket[dist-cell] structs: @chunk[ (define-struct/contract dist-cell ([p (or/c 'boundary posn?)] [n natural-number/c]) #:transparent)] -Each @tt{p} field in the @scheme[dist-cell] is a position on the board +Each @tt{p} field in the @racket[dist-cell] is a position on the board and the @tt{n} field is a natural number, indicating the distance of the shortest path from the node to some fixed point on the board. -The function @scheme[lookup-in-table] returns the distance from the fixed -point to the given posn, returning @scheme['∞] if the posn is not in the +The function @racket[lookup-in-table] returns the distance from the fixed +point to the given posn, returning @racket['∞] if the posn is not in the table. @chunk[ @@ -372,7 +372,7 @@ table. [else (lookup-in-table (rest t) p)])]))] -The @scheme[build-bfs-table] accepts a world and a cell +The @racket[build-bfs-table] accepts a world and a cell (indicating the fixed point) and returns a distance map encoding the distance to that cell. For example, here is the distance map for the distance to the boundary. @@ -397,15 +397,15 @@ The boundary is zero steps away; each of the cells that are on the boundary are one step away and the center is two steps away. The core of the breadth-first search is this function, -@scheme[bst]. It accepts a queue of the pending nodes to visit -and a @scheme[dist-table] that records the same information as a -@scheme[distance-map], but in an immutable hash-table. The -@scheme[dist-map] is an accumulator, recording the distances +@racket[bst]. It accepts a queue of the pending nodes to visit +and a @racket[dist-table] that records the same information as a +@racket[distance-map], but in an immutable hash-table. The +@racket[dist-map] is an accumulator, recording the distances to all of the nodes that have already been visited in the graph, and is used here to speed up the compuation. The queue is represented as a list of vectors of length two. Each element -in the queue contains a @scheme[posn], or the symbol @scheme['boundary] -and that @scheme[posn]'s distance. +in the queue contains a @racket[posn], or the symbol @racket['boundary] +and that @racket[posn]'s distance. @chunk[ @@ -430,23 +430,23 @@ and that @scheme[posn]'s distance. (neighbors/w p))) (hash-set dist-table p dist))]))]))] -If the @scheme[queue] is empty, then the accumulator contains +If the @racket[queue] is empty, then the accumulator contains bindings for all of the (reachable) nodes in the graph, so we just return it. If it isn't empty, then we extract the first element from the queue and name its consituents -@scheme[p] and @scheme[dist]. +@racket[p] and @racket[dist]. Next we check to see if the node at the head of the queue -is in @scheme[dist-table]. If it is, we just move on to the -next element in the queue. If that node is not in the @scheme[dist-table], -then we add all of the neighbors to the queue, in the @scheme[append] -expression, and update the @scheme[dist-table] with the distance to +is in @racket[dist-table]. If it is, we just move on to the +next element in the queue. If that node is not in the @racket[dist-table], +then we add all of the neighbors to the queue, in the @racket[append] +expression, and update the @racket[dist-table] with the distance to this node. Because we always add the new children to the end of the queue and always look at the front of the queue, we are guaranteed that the first time we see a node, it will be with the shortest distance. -The @scheme[build-bfs-table] function packages up @scheme[bfs] -function. It accepts a @scheme[world] and an initial position -and returns a @scheme[distance-table]. +The @racket[build-bfs-table] function packages up @racket[bfs] +function. It accepts a @racket[world] and an initial position +and returns a @racket[distance-table]. @chunk[ @@ -461,16 +461,16 @@ and returns a @scheme[distance-table]. (make-immutable-hash '())) make-dist-cell))] -As you can see, the first thing it does is bind the free variable in @scheme[bfs] -to the result of calling the @scheme[neighbors] function (defined in the chunk -@scheme[]) and then it has the @scheme[] chunk. In the body -it calls the @scheme[bfs] function +As you can see, the first thing it does is bind the free variable in @racket[bfs] +to the result of calling the @racket[neighbors] function (defined in the chunk +@racket[]) and then it has the @racket[] chunk. In the body +it calls the @racket[bfs] function and then transforms the result, using -@scheme[hash-map], into a list of @scheme[cell]s. +@racket[hash-map], into a list of @racket[cell]s. @section{Board to Graph} -As far as the @scheme[build-bfs-table] function goes, +As far as the @racket[build-bfs-table] function goes, all of the information specific to Chat Noir is encoded in the neighbors function. It accepts a world and returns a function @@ -491,11 +491,11 @@ it is implemented. ] -The neighbors functions accepts a @scheme[world] and then -returns a function that computes the neighbors of a @scheme[posn] -and of the @scheme['boundary]. +The neighbors functions accepts a @racket[world] and then +returns a function that computes the neighbors of a @racket[posn] +and of the @racket['boundary]. -For example, @scheme[(make-posn 1 0)] has four +For example, @racket[(make-posn 1 0)] has four neighbors: @chunk[ @@ -505,7 +505,7 @@ neighbors: (make-posn 0 1) (make-posn 1 1)))] -and @scheme[(make-posn 0 1)] has four neighbors: +and @racket[(make-posn 0 1)] has four neighbors: @chunk[ (test ((neighbors (empty-world 7)) (make-posn 0 1)) @@ -527,7 +527,7 @@ Also, there are 6 neighbors of the boundary in the 3x3 board: (make-posn 2 1) (make-posn 2 2)))] -This is the neighbors function. After it accepts the @scheme[world], +This is the neighbors function. After it accepts the @racket[world], it builds a list of the blocked cells in the world and a list of the cells that are on the boundary (and not blocked). Then it returns a function that is specialized to those values. @@ -554,17 +554,17 @@ returns a function that is specialized to those values. (world-size w) p)))] -The @scheme[neighbors-blocked/boundary] function is given next. -If @scheme[p] is blocked, it returns the empty list. If it is -on the boundary, the function simply returns @scheme[boundary-cells]. -Otherwise, @scheme[neighbors-blocked/boundary] calls -@scheme[adjacent] to compute the posns that are adjacent to @scheme[p], -filtering out the blocked @scheme[posn]s and binds that to @scheme[adjacent-posns]. -It then filters out the @scheme[posn]s that would be outside of the board. -If those two lists are the same, then @scheme[p] is not on the boundary, -so we just return @scheme[in-bounds]. If the lists are different, then -we know that @scheme[p] must have been on the boundary, so we add -@scheme['boundary] to the result list. +The @racket[neighbors-blocked/boundary] function is given next. +If @racket[p] is blocked, it returns the empty list. If it is +on the boundary, the function simply returns @racket[boundary-cells]. +Otherwise, @racket[neighbors-blocked/boundary] calls +@racket[adjacent] to compute the posns that are adjacent to @racket[p], +filtering out the blocked @racket[posn]s and binds that to @racket[adjacent-posns]. +It then filters out the @racket[posn]s that would be outside of the board. +If those two lists are the same, then @racket[p] is not on the boundary, +so we just return @racket[in-bounds]. If the lists are different, then +we know that @racket[p] must have been on the boundary, so we add +@racket['boundary] to the result list. @chunk[ (define/contract (neighbors-blocked/boundary blocked @@ -598,17 +598,17 @@ we know that @scheme[p] must have been on the boundary, so we add There are the three functions that build the basic graph structure -from a board as used by @scheme[neighbors]. +from a board as used by @racket[neighbors]. -The first function is @scheme[adjacent]. It consumes a -@scheme[posn] and returns six @scheme[posn]s that +The first function is @racket[adjacent]. It consumes a +@racket[posn] and returns six @racket[posn]s that indicate what the neighbors are, without consideration of the size of the board (or the missing corner pieces). -For example, these are the @scheme[posn]s that are adjacent -to @scheme[(make-posn 0 1)]; note that the first and the third +For example, these are the @racket[posn]s that are adjacent +to @racket[(make-posn 0 1)]; note that the first and the third are not on the board and do not show up in -@scheme[neighbors] function example above. +@racket[neighbors] function example above. @chunk[ (test (adjacent (make-posn 0 1)) @@ -620,7 +620,7 @@ are not on the board and do not show up in (make-posn 1 2)))] The adjacent function has two main cases; first when the -@scheme[y] coordinate of the @scheme[posn] is even and +@racket[y] coordinate of the @racket[posn] is even and second when it is odd. In each case, it is just a matter of looking at the board and calculating coordinate offsets. @@ -647,10 +647,10 @@ of looking at the board and calculating coordinate offsets. (make-posn x (+ y 1)) (make-posn (+ x 1) (+ y 1)))])))] -The @scheme[on-boundary?] function returns @scheme[#t] when +The @racket[on-boundary?] function returns @racket[#t] when the posn would be on the boundary of a board of size -@scheme[board-size]. Note that this function does not -have to special case the missing @scheme[posn]s from the corners. +@racket[board-size]. Note that this function does not +have to special case the missing @racket[posn]s from the corners. @chunk[ (define/contract (on-boundary? p board-size) @@ -661,10 +661,10 @@ have to special case the missing @scheme[posn]s from the corners. (= (posn-x p) (- board-size 1)) (= (posn-y p) (- board-size 1))))] -The @scheme[in-bounds?] function returns @scheme[#t] -when the @scheme[posn] is actually on the board, meaning -that the coordinates of the @scheme[posn] are within the -board's size, and that the @scheme[posn] is not one +The @racket[in-bounds?] function returns @racket[#t] +when the @racket[posn] is actually on the board, meaning +that the coordinates of the @racket[posn] are within the +board's size, and that the @racket[posn] is not one of the two corners that have been removed. @chunk[ @@ -689,12 +689,12 @@ determines where the shortest paths from the cat's current position to the bound <+/f-tests>] -The function @scheme[on-cats-path?] accepts a world and returns a predicate -on the @scheme[posn]s in the world. The predicate indicates if the given -@scheme[posn] is on the shortest path. +The function @racket[on-cats-path?] accepts a world and returns a predicate +on the @racket[posn]s in the world. The predicate indicates if the given +@racket[posn] is on the shortest path. -For example, in a world of size @scheme[7] with the cat at -@scheme[(make-posn 2 2)], the circles with white centers +For example, in a world of size @racket[7] with the cat at +@racket[(make-posn 2 2)], the circles with white centers are on the shortest path to the boundary: @image["chat-noir/cat-distance-example.png"] @@ -723,7 +723,7 @@ the cat to the boundary. The code is essentially that, plus two other special cases. Specifically if the ``h'' key is not pressed down, then we just consider no cells to be on that shortest -path. And if the distance to the cat is @scheme['∞], then again no nodes are on the +path. And if the distance to the cat is @racket['∞], then again no nodes are on the path. The second situation happens when the cat is completely boxed in and has lost the game. @@ -748,8 +748,8 @@ lost the game. [else (lambda (p) #f)]))] -Finally, the helper function @scheme[+/f] is just like @scheme[+], except that -it returns @scheme['∞] if either argument is @scheme['∞]. +Finally, the helper function @racket[+/f] is just like @racket[+], except that +it returns @racket['∞] if either argument is @racket['∞]. @chunk[<+/f> (define (+/f x y) @@ -762,15 +762,15 @@ it returns @scheme['∞] if either argument is @scheme['∞]. @section{Drawing the Cat} This code is three large, similar constants, -bundled up into the @scheme[cat] function. -The @scheme[thinking-cat] is the one that +bundled up into the @racket[cat] function. +The @racket[thinking-cat] is the one that is visible when the game is being played. It differs from the others in that it does not -have a mouth. The @scheme[mad-cat] is the one +have a mouth. The @racket[mad-cat] is the one that you see when the cat loses. It differs from the others in that its pinks turn pink. -Finally, the @scheme[happy-cat] shows up when -the cat wins and it is just like the @scheme[thinking-cat] +Finally, the @racket[happy-cat] shows up when +the cat wins and it is just like the @racket[thinking-cat] except it has a smile. @chunk[ @@ -880,9 +880,9 @@ of the circles that are drawn on the board, plus the radius of an invisible circle that, if they were drawn on top of the circles, would touch -each other. Accordingly, @scheme[circle-spacing] +each other. Accordingly, @racket[circle-spacing] is used when computing the positions of the circles, -but the circles are drawn using @scheme[circle-radius]. +but the circles are drawn using @racket[circle-radius]. @chunk[ (define circle-radius 20) @@ -896,7 +896,7 @@ The other four constants specify the colors of the circles. (define blocked-color 'black) (define under-mouse-color 'black)] -The main function for drawing a world is @scheme[render-world]. +The main function for drawing a world is @racket[render-world]. It is a fairly straightforward composition of helper functions. First, it builds the image of a board, and then puts the cat on it. Lastly, since the whiskers of the cat might now hang off of the edge @@ -921,7 +921,7 @@ and that the pinhole is always in the upper-left corner of the window. Trimming the cat's whiskers amounts to removing any extra space in the image that appears to the left or above the pinhole. -For example, the @scheme[rectangle] function returns +For example, the @racket[rectangle] function returns an image with a pinhole in the middle. So trimming 5x5 rectangle results in a 3x3 rectangle with the pinhole at (0,0). @@ -930,7 +930,7 @@ at (0,0). (test (chop-whiskers (rectangle 5 5 'solid 'black)) (put-pinhole (rectangle 3 3 'solid 'black) 0 0))] -The function uses @scheme[shrink] to remove all of the material above +The function uses @racket[shrink] to remove all of the material above and to the left of the pinhole. @chunk[ @@ -942,9 +942,9 @@ and to the left of the pinhole. (- (image-width img) (pinhole-x img) 1) (- (image-height img) (pinhole-y img) 1)))] -The @scheme[render-board] function uses @scheme[for/fold] to iterate -over all of the @scheme[cell]s in @scheme[cs]. It starts with -an empty rectangle and, one by one, puts the cells on @scheme[image]. +The @racket[render-board] function uses @racket[for/fold] to iterate +over all of the @racket[cell]s in @racket[cs]. It starts with +an empty rectangle and, one by one, puts the cells on @racket[image]. @chunk[ ;; render-board : board number (posn -> boolean) posn-or-#f -> image @@ -965,7 +965,7 @@ an empty rectangle and, one by one, puts the cells on @scheme[image]. (and (posn? mouse) (equal? mouse (cell-p c)))))))] -The @scheme[render-cell] function accepts a @scheme[cell], +The @racket[render-cell] function accepts a @racket[cell], a boolean indicating if the cell is on the shortest path between the cat and the boundary, and a second boolean indicating if the cell is underneath the mouse. It returns an image @@ -998,7 +998,7 @@ results in the cell being placed in the right place. (- x) (- y))))] -The @scheme[world-width] function computes the width of the rendered world, +The @racket[world-width] function computes the width of the rendered world, given the world's size by finding the center of the rightmost posn, and then adding an additional radius. @@ -1009,7 +1009,7 @@ and then adding an additional radius. (make-posn (- board-size 1) (- board-size 2))]) (+ (cell-center-x rightmost-posn) circle-radius)))] -Similarly, the @scheme[world-height] function computest the +Similarly, the @racket[world-height] function computest the height of the rendered world, given the world's size. @chunk[ @@ -1020,12 +1020,12 @@ height of the rendered world, given the world's size. (ceiling (+ (cell-center-y bottommost-posn) circle-radius))))] -The @scheme[cell-center-x] function returns the +The @racket[cell-center-x] function returns the @tt{x} coordinate of the center of the cell specified -by @scheme[p]. +by @racket[p]. For example, the first cell in -the third row (counting from @scheme[0]) is +the third row (counting from @racket[0]) is flush with the edge of the screen, so its center is just the radius of the circle that is drawn. @@ -1037,20 +1037,20 @@ is drawn. The first cell in the second row, in contrast is offset from the third row by -@scheme[circle-spacing]. +@racket[circle-spacing]. @chunk[ (test (cell-center-x (make-posn 0 1)) (+ circle-spacing circle-radius))] -The definition of @scheme[cell-center-x] -multiplies the @scheme[x] coordinate of -@scheme[p] by twice @scheme[circle-spacing] -and then adds @scheme[circle-radius] to move +The definition of @racket[cell-center-x] +multiplies the @racket[x] coordinate of +@racket[p] by twice @racket[circle-spacing] +and then adds @racket[circle-radius] to move over for the first circle. In addition -if the @scheme[y] coordinate is odd, then -it adds @scheme[circle-spacing], shifting +if the @racket[y] coordinate is odd, then +it adds @racket[circle-spacing], shifting the entire line over. @chunk[ @@ -1064,9 +1064,9 @@ the entire line over. circle-spacing 0))))] -The @scheme[cell-center-y] function computes the -@scheme[y] coordinate of a cell's location on -the screen. For example, the @scheme[y] +The @racket[cell-center-y] function computes the +@racket[y] coordinate of a cell's location on +the screen. For example, the @racket[y] coordinate of the first row is the radius of a circle, ensuring that the first row is flush against the top of @@ -1076,10 +1076,10 @@ the screen. (test (cell-center-y (make-posn 1 0)) circle-radius)] -Because the grid is hexagonal, the @scheme[y] coordinates -of the rows do not have the same spacing as the @scheme[x] +Because the grid is hexagonal, the @racket[y] coordinates +of the rows do not have the same spacing as the @racket[x] coordinates. In particular, they are off by -@tt{sin(pi/3)}. We approximate that by @scheme[866/1000] +@tt{sin(pi/3)}. We approximate that by @racket[866/1000] in order to keep the computations and test cases simple and using exact numbers. A more precise approximation would be @@ -1123,7 +1123,7 @@ plus various helper functions. ] -The @scheme[change] function handles keyboard input. If the input is @litchar{n} and the +The @racket[change] function handles keyboard input. If the input is @litchar{n} and the game is over, then restart the game. If the input is @litchar{h} then turn on the help and otherwise do nothing. @@ -1144,7 +1144,7 @@ and otherwise do nothing. #t)] [else w]))] -The @scheme[release] function adjusts the world for a key release event. +The @racket[release] function adjusts the world for a key release event. @chunk[ ;; release : world key-event -> world @@ -1159,15 +1159,15 @@ The @scheme[release] function adjusts the world for a key release event. (world-h-down? w))))] -The @scheme[clack] function handles mouse input. It has three tasks and each corresponds +The @racket[clack] function handles mouse input. It has three tasks and each corresponds to a helper function: @itemize[ -@item{block the clicked cell (@scheme[block-cell/world]),} -@item{move the cat (@scheme[move-cat]), and} -@item{update the black dot as the mouse moves around (@scheme[update-world-posn]).}] -The helper functions are combined in the body of @scheme[clack], +@item{block the clicked cell (@racket[block-cell/world]),} +@item{move the cat (@racket[move-cat]), and} +@item{update the black dot as the mouse moves around (@racket[update-world-posn]).}] +The helper functions are combined in the body of @racket[clack], first checking to see if the mouse event corresponds to a -player's move (via the @scheme[player-moved?] function. +player's move (via the @racket[player-moved?] function. @chunk[ (define/contract (clack world x y evt) @@ -1187,12 +1187,12 @@ player's move (via the @scheme[player-moved?] function. (not (equal? evt "leave")) (make-posn x y)))))] -The @scheme[player-moved?] predicate returns -a @scheme[posn] indicating where the player chose +The @racket[player-moved?] predicate returns +a @racket[posn] indicating where the player chose to move when the mouse event corresponds to a player move, -and returns @scheme[#f]. It first checks to see if the +and returns @racket[#f]. It first checks to see if the mouse event is a button up event and that the game -is not over, and then it just calls @scheme[circle-at-point]. +is not over, and then it just calls @racket[circle-at-point]. @chunk[ (define/contract (player-moved? world x y evt) @@ -1202,11 +1202,11 @@ is not over, and then it just calls @scheme[circle-at-point]. (equal? 'playing (world-state world)) (circle-at-point (world-board world) x y)))] -The @scheme[circle-at-point] function returns a @scheme[posn] when -the coordinate (@scheme[x],@scheme[y]) is inside an unblocked circle +The @racket[circle-at-point] function returns a @racket[posn] when +the coordinate (@racket[x],@racket[y]) is inside an unblocked circle on the given board. Instead of computing the nearest circle to the coordinates, it simply iterates over the cells on the -board and returns the @scheme[posn] of the matching cell. +board and returns the @racket[posn] of the matching cell. @chunk[ (define/contract (circle-at-point board x y) @@ -1219,9 +1219,9 @@ board and returns the @scheme[posn] of the matching cell. board))] -The @scheme[point-in-this-circle?] function returns @scheme[#t] -when the point (@scheme[x],@scheme[y]) on the screen -falls within the circle located at the @scheme[posn] @scheme[p]. +The @racket[point-in-this-circle?] function returns @racket[#t] +when the point (@racket[x],@racket[y]) on the screen +falls within the circle located at the @racket[posn] @racket[p]. This is precise about checking the circles. For example, a point that is (14,14) away from the center of a circle @@ -1245,15 +1245,15 @@ since it crosses the boundary away from a circle of radius (+ (cell-center-y (make-posn 1 0)) 15)) #f)] -The implementation of @scheme[point-in-this-circle?] uses +The implementation of @racket[point-in-this-circle?] uses complex numbers to represent both points on the screen and directional vectors. In particular, the -variable @scheme[center] is a complex number whose +variable @racket[center] is a complex number whose real part is the @tt{x} coordinate of the center of -the cell at @scheme[p], and its imaginary part is -@tt{y} coordinate. Similarly, @scheme[mp] is bound +the cell at @racket[p], and its imaginary part is +@tt{y} coordinate. Similarly, @racket[mp] is bound to a complex number corresponding to the position of -the mouse, at (@scheme[x], @scheme[y]). Then, the +the mouse, at (@racket[x], @racket[y]). Then, the function computes the vector between the two points by subtracting the complex numbers from each other and extracting the magnitude from that vector. @@ -1268,9 +1268,9 @@ other and extracting the magnitude from that vector. (<= (magnitude (- center mp)) circle-radius)))] -In the event that @scheme[player-moved?] returns a @scheme[posn], -the @scheme[clack] function blocks the clicked on cell using -@scheme[block-cell/world], which simply calls @scheme[block-cell]. +In the event that @racket[player-moved?] returns a @racket[posn], +the @racket[clack] function blocks the clicked on cell using +@racket[block-cell/world], which simply calls @racket[block-cell]. @chunk[ (define/contract (block-cell/world to-block w) @@ -1282,12 +1282,12 @@ the @scheme[clack] function blocks the clicked on cell using (world-mouse-posn w) (world-h-down? w)))] -The @scheme[move-cat] function uses calls @scheme[build-bfs-table] +The @racket[move-cat] function uses calls @racket[build-bfs-table] to find the shortest distance from all of the cells to the boundary, -and then uses @scheme[find-best-positions] to compute the +and then uses @racket[find-best-positions] to compute the list of neighbors of the cat that have the shortest distance -to the boundary. If that list is empty, then @scheme[next-cat-position] -is @scheme[#f], and otherwise, it is a random element from that list. +to the boundary. If that list is empty, then @racket[next-cat-position] +is @racket[#f], and otherwise, it is a random element from that list. @chunk[ (define/contract (move-cat world) @@ -1308,7 +1308,7 @@ is @scheme[#f], and otherwise, it is a random element from that list. ))] -Once @scheme[next-cat-position] has been computed, it is used to update +Once @racket[next-cat-position] has been computed, it is used to update the @tt{cat} and @tt{state} fields of the world, recording the cat's new position and whether or not the cat won. @@ -1329,13 +1329,13 @@ position and whether or not the cat won. (world-h-down? world))] -The @scheme[find-best-positions] function accepts -two parallel lists, one of @scheme[posn]s, and one -of scores for those @scheme[posn]s, and it -returns either a non-empty list of @scheme[posn]s +The @racket[find-best-positions] function accepts +two parallel lists, one of @racket[posn]s, and one +of scores for those @racket[posn]s, and it +returns either a non-empty list of @racket[posn]s that have tied for the best score, or it -returns @scheme[#f], if the best score is -@scheme['∞]. +returns @racket[#f], if the best score is +@racket['∞]. @chunk[ (define/contract (find-best-positions posns scores) @@ -1358,8 +1358,8 @@ returns @scheme[#f], if the best score is (map list scores posns)))])))] This is a helper function that behaves like -@scheme[<=], but is extended to deal properly with -@scheme['∞]. +@racket[<=], but is extended to deal properly with +@racket['∞]. @chunk[ (define/contract (<=/f a b) @@ -1372,13 +1372,13 @@ This is a helper function that behaves like [else (<= a b)]))] -Finally, to complete the mouse event handling, the @scheme[update-world-posn] -function is called from @scheme[clack]. It updates the @tt{mouse-down} -field of the @scheme[world]. If the @scheme[p] argument is a @scheme[posn], +Finally, to complete the mouse event handling, the @racket[update-world-posn] +function is called from @racket[clack]. It updates the @tt{mouse-down} +field of the @racket[world]. If the @racket[p] argument is a @racket[posn], it corresponds to the location of the mouse, in graphical coordinates. So, the function converts it to a cell position on the board and uses that. -Otherwise, when @scheme[p] is @scheme[#f], the @tt{mouse-down} field -is just updated to @scheme[#f]. +Otherwise, when @racket[p] is @racket[#f], the @tt{mouse-down} field +is just updated to @racket[#f]. @chunk[ (define/contract (update-world-posn w p) @@ -1415,11 +1415,11 @@ This section consists of some infrastructure for maintaining tests, plus a pile of additional tests for the other functions in this document. -The @scheme[test] and @scheme[test/set] macros +The @racket[test] and @racket[test/set] macros package up their arguments into thunks and then -simply call @scheme[test/proc], supplying +simply call @racket[test/proc], supplying information about the source location of the test -case. The @scheme[test/proc] function runs the tests +case. The @racket[test/proc] function runs the tests and reports the results. @chunk[ @@ -2391,7 +2391,7 @@ First, here is a function to compute state of the world at the start of a game. #f))] Finally, we can define and provide a function to start the game -by calling @scheme[big-bang] with the appropriate arguments. +by calling @racket[big-bang] with the appropriate arguments. @chunk[ (provide main) diff --git a/collects/games/gl-board-game/gl-board-game.scrbl b/collects/games/gl-board-game/gl-board-game.scrbl index f321831dcf..0808183c27 100644 --- a/collects/games/gl-board-game/gl-board-game.scrbl +++ b/collects/games/gl-board-game/gl-board-game.scrbl @@ -21,81 +21,81 @@ [move (any/c gl-vector? . -> . any) void] [who string? "this game"])]{ -The @scheme[min-x], @scheme[max-x], @scheme[min-y], and @scheme[max-y] +The @racket[min-x], @racket[max-x], @racket[min-y], and @racket[max-y] arguments specify the dimensions of the board plane to be visible in the window by default. -The @scheme[lift] argument specifies how many units a piece moves +The @racket[lift] argument specifies how many units a piece moves vertically when the user clicks on it. -The @scheme[move] function is called when a piece is moved to a space +The @racket[move] function is called when a piece is moved to a space (possibly it's current space), when a space is clicked on, and when a -space is dragged to another space. The @scheme[move] function is +space is dragged to another space. The @racket[move] function is given the information of the piece or space selected and the coordinates to which it is moved. -The @scheme[who] argument is used for reporting an error to the user +The @racket[who] argument is used for reporting an error to the user when GL is unavailable at run time.} @defmethod[(add-space [draw (-> any)] [info any/c]) void?]{ -Adds a space to the board. The @scheme[draw] thunk should draw the -space (using GL commands) when called. The @scheme[info] value is -given to the @scheme[_move] function (supplied to the constructor) +Adds a space to the board. The @racket[draw] thunk should draw the +space (using GL commands) when called. The @racket[info] value is +given to the @racket[_move] function (supplied to the constructor) when the space is selected.} @defmethod[(add-piece [x real?][y real?][z real?] [draw ([shadow? boolean?] . -> . any)] [info any/c]) void?]{ -Adds a piece to the board. The @scheme[draw] thunk should draw the -piece (using GL commands) when called. The @scheme[info] argument is -given to the @scheme[_move] function (supplied to the constructor) -when the piece is moved. The piece is translated by @scheme[x], -@scheme[y], and @scheme[z] before drawing.} +Adds a piece to the board. The @racket[draw] thunk should draw the +piece (using GL commands) when called. The @racket[info] argument is +given to the @racket[_move] function (supplied to the constructor) +when the piece is moved. The piece is translated by @racket[x], +@racket[y], and @racket[z] before drawing.} @defmethod[(remove-piece [info any/c]) void?]{ -Removes all pieces previously added with representative @scheme[info].} +Removes all pieces previously added with representative @racket[info].} @defmethod[(add-heads-up [w real?] [h real?] [draw (-> any)] [info any/c]) void?]{ -Add a ``heads-up'' display element whose size is @scheme[w] by -@scheme[h] units with the given @scheme[draw] thunk and @scheme[info] +Add a ``heads-up'' display element whose size is @racket[w] by +@racket[h] units with the given @racket[draw] thunk and @racket[info] reprsentative.} @defmethod[(remove-heads-up [info any/c]) void?]{ Removes all ``heads-up'' displays elements previous added with -representative @scheme[info].} +representative @racket[info].} @defmethod[(set-space-draw [info any/c] [draw (-> any)]) void?]{ Sets the drawing function of all spaces added with -representative @scheme[info].} +representative @racket[info].} @defmethod[(set-piece-draw [info any/c] [draw ([shadow? boolean?] . -> . any)]) void?]{ Sets the drawing function of all pieces added with -representative @scheme[info].} +representative @racket[info].} @defmethod[(enable-piece [info any/c][can-move? any/c]) void?]{ Enables or disables moving of all pieces added with -representative @scheme[info].} +representative @racket[info].} @defmethod[(enabled? [info any/c]) boolean?]{ -reports whether the first piece with representative @scheme[info] is enabled.} +reports whether the first piece with representative @racket[info] is enabled.} @@ -105,7 +105,7 @@ reports whether the first piece with representative @scheme[info] is enabled.} [(get-heads-up) list?])]{ Returns values for various kinds of content currently on the -board. The result corresponds to @scheme[_info] values given to -@scheme[add-piece], etc.} +board. The result corresponds to @racket[_info] values given to +@racket[add-piece], etc.} } diff --git a/collects/games/scribblings/checkers.scrbl b/collects/games/scribblings/checkers.scrbl index 83d69f2979..b8e9cf1fa2 100644 --- a/collects/games/scribblings/checkers.scrbl +++ b/collects/games/scribblings/checkers.scrbl @@ -4,4 +4,4 @@ @gametitle["Checkers" "checkers" "Board Game"] This simple checkers game (with no AI player) is intended as a -demonstration use of the @schememodname[games/gl-board-game] library. +demonstration use of the @racketmodname[games/gl-board-game] library. diff --git a/collects/games/scribblings/games.scrbl b/collects/games/scribblings/games.scrbl index fcd4a9d1ff..508fb1b0be 100644 --- a/collects/games/scribblings/games.scrbl +++ b/collects/games/scribblings/games.scrbl @@ -22,33 +22,33 @@ installed as sub-collections of the @filepath{games} collection (see The game-starting console inspects the sub-collections of the @filepath{games} collection. If a sub-collection has an -@filepath{info.rkt} module (see @schememodname[setup/infotab]), the +@filepath{info.rkt} module (see @racketmodname[setup/infotab]), the following fields of the collection's @filepath{info.rkt} file are used: @itemize[ - @item{@schemeidfont{game} [required] : used as a module name in the + @item{@racketidfont{game} [required] : used as a module name in the sub-collection to load for the game; the module must provide a - @schemeidfont["game@"] unit (see @schememodname[scheme/unit]) with + @racketidfont["game@"] unit (see @racketmodname[scheme/unit]) with no particular exports; the unit is invoked with no imports to start the game.} - @item{@schemeidfont{name} [defaults to the collection name] : used to + @item{@racketidfont{name} [defaults to the collection name] : used to label the game-starting button in the game console.} - @item{@schemeidfont{game-icon} [defaults to collection name with + @item{@racketidfont{game-icon} [defaults to collection name with @filepath{.png}] : used as a path to a bitmap file that is used for the game button's label; this image should be 32 by 32 pixels and have a mask.} - @item{@schemeidfont{game-set} [defaults to @scheme["Other Games"]] : + @item{@racketidfont{game-set} [defaults to @racket["Other Games"]] : a label used to group games that declare themselves to be in the same set.} ] -To implement card games, see @schememodname[games/cards]. Card games -typically belong in the @scheme["Cards"] game set. +To implement card games, see @racketmodname[games/cards]. Card games +typically belong in the @racket["Cards"] game set. @; ---------------------------------------------------------------------- @@ -62,8 +62,8 @@ typically belong in the @scheme["Cards"] game set. (-> void?)]{ Returns a thunk for opening a Scribbled section in the user's HTML -browser. The @scheme[mod-path] is the document's main source module, -and @scheme[section-tag] specifies the section in the document.} +browser. The @racket[mod-path] is the document's main source module, +and @racket[section-tag] specifies the section in the document.} @; ---------------------------------------------------------------------- @@ -81,11 +81,11 @@ text. Multiple invocations of the thunk bring the same window to the foreground (until the user closes the window). The help window displays @filepath{doc.txt} from the collection -specified by @scheme[coll-path]. +specified by @racket[coll-path]. -The @scheme[frame-title] argument is used for the help window title. +The @racket[frame-title] argument is used for the help window title. -If @scheme[verbatim?] is true, then @filepath{doc.txt} is displayed +If @racket[verbatim?] is true, then @filepath{doc.txt} is displayed verbatim, otherwise it is formatted as follows: @itemize[ diff --git a/collects/graphics/scribblings/traditional-turtles.scrbl b/collects/graphics/scribblings/traditional-turtles.scrbl index 130876657e..d8e6194622 100644 --- a/collects/graphics/scribblings/traditional-turtles.scrbl +++ b/collects/graphics/scribblings/traditional-turtles.scrbl @@ -112,12 +112,12 @@ The fern functions below demonstrate more advanced use of @defproc[(save-turtle-bitmap [name (or/c path-string? output-port?)] [kind (or/c 'png 'jpeg 'xbm 'xpm 'bmp)]) void?]{ - Saves the current state of the turtles window in an image file. + Saves the current state of the turtles window in an image file. } - + @defthing[turtle-window-size exact-positive-integer?]{ - The size of the turtles window. -} + The size of the turtles window. +} @; ---------------------------------------- @@ -215,7 +215,7 @@ Calls @racket[lorenze] with good initial values.} } @defthing[peano-size exact-nonnegative-integer?]{ - One size to use with @racket[peano]. + One size to use with @racket[peano]. } @defthing[fern-size exact-nonnegative-integer?]{ diff --git a/collects/graphics/scribblings/value-turtles.scrbl b/collects/graphics/scribblings/value-turtles.scrbl index 8af9fed4b6..e2ee7c396f 100644 --- a/collects/graphics/scribblings/value-turtles.scrbl +++ b/collects/graphics/scribblings/value-turtles.scrbl @@ -26,9 +26,9 @@ initial turtle and the direction in radians (where @racket[0] is to the right).} @defproc[(turtles? [v any/c]) boolean?]{ - Determines if @racket[v] is a turtles drawing. + Determines if @racket[v] is a turtles drawing. } - + @defproc[(move [n real?] [turtles turtles?]) turtles?]{ Moves the turtle @racket[n] pixels, returning a new turtles window.} @@ -108,7 +108,7 @@ same direction as the original turtle.} [radius real?] [turtles turtles?]) turtles?]{ - + Draws a regular poly centered at the turtle with @racket[sides] sides and with radius @racket[radius].} diff --git a/collects/htdp/htdp.scrbl b/collects/htdp/htdp.scrbl index 4cabe86606..993d20fe29 100644 --- a/collects/htdp/htdp.scrbl +++ b/collects/htdp/htdp.scrbl @@ -62,14 +62,14 @@ provides several functions: The library re-exports the following identifiers from test-engine/scheme-tests: - @scheme[build-test-engine] - @scheme[builder] - @scheme[display-results] - @scheme[error-handler] - @scheme[exn:fail:wish] - @scheme[generate-report] - @scheme[get-test-engine] - @scheme[reset-tests] - @scheme[run-tests] - @scheme[scheme-test-data] - @scheme[signature-test-info%] + @racket[build-test-engine] + @racket[builder] + @racket[display-results] + @racket[error-handler] + @racket[exn:fail:wish] + @racket[generate-report] + @racket[get-test-engine] + @racket[reset-tests] + @racket[run-tests] + @racket[scheme-test-data] + @racket[signature-test-info%] diff --git a/collects/html/html.scrbl b/collects/html/html.scrbl index 8d3115d236..022983b6ea 100644 --- a/collects/html/html.scrbl +++ b/collects/html/html.scrbl @@ -40,7 +40,7 @@ Reads HTML from a port, producing an @xexpr compatible with the other elements. For example, the top-level @racket[""] element may only contain a @racket[""] and @racket[""] element. Defaults to @racket[#f]. -} +} @section{Example} @(require (only-in (for-label racket) diff --git a/collects/lang/htdp-lib.scrbl b/collects/lang/htdp-lib.scrbl index bdae269eee..eb6bd4e8ef 100644 --- a/collects/lang/htdp-lib.scrbl +++ b/collects/lang/htdp-lib.scrbl @@ -19,7 +19,7 @@ @defmodule[lang/htdp-beginner] -The @schememodname[lang/htdp-beginner] module provides the Beginning +The @racketmodname[lang/htdp-beginner] module provides the Beginning Student language for @|htdp|; see @htdp-ref["beginner"]. @; ------------------------------------------------------------ @@ -27,7 +27,7 @@ Student language for @|htdp|; see @htdp-ref["beginner"]. @defmodule[lang/htdp-beginner-abbr] -The @schememodname[lang/htdp-beginner-abbr] module provides the +The @racketmodname[lang/htdp-beginner-abbr] module provides the Beginning Student with Abbreviations language for @|htdp|; see @htdp-ref["beginner-abbr"]. @@ -36,7 +36,7 @@ Beginning Student with Abbreviations language for @|htdp|; see @defmodule[lang/htdp-intermediate] -The @schememodname[lang/htdp-intermediate] module provides the +The @racketmodname[lang/htdp-intermediate] module provides the Intermediate Student language for @|htdp|; see @htdp-ref["intermediate"]. @@ -45,7 +45,7 @@ Intermediate Student language for @|htdp|; see @defmodule[lang/htdp-intermediate-lambda] -The @schememodname[lang/htdp-intermediate-lambda] module provides the +The @racketmodname[lang/htdp-intermediate-lambda] module provides the Intermediate Student with Lambda language for @|htdp|; see @htdp-ref["intermediate-lam"]. @@ -54,7 +54,7 @@ Intermediate Student with Lambda language for @|htdp|; see @defmodule[lang/htdp-advanced] -The @schememodname[lang/htdp-advanced] module provides the Advanced +The @racketmodname[lang/htdp-advanced] module provides the Advanced Student language for @|htdp|; see @htdp-ref["advanced"]. @; ------------------------------------------------------------ @@ -62,17 +62,17 @@ Student language for @|htdp|; see @htdp-ref["advanced"]. @defmodule[lang/plt-pretty-big-text] -The @schememodname[lang/plt-pretty-big-text] module is similar to the +The @racketmodname[lang/plt-pretty-big-text] module is similar to the @italic{HtDP} Advanced Student language, but with more of Racket's libraries in legacy form. It provides the bindings of -@schememodname[mzscheme], -@schememodname[mzlib/etc], @schememodname[mzlib/file], -@schememodname[mzlib/list], @schememodname[mzlib/class], -@schememodname[mzlib/unit], @schememodname[mzlib/include], -@schememodname[mzlib/defmacro], @schememodname[mzlib/pretty], -@schememodname[mzlib/string], @schememodname[mzlib/thread], -@schememodname[mzlib/math], @schememodname[mzlib/match], -@schememodname[mzlib/shared], and @schememodname[lang/posn]. +@racketmodname[mzscheme], +@racketmodname[mzlib/etc], @racketmodname[mzlib/file], +@racketmodname[mzlib/list], @racketmodname[mzlib/class], +@racketmodname[mzlib/unit], @racketmodname[mzlib/include], +@racketmodname[mzlib/defmacro], @racketmodname[mzlib/pretty], +@racketmodname[mzlib/string], @racketmodname[mzlib/thread], +@racketmodname[mzlib/math], @racketmodname[mzlib/match], +@racketmodname[mzlib/shared], and @racketmodname[lang/posn]. @; ------------------------------------------------------------ @@ -80,21 +80,21 @@ libraries in legacy form. It provides the bindings of @defmodule[lang/plt-pretty-big] -The @schememodname[lang/plt-pretty-big] module extends -@scheme[lang/plt-pretty-big-text] with @schememodname[scheme/gui/base] -and @schememodname[lang/imageeq]. This language corresponds to the +The @racketmodname[lang/plt-pretty-big] module extends +@racket[lang/plt-pretty-big-text] with @racketmodname[scheme/gui/base] +and @racketmodname[lang/imageeq]. This language corresponds to the @onscreen{Pretty Big} legacy language in DrRacket. @; ---------------------------------------------------------------------- -@section{@scheme[posn]s in @italic{HtDP} Languages} +@section{@racket[posn]s in @italic{HtDP} Languages} @defmodule[lang/posn] @defstruct[posn ([x any/c] [y any/c])]{ -The @scheme[posn] structure type that is also provided by -@scheme[lang/htdp-beginner].} +The @racket[posn] structure type that is also provided by +@racket[lang/htdp-beginner].} @; ---------------------------------------------------------------------- @@ -108,7 +108,7 @@ The @scheme[posn] structure type that is also provided by boolean?]{ The image-comparison operator that is also provided by -@scheme[lang/htdp-beginner].} +@racket[lang/htdp-beginner].} @; ---------------------------------------------------------------------- @@ -116,7 +116,7 @@ The image-comparison operator that is also provided by @defmodule[lang/prim] -The @schememodname[lang/prim] module several syntactic forms for +The @racketmodname[lang/prim] module several syntactic forms for use by the implementors of teachpacks, when the teachpack is to be used with the @|htdp| Beginner Student languages. In Beginner Student, primitive names (for built-in @@ -125,49 +125,49 @@ they can be syntactically restricted to application positions. @defform[(define-primitive id proc-id)]{ - Defines @scheme[id] to be a primitive operator whose implementation - is @scheme[proc-id], and that takes no procedures as - arguments. Normally, @scheme[id] is exported from the teachpack and - @scheme[proc-id] is not.} + Defines @racket[id] to be a primitive operator whose implementation + is @racket[proc-id], and that takes no procedures as + arguments. Normally, @racket[id] is exported from the teachpack and + @racket[proc-id] is not.} @defform[(provide-primitive id)]{ - Like @scheme[define-primitive], but the existing function @scheme[id] is - exported as the primitive operator named @scheme[id]. An alternative - to @scheme[define-primitive].} + Like @racket[define-primitive], but the existing function @racket[id] is + exported as the primitive operator named @racket[id]. An alternative + to @racket[define-primitive].} @defform[(provide-primitives id ...)]{ - Multiple-identifier version of @scheme[provide-primitive].} + Multiple-identifier version of @racket[provide-primitive].} @defform[(define-higher-order-primitive id proc-id (arg ...))]{ - Defines @scheme[id] to be a primitive operator whose implementation is - @scheme[proc-id]. Normally, @scheme[id] is exported from the teachpack and - @scheme[proc-id] is not. + Defines @racket[id] to be a primitive operator whose implementation is + @racket[proc-id]. Normally, @racket[id] is exported from the teachpack and + @racket[proc-id] is not. - For each non-procedure argument, the corresponding @scheme[arg] should be - an underscore. For each procedure argument, the corresponding @scheme[arg] + For each non-procedure argument, the corresponding @racket[arg] should be + an underscore. For each procedure argument, the corresponding @racket[arg] should be the usual name of the procedure. @as-examples[ - @schemeblock[ + @racketblock[ (define-higher-order-primitive convert-gui convert-gui/proc (f2c)) ]] } @defform[(provide-higher-order-primitive id (arg ...))]{ - Like @scheme[define-higher-order-primitive], but the existing function - @scheme[id] is exported as the primitive operator named - @scheme[id]. An alternative to @scheme[define-higher-order-primitive].} + Like @racket[define-higher-order-primitive], but the existing function + @racket[id] is exported as the primitive operator named + @racket[id]. An alternative to @racket[define-higher-order-primitive].} @defform[(first-order->higher-order expr)]{ -If @scheme[expr] is an identifier for a first-order function (either a +If @racket[expr] is an identifier for a first-order function (either a primitive or a function defined within Beginner Student), produces the function as a value; otherwise, the form is equivalent to -@scheme[expr]. +@racket[expr]. This form is mainly useful for implementing syntactic forms that, like the application of a higher-order primitive, allow first-order bindings diff --git a/collects/lazy/lazy.scrbl b/collects/lazy/lazy.scrbl index db0769a987..7158757eb1 100644 --- a/collects/lazy/lazy.scrbl +++ b/collects/lazy/lazy.scrbl @@ -42,22 +42,22 @@ Lazy Racket is available as both a language level and a module that can be used to write lazy code. To write lazy code, simply use -@schememodname[lazy] as your module's language: +@racketmodname[lazy] as your module's language: -@schememod[ +@racketmod[ lazy ... @#,elem{lazy code here}...] Function applications are delayed, and promises are automatically forced. The language provides bindings that are equivalent to most of -the @schememodname[mzscheme] and @schememodname[scheme/list] +the @racketmodname[mzscheme] and @racketmodname[scheme/list] libraries. Primitives are strict in the expected places; struct -constructors are lazy; @scheme[if], @scheme[and], @scheme[or] @|etc| +constructors are lazy; @racket[if], @racket[and], @racket[or] @|etc| are plain (lazy) functions. Strict functionality is provided as-is: -@scheme[begin], I/O, mutation, parameterization, etc. To have your -code make sense, you should chain side effects in @scheme[begin]s, +@racket[begin], I/O, mutation, parameterization, etc. To have your +code make sense, you should chain side effects in @racket[begin]s, which will sequence things properly. (Note: This is similar to -threading monads through your code---only use @scheme[begin] where +threading monads through your code---only use @racket[begin] where order matters.) Mixing lazy and strict code is simple: you just write the lazy code in @@ -67,11 +67,11 @@ as strict, and on the strict side you only need to force (possibly recursively) through promises. A few side-effect bindings are provided as-is. For example, -@scheme[read] and @scheme[printf] do the obvious thing---but note that +@racket[read] and @racket[printf] do the obvious thing---but note that the language is a call-by-need, and you need to be aware when promises -are forced. There are also bindings for @scheme[begin] (delays a -computation that forces all sub-expressions), @scheme[when], -@scheme[unless], etc. There are, however, less reliable and might +are forced. There are also bindings for @racket[begin] (delays a +computation that forces all sub-expressions), @racket[when], +@racket[unless], etc. There are, however, less reliable and might change (or be dropped) in the future. There are a few additional bindings, the important ones are special @@ -133,30 +133,30 @@ input arguments in order.} @defmodule[lazy/force] -The bindings of @schememodname[lazy/force] are re-provided by -@schememodname[lazy]. +The bindings of @racketmodname[lazy/force] are re-provided by +@racketmodname[lazy]. @defproc[(! [expr any/c]) any/c]{ -Evaluates @scheme[expr] strictly. The result is always forced, over +Evaluates @racket[expr] strictly. The result is always forced, over and over until it gets a non-promise value.} -@defproc[(!![expr any/c]) any/c]{ +@defproc[(!! [expr any/c]) any/c]{ -Similar to @scheme[!], but recursively forces a structure (e.g: +Similar to @racket[!], but recursively forces a structure (e.g: lists).} @defproc[(!list [expr (or/c promise? list?)]) list?]{ -Forces the @scheme[expr] which is expected to be a list, and forces -the @scheme[cdr]s recursively to expose a proper list structure.} +Forces the @racket[expr] which is expected to be a list, and forces +the @racket[cdr]s recursively to expose a proper list structure.} @defproc[(!!list [expr (or/c promise? list?)]) list?]{ -Similar to @scheme[!list] but also forces (using @scheme[!]) the +Similar to @racket[!list] but also forces (using @racket[!]) the elements of the list.} @@ -166,7 +166,7 @@ elements of the list.} To avoid dealing with multiple values, they are treated as a single tuple in the lazy language. This is implemented as a -@scheme[multiple-values] struct, with a @scheme[values] slot. +@racket[multiple-values] struct, with a @racket[values] slot. @defproc[(split-values [x multiple-values?]) any]{ @@ -176,12 +176,12 @@ in the future.)} @defproc[(!values [expr (or/c promise? multiple-values?)]) any]{ -Forces @scheme[expr] and uses @scheme[split-values] on the result.} +Forces @racket[expr] and uses @racket[split-values] on the result.} @defproc[(!!values [expr (or/c promise? multiple-values?)]) any]{ -Similar to @scheme[!values], but forces each of the values +Similar to @racket[!values], but forces each of the values recursively.} ;} diff --git a/collects/macro-debugger/macro-debugger.scrbl b/collects/macro-debugger/macro-debugger.scrbl index f4a67d923a..eb135d6fe9 100644 --- a/collects/macro-debugger/macro-debugger.scrbl +++ b/collects/macro-debugger/macro-debugger.scrbl @@ -52,7 +52,7 @@ stepping through the expansion. @defmodule[macro-debugger/expand] -This module provides @scheme[expand]-like procedures that allow the +This module provides @racket[expand]-like procedures that allow the user to specify macros whose expansions should be hidden. Warning: because of limitations in the way macro expansion is @@ -62,8 +62,8 @@ result as the original syntax. @defproc[(expand-only [stx any/c] [transparent-macros (listof identifier?)]) syntax?]{ - Expands the given syntax @scheme[stx], but only shows the expansion - of macros whose names occur in @scheme[transparent-macros]. + Expands the given syntax @racket[stx], but only shows the expansion + of macros whose names occur in @racket[transparent-macros]. @(examples #:eval the-eval (syntax->datum @@ -75,7 +75,7 @@ result as the original syntax. @defproc[(expand/hide [stx any/c] [hidden-macros (listof identifier?)]) syntax?]{ - Expands the given syntax @scheme[stx], but hides the expansion of macros in the + Expands the given syntax @racket[stx], but hides the expansion of macros in the given identifier list (conceptually, the complement of expand-only). @(examples #:eval the-eval @@ -87,8 +87,8 @@ result as the original syntax. @defproc[(expand/show-predicate [stx any/c] [show? (-> identifier? boolean?)]) syntax?]{ - Expands the given syntax @scheme[stx], but only shows the expansion of macros - whose names satisfy the predicate @scheme[show?]. + Expands the given syntax @racket[stx], but only shows the expansion of macros + whose names satisfy the predicate @racket[show?]. @(examples #:eval the-eval (syntax->datum @@ -116,12 +116,12 @@ the macro's context. The remark is only displayed if the macro that emits it is considered transparent by the hiding policy. By default, syntax objects in remarks have the transformer's mark -applied (using @scheme[syntax-local-introduce]) so that their +applied (using @racket[syntax-local-introduce]) so that their appearance in the macro stepper matches their appearance after the -transformer returns. Unmarking is suppressed if @scheme[unmark?] is -@scheme[#f]. +transformer returns. Unmarking is suppressed if @racket[unmark?] is +@racket[#f]. -@schemeblock[ +@racketblock[ (define-syntax (mymac stx) (syntax-case stx () [(_ x y) @@ -141,9 +141,9 @@ transformer returns. Unmarking is suppressed if @scheme[unmark?] is void?]{ Emits an event that simulates a local expansion step from -@scheme[before] to @scheme[after]. +@racket[before] to @racket[after]. -The @scheme[id] argument acts as the step's ``macro'' for the purposes +The @racket[id] argument acts as the step's ``macro'' for the purposes of macro hiding. } @@ -178,8 +178,8 @@ of macro hiding. (symbol? -> void?)]{ Returns a procedure that can be called on the symbol - @scheme['next] to print the next step or on the symbol - @scheme['all] to print out all remaining steps. + @racket['next] to print the next step or on the symbol + @racket['all] to print out all remaining steps. } @@ -197,7 +197,7 @@ of macro hiding. @defproc[(browse-syntaxes [stxs (listof syntax?)]) void?]{ - Like @scheme[browse-syntax], but shows multiple syntax objects in + Like @racket[browse-syntax], but shows multiple syntax objects in the same frame. The coloring partitions are shared between the two, showing the relationships between subterms in different syntax objects. @@ -270,7 +270,7 @@ syntax may be original, or it may be produced by the expansion of a nonhygienic macro. Note: even terms that have the same marks might not be -@scheme[bound-identifier=?] to each other, because they might occur in +@racket[bound-identifier=?] to each other, because they might occur in different environments. @;@example[(bound-identifier=? (let ([x 1]) #'x) #'x)] @@ -284,8 +284,8 @@ selected term are highlighted in yellow. The available secondary partitionings are: @itemize[ -@item{@scheme[bound-identifier=?]} -@item{@scheme[free-identifier=?]} +@item{@racket[bound-identifier=?]} +@item{@racket[free-identifier=?]} ] @subsection{Properties} @@ -298,12 +298,12 @@ selected syntax object. The properties pane has two tabbed pages: If the selection is an identifier, shows the binding information associated with the syntax object. For more information, see - @scheme[identifier-binding], etc. + @racket[identifier-binding], etc. } @item{@bold{Syntax Object}: Displays source location information and other properties (see - @scheme[syntax-property]) carried by the syntax object. + @racket[syntax-property]) carried by the syntax object. } ] diff --git a/collects/make/make.scrbl b/collects/make/make.scrbl index 33fbaa6a3d..46f602161a 100644 --- a/collects/make/make.scrbl +++ b/collects/make/make.scrbl @@ -9,7 +9,7 @@ @title{@bold{Make}: Dependency Manager} -The @schememodname[make] library provides a Racket version of the +The @racketmodname[make] library provides a Racket version of the popular @exec{make} utility. Its syntax is intended to imitate the syntax of @exec{make}, only in Racket. @@ -24,7 +24,7 @@ dependency tracking, just use @exec{raco make} as described in @|raco-manual|.} If you are already familiar with @exec{make}, skip to the precise -details of the @schememodname[make] library in @secref["make"]. This +details of the @racketmodname[make] library in @secref["make"]. This section contains a brief overview of @exec{make} for everyone else. @@ -69,13 +69,13 @@ files to determine when a certain step is necessary. The @exec{make} utility uses existing programs to build your project --- each rule has a shell command line. -The @schememodname[make] library provides similar functionality, +The @racketmodname[make] library provides similar functionality, except that the description is in Racket, and the steps that are needed to build target files are implemented as Racket functions. Here's a Racket program that is equivalent to the above: -@schemeblock[ +@racketblock[ (require make) (define (make-output in out) @@ -93,14 +93,14 @@ Here's a Racket program that is equivalent to the above: ] If you were to fill in the ellipses above with calls to -@scheme[system], you'd have the exact same functionality as the +@racket[system], you'd have the exact same functionality as the original @filepath{Makefile}. In addition, you can use -@scheme[make/proc] to abstract over the various lines. For example, +@racket[make/proc] to abstract over the various lines. For example, the @filepath{a.output}, @filepath{b.output}, and @filepath{c.output} lines are very similar so you can write the code that generates those lines: -@schemeblock[ +@racketblock[ (require make) (define (make-output in out) @@ -138,7 +138,7 @@ lines: Expands to -@schemeblock[ +@racketblock[ (make/proc (list (list target-expr (list depend-expr ...) (lambda () command-expr ...)) @@ -154,17 +154,17 @@ Expands to [argv (or/c string? (vectorof string?) (listof string?))]) void?] -Performs a make according to @scheme[spec] and using @scheme[argv] as +Performs a make according to @racket[spec] and using @racket[argv] as command-line arguments selecting one or more targets. -Each element of the @scheme[spec] list is a target. A target element +Each element of the @racket[spec] list is a target. A target element that starts with a list of strings is the same as multiple elements, one for each string. The second element of each target is a list of dependencies, and the third element (if any) of a target is the optional command thunk. -To make a target, @scheme[make/proc] is first called recursively on -each of the target's dependencies. If a target is not in @scheme[spec] +To make a target, @racket[make/proc] is first called recursively on +each of the target's dependencies. If a target is not in @racket[spec] and it exists as a file, then the target is considered made. If a target's modification date is older than any of its dependencies' modification dates, the corresponding command thunk is called. If the @@ -172,36 +172,36 @@ dependency has no command thunk then no action is taken; such a target is useful for triggering the make of other targets (i.e., the dependencies). -While running a command thunk, @scheme[make/proc] catches exceptions -and wraps them in an @scheme[exn:fail:make] structure, the raises the +While running a command thunk, @racket[make/proc] catches exceptions +and wraps them in an @racket[exn:fail:make] structure, the raises the resulting structure.} @defstruct[(exn:fail:make exn:fail) ([targets (listof path-string?)] [orig-exn any/c])]{ -The @scheme[targets] field is a list of strings naming the -target(s), and the @scheme[orig-exn] field is the original raised +The @racket[targets] field is a list of strings naming the +target(s), and the @racket[orig-exn] field is the original raised value.} @defboolparam[make-print-checking on?]{ -A parameter that controls whether @scheme[make/proc] prints a message -when making a target. The default is @scheme[#t].} +A parameter that controls whether @racket[make/proc] prints a message +when making a target. The default is @racket[#t].} @defboolparam[make-print-dep-no-line on?]{ -A parameter that controls whether @scheme[make/proc] prints +A parameter that controls whether @racket[make/proc] prints ``checking...'' lines for dependencies that have no target in the -given k@scheme[_spec]. The default is @scheme[#f].} +given k@racket[_spec]. The default is @racket[#f].} @defboolparam[make-print-reasons on?]{ -A parameter that controls whether @scheme[make/proc] prints the reason -that a command thunk is called. The default is @scheme[#t].} +A parameter that controls whether @racket[make/proc] prints the reason +that a command thunk is called. The default is @racket[#t].} @; ---------------------------------------- @@ -211,7 +211,7 @@ that a command thunk is called. The default is @scheme[#t].} @defsignature[make^ ()]{ -Includes all of the names provided by @schememodname[make].} +Includes all of the names provided by @racketmodname[make].} @; ---------------------------------------- @@ -221,7 +221,7 @@ Includes all of the names provided by @schememodname[make].} @defthing[make@ unit?]{ -A unit that imports nothing and exports @scheme[make^].} +A unit that imports nothing and exports @racket[make^].} @; ---------------------------------------------------------------------- @@ -229,19 +229,19 @@ A unit that imports nothing and exports @scheme[make^].} @defmodule[make/setup-extension] -The @schememodname[make/setup-extension] library helps compile C code +The @racketmodname[make/setup-extension] library helps compile C code via Setup PLT's ``pre-install'' phase (triggered by a -@schemeidfont{pre-install-collection} item in @filepath{info.rkt}; see +@racketidfont{pre-install-collection} item in @filepath{info.rkt}; see also @secref[#:doc '(lib "scribblings/raco/raco.scrbl") "setup-info"]). -The @scheme[pre-install] function takes a number of arguments that +The @racket[pre-install] function takes a number of arguments that describe how the C code is compiled---mainly the libraries that it depends on. It then drives a C compiler via the -@schememodname[dynext/compile] and @schememodname[dynext/link] +@racketmodname[dynext/compile] and @racketmodname[dynext/link] functions. -Many issues can complicate C compilation, and the @scheme[pre-install] +Many issues can complicate C compilation, and the @racket[pre-install] function helps with a few: @itemize[ @@ -263,9 +263,9 @@ issues manually, however. For example, an old @filepath{readline} installer used to pick whether to link to @filepath{libcurses} or @filepath{libncurses} heuristically by inspecting @filepath{/usr/lib}. More generally, the ``last chance'' argument to -@scheme[pre-install] allows an installer to patch compiler and linker -options (see @schememodname[dynext/compile] and -@schememodname[dynext/link]) before the C code is compiled or linked. +@racket[pre-install] allows an installer to patch compiler and linker +options (see @racketmodname[dynext/compile] and +@racketmodname[dynext/link]) before the C code is compiled or linked. @defproc[(pre-install [plthome-dir path-string?] @@ -286,75 +286,75 @@ The arguments are as follows: @itemize[ - @item{@scheme[plthome-dir] --- the directory provided to a `pre-installer' + @item{@racket[plthome-dir] --- the directory provided to a `pre-installer' function.} - @item{@scheme[collection-dir] --- a directory to use as the current directory + @item{@racket[collection-dir] --- a directory to use as the current directory while building.} - @item{@scheme[c-file] --- the name of the source file (relative to - @scheme[collection-dir]). The output file will be the same, except - with a @filepath{.c} suffix replaced with @scheme[(system-type - 'so-suffix)], and the path changed to @scheme[(build-path + @item{@racket[c-file] --- the name of the source file (relative to + @racket[collection-dir]). The output file will be the same, except + with a @filepath{.c} suffix replaced with @racket[(system-type + 'so-suffix)], and the path changed to @racket[(build-path "compiled" "native" (system-library-subpath))]. - If @scheme[(build-path "precompiled" "native" + If @racket[(build-path "precompiled" "native" (system-library-subpath) (path-replace-suffix c-file (system-type - 'so-suffix)))] exists, then @scheme[c-file] is not used at all, + 'so-suffix)))] exists, then @racket[c-file] is not used at all, and the file in the @filepath{precompiled} directory is simply copied.} - @item{@scheme[default-lib-dir] --- a default directory for finding + @item{@racket[default-lib-dir] --- a default directory for finding supporting libraries, often a subdirectory of @filepath{collection-dir}. The user can supplement this path by setting the @indexed-envvar{PLT_EXTENSION_LIB_PATHS} environment variable, which applies to all extensions manged by - @scheme[pre-install].} + @racket[pre-install].} - @item{@scheme[include-subdirs] --- a list of relative paths in which + @item{@racket[include-subdirs] --- a list of relative paths in which @tt{#include} files will be found; the path will be determined through a search, in case it's not in a standard place like @filepath{/usr/include}. - For example, the list used to be @scheme['("openssl")] for the + For example, the list used to be @racket['("openssl")] for the @filepath{openssl} collection, because the source uses @tt{#include } and @tt{#include }.} - @item{@scheme[find-unix-libs] --- like @scheme[include-subdirs], but + @item{@racket[find-unix-libs] --- like @racket[include-subdirs], but a list of library bases. Leave off the @filepath{lib} prefix and any suffix (such as @filepath{.a} or @filepath{.so}). For - @filepath{openssl}, the list used to be @scheme['("ssl" + @filepath{openssl}, the list used to be @racket['("ssl" "crypto")]. Each name will essentially get a @tt{-l} prefix for the linker command line.} - @item{@scheme[find-windows-libs] --- like @scheme[find-unix-libs], + @item{@racket[find-windows-libs] --- like @racket[find-unix-libs], but for Windows. The library name will be suffixed with @filepath{.lib} and supplied directly to the linker.} - @item{@scheme[unix-libs] --- like @scheme[find-unix-libs], except + @item{@racket[unix-libs] --- like @racket[find-unix-libs], except that the installer makes no attempt to find the libraries in a non-standard place. For example, the @filepath{readline} installer - used to supply @scheme['("curses")].} + used to supply @racket['("curses")].} - @item{@scheme[windows-libs] --- like @scheme[unix-libs], but for + @item{@racket[windows-libs] --- like @racket[unix-libs], but for Windows. For example, the @filepath{openssl} installer used to - supply @scheme['("wsock32")].} + supply @racket['("wsock32")].} - @item{@scheme[extra-depends] --- a list of relative paths to treat as + @item{@racket[extra-depends] --- a list of relative paths to treat as dependencies for compiling @filepath{file.c}. Often this list will include @filepath{file.c} with the @filepath{.c} suffix replaced by @filepath{.rkt}. For example, the "openssl" installer supplies - @scheme['("mzssl.rkt")] to ensure that the stub module + @racket['("mzssl.rkt")] to ensure that the stub module @filepath{mzssl.rkt} is never used when the true extension can be built.} - @item{@scheme[last-chance-k] --- a procedure of one argument, which + @item{@racket[last-chance-k] --- a procedure of one argument, which is a thunk. This procedure should invoke the thunk to make the file, but it may add parameterizations before the final build. For example, the @filepath{readline} installer used to add an AIX-specific compile flag in this step when compiling on AIX.} - @item{@scheme[3m-too?]--- a boolean. If true, when the 3m variant is + @item{@racket[3m-too?]--- a boolean. If true, when the 3m variant is installed, use the equivalent to @exec{raco ctool --xform} to transform the source file and then compile and link for 3m. Otherwise, the extension is built only for CGC when the CGC variant is installed.} @@ -372,10 +372,10 @@ The arguments are as follows: [argv (or/c string? (vectorof string?))]) void?]{ -Builds bytecode files for each file in @scheme[collection-files], +Builds bytecode files for each file in @racket[collection-files], writing each to a @filepath{compiled} subdirectory and automatically -managing dependencies. Supply @scheme['#("zo")] as @scheme[argv] to -compile all files. The @scheme[collection-name] argument is used only +managing dependencies. Supply @racket['#("zo")] as @racket[argv] to +compile all files. The @racket[collection-name] argument is used only for printing status information. Compilation is performed as with @exec{raco make} (see @@ -387,7 +387,7 @@ Compilation is performed as with @exec{raco make} (see @defsignature[make:collection^ ()]{ -Provides @schemeidfont{make-collection}.} +Provides @racketidfont{make-collection}.} @subsection{Unit} @@ -395,5 +395,5 @@ Provides @schemeidfont{make-collection}.} @defthing[make:collection@ unit?]{ -Imports @scheme[make^], @scheme[dynext:file^], and @scheme[compiler^], -and exports @scheme[make:collection^].} +Imports @racket[make^], @racket[dynext:file^], and @racket[compiler^], +and exports @racket[make:collection^].} diff --git a/collects/mrlib/scribblings/aligned-pasteboard/aligned-pasteboard-intf.scrbl b/collects/mrlib/scribblings/aligned-pasteboard/aligned-pasteboard-intf.scrbl index 48ee650d94..efe7f21c94 100644 --- a/collects/mrlib/scribblings/aligned-pasteboard/aligned-pasteboard-intf.scrbl +++ b/collects/mrlib/scribblings/aligned-pasteboard/aligned-pasteboard-intf.scrbl @@ -25,8 +25,8 @@ fit the widths of all of its children. [(realign) void?])]{ -Realigns the children inside the @scheme[aligned-pasteboard<%>] to -either a given @scheme[width] and @scheme[height] or the previously +Realigns the children inside the @racket[aligned-pasteboard<%>] to +either a given @racket[width] and @racket[height] or the previously alloted width and height.} @defmethod[(set-aligned-min-sizes) diff --git a/collects/mrlib/scribblings/aligned-pasteboard/aligned-pasteboard-parent-intf.scrbl b/collects/mrlib/scribblings/aligned-pasteboard/aligned-pasteboard-parent-intf.scrbl index 16d2a2a0ab..a8ed2280d8 100644 --- a/collects/mrlib/scribblings/aligned-pasteboard/aligned-pasteboard-parent-intf.scrbl +++ b/collects/mrlib/scribblings/aligned-pasteboard/aligned-pasteboard-parent-intf.scrbl @@ -4,7 +4,7 @@ @definterface/title[aligned-pasteboard-parent<%> ()]{ This interface must be implemented by any class who's editor -is an @scheme[aligned-pasteboard<%>]. +is an @racket[aligned-pasteboard<%>]. @defmethod[(set-aligned-min-sizes) void?]{} diff --git a/collects/mrlib/scribblings/aligned-pasteboard/aligned-pasteboard.scrbl b/collects/mrlib/scribblings/aligned-pasteboard/aligned-pasteboard.scrbl index c1842770b1..fddb49ef32 100644 --- a/collects/mrlib/scribblings/aligned-pasteboard/aligned-pasteboard.scrbl +++ b/collects/mrlib/scribblings/aligned-pasteboard/aligned-pasteboard.scrbl @@ -4,8 +4,8 @@ @title[#:style 'toc]{Aligned Pasteboard} The aligned-pasteboard library provides classes derived from -@scheme[pasteboard%] with geometry management that mirrors that of -@scheme[vertical-panel%] and @scheme[horizontal-panel%]. +@racket[pasteboard%] with geometry management that mirrors that of +@racket[vertical-panel%] and @racket[horizontal-panel%]. @defmodule[mrlib/aligned-pasteboard] diff --git a/collects/mrlib/scribblings/aligned-pasteboard/horizontal-pasteboard-class.scrbl b/collects/mrlib/scribblings/aligned-pasteboard/horizontal-pasteboard-class.scrbl index 2abf5ea6dc..c1435eed12 100644 --- a/collects/mrlib/scribblings/aligned-pasteboard/horizontal-pasteboard-class.scrbl +++ b/collects/mrlib/scribblings/aligned-pasteboard/horizontal-pasteboard-class.scrbl @@ -4,7 +4,7 @@ @defclass/title[horizontal-pasteboard% pasteboard% (aligned-pasteboard<%>)]{ @defconstructor/auto-super[()]{ -Passes all arguments to @scheme[super-init]. +Passes all arguments to @racket[super-init]. } @defmethod[#:mode override diff --git a/collects/mrlib/scribblings/aligned-pasteboard/stretchable-snip-intf.scrbl b/collects/mrlib/scribblings/aligned-pasteboard/stretchable-snip-intf.scrbl index 167e1cd7a6..016b55dce2 100644 --- a/collects/mrlib/scribblings/aligned-pasteboard/stretchable-snip-intf.scrbl +++ b/collects/mrlib/scribblings/aligned-pasteboard/stretchable-snip-intf.scrbl @@ -5,7 +5,7 @@ This interface must be implemented by any snip class who's objects will be stretchable when inserted into an -@scheme[aligned-pasteboard<%>]. +@racket[aligned-pasteboard<%>]. diff --git a/collects/mrlib/scribblings/aligned-pasteboard/vertical-pasteboard-class.scrbl b/collects/mrlib/scribblings/aligned-pasteboard/vertical-pasteboard-class.scrbl index 6a3e9b5351..dc863faa34 100644 --- a/collects/mrlib/scribblings/aligned-pasteboard/vertical-pasteboard-class.scrbl +++ b/collects/mrlib/scribblings/aligned-pasteboard/vertical-pasteboard-class.scrbl @@ -4,7 +4,7 @@ @defclass/title[vertical-pasteboard% pasteboard% (aligned-pasteboard<%>)]{ @defconstructor/auto-super[()]{ -Passes all arguments to @scheme[super-init]. +Passes all arguments to @racket[super-init]. } @defmethod[#:mode override diff --git a/collects/mrlib/scribblings/bitmap-label.scrbl b/collects/mrlib/scribblings/bitmap-label.scrbl index dc8b829062..2c280d1aeb 100644 --- a/collects/mrlib/scribblings/bitmap-label.scrbl +++ b/collects/mrlib/scribblings/bitmap-label.scrbl @@ -11,7 +11,7 @@ (is-a?/c bitmap%)]{ Constructs a bitmap label suitable for use a button that contains the -image specified by @scheme[img] followed by the text in @scheme[str].} +image specified by @racket[img] followed by the text in @racket[str].} @defproc[((bitmap-label-maker [str string?] @@ -19,5 +19,5 @@ image specified by @scheme[img] followed by the text in @scheme[str].} [future-parent (is-a?/c area-container<%>)]) (is-a?/c bitmap%)]{ -And older variant of @scheme[make-bitmap-label] that obtains a -font to use from a container @scheme[future-parent].} +And older variant of @racket[make-bitmap-label] that obtains a +font to use from a container @racket[future-parent].} diff --git a/collects/mrlib/scribblings/cache-image-snip.scrbl b/collects/mrlib/scribblings/cache-image-snip.scrbl index d2b857595d..b725bf5672 100644 --- a/collects/mrlib/scribblings/cache-image-snip.scrbl +++ b/collects/mrlib/scribblings/cache-image-snip.scrbl @@ -5,21 +5,21 @@ @defmodule[mrlib/cache-image-snip]{ -The @schememodname[mrlib/cache-image-snip] library provides the core +The @racketmodname[mrlib/cache-image-snip] library provides the core data structure for DrRacket's @filepath{image.rkt} teachpack. Images in the @filepath{image.rkt} teachpack are instances of the -@scheme[cache-image-snip%] class.} +@racket[cache-image-snip%] class.} -The library also defines a new type, @scheme[argb], that represents a +The library also defines a new type, @racket[argb], that represents a bitmap, but with alpha values. It has a maker, two selectors, and a predicate. @defclass[cache-image-snip% image-snip% ()]{ -The @scheme[cache-image-snip%] class is a subclass of -@scheme[image-snip%] simply so that its instances can be compared with -@scheme[image-snip%] using @scheme[equal?]. All @scheme[image-snip%] +The @racket[cache-image-snip%] class is a subclass of +@racket[image-snip%] simply so that its instances can be compared with +@racket[image-snip%] using @racket[equal?]. All @racket[image-snip%] functionality is overridden or ignored. @defmethod[#:mode overrride @@ -28,7 +28,7 @@ functionality is overridden or ignored. boolean?]{ Calls the @method[cache-image-snip% other-equal-to?] method of -@scheme[snip] if it is also a @scheme[cache-image-snip%] instance, +@racket[snip] if it is also a @racket[cache-image-snip%] instance, otherwise calls the @method[cache-image-snip% other-equal-to?] of @this-obj[].} @@ -52,7 +52,7 @@ otherwise calls the @method[cache-image-snip% other-equal-to?] of @defmethod[(get-argb/no-compute) (or/c false/c argb?)]{ - Returns a pixel array for this image or @scheme[#f] if it has not + Returns a pixel array for this image or @racket[#f] if it has not been computed yet. @@ -64,8 +64,8 @@ otherwise calls the @method[cache-image-snip% other-equal-to?] of Builds (if not yet built) a bitmap corresponding to this snip and returns it. - If the width or the height of the snip is @scheme[0], - this method return @scheme[#f]. + If the width or the height of the snip is @racket[0], + this method return @racket[#f]. } @defmethod[(get-dc-proc) @@ -119,20 +119,20 @@ This snipclass is used for saved cache image snips.} @defproc[(argb-vector [argb argb?]) (vectorof (integer-in 0 255))]{ - Extracts the vector from @scheme[argb].} + Extracts the vector from @racket[argb].} @defproc[(argb-width [argb argb?]) exact-nonnegative-integer?]{ - Extracts the width from @scheme[argb].} + Extracts the width from @racket[argb].} @defproc[(argb-height [argb argb?]) exact-nonnegative-integer?]{ - Extracts the height from @scheme[argb].} + Extracts the height from @racket[argb].} @defproc[(argb? [v any/c]) boolean?]{ -Returns @scheme[#t] if @scheme[v] is an argb, @scheme[#f] otherwise.} +Returns @racket[#t] if @racket[v] is an argb, @racket[#f] otherwise.} @defproc[(overlay-bitmap [dest argb?] @@ -142,8 +142,8 @@ Returns @scheme[#t] if @scheme[v] is an argb, @scheme[#f] otherwise.} [mask (is-a?/c bitmap%)]) void?]{ -Changes @scheme[argb], overlaying @scheme[img] with masking based on -@scheme[mask] at @math{(@scheme[dx], @scheme[dy])} from the top-left.} +Changes @racket[argb], overlaying @racket[img] with masking based on +@racket[mask] at @math{(@racket[dx], @racket[dy])} from the top-left.} @defproc[(build-bitmap [draw ((is-a?/c dc<%>) . -> . any)] @@ -151,34 +151,34 @@ Changes @scheme[argb], overlaying @scheme[img] with masking based on [height (integer-in 1 10000)]) (is-a?/c bitmap%)]{ -Builds a bitmap of size @scheme[width] by @scheme[height], using the -procedure @scheme[draw] to render the bitmap content into the given -@scheme[dc<%>].} +Builds a bitmap of size @racket[width] by @racket[height], using the +procedure @racket[draw] to render the bitmap content into the given +@racket[dc<%>].} @defproc[(flatten-bitmap [bitmap (is-a?/c bitmap%)]) (is-a?/c bitmap%)]{ - Builds a new bitmap that flattens the original @scheme[bitmap] + Builds a new bitmap that flattens the original @racket[bitmap] with its mask (as determined by @xmethod[bitmap% get-loaded-mask]), producing a bitmap that has no mask, and looks the way that bitmap would draw (when drawn with the mask) onto a white background.} - + @defproc[(argb->cache-image-snip [argb argb?][dx real?][dy real?]) (is-a?/c cache-image-snip%)]{ - Builds a new @scheme[cache-image-snip%] based on the contents of - @scheme[argb], using @scheme[dx] and @scheme[dy] as the pinhole.} + Builds a new @racket[cache-image-snip%] based on the contents of + @racket[argb], using @racket[dx] and @racket[dy] as the pinhole.} @defproc[(argb->bitmap [argb argb?]) (or/c false/c (is-a?/c bitmap%))]{ - Builds a bitmap that draws the same way as @scheme[argb]; the alpha + Builds a bitmap that draws the same way as @racket[argb]; the alpha pixels are put into the bitmap's @method[bitmap% get-loaded-mask] bitmap. - If the width or height of @scheme[argb] is @scheme[0], - this returns @scheme[#f]. + If the width or height of @racket[argb] is @racket[0], + this returns @racket[#f]. } diff --git a/collects/mrlib/scribblings/close-icon.scrbl b/collects/mrlib/scribblings/close-icon.scrbl index 963b3dc70f..1b2cc7e9ca 100644 --- a/collects/mrlib/scribblings/close-icon.scrbl +++ b/collects/mrlib/scribblings/close-icon.scrbl @@ -5,7 +5,7 @@ @title{Close Icon} -@defmodule[mrlib/close-icon]{The @scheme[close-icon%] class +@defmodule[mrlib/close-icon]{The @racket[close-icon%] class provides a clickable close button icon.} @defclass[close-icon% canvas% ()]{ @@ -14,8 +14,8 @@ provides a clickable close button icon.} [bg-color (or/c #f string (is-a?/c color%))] [horizontal-pad positive-integer? 4] [vertical-pad positive-integer? 4])]{ - The @scheme[callback] is called when the close icon is clicked. - - If @scheme[bg-color] is specified, it is used as the background color of the icon. + The @racket[callback] is called when the close icon is clicked. + + If @racket[bg-color] is specified, it is used as the background color of the icon. } } diff --git a/collects/mrlib/scribblings/gif.scrbl b/collects/mrlib/scribblings/gif.scrbl index cd7a7340d0..7703a7f56f 100644 --- a/collects/mrlib/scribblings/gif.scrbl +++ b/collects/mrlib/scribblings/gif.scrbl @@ -11,11 +11,11 @@ [filename path-string]) void?]{ -Writes the given @scheme[bitmap] to @scheme[filename] as a GIF image, -where @scheme[bitmap] is either an instance of @scheme[bitmap%] or a +Writes the given @racket[bitmap] to @racket[filename] as a GIF image, +where @racket[bitmap] is either an instance of @racket[bitmap%] or a thunk (to be called just once) that generates such an object. If the bitmap uses more than 256 colors, it is automatically quantized using -a simple algorithm; see @scheme[quantize]. If the bitmap has a mask +a simple algorithm; see @racket[quantize]. If the bitmap has a mask bitmap via @method[bitmap% get-loaded-mask], it is used to determine transparent pixels in the generated GIF image.} @@ -30,28 +30,28 @@ transparent pixels in the generated GIF image.} [#:last-frame-delay last-frame-delay (or/c (integer-in 0 #xFFFFFFFF) false/c) #f]) void?]{ -Writes the bitmaps in @scheme[bitmaps] to @scheme[filename] as an -animated GIF. The @scheme[bitmaps] list can contain a mixture of -@scheme[bitmap%] objects and thunks (each called just once) that -produce @scheme[bitmap%] objects. The @scheme[delay-csec] argument is +Writes the bitmaps in @racket[bitmaps] to @racket[filename] as an +animated GIF. The @racket[bitmaps] list can contain a mixture of +@racket[bitmap%] objects and thunks (each called just once) that +produce @racket[bitmap%] objects. The @racket[delay-csec] argument is the amount of time in 1/100s of a second to wait between transitions. -If @scheme[loop?] is a true value, then the GIF is marked as a looping +If @racket[loop?] is a true value, then the GIF is marked as a looping animation. -If @scheme[one-at-a-time?] is @scheme[#f], then the content of all +If @racket[one-at-a-time?] is @racket[#f], then the content of all images is collected and quantized at once, to produce a single colortable; a drawback to this approach is that it uses more memory, and it allows less color variation among animation frames. Even when -@scheme[one-at-a-time?] is @scheme[#f], the result of each thunk in -@scheme[bitmaps] is converted to a byte-string one at a time. +@racket[one-at-a-time?] is @racket[#f], the result of each thunk in +@racket[bitmaps] is converted to a byte-string one at a time. -If @scheme[one-at-a-time?] is true, then the bitmaps are quantized and +If @racket[one-at-a-time?] is true, then the bitmaps are quantized and written to the file one at a time; that is, for each thunk in -@scheme[bitmaps], its result is written and discarded before another +@racket[bitmaps], its result is written and discarded before another thunk is called. A drawback to this approach is that a separate colortable is written for each frame in the animation, which can make the resulting file large. -If @scheme[last-frame-delay] is not false, a delay of -@scheme[last-frame-delay] (in 1/100s of a second) is added to the last -frame. This extra delay is useful when @scheme[loop?] is true.} +If @racket[last-frame-delay] is not false, a delay of +@racket[last-frame-delay] (in 1/100s of a second) is added to the last +frame. This extra delay is useful when @racket[loop?] is true.} diff --git a/collects/mrlib/scribblings/graph/graph-pasteboard-intf.scrbl b/collects/mrlib/scribblings/graph/graph-pasteboard-intf.scrbl index a55cbff5b7..5d0b6a7d7c 100644 --- a/collects/mrlib/scribblings/graph/graph-pasteboard-intf.scrbl +++ b/collects/mrlib/scribblings/graph/graph-pasteboard-intf.scrbl @@ -70,8 +70,8 @@ different nodes. graph pasteboard, and is expected to draw the edges between the snips. The argments are a subset of those passed to @method[editor<%> on-paint] and it is only called when the - @scheme[before?] argument to @method[editor<%> on-paint] - is @scheme[#t]. + @racket[before?] argument to @method[editor<%> on-paint] + is @racket[#t]. } @defmethod[(draw-single-edge [dc (is-a?/c dc<%>)] @@ -88,25 +88,25 @@ different nodes. This method is called to draw each edge in the graph, except for the edges that connect a node to itself. -The @scheme[dc], @scheme[dx], and @scheme[dy] arguments are +The @racket[dc], @racket[dx], and @racket[dy] arguments are the same as in @method[editor<%> on-paint]. The -@scheme[from-x], @scheme[from-y], @scheme[to-x], and -@scheme[to-y] arguments specify points on the source and +@racket[from-x], @racket[from-y], @racket[to-x], and +@racket[to-y] arguments specify points on the source and destination snip's bounding box where a straight line between the centers of the snip would intersect. -The @scheme[arrow-point-ok?] function returns @scheme[#t] +The @racket[arrow-point-ok?] function returns @racket[#t] when the point specified by its arguments is inside the smallest rectangle that covers both the source and destination snips, but is outside of both of the rectangles that surround the source and destination snips themselves. -This default implementation uses @scheme[update-polygon] to compute +This default implementation uses @racket[update-polygon] to compute the arrowheads and otherwise draws a straight line between the two points and then the arrowheads, unless the arrowhead points -are not ok according to @scheme[arrow-point-ok?], in which case +are not ok according to @racket[arrow-point-ok?], in which case it just draws the line. } @@ -116,8 +116,8 @@ it just draws the line. [point3 (is-a?/c point%)] [point4 (is-a?/c point%)]) void?]{ -Updates the arguments @scheme[point1], @scheme[point2], @scheme[point3], @scheme[point4] with the coordinates -of an arrowhead for a line that connects (@scheme[from-x],@scheme[from-y]) to (@scheme[to-x],@scheme[to-y]). +Updates the arguments @racket[point1], @racket[point2], @racket[point3], @racket[point4] with the coordinates +of an arrowhead for a line that connects (@racket[from-x],@racket[from-y]) to (@racket[to-x],@racket[to-y]). } } diff --git a/collects/mrlib/scribblings/graph/graph-pasteboard-mixin.scrbl b/collects/mrlib/scribblings/graph/graph-pasteboard-mixin.scrbl index 646e3d504d..fccff0da8d 100644 --- a/collects/mrlib/scribblings/graph/graph-pasteboard-mixin.scrbl +++ b/collects/mrlib/scribblings/graph/graph-pasteboard-mixin.scrbl @@ -7,12 +7,12 @@ [edge-label-font (or/c #f (is-a?/c font%)) #f] [cache-arrow-drawing? any])]{ -If @scheme[edge-labels?] is @scheme[#f], no edge labels are +If @racket[edge-labels?] is @racket[#f], no edge labels are drawn. Otherwise, they are. -If @scheme[edge-label-font] is supplied, it is used when drawing the +If @racket[edge-label-font] is supplied, it is used when drawing the labels on the edges. Otherwise, the font is not set before drawing -the labels, defaulting to the @scheme[dc<%>] object's font. +the labels, defaulting to the @racket[dc<%>] object's font. If @racket[cache-arrow-drawing?] is @racket[#f], then the arrows in the snip are not cached in a bitmap (to speed up drawing when the mouse moves around). @@ -21,4 +21,4 @@ Otherwise, they are. } This mixin overrides many methods to draw lines between -@scheme[graph-snip<%>] that it contains.} +@racket[graph-snip<%>] that it contains.} diff --git a/collects/mrlib/scribblings/graph/graph-snip-intf.scrbl b/collects/mrlib/scribblings/graph/graph-snip-intf.scrbl index 0032ff6e83..679e5a9dd3 100644 --- a/collects/mrlib/scribblings/graph/graph-snip-intf.scrbl +++ b/collects/mrlib/scribblings/graph/graph-snip-intf.scrbl @@ -9,7 +9,7 @@ void?]{ Adds a child of this snip. Instead of calling this method, - consider using the @scheme[add-links] function. + consider using the @racket[add-links] function. } @@ -23,7 +23,7 @@ void?])]{ Adds a parent of this snip. Instead of calling this - method, consider using the @scheme[add-links] function. + method, consider using the @racket[add-links] function. } @@ -31,7 +31,7 @@ (listof snip%)]{ returns a list of snips that implement -@scheme[graph-snip<%>]. Each of these snips will have a line +@racket[graph-snip<%>]. Each of these snips will have a line drawn from it, pointing at this snip. } @@ -40,7 +40,7 @@ drawn from it, pointing at this snip. @defmethod[(get-parents) (listof graph-snip<%>)]{ -Returns a list of snips that implement @scheme[graph-snip<%>]. Each +Returns a list of snips that implement @racket[graph-snip<%>]. Each of these snips will have a line drawn to it, starting from this snip. } @@ -52,7 +52,7 @@ this snip. Removes a child snip from this snip. Be sure to remove this snip as a parent from the argument, too. Instead of calling this method, consider using the - @scheme[remove-links] function. + @racket[remove-links] function. } @@ -62,7 +62,7 @@ this snip. Removes a parent snip from this snip. Be sure to remove this snip as a child from the argument, too. Instead of calling this method, consider using the - @scheme[remove-links] function. + @racket[remove-links] function. } @@ -70,8 +70,8 @@ this snip. [label (or/c false/c string/)]) void?]{ - Changes the label on the edge going to the @scheme[parent] to be - @scheme[label]. Ignored if no such egde exists. + Changes the label on the edge going to the @racket[parent] to be + @racket[label]. Ignored if no such egde exists. } } diff --git a/collects/mrlib/scribblings/graph/graph.scrbl b/collects/mrlib/scribblings/graph/graph.scrbl index e2712e9a2f..74d13f2053 100644 --- a/collects/mrlib/scribblings/graph/graph.scrbl +++ b/collects/mrlib/scribblings/graph/graph.scrbl @@ -3,8 +3,8 @@ @title[#:style 'toc]{Graphs} -@defmodule[mrlib/graph]{The @schememodname[mrlib/graph] library -provides a graph drawing toolkit built out of @scheme[pasteboard%]s.} +@defmodule[mrlib/graph]{The @racketmodname[mrlib/graph] library +provides a graph drawing toolkit built out of @racket[pasteboard%]s.} @local-table-of-contents[] @@ -42,20 +42,20 @@ provides a graph drawing toolkit built out of @scheme[pasteboard%]s.} Connects a parent snip to a child snip within a pasteboard. -The default @scheme[dark-pen]/@scheme[dark-brush] and -@scheme[light-pen]/@scheme[light-brush] are blue and purple, -respectively. The @scheme[dark-pen] and @scheme[dark-brush] are used +The default @racket[dark-pen]/@racket[dark-brush] and +@racket[light-pen]/@racket[light-brush] are blue and purple, +respectively. The @racket[dark-pen] and @racket[dark-brush] are used when the mouse cursor is over the snip (or a child or parent), and the -@scheme[light-pen] and @scheme[light-brush] are used when the mouse +@racket[light-pen] and @racket[light-brush] are used when the mouse cursor is not over the snip. The brush is used to draw inside the arrow head and the pen is used to draw the border of the arrowhead and the line connecting the two snips. -if @scheme[label] is provided and not @scheme[#f], it is used as a +if @racket[label] is provided and not @racket[#f], it is used as a label on the edge. -When @scheme[dx] and @scheme[dy] are provided, the are offsets for the -head and the tail of the arrow. Otherwise, @scheme[0] offsets are +When @racket[dx] and @racket[dy] are provided, the are offsets for the +head and the tail of the arrow. Otherwise, @racket[0] offsets are used.} @defproc[(add-links/text-colors [parent (is-a?/c graph-snip<%>)] @@ -71,8 +71,8 @@ used.} [label (or/c string? false/c)]) void?]{ -Like @scheme[add-links], but with extra @scheme[dark-text] and -@scheme[light-text] arguments to set the colors of the label.} +Like @racket[add-links], but with extra @racket[dark-text] and +@racket[light-text] arguments to set the colors of the label.} @defproc[(remove-links [parent (is-a?/c graph-snip<%>)] [child (is-a?/c graph-snip<%>)]) @@ -85,6 +85,6 @@ Disconnects a parent snip from a child snip within a pasteboard.} [label (or/c string? false/c)]) void?]{ -Changes the label on the edge going from @scheme[child] to -@scheme[parent] to be @scheme[label]. If there is no existing edge +Changes the label on the edge going from @racket[child] to +@racket[parent] to be @racket[label]. If there is no existing edge between the two nodes, then nothing happens.} diff --git a/collects/mrlib/scribblings/hierlist/compound-item.scrbl b/collects/mrlib/scribblings/hierlist/compound-item.scrbl index 9bbfee1c50..a1407b94e5 100644 --- a/collects/mrlib/scribblings/hierlist/compound-item.scrbl +++ b/collects/mrlib/scribblings/hierlist/compound-item.scrbl @@ -32,7 +32,7 @@ Like @xmethod[hierarchical-list% new-list].} @defmethod[(delete-item [i (is-a?/c hierarchical-list-item<%>)]) void?]{ -Deletes immediate item or sub-list @scheme[i] from the sub-list.} +Deletes immediate item or sub-list @racket[i] from the sub-list.} @defmethod[(get-items) (listof (is-a?/c hierarchical-list-item<%>))]{ diff --git a/collects/mrlib/scribblings/hierlist/hierlist.scrbl b/collects/mrlib/scribblings/hierlist/hierlist.scrbl index 8adc0dd6d2..b68c9cfd2e 100644 --- a/collects/mrlib/scribblings/hierlist/hierlist.scrbl +++ b/collects/mrlib/scribblings/hierlist/hierlist.scrbl @@ -5,7 +5,7 @@ @defmodule[mrlib/hierlist] -A @scheme[hierarchical-list%] control is a list of items, some of +A @racket[hierarchical-list%] control is a list of items, some of which can themselves be hierarchical lists. Each such sub-list has an arrow that the user can click to hide or show the sub-list's items. diff --git a/collects/mrlib/scribblings/hierlist/item.scrbl b/collects/mrlib/scribblings/hierlist/item.scrbl index 0c421e0676..a6c1d2a571 100644 --- a/collects/mrlib/scribblings/hierlist/item.scrbl +++ b/collects/mrlib/scribblings/hierlist/item.scrbl @@ -21,7 +21,7 @@ Reports whether the item is selected.} [(click-select [on? any/c]) void?])]{ Calls @method[hierarchical-list% select] or @method[hierarchical-list% -click-select]. The @scheme[on?] argument can be @scheme[#f] only if +click-select]. The @racket[on?] argument can be @racket[#f] only if @xmethod[hierarchical-list% allow-deselect] allows it.} diff --git a/collects/mrlib/scribblings/hierlist/list.scrbl b/collects/mrlib/scribblings/hierlist/list.scrbl index 0fc3b3e867..b6114e3d5b 100644 --- a/collects/mrlib/scribblings/hierlist/list.scrbl +++ b/collects/mrlib/scribblings/hierlist/list.scrbl @@ -17,9 +17,9 @@ Creates a hierarchical-list control. Creates the control. -If the style @scheme['transparent] is passed, then the +If the style @racket['transparent] is passed, then the @method[editor-snip% use-style-background] method will be -called with @scheme[#t] when editor snips are created as part of +called with @racket[#t] when editor snips are created as part of the hierarchical list, ensuring that the entire control is transparent. @@ -39,11 +39,11 @@ Returns the currently selected item, if any.} (is-a?/c hierarchical-list-item<%>)]{ Creates and returns a new (empty) item in the list. See -@scheme[hierarchical-list-item<%>] for methods to fill in the item's +@racket[hierarchical-list-item<%>] for methods to fill in the item's label. -The @scheme[mixin] argument is applied to a class implementing -@scheme[hierarchical-list-item<%>], and the resulting class is +The @racket[mixin] argument is applied to a class implementing +@racket[hierarchical-list-item<%>], and the resulting class is instantiated as the list item.} @@ -62,17 +62,17 @@ list is empty.} (is-a?/c hierarchical-list-compound-item<%>)]{ Creates and returns a new (empty) sub-list in the list. See -@scheme[hierarchical-list-compound-item<%>] for methods to fill in the +@racket[hierarchical-list-compound-item<%>] for methods to fill in the item's label and content. -The @scheme[mixin] argument is applied to a class implementing -@scheme[hierarchical-list-compound-item<%>], and the resulting class +The @racket[mixin] argument is applied to a class implementing +@racket[hierarchical-list-compound-item<%>], and the resulting class is instantiated as the sub-list.} @defmethod[(delete-item [i (is-a?/c hierarchical-list-item<%>)]) void?]{ -Deletes immediate item or sub-list @scheme[i] from the list.} +Deletes immediate item or sub-list @racket[i] from the list.} @defmethod[(get-items) (listof (is-a?/c hierarchical-list-item<%>))]{ @@ -89,7 +89,7 @@ selection.} @defmethod[(on-select [i (or/c (is-a?/c hierarchical-list-item<%>) false/c)]) any]{ -Called for new select of @scheme[i], where @scheme[i] is @scheme[#f] +Called for new select of @racket[i], where @racket[i] is @racket[#f] if no item is now selected.} @@ -103,17 +103,17 @@ set-allow-selection].} @defmethod[(on-double-select [i (is-a?/c hierarchical-list-item<%>)]) any]{ -Called for a double-click on @scheme[i].} +Called for a double-click on @racket[i].} @defmethod[(on-item-opened [i (is-a?/c hierarchical-list-compound-item<%>)]) any]{ -Called when the arrow for @scheme[i] is turned down.} +Called when the arrow for @racket[i] is turned down.} @defmethod[(on-item-closed [i (is-a?/c hierarchical-list-compound-item<%>)]) any]{ -Called when the arrow for @scheme[i] is turned up.} +Called when the arrow for @racket[i] is turned up.} @defmethod[(sort [less-than-proc ((is-a?/c hierarchical-list-item<%>) @@ -122,8 +122,8 @@ Called when the arrow for @scheme[i] is turned up.} [recur? any/c #t]) void?]{ -Sorts items in the list by calling @scheme[less-than-proc] on pairs of -items. If @scheme[recur?] is true, items in sub-lists are sorted +Sorts items in the list by calling @racket[less-than-proc] on pairs of +items. If @racket[recur?] is true, items in sub-lists are sorted recursively.} @@ -131,7 +131,7 @@ recursively.} boolean?]{ Like @xmethod[editor<%> can-do-edit-operation?]. The default -implementation always returns @scheme[#f].} +implementation always returns @racket[#f].} @defmethod[(do-edit-operation [op symbol?] [recursive? any/c #t]) @@ -161,7 +161,7 @@ Moves the selection, scrolls as necessary to show it, and calls @method[hierarchical-list% on-select-always]. The @method[hierarchical-list% allow-deselect] method controls whether -@scheme[i] is allowed to be @scheme[#f] to deselect the currently +@racket[i] is allowed to be @racket[#f] to deselect the currently selected item.} @@ -199,7 +199,7 @@ This is initially disabled, by default.} Gets/sets whether the @method[hierarchical-list% on-select] can be -called with a @scheme[#f] argument to deselect the current item +called with a @racket[#f] argument to deselect the current item (leaving none selected). The initial mode does not allow deselection.} diff --git a/collects/mrlib/scribblings/hierlist/snips.scrbl b/collects/mrlib/scribblings/hierlist/snips.scrbl index f638fb788d..a237ef7d31 100644 --- a/collects/mrlib/scribblings/hierlist/snips.scrbl +++ b/collects/mrlib/scribblings/hierlist/snips.scrbl @@ -1,17 +1,17 @@ #lang scribble/doc @(require "../common.rkt" (for-label mrlib/hierlist)) -@title{Snips in a @scheme[hierarchical-list%] Instance} +@title{Snips in a @racket[hierarchical-list%] Instance} The @xmethod[text% find-snip] method of the editor in a -@scheme[hierarchical-list%] return instances of -@scheme[hierarchical-item-snip%] and @scheme[hierarchical-list-snip%]. +@racket[hierarchical-list%] return instances of +@racket[hierarchical-item-snip%] and @racket[hierarchical-list-snip%]. @defclass[hierarchical-item-snip% editor-snip% ()]{ @defmethod[(get-item) (is-a?/c hierarchical-list-item<%>)]{ - Returns the @scheme[hierarchical-list-item<%>] corresponding to the + Returns the @racket[hierarchical-list-item<%>] corresponding to the snip.} } @@ -21,7 +21,7 @@ The @xmethod[text% find-snip] method of the editor in a @defmethod[(get-item) (is-a?/c hierarchical-list-compound-item<%>)]{ - Returns the @scheme[hierarchical-list-compound-item<%>] corresponding to the + Returns the @racket[hierarchical-list-compound-item<%>] corresponding to the snip.} @defmethod[(get-content-buffer) (is-a?/c text%)]{ diff --git a/collects/mrlib/scribblings/image-core.scrbl b/collects/mrlib/scribblings/image-core.scrbl index 616464ff34..1d68280db1 100644 --- a/collects/mrlib/scribblings/image-core.scrbl +++ b/collects/mrlib/scribblings/image-core.scrbl @@ -18,7 +18,7 @@ up an image. void?]{ Draws @racket[image] in @racket[dc] at the position (@racket[dx],@racket[dy]). } - + @defproc[(image? [v any/c]) boolean?]{ Recognizes the images that library handles. } diff --git a/collects/mrlib/scribblings/include-bitmap.scrbl b/collects/mrlib/scribblings/include-bitmap.scrbl index 0b6a81486d..365024ff70 100644 --- a/collects/mrlib/scribblings/include-bitmap.scrbl +++ b/collects/mrlib/scribblings/include-bitmap.scrbl @@ -4,28 +4,28 @@ @title{Include Bitmap} -@defmodule[mrlib/include-bitmap]{The @scheme[include-bitmap] form +@defmodule[mrlib/include-bitmap]{The @racket[include-bitmap] form takes a filename containing a bitmap and ``inlines'' the bitmap into the program.} Historically, the advantage of inlining the bitmap is that a stand-alone executable can be created that contains the bitmap and does not refer to the original image file. The -@scheme[define-runtime-path] form, however, now provides a better +@racket[define-runtime-path] form, however, now provides a better alternative. @defform*[[(include-bitmap path-spec) (include-bitmap path-spec type-expr)]]{ -The @scheme[path-spec] is the same as for @scheme[include] form. The -@scheme[type-expr] should produce @scheme['unknown], -@scheme['unknown/mask], etc., as for @scheme[bitmap%], and the default -is @scheme['unknown/mask].} +The @racket[path-spec] is the same as for @racket[include] form. The +@racket[type-expr] should produce @racket['unknown], +@racket['unknown/mask], etc., as for @racket[bitmap%], and the default +is @racket['unknown/mask].} @defform*[[(include-bitmap/relative-to source path-spec) (include-bitmap/relative-to source path-spec [type-expr])]]{ -Analogous to @scheme[include-at/relative-to], though only a source is +Analogous to @racket[include-at/relative-to], though only a source is needed (no context).} diff --git a/collects/mrlib/scribblings/interactive-value-port.scrbl b/collects/mrlib/scribblings/interactive-value-port.scrbl index a35062b426..768718e1d9 100644 --- a/collects/mrlib/scribblings/interactive-value-port.scrbl +++ b/collects/mrlib/scribblings/interactive-value-port.scrbl @@ -8,8 +8,8 @@ @defproc[(set-interactive-display-handler [port output-port?]) void?]{ -Sets @scheme[port]'s display handler (via -@scheme[port-display-handler]) so that when it encounters these +Sets @racket[port]'s display handler (via +@racket[port-display-handler]) so that when it encounters these values: @itemize[ @@ -20,21 +20,21 @@ values: ] -it uses @scheme[write-special] to send snips to the port, +it uses @racket[write-special] to send snips to the port, instead of those values. Otherwise, it behaves like the default handler. To show values embedded in lists and other compound object, it uses -@scheme[pretty-print].} +@racket[pretty-print].} @defproc[(set-interactive-write-handler [port output-port?]) void?]{ -Like @scheme[set-interactive-display-handler], but sets the -@scheme[port-write-handler].} +Like @racket[set-interactive-display-handler], but sets the +@racket[port-write-handler].} @defproc[(set-interactive-print-handler [port output-port?]) void?]{ -Like @scheme[set-interactive-display-handler], but sets the -@scheme[port-print-handler].} +Like @racket[set-interactive-display-handler], but sets the +@racket[port-print-handler].} diff --git a/collects/mrlib/scribblings/name-message.scrbl b/collects/mrlib/scribblings/name-message.scrbl index 34b5a77b3a..fb009f9ad3 100644 --- a/collects/mrlib/scribblings/name-message.scrbl +++ b/collects/mrlib/scribblings/name-message.scrbl @@ -71,7 +71,7 @@ saying that there is no file name until the file is saved.} the label is determined by the @method[name-message% set-message]. } - + @defmethod[(get-background-color) (or/c #f (is-a/c color%) string?)]{ The result of this method is used for the background color diff --git a/collects/mrlib/scribblings/path-dialog.scrbl b/collects/mrlib/scribblings/path-dialog.scrbl index 5a79f9c1e7..ceba2e11c7 100644 --- a/collects/mrlib/scribblings/path-dialog.scrbl +++ b/collects/mrlib/scribblings/path-dialog.scrbl @@ -8,11 +8,11 @@ @defclass[path-dialog% dialog% ()]{ -The @scheme[path-dialog%] class implements a platform-independent +The @racket[path-dialog%] class implements a platform-independent file/directory dialog. The dialog is similar in functionality to the -@scheme[get-file], @scheme[put-file], @scheme[get-directory], and -@scheme[get-file-list] procedures, but considerable extra functionality -is available through the @scheme[path-dialog%] class. +@racket[get-file], @racket[put-file], @racket[get-directory], and +@racket[get-file-list] procedures, but considerable extra functionality +is available through the @racket[path-dialog%] class. @defconstructor[([label (or/c label-string? false/c) #f] @@ -34,79 +34,79 @@ is available through the @scheme[path-dialog%] class. [ok? (or/c (path? . -> . any) false/c) #f] [guard (or/c (path? . -> . any) false/c) #f])]{ -The @scheme[label] argument is the dialog's title string. If -@scheme[label] is @scheme[#f], the default is based on other field +The @racket[label] argument is the dialog's title string. If +@racket[label] is @racket[#f], the default is based on other field values. -The @scheme[message] argument is a prompt message to show at the top -of the dialog. If it is @scheme[#f], no prompt line. +The @racket[message] argument is a prompt message to show at the top +of the dialog. If it is @racket[#f], no prompt line. -The @scheme[parent] argument is the parent frame or dialog, if any, +The @racket[parent] argument is the parent frame or dialog, if any, for this dialog. -The @scheme[directory] argument specifies the dialog's initial -directory. If it is @scheme[#f], the initial directory is the last +The @racket[directory] argument specifies the dialog's initial +directory. If it is @racket[#f], the initial directory is the last directory that was used by the user (or the current directory on first use). -The @scheme[filename] argument provides an initial filename text, if +The @racket[filename] argument provides an initial filename text, if any. -If @scheme[put?] is true, the dialog operates in choose-file-to-write +If @racket[put?] is true, the dialog operates in choose-file-to-write mode (and warn the user if choosing an existing name). -If @scheme[dir?] is true, the dialog operates in directory-choice +If @racket[dir?] is true, the dialog operates in directory-choice mode. -If @scheme[existing?] is true, the use must choose an existing file. +If @racket[existing?] is true, the use must choose an existing file. -If @scheme[new?] is true, the user must choose a non-existant -path. Providing both @scheme[new?] and @scheme[existing?] as true +If @racket[new?] is true, the user must choose a non-existant +path. Providing both @racket[new?] and @racket[existing?] as true triggers an exception. -If @scheme[multi?] is true, the dialog allows selection of multiple +If @racket[multi?] is true, the dialog allows selection of multiple paths. -If @scheme[can-mkdir?] is true, the dialog includes a button for the +If @racket[can-mkdir?] is true, the dialog includes a button for the user to create a new directory. -The @scheme[filters] argument is one of: +The @racket[filters] argument is one of: @itemize[ - @item{@scheme[(list (list _filter-name _filter-glob) ...)] --- a - list of pattern names (e.g., @scheme["Scheme Files"]) and glob - patterns (e.g., @scheme["*.rkt;*.scrbl"]). Any list, including an + @item{@racket[(list (list _filter-name _filter-glob) ...)] --- a + list of pattern names (e.g., @racket["Scheme Files"]) and glob + patterns (e.g., @racket["*.rkt;*.scrbl"]). Any list, including an empty list, enables a filter box for the user to enter glob patterns, and the given list of choices is available in a combo-box drop-down menu. Glob patterns are the usual Unix ones - (see @scheme[glob->regexp]), and a semicolon can be used to allow + (see @racket[glob->regexp]), and a semicolon can be used to allow multiple patterns.} - @item{@scheme[#f] --- no patterns and no filter input box.} + @item{@racket[#f] --- no patterns and no filter input box.} - @item{@scheme[#t] --- use a generic @scheme["All"] filter, which is - @scheme["*.*"] on Windows and @scheme["*"] on other + @item{@racket[#t] --- use a generic @racket["All"] filter, which is + @racket["*.*"] on Windows and @racket["*"] on other platforms.} ] -The @scheme[show-file?] predicate is used to filter file paths that +The @racket[show-file?] predicate is used to filter file paths that are shown in the dialog. The predicate is applied to the file name as a string while the current-directory parameter is set. This predicate is intended to be a lightweight filter for choosing which names to display. -The @scheme[show-dir?] predicate is similar, but for directories +The @racket[show-dir?] predicate is similar, but for directories instead of files. -The @scheme[ok?] predicate is used in a similar fashion to the -@scheme[show-file?] and @scheme[show-dir?] predicate, but it is used +The @racket[ok?] predicate is used in a similar fashion to the +@racket[show-file?] and @racket[show-dir?] predicate, but it is used to determine whether the @onscreen{OK} button should be enabled when a file or directory is selected (so it need not be as lightweight as the other predicates). -The @scheme[guard] procedure is a generic verifier for the dialog's +The @racket[guard] procedure is a generic verifier for the dialog's final result, as produced by the @method[path-dialog% run] method. It receives the result that is about to be returned (which can be a list in a multi-selection dialog), and can return a different value (any @@ -119,9 +119,9 @@ message.} @defmethod[(run) any/c]{ -Shows the dialog and returns the selected result. If a @scheme[guard] +Shows the dialog and returns the selected result. If a @racket[guard] procedure is not supplied when the dialog is created, then the result is either a path or a list of paths (and the latter only when -@scheme[_multi?] is true when the dialog is created). If a -@scheme[_guard] procedure is supplied, its result determines the result +@racket[_multi?] is true when the dialog is created). If a +@racket[_guard] procedure is supplied, its result determines the result of this method.}} diff --git a/collects/mrlib/scribblings/plot.scrbl b/collects/mrlib/scribblings/plot.scrbl index 66a90935b1..53236b1a50 100644 --- a/collects/mrlib/scribblings/plot.scrbl +++ b/collects/mrlib/scribblings/plot.scrbl @@ -3,7 +3,7 @@ @title{Plot} -@defmodule[mrlib/plot]{The @schememodname[mrlib/plot] library provides +@defmodule[mrlib/plot]{The @racketmodname[mrlib/plot] library provides a simple tool for plotting data values to a device context.} @defstruct[data-set ([points (listof (is-a?/c point%))] @@ -14,9 +14,9 @@ a simple tool for plotting data values to a device context.} [min-y real?] [max-y real?])]{ -The @scheme[points] field contains the data values to plot, and -@scheme[connected?] indicates whether the points are connected by a -line. The @scheme[pen] field provides a pen for plotting +The @racket[points] field contains the data values to plot, and +@racket[connected?] indicates whether the points are connected by a +line. The @racket[pen] field provides a pen for plotting points/lines. The remaining fields determine the plotting area within a drawing context.} @@ -30,9 +30,9 @@ a drawing context.} [x-axis-label string?] [y-axis-label string?])]{ -Configures a plot. The @scheme[grid?] field determines whether to draw -a grid at axis markings, and the @scheme[x-axis-marking] and -@scheme[y-axis-marking] lists supply locations for marks on each +Configures a plot. The @racket[grid?] field determines whether to draw +a grid at axis markings, and the @racket[x-axis-marking] and +@racket[y-axis-marking] lists supply locations for marks on each axis. The other fields are self-explanatory.} @defproc[(plot [dc (is-a?/c dc<%>)] @@ -40,6 +40,6 @@ axis. The other fields are self-explanatory.} [setup plot-setup?]) void?]{ -Draws the @scheme[data-set]s in @scheme[data] into the given -@scheme[dc]. Uses drawing-context coordinates in @scheme[data-set]s +Draws the @racket[data-set]s in @racket[data] into the given +@racket[dc]. Uses drawing-context coordinates in @racket[data-set]s that will accommodate all of the data sets.} diff --git a/collects/mrlib/scribblings/switchable-button.scrbl b/collects/mrlib/scribblings/switchable-button.scrbl index db4dff6f83..df25e4cb15 100644 --- a/collects/mrlib/scribblings/switchable-button.scrbl +++ b/collects/mrlib/scribblings/switchable-button.scrbl @@ -7,7 +7,7 @@ @defclass[switchable-button% canvas% ()]{ - A @scheme[switchable-button%] control displays + A @racket[switchable-button%] control displays and icon and a string label. It toggles between display of just the icon and a display with the label and the icon side-by-side. @@ -17,15 +17,15 @@ [bitmap (is-a?/c bitmap%)] [alternate-bitmap (is-a?/c bitmap%) bitmap] [vertical-tight? boolean? #f])]{ - The @scheme[callback] is called when the button - is pressed. The @scheme[string] and @scheme[bitmap] are + The @racket[callback] is called when the button + is pressed. The @racket[string] and @racket[bitmap] are used as discussed above. - If @scheme[alternate-bitmap] is supplied, then it is used + If @racket[alternate-bitmap] is supplied, then it is used when the button is switched to the view that just shows the bitmap. If it is not supplied, both modes show the same bitmap. - If the @scheme[vertical-tight?] argument is @scheme[#t], then the button takes up + If the @racket[vertical-tight?] argument is @racket[#t], then the button takes up as little as possible vertical space. } diff --git a/collects/mrlib/scribblings/tex-table.scrbl b/collects/mrlib/scribblings/tex-table.scrbl index 5269439b26..783c67bed1 100644 --- a/collects/mrlib/scribblings/tex-table.scrbl +++ b/collects/mrlib/scribblings/tex-table.scrbl @@ -17,7 +17,7 @@ DrRacket uses with its @tt{control-\} (or @tt{command-\}) strings to their corresponding unicode characters. For example, it contains this mapping: - @schemeblock[ + @racketblock[ ("alpha" "α") ] as well as many more. diff --git a/collects/mysterx/scribblings/activex.scrbl b/collects/mysterx/scribblings/activex.scrbl index 5ff54b23aa..73b623e3e1 100644 --- a/collects/mysterx/scribblings/activex.scrbl +++ b/collects/mysterx/scribblings/activex.scrbl @@ -4,7 +4,7 @@ @title[#:tag "activex" #:style 'toc]{ActiveX and DHTML} A MysterX application consists of one or more browsers, which are -instances of the class @scheme[mx-browser%]. +instances of the class @racket[mx-browser%]. @local-table-of-contents[] diff --git a/collects/mysterx/scribblings/browsers.scrbl b/collects/mysterx/scribblings/browsers.scrbl index 9f9e7b7897..29b505f8ea 100644 --- a/collects/mysterx/scribblings/browsers.scrbl +++ b/collects/mysterx/scribblings/browsers.scrbl @@ -14,12 +14,12 @@ (listof (any-of/c 'iconize 'maximize 'no-system-menu 'no-thick-border 'scrollbars))])]{ - Creates an instance of a MysterX browser. The @scheme[label] + Creates an instance of a MysterX browser. The @racket[label] argument is a string for the document caption, with default . The - @scheme[width], @scheme[height], @scheme[x], and @scheme[y] give the + @racket[width], @racket[height], @racket[x], and @racket[y] give the size and placement of the browser window on the desktop, with - defaults provided by Windows. When @scheme[style-options] includes - @scheme['scrollbars], the vertical scrollbar is disabled if + defaults provided by Windows. When @racket[style-options] includes + @racket['scrollbars], the vertical scrollbar is disabled if scrolling is unnecessary, and the horizontal scrollbar disappears if scrolling is unnecessary. @@ -39,12 +39,12 @@ @defmethod[(show [show? any/c]) void?]{ - If @scheme[show?] is @scheme[#f], the browser window is hidden. + If @racket[show?] is @racket[#f], the browser window is hidden. Otherwise, the window is shown.} @defmethod[(navigate [url string?]) string?]{ - Navigates the browser to the URL given by @scheme[url]. + Navigates the browser to the URL given by @racket[url]. Any DHTML changes to the page associated with the URL are not shown. Returns a string that is the actual URL navigated to.} @@ -52,13 +52,13 @@ @defmethod[(navigate/status [url string?]) (list/c string? (or/c false/c integer? (one-of/c 'no-status)))]{ - Navigates the browser to the URL given by @scheme[url]. + Navigates the browser to the URL given by @racket[url]. Any DHTML changes to the page associated with the URL are not shown. Returns a list, whose first element string that is the actual URL navigated to, and whose second element is - a status code, one of: @scheme[#f], indicating no status could be - obtained; a number, such as @scheme[200] or @scheme[404], indicating the - http status; or @scheme['no-status], indicating that @scheme[url] does not + a status code, one of: @racket[#f], indicating no status could be + obtained; a number, such as @racket[200] or @racket[404], indicating the + http status; or @racket['no-status], indicating that @racket[url] does not denote a URL with the ``http'' scheme.} @defmethod[(go-back) string?]{ @@ -77,8 +77,8 @@ @defmethod[(refresh) boolean?]{ - Refreshes the document in the browser. Returns @scheme[#t] - if the refresh is successful, @scheme[#f] otherwise.} + Refreshes the document in the browser. Returns @racket[#t] + if the refresh is successful, @racket[#f] otherwise.} @defmethod[(iconize) void?]{ @@ -96,8 +96,8 @@ [f ((is-a?/c mx-event<%>) . -> . any)]) void?]{ - Registers an event handler for the HTML element @scheme[elem]. - The result of @scheme[f] is discarded.} + Registers an event handler for the HTML element @racket[elem]. + The result of @racket[f] is discarded.} @defmethod[(unregister-event-handler [elem (is-a?/c mx-element%)]) void?]{ @@ -121,7 +121,7 @@ @defproc[(block-while-browsers) void?]{ Blocks until all browser windows have been closed or hidden, using - the show method of @scheme[mx-browser%]. This is useful when a + the show method of @racket[mx-browser%]. This is useful when a MysterX program file is run as a script, to prevent @exec{mzscheme} or @exec{mred} from closing prematurely.} diff --git a/collects/mysterx/scribblings/com-events.scrbl b/collects/mysterx/scribblings/com-events.scrbl index 97ed7fd298..ca2bf24752 100644 --- a/collects/mysterx/scribblings/com-events.scrbl +++ b/collects/mysterx/scribblings/com-events.scrbl @@ -14,12 +14,12 @@ (listof string?)]{ Returns a list of strings naming the events supported by - @scheme[obj/type]. + @racket[obj/type]. If calling this procedure results in an error indicating that the COM object's coclass is ambiguous, try using either - @scheme[set-coclass!] or @scheme[set-coclass-from-progid!], then - retry @scheme[com-events].} + @racket[set-coclass!] or @racket[set-coclass-from-progid!], then + retry @racket[com-events].} @defproc[(com-event-type [obj/type (or/c com-object? com-type?)] @@ -27,11 +27,11 @@ (listof string?)]{ Returns the type of an event handler for the - event @scheme[ev] generated by the particular - COM object/type @scheme[obj/type]. The return type of + event @racket[ev] generated by the particular + COM object/type @racket[obj/type]. The return type of all COM event handlers is void. - See also @scheme[com-events] for dealing with a COM + See also @racket[com-events] for dealing with a COM object that has an ambiguous class.} @defproc[(com-register-event-handler @@ -40,17 +40,17 @@ [f (any/c . -> . any)]) void?]{ - Registers @scheme[f] as event handler for the event @scheme[ev] when - generated by @scheme[obj]. The type of argument supplied to - @scheme[f] depends on the event; the result of @scheme[f] is always + Registers @racket[f] as event handler for the event @racket[ev] when + generated by @racket[obj]. The type of argument supplied to + @racket[f] depends on the event; the result of @racket[f] is always discarded. - See also @scheme[com-events] for dealing with a COM + See also @racket[com-events] for dealing with a COM object that has an ambiguous class.} @defproc[(com-unregister-event-handler [obj com-object?] [ev string?]) void?]{ - Unregisters any event handler for the event @scheme[ev] that is - generated by the COM object @scheme[obj].} + Unregisters any event handler for the event @racket[ev] that is + generated by the COM object @racket[obj].} diff --git a/collects/mysterx/scribblings/com-types.scrbl b/collects/mysterx/scribblings/com-types.scrbl index a2463b7ea4..09e03e0797 100644 --- a/collects/mysterx/scribblings/com-types.scrbl +++ b/collects/mysterx/scribblings/com-types.scrbl @@ -3,12 +3,12 @@ @title[#:tag "com-types"]{COM Types} -In the result of a function like @scheme[com-method-type], a type -@indexed-scheme['mx-any] standards for a character, real number, -string, boolean, COM currency (as in @scheme[com-currency?]), COM date -(as in @scheme[com-date?]), COM scode value (as in -@scheme[com-scode?]), COM IUnknown value (as in -@scheme[com-iunknown?], or COM object (as in @scheme[com-object?]).} +In the result of a function like @racket[com-method-type], a type +@indexed-racket['mx-any] standards for a character, real number, +string, boolean, COM currency (as in @racket[com-currency?]), COM date +(as in @racket[com-date?]), COM scode value (as in +@racket[com-scode?]), COM IUnknown value (as in +@racket[com-iunknown?], or COM object (as in @racket[com-object?]).} @defproc[(com-object-type [obj com-object?]) com-type?]{ @@ -16,43 +16,43 @@ string, boolean, COM currency (as in @scheme[com-currency?]), COM date @defproc[(com-is-a? [obj com-object?] [type com-type?]) boolean?]{ - Return @scheme[#t] if @scheme[obj] is of the - type @scheme[type].} + Return @racket[#t] if @racket[obj] is of the + type @racket[type].} @defproc[(com-currency? [v any/c]) boolean?]{ - Returns @scheme[#t] if @scheme[v] is a COM currency value, - @scheme[#f] otherwise.} + Returns @racket[#t] if @racket[v] is a COM currency value, + @racket[#f] otherwise.} @defproc[(com-currency->number [curr com-currency?]) real?]{ - Returns a number for @scheme[curr].} + Returns a number for @racket[curr].} @defproc[(number->com-currency [n real?]) com-currency?]{ Converts a number to a COM currency value. A currency value is - repsented with a 64-bit two's-complement integer, though @scheme[n] - may contain decimal digits. If @scheme[n] is too large, an + repsented with a 64-bit two's-complement integer, though @racket[n] + may contain decimal digits. If @racket[n] is too large, an exception is raised.} @defproc[(com-date? [v any/c]) boolean?]{ - Returns @scheme[#t] if @scheme[v] is a COM date value, @scheme[#f] + Returns @racket[#t] if @racket[v] is a COM date value, @racket[#f] otherwise.} @defproc[(com-date->date [d com-date?]) date?]{ - Converts a COM date to an instance of the @scheme[date] structure - type. In the result, the @scheme[dst?] field is always @scheme[#f], - and the @scheme[time-zone-offset] field is @scheme[0].} + Converts a COM date to an instance of the @racket[date] structure + type. In the result, the @racket[dst?] field is always @racket[#f], + and the @racket[time-zone-offset] field is @racket[0].} @defproc[(date->com-date [d date?]) com-date?]{ - Converts a @scheme[date] instance to a COM date value.} + Converts a @racket[date] instance to a COM date value.} @defproc[(com-scode? [v any/c]) boolean?]{ - Returns @scheme[#t] if @scheme[v] is a COM scode value, @scheme[#f] + Returns @racket[#t] if @racket[v] is a COM scode value, @racket[#f] otherwise.} @defproc[(com-scode->number [sc com-scode?]) integer?]{ @@ -67,10 +67,10 @@ string, boolean, COM currency (as in @scheme[com-currency?]), COM date @defproc[(com-iunknown? [v any/c]) boolean?]{ - Returns @scheme[#t] if @scheme[v] is a COM IUnknown value, - @scheme[#f] otherwise.} + Returns @racket[#t] if @racket[v] is a COM IUnknown value, + @racket[#f] otherwise.} @defthing[com-omit any/c]{ -Used with @scheme[com-invoke] to represent an argument that is not +Used with @racket[com-invoke] to represent an argument that is not provided.} diff --git a/collects/mysterx/scribblings/dcom.scrbl b/collects/mysterx/scribblings/dcom.scrbl index 60f3b29dd3..33646c4f8c 100644 --- a/collects/mysterx/scribblings/dcom.scrbl +++ b/collects/mysterx/scribblings/dcom.scrbl @@ -3,9 +3,9 @@ @title[#:tag "remote"]{Remote COM servers (DCOM)} -For the MysterX procedures @scheme[cocreate-instance-from-coclass] and -@scheme[cocreate-instance-from-progid], the optional @scheme[_where] -argument can be @scheme['remote]. In that case, the server instance +For the MysterX procedures @racket[cocreate-instance-from-coclass] and +@racket[cocreate-instance-from-progid], the optional @racket[_where] +argument can be @racket['remote]. In that case, the server instance is run at the location given by the Registry key @centerline{@tt{HKEY_CLASSES_ROOT\AppID\@nonterm{CLSID}\RemoteServerName}} diff --git a/collects/mysterx/scribblings/documents.scrbl b/collects/mysterx/scribblings/documents.scrbl index ceabe41d34..91e7412908 100644 --- a/collects/mysterx/scribblings/documents.scrbl +++ b/collects/mysterx/scribblings/documents.scrbl @@ -37,9 +37,9 @@ [size (one-of/c 'pixels 'percent) 'pixels]) com-object?]{ - Inserts a COM object with class @scheme[coclass] at the beginning of - the document. The optional @scheme[size] argument gives an - interpretation for the width and height, where @scheme['percent] + Inserts a COM object with class @racket[coclass] at the beginning of + the document. The optional @racket[size] argument gives an + interpretation for the width and height, where @racket['percent] indicates that the width and height are a fixed percentage of the document window size.} @@ -83,13 +83,13 @@ (is-a?/c mx-element%)]{ Returns an object that encapsulates an HTML element, where - @scheme[tag] names an HTML tag, and @scheme[id] names the @scheme["id"] - attribute of the HTML element. The @scheme[index] is a nonnegative + @racket[tag] names an HTML tag, and @racket[id] names the @racket["id"] + attribute of the HTML element. The @racket[index] is a nonnegative integer indicating the zero-based index of the element among all - elements with the same @scheme[tag] and @scheme[id]. The ordering + elements with the same @racket[tag] and @racket[id]. The ordering of elements is defined by Internet Explorer. The requested element - must be within the document's @scheme["body"] tags or the - @scheme["body"] element itself.} + must be within the document's @racket["body"] tags or the + @racket["body"] element itself.} @defmethod[(find-element-by-id-or-name [id string?] @@ -97,19 +97,19 @@ (is-a?/c mx-element%)]{ Returns an object that encapsulates an HTML element, where - @scheme[id] names either the @scheme["id"] or @scheme["name"] - attribute of the HTML element. The @scheme[index] is a nonnegative + @racket[id] names either the @racket["id"] or @racket["name"] + attribute of the HTML element. The @racket[index] is a nonnegative integer indicating the zero-based index of the element among all - elements with the same @scheme["id"] or @scheme["name"]. The ordering + elements with the same @racket["id"] or @racket["name"]. The ordering of elements is defined by Internet Explorer. The requested element - must be within the document's @scheme["body"] tags or the - @scheme["body"] element itself.} + must be within the document's @racket["body"] tags or the + @racket["body"] element itself.} @defmethod[(elements-with-tag [tag string?]) (listof (is-a?/c mx-element%))]{ - Returns a list of elements with the HTML tag given by @scheme[tag]. - The requested elements must be within the document's @scheme["body"] - tags or the @scheme["body"] element itself.} + Returns a list of elements with the HTML tag given by @racket[tag]. + The requested elements must be within the document's @racket["body"] + tags or the @racket["body"] element itself.} } diff --git a/collects/mysterx/scribblings/html-element.scrbl b/collects/mysterx/scribblings/html-element.scrbl index aeaba237a6..bdc42e063d 100644 --- a/collects/mysterx/scribblings/html-element.scrbl +++ b/collects/mysterx/scribblings/html-element.scrbl @@ -22,13 +22,13 @@ (to-flow spacer) (to-flow (scheme 'option0)) (to-flow spacer) - (make-flow (list (schemeblock0 contract0)))) + (make-flow (list (racketblock0 contract0)))) (list (to-flow spacer) (to-flow spacer) (to-flow spacer) (to-flow (scheme 'option)) (to-flow spacer) - (make-flow (list (schemeblock0 contract)))) + (make-flow (list (racketblock0 contract)))) ...) ...)))) @@ -107,30 +107,30 @@ @defmethod[(insert-html [html string?]) void?]{ - Places the HTML given by the string @scheme[html] before the element.} + Places the HTML given by the string @racket[html] before the element.} @defmethod[(append-html [html string?]) void?]{ - Places the HTML given by the string @scheme[html] after the element.} + Places the HTML given by the string @racket[html] after the element.} @defmethod[(replace-html [html string?]) void?]{ - Replaces the HTML in the element with the string @scheme[html]. You + Replaces the HTML in the element with the string @racket[html]. You must use the @method[mx-document<%> find-element] or @method[mx-document<%> find-element-by-id-or-name] methods of - @scheme[mx-document<%>] to retrieve the updated element.} + @racket[mx-document<%>] to retrieve the updated element.} @defmethod[(insert-text [txt string?]) void?]{ - Places the text given by the string @scheme[txt] before the HTML element.} + Places the text given by the string @racket[txt] before the HTML element.} @defmethod[(append-text [txt string?]) void?]{ - Places the text given by the string @scheme[txt] after the HTML element.} + Places the text given by the string @racket[txt] after the HTML element.} @defmethod[(insert-object-from-coclass [coclass string?] [width exact-integer?] @@ -138,7 +138,7 @@ [size (one-of/c 'pixels 'percent) 'pixels]) void?]{ - Composes @scheme[coclass->html] with @method[mx-element% insert-html].} + Composes @racket[coclass->html] with @method[mx-element% insert-html].} @defmethod[(insert-object-from-progid [coclass string?] [width exact-integer?] @@ -146,7 +146,7 @@ [size (one-of/c 'pixels 'percent) 'pixels]) void?]{ - Composes @scheme[progid->html] with @method[mx-element% insert-html].} + Composes @racket[progid->html] with @method[mx-element% insert-html].} @defmethod[(append-object-from-coclass [coclass string?] [width exact-integer?] @@ -154,7 +154,7 @@ [size (one-of/c 'pixels 'percent) 'pixels]) void?]{ - Composes @scheme[coclass->html] with @method[mx-element% append-html].} + Composes @racket[coclass->html] with @method[mx-element% append-html].} @defmethod[(append-object-from-progid [coclass string?] [width exact-integer?] @@ -162,7 +162,7 @@ [size (one-of/c 'pixels 'percent) 'pixels]) void?]{ - Composes @scheme[progid->html] with @method[mx-element% append-html].} + Composes @racket[progid->html] with @method[mx-element% append-html].} @defmethod[(focus) void?]{ @@ -173,7 +173,7 @@ @defmethod[(selection) string?]{ - If the element has the @scheme["select"] tag, returns a string + If the element has the @racket["select"] tag, returns a string indicating the value of the current selection. Otherwise, an exception s raised. The value of the selection may be different from the string visible in the dropdown list.} @@ -181,23 +181,23 @@ @defmethod[(set-selection! [val string?]) void?]{ - If the element has the @scheme["select"] tag, sets the selection to - the entry with the value @scheme[val], a string. Otherwise, an + If the element has the @racket["select"] tag, sets the selection to + the entry with the value @racket[val], a string. Otherwise, an exception is raised. The value of the selection may be different from the string visible in the dropdown list.} @defmethod[(attribute [attr string?]) (or/c string? real? boolean?)]{ - Retrieves the attribute named by the string @scheme[attr]. The return + Retrieves the attribute named by the string @racket[attr]. The return value has a type that depends on the attribute.} @defmethod[(set-attribute! [attr string?] [val (or/c string? real? boolean?)]) void?]{ - Sets the attribute named by the string @scheme[attr]. The new - value @scheme[val] has a type that depends on the attribute.} + Sets the attribute named by the string @racket[attr]. The new + value @racket[val] has a type that depends on the attribute.} @defmethod[(click) void?]{ @@ -246,7 +246,7 @@ Gets or sets the element's CSS @tt{background-color}, @tt{background-image}, @tt{background-repeat}, @tt{background-attachment}, and @tt{background-position} - using the string @scheme[b].} + using the string @racket[b].} @defmethods[background-image diff --git a/collects/mysterx/scribblings/html-events.scrbl b/collects/mysterx/scribblings/html-events.scrbl index eead5637e7..3506906959 100644 --- a/collects/mysterx/scribblings/html-events.scrbl +++ b/collects/mysterx/scribblings/html-events.scrbl @@ -22,32 +22,32 @@ [(dblclick?) boolean?] [(error?) boolean?])]{ - Exactly one of these methods returns @scheme[#t] to indicate the type - of a given event, and the others return @scheme[#f] for the event.} + Exactly one of these methods returns @racket[#t] to indicate the type + of a given event, and the others return @racket[#f] for the event.} @defmethod[(alt-key) boolean?]{ - Returns @scheme[#t] if the Alt key was pressed when the - event was generated, @scheme[#f] otherwise.} + Returns @racket[#t] if the Alt key was pressed when the + event was generated, @racket[#f] otherwise.} @defmethod[(ctrl-key) boolean?]{ - Returns @scheme[#t] if the Ctrl key was pressed when the - event was generated, @scheme[#f] otherwise. } + Returns @racket[#t] if the Ctrl key was pressed when the + event was generated, @racket[#f] otherwise. } @defmethod[(from-tag) string?]{ Returns a string indicating the tag of the HTML element where the mouse is being moved from. The return value is valid only for events for which @method[mx-event<%> mouseover?] or @method[mx-event<%> - mouseout?] produces @scheme[#t].} + mouseout?] produces @racket[#t].} @defmethod[(from-id) string?]{ Returns a string indicating the identifier of the HTML element where the mouse is being moved from. Return value is valid only for events for which @method[mx-event<%> mouseover?] or @method[mx-event<%> - mouseout?] produces @scheme[#t].} + mouseout?] produces @racket[#t].} @defmethod[(id) string?]{ @@ -59,12 +59,12 @@ Returns a number indicating the keycode for the key that generated the event. Return value is valid only for events for which @method[mx-event<%> keypress?], @method[mx-event<%> keydown?], or - @method[mx-event<%> keyup?] produces @scheme[#t].} + @method[mx-event<%> keyup?] produces @racket[#t].} @defmethod[(shift-key) boolean?]{ - Returns @scheme[#t] if the Shift key was pressed when the - event was generated, @scheme[#f] otherwise.} + Returns @racket[#t] if the Shift key was pressed when the + event was generated, @racket[#f] otherwise.} @defmethod[(tag) string?]{ @@ -76,14 +76,14 @@ Returns a string indicating the tag of the target HTML element where the mouse is being moved to. Return value is valid only for events for which @method[mx-event<%> mouseover?] or @method[mx-event<%> - mouseout?] produces @scheme[#t].} + mouseout?] produces @racket[#t].} @defmethod[(to-id) boolean?]{ Returns a string indicating the identifier of the target HTML element where the mouse is being moved from. Return value is valid only for events for which @method[mx-event<%> mouseover?] or - @method[mx-event<%> mouseout?] produces @scheme[#t].} + @method[mx-event<%> mouseout?] produces @racket[#t].} @defmethod[(x) exact-integer?]{ diff --git a/collects/mysterx/scribblings/html.scrbl b/collects/mysterx/scribblings/html.scrbl index 32bc11bfdc..be755d2d9c 100644 --- a/collects/mysterx/scribblings/html.scrbl +++ b/collects/mysterx/scribblings/html.scrbl @@ -5,15 +5,15 @@ @title[#:tag "html" #:style 'toc]{HTML and Dynamic HTML} - The @scheme[mx-element%] class encapsulates HTML elements. By + The @racket[mx-element%] class encapsulates HTML elements. By calling the methods of the class, you can change the appearance of elements, and place new HTML before or after the element. While the methods are described here, a good DHTML reference, such as Goodman's @italic{Dynamic HTML} will have more complete information. - Many of the @scheme[mx-element%] methods have two variants, a + Many of the @racket[mx-element%] methods have two variants, a version that takes or returns Racket data, and another - @schemeidfont{-native} version that takes or returns a string. For + @racketidfont{-native} version that takes or returns a string. For methods that return values of element properties, we assume two characteristics, which we do not mention in the methods' documentation: 1) Native methods return the empty string for @@ -43,18 +43,18 @@ Returns a string containing HTML which when inserted into a document loads the COM object with the COM class or ProgID given by - @scheme[name]. This procedure is suitable for placing ActiveX - controls within complex HTML. The optional @scheme[size] argument - gives an interpretation for the @scheme[width] and @scheme[height] - arguments; by default, @scheme[size] is @scheme['pixels], but may - also be @scheme['percent], indicating that the width and height are + @racket[name]. This procedure is suitable for placing ActiveX + controls within complex HTML. The optional @racket[size] argument + gives an interpretation for the @racket[width] and @racket[height] + arguments; by default, @racket[size] is @racket['pixels], but may + also be @racket['percent], indicating that the width and height are a fixed percentage of the document window size.} @; ---------------------------------------- @section{CSS} - In the @scheme[mx-element%] method descriptions, ``CSS'' refers to + In the @racket[mx-element%] method descriptions, ``CSS'' refers to the Cascading Style Sheets specification. A CSS length is string consisting of a decimal integer number followed by one of the units @litchar{px} (pixels), @litchar{em} (font height), @litchar{ex} @@ -62,9 +62,9 @@ (centimeters), @litchar{mm} (millimeters), @litchar{pc} (picas), or @litchar{pt} (points). A CSS percentage is a string consisting of a decimal real number followed by @litchar{%}. When using - @schemeidfont{-native} methods, CSS lengths and percentages are + @racketidfont{-native} methods, CSS lengths and percentages are given as strings. For use by non-native methods, the - @scheme[css-percentage] and @scheme[css-length] structures have been + @racket[css-percentage] and @racket[css-length] structures have been defined. @deftogether[( @@ -82,13 +82,13 @@ (@litchar{0}-@litchar{9} and @litchar{a}-@litchar{f} or @litchar{A}-@litchar{F}); the first two digits are for the red component of the color, the middle two for the green component, and - the last two for the blue component. For example, @scheme["#FFFFFF"] - is white, @scheme["#000000"] is black, and @scheme["#00FF00"] is + the last two for the blue component. For example, @racket["#FFFFFF"] + is white, @racket["#000000"] is black, and @racket["#00FF00"] is green. - There are also predefined color names. The @schemeidfont{-native} + There are also predefined color names. The @racketidfont{-native} methods use these names in strings, while their nonnative counterpart - methods use the names as symbols. + methods use the names as symbols. The predefined color names are: diff --git a/collects/mysterx/scribblings/methprop.scrbl b/collects/mysterx/scribblings/methprop.scrbl index 9b3052ca51..8cb93d1eb1 100644 --- a/collects/mysterx/scribblings/methprop.scrbl +++ b/collects/mysterx/scribblings/methprop.scrbl @@ -16,7 +16,7 @@ @defproc[(com-all-controls) (listof string?)]{ Returns a list of strings for all COM classes - registered on a system that have the @scheme["Control"] + registered on a system that have the @racket["Control"] subkey.} @deftogether[( @@ -28,12 +28,12 @@ com-object?] )]{ - Returns an instance of @scheme[coclass]. This is useful for COM + Returns an instance of @racket[coclass]. This is useful for COM classes without a visual representation, or when a visual representation is not needed. - The optional argument @scheme[where] indicates a for running the - instance, and may be @scheme['local], @scheme['remote], or a string + The optional argument @racket[where] indicates a for running the + instance, and may be @racket['local], @racket['remote], or a string indicating a machine name. See @secref["remote"] for more information.} @@ -46,7 +46,7 @@ com-object?] )]{ -Like @scheme[cocreate-instance-from-coclass], but using a ProgID.} +Like @racket[cocreate-instance-from-coclass], but using a ProgID.} @deftogether[( @@ -56,49 +56,49 @@ Like @scheme[cocreate-instance-from-coclass], but using a ProgID.} com-object?] )]{ - Like @scheme[cocreate-instance-from-coclass], but gets an existing + Like @racket[cocreate-instance-from-coclass], but gets an existing active object (always local) instead of creating a new one.} @defproc[(coclass [obj com-object?]) string?]{ Returns a string that is the name of the COM class instantiated by - @scheme[obj], or raises an error if the COM class is not known.} + @racket[obj], or raises an error if the COM class is not known.} @defproc[(progid [obj com-object?]) string?]{ Returns a string that is the name of the ProgID instantiated by - @scheme[obj], or raises an error if the COM class is not known.} + @racket[obj], or raises an error if the COM class is not known.} @defproc[(set-coclass! [obj com-object?] [coclass string?]) void?]{ - Sets the COM class for @scheme[obj] to @scheme[coclass]. This is + Sets the COM class for @racket[obj] to @racket[coclass]. This is useful when MysterX COM event-handling procedures can obtain only ambiguous information about the object's COM class.} @defproc[(set-coclass-from-progid! [obj com-object?] [progid string?]) void?]{ - Like @scheme[set-coclass!], but using a ProgID.} + Like @racket[set-coclass!], but using a ProgID.} @defproc[(com-methods [obj/type (or/c com-object? com-type?)]) (listof string?)]{ Returns a list of strings indicating the names of methods on - @scheme[obj/type].} + @racket[obj/type].} @defproc[(com-method-type [obj/type (or/c com-object? com-type?)] [method-name string?]) (listof symbol?)]{ Returns a list of symbols indicating the type of the specified - method in @scheme[obj/type]. See @secref["com-types"] for + method in @racket[obj/type]. See @secref["com-types"] for information on the symbols.} @defproc[(com-invoke [obj com-object?] [method-name string?] [v any/c]) any/c]{ - Invokes @scheme[method-name] on @scheme[obj] with @scheme[v]s as the - arguments. The special value @scheme[com-omit] may be used for + Invokes @racket[method-name] on @racket[obj] with @racket[v]s as the + arguments. The special value @racket[com-omit] may be used for optional arguments, which useful when values are supplied for arguments after the omitted argument(s).} @@ -106,35 +106,35 @@ Like @scheme[cocreate-instance-from-coclass], but using a ProgID.} (listof string?)]{ Returns a list of strings indicating the names of readable - properties in @scheme[obj/type].} + properties in @racket[obj/type].} @defproc[(com-get-property-type [obj/type (or/c com-object? com-type?)] [property-name string?]) (listof symbol?)]{ Returns a list of symbols indicating the type of the specified - property in @scheme[obj/type]. See @secref["com-types"] for + property in @racket[obj/type]. See @secref["com-types"] for information on the symbols.} @defproc[(com-get-property [obj com-object?] [property string?] ...+) any/c]{ Returns the value of the final property by following the indicated - path of @scheme[property]s, where each intermediate property is a + path of @racket[property]s, where each intermediate property is a COM object.} @defproc[(com-set-properties [obj/type (or/c com-object? com-type?)]) (listof string?)]{ Returns a list of strings indicating the names of writeable - properties in @scheme[obj/type].} + properties in @racket[obj/type].} @defproc[(com-set-property-type [obj/type (or/c com-object? com-type?)] [property-name strig?]) (listof symbol?)]{ Returns a list of symbols indicating the type of the specified - property in @scheme[obj/type]. See @secref["com-types"] for + property in @racket[obj/type]. See @secref["com-types"] for information on the symbols.} @defproc[(com-set-property! [obj com-object?] @@ -142,8 +142,8 @@ Like @scheme[cocreate-instance-from-coclass], but using a ProgID.} [v any/c]) void?]{ - Sets the value of the final property in @scheme[obj] to @scheme[v] - by following the @scheme[property]s, where the value of each + Sets the value of the final property in @racket[obj] to @racket[v] + by following the @racket[property]s, where the value of each intermediate property is a COM object.} @defproc[(com-help [obj/type (or/c com-object? com-type?)] @@ -151,23 +151,23 @@ Like @scheme[cocreate-instance-from-coclass], but using a ProgID.} void?]{ Starts the Window Help system with help about the COM object or COM - type. The optional @scheme[topic] is typically a method or property + type. The optional @racket[topic] is typically a method or property name.} @defproc[(com-object-eq? [obj1 com-object?] [obj2 com-object?]) boolean?]{ - Returns @scheme[#t] if the two COM objects are the same, - @scheme[#f] otherwise.} + Returns @racket[#t] if the two COM objects are the same, + @racket[#f] otherwise.} @defproc[(com-object? [obj com-object?]) boolean?]{ - Returns @scheme[#t] if the argument is a COM object, @scheme[#f] + Returns @racket[#t] if the argument is a COM object, @racket[#f] otherwise.} @defproc[(com-add-ref [obj com-object?]) void?]{ - Increments the reference count for @scheme[obj]. + Increments the reference count for @racket[obj]. This procedure should only be called when system-level errors occur due to a mismanaged COM object. Ordinarily, MysterX handles all COM reference-counting automatically.} diff --git a/collects/mysterx/scribblings/overview.scrbl b/collects/mysterx/scribblings/overview.scrbl index ef041a4f35..6427116268 100644 --- a/collects/mysterx/scribblings/overview.scrbl +++ b/collects/mysterx/scribblings/overview.scrbl @@ -29,7 +29,7 @@ with your distribution, and the DLLs will need to be registered on the end user's machine. One way to do that is to include the following little setup program (as an executable) in your distribution: -@schemeblock[ +@racketblock[ (module setup scheme/base (require mzlib/runtime-path mzlib/process) @@ -51,7 +51,7 @@ little setup program (as an executable) in your distribution: Try -@schemeblock[ +@racketblock[ (require mysterx/mxdemo) ] @@ -65,19 +65,19 @@ downloaded from elsewhere; look for @filepath{mscal.ocx}. Load the MysterX module with -@schemeblock[ +@racketblock[ (require mysterx) ] -Because some MysterX code relies on the @schememodname[scheme/class] +Because some MysterX code relies on the @racketmodname[scheme/class] class system, you may also need -@schemeblock[ +@racketblock[ (require mzlib/class) ] Several MysterX procedures take HTML strings as input. The -@schememodname[xml] library provides procedures that convert Racket +@racketmodname[xml] library provides procedures that convert Racket syntax into XML strings. You may find using these procedures useful in creating HTML strings for use by MysterX. diff --git a/collects/mzcom/mzcom.scrbl b/collects/mzcom/mzcom.scrbl index 00f8c91d9d..e071f9ccd9 100644 --- a/collects/mzcom/mzcom.scrbl +++ b/collects/mzcom/mzcom.scrbl @@ -65,16 +65,16 @@ building from the Racket source distribution. The above C/C++ code is for illustration; your actual code should check return values, of course. -Using @schememodname[mysterx] to manipulate COM objects within Racket, +Using @racketmodname[mysterx] to manipulate COM objects within Racket, you can load MzCOM with either -@schemeblock[ +@racketblock[ (cci/coclass "MzObj Class") ] or -@schemeblock[ +@racketblock[ (cci/progid "MzCOM.MzObj.") ] @@ -158,7 +158,7 @@ means to obtain COM error information. The Racket evaluator runs in a Win32 thread created when MzCOM is loaded. If an expression kills the primary Racket thread, as in -@schemeblock[ +@racketblock[ (kill-thread (current-thread)) ] diff --git a/collects/mzlib/scribblings/awk.scrbl b/collects/mzlib/scribblings/awk.scrbl index 3715a936c6..aa2f0bc3de 100644 --- a/collects/mzlib/scribblings/awk.scrbl +++ b/collects/mzlib/scribblings/awk.scrbl @@ -36,12 +36,12 @@ [id-or-false id #f])]{ -The @scheme[awk] macro from Scsh @cite["Shivers06"]. In addition to -@scheme[awk], the Scsh-compatible procedures @scheme[match:start], -@scheme[match:end], @scheme[match:substring], and @scheme[regexp-exec] -are defined. These @schemeidfont{match:} procedures must be used to +The @racket[awk] macro from Scsh @cite["Shivers06"]. In addition to +@racket[awk], the Scsh-compatible procedures @racket[match:start], +@racket[match:end], @racket[match:substring], and @racket[regexp-exec] +are defined. These @racketidfont{match:} procedures must be used to extract match information in a regular expression clause when using -the @scheme[=>] form. } +the @racket[=>] form. } @deftogether[( @defproc[(match:start [rec ....] @@ -58,12 +58,12 @@ the @scheme[=>] form. } Extracts a start position, end position, or substring corresponding to a match. The first argument is the value supplied to the procedure -after @scheme[=>] in a @scheme[awk] clause or the result of -@scheme[regexp-exec].} +after @racket[=>] in a @racket[awk] clause or the result of +@racket[regexp-exec].} @defproc[(regexp-exec [re (or/c string? regexp?)] [s string?]) (or/c .... false/c)]{ Matches a regexp to a string, returning a record compatible with -@scheme[match:start], etc.} +@racket[match:start], etc.} diff --git a/collects/mzlib/scribblings/class100.scrbl b/collects/mzlib/scribblings/class100.scrbl index 7af06b6009..1c86276e92 100644 --- a/collects/mzlib/scribblings/class100.scrbl +++ b/collects/mzlib/scribblings/class100.scrbl @@ -6,19 +6,19 @@ @mzlib[#:mode title class100] -The @scheme[class100] and @scheme[class100*] forms provide a syntax -close to that of @scheme[class] and @scheme[class*] in Racket +The @racket[class100] and @racket[class100*] forms provide a syntax +close to that of @racket[class] and @racket[class*] in Racket versions 100 through 103, but with the semantics of the current -@schememodname[scheme/class]-based class system. For a class defined -with @scheme[class100], keyword-based initialization arguments can be +@racketmodname[scheme/class]-based class system. For a class defined +with @racket[class100], keyword-based initialization arguments can be propagated to the superclass, but by-position arguments are not (i.e., -the expansion of @scheme[class100] to @scheme[class] always includes -an @scheme[init-rest] clause). +the expansion of @racket[class100] to @racket[class] always includes +an @racket[init-rest] clause). -The @scheme[class100] form uses keywords (e.g., @scheme[public]) that -are defined by the @schememodname[mzlib/class] library, so typically -@schememodname[scheme/class] must be imported into any context that -imports @schememodname[mzlib/class100]. +The @racket[class100] form uses keywords (e.g., @racket[public]) that +are defined by the @racketmodname[mzlib/class] library, so typically +@racketmodname[scheme/class] must be imported into any context that +imports @racketmodname[mzlib/class100]. @defform/subs[ @@ -60,24 +60,24 @@ imports @schememodname[mzlib/class100]. ...) ]{ -Like @scheme[class100*], but without @scheme[interface-expr]s.} +Like @racket[class100*], but without @racket[interface-expr]s.} @defform[(class100-asi superclass instance-id-clause ...)]{ -Like @scheme[class100], but all initialization arguments are +Like @racket[class100], but all initialization arguments are automatically passed on to the superclass initialization procedure by position.} @defform[(class100*-asi superclass interfaces instance-id-clause ...)]{ -Like @scheme[class100*], but all initialization arguments are +Like @racket[class100*], but all initialization arguments are automatically passed on to the superclass initialization procedure by position.} @defform[(super-init init-arg-expr ...)]{ -An alias for @scheme[super-make-object].} +An alias for @racket[super-make-object].} diff --git a/collects/mzlib/scribblings/cmdline.scrbl b/collects/mzlib/scribblings/cmdline.scrbl index 420f9bc615..18b871be75 100644 --- a/collects/mzlib/scribblings/cmdline.scrbl +++ b/collects/mzlib/scribblings/cmdline.scrbl @@ -4,16 +4,16 @@ @(define-syntax-rule (intro id) (begin - (require (for-label scheme/cmdline)) - (define id (scheme command-line)))) -@(intro scheme-command-line) + (require (for-label racket/cmdline)) + (define id (racket command-line)))) +@(intro racket-command-line) @mzlib[#:mode title cmdline] -Provides a @scheme[command-line] from that is similar to the one in -@schememodname[scheme/cmdline], but without using keywords. The -@scheme[parse-command-line] procedure from -@schememodname[scheme/cmdline] is re-exported directly. +Provides a @racket[command-line] from that is similar to the one in +@racketmodname[racket/cmdline], but without using keywords. The +@racket[parse-command-line] procedure from +@racketmodname[racket/cmdline] is re-exported directly. @defform/subs[ #:literals (multi once-each once-any final help-labels args =>) @@ -34,5 +34,5 @@ Provides a @scheme[command-line] from that is similar to the one in (id ...) (id ...+ . id)])]{ -Like @scheme-command-line from @scheme[scheme/cmdline], but without +Like @racket-command-line from @racket[racket/cmdline], but without keywords in the syntax.} diff --git a/collects/mzlib/scribblings/cml.scrbl b/collects/mzlib/scribblings/cml.scrbl index ef15f15ead..fcc46f6397 100644 --- a/collects/mzlib/scribblings/cml.scrbl +++ b/collects/mzlib/scribblings/cml.scrbl @@ -4,7 +4,7 @@ @mzlib[#:mode title cml] -The @schememodname[mzlib/cml] library defines a number of procedures +The @racketmodname[mzlib/cml] library defines a number of procedures that wrap Racket concurrency procedures. The wrapper procedures have names and interfaces that more closely match those of Concurrent ML @cite["Reppy99"]. @@ -12,34 +12,34 @@ ML @cite["Reppy99"]. @defproc[(spawn [thunk (-> any)]) thread?]{ -Equivalent to @scheme[(thread/suspend-to-kill thunk)].} +Equivalent to @racket[(thread/suspend-to-kill thunk)].} @defproc[(channel) channel?]{ -Equivalent to @scheme[(make-channel)].} +Equivalent to @racket[(make-channel)].} @defproc[(channel-recv-evt [ch channel?]) evt?]{ -Equivalent to @scheme[ch].} +Equivalent to @racket[ch].} @defproc[(channel-send-evt [ch channel?][v any/c]) evt?]{ -Equivalent to @scheme[(channel-put-evt ch v)].} +Equivalent to @racket[(channel-put-evt ch v)].} @defproc[(thread-done-evt [thd thread?]) any]{ -Equivalent to @scheme[(thread-dead-evt thread)].} +Equivalent to @racket[(thread-dead-evt thread)].} @defproc[(current-time) real?]{ -Equivalent to @scheme[(current-inexact-milliseconds)].} +Equivalent to @racket[(current-inexact-milliseconds)].} @defproc[(time-evt [tm real?]) evt?]{ -Equivalent to @scheme[(alarm-evt tm)].} +Equivalent to @racket[(alarm-evt tm)].} diff --git a/collects/mzlib/scribblings/compat.scrbl b/collects/mzlib/scribblings/compat.scrbl index 6e0274099a..6567208e4b 100644 --- a/collects/mzlib/scribblings/compat.scrbl +++ b/collects/mzlib/scribblings/compat.scrbl @@ -9,10 +9,10 @@ @mzlib[#:mode title compat] -The @schememodname[mzlib/compat] library defines a number of +The @racketmodname[mzlib/compat] library defines a number of procedures and syntactic forms that are commonly provided by other Scheme implementations. Most of the procedures are aliases for -@schememodname[mzscheme] procedures. +@racketmodname[mzscheme] procedures. @deftogether[( @defproc[(=? [n number?] ...+) boolean?] @@ -22,33 +22,33 @@ Scheme implementations. Most of the procedures are aliases for @defproc[(>=? [n real?] ...+) boolean?] )]{ -Same as @scheme[=], @scheme[<], etc.} +Same as @racket[=], @racket[<], etc.} @deftogether[( @defproc[(1+ [n number?]) number?] @defproc[(1- [n number?]) number?] )]{ -Same as @scheme[add1] and @scheme[sub1].} +Same as @racket[add1] and @racket[sub1].} @defproc[(gentmp [base (or/c string? symbol?) "g"]) symbol?]{ -Same as @scheme[gensym].} +Same as @racket[gensym].} @defproc[(flush-output-port [o output-port? (current-output-port)]) void?]{ -Same as @scheme[flush-output].} +Same as @racket[flush-output].} @defproc[(real-time) exact-integer?]{ -Same as @scheme[current-milliseconds].} +Same as @racket[current-milliseconds].} @defproc[(atom? [v any/c]) any]{ -Same as @scheme[(not (pair? v))] (which does not actually imply an +Same as @racket[(not (pair? v))] (which does not actually imply an atomic value).} @@ -56,17 +56,17 @@ atomic value).} (define-structure (name-id field-id ...) ((init-field-id init-expr) ...))]]{ -Like @scheme[define-struct], except that the @scheme[name-id] is moved +Like @racket[define-struct], except that the @racket[name-id] is moved inside the parenthesis for fields. In addition, -@scheme[init-field-id]s can be specified with automatic initial-value +@racket[init-field-id]s can be specified with automatic initial-value expression. -The @scheme[init-field-id]s do not have corresponding arguments for -the @schemeidfont{make-}@scheme[name-id] constructor. Instead, each -@scheme[init-field-id]'s @scheme[init-expr] is evaluated to obtain the -field's value when the constructor is called. The @scheme[field-id]s -are bound in @scheme[init-expr]s, but not other -@scheme[init-field-id]s. +The @racket[init-field-id]s do not have corresponding arguments for +the @racketidfont{make-}@racket[name-id] constructor. Instead, each +@racket[init-field-id]'s @racket[init-expr] is evaluated to obtain the +field's value when the constructor is called. The @racket[field-id]s +are bound in @racket[init-expr]s, but not other +@racket[init-field-id]s. @examples[ #:eval compat-eval @@ -79,18 +79,18 @@ are bound in @scheme[init-expr]s, but not other @defproc[(putprop [sym symbol?][property symbol?][value any/c]) void?] )]{ -The @scheme[getprop] function gets a property value associated with -@scheme[sym]. The @scheme[property] argument names the property to be -found. If the property is not found, @scheme[default] is returned. +The @racket[getprop] function gets a property value associated with +@racket[sym]. The @racket[property] argument names the property to be +found. If the property is not found, @racket[default] is returned. -The properties obtained with @scheme[getprop] are the ones installed -with @scheme[putprop].} +The properties obtained with @racket[getprop] are the ones installed +with @racket[putprop].} @defproc[(new-cafe [eval-handler (any/c . -> . any) #f]) any]{ -Emulates Chez Scheme's @scheme[new-cafe] by installing -@scheme[eval-handler] into the @scheme[current-eval] parameter while -running @scheme[read-eval-print]. In addition, @scheme[current-exit] -is set to escape from the call to @scheme[new-cafe].} +Emulates Chez Scheme's @racket[new-cafe] by installing +@racket[eval-handler] into the @racket[current-eval] parameter while +running @racket[read-eval-print]. In addition, @racket[current-exit] +is set to escape from the call to @racket[new-cafe].} diff --git a/collects/mzlib/scribblings/compile.scrbl b/collects/mzlib/scribblings/compile.scrbl index 165316edb1..572ba3142b 100644 --- a/collects/mzlib/scribblings/compile.scrbl +++ b/collects/mzlib/scribblings/compile.scrbl @@ -13,22 +13,22 @@ [filter (any/c . -> . any/c) values]) path?]{ -Compiles the Scheme file @scheme[src] and saves the compiled code to -@scheme[dest]. If @scheme[dest] is not provided and the +Compiles the Scheme file @racket[src] and saves the compiled code to +@racket[dest]. If @racket[dest] is not provided and the @filepath{compiled} subdirectory does not already exist, the -subdirectory is created. The result of @scheme[compile-file] is the +subdirectory is created. The result of @racket[compile-file] is the destination file's path. -If the @scheme[filter] procedure is provided, it is applied to each +If the @racket[filter] procedure is provided, it is applied to each source expression, and the result is compiled. -The @scheme[compile-file] procedure is designed for compiling modules -files, in that each expression in @scheme[src] is compiled -independently. If @scheme[src] does not contain a single -@scheme[module] expression, then earlier expressions can affect the -compilation of later expressions when @scheme[src] is loaded -directly. An appropriate @scheme[filter] can make compilation behave +The @racket[compile-file] procedure is designed for compiling modules +files, in that each expression in @racket[src] is compiled +independently. If @racket[src] does not contain a single +@racket[module] expression, then earlier expressions can affect the +compilation of later expressions when @racket[src] is loaded +directly. An appropriate @racket[filter] can make compilation behave like evaluation, but the problem is also solved (as much as possible) -by the @scheme[compile-zos] procedure. +by the @racket[compile-zos] procedure. -See also @scheme[managed-compile-zo].} +See also @racket[managed-compile-zo].} diff --git a/collects/mzlib/scribblings/contract.scrbl b/collects/mzlib/scribblings/contract.scrbl index 769a903b69..fb3f050d0f 100644 --- a/collects/mzlib/scribblings/contract.scrbl +++ b/collects/mzlib/scribblings/contract.scrbl @@ -143,7 +143,7 @@ This is a restricted form of @racketmodname[racket/contract]'s @r:-> contract that does not handle keyword arguments or multiple value results. - + } @defform*/subs[((->* (contract-dom-expr ...) ->*rng) @@ -165,16 +165,15 @@ This is a restricted form of @racketmodname[racket/contract]'s (#,r:->* (contract-expr ...) #:rest contract-rest-expr (values contract-rng-expr ...))] - + } - + @defform*[((opt-> (contract-req-expr ...) (contact-opt-expr ...) any) (opt-> (contract-req-expr ...) (contact-opt-expr ...) contract-rng-expr))]{ - The @racket[opt->] form is a simplified verison of @racketmodname[racket/contract]'s @|r:->*| and appearances of @racket[opt->] can be simply replaced with @|r:->*|. - + } @defform*[((opt->* (contract-req-expr ...) (contact-opt-expr ...) any) @@ -245,7 +244,7 @@ This is a restricted form of @racketmodname[racket/contract]'s (and does lax checking; see @r:->d for details). } - + @defform*[((->pp ([dom-x contract-dom-expr] ...) pre-cond-expr any) (->pp ([dom-x contract-dom-expr] ...) pre-cond-expr @@ -280,7 +279,7 @@ This is a restricted form of @racketmodname[racket/contract]'s post-cond-expr))]{ Like @racket[->pp], but with an additional contract for the rest arguments of the function. } - + @defform[(case-> mzlib/contract-arrow-contract-expr ...)]{ Builds a contract analogous to @racket[case-lambda], where each case comes from one of the contract expression arguments diff --git a/collects/mzlib/scribblings/defmacro.scrbl b/collects/mzlib/scribblings/defmacro.scrbl index e30e508170..9c28c01470 100644 --- a/collects/mzlib/scribblings/defmacro.scrbl +++ b/collects/mzlib/scribblings/defmacro.scrbl @@ -16,14 +16,14 @@ (id ...+ . id)])] )]{ -Defines a (non-hygienic) macro @scheme[id] through a procedure that +Defines a (non-hygienic) macro @racket[id] through a procedure that manipulates S-expressions, as opposed to @techlink[#:doc ref]{syntax objects}. -In the first form, @scheme[expr] must produce a procedure. In the -second form, @scheme[formals] determines the formal arguments of the -procedure, as in @scheme[lambda], and the @scheme[expr]s are the -procedure body. The last form, with @scheme[defmacro], is like the +In the first form, @racket[expr] must produce a procedure. In the +second form, @racket[formals] determines the formal arguments of the +procedure, as in @racket[lambda], and the @racket[expr]s are the +procedure body. The last form, with @racket[defmacro], is like the second form, but with slightly different parentheses. In all cases, the procedure is generated in the @techlink[#:doc @@ -31,14 +31,14 @@ ref]{transformer environment}, not the normal environment. In a use of the macro, -@schemeblock[ +@racketblock[ (id datum ...) ] -@scheme[syntax->datum] is applied to the expression, and the -transformer procedure is applied to the @scheme[cdr] of the resulting -list. If the number of @scheme[datum]s does not match the procedure's -arity, or if @scheme[id] is used in a context that does not match the +@racket[syntax->datum] is applied to the expression, and the +transformer procedure is applied to the @racket[cdr] of the resulting +list. If the number of @racket[datum]s does not match the procedure's +arity, or if @racket[id] is used in a context that does not match the above pattern, then a syntax error is reported. After the macro procedure returns, the result is compared to the @@ -51,17 +51,17 @@ information in many cases, despite the macro procedure's operation on raw S-expressions. After substituting syntax objects for preserved values, the entire -macro result is converted to syntax with @scheme[datum->syntax]. The +macro result is converted to syntax with @racket[datum->syntax]. The original expression supplies the lexical context and source location for converted elements. -@bold{Important:} Although @scheme[define-macro] is non-hygienic, it +@bold{Important:} Although @racket[define-macro] is non-hygienic, it is still restricted by Racket's phase separation rules. This means that a macro cannot access run-time bindings, because it is executed in the syntax-expansion phase. Translating code that -involves @scheme[define-macro] or @scheme[defmacro] from an +involves @racket[define-macro] or @racket[defmacro] from an implementation without this restriction usually implies separating -macro related functionality into a @scheme[begin-for-syntax] or a -module (that will be imported with @scheme[require-for-syntax]) and +macro related functionality into a @racket[begin-for-syntax] or a +module (that will be imported with @racket[require-for-syntax]) and properly distinguishing syntactic information from run-time information.} diff --git a/collects/mzlib/scribblings/etc.scrbl b/collects/mzlib/scribblings/etc.scrbl index 2b7abc672a..406955e5a1 100644 --- a/collects/mzlib/scribblings/etc.scrbl +++ b/collects/mzlib/scribblings/etc.scrbl @@ -22,10 +22,10 @@ @mzlib[#:mode title etc] -The @schememodname[mzlib/etc] library re-exports the following -@schememodname[scheme/base] and other libraries: +The @racketmodname[mzlib/etc] library re-exports the following +@racketmodname[scheme/base] and other libraries: -@schemeblock[ +@racketblock[ boolean=? true false @@ -39,20 +39,20 @@ The @schememodname[mzlib/etc] library re-exports the following @defform[(begin-lifted expr ...+)] -Lifts the @scheme[expr]s so that they are evaluated once at the ``top +Lifts the @racket[expr]s so that they are evaluated once at the ``top level'' of the current context, and the result of the last -@scheme[expr] is used for every evaluation of the -@scheme[begin-lifted] form. +@racket[expr] is used for every evaluation of the +@racket[begin-lifted] form. When this form is used as a run-time expression within a module, the ``top level'' corresponds to the module's top level, so that each -@scheme[expr] is evaluated once for each invocation of the +@racket[expr] is evaluated once for each invocation of the module. When it is used as a run-time expression outside of a module, the ``top level'' corresponds to the true top level. When this form is -used in a @scheme[define-syntax], @scheme[letrec-syntax], +used in a @racket[define-syntax], @racket[letrec-syntax], etc. binding, the ``top level'' corresponds to the beginning of the binding's right-hand side. Other forms may redefine ``top level'' -(using @scheme[local-expand/capture-lifts]) for the expressions that +(using @racket[local-expand/capture-lifts]) for the expressions that they enclose. @defform[(begin-with-definitions defn-or-expr ...)]{ @@ -61,19 +61,19 @@ The same as @racket[(block defn-or-expr ...)].} @defform[(define-syntax-set (id ...) defn ...)]{ -Similar to @scheme[define-syntaxes], but instead of a single body +Similar to @racket[define-syntaxes], but instead of a single body expression, a sequence of definitions follows the sequence of defined -identifiers. For each @scheme[identifier], the @scheme[defn]s should -include a definition for @scheme[id]@schemeidfont{/proc}. The value -for @scheme[id]@schemeidfont{/proc} is used as the (expansion-time) -value for @scheme[id]. +identifiers. For each @racket[identifier], the @racket[defn]s should +include a definition for @racket[id]@racketidfont{/proc}. The value +for @racket[id]@racketidfont{/proc} is used as the (expansion-time) +value for @racket[id]. -The @scheme[define-syntax-set] form is useful for defining a set of +The @racket[define-syntax-set] form is useful for defining a set of syntax transformers that share helper functions, though -@scheme[begin-for-syntax] now serves essentially the same purposes. +@racket[begin-for-syntax] now serves essentially the same purposes. @as-examples[ -@schemeblock[ +@racketblock[ (define-syntax-set (let-current-continuation let-current-escape-continuation) (define (mk call-id) @@ -93,22 +93,22 @@ syntax transformers that share helper functions, though [(evcase key-expr (value-expr body-expr ...) ...+) (evcase key-expr (value-expr body-expr ...) ... [else body-expr ...])]]{ -The @scheme[evcase] form is similar to @scheme[case], except that +The @racket[evcase] form is similar to @racket[case], except that expressions are provided in each clause instead of a sequence of -data. After @scheme[key-expr] is evaluated, each @scheme[value-expr] -is evaluated until a value is found that is @scheme[eqv?] to the key +data. After @racket[key-expr] is evaluated, each @racket[value-expr] +is evaluated until a value is found that is @racket[eqv?] to the key value; when a matching value is found, the corresponding -@scheme[body-expr]s are evaluated and the value(s) for the last is the -result of the entire @scheme[evcase] expression. +@racket[body-expr]s are evaluated and the value(s) for the last is the +result of the entire @racket[evcase] expression. -The @scheme[else] literal is recognized either as unbound (like in the -@schememodname[mzscheme] language) or bound as @|base-else| from -@schememodname[scheme/base].} +The @racket[else] literal is recognized either as unbound (like in the +@racketmodname[mzscheme] language) or bound as @|base-else| from +@racketmodname[scheme/base].} @defproc[(identity [v any/c]) any/c]{ -Returns @scheme[v].} +Returns @racket[v].} @defform/subs[#:literals (val rec vals recs _ values) @@ -123,34 +123,34 @@ Returns @scheme[v].} A binding construct that specifies scoping on a per-binding basis instead of a per-expression basis. It helps eliminate rightward-drift -in programs. It looks similar to @scheme[let], except each clause has +in programs. It looks similar to @racket[let], except each clause has an additional keyword tag before the binding variables. -Each @scheme[clause] has one of the following forms: +Each @racket[clause] has one of the following forms: @itemize[ - @item{@scheme[(val target expr)] : Binds @scheme[target] - non-recursively to @scheme[expr].} + @item{@racket[(val target expr)] : Binds @racket[target] + non-recursively to @racket[expr].} - @item{@scheme[(rec target expr)] : Binds @scheme[target] recursively to - @scheme[expr].} + @item{@racket[(rec target expr)] : Binds @racket[target] recursively to + @racket[expr].} - @item{@scheme[(vals (target expr) ...)] : The @scheme[target]s are - bound to the @scheme[expr]s. The environment of the @scheme[expr]s is + @item{@racket[(vals (target expr) ...)] : The @racket[target]s are + bound to the @racket[expr]s. The environment of the @racket[expr]s is the environment active before this clause.} - @item{@scheme[(recs (target expr) ...)] : The @scheme[targets]s are - bound to the @scheme[expr]s. The environment of the @scheme[expr]s - includes all of the @scheme[targets]s.} + @item{@racket[(recs (target expr) ...)] : The @racket[targets]s are + bound to the @racket[expr]s. The environment of the @racket[expr]s + includes all of the @racket[targets]s.} - @item{@scheme[(_ expr ...)] : Evaluates the @scheme[expr]s without + @item{@racket[(_ expr ...)] : Evaluates the @racket[expr]s without binding any variables.} ] -The clauses bind left-to-right. When a @scheme[target] is -@scheme[(values id ...)], multiple values returned by the +The clauses bind left-to-right. When a @racket[target] is +@racket[(values id ...)], multiple values returned by the corresponding expression are bound to the multiple variables. @examples[ @@ -170,10 +170,10 @@ corresponding expression are bound to the multiple variables. [f (any/c . -> . any)]) void?]{ -Repeatedly invokes the @scheme[f] procedure until the @scheme[done?] -procedure returns @scheme[#t]: +Repeatedly invokes the @racket[f] procedure until the @racket[done?] +procedure returns @racket[#t]: -@schemeblock[ +@racketblock[ (define (loop-until start done? next f) (let loop ([i start]) (unless (done? i) @@ -184,29 +184,29 @@ procedure returns @scheme[#t]: @defproc[(namespace-defined? [sym symbol?]) boolean?]{ -Returns @scheme[#t] if @scheme[namespace-variable-value] would return -a value for @scheme[sym], @scheme[#f] otherwise.} +Returns @racket[#t] if @racket[namespace-variable-value] would return +a value for @racket[sym], @racket[#f] otherwise.} @defform[(nand expr ...)]{ -Same as @scheme[(not (and expr ...))].} +Same as @racket[(not (and expr ...))].} @defform[(nor expr ...)]{ -Same as @scheme[(not (or expr ...))].} +Same as @racket[(not (or expr ...))].} @defform[(opt-lambda formals body ...+)]{ Supports optional (but not keyword) arguments like @base-lambda from -@scheme[scheme/base].} +@racket[scheme/base].} @defform[(recur id bindings body ...+)]{ -Equivalent to @scheme[(let id bindings body ...+)].} +Equivalent to @racket[(let id bindings body ...+)].} @defform*[[(rec id value-expr) @@ -215,7 +215,7 @@ Equivalent to @scheme[(let id bindings body ...+)].} Equivalent, respectively, to -@schemeblock[ +@racketblock[ (letrec ([id value-expr]) id) (letrec ([id (lambda (arg-id ...) value-expr)]) id) (letrec ([id (lambda (arg-id ... . rest-id) value-expr)]) id) @@ -225,45 +225,45 @@ Equivalent, respectively, to @defform*[[(this-expression-source-directory) (this-expression-source-directory datum)]]{ -@margin-note{See @schememodname[scheme/runtime-path] for a definition form +@margin-note{See @racketmodname[scheme/runtime-path] for a definition form that works better when creating executables.} Expands to an expression that evaluates to the directory of the file -containing the source @scheme[datum]. If @scheme[datum] is not -supplied, then the entire @scheme[(this-expression-source-directory)] -expression is used as @scheme[datum]. +containing the source @racket[datum]. If @racket[datum] is not +supplied, then the entire @racket[(this-expression-source-directory)] +expression is used as @racket[datum]. -If @scheme[datum] has a source module, then the expansion attempts to +If @racket[datum] has a source module, then the expansion attempts to determine the module's run-time location. This location is determined -by preserving the lexical context of @scheme[datum] in a syntax +by preserving the lexical context of @racket[datum] in a syntax object, extracting its source module path at run time, and then resolving the module path. -Otherwise, @scheme[datum]'s source file is determined through source -location information associated with @scheme[datum], if it is -present. As a last resort, @scheme[current-load-relative-directory] is -used if it is not @scheme[#f], and @scheme[current-directory] is used +Otherwise, @racket[datum]'s source file is determined through source +location information associated with @racket[datum], if it is +present. As a last resort, @racket[current-load-relative-directory] is +used if it is not @racket[#f], and @racket[current-directory] is used if all else fails. A directory path derived from source location is always stored in bytes in the expanded code, unless the file is within the result of -@scheme[find-collects-dir], in which case the expansion records the -path relative to @scheme[(find-collects-dir)] and then reconstructs it -using @scheme[(find-collects-dir)] at run time.} +@racket[find-collects-dir], in which case the expansion records the +path relative to @racket[(find-collects-dir)] and then reconstructs it +using @racket[(find-collects-dir)] at run time.} @defform*[[(this-expression-file-name) (this-expression-file-name datum)]]{ -Similar to @scheme[this-expression-source-directory], except that only -source information associated with @scheme[datum] or -@scheme[(this-expression-file-name)] is used to extract a filename. If -no filename is available, the result is @scheme[#f].} +Similar to @racket[this-expression-source-directory], except that only +source information associated with @racket[datum] or +@racket[(this-expression-file-name)] is used to extract a filename. If +no filename is available, the result is @racket[#f].} @defform[#:literals (quote unsyntax scheme) (hash-table (#,(scheme quote) flag) ... (key-expr val-expr) ...)]{ Creates a new hash-table providing the quoted flags (if any) to -@scheme[make-hash-table], and then mapping each key to the +@racket[make-hash-table], and then mapping each key to the corresponding values.} diff --git a/collects/mzlib/scribblings/file.scrbl b/collects/mzlib/scribblings/file.scrbl index 64c520a64a..75907c6908 100644 --- a/collects/mzlib/scribblings/file.scrbl +++ b/collects/mzlib/scribblings/file.scrbl @@ -6,10 +6,10 @@ @mzlib[#:mode title file] -The @schememodname[mzlib/file] library mostly re-exports from -@schememodname[scheme/file]: +The @racketmodname[mzlib/file] library mostly re-exports from +@racketmodname[scheme/file]: -@schemeblock[ +@racketblock[ find-relative-path explode-path normalize-path @@ -40,9 +40,9 @@ pathlist-closure any] )]{ -Like @scheme[call-with-input-file]and @scheme[call-with-output-file], +Like @racket[call-with-input-file]and @racket[call-with-output-file], except that the opened port is closed if control escapes from the body -of @scheme[proc].} +of @racket[proc].} @deftogether[( @defproc[(build-relative-path [base (or/c path-string? @@ -60,5 +60,5 @@ of @scheme[proc].} (and/c path? absolute-path?)] )]{ -Like @scheme[build-path], but with extra constraints to ensure a +Like @racket[build-path], but with extra constraints to ensure a relative or absolute result.} diff --git a/collects/mzlib/scribblings/for.scrbl b/collects/mzlib/scribblings/for.scrbl index e67d271bfa..45bd40dd67 100644 --- a/collects/mzlib/scribblings/for.scrbl +++ b/collects/mzlib/scribblings/for.scrbl @@ -4,10 +4,10 @@ @mzlib[#:mode title for] -The @schememodname[mzlib/for] library re-exports from -@schememodname[scheme/base]: +The @racketmodname[mzlib/for] library re-exports from +@racketmodname[scheme/base]: -@schemeblock[ +@racketblock[ for/fold for*/fold for for* for/list for*/list diff --git a/collects/mzlib/scribblings/include.scrbl b/collects/mzlib/scribblings/include.scrbl index 8056d096cf..ee88d9f946 100644 --- a/collects/mzlib/scribblings/include.scrbl +++ b/collects/mzlib/scribblings/include.scrbl @@ -4,7 +4,7 @@ @mzlib[#:mode title include] -Similar to @schememodname[scheme/include], but with a different syntax +Similar to @racketmodname[scheme/include], but with a different syntax for paths. @defform/subs[#:literals (build-path lib up same) @@ -17,7 +17,7 @@ for paths. same])]{ Inlines the syntax in the designated file in place of the -@scheme[include] expression. The @scheme[path-spec] can be any of the +@racket[include] expression. The @racket[path-spec] can be any of the following: @itemize[ @@ -26,36 +26,36 @@ following: according to the platform's conventions (which means that it is not portable).} - @item{A path construction of the form @scheme[(build-path elem - ...+)], where @scheme[build-path] is - @scheme[module-identifier=?] either to the @scheme[build-path] - export from @scheme[mzscheme] or to the top-level - @scheme[build-path], and where each @scheme[elem] is a path - string, @scheme[up] (unquoted), or @scheme[same] (unquoted). - The @scheme[elem]s are combined in the same way as for the - @scheme[build-path] function to obtain the path to include.} + @item{A path construction of the form @racket[(build-path elem + ...+)], where @racket[build-path] is + @racket[module-identifier=?] either to the @racket[build-path] + export from @racket[mzscheme] or to the top-level + @racket[build-path], and where each @racket[elem] is a path + string, @racket[up] (unquoted), or @racket[same] (unquoted). + The @racket[elem]s are combined in the same way as for the + @racket[build-path] function to obtain the path to include.} - @item{A path construction of the form @scheme[(lib file-string - collection-string ...)], where @scheme[lib] is free or refers - to a top-level @scheme[lib] variable. The - @scheme[collection-string]s are passed to - @scheme[collection-path] to obtain a directory; if no - @scheme[collection-strings]s are supplied, @scheme["mzlib"] is - used. The @scheme[file-string] is then appended to the - directory using @scheme[build-path] to obtain the path to + @item{A path construction of the form @racket[(lib file-string + collection-string ...)], where @racket[lib] is free or refers + to a top-level @racket[lib] variable. The + @racket[collection-string]s are passed to + @racket[collection-path] to obtain a directory; if no + @racket[collection-strings]s are supplied, @racket["mzlib"] is + used. The @racket[file-string] is then appended to the + directory using @racket[build-path] to obtain the path to include.} ] -If @scheme[path-spec] specifies a relative path to include, the path -is resolved relative to the source for the @scheme[include] +If @racket[path-spec] specifies a relative path to include, the path +is resolved relative to the source for the @racket[include] expression, if that source is a complete path string. If the source is -not a complete path string, then @scheme[path-spec] is resolved +not a complete path string, then @racket[path-spec] is resolved relative to the current load relative directory if one is available, or to the current directory otherwise. The included syntax is given the lexical context of the -@scheme[include] expression.} +@racket[include] expression.} @deftogether[( @defform[(include-at/relative-to context source path-spec)] @@ -63,6 +63,6 @@ The included syntax is given the lexical context of the @defform[(include/reader path-spec reader-expr)] )]{ -Variants of @scheme[include] analogous to the variants of -@schememodname[scheme/include].} +Variants of @racket[include] analogous to the variants of +@racketmodname[scheme/include].} diff --git a/collects/mzlib/scribblings/integer-set.scrbl b/collects/mzlib/scribblings/integer-set.scrbl index 5d66d66880..73c25aaa46 100644 --- a/collects/mzlib/scribblings/integer-set.scrbl +++ b/collects/mzlib/scribblings/integer-set.scrbl @@ -4,7 +4,7 @@ @mzlib[#:mode title integer-set] -The @schememodname[mzlib/integer-set] library provides functions for +The @racketmodname[mzlib/integer-set] library provides functions for working with finite sets of integers. This module is designed for sets that are compactly represented as groups of intervals, even when their cardinality is large. For example, the set of integers from @@ -19,9 +19,9 @@ In addition to the @defterm{integer set} abstract type, a each pair represents a closed range of integers, and the entire set is the union of the ranges. The ranges must be disjoint and increasing. Further, adjacent ranges must have at least one integer between them. -For example: @scheme['((-1 . 2) (4 . 10))] is a well-formed-set as is -@scheme['((1 . 1) (3 . 3))], but @scheme['((1 . 5) (6 . 7))], -@scheme['((1 . 5) (-3 . -1))], @scheme['((5 . 1))], and @scheme['((1 +For example: @racket['((-1 . 2) (4 . 10))] is a well-formed-set as is +@racket['((1 . 1) (3 . 3))], but @racket['((1 . 5) (6 . 7))], +@racket['((1 . 5) (-3 . -1))], @racket['((5 . 1))], and @racket['((1 . 5) (3 . 6))] are not. @@ -42,12 +42,12 @@ Mutates an integer set.} @defproc[(integer-set? [v any/c]) boolean?]{ -Returns @scheme[#t] if @scheme[v] is an integer set, @scheme[#f] +Returns @racket[#t] if @racket[v] is an integer set, @racket[#f] otherwise.} @defproc[(well-formed-set? [v any/c]) boolean?]{ -Returns @scheme[#t] if @scheme[v] is a well-formed set, @scheme[#f] +Returns @racket[#t] if @racket[v] is a well-formed set, @racket[#f] otherwise.} @defproc*[([(make-range) integer-set?] @@ -56,9 +56,9 @@ otherwise.} [end exact-integer?]) integer-set?])]{ Produces, respectively, an empty integer set, an integer set -containing only @scheme[elem], or an integer set containing the -integers from @scheme[start] to @scheme[end] inclusive, where -@scheme[(start . <= . end)].} +containing only @racket[elem], or an integer set containing the +integers from @racket[start] to @racket[end] inclusive, where +@racket[(start . <= . end)].} @defproc[(intersect [x integer-set?][y integer-set?]) integer-set?]{ @@ -68,8 +68,8 @@ Returns the intersection of the given sets.} @defproc[(difference [x integer-set?][y integer-set?]) integer-set?]{ -Returns the difference of the given sets (i.e., elements in @scheme[x] -that are not in @scheme[y]).} +Returns the difference of the given sets (i.e., elements in @racket[x] +that are not in @racket[y]).} @defproc[(union [x integer-set?][y integer-set?]) integer-set?]{ @@ -79,36 +79,36 @@ Returns the union of the given sets.} @defproc[(split [x integer-set?][y integer-set?]) integer-set?]{ -Produces three values: the first is the intersection of @scheme[x] and -@scheme[y], the second is the difference @scheme[x] remove @scheme[y], -and the third is the difference @scheme[y] remove @scheme[x].} +Produces three values: the first is the intersection of @racket[x] and +@racket[y], the second is the difference @racket[x] remove @racket[y], +and the third is the difference @racket[y] remove @racket[x].} @defproc[(complement [s integer-set?] [start exact-integer?] [end exact-integer?]) any] -Returns the a set containing the elements between @scheme[start] to -@scheme[end] inclusive that are not in @scheme[s], where -@scheme[(start-k . <= . end-k)].} +Returns the a set containing the elements between @racket[start] to +@racket[end] inclusive that are not in @racket[s], where +@racket[(start-k . <= . end-k)].} @defproc[(xor [x integer-set?][y integer-set?]) integer-set?]{ -Returns an integer set containing every member of @scheme[x] -and @scheme[y] that is not in both sets.} +Returns an integer set containing every member of @racket[x] +and @racket[y] that is not in both sets.} @defproc[(member? [k exact-integer?][s integer-set?]) boolean?]{ -Returns @scheme[#t] if @scheme[k] is in @scheme[s], @scheme[#f] +Returns @racket[#t] if @racket[k] is in @racket[s], @racket[#f] otherwise.} @defproc[(get-integer [integer-set any/c]) (or/c exact-integer? false/c)]{ -Returns a member of @scheme[integer-set], or @scheme[#f] if -@scheme[integer-set] is empty.} +Returns a member of @racket[integer-set], or @racket[#f] if +@racket[integer-set] is empty.} @defproc[(foldr [proc (exact-integer? any/c . -> . any/c)] @@ -116,21 +116,21 @@ Returns a member of @scheme[integer-set], or @scheme[#f] if [s integer-set?]) any/c]{ -Applies @scheme[proc] to each member of @scheme[s] in ascending order, -where the first argument to @scheme[proc] is the set member, and the -second argument is the fold result starting with @scheme[base-v]. For -example, @scheme[(foldr cons null s)] returns a list of all the -integers in @scheme[s], sorted in increasing order.} +Applies @racket[proc] to each member of @racket[s] in ascending order, +where the first argument to @racket[proc] is the set member, and the +second argument is the fold result starting with @racket[base-v]. For +example, @racket[(foldr cons null s)] returns a list of all the +integers in @racket[s], sorted in increasing order.} @defproc[(partition [s integer-set-list?]) (listof integer-set?)]{ -Returns the coarsest refinement of the sets in @scheme[s] such that +Returns the coarsest refinement of the sets in @racket[s] such that the sets in the result list are pairwise disjoint. For example, -partitioning the sets that represent @scheme['((1 . 2) (5 . 10))] and -@scheme['((2 . 2) (6 . 6) (12 . 12))] produces the a list containing -the sets for @scheme['((1 . 1) (5 . 5) (7 . 10))] @scheme['((2 . 2) (6 -. 6))], and @scheme['((12 . 12))].} +partitioning the sets that represent @racket['((1 . 2) (5 . 10))] and +@racket['((2 . 2) (6 . 6) (12 . 12))] produces the a list containing +the sets for @racket['((1 . 1) (5 . 5) (7 . 10))] @racket['((2 . 2) (6 +. 6))], and @racket['((12 . 12))].} @defproc[(card [s integer-set?]) exact-nonnegative-integer?]{ @@ -140,6 +140,6 @@ Returns the number of integers in the given integer set.} @defproc[(subset? [x integer-set?][y integer-set?]) boolean?]{ -Returns true if every integer in @scheme[x] is also in -@scheme[y], otherwise @scheme[#f].} +Returns true if every integer in @racket[x] is also in +@racket[y], otherwise @racket[#f].} diff --git a/collects/mzlib/scribblings/kw.scrbl b/collects/mzlib/scribblings/kw.scrbl index 692dc0d463..78286089f3 100644 --- a/collects/mzlib/scribblings/kw.scrbl +++ b/collects/mzlib/scribblings/kw.scrbl @@ -19,8 +19,8 @@ @mzlib[#:mode title kw] @margin-note{The @base-lambda and procedure-application forms of - @scheme[scheme/base] support keyword arguments, and it is - @emph{not} compatible with the @scheme[mzlib/kw] + @racket[scheme/base] support keyword arguments, and it is + @emph{not} compatible with the @racket[mzlib/kw] library.} @deftogether[( @@ -54,39 +54,39 @@ (head . kw-formals)]) ])]{ -Like @scheme[lambda], but with optional and keyword-based argument +Like @racket[lambda], but with optional and keyword-based argument processing. This form is similar to an extended version of Common Lisp procedure arguments (but note the differences below). When used -with plain variable names, @scheme[lambda/kw] expands to a plain -@scheme[lambda], so @scheme[lambda/kw] is suitable for a language -module that will use it to replace @scheme[lambda]. Also, when used +with plain variable names, @racket[lambda/kw] expands to a plain +@racket[lambda], so @racket[lambda/kw] is suitable for a language +module that will use it to replace @racket[lambda]. Also, when used with only optionals, the resulting procedure is similar to -@scheme[opt-lambda] (but a bit faster). +@racket[opt-lambda] (but a bit faster). -In addition to @scheme[lambda/kw], @scheme[define/kw] is similar to -@scheme[define], except that the @scheme[formals] are as in -@scheme[lambda/kw]. Like @scheme[define], this form can be used with +In addition to @racket[lambda/kw], @racket[define/kw] is similar to +@racket[define], except that the @racket[formals] are as in +@racket[lambda/kw]. Like @racket[define], this form can be used with nested parenthesis for curried functions (the MIT-style generalization -of @scheme[define]). +of @racket[define]). -The syntax of @scheme[lambda/kw] is the same as @scheme[lambda], +The syntax of @racket[lambda/kw] is the same as @racket[lambda], except for the list of formal argument specifications. These specifications can hold (zero or more) plain argument names, then an optionals (and defaults) section that begins after an -@scheme[#:optional] marker, then a keyword section that is marked by -@scheme[#:keyword], and finally a section holding rest and +@racket[#:optional] marker, then a keyword section that is marked by +@racket[#:keyword], and finally a section holding rest and ``rest''-like arguments which are described below, together with argument processing flag directives. Each section is optional, but the order of the sections must be as listed. Of course, all binding -@scheme[id]s must be unique. +@racket[id]s must be unique. -The following sections describe each part of the @scheme[kw-formals].} +The following sections describe each part of the @racket[kw-formals].} @; ---------------------------------------- @section{Required Arguments} -Required arguments correspond to @scheme[id]s that appear before any +Required arguments correspond to @racket[id]s that appear before any keyword marker in the argument list. They determine the minimum arity of the resulting procedure. @@ -95,11 +95,11 @@ of the resulting procedure. @section{Optional Arguments} The optional-arguments section follows an -@as-index{@scheme[#:optional]} marker in the @scheme[_kw-formals]. +@as-index{@racket[#:optional]} marker in the @racket[_kw-formals]. Each optional argument can take the form of a parenthesized variable and a default expression; the latter is used if a value is not given at the call site. The default expression can be omitted (along with -the parentheses), in which case @scheme[#f] is the default. +the parentheses), in which case @racket[#f] is the default. The default expression's environment includes all previous arguments, both required and optional names. With @math{k} optionals after @@ -109,12 +109,12 @@ and @math{n+k} arguments, inclusive. The treatment of optionals is efficient, with an important caveat: default expressions appear multiple times in the resulting -@scheme[case-lambda]. For example, the default expression for the last +@racket[case-lambda]. For example, the default expression for the last optional argument appears @math{k-1} times (but no expression is ever evaluated more than once in a procedure call). This expansion risks -exponential blow-up is if @scheme[lambda/kw] is used in a default -expression of a @scheme[lambda/kw], etc. The bottom line, however, is -that @scheme[lambda/kw] is a sensible choice, due to its enhanced +exponential blow-up is if @racket[lambda/kw] is used in a default +expression of a @racket[lambda/kw], etc. The bottom line, however, is +that @racket[lambda/kw] is a sensible choice, due to its enhanced efficiency, even when you need only optional arguments. Using both optional and keyword arguments is possible, but note that @@ -126,7 +126,7 @@ details. @section{Keyword Arguments} -A keyword argument section is marked by a @as-index{@scheme[#:key]}. +A keyword argument section is marked by a @as-index{@racket[#:key]}. If it is used with optional arguments, then the keyword specifications must follow the optional arguments (which mirrors the use in call sites; where optionals are given before keywords). @@ -139,20 +139,20 @@ arguments have been provided before the keyword. This convention restricts the procedure's non-keyword optional arguments to non-keyword values, but it also avoids confusion when mixing optional arguments and keywords. For example, when a procedure that takes two -optional arguments and a keyword argument @scheme[#:x] is called with -@scheme[#:x 1], then the optional arguments get their default values -and the keyword argument is bound to @scheme[1]. (The traditional -behavior would bind @scheme[#:x] and @scheme[1] to the two optional -arguments.) When the same procedure is called with @scheme[1 #:x 2], -the first optional argument is bound to @scheme[1], the second +optional arguments and a keyword argument @racket[#:x] is called with +@racket[#:x 1], then the optional arguments get their default values +and the keyword argument is bound to @racket[1]. (The traditional +behavior would bind @racket[#:x] and @racket[1] to the two optional +arguments.) When the same procedure is called with @racket[1 #:x 2], +the first optional argument is bound to @racket[1], the second optional argument is bound to its default, and the keyword argument is -bound to @scheme[2]. (The traditional behavior would report an error, -because @scheme[2] is provided where @scheme[#:x] is expected.) +bound to @racket[2]. (The traditional behavior would report an error, +because @racket[2] is provided where @racket[#:x] is expected.) Like optional arguments, each keyword argument is specified as a parenthesized variable name and a default expression. The default expression can be omitted (with the parentheses), in which case -@scheme[#f] is the default value. The keyword used at a call site for +@racket[#f] is the default value. The keyword used at a call site for the corresponding variable has the same name as the variable; a third form of keyword arguments has three parts---a variable name, a keyword, and a default expression---to allow the name of the locally @@ -186,52 +186,52 @@ unknown keywords are allowed at a call site. @section{Rest and Rest-like Arguments} -The last @scheme[_kw-formals] section---after the required, optional, +The last @racket[_kw-formals] section---after the required, optional, and keyword arguments---may contain specifications for rest-like arguments and/or mode keywords. Up to five rest-like arguments can be -declared, each with an @scheme[_id] to bind: +declared, each with an @racket[_id] to bind: @itemize[ - @item{@as-index{@scheme[#:rest]} --- The variable is bound to the + @item{@as-index{@racket[#:rest]} --- The variable is bound to the list of ``rest'' arguments, which is the list of all values after the required and the optional values. This list includes all keyword-value pairs, exactly as they are specified at the call site. - Scheme's usual dot-notation is accepted in @scheme[_kw-formals] only + Scheme's usual dot-notation is accepted in @racket[_kw-formals] only if no other meta-keywords are specified, since it is not clear - whether it should specify the same binding as a @scheme[#:rest] or - as a @scheme[#:body]. The dot notation is allowed without - meta-keywords to make the @scheme[lambda/kw] syntax compatible with - @scheme[lambda].} + whether it should specify the same binding as a @racket[#:rest] or + as a @racket[#:body]. The dot notation is allowed without + meta-keywords to make the @racket[lambda/kw] syntax compatible with + @racket[lambda].} - @item{@as-index{@scheme[#:body]} --- The variable is bound to all + @item{@as-index{@racket[#:body]} --- The variable is bound to all arguments after keyword--value pairs. (This is different from - Common Lisp's @scheme[&body], which is a synonym for - @scheme[&rest].) More generally, a @scheme[#:body] specification - can be followed by another @scheme[_kw-formals], not just a single - @scheme[_id]; see @secref["kw-body"] for more information.} + Common Lisp's @racket[&body], which is a synonym for + @racket[&rest].) More generally, a @racket[#:body] specification + can be followed by another @racket[_kw-formals], not just a single + @racket[_id]; see @secref["kw-body"] for more information.} - @item{@as-index{@scheme[#:all-keys]} --- the variable is bound to the + @item{@as-index{@racket[#:all-keys]} --- the variable is bound to the list of all keyword-values from the call site, which is always a - proper prefix of a @scheme[#:rest] argument. (If no @scheme[#:body] - arguments are declared, then @scheme[#:all-keys] binds the same as - @scheme[#:rest].) See also @scheme[keyword-get].} + proper prefix of a @racket[#:rest] argument. (If no @racket[#:body] + arguments are declared, then @racket[#:all-keys] binds the same as + @racket[#:rest].) See also @racket[keyword-get].} - @item{@scheme[#:other-keys] --- The variable is bound like an - @scheme[#:all-keys] variable, except that all keywords specified in - the @scheme[kw-formals] are removed from the list. When a keyword + @item{@racket[#:other-keys] --- The variable is bound like an + @racket[#:all-keys] variable, except that all keywords specified in + the @racket[kw-formals] are removed from the list. When a keyword is used multiple times at a call cite (and this is allowed), only - the first instances is removed for the @scheme[#:other-keys] + the first instances is removed for the @racket[#:other-keys] binding.} - @item{@scheme[#:other-keys+body] --- the variable is bound like a - @scheme[#:rest] variable, except that all keywords specified in the - @scheme[_kw-formals] are removed from the list. When a keyword is + @item{@racket[#:other-keys+body] --- the variable is bound like a + @racket[#:rest] variable, except that all keywords specified in the + @racket[_kw-formals] are removed from the list. When a keyword is used multiple times at a call site (and this is allowed), only the - first instance us removed for the @scheme[#:other-keys+body] - binding. (When no @scheme[#:body] variables are specified, then - @scheme[#:other-keys+body] is the same as @scheme[#:other-keys].)} + first instance us removed for the @racket[#:other-keys+body] + binding. (When no @racket[#:body] variables are specified, then + @racket[#:other-keys+body] is the same as @racket[#:other-keys].)} ] @@ -253,32 +253,32 @@ bindings: Note that the following invariants always hold: @itemize[ -@item{@scheme[_rest] = @scheme[(append _all-keys _body)]} -@item{@scheme[_other-keys+body] = @scheme[(append _other-keys _body)]} +@item{@racket[_rest] = @racket[(append _all-keys _body)]} +@item{@racket[_other-keys+body] = @racket[(append _other-keys _body)]} ] To write a procedure that uses a few keyword argument values, and that also calls another procedure with the same list of arguments -(including all keywords), use @scheme[#:other-keys] (or -@scheme[#:other-keys+body]). The Common Lisp approach is to specify -@scheme[:allow-other-keys], so that the second procedure call will not +(including all keywords), use @racket[#:other-keys] (or +@racket[#:other-keys+body]). The Common Lisp approach is to specify +@racket[:allow-other-keys], so that the second procedure call will not cause an error due to unknown keywords, but the -@scheme[:allow-other-keys] approach risks confusing the two layers of +@racket[:allow-other-keys] approach risks confusing the two layers of keywords. @; ---------------------------------------- @section[#:tag "kw-body"]{Body Argument} -The most notable divergence from Common Lisp in @scheme[lambda/kw] is -the @scheme[#:body] argument, and the fact that it is possible at a +The most notable divergence from Common Lisp in @racket[lambda/kw] is +the @racket[#:body] argument, and the fact that it is possible at a call site to pass plain values after the keyword-value pairs. The -@scheme[#:body] binding is useful for procedure calls that use +@racket[#:body] binding is useful for procedure calls that use keyword-value pairs as sort of an attribute list before the actual arguments to the procedure. For example, consider a procedure that accepts any number of numeric arguments and will apply a procedure to them, but the procedure can be specified as an optional keyword -argument. It is easily implemented with a @scheme[#:body] argument: +argument. It is easily implemented with a @racket[#:body] argument: @examples[ #:eval kw-eval @@ -290,11 +290,11 @@ argument. It is easily implemented with a @scheme[#:body] argument: (Note that the first body value cannot itself be a keyword.) -A @scheme[#:body] declaration works as an arbitrary -@scheme[kw-formals], not just a single variable like @scheme[b] in the -above example. For example, to make the above @scheme[mathop] work -only on three arguments that follow the keyword, use @scheme[(x y z)] -instead of @scheme[b]: +A @racket[#:body] declaration works as an arbitrary +@racket[kw-formals], not just a single variable like @racket[b] in the +above example. For example, to make the above @racket[mathop] work +only on three arguments that follow the keyword, use @racket[(x y z)] +instead of @racket[b]: @examples[ #:eval kw-eval @@ -302,8 +302,8 @@ instead of @scheme[b]: (op x y z)) ] -In general, @scheme[#:body] handling is compiled to a sub procedure -using @scheme[lambda/kw], so that a procedure can use more then one +In general, @racket[#:body] handling is compiled to a sub procedure +using @racket[lambda/kw], so that a procedure can use more then one level of keyword arguments. For example: @examples[ @@ -318,7 +318,7 @@ Obviously, nested keyword arguments works only when non-keyword arguments separate the sets. Run-time errors during such calls report a mismatch for a procedure -with a name that is based on the original name plus a @schemeidfont{~body} +with a name that is based on the original name plus a @racketidfont{~body} suffix: @examples[ @@ -330,48 +330,48 @@ suffix: @section[#:tag "mode-keywords"]{Mode Keywords} -Finally, the argument list of a @scheme[lambda/kw] can contain +Finally, the argument list of a @racket[lambda/kw] can contain keywords that serve as mode flags to control error reporting. @itemize[ - @item{@as-index{@scheme[#:allow-other-keys]} --- The keyword-value + @item{@as-index{@racket[#:allow-other-keys]} --- The keyword-value sequence at the call site @italic{can} include keywords that are not - listed in the keyword part of the @scheme[lambda/kw] form.} + listed in the keyword part of the @racket[lambda/kw] form.} - @item{@as-index{@scheme[#:forbid-other-keys]} --- The keyword-value + @item{@as-index{@racket[#:forbid-other-keys]} --- The keyword-value sequence at the call site @italic{cannot} include keywords that are - not listed in the keyword part of the @scheme[lambda/kw] form, - otherwise the @scheme[exn:fail:contract] exception is raised.} + not listed in the keyword part of the @racket[lambda/kw] form, + otherwise the @racket[exn:fail:contract] exception is raised.} - @item{@as-index{@scheme[#:allow-duplicate-keys]} --- The + @item{@as-index{@racket[#:allow-duplicate-keys]} --- The keyword-value list at the call site @emph{can} include duplicate values associated with same keyword, the first one is used.} - @item{@as-index{@scheme[#:forbid-duplicate-keys]} --- The + @item{@as-index{@racket[#:forbid-duplicate-keys]} --- The keyword-value list at the call site @italic{cannot} include duplicate values for keywords, otherwise the - @scheme[exn:fail:contract] exception is raised. This restriction + @racket[exn:fail:contract] exception is raised. This restriction applies only to keywords that are listed in the keyword part of the - @scheme[lambda/kw] form --- if other keys are allowed, this + @racket[lambda/kw] form --- if other keys are allowed, this restriction does not apply to them.} - @item{@as-index{@scheme[#:allow-body]} --- Body arguments + @item{@as-index{@racket[#:allow-body]} --- Body arguments @italic{can} be specified at the call site after all keyword-value pairs.} - @item{@as-index{@scheme[#:forbid-body]} --- Body arguments + @item{@as-index{@racket[#:forbid-body]} --- Body arguments @italic{cannot} be specified at the call site after all keyword-value pairs.} - @item{@as-index{@scheme[#:allow-anything]} --- Allows all of the + @item{@as-index{@racket[#:allow-anything]} --- Allows all of the above, and treat a single keyword at the end of an argument list as - a @scheme[#:body], a situation that is usually an error. When this - is used and no rest-like arguments are used except @scheme[#:rest], + a @racket[#:body], a situation that is usually an error. When this + is used and no rest-like arguments are used except @racket[#:rest], an extra loop is saved and calling the procedures is faster (around 20%).} - @item{@as-index{@scheme[#:forbid-anything]} --- Forbids all of the + @item{@as-index{@racket[#:forbid-anything]} --- Forbids all of the above, ensuring that calls are as restricted as possible.} ] @@ -381,17 +381,17 @@ are determined by the declared rest-like arguments: @itemize[ - @item{The default is to allow other keys if a @scheme[#:rest], - @scheme[#:other-keys+body], @scheme[#:all-keys], or - @scheme[#:other-keys] variable is declared (and an - @scheme[#:other-keys] declaration requires allowing other keys).} + @item{The default is to allow other keys if a @racket[#:rest], + @racket[#:other-keys+body], @racket[#:all-keys], or + @racket[#:other-keys] variable is declared (and an + @racket[#:other-keys] declaration requires allowing other keys).} - @item{The default is to allow duplicate keys if a @scheme[#:rest] or - @scheme[#:all-keys] variable is declared.} + @item{The default is to allow duplicate keys if a @racket[#:rest] or + @racket[#:all-keys] variable is declared.} - @item{The default is to allow body arguments if a @scheme[#:rest], - @scheme[#:body], or @scheme[#:other-keys+body] variable is declared - (and a @scheme[#:body] argument requires allowing them).} + @item{The default is to allow body arguments if a @racket[#:rest], + @racket[#:body], or @racket[#:other-keys+body] variable is declared + (and a @racket[#:body] argument requires allowing them).} ] @@ -400,26 +400,26 @@ the behavior that they imply: @itemize[ - @item{@scheme[#:rest]: Everything is allowed (a body, other keys, + @item{@racket[#:rest]: Everything is allowed (a body, other keys, and duplicate keys);} - @item{@scheme[#:other-keys+body]: Other keys and body are allowed, + @item{@racket[#:other-keys+body]: Other keys and body are allowed, but duplicates are not;} - @item{@scheme[#:all-keys]: Other keys and duplicate keys are allowed, + @item{@racket[#:all-keys]: Other keys and duplicate keys are allowed, but a body is not;} - @item{@scheme[#:other-keys]: Other keys must be allowed (on by - default, cannot use with @scheme[#:forbid-other-keys]), and + @item{@racket[#:other-keys]: Other keys must be allowed (on by + default, cannot use with @racket[#:forbid-other-keys]), and duplicate keys and body are not allowed;} - @item{@scheme[#:body]: Body must be allowed (on by default, cannot use - with @scheme[#:forbid-body]) and other keys and duplicate keys and + @item{@racket[#:body]: Body must be allowed (on by default, cannot use + with @racket[#:forbid-body]) and other keys and duplicate keys and body are not allowed;} @item{Except for the previous two ``must''s, defaults can be - overridden by an explicit @scheme[#:allow-...] or a - @scheme[#:forbid-...] mode.} + overridden by an explicit @racket[#:allow-...] or a + @racket[#:forbid-...] mode.} ] @@ -433,15 +433,15 @@ the behavior that they imply: Searches a list of keyword arguments (a ``property list'' or ``plist'' in Lisp jargon) for the given keyword, and returns the associated -value. It is the facility that is used by @scheme[lambda/kw] to +value. It is the facility that is used by @racket[lambda/kw] to search for keyword values. -The @scheme[args] list is scanned from left to right, if the keyword -is found, then the next value is returned. If the @scheme[kw] was not -found, then the @scheme[not-found] thunk is used to produce a value by -applying it. If the @scheme[kw] was not found, and @scheme[not-found] -thunk is not given, @scheme[#f] is returned. (No exception is raised -if the @scheme[args] list is imbalanced, and the search stops at a +The @racket[args] list is scanned from left to right, if the keyword +is found, then the next value is returned. If the @racket[kw] was not +found, then the @racket[not-found] thunk is used to produce a value by +applying it. If the @racket[kw] was not found, and @racket[not-found] +thunk is not given, @racket[#f] is returned. (No exception is raised +if the @racket[args] list is imbalanced, and the search stops at a non-keyword value.)} diff --git a/collects/mzlib/scribblings/list.scrbl b/collects/mzlib/scribblings/list.scrbl index a7bff09e57..5484c8997f 100644 --- a/collects/mzlib/scribblings/list.scrbl +++ b/collects/mzlib/scribblings/list.scrbl @@ -4,10 +4,10 @@ @mzlib[#:mode title list] -The @schememodname[mzlib/list] library re-exports several functions -from @schememodname[scheme/base] and @schememodname[scheme/list]: +The @racketmodname[mzlib/list] library re-exports several functions +from @racketmodname[scheme/base] and @racketmodname[scheme/list]: -@schemeblock[ +@racketblock[ cons? empty? empty @@ -37,22 +37,22 @@ sort @defproc[(eighth [v (and/c pair? ....)]) any/c] )]{ -Accesses the first, second, @|etc| elment of ``list'' @scheme[v]. The +Accesses the first, second, @|etc| elment of ``list'' @racket[v]. The argument need not actually be a list; it is inspected only as far as necessary to obtain an element (unlike the same-named functions from -@schememodname[scheme/list], which do require the argument to be a +@racketmodname[scheme/list], which do require the argument to be a list).} @defproc[(rest [v pair?]) any/c]{ -The same as @scheme[cdr].} +The same as @racket[cdr].} @defproc[(last-pair [v pair?]) pair?]{ -Returns the last pair in @scheme[v], raising an error if @scheme[v] is -not a pair (but @scheme[v] does not have to be a proper list).} +Returns the last pair in @racket[v], raising an error if @racket[v] is +not a pair (but @racket[v] does not have to be a proper list).} @@ -62,14 +62,14 @@ not a pair (but @scheme[v] does not have to be a proper list).} Merges the two sorted input lists, creating a new sorted list. The merged result is stable: equal items in both lists stay in the same -order, and these in @scheme[lst1] precede @scheme[lst2].} +order, and these in @racket[lst1] precede @racket[lst2].} @defproc[(mergesort [lst list?] [less-than? (any/c any/c . -> . any/c)]) list?]{ -The same as @scheme[sort].} +The same as @racket[sort].} @defproc[(quicksort [lst list?] [less-than? (any/c any/c . -> . any/c)]) list?]{ -The same as @scheme[sort].} +The same as @racket[sort].} diff --git a/collects/mzlib/scribblings/match.scrbl b/collects/mzlib/scribblings/match.scrbl index 209fe11439..b957907ab7 100644 --- a/collects/mzlib/scribblings/match.scrbl +++ b/collects/mzlib/scribblings/match.scrbl @@ -6,22 +6,22 @@ @(begin (define-syntax-rule (bind id) (begin - (require scheme/match) - (define id (scheme match)))) - (bind scheme-match)) + (require racket/match) + (define id (racket match)))) + (bind racket-match)) @mzlib[#:mode title match] -The @schememodname[mzlib/match] library provides a @scheme[match] form -similar to that of @schememodname[scheme/match], but with an different +The @racketmodname[mzlib/match] library provides a @racket[match] form +similar to that of @racketmodname[racket/match], but with an different (older and less extensible) syntax of patterns. @defform/subs[(match val-expr clause ...) ([clause [pat expr ...+] [pat (=> id) expr ...+]])]{ -See @scheme-match from @schememodname[scheme/match] for a description -of matching. The grammar of @scheme[pat] for this @scheme[match] is as +See @racket-match from @racketmodname[racket/match] for a description +of matching. The grammar of @racket[pat] for this @racket[match] is as follows: @|match-grammar|} @@ -37,7 +37,7 @@ follows: @defform[(match-define pat expr)] )]{ -Analogous to the combined forms from @scheme[scheme/match].} +Analogous to the combined forms from @racket[racket/match].} @; ------------------------------------------------------------ @@ -48,7 +48,7 @@ Analogous to the combined forms from @scheme[scheme/match].} @defparam[match-equality-test comp-proc (any/c any/c . -> . any)] )]{ -Analogous to the form and parameter from @scheme[scheme/match]. The -@scheme[define-match-expander] form, however, supports an extra -@scheme[proc-expr] as the middle one: an expander for use with -@scheme[match] from @schememodname[mzlib/match].} +Analogous to the form and parameter from @racket[racket/match]. The +@racket[define-match-expander] form, however, supports an extra +@racket[proc-expr] as the middle one: an expander for use with +@racket[match] from @racketmodname[mzlib/match].} diff --git a/collects/mzlib/scribblings/math.scrbl b/collects/mzlib/scribblings/math.scrbl index 0722382f74..74b3c752a7 100644 --- a/collects/mzlib/scribblings/math.scrbl +++ b/collects/mzlib/scribblings/math.scrbl @@ -4,7 +4,7 @@ @mzlib[#:mode title math] -Re-exports @schememodname[scheme/math], and also exports @scheme[e]. +Re-exports @racketmodname[scheme/math], and also exports @racket[e]. @defthing[e real?]{ diff --git a/collects/mzlib/scribblings/mzlib.scrbl b/collects/mzlib/scribblings/mzlib.scrbl index 95f1698ece..79439a947e 100644 --- a/collects/mzlib/scribblings/mzlib.scrbl +++ b/collects/mzlib/scribblings/mzlib.scrbl @@ -6,7 +6,7 @@ The @filepath{mzlib} collection contains wrappers and libraries for compatibility with older versions of Racket. In many ways, the libraries of the @filepath{mzlib} collection go with the -@schememodname[mzscheme] legacy language. Newer variants of many +@racketmodname[mzscheme] legacy language. Newer variants of many libraries reside in the @filepath{scheme} collection. @table-of-contents[] @@ -15,23 +15,23 @@ libraries reside in the @filepath{scheme} collection. @mzlib[a-signature] -Like @schememodname[scheme/signature] in @hash-lang[] form for +Like @racketmodname[scheme/signature] in @hash-lang[] form for defining a single signature within a module, but based on -@schememodname[mzscheme] instead of @schememodname[scheme/base]. +@racketmodname[mzscheme] instead of @racketmodname[scheme/base]. @; ---------------------------------------------------------------------- @mzlib[a-unit] -Like @schememodname[scheme/unit] in @hash-lang[] form for defining a -single unit within a module, but based on @schememodname[mzscheme] -instead of @schememodname[scheme/base]. +Like @racketmodname[scheme/unit] in @hash-lang[] form for defining a +single unit within a module, but based on @racketmodname[mzscheme] +instead of @racketmodname[scheme/base]. @; ---------------------------------------------------------------------- @mzlib[async-channel] -Re-exports @schememodname[scheme/async-channel]. +Re-exports @racketmodname[scheme/async-channel]. @; ---------------------------------------------------------------------- @@ -41,7 +41,7 @@ Re-exports @schememodname[scheme/async-channel]. @mzlib[class] -Re-exports @schememodname[scheme/class], except for the contract +Re-exports @racketmodname[scheme/class], except for the contract constructors. @; ---------------------------------------------------------------------- @@ -52,13 +52,13 @@ constructors. @mzlib[cm] -Re-exports @schememodname[compiler/cm]. +Re-exports @racketmodname[compiler/cm]. @; ---------------------------------------------------------------------- @mzlib[cm-accomplice] -Re-exports @schememodname[compiler/cm-accomplice]. +Re-exports @racketmodname[compiler/cm-accomplice]. @; ---------------------------------------------------------------------- @@ -84,19 +84,19 @@ Re-exports @schememodname[compiler/cm-accomplice]. @mzlib[control] -Re-exports @schememodname[scheme/control]. +Re-exports @racketmodname[scheme/control]. @; ---------------------------------------------------------------------- @mzlib[date] -Re-exports @schememodname[scheme/date]. +Re-exports @racketmodname[scheme/date]. @; ---------------------------------------------------------------------- @mzlib[deflate] -Re-exports @schememodname[file/gzip]. +Re-exports @racketmodname[file/gzip]. @; ---------------------------------------------------------------------- @@ -118,7 +118,7 @@ Re-exports @schememodname[file/gzip]. @mzlib[foreign] -Re-exports @schememodname[scheme/foreign]. +Re-exports @racketmodname[scheme/foreign]. @; ---------------------------------------------------------------------- @@ -128,7 +128,7 @@ Re-exports @schememodname[scheme/foreign]. @mzlib[inflate] -Re-exports @schememodname[file/gunzip]. +Re-exports @racketmodname[file/gunzip]. @; ---------------------------------------------------------------------- @@ -154,7 +154,7 @@ Re-exports @schememodname[file/gunzip]. @mzlib[md5] -Re-exports @schememodname[file/md5]. +Re-exports @racketmodname[file/md5]. @; ---------------------------------------------------------------------- @@ -184,13 +184,13 @@ Re-exports @schememodname[file/md5]. @mzlib[pretty] -Re-exports @schememodname[scheme/pretty]. +Re-exports @racketmodname[scheme/pretty]. @; ---------------------------------------------------------------------- @mzlib[process] -Re-exports @schememodname[scheme/system]. +Re-exports @racketmodname[scheme/system]. @; ---------------------------------------------------------------------- @@ -200,7 +200,7 @@ Re-exports @schememodname[scheme/system]. @mzlib[runtime-path] -Re-exports @schememodname[scheme/runtime-path]. +Re-exports @racketmodname[scheme/runtime-path]. @; ---------------------------------------------------------------------- @@ -218,7 +218,7 @@ Re-exports @schememodname[scheme/runtime-path]. @mzlib[shared] -Re-exports @schememodname[scheme/shared]. +Re-exports @racketmodname[scheme/shared]. @; ---------------------------------------------------------------------- @@ -232,20 +232,20 @@ Re-exports @schememodname[scheme/shared]. @mzlib[stxparam] -Re-exports @schememodname[scheme/stxparam] and -@schememodname[scheme/stxparam-exptime] (both at phase level 0). +Re-exports @racketmodname[scheme/stxparam] and +@racketmodname[scheme/stxparam-exptime] (both at phase level 0). @; ---------------------------------------------------------------------- @mzlib[surrogate] -Re-exports @schememodname[scheme/surrogate]. +Re-exports @racketmodname[scheme/surrogate]. @; ---------------------------------------------------------------------- @mzlib[tar] -Re-exports @schememodname[file/tar]. +Re-exports @racketmodname[file/tar]. @; ---------------------------------------------------------------------- @@ -255,7 +255,7 @@ Re-exports @schememodname[file/tar]. @mzlib[trace] -Re-exports @schememodname[racket/trace]. +Re-exports @racketmodname[racket/trace]. @; ---------------------------------------------------------------------- @@ -265,7 +265,7 @@ Re-exports @schememodname[racket/trace]. @mzlib[trait] -Re-exports @schememodname[scheme/trait]. +Re-exports @racketmodname[scheme/trait]. @; ---------------------------------------------------------------------- @@ -279,13 +279,13 @@ Re-exports @schememodname[scheme/trait]. @mzlib[unit-exptime] -Re-exports @schememodname[scheme/unit-exptime]. +Re-exports @racketmodname[scheme/unit-exptime]. @; ---------------------------------------- @mzlib[unit200] -The @schememodname[mzlib/unit200] library provides an old +The @racketmodname[mzlib/unit200] library provides an old implementation of units. See archived version 360 documentation on the @filepath{unit.ss} library of the @filepath{mzlib} collection for information about this library. @@ -294,7 +294,7 @@ information about this library. @mzlib[unitsig200] -The @schememodname[mzlib/unit200] library provides an old +The @racketmodname[mzlib/unit200] library provides an old implementation of units. See archived version 360 documentation on the @filepath{unitsig.ss} library of the @filepath{mzlib} collection for information about this library. @@ -303,7 +303,7 @@ information about this library. @mzlib[zip] -Re-exports @schememodname[file/zip]. +Re-exports @racketmodname[file/zip]. @; ---------------------------------------------------------------------- diff --git a/collects/mzlib/scribblings/os.scrbl b/collects/mzlib/scribblings/os.scrbl index 43c5c2152d..abaf66a781 100644 --- a/collects/mzlib/scribblings/os.scrbl +++ b/collects/mzlib/scribblings/os.scrbl @@ -19,10 +19,10 @@ operating system.} @defproc[(truncate-file [file path-string?][n-bytes exact-nonnegative-integer? 0]) void?]{ -Truncates or extends the given @scheme[file] so that it is -@scheme[n-bytes] long. If the file does not exist, or if the process +Truncates or extends the given @racket[file] so that it is +@racket[n-bytes] long. If the file does not exist, or if the process does not have sufficient privilege to truncate the file, the -@scheme[exn:fail] exception is raised. +@racket[exn:fail] exception is raised. @bold{WARNING:} on Unix, the implementation assumes that the platform's @tt{ftruncate} function accepts a @tt{long long} second diff --git a/collects/mzlib/scribblings/pconvert-prop.scrbl b/collects/mzlib/scribblings/pconvert-prop.scrbl index 35d0e3d5b2..ad875fc2e8 100644 --- a/collects/mzlib/scribblings/pconvert-prop.scrbl +++ b/collects/mzlib/scribblings/pconvert-prop.scrbl @@ -12,17 +12,17 @@ @defproc[(print-converter-proc [v print-converter?]) (any/c (any/c . -> . any/c) . -> . any/c)] )]{ -The @scheme[prop:print-converter] property can be given a procedure +The @racket[prop:print-converter] property can be given a procedure value for a structure type. In that case, for constructor-style print -conversion via @scheme[print-convert], instances of the structure are +conversion via @racket[print-convert], instances of the structure are converted by calling the procedure that is the property's value. The procedure is called with the value to convert and a procedure to recursively convert nested values. The result should be an S-expression for the converted value. -The @scheme[print-converter?] predicate recognizes instances of -structure types that have the @scheme[prop:print-converter] property, -and @scheme[print-converter-proc] extracts the property value.} +The @racket[print-converter?] predicate recognizes instances of +structure types that have the @racket[prop:print-converter] property, +and @racket[print-converter-proc] extracts the property value.} @deftogether[( @@ -31,19 +31,19 @@ and @scheme[print-converter-proc] extracts the property value.} @defproc[(print-convert-constructor-name [v print-convert-named-constructor?]) any] )]{ -The @scheme[prop:print-convert-constructor-name] property can be given +The @racket[prop:print-convert-constructor-name] property can be given a symbol value for a structure type. In that case, for -constructor-style print conversion via @scheme[print-convert], +constructor-style print conversion via @racket[print-convert], instances of the structure are shown using the symbol as the constructor name. -The @scheme[prop:print-converter] property takes precedence over -@scheme[prop:print-convert-constructor-name]. If neither is attached +The @racket[prop:print-converter] property takes precedence over +@racket[prop:print-convert-constructor-name]. If neither is attached to a structure type, its instances are converted using a constructor -name that is @schemeidfont{make-} prefixed onto the result of -@scheme[object-name]. +name that is @racketidfont{make-} prefixed onto the result of +@racket[object-name]. -The @scheme[print-convert-named-constructor?] predicate recognizes +The @racket[print-convert-named-constructor?] predicate recognizes instances of structure types that have the -@scheme[prop:print-convert-constructor-name] property, and -@scheme[print-convert-constructor-name] extracts the property value.} +@racket[prop:print-convert-constructor-name] property, and +@racket[print-convert-constructor-name] extracts the property value.} diff --git a/collects/mzlib/scribblings/pconvert.scrbl b/collects/mzlib/scribblings/pconvert.scrbl index e7487c201c..74e9db4bfb 100644 --- a/collects/mzlib/scribblings/pconvert.scrbl +++ b/collects/mzlib/scribblings/pconvert.scrbl @@ -6,101 +6,101 @@ @mzlib[#:mode title pconvert] -The @schememodname[mzlib/pconvert] library defines routines for -printing Scheme values as @scheme[eval]uable S-expressions. Racket's +The @racketmodname[mzlib/pconvert] library defines routines for +printing Scheme values as @racket[eval]uable S-expressions. Racket's default printing mode also prints values as expressions (in contrast -to the Lisp and Scheme tradition of printing @scheme[read]able -S-expressions), but @schememodname[mzlib/pconvert] is more +to the Lisp and Scheme tradition of printing @racket[read]able +S-expressions), but @racketmodname[mzlib/pconvert] is more configurable and approximates expressions for a wider range of -values. For example, procedures print using @schemeresultfont{lambda} -instead of @schemeresultfont{#}. +values. For example, procedures print using @racketresultfont{lambda} +instead of @racketresultfont{#}. -The @scheme[print-convert] procedure does not print values; rather, it +The @racket[print-convert] procedure does not print values; rather, it converts a Scheme value into another Scheme value such that the new value @racket[pretty-write]s as a Scheme expression that evaluates to -the original value. For example, @scheme[(pretty-write (print-convert +the original value. For example, @racket[(pretty-write (print-convert `(9 ,(box 5) #(6 7))))] prints the literal expression -@schemeresult[(list 9 (box 5) (vector 6 7))] to the current output +@racketresult[(list 9 (box 5) (vector 6 7))] to the current output port. To install print converting into the read-eval-print loop, require -@scheme[mzlib/pconvert] and call the procedure -@scheme[install-converting-printer]. +@racket[mzlib/pconvert] and call the procedure +@racket[install-converting-printer]. -In addition to @scheme[print-convert], this library provides -@scheme[print-convert], @scheme[build-share], @scheme[get-shared], -and @scheme[print-convert-expr]. The last three are used to convert +In addition to @racket[print-convert], this library provides +@racket[print-convert], @racket[build-share], @racket[get-shared], +and @racket[print-convert-expr]. The last three are used to convert sub-expressions of a larger expression (potentially with shared structure). -See also @scheme[prop:print-convert-constructor-name]. +See also @racket[prop:print-convert-constructor-name]. @defboolparam[abbreviate-cons-as-list abbreviate?]{ A parameter that controls how lists are represented with -constructor-style conversion. If the parameter's value is @scheme[#t], -lists are represented using @scheme[list]. Otherwise, lists are -represented using @scheme[cons]. The initial value of the parameter is -@scheme[#t].} +constructor-style conversion. If the parameter's value is @racket[#t], +lists are represented using @racket[list]. Otherwise, lists are +represented using @racket[cons]. The initial value of the parameter is +@racket[#t].} @defboolparam[booleans-as-true/false use-name?]{ -A parameter that controls how @scheme[#t] and @scheme[#f] are -represented. If the parameter's value is @scheme[#t], then @scheme[#t] -is represented as @scheme[true] and @scheme[#f] is represented as -@scheme[false]. The initial value of the parameter is @scheme[#t].} +A parameter that controls how @racket[#t] and @racket[#f] are +represented. If the parameter's value is @racket[#t], then @racket[#t] +is represented as @racket[true] and @racket[#f] is represented as +@racket[false]. The initial value of the parameter is @racket[#t].} @defparam[use-named/undefined-handler use-handler (any/c . -> . any/c)]{ A parameter that controls how values that have inferred names are represented. The procedure is passed a value. If the procedure returns -true, the procedure associated with @scheme[named/undefined-handler] +true, the procedure associated with @racket[named/undefined-handler] is invoked to render that value. Only values that have inferred names but are not defined at the top-level are used with this handler. -The initial value of the parameter is @scheme[(lambda (x) #f)].} +The initial value of the parameter is @racket[(lambda (x) #f)].} @defparam[named/undefined-handler use-handler (any/c . -> . any/c)]{ Parameter for a procedure that controls how values that have inferred names are represented. The procedure is called only if -@scheme[use-named/undefined-handler] returns true for some value. In +@racket[use-named/undefined-handler] returns true for some value. In that case, the procedure is passed that same value, and the result of the parameter is used as the representation for the value. -The initial value of the parameter is @scheme[(lambda (x) #f)].} +The initial value of the parameter is @racket[(lambda (x) #f)].} @defproc[(build-share [v any/c]) ....]{ Takes a value and computes sharing information used for representing the value as an expression. The return value is an opaque structure -that can be passed back into @scheme[get-shared] or -@scheme[print-convert-expr].} +that can be passed back into @racket[get-shared] or +@racket[print-convert-expr].} @defboolparam[constructor-style-printing use-constructors?]{ Parameter that controls how values are represented after conversion. -If this parameter's value is @scheme[#t], then constructors are used; -e.g., pair containing @scheme[1] and @scheme[2] is represented as -@scheme[(cons 1 2)]. Otherwise, @scheme[quasiquote]-style syntax is -used; e.g., the pair containing @scheme[1] and @scheme[2] is -represented as @scheme[`(1 . 2)]. The initial value of the parameter -is @scheme[#f]. +If this parameter's value is @racket[#t], then constructors are used; +e.g., pair containing @racket[1] and @racket[2] is represented as +@racket[(cons 1 2)]. Otherwise, @racket[quasiquote]-style syntax is +used; e.g., the pair containing @racket[1] and @racket[2] is +represented as @racket[`(1 . 2)]. The initial value of the parameter +is @racket[#f]. -The constructor used for mutable pairs is @schemeidfont{mcons}, unless -@scheme[print-mpair-curly-braces] is set to @scheme[#f], in which case -@schemeidfont{cons} and @schemeidfont{list} are used. Similarly, when -using @scheme[quasiquote] style and @scheme[print-mpair-curly-braces] -is set to @scheme[#f], mutable pair constructions are represented -using @schemeidfont{quote}, @schemeidfont{quasiquote}, etc. +The constructor used for mutable pairs is @racketidfont{mcons}, unless +@racket[print-mpair-curly-braces] is set to @racket[#f], in which case +@racketidfont{cons} and @racketidfont{list} are used. Similarly, when +using @racket[quasiquote] style and @racket[print-mpair-curly-braces] +is set to @racket[#f], mutable pair constructions are represented +using @racketidfont{quote}, @racketidfont{quasiquote}, etc. -See also @scheme[quasi-read-style-printing] and -@scheme[prop:print-convert-constructor-name].} +See also @racket[quasi-read-style-printing] and +@racket[prop:print-convert-constructor-name].} @defparam[current-build-share-hook @@ -108,28 +108,28 @@ See also @scheme[quasi-read-style-printing] and (any/c (any/c . -> . void?) (any/c . -> . void?) . -> . any)]{ -Parameter that sets a procedure used by @scheme[print-convert] and -@scheme[build-share] to assemble sharing information. The procedure -@scheme[hook] takes three arguments: a value @scheme[_v], a procedure -@scheme[_basic-share], and a procedure @scheme[_sub-share]; the return -value is ignored. The @scheme[basic-share] procedure takes @scheme[_v] +Parameter that sets a procedure used by @racket[print-convert] and +@racket[build-share] to assemble sharing information. The procedure +@racket[hook] takes three arguments: a value @racket[_v], a procedure +@racket[_basic-share], and a procedure @racket[_sub-share]; the return +value is ignored. The @racket[basic-share] procedure takes @racket[_v] and performs the built-in sharing analysis, while the -@scheme[_sub-share] procedure takes a component of @scheme[_v] ands +@racket[_sub-share] procedure takes a component of @racket[_v] ands analyzes it. Sharing information is accumulated as values are passed -to @scheme[basic-share] and @scheme[sub-share]. +to @racket[basic-share] and @racket[sub-share]. -A @scheme[current-build-share-hook] procedure usually works together -with a @scheme[current-print-convert-hook] procedure.} +A @racket[current-build-share-hook] procedure usually works together +with a @racket[current-print-convert-hook] procedure.} @defparam[current-build-share-name-hook hook (any/c . -> . (or/c symbol? false/c))]{ -Parameter that sets a procedure used by @scheme[print-convert] and -@scheme[build-share] to generate a new name for a shared value. The -@scheme[hook] procedure takes a single value and returns a symbol for -the value's name. If @scheme[hook] returns @scheme[#f], a name is +Parameter that sets a procedure used by @racket[print-convert] and +@racket[build-share] to generate a new name for a shared value. The +@racket[hook] procedure takes a single value and returns a symbol for +the value's name. If @racket[hook] returns @racket[#f], a name is generated using the form -``@schemeidfont{-}@scheme[_n]@schemeidfont{-}, where @scheme[n] is an +``@racketidfont{-}@racket[_n]@racketidfont{-}, where @racket[n] is an integer.} @@ -139,41 +139,41 @@ integer.} (any/c . -> . any/c) . -> . any/c)]{ -Parameter that sets a procedure used by @scheme[print-convert] and -@scheme[print-convert-expr] to convert values. The procedure -@scheme[hook] takes three arguments---a value @scheme[_v], a procedure -@scheme[_basic-convert], and a procedure @scheme[_sub-convert]---and -returns the converted representation of @scheme[_v]. The -@scheme[_basic-convert] procedure takes @scheme[_v] and returns the -default conversion, while the @scheme[_sub-convert] procedure takes a -component of @scheme[_v] and returns its conversion. +Parameter that sets a procedure used by @racket[print-convert] and +@racket[print-convert-expr] to convert values. The procedure +@racket[hook] takes three arguments---a value @racket[_v], a procedure +@racket[_basic-convert], and a procedure @racket[_sub-convert]---and +returns the converted representation of @racket[_v]. The +@racket[_basic-convert] procedure takes @racket[_v] and returns the +default conversion, while the @racket[_sub-convert] procedure takes a +component of @racket[_v] and returns its conversion. -A @scheme[current-print-convert-hook] procedure usually works together -with a @scheme[current-build-share-hook] procedure.} +A @racket[current-print-convert-hook] procedure usually works together +with a @racket[current-build-share-hook] procedure.} @defparam[current-read-eval-convert-print-prompt str string?]{ Parameter that sets the prompt used by -@scheme[install-converting-printer]. -The initial value is @scheme["|- "].} +@racket[install-converting-printer]. +The initial value is @racket["|- "].} @defproc[(get-shared [share-info ....] [cycles-only? any/c #f]) (list-of (cons/c symbol? any/c))]{ -The @scheme[shared-info] value must be a result from @scheme[build-share]. +The @racket[shared-info] value must be a result from @racket[build-share]. The procedure returns a list matching variables to shared values -within the value passed to @scheme[build-share]. +within the value passed to @racket[build-share]. -The default value for @scheme[cycles-only?] is @scheme[#f]; -if it is not @scheme[#f], @scheme[get-shared] returns only information +The default value for @racket[cycles-only?] is @racket[#f]; +if it is not @racket[#f], @racket[get-shared] returns only information about cycles. For example, -@schemeblock[ +@racketblock[ (get-shared (build-share (shared ([a (cons 1 b)] [b (cons 2 a)]) a))) @@ -181,7 +181,7 @@ For example, might return the list -@schemeblock[ +@racketblock[ '((-1- (cons 1 -2-)) (-2- (cons 2 -1-))) ]} @@ -189,17 +189,17 @@ might return the list @defproc[(install-converting-printer) void?]{ Sets the current print handler to print values using -@scheme[print-convert] and sets @racket[print-as-expression] to +@racket[print-convert] and sets @racket[print-as-expression] to @racket[#f] (since the conversion of a value is meant to be printed in @racket[read]able form rather than @racket[eval]uable form). The current read handler is also set to use the prompt returned by -@scheme[current-read-eval-convert-print-prompt].} +@racket[current-read-eval-convert-print-prompt].} @defproc[(print-convert [v any/c][cycles-only? any/c (show-sharing)]) any/c]{ -Converts the value @scheme[v]. If @scheme[cycles-only?] is not -@scheme[#f], then only circular objects are included in the +Converts the value @racket[v]. If @racket[cycles-only?] is not +@racket[#f], then only circular objects are included in the output.} @@ -207,48 +207,48 @@ output.} [v any/c] [unroll-once? any/c]) any/c]{ -Converts the value @scheme[v] using sharing information -@scheme[share-info], which was previously returned by -@scheme[build-share] for a value containing @scheme[v]. If the most -recent call to @scheme[get-shared] with @scheme[share-info] requested -information only for cycles, then @scheme[print-convert-expr] will +Converts the value @racket[v] using sharing information +@racket[share-info], which was previously returned by +@racket[build-share] for a value containing @racket[v]. If the most +recent call to @racket[get-shared] with @racket[share-info] requested +information only for cycles, then @racket[print-convert-expr] will only display sharing among values for cycles, rather than showing all value sharing. -The @scheme[unroll-once?] argument is used if @scheme[v] is a shared -value in @scheme[share-info]. In this case, if @scheme[unroll-once?] -is @scheme[#f], then the return value will be a shared-value +The @racket[unroll-once?] argument is used if @racket[v] is a shared +value in @racket[share-info]. In this case, if @racket[unroll-once?] +is @racket[#f], then the return value will be a shared-value identifier; otherwise, the returned value shows the internal structure -of @scheme[v] (using shared value identifiers within @scheme[v]'s +of @racket[v] (using shared value identifiers within @racket[v]'s immediate structure as appropriate).} @defboolparam[quasi-read-style-printing on?]{ Parameter that controls how vectors and boxes are represented after -conversion when the value of @scheme[constructor-style-printing] is -@scheme[#f]. If @scheme[quasi-read-style-printing] is set to -@scheme[#f], then boxes and vectors are unquoted and represented using +conversion when the value of @racket[constructor-style-printing] is +@racket[#f]. If @racket[quasi-read-style-printing] is set to +@racket[#f], then boxes and vectors are unquoted and represented using constructors. For example, the list of a box containing the number 1 -and a vector containing the number 1 is represented as @scheme[`(,(box -1) ,(vector 1))]. If the parameter's value is @scheme[#t], then -@scheme[#&....] and @scheme[#(....)] are used, e.g., @scheme[`(#&1 -#(1))]. The initial value of the parameter is @scheme[#t].} +and a vector containing the number 1 is represented as @racket[`(,(box +1) ,(vector 1))]. If the parameter's value is @racket[#t], then +@racket[#&....] and @racket[#(....)] are used, e.g., @racket[`(#&1 +#(1))]. The initial value of the parameter is @racket[#t].} @defboolparam[show-sharing show?]{ Parameter that determines whether sub-value sharing is conserved (and shown) in the converted output by default. The initial value of the -parameter is @scheme[#t].} +parameter is @racket[#t].} @defboolparam[whole/fractional-exact-numbers whole-frac?]{ Parameter that controls how exact, non-integer numbers are converted when the numerator is greater than the denominator. If the parameter's -value is @scheme[#t], the number is converted to the form @scheme[(+ -_integer _fraction)] (i.e., a list containing @scheme['+], an exact -integer, and an exact rational less than @scheme[1] and greater than -@scheme[-1]). The initial value of the parameter is @scheme[#f].} +value is @racket[#t], the number is converted to the form @racket[(+ +_integer _fraction)] (i.e., a list containing @racket['+], an exact +integer, and an exact rational less than @racket[1] and greater than +@racket[-1]). The initial value of the parameter is @racket[#f].} diff --git a/collects/mzlib/scribblings/plt-match.scrbl b/collects/mzlib/scribblings/plt-match.scrbl index 438cecca6e..7fd32b4f1f 100644 --- a/collects/mzlib/scribblings/plt-match.scrbl +++ b/collects/mzlib/scribblings/plt-match.scrbl @@ -4,8 +4,8 @@ @mzlib[#:mode title plt-match] -The @schememodname[mzlib/plt-match] library mostly re-provides -@scheme[scheme/match]. +The @racketmodname[mzlib/plt-match] library mostly re-provides +@racket[scheme/match]. @deftogether[( @defform*[((define-match-expander id proc-expr) @@ -13,4 +13,4 @@ The @schememodname[mzlib/plt-match] library mostly re-provides (define-match-expander id proc-expr proc-expr proc-expr))] )]{ -The same as the form from @schememodname[mzlib/match].} +The same as the form from @racketmodname[mzlib/match].} diff --git a/collects/mzlib/scribblings/port.scrbl b/collects/mzlib/scribblings/port.scrbl index 3e834bcfff..aba02f4559 100644 --- a/collects/mzlib/scribblings/port.scrbl +++ b/collects/mzlib/scribblings/port.scrbl @@ -4,12 +4,12 @@ @mzlib[#:mode title port] -The @schememodname[mzlib/port] library mostly re-provides -@schememodname[scheme/port]. +The @racketmodname[mzlib/port] library mostly re-provides +@racketmodname[scheme/port]. @defproc[(strip-shell-command-start [in input-port?]) void?]{ -Reads and discards a leading @litchar{#!} in @scheme[in] (plus +Reads and discards a leading @litchar{#!} in @racket[in] (plus continuing lines if the line ends with a backslash). Since @litchar{#!} followed by a forward slash or space is a comment, this procedure is not needed before reading Scheme expressions.} diff --git a/collects/mzlib/scribblings/pregexp.scrbl b/collects/mzlib/scribblings/pregexp.scrbl index fdb9a07156..8c658e5dd8 100644 --- a/collects/mzlib/scribblings/pregexp.scrbl +++ b/collects/mzlib/scribblings/pregexp.scrbl @@ -5,13 +5,13 @@ @mzlib[#:mode title pregexp] -The @schememodname[mzlib/pregexp] library provides wrappers around -@scheme[regexp-match], @|etc| that coerce string and byte-string -arguments to @scheme[pregexp] matchers instead of @scheme[regexp] +The @racketmodname[mzlib/pregexp] library provides wrappers around +@racket[regexp-match], @|etc| that coerce string and byte-string +arguments to @racket[pregexp] matchers instead of @racket[regexp] matchers. -The library also re-exports: @scheme[pregexp], and it re-exports -@scheme[regexp-quote] as @scheme[pregexp-quote]. +The library also re-exports: @racket[pregexp], and it re-exports +@racket[regexp-quote] as @racket[pregexp-quote]. @deftogether[( @defproc[(pregexp-match [pattern (or/c string? bytes? regexp? byte-regexp?)] @@ -51,6 +51,6 @@ The library also re-exports: @scheme[pregexp], and it re-exports (or/c string? bytes?)] )]{ -Like @scheme[regexp-match], @|etc|, but a string @scheme[pattern] -argument is compiled via @scheme[pregexp], and a byte string -@scheme[pattern] argument is compiled via @scheme[byte-pregexp].} +Like @racket[regexp-match], @|etc|, but a string @racket[pattern] +argument is compiled via @racket[pregexp], and a byte string +@racket[pattern] argument is compiled via @racket[byte-pregexp].} diff --git a/collects/mzlib/scribblings/restart.scrbl b/collects/mzlib/scribblings/restart.scrbl index 6460055862..4930da0f78 100644 --- a/collects/mzlib/scribblings/restart.scrbl +++ b/collects/mzlib/scribblings/restart.scrbl @@ -5,7 +5,7 @@ @mzlib[#:mode title restart] -@margin-note{See @scheme[scheme/sandbox] for a more general way to +@margin-note{See @racket[scheme/sandbox] for a more general way to simulate running a new Racket process.} @defproc[(restart-mzscheme [init-argv (vectorof string?)] @@ -15,53 +15,53 @@ boolean?]{ Simulates starting Racket with the vector of command-line strings -@scheme[argv]. The @scheme[init-argv], @scheme[adjust-flag-table], and -@scheme[init-namespace] arguments are used to modify the default +@racket[argv]. The @racket[init-argv], @racket[adjust-flag-table], and +@racket[init-namespace] arguments are used to modify the default settings for command-line flags, adjust the parsing of command-line flags, and customize the initial namespace, respectively. -The vector of strings @scheme[init-argv] is read first with the +The vector of strings @racket[init-argv] is read first with the standard Racket command-line parsing. Flags that load files or evaluate expressions (e.g., @Flag{f} and @Flag{e}) are ignored, but flags that set Racket's modes (e.g., @Flag{c} or @Flag{j}) -effectively set the default mode before @scheme[argv] is parsed. +effectively set the default mode before @racket[argv] is parsed. -Before @scheme[argv] is parsed, the procedure -@scheme[adjust-flag-table] is called with a command-line flag table as -accepted by @scheme[parse-command-line]. The return value must also be +Before @racket[argv] is parsed, the procedure +@racket[adjust-flag-table] is called with a command-line flag table as +accepted by @racket[parse-command-line]. The return value must also be a table of command-line flags, and this table is used to parse -@scheme[argv]. The intent is to allow @scheme[adjust-flag-table] to +@racket[argv]. The intent is to allow @racket[adjust-flag-table] to add or remove flags from the standard set. -After @scheme[argv] is parsed, a new thread and a namespace are +After @racket[argv] is parsed, a new thread and a namespace are created for the ``restarted'' Racket. (The new namespace is installed as the current namespace in the new thread.) In the new thread, restarting performs the following actions: @itemize[ - @item{The @scheme[init-namespace] procedure is called with no + @item{The @racket[init-namespace] procedure is called with no arguments. The return value is ignored.} - @item{Expressions and files specified by @scheme[argv] are evaluated + @item{Expressions and files specified by @racket[argv] are evaluated and loaded. If an error occurs, the remaining expressions and files are ignored, and the return value for - @scheme[restart-mzscheme] is set to @scheme[#f].} + @racket[restart-mzscheme] is set to @racket[#f].} - @item{The @scheme[read-eval-print-loop] procedure is called, unless a - flag in @scheme[init-argv] or @scheme[argv] disables it. When - @scheme[read-eval-print-loop] returns, the return value for - @scheme[restart-mzscheme] is set to @scheme[#t].} + @item{The @racket[read-eval-print-loop] procedure is called, unless a + flag in @racket[init-argv] or @racket[argv] disables it. When + @racket[read-eval-print-loop] returns, the return value for + @racket[restart-mzscheme] is set to @racket[#t].} ] Before evaluating command-line arguments, an exit handler is installed -that immediately returns from @scheme[restart-mzscheme] with the value +that immediately returns from @racket[restart-mzscheme] with the value supplied to the handler. This exit handler remains in effect when -@scheme[read-eval-print-loop] is called (unless a command-line -argument changes it). If @scheme[restart-mzscheme] returns normally, +@racket[read-eval-print-loop] is called (unless a command-line +argument changes it). If @racket[restart-mzscheme] returns normally, the return value is determined as described above. Note that an error in a command-line expression followed by -@scheme[read-eval-print-loop] produces a @scheme[#t] result. This is +@racket[read-eval-print-loop] produces a @racket[#t] result. This is consistent with Racket's stand-alone behavior.} diff --git a/collects/mzlib/scribblings/sandbox.scrbl b/collects/mzlib/scribblings/sandbox.scrbl index cdf3cbee93..ffd3976591 100644 --- a/collects/mzlib/scribblings/sandbox.scrbl +++ b/collects/mzlib/scribblings/sandbox.scrbl @@ -1,24 +1,24 @@ #lang scribble/doc @(require "common.rkt" (for-label mzlib/sandbox - (only-in scheme/sandbox make-module-evaluator))) + (only-in racket/sandbox make-module-evaluator))) @(begin (define-syntax-rule (bind id) (begin - (require (for-label scheme/sandbox)) - (define id (scheme make-evaluator)))) - (bind scheme-make-evaluator)) + (require (for-label racket/sandbox)) + (define id (racket make-evaluator)))) + (bind racket-make-evaluator)) @mzlib[#:mode title sandbox] -The @schememodname[mzlib/sandbox] library mostly re-exports -@schememodname[scheme/sandbox], but it provides a slightly different -@scheme[make-evaluator] function. +The @racketmodname[mzlib/sandbox] library mostly re-exports +@racketmodname[racket/sandbox], but it provides a slightly different +@racket[make-evaluator] function. The library re-exports the following bindings: -@schemeblock[ +@racketblock[ sandbox-init-hook sandbox-reader sandbox-input @@ -59,24 +59,24 @@ exn:fail:resource-resource [(make-evaluator [module-decl (or/c syntax? pair?)]) (any/c . -> . any)])]{ -Like @scheme-make-evaluator or @scheme[make-module-evaluator], but +Like @racket-make-evaluator or @racket[make-module-evaluator], but with several differences: @itemize[ - @item{The @scheme[language] argument can be one of a fixed set of - symbols: @scheme['r5rs], etc. They are converted by adding a - @scheme[(list 'special ....)] wrapper.} + @item{The @racket[language] argument can be one of a fixed set of + symbols: @racket['r5rs], etc. They are converted by adding a + @racket[(list 'special ....)] wrapper.} - @item{If @scheme[requires] starts with @scheme['begin], then each + @item{If @racket[requires] starts with @racket['begin], then each element in the remainder of the list is effectively evaluated as a prefix to the program. Otherwise, it corresponds to the - @scheme[#:requires] argument of @|scheme-make-evaluator|.} + @racket[#:requires] argument of @|racket-make-evaluator|.} - @item{For each of @scheme[language] and @scheme[requires] that starts - with @scheme['begin], the expressions are inspected to find - top-level @scheme[require] forms (using symbolic equality to - detect @scheme[require]), and the @scheme[require]d modules are - added to the @scheme[#:allow] list for @|scheme-make-evaluator|.} + @item{For each of @racket[language] and @racket[requires] that starts + with @racket['begin], the expressions are inspected to find + top-level @racket[require] forms (using symbolic equality to + detect @racket[require]), and the @racket[require]d modules are + added to the @racket[#:allow] list for @|racket-make-evaluator|.} ]} diff --git a/collects/mzlib/scribblings/sendevent.scrbl b/collects/mzlib/scribblings/sendevent.scrbl index d66ae82159..db8424daf4 100644 --- a/collects/mzlib/scribblings/sendevent.scrbl +++ b/collects/mzlib/scribblings/sendevent.scrbl @@ -11,8 +11,8 @@ @mzlib[#:mode title sendevent] -The @schememodname[mzlib/sendevent] library provides a -@scheme[send-event] function that works only on Mac OS X, and only +The @racketmodname[mzlib/sendevent] library provides a +@racket[send-event] function that works only on Mac OS X, and only when running in GRacket (though the library can be loaded in Racket). @defproc[(send-event [receiver-bytes (lambda (s) (and (bytes? s) @@ -25,5 +25,5 @@ when running in GRacket (though the library can be loaded in Racket). [argument-list list? null]) any/c]{ -Calls @|mred-send-event| @schememodname[scheme/gui/base], if -available, otherwise raises @scheme[exn:fail:unsupported].} +Calls @|mred-send-event| @racketmodname[scheme/gui/base], if +available, otherwise raises @racket[exn:fail:unsupported].} diff --git a/collects/mzlib/scribblings/serialize.scrbl b/collects/mzlib/scribblings/serialize.scrbl index 44a4130e47..22c73ed46e 100644 --- a/collects/mzlib/scribblings/serialize.scrbl +++ b/collects/mzlib/scribblings/serialize.scrbl @@ -5,18 +5,18 @@ @(begin (define-syntax-rule (bind id id2) (begin - (require (for-label scheme/serialize)) - (define id (scheme define-serializable-struct)) - (define id2 (scheme define-serializable-struct/versions)))) - (bind scheme-define-serializable-struct scheme-define-serializable-struct/versions)) + (require (for-label racket/serialize)) + (define id (racket define-serializable-struct)) + (define id2 (racket define-serializable-struct/versions)))) + (bind racket-define-serializable-struct racket-define-serializable-struct/versions)) @mzlib[#:mode title serialize] -The @schememodname[mzlib/serialize] library provides the same bindings -as @schememodname[scheme/serialize], except that -@scheme[define-serializable-struct] and -@scheme[define-serializable-struct/versions] are based on the syntax -of @scheme[define-struct] from @schememodname[mzscheme]. +The @racketmodname[mzlib/serialize] library provides the same bindings +as @racketmodname[racket/serialize], except that +@racket[define-serializable-struct] and +@racket[define-serializable-struct/versions] are based on the syntax +of @racket[define-struct] from @racketmodname[mzscheme]. @deftogether[( @defform[(define-serializable-struct id-maybe-super (field-id ...) maybe-inspector-expr)] @@ -31,6 +31,6 @@ of @scheme[define-struct] from @schememodname[mzscheme]. cycle-make-proc-expr)])] )]{ -Like @scheme-define-serializable-struct and -@scheme-define-serializable-struct/versions, but with the syntax of -closer to @scheme[define-struct] of @schememodname[mzscheme].} +Like @racket-define-serializable-struct and +@racket-define-serializable-struct/versions, but with the syntax of +closer to @racket[define-struct] of @racketmodname[mzscheme].} diff --git a/collects/mzlib/scribblings/string.scrbl b/collects/mzlib/scribblings/string.scrbl index 19dfcf93f5..625a924812 100644 --- a/collects/mzlib/scribblings/string.scrbl +++ b/collects/mzlib/scribblings/string.scrbl @@ -7,10 +7,10 @@ @mzlib[#:mode title string] -The @schememodname[mzlib/string] library re-exports several functions -from @schememodname[scheme/base]: +The @racketmodname[mzlib/string] library re-exports several functions +from @racketmodname[scheme/base]: -@schemeblock[ +@racketblock[ real->decimal-string regexp-quote regexp-replace-quote @@ -21,8 +21,8 @@ regexp-split regexp-match-exact? ] -It also re-exports @scheme[regexp-try-match] as -@scheme[regexp-match/fail-without-reading]. +It also re-exports @racket[regexp-try-match] as +@racket[regexp-match/fail-without-reading]. @defproc[(glob->regexp [str (or/c string bytes?)?] @@ -31,33 +31,33 @@ It also re-exports @scheme[regexp-try-match] as [simple? any/c #f]) (or/c regexp? byte-regexp?)]{ -Produces a regexp for a an input ``glob pattern'' @scheme[str]. A +Produces a regexp for a an input ``glob pattern'' @racket[str]. A glob pattern is one that matches @litchar{*} with any string, @litchar{?} with a single character, and character ranges are the same -as in regexps (unless @scheme[simple?] is true). In addition, the +as in regexps (unless @racket[simple?] is true). In addition, the resulting regexp does not match strings that begin with @litchar{.}, -unless @scheme[str] begins with @litchar{.} or @scheme[hide-dots?] is -@scheme[#f]. The resulting regexp can be used with string file names +unless @racket[str] begins with @litchar{.} or @racket[hide-dots?] is +@racket[#f]. The resulting regexp can be used with string file names to check the glob pattern. If the glob pattern is provided as a byte string, the result is a byte regexp. -The @scheme[case-sensitive?] argument determines whether the resulting +The @racket[case-sensitive?] argument determines whether the resulting regexp is case-sensitive. -If @scheme[simple?] is true, then ranges with -@litchar{[}...@litchar{]} in @scheme[str] are treated as literal +If @racket[simple?] is true, then ranges with +@litchar{[}...@litchar{]} in @racket[str] are treated as literal character sequences.} @defproc[(string-lowercase! [str (and/c string? (not/c immutable?))]) void?]{ -Destructively changes @scheme[str] to contain only lowercase +Destructively changes @racket[str] to contain only lowercase characters.} @defproc[(string-uppercase! [str (and/c string? (not/c immutable?))]) void?]{ -Destructively changes @scheme[str] to contain only uppercase +Destructively changes @racket[str] to contain only uppercase characters.} @@ -69,16 +69,16 @@ characters.} #f]) list?]{ -Reads and evaluates S-expressions from @scheme[str], returning results +Reads and evaluates S-expressions from @racket[str], returning results for all of the expressions in the string. If any expression produces multiple results, the results are spliced into the resulting list. If -@scheme[str] contains only whitespace and comments, an empty list is -returned, and if @scheme[str] contains multiple expressions, the +@racket[str] contains only whitespace and comments, an empty list is +returned, and if @racket[str] contains multiple expressions, the result will be contain multiple values from all subexpressions. -The @scheme[err-handler] argument can be: +The @racket[err-handler] argument can be: @itemize[ -@item{@scheme[#f] (the default) which means that errors are not +@item{@racket[#f] (the default) which means that errors are not caught;} @item{a one-argument procedure, which will be used with an exception (when an error occurs) and its result will be returned} @@ -88,7 +88,7 @@ The @scheme[err-handler] argument can be: @defproc[(expr->string [expr any/c]) string?]{ -Prints @scheme[expr] into a string and returns the string.} +Prints @racket[expr] into a string and returns the string.} @defproc[(read-from-string [str (or/c string? bytes?)] @@ -98,8 +98,8 @@ Prints @scheme[expr] into a string and returns the string.} #f]) any/c]{ -Reads the first S-expression from @scheme[str] and returns it. The -@scheme[err-handler] is as in @scheme[eval-string].} +Reads the first S-expression from @racket[str] and returns it. The +@racket[err-handler] is as in @racket[eval-string].} @defproc[(read-from-string-all [str (or/c string? bytes?)] @@ -109,6 +109,6 @@ Reads the first S-expression from @scheme[str] and returns it. The #f]) list?]{ -Reads all S-expressions from the string (or byte string) @scheme[str] -and returns them in a list. The @scheme[err-handler] is as in -@scheme[eval-string].} +Reads all S-expressions from the string (or byte string) @racket[str] +and returns them in a list. The @racket[err-handler] is as in +@racket[eval-string].} diff --git a/collects/mzlib/scribblings/struct.scrbl b/collects/mzlib/scribblings/struct.scrbl index d95166c621..02d62575cd 100644 --- a/collects/mzlib/scribblings/struct.scrbl +++ b/collects/mzlib/scribblings/struct.scrbl @@ -16,25 +16,25 @@ (accessor-id field-expr) ...)]{ ``Functional update'' for structure instances. The result of -evaluating @scheme[struct-expr] must be an instance of the structure -type named by @scheme[struct-id]. The result of the -@scheme[copy-struct] expression is a fresh instance of -@scheme[struct-id] with the same field values as the result of -@scheme[struct-expr], except that the value for the field accessed by -each @scheme[accessor-id] is replaced by the result of -@scheme[field-expr]. +evaluating @racket[struct-expr] must be an instance of the structure +type named by @racket[struct-id]. The result of the +@racket[copy-struct] expression is a fresh instance of +@racket[struct-id] with the same field values as the result of +@racket[struct-expr], except that the value for the field accessed by +each @racket[accessor-id] is replaced by the result of +@racket[field-expr]. -The result of @scheme[struct-expr] might be an instance of a sub-type -of @scheme[struct-id], but the result of the @scheme[copy-struct] -expression is an immediate instance of @scheme[struct-id]. If -@scheme[struct-expr] does not produce an instance of -@scheme[struct-id], the @scheme[exn:fail:contract] exception is +The result of @racket[struct-expr] might be an instance of a sub-type +of @racket[struct-id], but the result of the @racket[copy-struct] +expression is an immediate instance of @racket[struct-id]. If +@racket[struct-expr] does not produce an instance of +@racket[struct-id], the @racket[exn:fail:contract] exception is raised. -If any @scheme[accessor-id] is not bound to an accessor of -@scheme[struct-id] (according to the expansion-time information -associated with @scheme[struct-id]), or if the same -@scheme[accessor-id] is used twice, then a syntax error is raised.} +If any @racket[accessor-id] is not bound to an accessor of +@racket[struct-id] (according to the expansion-time information +associated with @racket[struct-id]), or if the same +@racket[accessor-id] is used twice, then a syntax error is raised.} @defform/subs[(define-struct/properties id (field-id ...) @@ -43,10 +43,10 @@ associated with @scheme[struct-id]), or if the same ([maybe-inspector-expr code:blank expr])]{ -Like @scheme[define-struct] from @schememodname[mzscheme], but +Like @racket[define-struct] from @racketmodname[mzscheme], but properties can be attached to the structure type. Each -@scheme[prop-expr] should produce a structure-type property value, and -each @scheme[val-expr] produces the corresponding value for the +@racket[prop-expr] should produce a structure-type property value, and +each @racket[val-expr] produces the corresponding value for the property. @examples[ @@ -63,6 +63,6 @@ property. @defform[(make-->vector struct-id)]{ Builds a function that accepts a structure type instance (matching -@scheme[struct-id]) and provides a vector of the fields of the +@racket[struct-id]) and provides a vector of the fields of the structure type instance.} diff --git a/collects/mzlib/scribblings/thread.scrbl b/collects/mzlib/scribblings/thread.scrbl index 206a3d3c8a..8efa0a9668 100644 --- a/collects/mzlib/scribblings/thread.scrbl +++ b/collects/mzlib/scribblings/thread.scrbl @@ -10,54 +10,54 @@ coroutine?]{ Returns a coroutine object to encapsulate a thread that runs only when -allowed. The @scheme[proc] procedure should accept one argument, and -@scheme[proc] is run in the coroutine thread when -@scheme[coroutine-run] is called. If @scheme[coroutine-run] returns +allowed. The @racket[proc] procedure should accept one argument, and +@racket[proc] is run in the coroutine thread when +@racket[coroutine-run] is called. If @racket[coroutine-run] returns due to a timeout, then the coroutine thread is suspended until a -future call to @scheme[coroutine-run]. Thus, @scheme[proc] only -executes during the dynamic extent of a @scheme[coroutine-run] call. +future call to @racket[coroutine-run]. Thus, @racket[proc] only +executes during the dynamic extent of a @racket[coroutine-run] call. -The argument to @scheme[proc] is a procedure that takes a boolean, and -it can be used to disable suspends (in case @scheme[proc] has critical +The argument to @racket[proc] is a procedure that takes a boolean, and +it can be used to disable suspends (in case @racket[proc] has critical regions where it should not be suspended). A true value passed to the -procedure enables suspends, and @scheme[#f] disables +procedure enables suspends, and @racket[#f] disables suspends. Initially, suspends are allowed.} @defproc[(coroutine? [v any/c]) any]{ -Returns @scheme[#t] if @scheme[v] is a coroutine produced by -@scheme[coroutine], @scheme[#f] otherwise.} +Returns @racket[#t] if @racket[v] is a coroutine produced by +@racket[coroutine], @racket[#f] otherwise.} @defproc[(coroutine-run [until (or/c evt? real?)][coroutine coroutine?]) boolean?]{ -Allows the thread associated with @scheme[coroutine] to execute for up -as long as @scheme[until] milliseconds (of @scheme[until] is a real -number) or @scheme[until] is ready (if @scheme[until] is an event). If -@scheme[coroutine]'s procedure disables suspends, then the coroutine +Allows the thread associated with @racket[coroutine] to execute for up +as long as @racket[until] milliseconds (of @racket[until] is a real +number) or @racket[until] is ready (if @racket[until] is an event). If +@racket[coroutine]'s procedure disables suspends, then the coroutine can run arbitrarily long until it re-enables suspends. -The @scheme[coroutine-run] procedure returns @scheme[#t] if -@scheme[coroutine]'s procedure completes (or if it completed earlier), -and the result is available via @scheme[coroutine-result]. The -@scheme[coroutine-run] procedure returns @scheme[#f] if -@scheme[coroutine]'s procedure does not complete before it is -suspended after @scheme[timeout-secs]. If @scheme[coroutine]'s +The @racket[coroutine-run] procedure returns @racket[#t] if +@racket[coroutine]'s procedure completes (or if it completed earlier), +and the result is available via @racket[coroutine-result]. The +@racket[coroutine-run] procedure returns @racket[#f] if +@racket[coroutine]'s procedure does not complete before it is +suspended after @racket[timeout-secs]. If @racket[coroutine]'s procedure raises an exception, then it is re-raised by -@scheme[coroutine-run].} +@racket[coroutine-run].} @defproc[(coroutine-result [coroutine coroutine]) any]{ -Returns the result for @scheme[coroutine] if it has completed with a -value (as opposed to an exception), @scheme[#f] otherwise.} +Returns the result for @racket[coroutine] if it has completed with a +value (as opposed to an exception), @racket[#f] otherwise.} @defproc[(coroutine-kill [coroutine coroutine?]) void?]{ -Forcibly terminates the thread associated with @scheme[coroutine] if +Forcibly terminates the thread associated with @racket[coroutine] if it is still running, leaving the coroutine result unchanged.} @@ -65,18 +65,18 @@ it is still running, leaving the coroutine result unchanged.} (values thread? procedure?)]{ Returns two values: a thread descriptor for a new thread, and a -procedure with the same arity as @scheme[f]. +procedure with the same arity as @racket[f]. When the returned procedure is applied, its arguments are queued to be -passed on to @scheme[f], and @|void-const| is immediately returned. -The thread created by @scheme[consumer-thread] dequeues arguments and -applies @scheme[f] to them, removing a new set of arguments from the -queue only when the previous application of @scheme[f] has completed; -if @scheme[f] escapes from a normal return (via an exception or a -continuation), the @scheme[f]-applying thread terminates. +passed on to @racket[f], and @|void-const| is immediately returned. +The thread created by @racket[consumer-thread] dequeues arguments and +applies @racket[f] to them, removing a new set of arguments from the +queue only when the previous application of @racket[f] has completed; +if @racket[f] escapes from a normal return (via an exception or a +continuation), the @racket[f]-applying thread terminates. -The @scheme[init] argument is a procedure of no arguments; if it is -provided, @scheme[init] is called in the new thread immediately after the +The @racket[init] argument is a procedure of no arguments; if it is +provided, @racket[init] is called in the new thread immediately after the thread is created.} @@ -92,48 +92,48 @@ thread is created.} [accept/break (listener? . ->* . (input-port? output-port?)) tcp-accept/enable-break]) void?]{ -Executes a TCP server on the port indicated by @scheme[port-no]. When -a connection is made by a client, @scheme[conn] is called with two +Executes a TCP server on the port indicated by @racket[port-no]. When +a connection is made by a client, @racket[conn] is called with two values: an input port to receive from the client, and an output port to send to the client. Each client connection is managed by a new custodian, and each call to -@scheme[conn] occurs in a new thread (managed by the connection's -custodian). If the thread executing @scheme[conn] terminates for any -reason (e.g., @scheme[conn] returns), the connection's custodian is -shut down. Consequently, @scheme[conn] need not close the ports +@racket[conn] occurs in a new thread (managed by the connection's +custodian). If the thread executing @racket[conn] terminates for any +reason (e.g., @racket[conn] returns), the connection's custodian is +shut down. Consequently, @racket[conn] need not close the ports provided to it. Breaks are enabled in the connection thread if breaks -are enabled when @scheme[run-server] is called. +are enabled when @racket[run-server] is called. To facilitate capturing a continuation in one connection thread and invoking it in another, the parameterization of the -@scheme[run-server] call is used for every call to -@scheme[handler]. In this parameterization and for the connection's -thread, the @scheme[current-custodian] parameter is assigned to the +@racket[run-server] call is used for every call to +@racket[handler]. In this parameterization and for the connection's +thread, the @racket[current-custodian] parameter is assigned to the connection's custodian. -If @scheme[conn-timeout] is not @scheme[#f], then it must be a +If @racket[conn-timeout] is not @racket[#f], then it must be a non-negative number specifying the time in seconds that a connection thread is allowed to run before it is sent a break signal. Then, if -the thread runs longer than @scheme[(* conn-timeout 2)] seconds, then -the connection's custodian is shut down. If @scheme[conn-timeout] is -@scheme[#f], a connection thread can run indefinitely. +the thread runs longer than @racket[(* conn-timeout 2)] seconds, then +the connection's custodian is shut down. If @racket[conn-timeout] is +@racket[#f], a connection thread can run indefinitely. -If @scheme[handler] is provided, it is passed exceptions related -to connections (i.e., exceptions not caught by @scheme[conn-proc], or +If @racket[handler] is provided, it is passed exceptions related +to connections (i.e., exceptions not caught by @racket[conn-proc], or exceptions that occur when trying to accept a connection). The default handler ignores the exception and returns @|void-const|. -The @scheme[run-server] function uses @scheme[listen], @scheme[close], -@scheme[accept] and @scheme[accept/break] in the same way as it might -use @scheme[tcp-listen], @scheme[tcp-close], @scheme[tcp-accept], and -@scheme[tcp-accept/enable-break] to accept connections. Provide +The @racket[run-server] function uses @racket[listen], @racket[close], +@racket[accept] and @racket[accept/break] in the same way as it might +use @racket[tcp-listen], @racket[tcp-close], @racket[tcp-accept], and +@racket[tcp-accept/enable-break] to accept connections. Provide alternate procedures to use an alternate communication protocol (such as SSL) or to supply optional arguments in the use of -@scheme[tcp-listen]. The @scheme[listener?] part of the contract +@racket[tcp-listen]. The @racket[listener?] part of the contract indicates that the procedures must all work on the same kind of listener value. -The @scheme[run-server] procedure loops to serve client connections, +The @racket[run-server] procedure loops to serve client connections, so it never returns. If a break occurs, the loop will cleanly shut down the server, but it will not terminate active connections.} diff --git a/collects/mzlib/scribblings/traceld.scrbl b/collects/mzlib/scribblings/traceld.scrbl index 19c0bd61ed..bda84bb9f7 100644 --- a/collects/mzlib/scribblings/traceld.scrbl +++ b/collects/mzlib/scribblings/traceld.scrbl @@ -3,20 +3,20 @@ @mzlib[#:mode title traceld] -The @schememodname[mzlib/traceld] library does not provide any -bindings. Instead, @schememodname[mzlib/traceld] is @scheme[require]d +The @racketmodname[mzlib/traceld] library does not provide any +bindings. Instead, @racketmodname[mzlib/traceld] is @racket[require]d for its side-effects. -The @schememodname[mzlib/traceld] library installs a new load handler -(see @scheme[current-load]) and load-extension handler (see -@scheme[current-load-extension]) to print information about the files +The @racketmodname[mzlib/traceld] library installs a new load handler +(see @racket[current-load]) and load-extension handler (see +@racket[current-load-extension]) to print information about the files that are loaded. These handlers chain to the current handlers to perform the actual loads. Trace output is printed to the port that is -the current error port (see @scheme[current-error-port]) when the +the current error port (see @racket[current-error-port]) when the library is instantiated. Before a file is loaded, the tracer prints the file name and ``time'' -(as reported by the procedure @scheme[current-process-milliseconds]) +(as reported by the procedure @racket[current-process-milliseconds]) when the load starts. Trace information for nested loads is printed with indentation. After the file is loaded, the file name is printed with the ``time'' that the load completed. diff --git a/collects/mzlib/scribblings/transcr.scrbl b/collects/mzlib/scribblings/transcr.scrbl index ebcc26f605..30e9085cc6 100644 --- a/collects/mzlib/scribblings/transcr.scrbl +++ b/collects/mzlib/scribblings/transcr.scrbl @@ -3,11 +3,11 @@ @mzlib[#:mode title transcr] -The @scheme[transcript-on] and @scheme[transcript-off] procedures of -@schememodname[mzscheme] always raise -@scheme[exn:fail:unsupported]. The @schememodname[mzlib/transcr] -library provides working versions of @scheme[transcript-on] and -@scheme[transcript-off]. +The @racket[transcript-on] and @racket[transcript-off] procedures of +@racketmodname[mzscheme] always raise +@racket[exn:fail:unsupported]. The @racketmodname[mzlib/transcr] +library provides working versions of @racket[transcript-on] and +@racket[transcript-off]. @(define-syntax-rule (go) (begin @@ -18,5 +18,5 @@ library provides working versions of @scheme[transcript-on] and @defproc[(transcript-off) any] )]{ - Starts/stops recording a transcript at @scheme[filename].})) + Starts/stops recording a transcript at @racket[filename].})) @(go) diff --git a/collects/mzlib/scribblings/unit.scrbl b/collects/mzlib/scribblings/unit.scrbl index fa55beac27..5ccf11e6a6 100644 --- a/collects/mzlib/scribblings/unit.scrbl +++ b/collects/mzlib/scribblings/unit.scrbl @@ -5,20 +5,20 @@ @(begin (define-syntax-rule (bind id) (begin - (require (for-label scheme/unit)) - (define id (scheme struct)))) - (bind scheme-struct) + (require (for-label racket/unit)) + (define id (racket struct)))) + (bind racket-struct) (define-syntax-rule (bindc id) (begin - (require (for-label scheme/unit)) - (define id (scheme struct/ctc)))) - (bindc scheme-struct/ctc)) + (require (for-label racket/unit)) + (define id (racket struct/ctc)))) + (bindc racket-struct/ctc)) @mzlib[#:mode title unit] -The @schememodname[mzlib/unit] library mostly re-provides -@schememodname[scheme/unit], except for @scheme-struct and -@scheme-struct/ctc from @schememodname[scheme/unit]. +The @racketmodname[mzlib/unit] library mostly re-provides +@racketmodname[racket/unit], except for @racket-struct and +@racket-struct/ctc from @racketmodname[racket/unit]. @defform/subs[(struct id (field-id ...) omit-decl ...) ([omit-decl -type @@ -26,7 +26,7 @@ The @schememodname[mzlib/unit] library mostly re-provides -setters -constructor])]{ -A signature form like @scheme-struct from @schememodname[scheme/unit], +A signature form like @racket-struct from @racketmodname[racket/unit], but with a different syntax for the options that limit exports.} @defform/subs[(struct/ctc id ([field-id contract-expr] ...) omit-decl ...) @@ -35,7 +35,7 @@ but with a different syntax for the options that limit exports.} -setters -constructor])]{ -A signature form like @scheme-struct/ctc from @schememodname[scheme/unit], +A signature form like @racket-struct/ctc from @racketmodname[racket/unit], but with a different syntax for the options that limit exports.} @deftogether[( @@ -43,15 +43,13 @@ but with a different syntax for the options that limit exports.} @defidform[struct~s/ctc] )]{ -The same as @|scheme-struct| and @|scheme-struct/ctc| from -@schememodname[scheme/unit].} +The same as @|racket-struct| and @|racket-struct/ctc| from +@racketmodname[racket/unit].} @deftogether[( @defidform[struct~r] @defidform[struct~r/ctc] )]{ -Like @scheme[struct~s] and @scheme[struct~s/ctc], but the constructor is -named the same as the type, instead of with @schemeidfont{make-} prefix.} - - +Like @racket[struct~s] and @racket[struct~s/ctc], but the constructor is +named the same as the type, instead of with @racketidfont{make-} prefix.} diff --git a/collects/mzscheme/mzscheme.scrbl b/collects/mzscheme/mzscheme.scrbl index e5443a184a..a680d019cd 100644 --- a/collects/mzscheme/mzscheme.scrbl +++ b/collects/mzscheme/mzscheme.scrbl @@ -47,7 +47,7 @@ @(define-syntax-rule (additionals racket/base id ...) (begin (require (for-label (only-in racket/base id ...))) - (schemeblock id ...))) + (racketblock id ...))) @(define old-vers @elem{version 372}) @@ -55,21 +55,21 @@ @defmodule[mzscheme]{ -The @schememodname[mzscheme] language provides nearly the same -bindings as the @schememodname[mzscheme] module of PLT Scheme +The @racketmodname[mzscheme] language provides nearly the same +bindings as the @racketmodname[mzscheme] module of PLT Scheme @|old-vers| and earlier.} -Unlike @|old-vers|, the @schememodname[mzscheme] language does not -include @scheme[set-car!] or @scheme[set-cdr!], and @scheme[cons] -makes immutable pairs, as in @scheme[scheme/base]; those changes make -modules built on @schememodname[mzscheme] reasonably compatible with -modules built on @schememodname[scheme/base]. +Unlike @|old-vers|, the @racketmodname[mzscheme] language does not +include @racket[set-car!] or @racket[set-cdr!], and @racket[cons] +makes immutable pairs, as in @racket[scheme/base]; those changes make +modules built on @racketmodname[mzscheme] reasonably compatible with +modules built on @racketmodname[scheme/base]. -Otherwise, the @schememodname[mzscheme] language shares many bindings -with @schememodname[scheme/base]. It renames a few bindings, such as -@scheme[syntax-object->datum] instead of @scheme[syntax->datum], and +Otherwise, the @racketmodname[mzscheme] language shares many bindings +with @racketmodname[scheme/base]. It renames a few bindings, such as +@racket[syntax-object->datum] instead of @racket[syntax->datum], and it provides old versions of some syntactic forms, such as -@scheme[lambda] without support for keyword and optional arguments. +@racket[lambda] without support for keyword and optional arguments. @table-of-contents[] @@ -79,25 +79,25 @@ it provides old versions of some syntactic forms, such as @defform[(#%module-begin form ...)]{ -Like @scheme[#%plain-module-begin] from @schememodname[scheme/base], -but @scheme[(require-for-syntax mzscheme)] is added to the beginning -of the @scheme[form] sequence, thus importing @schememodname[mzscheme] +Like @racket[#%plain-module-begin] from @racketmodname[scheme/base], +but @racket[(require-for-syntax mzscheme)] is added to the beginning +of the @racket[form] sequence, thus importing @racketmodname[mzscheme] into the transformer environment for the module body. (In contrast, -@schememodname[scheme/base] exports @scheme[for-syntax] minimal -transformer support, while @schememodname[scheme] exports all of -@schememodname[scheme/base] @scheme[for-syntax].} +@racketmodname[scheme/base] exports @racket[for-syntax] minimal +transformer support, while @racketmodname[scheme] exports all of +@racketmodname[scheme/base] @racket[for-syntax].} @defform[(#%plain-module-begin form ...)]{ -The same binding as @scheme[#%plain-module-begin] from -@schememodname[scheme/base].} +The same binding as @racket[#%plain-module-begin] from +@racketmodname[scheme/base].} @defform[(#%plain-lambda formals body ...+)]{ -The same binding as @scheme[#%plain-lambda] in -@schememodname[scheme/base]. (This binding was not present in +The same binding as @racket[#%plain-lambda] in +@racketmodname[scheme/base]. (This binding was not present in @|old-vers| and earlier.)} @@ -106,19 +106,19 @@ The same binding as @scheme[#%plain-lambda] in @defform[(λ formals body ...+)] )]{ -The same bindings as @scheme[#%plain-lambda].} +The same bindings as @racket[#%plain-lambda].} @defform*[[(#%app proc-expr arg-expr ...) (#%app)]]{ -The same binding as @scheme[#%plain-app] from -@schememodname[scheme/base].} +The same binding as @racket[#%plain-app] from +@racketmodname[scheme/base].} @defform*[[(#%plain-app proc-expr arg-expr ...) (#%plain-app)]]{ -The same binding as @scheme[#%app]. (This binding was not present in +The same binding as @racket[#%app]. (This binding was not present in @|old-vers| and earlier.)} @defform*/subs[[(define id expr) @@ -126,9 +126,9 @@ The same binding as @scheme[#%app]. (This binding was not present in ([head id (head args)] [args (code:line arg-id ...) - (code:line arg-id ... @#,schemeparenfont{.} rest-id)])]{ + (code:line arg-id ... @#,racketparenfont{.} rest-id)])]{ -Like @|base-define| in @schememodname[scheme/base], but without +Like @|base-define| in @racketmodname[scheme/base], but without support for keyword arguments or optional arguments.} @deftogether[( @@ -139,49 +139,49 @@ support for keyword arguments or optional arguments.} )]{ Like @|base-define-syntax| and @|base-define-for-syntax| in -@schememodname[scheme/base], but without support for keyword arguments -or optional arguments (i.e., @scheme[head] is as for @scheme[define]).} +@racketmodname[scheme/base], but without support for keyword arguments +or optional arguments (i.e., @racket[head] is as for @racket[define]).} @defform*[[(if test-expr then-expr else-expr) (if test-expr then-expr)]]{ -Like @|base-if| in @schememodname[scheme/base], but @scheme[else-expr] -defaults to @scheme[(void)].} +Like @|base-if| in @racketmodname[scheme/base], but @racket[else-expr] +defaults to @racket[(void)].} @deftogether[( @defform[(cond cond-clause ...)] @defform[(case val-expr case-clause ...)] )]{ -Like @|base-cond| and @|base-case| in @schememodname[scheme/base], but -@scheme[else] and @scheme[=>] are recognized as unbound identifiers, -instead of as the @schememodname[scheme/base] bindings. } +Like @|base-cond| and @|base-case| in @racketmodname[scheme/base], but +@racket[else] and @racket[=>] are recognized as unbound identifiers, +instead of as the @racketmodname[scheme/base] bindings. } @defform[(fluid-let ([id expr] ...) body ...+)]{ -Provides a kind of dynamic binding via mutation of the @scheme[id]s. +Provides a kind of dynamic binding via mutation of the @racket[id]s. -The @scheme[fluid-let] form first evaluates each @scheme[expr] to -obtain an @defterm{entry value} for each @scheme[id]. As evaluation -moves into @scheme[body], either though normal evaluation or a -continuation jump, the current value of each @scheme[id] is swapped -with the entry value. On exit from @scheme[body], then the current +The @racket[fluid-let] form first evaluates each @racket[expr] to +obtain an @defterm{entry value} for each @racket[id]. As evaluation +moves into @racket[body], either though normal evaluation or a +continuation jump, the current value of each @racket[id] is swapped +with the entry value. On exit from @racket[body], then the current value and entry value are swapped again.} @defform/subs[(define-struct id-maybe-super (field-id ...) maybe-inspector-expr) ([maybe-inspector-expr code:blank expr])]{ -Like @base-define-struct from @scheme[scheme/base], but with fewer +Like @base-define-struct from @racket[scheme/base], but with fewer options. Each field is implicitly mutable, and the optional -@scheme[expr] is analogous to supplying an @scheme[#:inspector] +@racket[expr] is analogous to supplying an @racket[#:inspector] expression.} @defform[(let-struct id-maybe-super (field-id ...) body ...+)]{ Expands to -@schemeblock[ +@racketblock[ (let () (define-struct id-maybe-super (field-id ...)) body ...+) @@ -197,21 +197,21 @@ Expands to @defform[(provide-for-label raw-provide-spec)] )]{ -Like @scheme[#%require] and @scheme[#%provide]. The -@schemeidfont{-for-syntax}, @schemeidfont{-for-template}, and -@schemeidfont{-for-label} forms are translated to @scheme[#%require] -and @scheme[#%provide] using @schemeidfont{for-syntax}, -@schemeidfont{for-template}, and @schemeidfont{for-label} sub-forms, +Like @racket[#%require] and @racket[#%provide]. The +@racketidfont{-for-syntax}, @racketidfont{-for-template}, and +@racketidfont{-for-label} forms are translated to @racket[#%require] +and @racket[#%provide] using @racketidfont{for-syntax}, +@racketidfont{for-template}, and @racketidfont{for-label} sub-forms, respectively.} @defform[(#%datum . datum)]{ -Expands to @scheme[(quote datum)], even if @scheme[datum] is a +Expands to @racket[(quote datum)], even if @racket[datum] is a keyword.} @defform[(#%top-interaction . form)]{ -The same as @|base-top-interaction| in @schememodname[scheme/base].} +The same as @|base-top-interaction| in @racketmodname[scheme/base].} @; ---------------------------------------- @@ -219,12 +219,12 @@ The same as @|base-top-interaction| in @schememodname[scheme/base].} @defproc[(apply [proc procedure?] [v any/c] ... [lst list?]) any]{ -Like @base-apply from @schememodname[scheme/base], but without support +Like @base-apply from @racketmodname[scheme/base], but without support for keyword arguments.} @defthing[prop:procedure struct-type-property?]{ -Like @base-prop:procedure from @schememodname[scheme/base], but even +Like @base-prop:procedure from @racketmodname[scheme/base], but even if the property's value for a structure type is a procedure that accepts keyword arguments, then instances of the structure type still do not accept keyword arguments. (In contrast, if the property's value @@ -267,9 +267,9 @@ arguments.)} any] )]{ -Like @base-open-input-file, etc. from @schememodname[scheme/base], but -@scheme[mode] and @scheme[exists] arguments are not keyword -arguments. When both @scheme[mode] and @scheme[exists] are accepted, +Like @base-open-input-file, etc. from @racketmodname[scheme/base], but +@racket[mode] and @racket[exists] arguments are not keyword +arguments. When both @racket[mode] and @racket[exists] are accepted, they are accepted in either order.} @@ -293,7 +293,7 @@ they are accepted in either order.} syntax?] )]{ -The same as @scheme[syntax->datum] and @scheme[datum->syntax].} +The same as @racket[syntax->datum] and @racket[datum->syntax].} @deftogether[( @defproc[(module-identifier=? [a-id syntax?][b-id syntax?]) boolean?] @@ -303,12 +303,12 @@ The same as @scheme[syntax->datum] and @scheme[datum->syntax].} @defproc[(free-identifier=? [a-id syntax?][b-id syntax?]) boolean?] )]{ -The @scheme[module-identifier=?], @|etc| functions are the same as -@base-free-identifier=?, @|etc| in @schememodname[scheme/base]. +The @racket[module-identifier=?], @|etc| functions are the same as +@base-free-identifier=?, @|etc| in @racketmodname[scheme/base]. -The @scheme[free-identifier=?] procedure returns +The @racket[free-identifier=?] procedure returns -@schemeblock[ +@racketblock[ (and (eq? (syntax-e a) (syntax-e b)) (module-identifier=? a b)) ]} @@ -316,24 +316,24 @@ The @scheme[free-identifier=?] procedure returns @defproc[(make-namespace [mode (one-of/c 'initial 'empty) 'initial]) namespace?]{ -Creates a namespace with @schememodname[mzscheme] attached. If the -@scheme[mode] is empty, the namespace's top-level environment is left -empty. If @scheme[mode] is @scheme['initial], then the namespace's +Creates a namespace with @racketmodname[mzscheme] attached. If the +@racket[mode] is empty, the namespace's top-level environment is left +empty. If @racket[mode] is @racket['initial], then the namespace's top-level environment is initialized with -@scheme[(namespace-require/copy 'mzscheme)]. See also -@scheme[make-base-empty-namespace].} +@racket[(namespace-require/copy 'mzscheme)]. See also +@racket[make-base-empty-namespace].} @defproc[(namespace-transformer-require [req any/c]) void?]{ -Equivalent to @scheme[(namespace-require `(for-syntax ,req))].} +Equivalent to @racket[(namespace-require `(for-syntax ,req))].} @deftogether[( @defproc[(transcript-on [filename any/c]) any] @defproc[(transcript-off) any] )]{ -Raises @scheme[exn:fail], because the operations are not supported.} +Raises @racket[exn:fail], because the operations are not supported.} @defproc*[([(hash-table? [v any/c]) @@ -345,11 +345,11 @@ Raises @scheme[exn:fail], because the operations are not supported.} [flag (one-of/c 'weak 'equal 'eqv)]) hash-table?])]{ -Returns @scheme[#t] if @scheme[v] like a hash table created by -@scheme[make-hash-table] or @scheme[make-immutable-hash-table] with -the given @scheme[flag]s (or more), @scheme[#f] otherwise. Each -provided @scheme[flag] must be distinct and @scheme['equal] cannot be -used with @scheme['eqv], otherwise the @scheme[exn:fail:contract] +Returns @racket[#t] if @racket[v] like a hash table created by +@racket[make-hash-table] or @racket[make-immutable-hash-table] with +the given @racket[flag]s (or more), @racket[#f] otherwise. Each +provided @racket[flag] must be distinct and @racket['equal] cannot be +used with @racket['eqv], otherwise the @racket[exn:fail:contract] exception is raised.} @@ -361,29 +361,29 @@ exception is raised.} [flag (one-of/c 'weak 'equal 'eqv)]) hash-table?])]{ -Creates and returns a new hash table. If provided, each @scheme[flag] +Creates and returns a new hash table. If provided, each @racket[flag] must one of the following: @itemize[ - @item{@indexed-scheme['weak] --- creates a hash table with - weakly-held keys via @scheme[make-weak-hash], - @scheme[make-weak-hasheq], or @scheme[make-weak-hasheqv].} + @item{@indexed-racket['weak] --- creates a hash table with + weakly-held keys via @racket[make-weak-hash], + @racket[make-weak-hasheq], or @racket[make-weak-hasheqv].} - @item{@indexed-scheme['equal] --- creates a hash table that compares - keys using @scheme[equal?] instead of @scheme[eq?] using - @scheme[make-hash] or @scheme[make-weak-hash].} + @item{@indexed-racket['equal] --- creates a hash table that compares + keys using @racket[equal?] instead of @racket[eq?] using + @racket[make-hash] or @racket[make-weak-hash].} - @item{@indexed-scheme['eqv] --- creates a hash table that compares - keys using @scheme[eqv?] instead of @scheme[eq?] using - @scheme[make-hasheqv] or @scheme[make-weak-hasheqv].} + @item{@indexed-racket['eqv] --- creates a hash table that compares + keys using @racket[eqv?] instead of @racket[eq?] using + @racket[make-hasheqv] or @racket[make-weak-hasheqv].} ] -By default, key comparisons use @scheme[eq?] (i.e., the hash table is -created with @scheme[make-hasheq]). If the second @scheme[flag] is -redundant or @scheme['equal] is provided with @scheme['eqv], the -@scheme[exn:fail:contract] exception is raised.} +By default, key comparisons use @racket[eq?] (i.e., the hash table is +created with @racket[make-hasheq]). If the second @racket[flag] is +redundant or @racket['equal] is provided with @racket['eqv], the +@racket[exn:fail:contract] exception is raised.} @defproc*[([(make-immutable-hash-table [assocs (listof pair?)]) @@ -392,9 +392,9 @@ redundant or @scheme['equal] is provided with @scheme['eqv], the [flag (one-of/c 'equal 'eqv)]) (and/c hash-table? immutable?)])]{ -Like @scheme[make-immutable-hash], @scheme[make-immutable-hasheq], or -@scheme[make-immutable-hasheqv], depending on whether an -@scheme['equal] or @scheme['eqv] @scheme[flag] is provided.} +Like @racket[make-immutable-hash], @racket[make-immutable-hasheq], or +@racket[make-immutable-hasheqv], depending on whether an +@racket['equal] or @racket['eqv] @racket[flag] is provided.} @; ---------------------------------------- diff --git a/collects/net/scribblings/base64.scrbl b/collects/net/scribblings/base64.scrbl index eb0cb58255..9ca28e69a7 100644 --- a/collects/net/scribblings/base64.scrbl +++ b/collects/net/scribblings/base64.scrbl @@ -3,7 +3,7 @@ @title[#:tag "base64"]{Base 64: Encoding and Decoding} -@defmodule[net/base64]{The @schememodname[net/base64] library provides +@defmodule[net/base64]{The @racketmodname[net/base64] library provides utilities for Base 64 (mime-standard) encoding and decoding.} @section[#:tag "base64-procs"]{Functions} @@ -27,20 +27,20 @@ string.} [newline-bstr bytes? #"\n"]) void?]{ -Reads bytes from @scheme[in] and writes the encoded result to -@scheme[out], breaking the output into 72-character lines separated by -@scheme[newline-bstr], and ending with @scheme[newline-bstr] unless -the input stream is empty. Note that the default @scheme[newline-bstr] -is just @scheme[#"\n"], not @scheme[#"\r\n"]. The procedure returns when -it encounters an end-of-file from @scheme[in].} +Reads bytes from @racket[in] and writes the encoded result to +@racket[out], breaking the output into 72-character lines separated by +@racket[newline-bstr], and ending with @racket[newline-bstr] unless +the input stream is empty. Note that the default @racket[newline-bstr] +is just @racket[#"\n"], not @racket[#"\r\n"]. The procedure returns when +it encounters an end-of-file from @racket[in].} @defproc[(base64-decode-stream [in input-port?] [out output-port?]) void?]{ -Reads a Base 64 encoding from @scheme[in] and writes the decoded -result to @scheme[out]. The procedure returns when it encounters an -end-of-file or Base 64 terminator @litchar{=} from @scheme[in].} +Reads a Base 64 encoding from @racket[in] and writes the decoded +result to @racket[out]. The procedure returns when it encounters an +end-of-file or Base 64 terminator @litchar{=} from @racket[in].} @; ---------------------------------------- @@ -50,7 +50,7 @@ end-of-file or Base 64 terminator @litchar{=} from @scheme[in].} @defthing[base64@ unit?]{ -Imports nothing, exports @scheme[base64^].} +Imports nothing, exports @racket[base64^].} @; ---------------------------------------- @@ -60,4 +60,4 @@ Imports nothing, exports @scheme[base64^].} @defsignature[base64^ ()]{} -Includes everything exported by the @schememodname[net/base64] module. +Includes everything exported by the @racketmodname[net/base64] module. diff --git a/collects/net/scribblings/cgi.scrbl b/collects/net/scribblings/cgi.scrbl index d31e543d92..562d659d92 100644 --- a/collects/net/scribblings/cgi.scrbl +++ b/collects/net/scribblings/cgi.scrbl @@ -4,10 +4,10 @@ @title[#:tag "cgi"]{CGI Scripts} -@defmodule[net/cgi]{The @schememodname[net/cgi] module provides tools +@defmodule[net/cgi]{The @racketmodname[net/cgi] module provides tools for scripts that follow the Common Gateway Interface @cite["CGI"].} -The @schememodname[net/cgi] library expects to be run in a certain +The @racketmodname[net/cgi] library expects to be run in a certain context as defined by the CGI standard. This means, for instance, that certain environment variables will be bound. @@ -18,7 +18,7 @@ bind @envvar{REQUEST_METHOD} and possibly also @envvar{QUERY_STRING} to successfully employ the CGI library. The FastCGI library ought to provide a way to extract the values bound to these variables; the user can then put these into the CGI program's environment using the -@scheme[putenv] function. +@racket[putenv] function. A CGI @deftech{binding} is an association of a form item with its value. Some form items, such as checkboxes, may correspond to @@ -36,12 +36,12 @@ symbol or a string. )]{ Returns the bindings that corresponding to the options specified by -the user. The @scheme[get-bindings/post] and -@scheme[get-bindings/get] variants work only when POST and GET forms -are used, respectively, while @scheme[get-bindings] determines the +the user. The @racket[get-bindings/post] and +@racket[get-bindings/get] variants work only when POST and GET forms +are used, respectively, while @racket[get-bindings] determines the kind of form that was used and invokes the appropriate function. -These functions respect @scheme[current-alist-separator-mode]. +These functions respect @racket[current-alist-separator-mode]. } @@ -58,15 +58,15 @@ key.} [bindings (listof (cons/c (or/c symbol? string?) string?))]) string?]{ -Like @scheme[extract-bindings], but for a key that has exactly one +Like @racket[extract-bindings], but for a key that has exactly one association.} @defproc[(output-http-headers) void?]{ Outputs all the HTTP headers needed for a normal response. Only -call this function if you are not using @scheme[generate-html-output] or -@scheme[generate-error-output].} +call this function if you are not using @racket[generate-html-output] or +@racket[generate-error-output].} @defproc[(generate-html-output [title string?] @@ -101,12 +101,12 @@ text, and generates HTML corresponding to an anchor.} The procedure takes a list of HTML strings representing the body, prints them with the subject line "Internal error", and exits via -@scheme[exit].} +@racket[exit].} @defproc[(get-cgi-method) (one-of/c "GET" "POST")]{ -Returns either @scheme["GET"] or @scheme["POST"] when invoked inside a +Returns either @racket["GET"] or @racket["POST"] when invoked inside a CGI script, unpredictable otherwise.} @@ -119,7 +119,7 @@ useful for debugging.} @defstruct[cgi-error ()]{ -A supertype for all exceptions thrown by the @schememodname[net/cgi] +A supertype for all exceptions thrown by the @racketmodname[net/cgi] library.} @@ -144,7 +144,7 @@ query is invalid.} @defthing[cgi@ unit?]{ -Imports nothing, exports @scheme[cgi^].} +Imports nothing, exports @racket[cgi^].} @; ---------------------------------------- @@ -154,4 +154,4 @@ Imports nothing, exports @scheme[cgi^].} @defsignature[cgi^ ()]{} -Includes everything exported by the @schememodname[net/cgi] module. +Includes everything exported by the @racketmodname[net/cgi] module. diff --git a/collects/net/scribblings/cookie.scrbl b/collects/net/scribblings/cookie.scrbl index 4dd2579c5d..9f30a58e21 100644 --- a/collects/net/scribblings/cookie.scrbl +++ b/collects/net/scribblings/cookie.scrbl @@ -8,27 +8,31 @@ @title[#:tag "cookie"]{Cookie: HTTP Client Storage} -@defmodule[net/cookie]{The @schememodname[net/cookie] library provides +@defmodule[net/cookie]{The @racketmodname[net/cookie] library provides utilities for using cookies as specified in RFC 2109 @cite["RFC2109"].} @section[#:tag "cookie-procs"]{Functions} @defproc[(cookie? [v any/c]) boolean?]{ -Returns @scheme[#t] if @scheme[v] represents a cookie, @scheme[#f] -otherwise.} +Returns @racket[#t] if @racket[v] represents a cookie, @racket[#f] + otherwise. +} @defproc[(valid-domain? [v any/c]) boolean?]{ - Returns @scheme[#t] if @scheme[v] represents a valid domain, @scheme[#f] otherwise. + Returns @racket[#t] if @racket[v] represents a valid domain, + @racket[#f] otherwise. } @defproc[(cookie-name? [v any/c]) boolean?]{ - Returns @scheme[#t] if @scheme[v] is a valid cookie name string, @scheme[#f] otherwise. -} - + Returns @racket[#t] if @racket[v] is a valid cookie name string, + @racket[#f] otherwise. +} + @defproc[(cookie-value? [v any/c]) boolean?]{ - Returns @scheme[#t] if @scheme[v] is a valid cookie value string, @scheme[#f] otherwise. -} + Returns @racket[#t] if @racket[v] is a valid cookie value string, + @racket[#f] otherwise. +} @defproc[(set-cookie [name cookie-name?] [value cookie-value?]) cookie?]{ @@ -37,64 +41,64 @@ Creates a new cookie, with default values for required fields.} @defproc[(cookie:add-comment [cookie cookie?] [comment string?]) cookie?]{ -Modifies @scheme[cookie] with a comment, and also returns -@scheme[cookie].} +Modifies @racket[cookie] with a comment, and also returns +@racket[cookie].} @defproc[(cookie:add-domain [cookie cookie?] [domain valid-domain?]) cookie?]{ -Modifies @scheme[cookie] with a domain, and also returns -@scheme[cookie]. The @scheme[domain] must match a prefix of the +Modifies @racket[cookie] with a domain, and also returns +@racket[cookie]. The @racket[domain] must match a prefix of the request URI.} @defproc[(cookie:add-max-age [cookie cookie?] [seconds exact-nonnegative-integer?]) cookie?]{ -Modifies @scheme[cookie] with a maximum age, and also returns -@scheme[cookie]. The @scheme[seconds] argument is number of seconds +Modifies @racket[cookie] with a maximum age, and also returns +@racket[cookie]. The @racket[seconds] argument is number of seconds that a client should retain the cookie.} @defproc[(cookie:add-path [cookie cookie?] [path valid-path?]) cookie?]{ -Modifies @scheme[cookie] with a path, and also returns -@scheme[cookie].} +Modifies @racket[cookie] with a path, and also returns +@racket[cookie].} @defproc[(cookie:secure [cookie cookie?] [secure boolean?]) cookie?]{ -Modifies @scheme[cookie] with a security flag, and also returns -@scheme[cookie].} +Modifies @racket[cookie] with a security flag, and also returns +@racket[cookie].} @defproc[(cookie:version [cookie cookie?] [version exact-nonnegative-integer?]) cookie?]{ -Modifies @scheme[cookie] with a version, and also returns -@scheme[cookie]. The default is the only known incarnation of HTTP -cookies: @scheme[1].} +Modifies @racket[cookie] with a version, and also returns +@racket[cookie]. The default is the only known incarnation of HTTP +cookies: @racket[1].} @defproc[(print-cookie [cookie cookie?]) string?]{ -Prints @scheme[cookie] to a string. Empty fields do not appear in the +Prints @racket[cookie] to a string. Empty fields do not appear in the output except when there is a required default.} @defproc[(get-cookie [name cookie-name?] [cookies string?]) (listof cookie-value?)]{ -Returns a list with all the values (strings) associated with @scheme[name]. +Returns a list with all the values (strings) associated with @racket[name]. -The method used to obtain the @scheme["Cookie"] header depends on the +The method used to obtain the @racket["Cookie"] header depends on the web server. It may be an environment variable (CGI), or you may have to read it from the input port (FastCGI), or maybe it comes in an -initial-request structure, etc. The @scheme[get-cookie] and -@scheme[get-cookie/single] procedure can be used to extract fields -from a @scheme["Cookie"] field value.} +initial-request structure, etc. The @racket[get-cookie] and +@racket[get-cookie/single] procedure can be used to extract fields +from a @racket["Cookie"] field value.} @defproc[(get-cookie/single [name cookie-name?] [cookies string?]) (or/c cookie-value? false/c)]{ -Like @scheme[get-cookie], but returns the just first value string -associated to @scheme[name], or #f if no association is found.} +Like @racket[get-cookie], but returns the just first value string +associated to @racket[name], or #f if no association is found.} @defstruct[(cookie-error exn:fail) ()]{ @@ -105,7 +109,7 @@ Raised for errors when handling cookies.} @subsection{Creating a cookie} -@schemeblock[ +@racketblock[ (let ((c (cookie:add-max-age (cookie:add-path (set-cookie "foo" "bar") @@ -116,19 +120,19 @@ Raised for errors when handling cookies.} Produces -@schemeblock[ -@#,schemeresultfont{"foo=bar; Max-Age=3600; Path=/servlets; Version=1"} +@racketblock[ +@#,racketresultfont{"foo=bar; Max-Age=3600; Path=/servlets; Version=1"} ] To use this output in a ``regular'' CGI, instead of the last line use: -@schemeblock[ +@racketblock[ (display (format "Set-Cookie: ~a" (print-cookie c))) ] and to use with the PLT Web Server, use: -@schemeblock[ +@racketblock[ (make-response/full code message (current-seconds) mime (list (make-header #"Set-Cookie" (string->bytes/utf-8 (print-cookie c)))) body) @@ -172,7 +176,7 @@ won't have a cookie set then first arrive at your site. @defthing[cookie@ unit?]{ -Imports nothing, exports @scheme[cookie^].} +Imports nothing, exports @racket[cookie^].} @; ---------------------------------------- @@ -182,4 +186,4 @@ Imports nothing, exports @scheme[cookie^].} @defsignature[cookie^ ()]{} -Includes everything exported by the @schememodname[net/cookie] module. +Includes everything exported by the @racketmodname[net/cookie] module. diff --git a/collects/net/scribblings/dns.scrbl b/collects/net/scribblings/dns.scrbl index 2df78ccdbb..016a237413 100644 --- a/collects/net/scribblings/dns.scrbl +++ b/collects/net/scribblings/dns.scrbl @@ -3,7 +3,7 @@ @title[#:tag "dns"]{DNS: Domain Name Service Queries} -@defmodule[net/dns]{The @schememodname[net/dns] library provides +@defmodule[net/dns]{The @racketmodname[net/dns] library provides utilities for looking up hostnames. Thanks to Eduardo Cavazos and Jason Crowe for repairs and @@ -18,11 +18,11 @@ improvements.} string?]{ Consults the specified nameserver (normally a numerical address like -@scheme["128.42.1.30"]) to obtain a numerical address for the given +@racket["128.42.1.30"]) to obtain a numerical address for the given Internet address. The query record sent to the DNS server includes the "recursive" bit, -but @scheme[dns-get-address] also implements a recursive search itself +but @racket[dns-get-address] also implements a recursive search itself in case the server does not provide this optional feature.} @@ -31,7 +31,7 @@ in case the server does not provide this optional feature.} string?]{ Consults the specified nameserver (normally a numerical address like -@scheme["128.42.1.30"]) to obtain a name for the given numerical +@racket["128.42.1.30"]) to obtain a name for the given numerical address.} @@ -41,7 +41,7 @@ address.} Consults the specified nameserver to obtain the address for a mail exchanger the given mail host address. For example, the mail exchanger -for @scheme["ollie.cs.rice.edu"] might be @scheme["cs.rice.edu"].} +for @racket["ollie.cs.rice.edu"] might be @racket["cs.rice.edu"].} @@ -60,7 +60,7 @@ extract the first nameserver address. On Windows, it runs @defthing[dns@ unit?]{ -Imports nothing, exports @scheme[dns^].} +Imports nothing, exports @racket[dns^].} @; ---------------------------------------- @@ -70,4 +70,4 @@ Imports nothing, exports @scheme[dns^].} @defsignature[dns^ ()]{} -Includes everything exported by the @schememodname[net/dns] module. +Includes everything exported by the @racketmodname[net/dns] module. diff --git a/collects/net/scribblings/ftp.scrbl b/collects/net/scribblings/ftp.scrbl index 1e0b269e6f..1e0113172b 100644 --- a/collects/net/scribblings/ftp.scrbl +++ b/collects/net/scribblings/ftp.scrbl @@ -3,7 +3,7 @@ @title[#:tag "ftp"]{FTP: Client Downloading} -@defmodule[net/ftp]{The @schememodname[net/ftp] library provides +@defmodule[net/ftp]{The @racketmodname[net/ftp] library provides utilities for FTP client operations. The library was written by Micah Flatt.} @@ -12,8 +12,8 @@ The library was written by Micah Flatt.} @defproc[(ftp-connection? [v any/c]) boolean?]{ -Returns @scheme[#t] if @scheme[v] represents an FTP connection as -returned by @scheme[ftp-establish-connection], @scheme[#f] otherwise.} +Returns @racket[#t] if @racket[v] represents an FTP connection as +returned by @racket[ftp-establish-connection], @racket[#f] otherwise.} @defproc[(ftp-establish-connection [server string?] @@ -36,8 +36,8 @@ Closes an FTP connection.} @defproc[(ftp-cd [ftp-conn ftp-connection?][new-dir string?]) void?]{ -Changes the current directory on the FTP server to @scheme[new-dir]. -The @scheme[new-dir] argument is not interpreted at all, but simply +Changes the current directory on the FTP server to @racket[new-dir]. +The @racket[new-dir] argument is not interpreted at all, but simply passed on to the server (encoded using the current locale's encoding); it must not contain a newline.} @@ -51,11 +51,11 @@ the server, assuming that the server provides directory information in the quasi-standard Unix format. Each file or directory is represented by a list of three strings. The -first string is either @scheme["-"], @scheme["d"], or @scheme["l"], +first string is either @racket["-"], @racket["d"], or @racket["l"], depending on whether the items is a file, directory, or link, respectively. The second item is the file's date; to convert this -value to seconds consistent with @scheme[file-seconds], pass the date -string to @scheme[ftp-make-file-seconds], below. The third string is +value to seconds consistent with @racket[file-seconds], pass the date +string to @racket[ftp-make-file-seconds], below. The third string is the name of the file or directory. All strings are decoded from bytes using the current locale's @@ -64,17 +64,17 @@ encoding.} @defproc[(ftp-make-file-seconds [ftp-date string?]) exact-integer?]{ -Takes a date string produced by @scheme[ftp-directory-list] and +Takes a date string produced by @racket[ftp-directory-list] and converts it to seconds (which can be used with -@scheme[seconds->date]).} +@racket[seconds->date]).} @defproc[(ftp-download-file [ftp-conn ftp-connection?] [local-dir path-string?] [file string?]) void?]{ -Downloads @scheme[file] from the server's current directory and puts -it in @scheme[local-dir] using the same name. If the file already +Downloads @racket[file] from the server's current directory and puts +it in @racket[local-dir] using the same name. If the file already exists in the local directory, it is replaced, but only after the transfer succeeds (i.e., the file is first downloaded to a temporary file, then moved into place on success).} @@ -87,7 +87,7 @@ file, then moved into place on success).} @defthing[ftp@ unit?]{ -Imports nothing, exports @scheme[ftp^].} +Imports nothing, exports @racket[ftp^].} @; ---------------------------------------- @@ -97,4 +97,4 @@ Imports nothing, exports @scheme[ftp^].} @defsignature[ftp^ ()]{} -Includes everything exported by the @schememodname[net/ftp] module. +Includes everything exported by the @racketmodname[net/ftp] module. diff --git a/collects/net/scribblings/head.scrbl b/collects/net/scribblings/head.scrbl index 7b3d0c41dd..d93cba84f0 100644 --- a/collects/net/scribblings/head.scrbl +++ b/collects/net/scribblings/head.scrbl @@ -7,7 +7,7 @@ @title[#:tag "head"]{Headers: Parsing and Constructing} -@defmodule[net/head]{The @schememodname[net/head] module provides +@defmodule[net/head]{The @racketmodname[net/head] module provides utilities for parsing and constructing RFC 822 headers @cite["RFC822"], which are used in protocols such as HTTP, SMTP, and NNTP.} @@ -24,29 +24,29 @@ terminates the header). @defthing[empty-header string?]{ -The string @scheme["\r\n\r\n"], which corresponds to the empty header. +The string @racket["\r\n\r\n"], which corresponds to the empty header. This value is useful for building up headers with -@scheme[insert-field] and @scheme[append-headers].} +@racket[insert-field] and @racket[append-headers].} @defproc[(validate-header [candidate (or string? bytes?)]) void?]{ -Checks that @scheme[candidate] matches RFC 822. If it does not, an +Checks that @racket[candidate] matches RFC 822. If it does not, an exception is raised.} @defproc[(extract-field [field (or/c string? bytes?)] [header (or/c string? bytes?)]) (or/c string? bytes? false/c)]{ -Returns the header content for the specified field, or @scheme[#f] if -the field is not in the header. The @scheme[field] string should not -end with @scheme[":"], and it is used case-insensitively. The returned +Returns the header content for the specified field, or @racket[#f] if +the field is not in the header. The @racket[field] string should not +end with @racket[":"], and it is used case-insensitively. The returned string will not contain the field name, color separator, or CRLF terminator for the field; however, if the field spans multiple lines, the CRLFs separating the lines will be intact. -The @scheme[field] and @scheme[header] arguments must be both strings -or both byte strings, and the result (if not @scheme[#f]) is of the +The @racket[field] and @racket[header] arguments must be both strings +or both byte strings, and the result (if not @racket[#f]) is of the same type. @examples[ @@ -63,8 +63,8 @@ Returns an association-list version of the header; the case of the field names is preserved, as well as the order and duplicate uses of a field name. -The result provides strings if @scheme[header] is a string, byte -strings if @scheme[header] is a byte string.} +The result provides strings if @racket[header] is a string, byte +strings if @racket[header] is a byte string.} @defproc[(remove-field [field (or/c string? bytes?)] @@ -72,11 +72,11 @@ strings if @scheme[header] is a byte string.} (or/c string? bytes?)]{ Creates a new header by removing the specified field from -@scheme[header] (or the first instance of the field, if it occurs -multiple times). If the field is not in @scheme[header], then the -return value is @scheme[header]. +@racket[header] (or the first instance of the field, if it occurs +multiple times). If the field is not in @racket[header], then the +return value is @racket[header]. -The @scheme[field] and @scheme[header] arguments must be both strings +The @racket[field] and @racket[header] arguments must be both strings or both byte strings, and the result is of the same type.} @@ -85,12 +85,12 @@ or both byte strings, and the result is of the same type.} [header (or/c string? bytes?)]) (or/c string? bytes?)]{ -Creates a new header by prefixing the given @scheme[header] with the -given @scheme[field]-@scheme[value] pair. The @scheme[value] string +Creates a new header by prefixing the given @racket[header] with the +given @racket[field]-@racket[value] pair. The @racket[value] string should not contain a terminating CRLF, but a multi-line value (perhaps -created with @scheme[data-lines->data]) may contain separator CRLFs. +created with @racket[data-lines->data]) may contain separator CRLFs. -The @scheme[field], @scheme[value], and @scheme[header] arguments must +The @racket[field], @racket[value], and @racket[header] arguments must be all strings or all byte strings, and the result is of the same type.} @@ -100,8 +100,8 @@ type.} [header (or/c string? bytes?)]) (or/c string? bytes?)]{ -Composes @scheme[remove-field] and (if @scheme[value] is not -@scheme[#f]) @scheme[insert-field].} +Composes @racket[remove-field] and (if @racket[value] is not +@racket[#f]) @racket[insert-field].} @defproc[(append-headers [header1 (or/c string? bytes?)] [header2 (or/c string? bytes?)]) @@ -109,7 +109,7 @@ Composes @scheme[remove-field] and (if @scheme[value] is not Appends two headers. -The @scheme[header1] and @scheme[header2] arguments must be both +The @racket[header1] and @racket[header2] arguments must be both strings or both byte strings, and the result is of the same type.} @@ -121,7 +121,7 @@ strings or both byte strings, and the result is of the same type.} string?]{ Creates a standard mail header given the sender, various lists of -recipients, a subject. A @scheme["Date"] field is added to the header +recipients, a subject. A @racket["Date"] field is added to the header automatically, using the current time. The BCC recipients do not actually appear in the header, but they're @@ -140,17 +140,17 @@ adding CRLF-TAB separators.} (or/c (listof string?) (listof (list/c string? string? string?)))]{ -Parses @scheme[string] as a list of comma-delimited mail addresses, +Parses @racket[string] as a list of comma-delimited mail addresses, raising an exception if the list is ill-formed. This procedure can be used for single-address strings, in which case the returned list contains only one address. -The @scheme[kind] argument specifies which portion of an address +The @racket[kind] argument specifies which portion of an address should be returned: @itemize[ - @item{@scheme['name] --- the free-form name in the address, or the + @item{@racket['name] --- the free-form name in the address, or the address itself if no name is available. @examples[ @@ -162,7 +162,7 @@ should be returned: 'name) ]} - @item{@scheme['address] --- just the mailing address, without any free-form + @item{@racket['address] --- just the mailing address, without any free-form names. @examples[ @@ -174,7 +174,7 @@ should be returned: 'address) ]} - @item{@scheme['full] --- the full address, essentially as it appears in the + @item{@racket['full] --- the full address, essentially as it appears in the input, but normalized. @examples[ @@ -186,7 +186,7 @@ should be returned: 'full) ]} - @item{@scheme['all] --- a list containing each of the three possibilities: + @item{@racket['all] --- a list containing each of the three possibilities: free-form name, address, and full address (in that order). @@ -226,7 +226,7 @@ are comma-separated, and possibly broken into multiple lines. @defthing[head@ unit?]{ -Imports nothing, exports @scheme[head^].} +Imports nothing, exports @racket[head^].} @; ---------------------------------------- @@ -236,4 +236,4 @@ Imports nothing, exports @scheme[head^].} @defsignature[head^ ()]{} -Includes everything exported by the @schememodname[net/head] module. +Includes everything exported by the @racketmodname[net/head] module. diff --git a/collects/net/scribblings/imap.scrbl b/collects/net/scribblings/imap.scrbl index 9809909cb1..8dde660064 100644 --- a/collects/net/scribblings/imap.scrbl +++ b/collects/net/scribblings/imap.scrbl @@ -39,7 +39,7 @@ @title[#:tag "imap"]{IMAP: Reading Mail} -@defmodule[net/imap]{The @schememodname[net/imap] module provides +@defmodule[net/imap]{The @racketmodname[net/imap] module provides utilities for the client side of Internet Message Access Protocol version 4rev1 @cite["RFC2060"].} @@ -49,8 +49,8 @@ version 4rev1 @cite["RFC2060"].} @defproc[(imap-connection? [v any/c]) boolean?]{ -Return @scheme[#t] if @scheme[v] is a IMAP-connection value (which is -opaque), @scheme[#f] otherwise.} +Return @racket[#t] if @racket[v] is a IMAP-connection value (which is +opaque), @racket[#f] otherwise.} @defproc[(imap-connect [server string?] [username (or/c string? bytes?)] @@ -66,21 +66,21 @@ The second and third return values indicate the total number of messages in the mailbox and the number of recent messages (i.e., messages received since the mailbox was last selected), respectively. -See also @scheme[imap-port-number]. +See also @racket[imap-port-number]. A user's primary mailbox is always called -@scheme["INBOX"]. (Capitalization doesn't matter for that mailbox +@racket["INBOX"]. (Capitalization doesn't matter for that mailbox name.) Updated message-count and recent-count values are available through -@scheme[imap-messages] and @scheme[imap-recent]. See also @scheme[imap-new?] and -@scheme[imap-reset-new!].} +@racket[imap-messages] and @racket[imap-recent]. See also @racket[imap-new?] and +@racket[imap-reset-new!].} @defparam[imap-port-number k (integer-in 0 65535)]{ A parameter that determines the server port number. The initial value -is @scheme[143].} +is @racket[143].} @defproc[(imap-connect* [in input-port?] @@ -90,7 +90,7 @@ is @scheme[143].} [mailbox (or/c string? bytes?)]) (values imap-connection? exact-nonnegative-integer? exact-nonnegative-integer?)]{ -Like @scheme[imap-connect], but given input and output ports (e.g., +Like @racket[imap-connect], but given input and output ports (e.g., ports for an SSL session) instead of a server address.} @@ -116,15 +116,15 @@ counts for the new mailbox. Expunge and message-state information is removed. Do not use this procedure to poll a mailbox to see whether there are -any new messages. Use @scheme[imap-noop], @scheme[imap-new?], and -@scheme[imap-reset-new!] instead.} +any new messages. Use @racket[imap-noop], @racket[imap-new?], and +@racket[imap-reset-new!] instead.} @defproc[(imap-examine [imap imap-connection?] [mailbox (or/c string? bytes?)]) (values exact-nonnegative-integer? exact-nonnegative-integer?)]{ -Like @scheme[imap-reselect], but the mailbox is selected as read-only.} +Like @racket[imap-reselect], but the mailbox is selected as read-only.} @; ---------------------------------------- @@ -135,9 +135,9 @@ Like @scheme[imap-reselect], but the mailbox is selected as read-only.} Sends a ``no-op'' message to the server, typically to keep the session alive. As for many commands, the server may report message-state -updates or expunges, which are recorded in @scheme[imap]. +updates or expunges, which are recorded in @racket[imap]. -The return information is the same as for @scheme[imap-reselect].} +The return information is the same as for @racket[imap-reselect].} @defproc[(imap-poll [imap imap-connection?]) void?]{ @@ -169,7 +169,7 @@ update this count during most any interaction. Returns the number of ``unseen'' messages in the currently selected mailbox, as most recently reported by the server. The server can update this count during most any interaction. Old IMAP servers might -not report this value, in which case the result is @scheme[#f]. +not report this value, in which case the result is @racket[#f]. @just-report[]} @@ -179,7 +179,7 @@ not report this value, in which case the result is @scheme[#f]. Returns the predicted next uid for a message in the currently selected mailbox, as most recently reported by the server. The server can update this count during most any interaction. Old IMAP servers might -not report this value, in which case the result is @scheme[#f]. +not report this value, in which case the result is @racket[#f]. @just-report[]} @@ -189,24 +189,24 @@ not report this value, in which case the result is @scheme[#f]. Returns an id number that changes when all uids become invalid. The server @emph{cannot} update this number during a session. Old IMAP servers might not report this value, in which case the result is -@scheme[#f]. +@racket[#f]. @just-report[]} @defproc[(imap-new? [imap imap-connection?]) boolean?]{ -Returns @scheme[#t] if the server has reported an increase in the +Returns @racket[#t] if the server has reported an increase in the message count for the currently mailbox since the last call to -@scheme[imap-reset-new!]. Selecting a mailbox implicitly calls -@scheme[imap-reset-new!]. +@racket[imap-reset-new!]. Selecting a mailbox implicitly calls +@racket[imap-reset-new!]. @just-report[]} @defproc[(imap-reset-new! [imap imap-connection?]) void?]{ -Resets the new flag for the session; see @scheme[imap-new?]. +Resets the new flag for the session; see @racket[imap-new?]. This operation does not communicate with the server.} @@ -220,25 +220,25 @@ pending notifications. The result list is sorted, ascending. The server can notify the client of newly deleted messages during most other commands, but not asynchronously between commands. Furthermore, -the server cannot report new deletions during @scheme[imap-get-messages] or -@scheme[imap-store] operations. +the server cannot report new deletions during @racket[imap-get-messages] or +@racket[imap-store] operations. Before calling any IMAP operation that works in terms of message numbers, pending expunge notifications must be handled by calling -@scheme[imap-get-expunges].} +@racket[imap-get-expunges].} @defproc[(imap-pending-expunges? [imap imap-connection?]) boolean?]{ -Returns @scheme[#f] if @scheme[imap-get-expunges] would return an -empty list, @scheme[#t] otherwise.} +Returns @racket[#f] if @racket[imap-get-expunges] would return an +empty list, @racket[#t] otherwise.} @defproc[(imap-get-updates [imap imap-connection?]) (listof (cons/c exact-nonnegative-integer? (listof pair?)))]{ -Returns information must like @scheme[imap-get-messages], but includes +Returns information must like @racket[imap-get-messages], but includes information reported asynchronously by the server (e.g., to notify a client with some other client changes a message attribute). Instead of reporting specific requested information for specific messages, the @@ -251,18 +251,18 @@ connection after reporting it. When a server reports information that supersedes old reported information for a message, or if the server reports that a message has been deleted, then old information for the message is -dropped. Similarly, if @scheme[imap-get-messages] is used to +dropped. Similarly, if @racket[imap-get-messages] is used to explicitly obtain information, any redundant (or out-of-date) information is dropped. -A client need not use @scheme[imap-get-updates] ever, but accumulated +A client need not use @racket[imap-get-updates] ever, but accumulated information for the connection consumes space.} @defproc[(imap-pending-updates? [imap imap-connection?]) boolean?]{ -Returns @scheme[#f] if @scheme[imap-get-updates] would return an -list, @scheme[#t] otherwise.} +Returns @racket[#f] if @racket[imap-get-updates] would return an +list, @racket[#t] otherwise.} @; ---------------------------------------- @@ -277,32 +277,32 @@ list, @scheme[#t] otherwise.} 'flags))]) (listof list?)]{ -Downloads information for a set of messages. The @scheme[msg-nums] +Downloads information for a set of messages. The @racket[msg-nums] argument specifies a set of messages by their message positions (not -their uids). The @scheme[fields] argument specifies the type of +their uids). The @racket[fields] argument specifies the type of information to download for each message. The available fields are: @itemize[ - @item{@scheme['uid] --- the value is an integer} + @item{@racket['uid] --- the value is an integer} - @item{@scheme['header] --- the value is a header (a string, but see - @schememodname[net/head])} + @item{@racket['header] --- the value is a header (a string, but see + @racketmodname[net/head])} - @item{@scheme['body] --- the value is a byte string, with + @item{@racket['body] --- the value is a byte string, with CRLF-separated lines} - @item{@scheme['flags] --- the value is a list of symbols that - correspond to IMAP flags; see @scheme[imap-flag->symbol]} + @item{@racket['flags] --- the value is a list of symbols that + correspond to IMAP flags; see @racket[imap-flag->symbol]} ] The return value is a list of entry items in parallel to -@scheme[msg-nums]. Each entry is itself a list containing value items -in parallel to @scheme[fields]. +@racket[msg-nums]. Each entry is itself a list containing value items +in parallel to @racket[fields]. Pending expunges must be handled before calling this function; see -@scheme[imap-get-expunges]. +@racket[imap-get-expunges]. @examples[ (eval:alts (imap-get-message imap '(1 3 5) '(uid header)) @@ -318,8 +318,8 @@ Pending expunges must be handled before calling this function; see An IMAP flag is a symbol, but it is generally not a convenient one to use within a Scheme program, because it usually starts with a -backslash. The @scheme[imap-flag->symbol] and -@scheme[symbol->imap-flag] procedures convert IMAP flags to convenient +backslash. The @racket[imap-flag->symbol] and +@racket[symbol->imap-flag] procedures convert IMAP flags to convenient symbols and vice-versa: @flag-table[ @@ -341,7 +341,7 @@ symbols and vice-versa: ) ] -The @scheme[imap-flag->symbol] and @scheme[symbol->imap-flag] +The @racket[imap-flag->symbol] and @racket[symbol->imap-flag] functions act like the identity function when any other symbol is provided.} @@ -357,22 +357,22 @@ flags are set: @itemize[ - @item{@scheme['+] --- add the given flags to each message} + @item{@racket['+] --- add the given flags to each message} - @item{@scheme['-] --- remove the given flags from each message} + @item{@racket['-] --- remove the given flags from each message} - @item{@scheme['!] --- set each message's flags to the given set} + @item{@racket['!] --- set each message's flags to the given set} ] -The @scheme[msg-nums] argument specifies a set of messages by their -message positions (not their uids). The @scheme[flags] argument +The @racket[msg-nums] argument specifies a set of messages by their +message positions (not their uids). The @racket[flags] argument specifies the imap flags to add/remove/install. Pending expunges must be handled before calling this function; see -@scheme[imap-get-expunges]. The server will not report back +@racket[imap-get-expunges]. The server will not report back message-state changes (so they will not show up through -@scheme[imap-get-updates]). +@racket[imap-get-updates]). @examples[ (eval:alts (imap-store imap '+ '(1 2 3) (list (symbol->imap-flag 'deleted))) @@ -386,7 +386,7 @@ message-state changes (so they will not show up through @defproc[(imap-expunge [imap imap-connection?]) void?]{ -Purges every message currently marked with the @scheme['|\Deleted|] +Purges every message currently marked with the @racket['|\Deleted|] flag from the mailbox.} @; ---------------------------------------- @@ -402,7 +402,7 @@ Copies the specified messages from the currently selected mailbox to the specified mailbox. Pending expunges must be handled before calling this function; see -@scheme[imap-get-expunges].} +@racket[imap-get-expunges].} @defproc[(imap-append [imap imap-connection?] @@ -410,7 +410,7 @@ Pending expunges must be handled before calling this function; see [message (or/c string? bytes?)]) void?]{ -Adds a new message (containing @scheme[message]) to the given +Adds a new message (containing @racket[message]) to the given mailbox.} @@ -418,27 +418,27 @@ mailbox.} [mailbox (or/c string? bytes?)] [statuses (listof symbol?)]) list?]{ - + Requests information about a mailbox from the server, typically @emph{not} the currently selected mailbox. -The @scheme[statuses] list specifies the request, and the return value -includes one value for each symbol in @scheme[statuses]. The allowed +The @racket[statuses] list specifies the request, and the return value +includes one value for each symbol in @racket[statuses]. The allowed status symbols are: @itemize[ - @item{@scheme['messages] --- number of messages} - @item{@scheme['recent] --- number of recent messages} - @item{@scheme['unseen] --- number of unseen messages} - @item{@scheme['uidnext] --- uid for next received message} - @item{@scheme['uidvalidity] --- id that changes when all uids are changed} + @item{@racket['messages] --- number of messages} + @item{@racket['recent] --- number of recent messages} + @item{@racket['unseen] --- number of unseen messages} + @item{@racket['uidnext] --- uid for next received message} + @item{@racket['uidvalidity] --- id that changes when all uids are changed} ] -Use @scheme[imap-messages] to get the message count for the currently -selected mailbox, etc. Use @scheme[imap-new?] and -@scheme[imap-reset-new!] to detect when new messages are available in +Use @racket[imap-messages] to get the message count for the currently +selected mailbox, etc. Use @racket[imap-new?] and +@racket[imap-reset-new!] to detect when new messages are available in the currently selected mailbox.} @@ -446,7 +446,7 @@ the currently selected mailbox.} [mailbox (or/c string? bytes?)]) boolean?]{ -Returns @scheme[#t] if @scheme[mailbox] exists, @scheme[#f] +Returns @racket[#t] if @racket[mailbox] exists, @racket[#f] otherwise.} @@ -454,7 +454,7 @@ otherwise.} [mailbox (or/c string? bytes?)]) void?]{ -Creates @scheme[mailbox]. (It must not exist already.)} +Creates @racket[mailbox]. (It must not exist already.)} @defproc[(imap-list-child-mailboxes [imap imap-connection?] @@ -463,9 +463,9 @@ Creates @scheme[mailbox]. (It must not exist already.)} (imap-get-hierarchy-delimiter)]) (listof (list/c (listof symbol?) bytes?))]{ -Returns information about sub-mailboxes of @scheme[mailbox]; if -@scheme[mailbox] is @scheme[#f], information about all top-level -mailboxes is returned. The @scheme[delimiter] is used to parse mailbox +Returns information about sub-mailboxes of @racket[mailbox]; if +@racket[mailbox] is @racket[#f], information about all top-level +mailboxes is returned. The @racket[delimiter] is used to parse mailbox names from the server to detect hierarchy. The return value is a list of mailbox-information lists. Each @@ -491,7 +491,7 @@ mailbox path names.} (listof symbol?)]{ Returns a list of IMAP flags for the given mailbox. See also -@scheme[imap-flag->symbol].} +@racket[imap-flag->symbol].} @; ---------------------------------------- @@ -501,7 +501,7 @@ Returns a list of IMAP flags for the given mailbox. See also @defthing[imap@ unit?]{ -Imports nothing, exports @scheme[imap^].} +Imports nothing, exports @racket[imap^].} @; ---------------------------------------- @@ -511,4 +511,4 @@ Imports nothing, exports @scheme[imap^].} @defsignature[imap^ ()]{} -Includes everything exported by the @schememodname[net/imap] module. +Includes everything exported by the @racketmodname[net/imap] module. diff --git a/collects/net/scribblings/mime.scrbl b/collects/net/scribblings/mime.scrbl index ec5d084f27..001c353ae2 100644 --- a/collects/net/scribblings/mime.scrbl +++ b/collects/net/scribblings/mime.scrbl @@ -25,7 +25,7 @@ @title[#:tag "mime"]{MIME: Decoding Internet Data} -@defmodule[net/mime]{The @schememodname[net/mime] library provides +@defmodule[net/mime]{The @racketmodname[net/mime] library provides utilities for parsing and creating MIME encodings as described in RFC 2045 through RFC 2049. @@ -39,15 +39,15 @@ The library was written by Francisco Solsona.} [part? any/c]) message?]{ -Parses @scheme[message-in] and returns the parsed result as a -@scheme[message] instance.} +Parses @racket[message-in] and returns the parsed result as a +@racket[message] instance.} @defstruct[message ([version real?] [entity entity] [fields (listof string?)])]{ -A decoded MIME message. The version is @scheme[1.0] by default. The -@scheme[entity] field represents the message data. The @scheme[fields] +A decoded MIME message. The version is @racket[1.0] by default. The +@racket[entity] field represents the message data. The @racket[fields] field contains one string for each field in the message header.} @defstruct[entity ([type symbol?] @@ -65,12 +65,12 @@ field contains one string for each field in the message header.} Represents the content of a message or a sub-part. -Standard values for the @scheme[type] field include @scheme['text], -@scheme['image], @scheme['audio], @scheme['video], -@scheme['application], @scheme['message], and @scheme['multipart]. +Standard values for the @racket[type] field include @racket['text], +@racket['image], @racket['audio], @racket['video], +@racket['application], @racket['message], and @racket['multipart]. -Standard values for the @scheme[subtype] field depend on the -@scheme[type] field, and include the following: +Standard values for the @racket[subtype] field depend on the +@racket[type] field, and include the following: @mime-table[ ( @@ -123,36 +123,36 @@ Standard values for the @scheme[subtype] field depend on the (quicktime "[Lindner]") )] -Standard values for the @scheme[charset] field include -@scheme['us-ascii], which is the default. +Standard values for the @racket[charset] field include +@racket['us-ascii], which is the default. -Standard values for the @scheme[encoding] field are @scheme['7bit], -@scheme['8bit], @scheme['binary], @scheme['quoted-printable], and -@scheme['base64]. The default is @scheme['7bit]. +Standard values for the @racket[encoding] field are @racket['7bit], +@racket['8bit], @racket['binary], @racket['quoted-printable], and +@racket['base64]. The default is @racket['7bit]. -The @scheme[params] field contains a list of parameters from other +The @racket[params] field contains a list of parameters from other MIME headers. -The @scheme[id] field is taken from the @scheme["Content-Id"] header +The @racket[id] field is taken from the @racket["Content-Id"] header field. -The @scheme[description] field is taken from the -@scheme["Content-description"] header field. +The @racket[description] field is taken from the +@racket["Content-description"] header field. -The @scheme[other] field contains additional (non-standard) field -headers whose field names start with @scheme["Content-"]. +The @racket[other] field contains additional (non-standard) field +headers whose field names start with @racket["Content-"]. -The @scheme[fields] field contains additional field headers whose -field names @emph{do not} start with @scheme["Content-"]. +The @racket[fields] field contains additional field headers whose +field names @emph{do not} start with @racket["Content-"]. -The @scheme[parts] contains sub-parts from multipart MIME -messages. This list is non-empty only when @scheme[type] is -@scheme['multipart] or @scheme['message]. +The @racket[parts] contains sub-parts from multipart MIME +messages. This list is non-empty only when @racket[type] is +@racket['multipart] or @racket['message]. -The @scheme[body] field represents the body as a function that +The @racket[body] field represents the body as a function that consumes an output out and writes the decoded message to the port. No -bytes are written if @scheme[type] is @scheme['multipart] or -@scheme['message]. All of the standard values of @scheme[encoding] +bytes are written if @racket[type] is @racket['multipart] or +@racket['message]. All of the standard values of @racket[encoding] are supported. The procedure only works once (since the encoded body is pulled from a stream).} @@ -164,26 +164,26 @@ is pulled from a stream).} [size (or/c exact-nonnegative-integer? false/c)] [params (listof (cons/c symbol? string?))])]{ -Represents a @scheme["Content-Disposition"] header as defined in RFC +Represents a @racket["Content-Disposition"] header as defined in RFC 2183. -Standard values for the @scheme[type] field include @scheme['inline] -and @scheme['attachment]. +Standard values for the @racket[type] field include @racket['inline] +and @racket['attachment]. -The @scheme[filename] field is drawn from the @scheme["filename"] -parameter of the @scheme["Content-Disposition"] header, if included in +The @racket[filename] field is drawn from the @racket["filename"] +parameter of the @racket["Content-Disposition"] header, if included in the message. -The @scheme[creation], @scheme[modification], and @scheme[read] fields -represent file timestamps as drawn from the @scheme["creation-date"], -@scheme["modification-date"], and @scheme["read-date"] attributes of -the @scheme["Content-Disposition"] header, if included in the message. +The @racket[creation], @racket[modification], and @racket[read] fields +represent file timestamps as drawn from the @racket["creation-date"], +@racket["modification-date"], and @racket["read-date"] attributes of +the @racket["Content-Disposition"] header, if included in the message. -The @scheme[size] field is drawn from the @scheme["size"] parameter of -the @scheme["Content-Disposition"] header, if included in the message. +The @racket[size] field is drawn from the @racket["size"] parameter of +the @racket["Content-Disposition"] header, if included in the message. -The @scheme[params] field stores any additional attribute bindings of -the @scheme["Content-Disposition"] header, if included in the message.} +The @racket[params] field stores any additional attribute bindings of +the @racket["Content-Disposition"] header, if included in the message.} @; ---------------------------------------- @@ -201,35 +201,35 @@ to RFC 2045 and friends.} @defstruct[(missing-multipart-boundary-parameter mime-error) ()]{ -Raised when a multipart type is specified, but no @scheme["Boundary"] +Raised when a multipart type is specified, but no @racket["Boundary"] parameter is given or an end-of-file is encountered before the boundary.} @defstruct[(malformed-multipart-entity mime-error) ([msg string?])]{ -Similar to @scheme[unexpected-termination], but used only while +Similar to @racket[unexpected-termination], but used only while scanning parts of a multipart message.} @defstruct[(empty-mechanism mime-error) ()]{ Raised when no transport encoding mechanism was provided with the -@scheme["Content-Transfer-Encoding"] field.} +@racket["Content-Transfer-Encoding"] field.} @defstruct[(empty-type mime-error) ()]{ -Raised when no type is specified for @scheme["Content-Type"], or when +Raised when no type is specified for @racket["Content-Type"], or when the specification is incorrectly formatted.} @defstruct[(empty-subtype mime-error) ()]{ -Raised when no sub-type is specified for @scheme["Content-Type"], or +Raised when no sub-type is specified for @racket["Content-Type"], or when the specification is incorrectly formatted.} @defstruct[(empty-disposition-type mime-error) ()]{ -Raised when type specified for the @scheme["Content-Disposition"] +Raised when type specified for the @racket["Content-Disposition"] field, or when the specification is incorrectly formatted.} @; ---------------------------------------- @@ -240,7 +240,7 @@ field, or when the specification is incorrectly formatted.} @defthing[mime@ unit?]{ -Imports nothing, exports @scheme[mime^].} +Imports nothing, exports @racket[mime^].} @; ---------------------------------------- @@ -250,4 +250,4 @@ Imports nothing, exports @scheme[mime^].} @defsignature[mime^ ()]{} -Includes everything exported by the @schememodname[net/mime] module. +Includes everything exported by the @racketmodname[net/mime] module. diff --git a/collects/net/scribblings/net.scrbl b/collects/net/scribblings/net.scrbl index 2d3fd8b826..a169d17dfc 100644 --- a/collects/net/scribblings/net.scrbl +++ b/collects/net/scribblings/net.scrbl @@ -38,14 +38,14 @@ #:location "RFC" #:url "http://www.ietf.org/rfc/rfc0822.txt" #:date "1982") - + (bib-entry #:key "RFC977" #:title "Network News Transfer Protocol" #:author "Brian Kantor and Phil Lapsley" #:location "RFC" #:url "http://www.ietf.org/rfc/rfc0977.txt" #:date "1986") - + (bib-entry #:key "RFC1738" #:title "Uniform Resource Locators (URL)" #:author "T. Berners-Lee, L. Masinter, and M. McCahill" diff --git a/collects/net/scribblings/nntp.scrbl b/collects/net/scribblings/nntp.scrbl index 27c2a5c1ef..d63ceca3c2 100644 --- a/collects/net/scribblings/nntp.scrbl +++ b/collects/net/scribblings/nntp.scrbl @@ -3,7 +3,7 @@ @title[#:tag "nntp"]{NNTP: Newsgroup Protocol} -@defmodule[net/nntp]{The @schememodname[net/nntp] module provides +@defmodule[net/nntp]{The @racketmodname[net/nntp] module provides tools to access Usenet group via NNTP @cite["RFC977"].} @section{Connection and Operations} @@ -14,13 +14,13 @@ tools to access Usenet group via NNTP @cite["RFC977"].} [port (integer-in 0 65535)])]{ Once a connection to a Usenet server has been established, its state -is stored in a @scheme[communicator], and other procedures take +is stored in a @racket[communicator], and other procedures take communicators as an argument.} @defproc[(connect-to-server [server string?] [port-number (integer-in 0 65535) 119]) communicator?]{ -Connects to @scheme[server] at @scheme[port-number].} +Connects to @racket[server] at @racket[port-number].} @defproc[(disconnect-from-server [communicator communicator?]) void?]{ @@ -42,7 +42,7 @@ article, and the last available article.} void?]{ Tries to authenticate a user with the original authinfo command (uses -cleartext). The @scheme[password] argument is ignored if the server +cleartext). The @racket[password] argument is ignored if the server does not ask for it.} @defproc[(head-of-message [communicator communicator?] @@ -69,8 +69,8 @@ Implements the @tt{NEWNEWS} command (often disabled on servers).} [message-index exact-nonnegative-integer?]) (listof string?)]{ -Useful primitive for implementing @scheme[head-of-message], -@scheme[body-of-message] and other similar commands.} +Useful primitive for implementing @racket[head-of-message], +@racket[body-of-message] and other similar commands.} @defproc[(make-desired-header [tag-string string?]) regexp?]{ @@ -82,7 +82,7 @@ Takes a header field's tag and returns a regexp to match the field} (listof string?)]{ Given a list of header lines and of desired regexps, returns the -header lines that match any of the @scheme[desireds].} +header lines that match any of the @racket[desireds].} @section{Exceptions} @@ -95,7 +95,7 @@ The supertype of all NNTP exceptions.} [text string?])]{ Raised whenever an unexpected response code is received. The -@scheme[text] field holds the response text sent by the server.} +@racket[text] field holds the response text sent by the server.} @defstruct[(bad-status-line nntp) ([line string?])]{ @@ -139,7 +139,7 @@ Raised when the server reject an authentication attempt.} @defthing[nntp@ unit?]{ -Imports nothing, exports @scheme[nntp^].} +Imports nothing, exports @racket[nntp^].} @; ---------------------------------------- @@ -149,4 +149,4 @@ Imports nothing, exports @scheme[nntp^].} @defsignature[nntp^ ()]{} -Includes everything exported by the @schememodname[net/nntp] module. +Includes everything exported by the @racketmodname[net/nntp] module. diff --git a/collects/net/scribblings/pop3.scrbl b/collects/net/scribblings/pop3.scrbl index c6474803f5..c2d59dc0ee 100644 --- a/collects/net/scribblings/pop3.scrbl +++ b/collects/net/scribblings/pop3.scrbl @@ -5,7 +5,7 @@ @title[#:tag "pop3"]{POP3: Reading Mail} -@defmodule[net/pop3]{The @schememodname[net/pop3] module provides +@defmodule[net/pop3]{The @racketmodname[net/pop3] module provides tools for the Post Office Protocol version 3 @cite["RFC977"].} @defstruct[communicator ([sender output-port?] @@ -15,31 +15,31 @@ tools for the Post Office Protocol version 3 @cite["RFC977"].} [state (one-of/c 'disconnected 'authorization 'transaction)])]{ Once a connection to a POP-3 server has been established, its state is -stored in a @scheme[communicator] instance, and other procedures take -@scheme[communicator] instances as an argument.} +stored in a @racket[communicator] instance, and other procedures take +@racket[communicator] instances as an argument.} @defproc[(connect-to-server [server string?] [port-number (integer-in 0 65535) 110]) communicator?]{ -Connects to @scheme[server] at @scheme[port-number].} +Connects to @racket[server] at @racket[port-number].} @defproc[(disconnect-from-server [communicator communicator?]) void?]{ -Disconnects @scheme[communicator] from the server, and sets -@scheme[communicator]'s state to @scheme['disconnected].} +Disconnects @racket[communicator] from the server, and sets +@racket[communicator]'s state to @racket['disconnected].} @defproc[(authenticate/plain-text [user string?] [passwd string?] [communicator communicator?]) void?]{ -Authenticates using @scheme[user] and @scheme[passwd]. If -authentication is successful, @scheme[communicator]'s state is set to -@scheme['transaction].} +Authenticates using @racket[user] and @racket[passwd]. If +authentication is successful, @racket[communicator]'s state is set to +@racket['transaction].} @defproc[(get-mailbox-status [communicator communicator?]) (values exact-nonnegative-integer? exact-nonnegative-integer?)]{ @@ -83,8 +83,8 @@ Gets the server's unique id for a particular message.} (listof (cons/c exact-integer? string?))]{ Gets a list of unique id's from the server for all the messages in the -mailbox. The @scheme[car] of each item in the result list is the -message number, and the @scheme[cdr] of each item is the message's +mailbox. The @racket[car] of each item in the result list is the +message number, and the @racket[cdr] of each item is the message's id.} @defproc[(make-desired-header [tag-string string?]) @@ -97,7 +97,7 @@ Takes a header field's tag and returns a regexp to match the field} (listof string?)]{ Given a list of header lines and of desired regexps, returns the -header lines that match any of the @scheme[desireds].} +header lines that match any of the @racket[desireds].} @; ---------------------------------------- @@ -151,7 +151,7 @@ Raised when the server produces a malformed response.} @section{Example Session} -@schemeblock[ +@racketblock[ #,pt (require net/pop3) #,pt (define c (connect-to-server "cs.rice.edu")) #,pt (authenticate/plain-text "scheme" "********" c) @@ -172,7 +172,7 @@ Raised when the server produces a malformed response.} "Status: RO") ("some body" "text" "goes" "." "here" "." "") #,pt (get-unique-id/single c 205) - @#,schemeerror{no message numbered 205 available for unique id} + @#,racketerror{no message numbered 205 available for unique id} #,pt (list-tail (get-unique-id/all c) 194) ((195 . "e24d13c7ef050000") (196 . "3ad2767070050000")) #,pt (get-unique-id/single c 196) @@ -188,7 +188,7 @@ Raised when the server produces a malformed response.} @defthing[pop3@ unit?]{ -Imports nothing, exports @scheme[pop3^].} +Imports nothing, exports @racket[pop3^].} @; ---------------------------------------- @@ -198,4 +198,4 @@ Imports nothing, exports @scheme[pop3^].} @defsignature[pop3^ ()]{} -Includes everything exported by the @schememodname[net/pop3] module. +Includes everything exported by the @racketmodname[net/pop3] module. diff --git a/collects/net/scribblings/qp.scrbl b/collects/net/scribblings/qp.scrbl index 1b83cbe4dd..c5f0a6d608 100644 --- a/collects/net/scribblings/qp.scrbl +++ b/collects/net/scribblings/qp.scrbl @@ -3,7 +3,7 @@ @title[#:tag "qp"]{Quoted-Printable: Encoding and Decoding} -@defmodule[net/qp]{The @schememodname[net/qp] library provides +@defmodule[net/qp]{The @racketmodname[net/qp] library provides utilities for quoted-printable (mime-standard) encoding and decoding from RFC 2045 section 6.7. @@ -14,7 +14,7 @@ The library was written by Francisco Solsona.} @defproc[(qp-encode [bstr bytes?]) bytes?]{ Consumes a byte string and returns its quoted printable representation -as a new string. The encoded string uses @scheme[#"\r\n"] where +as a new string. The encoded string uses @racket[#"\r\n"] where necessary to create shorter lines.} @@ -30,12 +30,12 @@ whatever form they exist (CR, LR, or CRLF) in the input string.} [newline-bstr bytes? #"\n"]) void?]{ -Reads characters from @scheme[in] and writes the quoted printable -encoded result to @scheme[out]. +Reads characters from @racket[in] and writes the quoted printable +encoded result to @racket[out]. -The @scheme[newline-bstr] argument is used for soft line-breaks (after -@litchar{=}). Note that the default @scheme[newline-bstr] is just -@scheme[#"\n"], not @scheme[#"\r\n"]. +The @racket[newline-bstr] argument is used for soft line-breaks (after +@litchar{=}). Note that the default @racket[newline-bstr] is just +@racket[#"\n"], not @racket[#"\r\n"]. Other line breaks are preserved in whatever form they exist (CR, LR, or CRLF) in the input stream.} @@ -45,8 +45,8 @@ or CRLF) in the input stream.} [out output-port?]) void?]{ -Reads characters from @scheme[in] and writes de-quoted-printable -result to @scheme[out]. Non-soft line breaks are preserved in +Reads characters from @racket[in] and writes de-quoted-printable +result to @racket[out]. Non-soft line breaks are preserved in whatever form they exist (CR, LR, or CRLF) in the input stream.} @; ---------------------------------------- @@ -70,7 +70,7 @@ backward compatibility.} @defthing[qp@ unit?]{ -Imports nothing, exports @scheme[qp^].} +Imports nothing, exports @racket[qp^].} @; ---------------------------------------- @@ -80,4 +80,4 @@ Imports nothing, exports @scheme[qp^].} @defsignature[qp^ ()]{} -Includes everything exported by the @schememodname[net/qp] module. +Includes everything exported by the @racketmodname[net/qp] module. diff --git a/collects/net/scribblings/sendmail.scrbl b/collects/net/scribblings/sendmail.scrbl index eaef6a766c..cef43caa42 100644 --- a/collects/net/scribblings/sendmail.scrbl +++ b/collects/net/scribblings/sendmail.scrbl @@ -4,10 +4,10 @@ @title[#:tag "sendmail"]{@exec{sendmail}: Sending E-Mail} -@defmodule[net/sendmail]{The @schememodname[net/sendmail] module +@defmodule[net/sendmail]{The @racketmodname[net/sendmail] module provides tools for sending electronic mail messages using a @exec{sendmail} program on the local system. See also the -@schememodname[net/smtp] package, which sends mail via SMTP.} +@racketmodname[net/smtp] package, which sends mail via SMTP.} All strings used in mail messages are assumed to conform to their corresponding SMTP specifications, except as noted otherwise. @@ -30,11 +30,11 @@ which must be provided as lines (not terminated by a linefeed or carriage return) to include verbatim in the header. The return value is an output port into which the client must write -the message. Clients are urged to use @scheme[close-output-port] on +the message. Clients are urged to use @racket[close-output-port] on the return value as soon as the necessary text has been written, so that the sendmail process can complete. -The @scheme[from] argument can be any value; of course, spoofing +The @racket[from] argument can be any value; of course, spoofing should be used with care.} @defproc[(send-mail-message [from string?] @@ -46,7 +46,7 @@ should be used with care.} [extra-header string?] ...) void?]{ -Like @scheme[send-mail-message/port], but with @scheme[body] as a list +Like @racket[send-mail-message/port], but with @racket[body] as a list of strings, each providing a line of the message body. Lines that contain a single period do not need to be quoted.} @@ -55,7 +55,7 @@ Lines that contain a single period do not need to be quoted.} @defstruct[(no-mail-recipients exn) ()]{ Raised when no mail recipients were specified for -@scheme[send-mail-message/port].} +@racket[send-mail-message/port].} @@ -67,7 +67,7 @@ Raised when no mail recipients were specified for @defthing[sendmail@ unit?]{ -Imports nothing, exports @scheme[sendmail^].} +Imports nothing, exports @racket[sendmail^].} @; ---------------------------------------- @@ -77,4 +77,4 @@ Imports nothing, exports @scheme[sendmail^].} @defsignature[sendmail^ ()]{} -Includes everything exported by the @schememodname[net/sendmail] module. +Includes everything exported by the @racketmodname[net/sendmail] module. diff --git a/collects/net/scribblings/sendurl.scrbl b/collects/net/scribblings/sendurl.scrbl index 408b8c8164..c297b08a1f 100644 --- a/collects/net/scribblings/sendurl.scrbl +++ b/collects/net/scribblings/sendurl.scrbl @@ -3,11 +3,11 @@ @title[#:tag "sendurl"]{Send URL: Opening a Web Browser} -@defmodule[net/sendurl]{Provides @scheme[send-url] for opening a URL +@defmodule[net/sendurl]{Provides @racket[send-url] for opening a URL in the user's chosen web browser.} -See also @schememodname[browser/external], which requires -@scheme[racket/gui], but can prompt the user for a browser if no +See also @racketmodname[browser/external], which requires +@racket[racket/gui], but can prompt the user for a browser if no browser preference is set. @@ -15,40 +15,40 @@ browser preference is set. [#:escape escape? any/c #t]) void?]{ -Opens @scheme[str], which represents a URL, in a platform-specific +Opens @racket[str], which represents a URL, in a platform-specific manner. For some platforms and configurations, the -@scheme[separate-window?] parameter determines if the browser creates +@racket[separate-window?] parameter determines if the browser creates a new window to display the URL or not. -On Windows, @scheme[send-url] normally uses @scheme[shell-execute] +On Windows, @racket[send-url] normally uses @racket[shell-execute] to launch a browser. (If the URL appears to contain a fragment, it may use an intermediate redirecting file due to a bug in IE7.) -On Mac OS X, @scheme[send-url] runs @exec{osascript} to start the +On Mac OS X, @racket[send-url] runs @exec{osascript} to start the user's chosen browser. -On Unix, @scheme[send-url] uses a user-preference, or when none is +On Unix, @racket[send-url] uses a user-preference, or when none is set, it will look for a known browser. See the description of -@scheme[external-browser] for details. +@racket[external-browser] for details. -The @scheme[url] string is usually escaped to avoid dangerous shell +The @racket[url] string is usually escaped to avoid dangerous shell characters (quotations, dollar signs, backslashes, and non-ASCII). Note that it is a good idea to encode URLs before passing them to this function. -On all platforms, @scheme[external-browser] parameter can be set to a +On all platforms, @racket[external-browser] parameter can be set to a procedure to override the above behavior --- the procedure will be -called with the @scheme[url] string.} +called with the @racket[url] string.} @defproc[(send-url/file [path path-string?] [separate-window? any/c #t] [#:fragment fragment (or/c string? false/c) #f] [#:query query (or/c string? false/c) #f]) void?]{ -Similar to @scheme[send-url], but accepts a path to a file to be +Similar to @racket[send-url], but accepts a path to a file to be displayed by the browser. Use this function when you want to display a local file: it takes care of the peculiarities of constructing the -correct @litchar{file://} URL, and uses @scheme[send-url] to display +correct @litchar{file://} URL, and uses @racket[send-url] to display the file. If you need to use an anchor fragment or a query string, use the corresponding keyword arguments.} @@ -58,52 +58,52 @@ use the corresponding keyword arguments.} [#:delete-at seconds (or/c number? false/c) #f]) void?]{ -Similar to @scheme[send-url/file], but it consumes the contents of a +Similar to @racket[send-url/file], but it consumes the contents of a page to show, and displayes it from a temporary file. -If @scheme[delete-at] is a number, the temporary file is removed after +If @racket[delete-at] is a number, the temporary file is removed after this many seconds. The deletion happens in a thread, so if racket exits before that it will not happen --- when this function is called it scans old generated files (this happens randomly, not on every call) and removes them to avoid cluttering the temporary directory. -If @scheme[delete-at] is @scheme[#f], no delayed deletion happens, but +If @racket[delete-at] is @racket[#f], no delayed deletion happens, but old temporary files are still deleted as described above.} @defparam[external-browser cmd browser-preference?]{ A parameter that can hold a procedure to override how a browser is -started, or @scheme[#f] to use the default platform-dependent command. +started, or @racket[#f] to use the default platform-dependent command. On Unix, the command that is used depends on the -@scheme['external-browser] preference. If the preference is unset, -@scheme[send-url] uses the first of the browsers from -@scheme[unix-browser-list] for which the executable is found. +@racket['external-browser] preference. If the preference is unset, +@racket[send-url] uses the first of the browsers from +@racket[unix-browser-list] for which the executable is found. Otherwise, the preference should hold a symbol indicating a known -browser (from the @scheme[unix-browser-list]), or it a pair of a prefix -and a suffix string that are concatenated around the @scheme[url] string +browser (from the @racket[unix-browser-list]), or it a pair of a prefix +and a suffix string that are concatenated around the @racket[url] string to make up a shell command to run. In addition, the -@scheme[external-browser] paremeter can be set to one of these values, -and @scheme[send-url] will use it instead of the preference value. +@racket[external-browser] paremeter can be set to one of these values, +and @racket[send-url] will use it instead of the preference value. Note that the URL is encoded to make it work inside shell double-quotes: URLs can still hold characters like @litchar{#}, @litchar{?}, and -@litchar{&}, so if the @scheme[external-browser] is set to a pair of +@litchar{&}, so if the @racket[external-browser] is set to a pair of prefix/suffix strings, they should use double quotes around the url. If the preferred or default browser can't be launched, -@scheme[send-url] fails. See @scheme[get-preference] and -@scheme[put-preferences] for details on setting preferences.} +@racket[send-url] fails. See @racket[get-preference] and +@racket[put-preferences] for details on setting preferences.} @defproc[(browser-preference? [a any/c]) boolean?]{ -Returns @scheme[#t] if @scheme[v] is a valid browser preference, -@scheme[#f] otherwise. See @scheme[external-browser] for more +Returns @racket[#t] if @racket[v] is a valid browser preference, +@racket[#f] otherwise. See @racket[external-browser] for more information.} @defthing[unix-browser-list (listof symbol?)]{ A list of symbols representing Unix executable names that may be tried -in order by @scheme[send-url]. The @scheme[send-url] function +in order by @racket[send-url]. The @racket[send-url] function internally includes information on how to launch each executable with a URL.} diff --git a/collects/net/scribblings/smtp.scrbl b/collects/net/scribblings/smtp.scrbl index b00e4ba1c4..46cc382838 100644 --- a/collects/net/scribblings/smtp.scrbl +++ b/collects/net/scribblings/smtp.scrbl @@ -4,16 +4,16 @@ @title[#:tag "smtp"]{SMTP: Sending E-Mail} -@defmodule[net/smtp]{The @schememodname[net/smtp] module provides +@defmodule[net/smtp]{The @racketmodname[net/smtp] module provides tools for sending electronic mail messages using SMTP. The client must provide the address of an SMTP server; in contrast, the -@schememodname[net/sendmail] module uses a pre-configured +@racketmodname[net/sendmail] module uses a pre-configured @exec{sendmail} on the local system.} -The @schememodname[net/head] library defines the format of a -@tech{header} string, which is used by @scheme[send-smtp-message]. The -@schememodname[net/head] module also provides utilities to verify the -formatting of a mail address. The procedures of the @scheme[net/smtp] +The @racketmodname[net/head] library defines the format of a +@tech{header} string, which is used by @racket[send-smtp-message]. The +@racketmodname[net/head] module also provides utilities to verify the +formatting of a mail address. The procedures of the @racket[net/smtp] module assume that the given string arguments are well-formed. @@ -42,59 +42,59 @@ module assume that the given string arguments are well-formed. [port-no (integer-in 0 65535) port-no/k]) void?]{ -Connects to the server at @scheme[server-address] and @scheme[port-no] -to send a message. The @scheme[from] argument specifies the mail -address of the sender, and @scheme[to] is a list of recipient +Connects to the server at @racket[server-address] and @racket[port-no] +to send a message. The @racket[from] argument specifies the mail +address of the sender, and @racket[to] is a list of recipient addresses (including ``To:'', ``CC'', and ``BCC'' recipients). -The @scheme[header] argument is the complete message header, which +The @racket[header] argument is the complete message header, which should already include ``From:'', ``To:'', and ``CC:'' fields consistent with the given sender and recipients. See also the -@schememodname[net/head] library for header-creating utilities. +@racketmodname[net/head] library for header-creating utilities. -The @scheme[message] argument is the body of the message, where each +The @racket[message] argument is the body of the message, where each string or byte string in the list corresponds to a single line of -message text. No string in @scheme[message] should contain a carriage +message text. No string in @racket[message] should contain a carriage return or linefeed character. -The optional @scheme[port-no] argument---which can be specified either -with the @scheme[#:port-no] keyword or, for backward compatibility, as +The optional @racket[port-no] argument---which can be specified either +with the @racket[#:port-no] keyword or, for backward compatibility, as an extra argument after keywords---specifies the IP port to use in contacting the SMTP server. -The optional @scheme[#:auth-user] and @scheme[#:auth-passwd] keyword +The optional @racket[#:auth-user] and @racket[#:auth-passwd] keyword argument supply a username and password for authenticated SMTP (using the AUTH PLAIN protocol). -The optional @scheme[#:tcp-connect] keyword argument supplies a -connection procedure to be used in place of @scheme[tcp-connect]. For -example, use @scheme[ssl-connect] to connect to the server via SSL. +The optional @racket[#:tcp-connect] keyword argument supplies a +connection procedure to be used in place of @racket[tcp-connect]. For +example, use @racket[ssl-connect] to connect to the server via SSL. -If the optional @scheme[#:tls-encode] keyword argument supplies a +If the optional @racket[#:tls-encode] keyword argument supplies a procedure instead of #f, then the ESMTP STARTTLS protocol is used to initiate SSL communication with the server. The procedure given as the -#:tls-encode argument should be like @scheme[ports->ssl-ports]; it +#:tls-encode argument should be like @racket[ports->ssl-ports]; it will be called as -@schemeblock[ +@racketblock[ (encode r w #:mode 'connect #:encrypt 'tls #:close-original? #t) ] and it should return two values: an input port and an export port. All further SMTP communication uses the returned ports. -For encrypted communication, normally either @scheme[ssl-connect] -should be supplied for @scheme[#:tcp-connect], or -@scheme[ports->ssl-ports] should be supplied for -@scheme[#:tls-encode]---one or the other (depending on what the server +For encrypted communication, normally either @racket[ssl-connect] +should be supplied for @racket[#:tcp-connect], or +@racket[ports->ssl-ports] should be supplied for +@racket[#:tls-encode]---one or the other (depending on what the server expects), rather than both.} @defparam[smtp-sending-end-of-message proc (-> any)]{ A parameter that determines a send-done procedure to be called after -@scheme[smtp-send-message] has completely sent the message. Before the +@racket[smtp-send-message] has completely sent the message. Before the send-done procedure is called, breaking the thread that is executing -@scheme[smtp-send-message] cancels the send. After the send-done +@racket[smtp-send-message] cancels the send. After the send-done procedure is called, breaking may or may not cancel the send (and probably will not).} @@ -106,7 +106,7 @@ probably will not).} @defthing[smtp@ unit?]{ -Imports nothing, exports @scheme[smtp^].} +Imports nothing, exports @racket[smtp^].} @; ---------------------------------------- @@ -116,4 +116,4 @@ Imports nothing, exports @scheme[smtp^].} @defsignature[smtp^ ()]{} -Includes everything exported by the @schememodname[net/smtp] module. +Includes everything exported by the @racketmodname[net/smtp] module. diff --git a/collects/net/scribblings/ssl-tcp-unit.scrbl b/collects/net/scribblings/ssl-tcp-unit.scrbl index 198e8a985c..f1cef7febc 100644 --- a/collects/net/scribblings/ssl-tcp-unit.scrbl +++ b/collects/net/scribblings/ssl-tcp-unit.scrbl @@ -1,11 +1,11 @@ #lang scribble/doc @(require "common.rkt" (for-label net/ssl-tcp-unit net/tcp-sig)) -@title[#:tag "ssl-tcp-unit"]{SSL Unit: @scheme[tcp^] via SSL} +@title[#:tag "ssl-tcp-unit"]{SSL Unit: @racket[tcp^] via SSL} -@defmodule[net/ssl-tcp-unit]{The @schememodname[net/ssl-tcp-unit] -library provides a function for creating a @scheme[tcp^] -implementation with @schememodname[openssl] functionality.} +@defmodule[net/ssl-tcp-unit]{The @racketmodname[net/ssl-tcp-unit] +library provides a function for creating a @racket[tcp^] +implementation with @racketmodname[openssl] functionality.} @defproc[(make-ssl-tcp@ [server-cert-file (or/c path-string? false/c)] [server-key-file (or/c path-string? false/c)] @@ -16,39 +16,39 @@ implementation with @schememodname[openssl] functionality.} [client-root-cert-files (listof path-string?)]) unit?]{ -Returns a unit that implements @scheme[tcp^] using the SSL functions -from @schememodname[openssl]. The arguments to @scheme[make-ssl-tcp@] +Returns a unit that implements @racket[tcp^] using the SSL functions +from @racketmodname[openssl]. The arguments to @racket[make-ssl-tcp@] control the certificates and keys uses by server and client connections: @itemize[ - @item{@scheme[server-cert-file] --- a PEM file for a server's - certificate; @scheme[#f] means no certificate (which is unlikely + @item{@racket[server-cert-file] --- a PEM file for a server's + certificate; @racket[#f] means no certificate (which is unlikely to work with any SSL client)} - @item{@scheme[server-key-file] --- a private key PEM to go with - @scheme[server-cert-file]; @scheme[#f] means no key (which is likely + @item{@racket[server-key-file] --- a private key PEM to go with + @racket[server-cert-file]; @racket[#f] means no key (which is likely renders a certificate useless)} - @item{@scheme[server-root-cert-files] --- a list of PEM files for - trusted root certificates; @scheme[#f] disables verification of + @item{@racket[server-root-cert-files] --- a list of PEM files for + trusted root certificates; @racket[#f] disables verification of peer client certificates} - @item{@scheme[server-suggest-auth-file] --- PEM file for root + @item{@racket[server-suggest-auth-file] --- PEM file for root certificates to be suggested to peer clients that must supply certificates} - @item{@scheme[client-cert-file] --- a PEM file for a client's - certificate; @scheme[#f] means no certificate (which is usually + @item{@racket[client-cert-file] --- a PEM file for a client's + certificate; @racket[#f] means no certificate (which is usually fine)} - @item{@scheme[client-key-file] --- a private key PEM to go with - @scheme[client-cert-file]; @scheme[#f] means no key (which is likely + @item{@racket[client-key-file] --- a private key PEM to go with + @racket[client-cert-file]; @racket[#f] means no key (which is likely renders a certificate useless)} - @item{@scheme[client-root-cert-files] --- a list of PEM files for - trusted root certificates; @scheme[#f] disables verification of + @item{@racket[client-root-cert-files] --- a list of PEM files for + trusted root certificates; @racket[#f] disables verification of peer server certificates} ]} diff --git a/collects/net/scribblings/tcp-redirect.scrbl b/collects/net/scribblings/tcp-redirect.scrbl index 34224f39ec..5595b02c14 100644 --- a/collects/net/scribblings/tcp-redirect.scrbl +++ b/collects/net/scribblings/tcp-redirect.scrbl @@ -1,21 +1,21 @@ #lang scribble/doc @(require "common.rkt" (for-label net/tcp-redirect net/tcp-sig)) -@title[#:tag "tcp-redirect"]{TCP Redirect: @scheme[tcp^] via Channels} +@title[#:tag "tcp-redirect"]{TCP Redirect: @racket[tcp^] via Channels} -@defmodule[net/tcp-redirect]{The @schememodname[net/tcp-redirect] +@defmodule[net/tcp-redirect]{The @racketmodname[net/tcp-redirect] library provides a function for directing some TCP port numbers to use buffered channels instead of the TCP support from -@schememodname[racket/tcp].} +@racketmodname[racket/tcp].} @defproc[(tcp-redirect [port-numbers (listof (integer-in 0 65535))]) unit?]{ -Returns a unit that implements @scheme[tcp^]. For port numbers not -listed in @scheme[port-numbers], the unit's implementations are the -@schememodname[racket/tcp] implementations. +Returns a unit that implements @racket[tcp^]. For port numbers not +listed in @racket[port-numbers], the unit's implementations are the +@racketmodname[racket/tcp] implementations. -For the port numbers listed in @scheme[port-numbers] and for -connections to @scheme["127.0.0.1"], the unit's implementation does +For the port numbers listed in @racket[port-numbers] and for +connections to @racket["127.0.0.1"], the unit's implementation does not use TCP connections, but instead uses internal buffered channels. Such channels behave exactly as TCP listeners and ports.} diff --git a/collects/net/scribblings/tcp.scrbl b/collects/net/scribblings/tcp.scrbl index 2ae0c40d3d..ea5e8b37a0 100644 --- a/collects/net/scribblings/tcp.scrbl +++ b/collects/net/scribblings/tcp.scrbl @@ -5,16 +5,16 @@ @title[#:tag "tcp"]{TCP: Unit and Signature} -The @schememodname[net/tcp-sig] and @schememodname[net/tcp-unit] -libraries define a @scheme[tcp^] signature and @scheme[tcp@] +The @racketmodname[net/tcp-sig] and @racketmodname[net/tcp-unit] +libraries define a @racket[tcp^] signature and @racket[tcp@] implementation, where the implementation uses -@schememodname[racket/tcp]. +@racketmodname[racket/tcp]. -Some units in the @filepath{net} collection import @scheme[tcp^], so +Some units in the @filepath{net} collection import @racket[tcp^], so that they can be used with transports other than plain TCP. For -example, @scheme[url@] imports @scheme[tcp^]. +example, @racket[url@] imports @racket[tcp^]. -See also @scheme[tcp-redirect] and @scheme[make-ssl-tcp@]. +See also @racket[tcp-redirect] and @racket[make-ssl-tcp@]. @section{TCP Signature} @@ -29,7 +29,7 @@ See also @scheme[tcp-redirect] and @scheme[make-ssl-tcp@]. [hostname (or/c string? false/c) #f]) @#,sigelem[tcp^ tcp-listener?]]{ -Like @scheme[tcp-listen] from @schememodname[racket/tcp].} +Like @racket[tcp-listen] from @racketmodname[racket/tcp].} @defproc[(tcp-connect [hostname string?] [port-no (and/c exact-nonnegative-integer? @@ -41,7 +41,7 @@ Like @scheme[tcp-listen] from @schememodname[racket/tcp].} #f]) (values input-port? output-port?)]{ -Like @scheme[tcp-connect] from @schememodname[racket/tcp].} +Like @racket[tcp-connect] from @racketmodname[racket/tcp].} @defproc[(tcp-connect/enable-break [hostname string?] [port-no (and/c exact-nonnegative-integer? @@ -52,33 +52,33 @@ Like @scheme[tcp-connect] from @schememodname[racket/tcp].} false/c)]) (values input-port? output-port?)]{ -Like @scheme[tcp-connect/enable-break] from @schememodname[racket/tcp].} +Like @racket[tcp-connect/enable-break] from @racketmodname[racket/tcp].} @defproc[(tcp-accept [listener @#,sigelem[tcp^ tcp-listener?]]) (values input-port? output-port?)]{ -Like @scheme[tcp-accept] from @schememodname[racket/tcp].} +Like @racket[tcp-accept] from @racketmodname[racket/tcp].} @defproc[(tcp-accept/enable-break [listener @#,sigelem[tcp^ tcp-listener?]]) (values input-port? output-port?)]{ -Like @scheme[tcp-accept/enable-break] from @schememodname[racket/tcp].} +Like @racket[tcp-accept/enable-break] from @racketmodname[racket/tcp].} @defproc[(tcp-accept-ready? [listener @#,sigelem[tcp^ tcp-listener?]]) boolean?]{ -Like @scheme[tcp-accept-ready?] from @schememodname[racket/tcp].} +Like @racket[tcp-accept-ready?] from @racketmodname[racket/tcp].} @defproc[(tcp-close [listener @#,sigelem[tcp^ tcp-listener?]]) void?]{ -Like @scheme[tcp-close] from @schememodname[racket/tcp].} +Like @racket[tcp-close] from @racketmodname[racket/tcp].} @defproc[(tcp-listener? [v any/c]) boolean?]{ -Like @scheme[tcp-listener?] from @schememodname[racket/tcp].} +Like @racket[tcp-listener?] from @racketmodname[racket/tcp].} @defproc[(tcp-abandon-port [tcp-port port?]) void?]{ -Like @scheme[tcp-abandon-port] from @schememodname[racket/tcp].} +Like @racket[tcp-abandon-port] from @racketmodname[racket/tcp].} @defproc[(tcp-addresses [tcp-port port?] [port-numbers? any/c #f]) @@ -86,7 +86,7 @@ Like @scheme[tcp-abandon-port] from @schememodname[racket/tcp].} (values string? (integer-in 1 65535) string? (integer-in 1 65535)))]{ -Like @scheme[tcp-addresses] from @schememodname[racket/tcp].} +Like @racket[tcp-addresses] from @racketmodname[racket/tcp].} } @@ -96,5 +96,5 @@ Like @scheme[tcp-addresses] from @schememodname[racket/tcp].} @defthing[tcp@ unit?]{ -Imports nothing and exports @scheme[tcp^], implemented using -@schememodname[racket/tcp].} +Imports nothing and exports @racket[tcp^], implemented using +@racketmodname[racket/tcp].} diff --git a/collects/net/scribblings/uri-codec.scrbl b/collects/net/scribblings/uri-codec.scrbl index 76965c8cfb..57f3c30ebc 100644 --- a/collects/net/scribblings/uri-codec.scrbl +++ b/collects/net/scribblings/uri-codec.scrbl @@ -8,7 +8,7 @@ @title[#:tag "uri-codec"]{URI Codec: Encoding and Decoding URIs} -@defmodule[net/uri-codec]{The @schememodname[net/uri-codec] module +@defmodule[net/uri-codec]{The @racketmodname[net/uri-codec] module provides utilities for encoding and decoding strings using the URI encoding rules given in RFC 2396 @cite["RFC2396"], and to encode and decode name/value pairs using the @@ -54,7 +54,7 @@ given in the HTML 4.0 spec are: These rules differs slightly from the straight encoding in RFC 2396 in that @litchar{+} is allowed, and it represents a space. The -@schememodname[net/uri-codec] library follows this convention, +@racketmodname[net/uri-codec] library follows this convention, encoding a space as @litchar{+} and decoding @litchar{+} as a space. In addtion, since there appear to be some brain-dead decoders on the web, the library also encodes @litchar{!}, @litchar{~}, @litchar{'}, @@ -106,7 +106,7 @@ Decode a string encoded using the Encode an association list using the @tt{application/x-www-form-urlencoded} encoding rules. -The @scheme[current-alist-separator-mode] parameter determines the +The @racket[current-alist-separator-mode] parameter determines the separator used in the result.} @@ -117,7 +117,7 @@ Decode a string encoded using the @tt{application/x-www-form-urlencoded} encoding rules into an association list. All keys are case-folded for conversion to symbols. -The @scheme[current-alist-separator-mode] parameter determines the way +The @racket[current-alist-separator-mode] parameter determines the way that separators are parsed in the input.} @@ -125,11 +125,11 @@ that separators are parsed in the input.} (one-of/c 'amp 'semi 'amp-or-semi 'semi-or-amp)]{ A parameter that determines the separator used/recognized between -associations in @scheme[form-urlencoded->alist], -@scheme[alist->form-urlencoded], @scheme[url->string], and -@scheme[string->url]. +associations in @racket[form-urlencoded->alist], +@racket[alist->form-urlencoded], @racket[url->string], and +@racket[string->url]. -The default value is @scheme['amp-or-semi], which means that both +The default value is @racket['amp-or-semi], which means that both @litchar{&} and @litchar{;} are treated as separators when parsing, and @litchar{&} is used as a separator when encoding. The other modes use/recognize only of the separators. @@ -137,19 +137,19 @@ use/recognize only of the separators. @examples[ #:eval uri-codec-eval (define ex '((x . "foo") (y . "bar") (z . "baz"))) -(code:line (current-alist-separator-mode 'amp) (code:comment @#,t{try @scheme['amp]...})) +(code:line (current-alist-separator-mode 'amp) (code:comment @#,t{try @racket['amp]...})) (form-urlencoded->alist "x=foo&y=bar&z=baz") (form-urlencoded->alist "x=foo;y=bar;z=baz") (alist->form-urlencoded ex) -(code:line (current-alist-separator-mode 'semi) (code:comment @#,t{try @scheme['semi]...})) +(code:line (current-alist-separator-mode 'semi) (code:comment @#,t{try @racket['semi]...})) (form-urlencoded->alist "x=foo;y=bar;z=baz") (form-urlencoded->alist "x=foo&y=bar&z=baz") (alist->form-urlencoded ex) -(code:line (current-alist-separator-mode 'amp-or-semi) (code:comment @#,t{try @scheme['amp-or-semi]...})) +(code:line (current-alist-separator-mode 'amp-or-semi) (code:comment @#,t{try @racket['amp-or-semi]...})) (form-urlencoded->alist "x=foo&y=bar&z=baz") (form-urlencoded->alist "x=foo;y=bar;z=baz") (alist->form-urlencoded ex) -(code:line (current-alist-separator-mode 'semi-or-amp) (code:comment @#,t{try @scheme['semi-or-amp]...})) +(code:line (current-alist-separator-mode 'semi-or-amp) (code:comment @#,t{try @racket['semi-or-amp]...})) (form-urlencoded->alist "x=foo&y=bar&z=baz") (form-urlencoded->alist "x=foo;y=bar;z=baz") (alist->form-urlencoded ex) diff --git a/collects/net/scribblings/url.scrbl b/collects/net/scribblings/url.scrbl index 76694a1b28..29ffefc297 100644 --- a/collects/net/scribblings/url.scrbl +++ b/collects/net/scribblings/url.scrbl @@ -6,28 +6,28 @@ @title[#:tag "url"]{URLs and HTTP} -@defmodule[net/url]{The @schememodname[net/url] library provides +@defmodule[net/url]{The @racketmodname[net/url] library provides utilities to parse and manipulate URIs, as specified in RFC 2396 @cite["RFC2396"], and to use the HTTP protocol.} To access the text of a document from the web, first obtain its URL as -a string. Convert the address into a @scheme[url] structure using -@scheme[string->url]. Then, open the document using -@scheme[get-pure-port] or @scheme[get-impure-port], depending on +a string. Convert the address into a @racket[url] structure using +@racket[string->url]. Then, open the document using +@racket[get-pure-port] or @racket[get-impure-port], depending on whether or not you wish to examine its MIME headers. At this point, you have a regular input port with which to process the document, as with -any other file. +any other file. -Currently the only supported protocols are @scheme["http"], -@racket["https"], and sometimes @scheme["file"]. +Currently the only supported protocols are @racket["http"], +@racket["https"], and sometimes @racket["file"]. @section{URL Structure} @declare-exporting[net/url-structs net/url] @defmodule*/no-declare[(net/url-structs)]{The URL structure types are -provided by the @schememodname[net/url-structs] library, and -re-exported by @schememodname[net/url].} +provided by the @racketmodname[net/url-structs] library, and +re-exported by @racketmodname[net/url].} @; ---------------------------------------- @@ -53,30 +53,30 @@ The basic structure for all URLs, which is explained in RFC 3986 7 = query, 8 = fragment }| -The strings inside the @scheme[user], @scheme[path], @scheme[query], -and @scheme[fragment] fields are represented directly as Racket +The strings inside the @racket[user], @racket[path], @racket[query], +and @racket[fragment] fields are represented directly as Racket strings, without URL-syntax-specific quoting. The procedures -@scheme[string->url] and @scheme[url->string] translate encodings such +@racket[string->url] and @racket[url->string] translate encodings such as @litchar{%20} into spaces and back again. By default, query associations are parsed with either @litchar{;} or @litchar{&} as a separator, and they are generated with @litchar{&} as -a separator. The @scheme[current-alist-separator-mode] parameter +a separator. The @racket[current-alist-separator-mode] parameter adjusts the behavior. -An empty string at the end of the @scheme[path] list corresponds to a +An empty string at the end of the @racket[path] list corresponds to a URL that ends in a slash. For example, the result of -@scheme[(string->url "http://racket-lang.org/a/")] has a -@scheme[path] field with strings @scheme["a"] and @scheme[""], while -the result of @scheme[(string->url "http://racket-lang.org/a")] has a -@scheme[path] field with only the string @scheme["a"]. +@racket[(string->url "http://racket-lang.org/a/")] has a +@racket[path] field with strings @racket["a"] and @racket[""], while +the result of @racket[(string->url "http://racket-lang.org/a")] has a +@racket[path] field with only the string @racket["a"]. -When a @scheme["file"] URL is represented by a @scheme[url] structure, -the @scheme[path] field is mostly a list of path elements. For Unix -paths, the root directory is not included in @scheme[path]; its -presence or absence is implicit in the @scheme[path-absolute?] flag. +When a @racket["file"] URL is represented by a @racket[url] structure, +the @racket[path] field is mostly a list of path elements. For Unix +paths, the root directory is not included in @racket[path]; its +presence or absence is implicit in the @racket[path-absolute?] flag. For Windows paths, the first element typically represents a drive, but -a UNC path is represented by a first element that is @scheme[""] and +a UNC path is represented by a first element that is @racket[""] and then successive elements complete the drive components that are separated by @litchar{/} or @litchar{\}.} @@ -96,28 +96,28 @@ fragment. An impure port is one that still has its MIME headers. @defproc[(string->url [str string?]) url?]{ -Parses the URL specified by @scheme[str] into a @scheme[url] -struct. The @scheme[string->url] procedure uses -@scheme[form-urlencoded->alist] when parsing the query, so it is -sensitive to the @scheme[current-alist-separator-mode] parameter for +Parses the URL specified by @racket[str] into a @racket[url] +struct. The @racket[string->url] procedure uses +@racket[form-urlencoded->alist] when parsing the query, so it is +sensitive to the @racket[current-alist-separator-mode] parameter for determining the association separator. -If @scheme[str] starts with @scheme["file:"], then the path is always +If @racket[str] starts with @racket["file:"], then the path is always parsed as an absolute path, and the parsing details depend on -@scheme[file-url-path-convention-type]: +@racket[file-url-path-convention-type]: @itemize[ - @item{@scheme['unix] : If @scheme["file:"] is followed by + @item{@racket['unix] : If @racket["file:"] is followed by @litchar{//} and a non-@litchar{/}, then the first element after the @litchar{//} is parsed as a host (and maybe port); otherwise, the first element starts the path, and the host is - @scheme[""].} + @racket[""].} - @item{@scheme['windows] : If @scheme["file:"] is followed by + @item{@racket['windows] : If @racket["file:"] is followed by @litchar{//}, then the @litchar{//} is stripped; the remainder - parsed as a Windows path. The host is always @scheme[""] and - the port is always @scheme[#f].} + parsed as a Windows path. The host is always @racket[""] and + the port is always @racket[#f].} ]} @@ -135,33 +135,33 @@ This function does not raise any exceptions.} Turns a string into a URL, applying (what appear to be) Netscape's conventions on automatically specifying the scheme: a string starting -with a slash gets the scheme @scheme["file"], while all others get the -scheme @scheme["http"].} +with a slash gets the scheme @racket["file"], while all others get the +scheme @racket["http"].} @defproc[(url->string [URL url?]) string?]{ -Generates a string corresponding to the contents of a @scheme[url] -struct. For a @scheme["file:"] URL, the URL must not be relative, the +Generates a string corresponding to the contents of a @racket[url] +struct. For a @racket["file:"] URL, the URL must not be relative, the result always starts @litchar{file://}, and the interpretation of the -path depends on the value of @scheme[file-url-path-convention-type]: +path depends on the value of @racket[file-url-path-convention-type]: @itemize[ - @item{@scheme['unix] : Elements in @scheme[URL] are treated as path + @item{@racket['unix] : Elements in @racket[URL] are treated as path elements. Empty strings in the path list are treated like - @scheme['same].} + @racket['same].} - @item{@scheme['windows] : If the first element is @scheme[""] then + @item{@racket['windows] : If the first element is @racket[""] then the next two elements define the UNC root, and the rest of the elements are treated as path elements. Empty strings in the - path list are treated like @scheme['same].} + path list are treated like @racket['same].} ] -The @scheme[url->string] procedure uses -@scheme[alist->form-urlencoded] when formatting the query, so it is -sensitive to the @scheme[current-alist-separator-mode] parameter for +The @racket[url->string] procedure uses +@racket[alist->form-urlencoded] when formatting the query, so it is +sensitive to the @racket[current-alist-separator-mode] parameter for determining the association separator. The default is to separate associations with a @litchar{&}.} @@ -169,21 +169,21 @@ associations with a @litchar{&}.} @defproc[(path->url [path (or/c path-string? path-for-some-system?)]) url?]{ -Converts a path to a @scheme[url].} +Converts a path to a @racket[url].} @defproc[(url->path [URL url?] [kind (one-of/c 'unix 'windows) (system-path-convention-type)]) path-for-some-system?]{ -Converts @scheme[URL], which is assumed to be a @scheme["file"] URL, +Converts @racket[URL], which is assumed to be a @racket["file"] URL, to a path.} @defparam[file-url-path-convention-type kind (one-of/c 'unix 'windows)]{ Determines the default conversion to and from strings for -@scheme["file"] URLs. See @scheme[string->url] and @scheme[url->string].} +@racket["file"] URLs. See @racket[string->url] and @racket[url->string].} @deftogether[( @@ -198,13 +198,13 @@ Determines the default conversion to and from strings for input-port?] )]{ -Initiates a GET/HEAD/DELETE request for @scheme[URL] and returns a +Initiates a GET/HEAD/DELETE request for @racket[URL] and returns a @tech{pure port} corresponding to the body of the response. The optional list of strings can be used to send header lines to the server. The GET method is used to retrieve whatever information is identified -by @scheme[URL]. +by @racket[URL]. The HEAD method is identical to GET, except the server must not return a message body. The meta-information returned in a response to a HEAD @@ -212,9 +212,9 @@ request should be identical to the information in a response to a GET request. The DELETE method is used to delete the entity identified by -@scheme[URL]. +@racket[URL]. -@bold{Beware:} By default, @scheme["https"] scheme handling does not +@bold{Beware:} By default, @racket["https"] scheme handling does not verify a server's certificate (i.e., it's equivalent of clicking through a browser's warnings), so communication is safe, but the identity of the server is not verified. To validate the server's @@ -222,8 +222,8 @@ certificate, set @racket[current-https-protocol] to a context created with @racket[ssl-make-client-context], and enable certificate validation in the context with @racket[ssl-set-verify!]. -The @scheme["file"] scheme for URLs is handled only by -@scheme[get-pure-port], which uses @scheme[open-input-file], does not +The @racket["file"] scheme for URLs is handled only by +@racket[get-pure-port], which uses @racket[open-input-file], does not handle exceptions, and ignores the optional strings.} @deftogether[( @@ -238,9 +238,9 @@ handle exceptions, and ignores the optional strings.} input-port?] )]{ -Like @scheme[get-pure-port], etc., but the resulting @tech{impure +Like @racket[get-pure-port], etc., but the resulting @tech{impure port} contains both the returned headers and the body. The -@scheme["file"] URL scheme is not handled by these functions.} +@racket["file"] URL scheme is not handled by these functions.} @deftogether[( @defproc[(post-pure-port [URL url?] @@ -253,13 +253,13 @@ port} contains both the returned headers and the body. The input-port?] )]{ -Initiates a POST/PUT request for @scheme[URL] and sends the -@scheme[post] byte string. The result is a @tech{pure port}, which +Initiates a POST/PUT request for @racket[URL] and sends the +@racket[post] byte string. The result is a @tech{pure port}, which contains the body of the response is returned. The optional list of strings can be used to send header lines to the server. @bold{Beware:} See @racket[get-pure-port] for warnings about -@scheme["https"] certificate validation.} +@racket["https"] certificate validation.} @deftogether[( @@ -273,7 +273,7 @@ strings can be used to send header lines to the server. input-port?] )]{ -Like @scheme[post-pure-port] and @scheme[put-pure-port], but the +Like @racket[post-pure-port] and @racket[put-pure-port], but the resulting @tech{impure port} contains both the returned headers and body.} @@ -292,15 +292,15 @@ something like @litchar{1.0} or @litchar{1.1}, @nonterm{code} is an exact integer for the response code, and @nonterm{message} is arbitrary text without a return or newline. -The @schememodname[net/head] library provides procedures, such as -@scheme[extract-field] for manipulating the header. +The @racketmodname[net/head] library provides procedures, such as +@racket[extract-field] for manipulating the header. Since web servers sometimes return mis-formatted replies, -@scheme[purify-port] is liberal in what it accepts as a header. as a +@racket[purify-port] is liberal in what it accepts as a header. as a result, the result string may be ill formed, but it will either be the empty string, or it will be a string matching the following regexp: -@schemeblock[ +@racketblock[ #rx"^HTTP/.*?(\r\n\r\n|\n\n|\r\r)" ]} @@ -315,18 +315,18 @@ empty string, or it will be a string matching the following regexp: [header (listof string?)]) any])]{ -Given a URL and a @scheme[connect] procedure like -@scheme[get-pure-port] to convert the URL to an input port (either a -@tech{pure port} or @tech{impure port}), calls the @scheme[handle] +Given a URL and a @racket[connect] procedure like +@racket[get-pure-port] to convert the URL to an input port (either a +@tech{pure port} or @tech{impure port}), calls the @racket[handle] procedure on the port and closes the port on return. The result of the -@scheme[handle] procedure is the result of @scheme[call/input-url]. +@racket[handle] procedure is the result of @racket[call/input-url]. -When a @scheme[header] argument is supplied, it is passed along to the -@scheme[connect] procedure. +When a @racket[header] argument is supplied, it is passed along to the +@racket[connect] procedure. The connection is made in such a way that the port is closed before -@scheme[call/input-url] returns, no matter how it returns. In -particular, it is closed if @scheme[handle] raises an exception, or if +@racket[call/input-url] returns, no matter how it returns. In +particular, it is closed if @racket[handle] raises an exception, or if the connection process is interruped by an asynchronous break exception.} @@ -338,7 +338,7 @@ connections. Each mapping is a list of three elements: @itemize[ - @item{the URL scheme, such as @scheme["http"];} + @item{the URL scheme, such as @racket["http"];} @item{the proxy server address; and} @@ -346,7 +346,7 @@ connections. Each mapping is a list of three elements: ] -Currently, the only proxiable scheme is @scheme["http"]. The default +Currently, the only proxiable scheme is @racket["http"]. The default mapping is the empty list (i.e., no proxies).} @defparam[current-https-protocol protocol (or/c ssl-client-context? symbol?)]{ @@ -387,9 +387,9 @@ Note that @racket[net/url] does not provide the @defsignature[url^ ()]{ -Includes everything exported by the @schememodname[net/url] module +Includes everything exported by the @racketmodname[net/url] module except @racket[current-https-protocol]. Note that the exports of -@schememodname[net/url] and the @racket[url^] signature do not include +@racketmodname[net/url] and the @racket[url^] signature do not include @racket[current-connect-scheme].} @defsignature[url+scheme^ (url^)]{ diff --git a/collects/net/scribblings/websocket.scrbl b/collects/net/scribblings/websocket.scrbl index de2423ac2e..825f7742fd 100644 --- a/collects/net/scribblings/websocket.scrbl +++ b/collects/net/scribblings/websocket.scrbl @@ -34,7 +34,7 @@ This module provides the exports from @racketmodname[net/websocket/client] and @ Connects to the WebSocket server specified by @racket[u], providing @racket[headers] as additional headers. Returns the connection handle. } - + This module also provides the exports from @racketmodname[net/websocket/conn]. @section{Server API} @@ -64,7 +64,7 @@ This module also provides the exports from @racketmodname[net/websocket/conn]. sole control until the WebSocket connection completes. All other arguments are used as in a @secref["dispatch-server-unit" #:doc '(lib "web-server/scribblings/web-server-internal.scrbl")]. - + The @racket[#:tcp@] keyword is provided for building an SSL server. } diff --git a/collects/openssl/openssl.scrbl b/collects/openssl/openssl.scrbl index aeeebd410c..d8083644c7 100644 --- a/collects/openssl/openssl.scrbl +++ b/collects/openssl/openssl.scrbl @@ -2,17 +2,17 @@ @(require scribble/manual scribble/bnf (for-label openssl - scheme + scheme openssl/sha1)) @title{@bold{OpenSSL}} @defmodule[openssl] -The @schememodname[openssl] library provides glue for the OpenSSL +The @racketmodname[openssl] library provides glue for the OpenSSL library with the Racket port system. It provides functions nearly identically to the standard TCP subsystem in Racket, plus a -generic @scheme[ports->ssl-ports] interface. +generic @racket[ports->ssl-ports] interface. To use this library, you will need OpenSSL installed on your machine, but @@ -33,14 +33,14 @@ but @defthing[ssl-available? boolean?]{ A boolean value which says whether the system openssl library was -successfully loaded. Calling @scheme[ssl-connect], @|etc| when this -value is @scheme[#f] (library not loaded) will raise an exception.} +successfully loaded. Calling @racket[ssl-connect], @|etc| when this +value is @racket[#f] (library not loaded) will raise an exception.} @defthing[ssl-load-fail-reason (or/c false/c string?)]{ -Either @scheme[#f] (when @scheme[ssl-available?] is @scheme[#t]) or an -error string (when @scheme[ssl-available?] is @scheme[#f]).} +Either @racket[#f] (when @racket[ssl-available?] is @racket[#t]) or an +error string (when @racket[ssl-available?] is @racket[#f]).} @; ---------------------------------------------------------------------- @@ -52,21 +52,21 @@ error string (when @scheme[ssl-available?] is @scheme[#f]).} (or/c ssl-client-context? symbol?) 'sslv2-or-v3)) (values input-port? output-port?)]{ -Connect to the host given by @scheme[hostname], on the port given by -@scheme[port-no]. This connection will be encrypted using SSL. The -return values are as for @scheme[tcp-connect]: an input port and an +Connect to the host given by @racket[hostname], on the port given by +@racket[port-no]. This connection will be encrypted using SSL. The +return values are as for @racket[tcp-connect]: an input port and an output port. -The optional @scheme[client-protocol] argument determines which +The optional @racket[client-protocol] argument determines which encryption protocol is used, whether the server's certificate is checked, etc. The argument can be either a client context created by -@scheme[ssl-make-client-context], or one of the following symbols: -@scheme['sslv2-or-v3] (the default), @scheme['sslv2], @scheme['sslv3], -or @scheme['tls]; see @scheme[ssl-make-client-context] for further +@racket[ssl-make-client-context], or one of the following symbols: +@racket['sslv2-or-v3] (the default), @racket['sslv2], @racket['sslv3], +or @racket['tls]; see @racket[ssl-make-client-context] for further details (including the meanings of the protocol symbols). Closing the resulting output port does not send a shutdown message to -the server. See also @scheme[ports->ssl-ports]. +the server. See also @racket[ports->ssl-ports]. @;{ See `enforce-retry?' in "mzssl.rkt", currently set to #f so that this @@ -76,7 +76,7 @@ direction at a time. If you request data from the input port, then data cannot be written to the output port (i.e., attempting to write will block) until the other end of the connection responds to the read. Even merely checking for input data --- using -@scheme[byte-ready?], for example --- commits the connection to +@racket[byte-ready?], for example --- commits the connection to reading, and the other end must respond with a (possibly zero-length) answer. Protocols that work with SSL, such as IMAP, have a well-defined communication pattern, where theres no question of @@ -92,42 +92,42 @@ whether the other end is supposed to be sending or reading data. (or/c ssl-client-context? symbol?) 'sslv2-or-v3)) (values input-port? output-port?)]{ -Like @scheme[ssl-connect], but breaking is enabled while trying to +Like @racket[ssl-connect], but breaking is enabled while trying to connect.} @defproc[(ssl-make-client-context (protocol symbol? 'sslv2-or-v3)) ssl-client-context?]{ -Creates a context to be supplied to @scheme[ssl-connect]. The context +Creates a context to be supplied to @racket[ssl-connect]. The context identifies a communication protocol (as selected by -@scheme[protocol]), and also holds certificate information (i.e., the +@racket[protocol]), and also holds certificate information (i.e., the client's identity, its trusted certificate authorities, etc.). See the section @secref["cert-procs"] below for more information on certificates. -The @scheme[protocol] must be one of the following: +The @racket[protocol] must be one of the following: @itemize[ - @item{@scheme['sslv2-or-v3] : SSL protocol versions 2 or 3, as + @item{@racket['sslv2-or-v3] : SSL protocol versions 2 or 3, as appropriate (this is the default)} - @item{@scheme['sslv2] : SSL protocol version 2} - @item{@scheme['sslv3] : SSL protocol version 3} - @item{@scheme['tls] : the TLS protocol version 1} + @item{@racket['sslv2] : SSL protocol version 2} + @item{@racket['sslv3] : SSL protocol version 3} + @item{@racket['tls] : the TLS protocol version 1} ] Note that SSL protocol version 2 is deprecated on some platforms and may not be present in your system libraries. The use of SSLv2 may also compromise security; thus, using SSLv3 is recommended. -By default, the context returned by @scheme[ssl-make-client-context] does not -request verification of a server's certificate. Use @scheme[ssl-set-verify!] +By default, the context returned by @racket[ssl-make-client-context] does not +request verification of a server's certificate. Use @racket[ssl-set-verify!] to enable such verification.} @defproc[(ssl-client-context? (v any/c)) boolean?]{ -Returns @scheme[#t] if @scheme[v] is a value produced by -@scheme[ssl-make-client-context], @scheme[#f] otherwise.} +Returns @racket[#t] if @racket[v] is a value produced by +@racket[ssl-make-client-context], @racket[#f] otherwise.} @; ---------------------------------------------------------------------- @@ -143,18 +143,18 @@ Returns @scheme[#t] if @scheme[v] is a value produced by (or/c ssl-server-context? symbol?) 'sslv2-or-v3]) ssl-listener?]{ -Like @scheme[tcp-listen], but the result is an SSL listener. The extra optional -@scheme[server-protocol] is as for @scheme[ssl-connect], except that a +Like @racket[tcp-listen], but the result is an SSL listener. The extra optional +@racket[server-protocol] is as for @racket[ssl-connect], except that a context must be a server context instead of a client context. -Call @scheme[ssl-load-certificate-chain!] and -@scheme[ssl-load-private-key!] to avoid a @emph{no shared cipher} +Call @racket[ssl-load-certificate-chain!] and +@racket[ssl-load-private-key!] to avoid a @emph{no shared cipher} error on accepting connections. The file @filepath{test.pem} in the @filepath{openssl} collection is a suitable argument for both calls when testing. Since @filepath{test.pem} is public, however, such a test configuration obviously provides no security. -An SSL listener is a synchronizable value (see @scheme[sync]). It is +An SSL listener is a synchronizable value (see @racket[sync]). It is ready---with itself as its value---when the underlying TCP listener is ready. At that point, however, accepting a connection with @racket[ssl-accept] may not complete immediately, because @@ -165,7 +165,7 @@ further communication is needed to establish the connection.} @defproc[(ssl-close (listener ssl-listener?)) void?] @defproc[(ssl-listener? (v any/c)) boolean?])]{ -Analogous to @scheme[tcp-close] and @scheme[tcp-listener?].} +Analogous to @racket[tcp-close] and @racket[tcp-listener?].} @deftogether[( @defproc[(ssl-accept (listener ssl-listener?)) @@ -173,16 +173,16 @@ Analogous to @scheme[tcp-close] and @scheme[tcp-listener?].} @defproc[(ssl-accept/enable-break (listener ssl-listener?)) (values input-port? output-port?)])]{ -Analogous to @scheme[tcp-accept]. +Analogous to @racket[tcp-accept]. Closing the resulting output port does not send a shutdown message to -the client. See also @scheme[ports->ssl-ports]. +the client. See also @racket[ports->ssl-ports]. -See also @scheme[ssl-connect] about the limitations of reading and +See also @racket[ssl-connect] about the limitations of reading and writing to an SSL connection (i.e., one direction at a time). -The @scheme[ssl-accept/enable-break] procedure is analogous to -@scheme[tcp-accept/enable-break].} +The @racket[ssl-accept/enable-break] procedure is analogous to +@racket[tcp-accept/enable-break].} @defproc[(ssl-abandon-port [in (and/c ssl-port? output-port?)]) void?]{ @@ -206,12 +206,12 @@ Returns @racket[#t] of @racket[v] is an SSL port produced by @defproc[(ssl-make-server-context (protocol symbol?)) ssl-server-context?]{ -Like @scheme[ssl-make-client-context], but creates a server context.} +Like @racket[ssl-make-client-context], but creates a server context.} @defproc[(ssl-server-context? (v any/c)) boolean?]{ -Returns @scheme[#t] if @scheme[v] is a value produced by -@scheme[ssl-make-server-context], @scheme[#f] otherwise.} +Returns @racket[#t] if @racket[v] is a value produced by +@racket[ssl-make-server-context], @racket[#f] otherwise.} @; ---------------------------------------------------------------------- @@ -238,43 +238,43 @@ implement the SSL protocol over the given input and output port. (The given ports should be connected to another process that runs the SSL protocol.) -The @scheme[mode] argument can be @scheme['connect] or -@scheme['accept]. The mode determines how the SSL protocol is +The @racket[mode] argument can be @racket['connect] or +@racket['accept]. The mode determines how the SSL protocol is initialized over the ports, either as a client or as a server. As with -@scheme[ssl-listen], in @scheme['accept] mode, supply a -@scheme[context] that has been initialized with -@scheme[ssl-load-certificate-chain!] and -@scheme[ssl-load-private-key!] to avoid a @emph{no shared cipher} +@racket[ssl-listen], in @racket['accept] mode, supply a +@racket[context] that has been initialized with +@racket[ssl-load-certificate-chain!] and +@racket[ssl-load-private-key!] to avoid a @emph{no shared cipher} error. -The @scheme[context] argument should be a client context for -@scheme['connect] mode or a server context for @scheme['accept] +The @racket[context] argument should be a client context for +@racket['connect] mode or a server context for @racket['accept] mode. If it is not supplied, a context is created using the protocol -specified by a @scheme[protocol] argument. +specified by a @racket[protocol] argument. -If the @scheme[protocol] argument is not supplied, it defaults to -@scheme['sslv2-or-v3]. See @scheme[ssl-make-client-context] for +If the @racket[protocol] argument is not supplied, it defaults to +@racket['sslv2-or-v3]. See @racket[ssl-make-client-context] for further details (including all options and the meanings of the -protocol symbols). This argument is ignored if a @scheme[context] +protocol symbols). This argument is ignored if a @racket[context] argument is supplied. -If @scheme[close-original?] is true, then when both SSL ports are +If @racket[close-original?] is true, then when both SSL ports are closed, the given input and output ports are automatically closed. -If @scheme[shutdown-on-close?] is true, then when the output SSL port +If @racket[shutdown-on-close?] is true, then when the output SSL port is closed, it sends a shutdown message to the other end of the SSL connection. When shutdown is enabled, closing the output port can fail if the given output port becomes unwritable (e.g., because the other end of the given port has been closed by another process). -The @scheme[error] argument is an error procedure to use for raising -communication errors. The default is @scheme[error], which raises -@scheme[exn:fail]; in contrast, @scheme[ssl-accept] and -@scheme[ssl-connect] use an error function that raises -@scheme[exn:fail:network]. +The @racket[error] argument is an error procedure to use for raising +communication errors. The default is @racket[error], which raises +@racket[exn:fail]; in contrast, @racket[ssl-accept] and +@racket[ssl-connect] use an error function that raises +@racket[exn:fail:network]. -See also @scheme[ssl-connect] about the limitations of reading and +See also @racket[ssl-connect] about the limitations of reading and writing to an SSL connection (i.e., one direction at a time).} @; ---------------------------------------------------------------------- @@ -288,13 +288,13 @@ writing to an SSL connection (i.e., one direction at a time).} void?]{ Loads a PEM-format certification chain file for connections to made -with the given context (created by @scheme[ssl-make-client-context] or -@scheme[ssl-make-server-context]) or listener (created by -@scheme[ssl-listen]). +with the given context (created by @racket[ssl-make-client-context] or +@racket[ssl-make-server-context]) or listener (created by +@racket[ssl-listen]). This chain is used to identify the client or server when it connects or accepts connections. Loading a chain overwrites the old chain. Also -call @scheme[ssl-load-private-key!] to load the certificate's +call @racket[ssl-load-private-key!] to load the certificate's corresponding key. You can use the file @filepath{test.pem} of the @filepath{openssl} @@ -309,13 +309,13 @@ such a test configuration obviously provides no security.} [asn1? boolean? #f]) void?]{ -Loads the first private key from @scheme[pathname] for the given +Loads the first private key from @racket[pathname] for the given context or listener. The key goes with the certificate that identifies the client or server. -If @scheme[rsa?] is @scheme[#t] (the default), the first RSA key is -read (i.e., non-RSA keys are skipped). If @scheme[asn1?] is -@scheme[#t], the file is parsed as ASN1 format instead of PEM. +If @racket[rsa?] is @racket[#t] (the default), the first RSA key is +read (i.e., non-RSA keys are skipped). If @racket[asn1?] is +@racket[#t], the file is parsed as ASN1 format instead of PEM. You can use the file @filepath{test.pem} of the @filepath{openssl} collection for testing purposes. Since @filepath{test.pem} is public, @@ -332,7 +332,7 @@ By default, verification is disabled. Enabling verification also requires, at a minimum, designating trusted certificate authorities with -@scheme[ssl-load-verify-root-certificates!].} +@racket[ssl-load-verify-root-certificates!].} @defproc[(ssl-load-verify-root-certificates! (context-or-listener (or/c ssl-client-context? ssl-server-context? @@ -361,7 +361,7 @@ server trusts. Loading the suggested certificates does not imply trust, however; any certificate presented by the client will be checked using the trusted -roots loaded by @scheme[ssl-load-verify-root-certificates!]. +roots loaded by @racket[ssl-load-verify-root-certificates!]. You can use the file @filepath{test.pem} of the @filepath{openssl} collection for testing purposes where the peer identifies itself using @@ -393,7 +393,7 @@ is @racket[#f].} @section{SHA-1 Hashing} -@defmodule[openssl/sha1]{The @schememodname[openssl/sha1] library +@defmodule[openssl/sha1]{The @racketmodname[openssl/sha1] library provides a Racket wrapper for the OpenSSL library's SHA-1 hashing functions. If the OpenSSL library cannot be opened, this library logs a warning and falls back to the implementation in @@ -402,39 +402,39 @@ a warning and falls back to the implementation in @defproc[(sha1 [in input-port]) string?]{ Returns a 40-character string that represents the SHA-1 hash (in -hexadecimal notation) of the content from @scheme[in], consuming all -of the input from @scheme[in] until an end-of-file. +hexadecimal notation) of the content from @racket[in], consuming all +of the input from @racket[in] until an end-of-file. -The @scheme[sha1] function composes @scheme[bytes->hex-string] with +The @racket[sha1] function composes @racket[bytes->hex-string] with @racket[sha1-bytes].} @defproc[(sha1-bytes [in input-port]) bytes?]{ Returns a 20-byte byte string that represents the SHA-1 hash of the -content from @scheme[in], consuming all of the input from @scheme[in] +content from @racket[in], consuming all of the input from @racket[in] until an end-of-file.} @defproc[(bytes->hex-string [bstr bytes?]) string?]{ Converts the given byte string to a string representation, where each -byte in @scheme[bstr] is converted to its two-digit hexadecimal +byte in @racket[bstr] is converted to its two-digit hexadecimal representation in the resulting string.} @; ---------------------------------------------------------------------- @section{Implementation Notes} -For Windows, @schememodname[openssl] relies on @filepath{libeay32.dll} +For Windows, @racketmodname[openssl] relies on @filepath{libeay32.dll} and @filepath{ssleay32.dll}, where the DLLs are located in the same place as @filepath{libmzsch@nonterm{vers}.dll} (where @nonterm{vers} is either @tt{xxxxxxx} or a mangling of Racket's version number). The DLLs are distributed as part of Racket. -For Unix variants, @schememodname[openssl] relies on +For Unix variants, @racketmodname[openssl] relies on @filepath{libcryto.so} and @filepath{libssl.so}, which must be installed in a standard library location, or in a directory listed by @envvar{LD_LIBRARY_PATH}. -For Mac OS X, @schememodname[openssl] relies on +For Mac OS X, @racketmodname[openssl] relies on @filepath{libssl.dylib} and @filepath{libcryto.dylib}, which are part of the OS distribution for Mac OS X 10.2 and later. diff --git a/collects/parser-tools/parser-tools.scrbl b/collects/parser-tools/parser-tools.scrbl index ec875e5b38..d42bed3b6a 100644 --- a/collects/parser-tools/parser-tools.scrbl +++ b/collects/parser-tools/parser-tools.scrbl @@ -1,8 +1,5 @@ #lang scribble/doc -@(require scribble/manual - scribble/struct - scribble/xref - scribble/bnf +@(require scribble/manual scribble/struct scribble/xref scribble/bnf (for-label scheme/base scheme/contract parser-tools/lex @@ -53,107 +50,107 @@ style lexer and parser generators. (id datum ...)])]{ Produces a function that takes an input-port, matches the - @scheme[re]'s against the buffer, and returns the result of - executing the corresponding @scheme[action-expr]. + @racket[re]'s against the buffer, and returns the result of + executing the corresponding @racket[action-expr]. - @margin-note{The implementation of @schememodname[syntax-color/scheme-lexer] - contains a lexer for the @schememodname[scheme] language. + @margin-note{The implementation of @racketmodname[syntax-color/scheme-lexer] + contains a lexer for the @racketmodname[racket] language. In addition, files in the @filepath{examples} sub-directory of the @filepath{parser-tools} collection contain simpler example lexers.} - An @scheme[re] is matched as follows: + An @racket[re] is matched as follows: @itemize[ - @item{@scheme[id] --- expands to the named @deftech{lexer abbreviation}; - abbreviations are defined via @scheme[define-lex-abbrev] or supplied by modules - like @schememodname[parser-tools/lex-sre].} - @item{@scheme[string] --- matches the sequence of characters in @scheme[string].} - @item{@scheme[character] --- matches a literal @scheme[character].} - @item{@scheme[(repetition lo hi re)] --- matches @scheme[re] repeated between @scheme[lo] - and @scheme[hi] times, inclusive; @scheme[hi] can be @scheme[+inf.0] for unbounded repetitions.} - @item{@scheme[(union re ...)] --- matches if any of the sub-expressions match} - @item{@scheme[(intersection re ...)] --- matches if all of the @scheme[re]s match.} - @item{@scheme[(complement re)] --- matches anything that @scheme[re] does not.} - @item{@scheme[(concatenation re ...)] --- matches each @scheme[re] in succession.} - @item{@scheme[(char-range char char)] --- matches any character between the two (inclusive); - a single character string can be used as a @scheme[char].} - @item{@scheme[(char-complement re)] --- matches any character not matched by @scheme[re]. - The sub-expression must be a set of characters @scheme[re].} - @item{@scheme[(id datum ...)] --- expands the @deftech{lexer macro} named @scheme[id]; macros - are defined via @scheme[define-lex-trans].} + @item{@racket[id] --- expands to the named @deftech{lexer abbreviation}; + abbreviations are defined via @racket[define-lex-abbrev] or supplied by modules + like @racketmodname[parser-tools/lex-sre].} + @item{@racket[string] --- matches the sequence of characters in @racket[string].} + @item{@racket[character] --- matches a literal @racket[character].} + @item{@racket[(repetition lo hi re)] --- matches @racket[re] repeated between @racket[lo] + and @racket[hi] times, inclusive; @racket[hi] can be @racket[+inf.0] for unbounded repetitions.} + @item{@racket[(union re ...)] --- matches if any of the sub-expressions match} + @item{@racket[(intersection re ...)] --- matches if all of the @racket[re]s match.} + @item{@racket[(complement re)] --- matches anything that @racket[re] does not.} + @item{@racket[(concatenation re ...)] --- matches each @racket[re] in succession.} + @item{@racket[(char-range char char)] --- matches any character between the two (inclusive); + a single character string can be used as a @racket[char].} + @item{@racket[(char-complement re)] --- matches any character not matched by @racket[re]. + The sub-expression must be a set of characters @racket[re].} + @item{@racket[(id datum ...)] --- expands the @deftech{lexer macro} named @racket[id]; macros + are defined via @racket[define-lex-trans].} ] -Note that both @scheme[(concatenation)] and @scheme[""] match the -empty string, @scheme[(union)] matches nothing, -@scheme[(intersection)] matches any string, and -@scheme[(char-complement (union))] matches any single character. +Note that both @racket[(concatenation)] and @racket[""] match the +empty string, @racket[(union)] matches nothing, +@racket[(intersection)] matches any string, and +@racket[(char-complement (union))] matches any single character. The regular expression language is not designed to be used directly, but rather as a basis for a user-friendly notation written with regular expression macros. For example, -@schememodname[parser-tools/lex-sre] supplies operators from Olin -Shivers's SREs, and @schememodname[parser-tools/lex-plt-v200] supplies +@racketmodname[parser-tools/lex-sre] supplies operators from Olin +Shivers's SREs, and @racketmodname[parser-tools/lex-plt-v200] supplies (deprecated) operators from the previous version of this library. -Since those libraries provide operators whose names match other Scheme -bindings, such as @scheme[*] and @scheme[+], they normally must be +Since those libraries provide operators whose names match other Racket +bindings, such as @racket[*] and @racket[+], they normally must be imported using a prefix: -@schemeblock[ +@racketblock[ (require (prefix-in : parser-tools/lex-sre)) ] -The suggested prefix is @scheme[:], so that @scheme[:*] and -@scheme[:+] are imported. Of course, a prefix other than @scheme[:] -(such as @scheme[re-]) will work too. +The suggested prefix is @racket[:], so that @racket[:*] and +@racket[:+] are imported. Of course, a prefix other than @racket[:] +(such as @racket[re-]) will work too. Since negation is not a common operator on regular expressions, here -are a few examples, using @scheme[:] prefixed SRE syntax: +are a few examples, using @racket[:] prefixed SRE syntax: @itemize[ -@item{@schemeblock0[(complement "1")] +@item{@racketblock0[(complement "1")] - Matches all strings except the string @scheme["1"], including - @scheme["11"], @scheme["111"], @scheme["0"], @scheme["01"], - @scheme[""], and so on.} + Matches all strings except the string @racket["1"], including + @racket["11"], @racket["111"], @racket["0"], @racket["01"], + @racket[""], and so on.} -@item{@schemeblock0[(complement (:* "1"))] +@item{@racketblock0[(complement (:* "1"))] - Matches all strings that are not sequences of @scheme["1"], - including @scheme["0"], @scheme["00"], @scheme["11110"], - @scheme["0111"], @scheme["11001010"] and so on.} + Matches all strings that are not sequences of @racket["1"], + including @racket["0"], @racket["00"], @racket["11110"], + @racket["0111"], @racket["11001010"] and so on.} -@item{@schemeblock0[(:& (:: any-string "111" any-string) +@item{@racketblock0[(:& (:: any-string "111" any-string) (complement (:or (:: any-string "01") (:+ "1"))))] Matches all strings that have 3 consecutive ones, but not those that - end in @scheme["01"] and not those that are ones only. These - include @scheme["1110"], @scheme["0001000111"] and @scheme["0111"] - but not @scheme[""], @scheme["11"], @scheme["11101"], @scheme["111"] - and @scheme["11111"].} + end in @racket["01"] and not those that are ones only. These + include @racket["1110"], @racket["0001000111"] and @racket["0111"] + but not @racket[""], @racket["11"], @racket["11101"], @racket["111"] + and @racket["11111"].} -@item{@schemeblock0[(:: "/*" (complement (:: any-string "*/" any-string)) "*/")] +@item{@racketblock0[(:: "/*" (complement (:: any-string "*/" any-string)) "*/")] - Matches Java/C block comments. @scheme["/**/"], - @scheme["/******/"], @scheme["/*////*/"], @scheme["/*asg4*/"] and so - on. It does not match @scheme["/**/*/"], @scheme["/* */ */"] and so - on. @scheme[(:: any-string "*/" any-string)] matches any string - that has a @scheme["*/"] in is, so @scheme[(complement (:: any-string "*/" - any-string))] matches any string without a @scheme["*/"] in it.} + Matches Java/C block comments. @racket["/**/"], + @racket["/******/"], @racket["/*////*/"], @racket["/*asg4*/"] and so + on. It does not match @racket["/**/*/"], @racket["/* */ */"] and so + on. @racket[(:: any-string "*/" any-string)] matches any string + that has a @racket["*/"] in is, so @racket[(complement (:: any-string "*/" + any-string))] matches any string without a @racket["*/"] in it.} -@item{@schemeblock0[(:: "/*" (:* (complement "*/")) "*/")] +@item{@racketblock0[(:: "/*" (:* (complement "*/")) "*/")] - Matches any string that starts with @scheme["/*"] and ends with - @scheme["*/"], including @scheme["/* */ */ */"]. - @scheme[(complement "*/")] matches any string except @scheme["*/"]. - This includes @scheme["*"] and @scheme["/"] separately. Thus - @scheme[(:* (complement "*/"))] matches @scheme["*/"] by first - matching @scheme["*"] and then matching @scheme["/"]. Any other - string is matched directly by @scheme[(complement "*/")]. In other - words, @scheme[(:* (complement "xx"))] = @scheme[any-string]. It is - usually not correct to place a @scheme[:*] around a - @scheme[complement].} + Matches any string that starts with @racket["/*"] and ends with + @racket["*/"], including @racket["/* */ */ */"]. + @racket[(complement "*/")] matches any string except @racket["*/"]. + This includes @racket["*"] and @racket["/"] separately. Thus + @racket[(:* (complement "*/"))] matches @racket["*/"] by first + matching @racket["*"] and then matching @racket["/"]. Any other + string is matched directly by @racket[(complement "*/")]. In other + words, @racket[(:* (complement "xx"))] = @racket[any-string]. It is + usually not correct to place a @racket[:*] around a + @racket[complement].} ] @@ -161,18 +158,18 @@ are a few examples, using @scheme[:] prefixed SRE syntax: action: @itemize[ - @item{@scheme[start-pos] --- a @scheme[position] struct for the first character matched.} - @item{@scheme[end-pos] --- a @scheme[position] struct for the character after the last character in the match.} - @item{@scheme[lexeme] --- the matched string.} - @item{@scheme[input-port] --- the input-port being + @item{@racket[start-pos] --- a @racket[position] struct for the first character matched.} + @item{@racket[end-pos] --- a @racket[position] struct for the character after the last character in the match.} + @item{@racket[lexeme] --- the matched string.} + @item{@racket[input-port] --- the input-port being processed (this is useful for matching input with multiple lexers).} - @item{@scheme[(return-without-pos x)] is a function (continuation) that - immediately returns the value of @scheme[x] from the lexer. This useful + @item{@racket[(return-without-pos x)] is a function (continuation) that + immediately returns the value of @racket[x] from the lexer. This useful in a src-pos lexer to prevent the lexer from adding source information. For example: - @schemeblock[ + @racketblock[ (define get-token (lexer-src-pos ... @@ -182,43 +179,43 @@ are a few examples, using @scheme[:] prefixed SRE syntax: would wrap the source location information for the comment around the value of the recursive call. Using - @scheme[((comment) (return-without-pos (get-token input-port)))] + @racket[((comment) (return-without-pos (get-token input-port)))] will cause the value of the recursive call to be returned without wrapping position around it.} ] - The lexer raises an exception @scheme[(exn:read)] if none of the - regular expressions match the input. Hint: If @scheme[(any-char + The lexer raises an exception @racket[(exn:read)] if none of the + regular expressions match the input. Hint: If @racket[(any-char _custom-error-behavior)] is the last rule, then there will always - be a match, and @scheme[_custom-error-behavior] is executed to + be a match, and @racket[_custom-error-behavior] is executed to handle the error situation as desired, only consuming the first character from the input buffer. In addition to returning characters, input - ports can return @scheme[eof-object]s. Custom input ports can - also return a @scheme[special-comment] value to indicate a + ports can return @racket[eof-object]s. Custom input ports can + also return a @racket[special-comment] value to indicate a non-textual comment, or return another arbitrary value (a - special). The non-@scheme[re] @scheme[trigger] forms handle these + special). The non-@racket[re] @racket[trigger] forms handle these cases: @itemize[ - @item{The @scheme[(eof)] rule is matched when the input port - returns an @scheme[eof-object] value. If no @scheme[(eof)] - rule is present, the lexer returns the symbol @scheme['eof] - when the port returns an @scheme[eof-object] value.} + @item{The @racket[(eof)] rule is matched when the input port + returns an @racket[eof-object] value. If no @racket[(eof)] + rule is present, the lexer returns the symbol @racket['eof] + when the port returns an @racket[eof-object] value.} - @item{The @scheme[(special-comment)] rule is matched when the - input port returns a @scheme[special-comment] structure. If no - @scheme[special-comment] rule is present, the lexer + @item{The @racket[(special-comment)] rule is matched when the + input port returns a @racket[special-comment] structure. If no + @racket[special-comment] rule is present, the lexer automatically tries to return the next token from the input port.} - @item{The @scheme[(special)] rule is matched when the input + @item{The @racket[(special)] rule is matched when the input port returns a value other than a character, - @scheme[eof-object], or @scheme[special-comment] structure. If - no @scheme[(special)] rule is present, the lexer returns - @scheme[(void)].}] + @racket[eof-object], or @racket[special-comment] structure. If + no @racket[(special)] rule is present, the lexer returns + @racket[(void)].}] End-of-files, specials, special-comments and special-errors cannot be parsed via a rule using an ordinary regular expression @@ -226,27 +223,27 @@ are a few examples, using @scheme[:] prefixed SRE syntax: is possible in some situations). Since the lexer gets its source information from the port, use - @scheme[port-count-lines!] to enable the tracking of line and + @racket[port-count-lines!] to enable the tracking of line and column information. Otherwise, the line and column information - will return @scheme[#f]. + will return @racket[#f]. When peeking from the input port raises an exception (such as by an embedded XML editor with malformed syntax), the exception can be raised before all tokens preceding the exception have been returned. - Each time the scheme code for a lexer is compiled (e.g. when a - @filepath{.rkt} file containing a @scheme[lexer] form is loaded), + Each time the racket code for a lexer is compiled (e.g. when a + @filepath{.rkt} file containing a @racket[lexer] form is loaded), the lexer generator is run. To avoid this overhead place the lexer into a module and compile the module to a @filepath{.zo} bytecode file.} @defform[(lexer-src-pos (trigger action-expr) ...)]{ -Like @scheme[lexer], but for each @scheme[_action-result] produced by -an @scheme[action-expr], returns @scheme[(make-position-token +Like @racket[lexer], but for each @racket[_action-result] produced by +an @racket[action-expr], returns @racket[(make-position-token _action-result start-pos end-pos)] instead of simply -@scheme[_action-result].} +@racket[_action-result].} @deftogether[( @defidform[start-pos] @@ -256,30 +253,30 @@ _action-result start-pos end-pos)] instead of simply @defidform[return-without-pos] )]{ -Use of these names outside of a @scheme[lexer] action is a syntax +Use of these names outside of a @racket[lexer] action is a syntax error.} @defstruct[position ([offset exact-positive-integer?] [line exact-positive-integer?] [col exact-nonnegative-integer?])]{ - Instances of @scheme[position] are bound to @scheme[start-pos] and - @scheme[end-pos]. The @scheme[offset] field contains the offset of - the character in the input. The @scheme[line] field contains the - line number of the character. The @scheme[col] field contains the + Instances of @racket[position] are bound to @racket[start-pos] and + @racket[end-pos]. The @racket[offset] field contains the offset of + the character in the input. The @racket[line] field contains the + line number of the character. The @racket[col] field contains the offset in the current line.} @defstruct[position-token ([token any/c] [start-pos position?] [end-pos position?])]{ - Lexers created with @scheme[src-pos-lexers] return instances of @scheme[position-token].} + Lexers created with @racket[src-pos-lexers] return instances of @racket[position-token].} @defparam[file-path source any/c]{ A parameter that the lexer uses as the source location if it - raises a @scheme[exn:fail:rad] error. Setting this parameter allows + raises a @racket[exn:fail:rad] error. Setting this parameter allows DrRacket, for example, to open the file containing the error.} @@ -289,7 +286,7 @@ error.} @defform[(char-set string)]{ -A @tech{lexer macro} that matches any character in @scheme[string].} +A @tech{lexer macro} that matches any character in @racket[string].} @defidform[any-char]{A @tech{lexer abbreviation} that matches any character.} @@ -310,27 +307,27 @@ A @tech{lexer macro} that matches any character in @scheme[string].} @defidform[iso-control] )]{ -@tech{Lexer abbreviations} that match @scheme[char-alphabetic?] -characters, @scheme[char-lower-case?] characters, etc.} +@tech{Lexer abbreviations} that match @racket[char-alphabetic?] +characters, @racket[char-lower-case?] characters, etc.} @defform[(define-lex-abbrev id re)]{ Defines a @tech{lexer abbreviation} by associating a regular - expression to be used in place of the @scheme[id] in other + expression to be used in place of the @racket[id] in other regular expression. The definition of name has the same scoping properties as a other syntactic binding (e.g., it can be exported from a module).} @defform[(define-lex-abbrevs (id re) ...)]{ - - Like @scheme[define-lex-abbrev], but defines several @tech{lexer + + Like @racket[define-lex-abbrev], but defines several @tech{lexer abbreviations}.} @defform[(define-lex-trans id trans-expr)]{ - Defines a @tech{lexer macro}, where @scheme[trans-expr] produces a - transformer procedure that takes one argument. When @scheme[(id + Defines a @tech{lexer macro}, where @racket[trans-expr] produces a + transformer procedure that takes one argument. When @racket[(id _datum ...)] appears as a regular expression, it is replaced with the result of applying the transformer to the expression.} @@ -349,56 +346,56 @@ characters, @scheme[char-lower-case?] characters, etc.} @defform[(* re ...)]{ -Repetition of @scheme[re] sequence 0 or more times.} +Repetition of @racket[re] sequence 0 or more times.} @defform[(+ re ...)]{ -Repetition of @scheme[re] sequence 1 or more times.} +Repetition of @racket[re] sequence 1 or more times.} @defform[(? re ...)]{ -Zero or one occurrence of @scheme[re] sequence.} +Zero or one occurrence of @racket[re] sequence.} @defform[(= n re ...)]{ -Exactly @scheme[n] occurrences of @scheme[re] sequence, where -@scheme[n] must be a literal exact, non-negative number.} +Exactly @racket[n] occurrences of @racket[re] sequence, where +@racket[n] must be a literal exact, non-negative number.} @defform[(>= n re ...)]{ -At least @scheme[n] occurrences of @scheme[re] sequence, where -@scheme[n] must be a literal exact, non-negative number.} +At least @racket[n] occurrences of @racket[re] sequence, where +@racket[n] must be a literal exact, non-negative number.} @defform[(** n m re ...)]{ -Between @scheme[n] and @scheme[m] (inclusive) occurrences of -@scheme[re] sequence, where @scheme[n] must be a literal exact, -non-negative number, and @scheme[m] must be literally either -@scheme[#f], @scheme[+inf.0], or an exact, non-negative number; a -@scheme[#f] value for @scheme[m] is the same as @scheme[+inf.0].} +Between @racket[n] and @racket[m] (inclusive) occurrences of +@racket[re] sequence, where @racket[n] must be a literal exact, +non-negative number, and @racket[m] must be literally either +@racket[#f], @racket[+inf.0], or an exact, non-negative number; a +@racket[#f] value for @racket[m] is the same as @racket[+inf.0].} @defform[(or re ...)]{ -Same as @scheme[(union re ...)].} +Same as @racket[(union re ...)].} @deftogether[( @defform[(: re ...)] @defform[(seq re ...)] )]{ -Both forms concatenate the @scheme[re]s.} +Both forms concatenate the @racket[re]s.} @defform[(& re ...)]{ -Intersects the @scheme[re]s.} +Intersects the @racket[re]s.} @defform[(- re ...)]{ -The set difference of the @scheme[re]s.} +The set difference of the @racket[re]s.} @defform[(~ re ...)]{ -Character-set complement, which each @scheme[re] must match exactly +Character-set complement, which each @racket[re] must match exactly one character.} @defform[(/ char-or-string ...)]{ @@ -421,11 +418,11 @@ characters.} (begin (require (for-label parser-tools/lex-plt-v200)) -@t{The @schememodname[parser-tools/lex-plt-v200] module re-exports - @scheme[*], @scheme[+], @scheme[?], and @scheme[&] from - @schememodname[parser-tools/lex-sre]. It also re-exports - @scheme[:or] as @scheme[:], @scheme[::] as @scheme[|@|], @scheme[:~] - as @scheme[^], and @scheme[:/] as @scheme[-].} +@t{The @racketmodname[parser-tools/lex-plt-v200] module re-exports + @racket[*], @racket[+], @racket[?], and @racket[&] from + @racketmodname[parser-tools/lex-sre]. It also re-exports + @racket[:or] as @racket[:], @racket[::] as @racket[|@|], @racket[:~] + as @racket[^], and @racket[:/] as @racket[-].} @defform[(epsilon)]{ @@ -433,7 +430,7 @@ A @tech{lexer macro} that matches an empty sequence.} @defform[(~ re ...)]{ -The same as @scheme[(complement re ...)].}))) +The same as @racket[(complement re ...)].}))) @(lex-v200-doc) @@ -441,30 +438,30 @@ The same as @scheme[(complement re ...)].}))) @subsection{Tokens} -Each @scheme[_action-expr] in a @scheme[lexer] form can produce any +Each @racket[_action-expr] in a @racket[lexer] form can produce any kind of value, but for many purposes, producing a @deftech{token} value is useful. Tokens are usually necessary for inter-operating with -a parser generated by @scheme[parser-tools/parser], but tokens not be -the right choice when using @scheme[lexer] in other situations. +a parser generated by @racket[parser-tools/parser], but tokens not be +the right choice when using @racket[lexer] in other situations. @defform[(define-tokens group-id (token-id ...))]{ - Binds @scheme[group-id] to the group of tokens being defined. For - each @scheme[token-id], a function - @schemeidfont{token-}@scheme[token-id] is created that takes any - value and puts it in a token record specific to @scheme[token-id]. - The token value is inspected using @scheme[token-id] and - @scheme[token-value]. + Binds @racket[group-id] to the group of tokens being defined. For + each @racket[token-id], a function + @racketidfont{token-}@racket[token-id] is created that takes any + value and puts it in a token record specific to @racket[token-id]. + The token value is inspected using @racket[token-id] and + @racket[token-value]. - A token cannot be named @schemeidfont{error}, since - @schemeidfont{error} it has special use in the parser.} + A token cannot be named @racketidfont{error}, since + @racketidfont{error} it has special use in the parser.} @defform[(define-empty-tokens group-id (token-id ...) )]{ - Like @scheme[define-tokens], except a each token constructor - @schemeidfont{token-}@scheme[token-id] takes no arguments and returns - @scheme[(@#,scheme[quote] token-id)].} + Like @racket[define-tokens], except a each token constructor + @racketidfont{token-}@racket[token-id] takes no arguments and returns + @racket[(@#,racket[quote] token-id)].} @defproc[(token-name [t (or/c token? symbol?)]) symbol?]{ @@ -476,13 +473,13 @@ the right choice when using @scheme[lexer] in other situations. @defproc[(token-value [t (or/c token? symbol?)]) any/c]{ Returns the value of a token that is represented either by a symbol - or a token structure, returning @scheme[#f] for a symbol token.} + or a token structure, returning @racket[#f] for a symbol token.} @defproc[(token? [v any/c]) boolean?]{ - Returns @scheme[#t] if @scheme[val] is a - token structure, @scheme[#f] otherwise.} + Returns @racket[#t] if @racket[val] is a + token structure, @racket[#f] otherwise.} @; ---------------------------------------------------------------------- @@ -502,7 +499,7 @@ the right choice when using @scheme[lexer] in other situations. (tokens group-id ...) (start non-terminal-id ...) (end token-id ...) - (@#,schemeidfont{error} expr) + (@#,racketidfont{error} expr) (precs (assoc token-id ...) ...) (src-pos) (suppress) @@ -518,63 +515,63 @@ the right choice when using @scheme[lexer] in other situations. @itemize[ - @item{@schemeblock0[(grammar (non-terminal-id + @item{@racketblock0[(grammar (non-terminal-id ((grammar-id ...) maybe-prec expr) ...) ...)] - Declares the grammar to be parsed. Each @scheme[grammar-id] can - be a @scheme[token-id] from a @scheme[group-id] named in a - @scheme[tokens] declaration, or it can be a - @scheme[non-terminal-id] declared in the @scheme[grammar] - declaration. The optional @scheme[prec] declaration works with - the @scheme[precs] declaration. The @scheme[expr] is a + Declares the grammar to be parsed. Each @racket[grammar-id] can + be a @racket[token-id] from a @racket[group-id] named in a + @racket[tokens] declaration, or it can be a + @racket[non-terminal-id] declared in the @racket[grammar] + declaration. The optional @racket[prec] declaration works with + the @racket[precs] declaration. The @racket[expr] is a ``semantic action,'' which is evaluated when the input is found to match its corresponding production. - Each action is scheme code that has the same scope as its - parser's definition, except that the variables @scheme[$1], ..., - @schemeidfont{$}@math{i} are bound, where @math{i} is the number - of @scheme[grammar-id]s in the corresponding production. Each - @schemeidfont{$}@math{k} is bound to the result of the action + Each action is Racket code that has the same scope as its + parser's definition, except that the variables @racket[$1], ..., + @racketidfont{$}@math{i} are bound, where @math{i} is the number + of @racket[grammar-id]s in the corresponding production. Each + @racketidfont{$}@math{k} is bound to the result of the action for the @math{k}@superscript{th} grammar symbol on the right of the production, if that grammar symbol is a non-terminal, or the value stored in the token if the grammar symbol is a terminal. - If the @scheme[src-pos] option is present in the parser, then - variables @scheme[$1-start-pos], ..., - @schemeidfont{$}@math{i}@schemeidfont{-start-pos} and - @scheme[$1-end-pos], ..., - @schemeidfont{$}@math{i}@schemeidfont{-end-pos} and are also + If the @racket[src-pos] option is present in the parser, then + variables @racket[$1-start-pos], ..., + @racketidfont{$}@math{i}@racketidfont{-start-pos} and + @racket[$1-end-pos], ..., + @racketidfont{$}@math{i}@racketidfont{-end-pos} and are also available, and they refer to the position structures corresponding to the start and end of the corresponding - @scheme[grammar-symbol]. Grammar symbols defined as empty-tokens - have no @schemeidfont{$}@math{k} associated, but do have - @schemeidfont{$}@math{k}@schemeidfont{-start-pos} and - @schemeidfont{$}@math{k}@schemeidfont{-end-pos}. - Also @schemeidfont{$n-start-pos} and @schemeidfont{$n-end-pos} + @racket[grammar-symbol]. Grammar symbols defined as empty-tokens + have no @racketidfont{$}@math{k} associated, but do have + @racketidfont{$}@math{k}@racketidfont{-start-pos} and + @racketidfont{$}@math{k}@racketidfont{-end-pos}. + Also @racketidfont{$n-start-pos} and @racketidfont{$n-end-pos} are bound to the largest start and end positions, (i.e., - @schemeidfont{$}@math{i}@schemeidfont{-start-pos} and - @schemeidfont{$}@math{i}@schemeidfont{-end-pos}). + @racketidfont{$}@math{i}@racketidfont{-start-pos} and + @racketidfont{$}@math{i}@racketidfont{-end-pos}). All of the productions for a given non-terminal must be grouped - with it. That is, no @scheme[non-terminal-id] may appear twice + with it. That is, no @racket[non-terminal-id] may appear twice on the left hand side in a parser.} - @item{@scheme[(tokens group-id ...)] + @item{@racket[(tokens group-id ...)] Declares that all of the tokens defined in each - @scheme[group-id]---as bound by @scheme[define-tokens] or - @scheme[define-empty-tokens]---can be used by the parser in the - @scheme[grammar] declaration.} + @racket[group-id]---as bound by @racket[define-tokens] or + @racket[define-empty-tokens]---can be used by the parser in the + @racket[grammar] declaration.} - @item{@scheme[(start non-terminal-id ...)] + @item{@racket[(start non-terminal-id ...)] Declares a list of starting non-terminals for the grammar.} - @item{@scheme[(end token-id ...)] + @item{@racket[(end token-id ...)] Specifies a set of tokens from which some member must follow any valid parse. For example, an EOF token would be specified for a @@ -582,53 +579,53 @@ the right choice when using @scheme[lexer] in other situations. that parses entire lines individually.} - @item{@scheme[(@#,schemeidfont{error} expr)] + @item{@racket[(@#,racketidfont{error} expr)] - The @scheme[expr] should evaluate to a function which will be + The @racket[expr] should evaluate to a function which will be executed for its side-effect whenever the parser encounters an error. - If the @scheme[src-pos] declaration is present, the function + If the @racket[src-pos] declaration is present, the function should accept 5 arguments,: - @schemeblock[(lambda (tok-ok? tok-name tok-value _start-pos _end-pos) + @racketblock[(lambda (tok-ok? tok-name tok-value _start-pos _end-pos) ....)] Otherwise it should accept 3: - @schemeblock[(lambda (tok-ok? tok-name tok-value) + @racketblock[(lambda (tok-ok? tok-name tok-value) ....)] - The first argument will be @scheme[#f] if and only if the error + The first argument will be @racket[#f] if and only if the error is that an invalid token was received. The second and third arguments will be the name and the value of the token at which the error was detected. The fourth and fifth arguments, if present, provide the source positions of that token.} - @item{@scheme[(precs (assoc token-id ...) ...)] + @item{@racket[(precs (assoc token-id ...) ...)] @italic{OPTIONAL} Precedence declarations to resolve shift/reduce and reduce/reduce conflicts as in @exec{yacc}/@exec{bison}. An - @scheme[assoc] must be one of @scheme[left], @scheme[right] or - @scheme[nonassoc]. States with multiple shift/reduce or + @racket[assoc] must be one of @racket[left], @racket[right] or + @racket[nonassoc]. States with multiple shift/reduce or reduce/reduce conflicts (or some combination thereof) are not resolved with precedence.} - @item{@scheme[(src-pos)] @italic{OPTIONAL} + @item{@racket[(src-pos)] @italic{OPTIONAL} Causes the generated parser to expect input in the form - @scheme[(make-position-token _token _start-pos _end-pos)] instead - of simply @scheme[_token]. Include this option when using the - parser with a lexer generated with @scheme[lexer-src-pos].} + @racket[(make-position-token _token _start-pos _end-pos)] instead + of simply @racket[_token]. Include this option when using the + parser with a lexer generated with @racket[lexer-src-pos].} - @item{@scheme[(debug filename)] @italic{OPTIONAL} + @item{@racket[(debug filename)] @italic{OPTIONAL} Causes the parser generator to write the LALR table to the file - named @scheme[filename] (unless the file exists), where - @scheme[filename] is a literal string. Additionally, if a debug + named @racket[filename] (unless the file exists), where + @racket[filename] is a literal string. Additionally, if a debug file is specified, when a running generated parser encounters a parse error on some input file, after the user specified error expression returns, the complete parse stack is printed to @@ -637,43 +634,43 @@ the right choice when using @scheme[lexer] in other situations. the LALR table file.} - @item{@scheme[(yacc-output filename)] @italic{OPTIONAL} + @item{@racket[(yacc-output filename)] @italic{OPTIONAL} Causes the parser generator to write a grammar file in approximately the syntax of @exec{yacc}/@exec{bison}. The file - might not be a valid @exec{yacc} file, because the scheme + might not be a valid @exec{yacc} file, because the Racket grammar can use symbols that are invalid in C.} - @item{@scheme[(suppress)] @italic{OPTIONAL} + @item{@racket[(suppress)] @italic{OPTIONAL} Causes the parser generator not to report shift/reduce or reduce/reduce conflicts.} ] - The result of a @scheme[parser] expression with one @scheme[start] - non-terminal is a function, @scheme[_parse], that takes one + The result of a @racket[parser] expression with one @racket[start] + non-terminal is a function, @racket[_parse], that takes one argument. This argument must be a zero argument function, - @scheme[_gen], that produces successive tokens of the input each - time it is called. If desired, the @scheme[_gen] may return + @racket[_gen], that produces successive tokens of the input each + time it is called. If desired, the @racket[_gen] may return symbols instead of tokens, and the parser will treat symbols as - tokens of the corresponding name (with @scheme[#f] as a value, so + tokens of the corresponding name (with @racket[#f] as a value, so it is usual to return symbols only in the case of empty tokens). - The @scheme[_parse] function returns the value associated with the + The @racket[_parse] function returns the value associated with the parse tree by the semantic actions. If the parser encounters an error, after invoking the supplied error function, it will try to use error productions to continue parsing. If it cannot, it - raises @scheme[exn:fail:read]. + raises @racket[exn:fail:read]. - If multiple non-terminals are provided in @scheme[start], the - @scheme[parser] expression produces a list of parsing functions, + If multiple non-terminals are provided in @racket[start], the + @racket[parser] expression produces a list of parsing functions, one for each non-terminal in the same order. Each parsing function is like the result of a parser expression with only one - @scheme[start] non-terminal, + @racket[start] non-terminal, - Each time the scheme code for a @scheme[parser] is compiled - (e.g. when a @filepath{.rkt} file containing a @scheme[parser] form + Each time the Racket code for a @racket[parser] is compiled + (e.g. when a @filepath{.rkt} file containing a @racket[parser] form is loaded), the parser generator is run. To avoid this overhead place the parser into a module and compile the module to a @filepath{.zo} bytecode file.} @@ -686,12 +683,12 @@ the right choice when using @scheme[lexer] in other situations. @defproc[(trans [file path-string?]) any/c]{ -Reads a C @exec{yacc}/@exec{bison} grammar from @scheme[file] and -produces an s-expression that represents a scheme parser for use with -@scheme[parser]. +Reads a C @exec{yacc}/@exec{bison} grammar from @racket[file] and +produces an s-expression that represents a Racket parser for use with +@racket[parser]. This function is intended to assist in the manual conversion of -grammars for use with @scheme[parser], and not as a fully automatic +grammars for use with @racket[parser], and not as a fully automatic conversion tool. It is not entirely robust. For example, if the C actions in the original grammar have nested blocks, the tool will fail. diff --git a/collects/picturing-programs/picturing-programs.scrbl b/collects/picturing-programs/picturing-programs.scrbl index 9f053a2ab6..8dd721b861 100644 --- a/collects/picturing-programs/picturing-programs.scrbl +++ b/collects/picturing-programs/picturing-programs.scrbl @@ -269,7 +269,7 @@ size and shape. For example, ; lose-red : num(x) num(y) color -> color (define (lose-red x y old-color) (make-color 0 (color-green old-color) (color-blue old-color))) - + (map-image lose-red my-picture)}| produces a copy of @racket[my-picture] with all the red leached out, leaving only the blue and green components. @@ -289,7 +289,7 @@ Another example: (make-color (min (* 3 x) 255) 0 (min (* 3 y) 255))) - + (map-image apply-gradient my-picture)}| produces a picture the size of @racket[my-picture]'s bounding rectangle, with a smooth color gradient with red increasing from left to @@ -463,7 +463,7 @@ its output into a string, which is returned. Especially useful for testing: ; ask : string -> prints output, waits for text input, returns it (define (ask question) (begin (display question) - (read))) + (read))) ; greet : nothing -> prints output, waits for text input, prints output (define (greet) (local [(define name (ask "What is your name?"))] diff --git a/collects/plai/scribblings/plai.scrbl b/collects/plai/scribblings/plai.scrbl index 95b12f0da9..64e0a39418 100644 --- a/collects/plai/scribblings/plai.scrbl +++ b/collects/plai/scribblings/plai.scrbl @@ -12,7 +12,9 @@ test test/pred test/exn test/regexp abridged-test-output plai-catch-test-exn - halt-on-errors print-only-errors test-inexact-epsilon plai-ignore-exn-strings plai-all-test-results) + halt-on-errors print-only-errors + test-inexact-epsilon plai-ignore-exn-strings + plai-all-test-results) (only-in plai/collector root? heap-size @@ -36,9 +38,6 @@ test/value=? printf))) -@(define-syntax-rule (schememodlang lang) - (scheme #,(hash-lang) lang)) - @(define PLAI-LANG "PLAI Scheme") @(define COLLECT-LANG "GC Collector Scheme") @(define MUTATE-LANG "GC Mutator Scheme") @@ -62,139 +61,150 @@ This package contains the following languages: @(define scheme-guide '(lib "scribblings/reference/reference.scrbl")) -@PLAI-LANG is derived from the @schememodname[scheme] langauge. In addition, it includes -the @scheme[define-type] and @scheme[type-case] forms and testing +@PLAI-LANG is derived from the @racketmodname[scheme] langauge. In addition, +it includes the @racket[define-type] and @racket[type-case] forms and testing support. -@subsection[#:tag "define-type"]{Defining Types: @scheme[define-type]} +@subsection[#:tag "define-type"]{Defining Types: @racket[define-type]} @defform/subs[(define-type type-id variant ...) ([variant (variant-id (field-id contract-expr) ...)])]{ -Defines the datatype @scheme[_type-id]. A constructor @scheme[_variant-id] is defined for each variant. -Each constructor takes an argument for each field of its variant. +Defines the datatype @racket[_type-id]. A constructor @racket[_variant-id] is +defined for each variant. Each constructor takes an argument for each field of +its variant. -The value of each field is checked by its associated @scheme[_contract-expr]. A @scheme[_contract-expr] may be an -arbitrary predicate or a contract. +The value of each field is checked by its associated @racket[_contract-expr]. +A @racket[_contract-expr] may be an arbitrary predicate or a contract. -In addition to the contructors, a @scheme[define-type] expression also defines: +In addition to the contructors, a @racket[define-type] expression also defines: -@itemize{ +@itemize[ - @item{a predicate @scheme[_type-id?] that returns @scheme[true] for instances of the - datatype, and @scheme[false] for any other value,} + @item{a predicate @racket[_type-id?] that returns @racket[true] for instances + of the datatype, and @racket[false] for any other value,} - @item{for each variant, a predicate @scheme[_variant-id?] that returns @scheme[true] when applied to a value of the - same variant and @scheme[false] for any other value,} - - @item{for each field of each variant, an accessor @scheme[_variant-id-field-id] that returns the value of the - field, and} - - @item{for each field of each variant, a mutator @scheme[_set-variant-id-field-id!] that set the value of the - field.} -} -} + @item{for each variant, a predicate @racket[_variant-id?] that returns + @racket[true] when applied to a value of the same variant and + @racket[false] for any other value,} -@subsection[#:tag "type-case"]{Deconstructing Data Structures: @scheme[type-case]} + @item{for each field of each variant, an accessor + @racket[_variant-id-field-id] that returns the value of the field, and} -@defform/subs[(type-case datatype-id expr + @item{for each field of each variant, a mutator + @racket[_set-variant-id-field-id!] that set the value of the field.} +]} + +@subsection[#:tag "type-case"]{Deconstructing Data Structures: @racket[type-case]} + +@defform/subs[(type-case datatype-id expr branch ...) - + ([branch (variant-id (field-id ...) result-expr ...) (else result-expr ...)])]{ - -Branches on the datatype instance produced by @scheme[_expr], which must be an instance of @scheme[_datatype-id] -(previously defined with @scheme[define-type]) Each @scheme[_branch] extracts the values of the fields, and binds them -to @scheme[_field-id ...]. -If a branch is not specified for each variant, you may use an @scheme[else] branch to create a catch-all branch. An -@scheme[else] branch must be the last branch in the sequence of branches. -@scheme[type-case] signals a compile-time error if all variants are not covered and the @scheme[else] branch is -missing. Similarly, @scheme[type-case] signals a compile-time error if an @scheme[else] branch is unreachable because -a branch exists for all variants. +Branches on the datatype instance produced by @racket[_expr], which must be an +instance of @racket[_datatype-id] (previously defined with +@racket[define-type]) Each @racket[_branch] extracts the values of the fields, +and binds them to @racket[_field-id ...]. + +If a branch is not specified for each variant, you may use an @racket[else] +branch to create a catch-all branch. An @racket[else] branch must be the last +branch in the sequence of branches. @racket[type-case] signals a compile-time +error if all variants are not covered and the @racket[else] branch is missing. +Similarly, @racket[type-case] signals a compile-time error if an @racket[else] +branch is unreachable because a branch exists for all variants. } - + @subsection[#:tag "testing"]{Testing Infrastructure} PLAI Scheme provides the following syntactic forms for testing. @defform/subs[(test result-expr expected-expr)()]{ -If @scheme[_result-expr] and @scheme[_expected-expr] evaluate to the same value, @scheme[_result-value], the test prints +If @racket[_result-expr] and @racket[_expected-expr] evaluate to the same +value, @racket[_result-value], the test prints -@schemeresultfont{(good result-expr result-value expected-value location)}. +@racketresultfont{(good result-expr result-value expected-value location)}. If they do not evaluate to the same value, the test prints -@schemeresultfont{(bad result-expr result-value expected-value location)}. +@racketresultfont{(bad result-expr result-value expected-value location)}. -If evaluating @scheme[_result-expr] signals an error, the test prints +If evaluating @racket[_result-expr] signals an error, the test prints -@schemeresultfont{(exception result-expr exception-message location)} +@racketresultfont{(exception result-expr exception-message location)} -If evaluating @scheme[_expected-expr] signals an error, the test prints +If evaluating @racket[_expected-expr] signals an error, the test prints -@schemeresultfont{(pred-exception result-expr exception-message location)} +@racketresultfont{(pred-exception result-expr exception-message location)} } @defform/subs[(test/pred result-expr pred?)()]{ -Similar to @scheme[test], but instead of supplying an expected value, the predicate @scheme[_pred?] is applied to -@scheme[_result-expr]. +Similar to @racket[test], but instead of supplying an expected value, the +predicate @racket[_pred?] is applied to @racket[_result-expr]. -If evaluating @scheme[_pred?] signals an error, the test prints +If evaluating @racket[_pred?] signals an error, the test prints -@schemeresultfont{(pred-exception result-expr exception-message location)} +@racketresultfont{(pred-exception result-expr exception-message location)} -The syntax of @scheme[_pred?] is considered @scheme[_expected-value] for the purposes of test reporting. +The syntax of @racket[_pred?] is considered @racket[_expected-value] for the +purposes of test reporting. } @defthing[error procedure?]{ - Like @schememodname[scheme]'s @scheme[scheme:error], - but generates exceptions that are caught by @scheme[test/exn]. + Like @racketmodname[scheme]'s @racket[scheme:error], + but generates exceptions that are caught by @racket[test/exn]. } @defform/subs[(test/exn result-expr error-message)()]{ -This test succeeds if the expression evaluates to a call to @scheme[error]. Moreover, the error message contained in the -exception must contain the string @scheme[_error-message]. Note that @scheme[test/exn] only succeeds if the exception was -explicitly raised by the user. +This test succeeds if the expression evaluates to a call to +@racket[error]. Moreover, the error message contained in the exception must +contain the string @racket[_error-message]. Note that @racket[test/exn] only +succeeds if the exception was explicitly raised by the user. For example, the following test succeeds: -@(schemeblock (test/exn (error "/: division by zero") "by zero")) - -The error message is @scheme{/: division by zero}, and @scheme{by zero} is a substring of the error message. However, -the following test fails: +@racketblock[(test/exn (error "/: division by zero") "by zero")] -@(schemeblock (test/exn (/ 25 0) "by zero")) +The error message is @racket["/: division by zero"], and @racket["by zero"] is +a substring of the error message. However, the following test fails: -Although the expression raises an exception and the error string contains @scheme{by zero}, since the error was not -explicitly raised by user-written code, the test fails. +@racketblock[(test/exn (/ 25 0) "by zero")] -The evaluation of @scheme[_error-message] is considered @scheme[_expected-value] for the purposes of test reporting. +Although the expression raises an exception and the error string contains +@racket["by zero"], since the error was not explicitly raised by user-written +code, the test fails. + +The evaluation of @racket[_error-message] is considered +@racket[_expected-value] for the purposes of test reporting. } @defform/subs[(test/regexp result-expr error-message-regexp)()]{ -This test is similar to @scheme[test/exn],but the error message is matched against a regular expression instead. - -The evaluation of @scheme[_error-message-regexp] is considered @scheme[_expected-value] for the purposes of test reporting. +This test is similar to @racket[test/exn],but the error message is matched +against a regular expression instead. + +The evaluation of @racket[_error-message-regexp] is considered +@racket[_expected-value] for the purposes of test reporting. } @subsubsection{Test Flags} @defproc[(abridged-test-output (abridge? boolean? false)) void?]{ -When this flag is set to @scheme[true], the test forms never prints @scheme[_result-expr] or @scheme[_location]. - +When this flag is set to @racket[true], the test forms never prints +@racket[_result-expr] or @racket[_location]. + } @defproc[(plai-catch-test-exn (catch? boolean? true)) void?]{ -When this flag is set to @scheme[true], exceptions from tests will be caught. +When this flag is set to @racket[true], exceptions from tests will be caught. By default, exceptions are caught. } @@ -202,83 +212,92 @@ By default, exceptions are caught. @defproc[(halt-on-errors (halt? boolean? true)) void?]{ -This flag determines whether the program immediately halts when a test fails. By default, programs do not halt on -failures. +This flag determines whether the program immediately halts when a test fails. +By default, programs do not halt on failures. } @defproc[(print-only-errors (print? boolean? true)) void?]{ -When this flag is set to @scheme[true], only tests that fail will be printed. +When this flag is set to @racket[true], only tests that fail will be printed. By default, the results of all tests are printed. } @defproc[(test-inexact-epsilon (epsilon number?)) void?]{ -When testing inexact values for equality, @scheme[test] permits them to differ by @scheme[_epsilon]. The -default value of @scheme[_epsilon] is @scheme[0.01]. +When testing inexact values for equality, @racket[test] permits them to differ +by @racket[_epsilon]. The default value of @racket[_epsilon] is @racket[0.01]. } @defproc[(plai-ignore-exn-strings (ignore? boolean?)) void?]{ -If this flag is set to @scheme[true], when testing for exceptions with @scheme[test/exn] and @scheme[test/regexp], -the message of the exception is ignored. By default, @scheme[test/exn] and @scheme[test/regexp] only succeed when the -message of the exception matches the supplied string or regular expression. +If this flag is set to @racket[true], when testing for exceptions with +@racket[test/exn] and @racket[test/regexp], the message of the exception is +ignored. By default, @racket[test/exn] and @racket[test/regexp] only succeed +when the message of the exception matches the supplied string or regular +expression. } @defidform[plai-all-test-results]{ -This variable is the list of all tests that have been run so far, with the most recent test at the head. +This variable is the list of all tests that have been run so far, with the most +recent test at the head. } - -@section[#:tag "collector"]{@COLLECT-LANG} + +@section[#:tag "collector"]{@COLLECT-LANG} @defmodulelang[plai/collector] -@COLLECT-LANG is based on @seclink["plai-scheme"]{PLAI Scheme}. It provides additional procedures and -syntax for writing garbage collectors. +@COLLECT-LANG is based on @seclink["plai-scheme"]{PLAI Scheme}. It provides +additional procedures and syntax for writing garbage collectors. @subsection{Garbage Collector Interface} -The @COLLECT-LANG language provides the following functions that provide access to the heap and root set: +The @COLLECT-LANG language provides the following functions that provide access +to the heap and root set: @defproc[(heap-size) exact-nonnegative-integer?]{ -Returns the size of the heap. The size of the heap is specified by the mutator that uses the garbage collector. -See @scheme[allocator-setup] for more information. + +Returns the size of the heap. The size of the heap is specified by the mutator +that uses the garbage collector. See @racket[allocator-setup] for more +information. } @defproc[(location? [v any/c]) boolean?]{ -Determines if @scheme[v] is an integer between @scheme[0] and @scheme[(- (heap-size) 1)] inclusive. + Determines if @racket[v] is an integer between @racket[0] and + @racket[(- (heap-size) 1)] inclusive. } @defproc[(root? [v any/c]) boolean?]{ -Determines if @scheme[v] is a root. +Determines if @racket[v] is a root. } @defproc[(heap-value? [v any/c]) boolean?]{ - A value that may be stored on the heap. Roughly corresponds to the contract @scheme[(or/c boolean? number? procedure? symbol? empty?)]. + A value that may be stored on the heap. Roughly corresponds to the contract + @racket[(or/c boolean? number? procedure? symbol? empty?)]. } @defproc[(heap-set! (loc location?) (val heap-value?)) void?]{ - Sets the value at @scheme[_loc] to @scheme[_val]. + Sets the value at @racket[_loc] to @racket[_val]. } @defproc[(heap-ref (loc location?)) heap-value?]{ - Returns the value at @scheme[_loc]. + Returns the value at @racket[_loc]. } @defform/subs[(get-root-set id ...)()]{ - Returns the current roots as a list. Local roots are created for the identifiers @scheme[_id] as well. + Returns the current roots as a list. Local roots are created for the + identifiers @racket[_id] as well. } @defproc[(read-root (root root?)) location?]{ - Returns the location of @scheme[_root]. + Returns the location of @racket[_root]. } @defproc[(set-root! (root root?) (loc location?)) void?]{ @@ -286,14 +305,16 @@ Determines if @scheme[v] is a root. } @defproc[(procedure-roots (proc procedure?)) (listof root?)]{ - Given a closure stored on the heap, returns a list of the roots reachable from the closure's environment. If - @scheme[_proc] is not reachable, the empty list is returned. + Given a closure stored on the heap, returns a list of the roots reachable + from the closure's environment. If @racket[_proc] is not reachable, the + empty list is returned. } @defform[(with-heap heap expr ...) #:contracts ([heap (vectorof heap-value?)])]{ - Evaluates @scheme[(begin expr ...)] in the context of @scheme[heap]. Useful in tests: - @schemeblock[ + Evaluates @racket[(begin expr ...)] in the context of @racket[heap]. Useful in + tests: + @racketblock[ (test (with-heap (make-vector 20) (init-allocator) (gc:deref (gc:alloc-flat 2))) @@ -308,74 +329,83 @@ A garbage collector must define the following functions: @defproc[(init-allocator) void?]{ -@scheme[init-allocator] is called before all other procedures by a mutator. Place any requisite initialization code -here. - +@racket[init-allocator] is called before all other procedures by a +mutator. Place any requisite initialization code here. + } @defproc[(gc:deref (loc location?)) heap-value?]{ -Given the location of a flat Scheme value, this procedure should return that value. If the location does not hold -a flat value, this function should signal an error. +Given the location of a flat Scheme value, this procedure should return that +value. If the location does not hold a flat value, this function should signal +an error. } @defproc[(gc:alloc-flat (val heap-value?)) location?]{ -This procedure should allocate a flat Scheme value (number, symbol, boolean, closure or empty list) on the heap, -returning its location (a number). The value should occupy a single heap cell, though you may use additional space to -store a tag, etc. You are also welcome to pre-allocate common constants (e.g., the empty list). This procedure may need -to perform a garbage-collection. If there is still insufficient space, it should signal an error. +This procedure should allocate a flat Scheme value (number, symbol, boolean, +closure or empty list) on the heap, returning its location (a number). The +value should occupy a single heap cell, though you may use additional space to +store a tag, etc. You are also welcome to pre-allocate common constants (e.g., +the empty list). This procedure may need to perform a garbage-collection. If +there is still insufficient space, it should signal an error. -Note that closures are flat values. The environment of a closure is internally managed, but contains -references to values on the heap. Therefore, during garbage collection, the environment of reachable closures must be -updated. The language exposes the environment via the @scheme[procedure-roots] function. +Note that closures are flat values. The environment of a closure is internally +managed, but contains references to values on the heap. Therefore, during +garbage collection, the environment of reachable closures must be updated. The +language exposes the environment via the @racket[procedure-roots] function. } @defproc[(gc:cons (first location?) (rest location?)) location?]{ -Given the location of the @scheme[_first] and @scheme[_rest] values, this procedure must allocate a cons cell on the -heap. If there is insufficient space to allocate the cons cell, it should signal an error. +Given the location of the @racket[_first] and @racket[_rest] values, this +procedure must allocate a cons cell on the heap. If there is insufficient +space to allocate the cons cell, it should signal an error. } @defproc[(gc:first (cons-cell location?)) location?]{ -If the given location refers to a cons cell, this should return the first field. Otherwise, it should signal an error. +If the given location refers to a cons cell, this should return the first +field. Otherwise, it should signal an error. } @defproc[(gc:rest (cons-cell location?)) location?]{ -If the given location refers to a cons cell, this should return the rest field. Otherwise, it should signal an error. +If the given location refers to a cons cell, this should return the rest +field. Otherwise, it should signal an error. } @defproc[(gc:set-first! (cons-cell location?) (first-value location?)) void?]{ -If @scheme[_cons-cell] refers to a cons cell, set the head of the cons cell to -@scheme[_first-value]. Otherwise, signal an error. +If @racket[_cons-cell] refers to a cons cell, set the head of the cons cell to +@racket[_first-value]. Otherwise, signal an error. } @defproc[(gc:set-rest! (cons-cell location?) (rest-value location?)) void?]{ -If @scheme[_cons-cell] refers to a cons cell, set the tail of the cons cell to -@scheme[_rest-value]. Otherwise, signal an error. +If @racket[_cons-cell] refers to a cons cell, set the tail of the cons cell to +@racket[_rest-value]. Otherwise, signal an error. } @defproc[(gc:cons? (loc location?)) boolean?]{ -Returns @scheme[true] if @scheme[_loc] refers to a cons cell. This function should never signal an error. +Returns @racket[true] if @racket[_loc] refers to a cons cell. This function +should never signal an error. } @defproc[(gc:flat? (loc location?)) boolean?]{ -Returns @scheme[true] if @scheme[_loc] refers to a flat value. This function should never signal an error. +Returns @racket[true] if @racket[_loc] refers to a flat value. This function +should never signal an error. } @@ -383,10 +413,12 @@ Returns @scheme[true] if @scheme[_loc] refers to a flat value. This function sh @defmodulelang[plai/mutator] -The @MUTATE-LANG language is used to test garbage collectors written with the -@secref["collector"] language. Since collectors support a subset of Scheme's values, the @MUTATE-LANG language supports a subset of procedures and syntax. -In addition, many procedures that can be written in the mutator are omitted as they make good test cases. Therefore, -the mutator language provides only primitive procedures, such as @scheme[+], @scheme[cons], etc. +The @MUTATE-LANG language is used to test garbage collectors written with the +@secref["collector"] language. Since collectors support a subset of Scheme's +values, the @MUTATE-LANG language supports a subset of procedures and syntax. +In addition, many procedures that can be written in the mutator are omitted as +they make good test cases. Therefore, the mutator language provides only +primitive procedures, such as @racket[+], @racket[cons], etc. @subsection{Building Mutators} @@ -399,23 +431,26 @@ The first expression of a mutator must be: heap-size) ([heap-size exact-nonnegative-integer?])]{ -@scheme[_collector-module] specifies the path to the garbage collector that the mutator should use. The collector -must be written in the @COLLECT-LANG language. +@racket[_collector-module] specifies the path to the garbage collector that the +mutator should use. The collector must be written in the @COLLECT-LANG +language. } -The rest of a mutator module is a sequence of definitions, expressions and test cases. The @MUTATE-LANG language -transforms these definitions and statements to use the collector specified in @scheme[allocator-setup]. In particular, -many of the primitive forms, such as @scheme[cons] map directly to procedures such as @scheme[gc:cons], written in the -collector. +The rest of a mutator module is a sequence of definitions, expressions and test +cases. The @MUTATE-LANG language transforms these definitions and statements to +use the collector specified in @racket[allocator-setup]. In particular, many +of the primitive forms, such as @racket[cons] map directly to procedures such +as @racket[gc:cons], written in the collector. @subsection{Mutator API} -The @MUTATE-LANG language supports the following procedures and syntactic forms: +The @MUTATE-LANG language supports the following procedures and syntactic +forms: @(define-syntax (document/lift stx) (syntax-case stx () [(_ a ...) - (with-syntax ([(doc ...) + (with-syntax ([(doc ...) (map (λ (a) (with-syntax ([a a] [rkt:a (string->symbol (format "rkt:~a" (syntax-e a)))]) @@ -428,42 +463,45 @@ The @MUTATE-LANG language supports the following procedures and syntactic forms: @document/lift[if and or cond case define-values let let-values let* set! quote error begin] @defform[(define (id arg-id ...) body-expression ...+)]{ - Just like Racket's @racket[define], except restricted to the simpler form above. + Just like Racket's @racket[define], except restricted to the simpler form + above. } @deftogether[(@defform[(lambda (arg-id ...) body-expression ...+)]{} @defform[(λ (arg-id ...) body-expression ...+)]{})]{ - Just like Racket's @racket[lambda] and @racket[λ], except restricted to the simpler form above. + Just like Racket's @racket[lambda] and @racket[λ], except restricted to the + simpler form above. } @document/lift[add1 sub1 zero? + - * / even? odd? = < > <= >= symbol? symbol=? number? boolean? empty? eq?] @defproc[(cons [hd any/c] [tl any/c]) cons?]{ - Constructs a (mutable) pair. + Constructs a (mutable) pair. } @defproc[(cons? [v any/c]) boolean?]{ Returns @racket[#t] when given a value created by @racket[cons], @racket[#f] otherwise. } @defproc[(first [c cons?]) any/c]{ - Extracts the first component of @racket[c]. + Extracts the first component of @racket[c]. } @defproc[(rest [c cons?]) any/c]{ - Extracts the rest component of @racket[c]. + Extracts the rest component of @racket[c]. } @defproc[(set-first! [c cons?] [v any/c]) void]{ - Sets the @scheme[first] of the cons cell @scheme[c]. + Sets the @racket[first] of the cons cell @racket[c]. } @defproc[(set-rest! [c cons?] [v any/c]) void]{ - Sets the @scheme[rest] of the cons cell @scheme[c]. + Sets the @racket[rest] of the cons cell @racket[c]. } @defidform[empty]{ -The identifier @scheme[empty] is defined to invoke @scheme[(gc:alloc-flat empty)] wherever it is used. + The identifier @racket[empty] is defined to invoke + @racket[(gc:alloc-flat empty)] wherever it is used. } @defidform[print-only-errors]{ @@ -477,19 +515,19 @@ The identifier @scheme[empty] is defined to invoke @scheme[(gc:alloc-flat empty) Other common procedures are left undefined as they can be defined in terms of the primitives and may be used to test collectors. -Additional procedures from @schememodname[scheme] may be imported with: +Additional procedures from @racketmodname[scheme] may be imported with: @defform/subs[(import-primitives id ...)()]{ -Imports the procedures @scheme[_id ...] from @schememodname[scheme]. Each +Imports the procedures @racket[_id ...] from @racketmodname[scheme]. Each procedure is transformed to correctly interface with the mutator. That is, its arguments are dereferenced from the mutator's heap and the result is allocated -on the mutator's heap. The arguments and result must be @scheme[heap-value?]s, +on the mutator's heap. The arguments and result must be @racket[heap-value?]s, even if the imported procedure accepts or produces structured data. -For example, the @MUTATE-LANG language does not define @scheme[modulo]: +For example, the @MUTATE-LANG language does not define @racket[modulo]: -@schemeblock[ +@racketblock[ (import-primitives modulo) @@ -504,16 +542,17 @@ For example, the @MUTATE-LANG language does not define @scheme[modulo]: @defform/subs[(test/location=? mutator-expr1 mutator-expr2)()]{ -@scheme[test/location=?] succeeds if @scheme[_mutator-expr1] and @scheme[_mutator-expr2] reference the same location -on the heap. - +@racket[test/location=?] succeeds if @racket[_mutator-expr1] and +@racket[_mutator-expr2] reference the same location on the heap. + } @defform/subs[(test/value=? mutator-expr scheme-datum/quoted)()]{ -@scheme[test/value=?] succeeds if @scheme[_mutator-expr] and @scheme[_scheme-datum/expr] are structurally equal. -@scheme[_scheme-datum/quoted] is not allocated on the mutator's heap. Futhermore, it must either be a quoted value or a -literal value. +@racket[test/value=?] succeeds if @racket[_mutator-expr] and +@racket[_scheme-datum/expr] are structurally equal. +@racket[_scheme-datum/quoted] is not allocated on the mutator's +heap. Futhermore, it must either be a quoted value or a literal value. } @@ -521,11 +560,11 @@ literal value. (printf format mutator-expr ...) ([format literal-string])]{ -In @|MUTATE-LANG|, @scheme[printf] is a syntactic form and not a procedure. The format string, -@scheme[_format] is not allocated on the mutator's heap. +In @|MUTATE-LANG|, @racket[printf] is a syntactic form and not a procedure. The +format string, @racket[_format] is not allocated on the mutator's heap. } - + @subsection{Generating Random Mutators} @defmodule[plai/random-mutator] @@ -533,88 +572,89 @@ In @|MUTATE-LANG|, @scheme[printf] is a syntactic form and not a procedure. The This PLAI library provides a facility for generating random mutators, in order to test your garbage collection implementation. -@defproc[(save-random-mutator +@defproc[(save-random-mutator [file path-string?] [collector-name string?] - [#:heap-values heap-values (cons heap-value? (listof heap-value?)) (list 0 1 -1 'x 'y #f #t '())] - [#:iterations iterations exact-positive-integer? 200] + [#:heap-values heap-values (cons heap-value? (listof heap-value?)) + (list 0 1 -1 'x 'y #f #t '())] + [#:iterations iterations exact-positive-integer? 200] [#:program-size program-size exact-positive-integer? 10] [#:heap-size heap-size exact-positive-integer? 100]) void?]{ -Creates a random mutator that uses the collector @scheme[collector-name] and -saves it in @scheme[file]. +Creates a random mutator that uses the collector @racket[collector-name] and +saves it in @racket[file]. -The mutator is created by first making a random graph whose nodes either -have no outgoing edges, two outgoing edges, or some random number of -outgoing edges and then picking -a random path in the graph that ends at one of the nodes with no edges. +The mutator is created by first making a random graph whose nodes either have +no outgoing edges, two outgoing edges, or some random number of outgoing edges +and then picking a random path in the graph that ends at one of the nodes with +no edges. -This graph and path are then turned into a PLAI program by creating -a @scheme[let] expression that binds one variable per node in the graph. -If the node has no outgoing edges, it is bound to a @scheme[heap-value?]. -If the node has two outgoing edges, it is bound to a pair and the two -edges are put into the first and rest fields. Otherwise, the node -is represented as a procedure that accepts an integer index and -returns the destination node of the corresponding edge. +This graph and path are then turned into a PLAI program by creating a +@racket[let] expression that binds one variable per node in the graph. If the +node has no outgoing edges, it is bound to a @racket[heap-value?]. If the node +has two outgoing edges, it is bound to a pair and the two edges are put into +the first and rest fields. Otherwise, the node is represented as a procedure +that accepts an integer index and returns the destination node of the +corresponding edge. -Once the @scheme[let] expression has been created, the program -creates a bunch of garbage and then traverses the graph, -according to the randomly created path. If the result of the path -is the expected heap value, the program does this again, up -to @scheme[iterations] times. If the result of the path -is not the expected heap value, the program terminates -with an error. +Once the @racket[let] expression has been created, the program creates a bunch +of garbage and then traverses the graph, according to the randomly created +path. If the result of the path is the expected heap value, the program does +this again, up to @racket[iterations] times. If the result of the path is not +the expected heap value, the program terminates with an error. The keyword arguments control some aspects of the generation of random mutators: -@itemize[@item{Elements from the @scheme[heap-values] argument are used - as the base values when creating nodes with no outgoing edges. - See also @scheme[find-heap-values].} - @item{The @scheme[iterations] argument controls how many times - the graph is created (and traversed).} - @item{The @scheme[program-size] argument is a bound on how - big the program it is; it limits the number of nodes, - the maximum number of edges, and the length of the - path in the graph.} - @item{The @scheme[heap-size] argument controls the size of the - heap in the generated mutator.}] +@itemize[ +@item{Elements from the @racket[heap-values] argument are used as the base + values when creating nodes with no outgoing edges. See also + @racket[find-heap-values].} +@item{The @racket[iterations] argument controls how many times the graph is + created (and traversed).} +@item{The @racket[program-size] argument is a bound on how big the program it + is; it limits the number of nodes, the maximum number of edges, and the + length of the path in the graph.} +@item{The @racket[heap-size] argument controls the size of the heap in the + generated mutator.}] } - -@defproc[(find-heap-values [input (or/c path-string? input-port?)]) (listof heap-value?)]{ - Processes @scheme[input] looking for occurrences of @scheme[heap-value?]s - in the source of the program and returns them. This makes a good start - for the @scheme[heap-values] argument to @scheme[save-random-mutator]. - - If @scheme[input] is a port, its contents are assumed to be a well-formed - PLAI program. If @scheme[input] is a file, the contents of the file are - used. +@defproc[(find-heap-values [input (or/c path-string? input-port?)]) + (listof heap-value?)]{ + Processes @racket[input] looking for occurrences of @racket[heap-value?]s in + the source of the program and returns them. This makes a good start for the + @racket[heap-values] argument to @racket[save-random-mutator]. + + If @racket[input] is a port, its contents are assumed to be a well-formed + PLAI program. If @racket[input] is a file, the contents of the file are used. } @section[#:tag "web"]{@WEB-LANG} @defmodulelang[plai/web] -The @WEB-LANG language allows you to write server-side Web applications for the PLT Web Server. +The @WEB-LANG language allows you to write server-side Web applications for the +PLT Web Server. For more information about writing Web applications, see: @other-manual['(lib "web-server/scribblings/web-server.scrbl")]. -When you click on the @onscreen{Run} button in DrRacket, your Web application is launched in the Web server. +When you click on the @onscreen{Run} button in DrRacket, your Web application +is launched in the Web server. -The application is available at @italic{http://localhost:8000/servlets/standalone.rkt}. +The application is available at +@italic{http://localhost:8000/servlets/standalone.rkt}. The @WEB-LANG language will automatically load this URL in your Web browser. -You may use @scheme[no-web-browser] to prevent the browser from being launched and @scheme[static-files-path] -to serve additional static files. +You may use @racket[no-web-browser] to prevent the browser from being launched +and @racket[static-files-path] to serve additional static files. @subsection{Web Application Exports} @declare-exporting[#:use-sources (plai/scribblings/fake-web)] -A Web application must define a procedure @scheme[start]: +A Web application must define a procedure @racket[start]: @defproc[(start (initial-request request?)) response?]{ diff --git a/collects/planet/planet.scrbl b/collects/planet/planet.scrbl index f840d871ab..0155dafc17 100644 --- a/collects/planet/planet.scrbl +++ b/collects/planet/planet.scrbl @@ -487,7 +487,7 @@ the resolvers behavior. } @defparam[install? inst? boolean?]{ - A parameter that controls if @PLaneT attempts to install a planet package that isn't already installed. + A parameter that controls if @PLaneT attempts to install a planet package that isn't already installed. If the package isn't installed, the resolver will raise the @racket[exn:fail:planet?] exception instead of installing it. } diff --git a/collects/plot/plot.scrbl b/collects/plot/plot.scrbl index b7070427d3..c9e4d6d0e7 100644 --- a/collects/plot/plot.scrbl +++ b/collects/plot/plot.scrbl @@ -29,16 +29,16 @@ and passed to other programs. @subsection{Basic Plotting} -After loading the correct module using @scheme[(require plot)] try +After loading the correct module using @racket[(require plot)] try -@schemeblock[(plot (line (lambda (x) x)))] +@racketblock[(plot (line (lambda (x) x)))] -Any other function using the contract @scheme[(real? . -> . real?)] +Any other function using the contract @racket[(real? . -> . real?)] can be plotted using the same form. To plot multiple items, use the -functions @scheme[mix] and @scheme[mix*] to combine the items to be +functions @racket[mix] and @racket[mix*] to combine the items to be plotted. -@schemeblock[ +@racketblock[ (plot (mix (line (lambda (x) (sin x))) (line (lambda (x) (cos x))))) ] @@ -46,7 +46,7 @@ plotted. The display area and appearance of the plot can be changed by adding brackets argument/value pairs after the first argument. -@schemeblock[ +@racketblock[ (plot (line (lambda (x) (sin x))) #:x-min -1 #:x-max 1 #:title "Sin(x)") ] @@ -54,7 +54,7 @@ brackets argument/value pairs after the first argument. The appearance of each individual plot item can be altered by adding argument/value pairs after the data. -@schemeblock[ +@racketblock[ (plot (line (lambda (x) x) #:color 'green #:width 3)) ] @@ -63,87 +63,47 @@ Besides plotting lines from functions in 2-D, the plotter can also render a variety of other data in several ways: @itemize[ - + @item{Discrete data, such as - - @schemeblock[ - (define data (list (vector 1 1 2) - (vector 2 2 2))) - ] - + @racketblock[(define data (list (vector 1 1 2) + (vector 2 2 2)))] can be interpreted in several ways: - @itemize[ - - @item{As points: @scheme[(plot (points _data))]} - - @item{As error data: @scheme[(plot (error-bars _data))]} - - ] - } - + @item{As points: @racket[(plot (points _data))]} + @item{As error data: @racket[(plot (error-bars _data))]}]} + @item{A function of two variables, such as - - @schemeblock[ - (define 3dfun (lambda (x y) (* (sin x) (sin y)))) - ] - + @racketblock[(define 3dfun (lambda (x y) (* (sin x) (sin y))))] can be plotted on a 2d graph - @itemize[ - @item{Using contours to represent height (z) - - @schemeblock[ - (plot (contour 3dfun)) - ] - } - + @racketblock[(plot (contour 3dfun))]} @item{Using color shading - - @schemeblock[ - (plot (shade 3dfun)) - ] - } - + @racketblock[(plot (shade 3dfun))]} @item{Using a gradient field - - @schemeblock[ - (plot (vector-field (gradient 3dfun))) - ] - } - ] - + @racketblock[(plot (vector-field (gradient 3dfun)))]}] or in a 3d box - @itemize[ - @item{Displaying only the top of the surface - - @schemeblock[ - (plot3d (surface 3dfun)) - ] - } - ] - } - + @racketblock[(plot3d (surface 3dfun))]}]} + ] @subsection[#:tag "ex-curve-fit"]{Curve Fitting} -The @schememodname[plot] library uses a non-linear, least-squares fit +The @racketmodname[plot] library uses a non-linear, least-squares fit algorithm to fit parameterized functions to given data. To fit a particular function to a curve: @itemize[ - + @item{Set up the independent and dependent variable data. The first item in each vector is the independent variable, the second is the result. The last item is the weight of the error; we can leave it - as @scheme[1] since all the items weigh the same. - - @schemeblock[ + as @racket[1] since all the items weigh the same. + + @racketblock[ (define data '(#(0 3 1) #(1 5 1) #(2 7 1) @@ -151,52 +111,50 @@ To fit a particular function to a curve: #(4 11 1))) ] } - + @item{Set up the function to be fitted using fit. This particular function looks like a line. The independent variables must come before the parameters. - - @schemeblock[ + + @racketblock[ (define fit-fun (lambda (x m b) (+ b (* m x)))) ] } - + @item{If possible, come up with some guesses for the values of the parameters. The guesses can be left as one, but each parameter must be named.} - + @item{Do the fit; the details of the function are described in @secref["curve-fit"]. - - @schemeblock[ + + @racketblock[ (define fitted (fit fit-fun '((m 1) (b 1)) data)) ] } - + @item{View the resulting parameters; for example, - - @schemeblock[ + + @racketblock[ (fit-result-final-params fitted) ] - - will produce @schemeresultfont{(2.0 3.0)}. + + will produce @racketresultfont{(2.0 3.0)}. } - + @item{For some visual feedback of the fit result, plot the function - with the new parameters. For convenience, the structure that is - returned by the fit command has already the function. - - @schemeblock[ + with the new parameters. For convenience, the structure that is + returned by the fit command has already the function. + + @racketblock[ (plot (mix (points data) (line (fit-result-function fitted))) #:y-max 15) - ] - } - ] + ]}] A more realistic example can be found in @filepath{demos/fit-demo-2.rkt} in the @filepath{plot} collection. @@ -210,10 +168,10 @@ can call in any order. The full details of the view interface can be found in @secref["extend"]. For example, if we wanted to create a constructor that creates -plot-items that draw dashed lines given a @scheme[(real? . -> . real?)] +plot-items that draw dashed lines given a @racket[(real? . -> . real?)] function, we could do the following: -@schemeblock[ +@racketblock[ (require plot/extend) (define (dashed-line fun @@ -242,9 +200,9 @@ function, we could do the following: x-lists)))) ] -Plot a test case using @scheme[dashed-line]: +Plot a test case using @racket[dashed-line]: -@schemeblock[ +@racketblock[ (plot (dashed-line (lambda (x) x) #:color 'blue)) ] @@ -254,12 +212,12 @@ Plot a test case using @scheme[dashed-line]: @defmodule[plot] -The @schememodname[plot] library provides the ability to make basic +The @racketmodname[plot] library provides the ability to make basic plots, fit curves to data, and some useful miscellaneous functions. @subsection{Plotting} -The @scheme[plot] and @scheme[plot3d] functions generate plots that can be +The @racket[plot] and @racket[plot3d] functions generate plots that can be viewed in the DrRacket interactions window. @defproc[(plot [data ((is-a?/c 2d-view%) . -> . void?)] @@ -278,11 +236,11 @@ viewed in the DrRacket interactions window. [#:out-file out-file (or/c path-string? output-port? #f) #f]) (is-a?/c image-snip%)]{ -Plots @scheme[data] in 2-D, where @scheme[data] is generated by -functions like @scheme[points] or @scheme[lines]. +Plots @racket[data] in 2-D, where @racket[data] is generated by +functions like @racket[points] or @racket[lines]. -A @scheme[data] value is represented as a procedure that takes a -@scheme[2d-view%] instance and adds plot information to it. +A @racket[data] value is represented as a procedure that takes a +@racket[2d-view%] instance and adds plot information to it. The result is a @racket[image-snip%] for the plot. If an @racket[#:out-file] path or port is provided, the plot is also written as a PNG image to @@ -290,31 +248,31 @@ the given path or port.} @defproc[(plot3d [data ((is-a?/c 3d-view%) . -> . void?)] [#:width width real? 400] - [#:height height real? 400] - [#:x-min x-min real? -5] - [#:x-max x-max real? 5] - [#:y-min y-min real? -5] - [#:y-max y-max real? 5] - [#:z-min z-min real? -5] - [#:z-max z-max real? 5] - [#:alt alt real? 30] - [#:az az real? 45] - [#:x-label x-label string? "X axis"] - [#:y-label y-label string? "Y axis"] - [#:z-label z-label string? "Z axis"] - [#:title title string? ""] - [#:fgcolor fgcolor (list/c byte? byte? byte) '(0 0 0)] - [#:bgcolor bgcolor (list/c byte? byte? byte) '(255 255 255)] - [#:lncolor lncolor (list/c byte? byte? byte) '(255 0 0)]) - (is-a?/c image-snip%)]{ + [#:height height real? 400] + [#:x-min x-min real? -5] + [#:x-max x-max real? 5] + [#:y-min y-min real? -5] + [#:y-max y-max real? 5] + [#:z-min z-min real? -5] + [#:z-max z-max real? 5] + [#:alt alt real? 30] + [#:az az real? 45] + [#:x-label x-label string? "X axis"] + [#:y-label y-label string? "Y axis"] + [#:z-label z-label string? "Z axis"] + [#:title title string? ""] + [#:fgcolor fgcolor (list/c byte? byte? byte) '(0 0 0)] + [#:bgcolor bgcolor (list/c byte? byte? byte) '(255 255 255)] + [#:lncolor lncolor (list/c byte? byte? byte) '(255 0 0)]) + (is-a?/c image-snip%)]{ -Plots @scheme[data] in 3-D, where @scheme[data] is generated by a -function like @scheme[surface]. The arguments @scheme[alt] and -@scheme[az] set the viewing altitude (in degrees) and the azimuth +Plots @racket[data] in 3-D, where @racket[data] is generated by a +function like @racket[surface]. The arguments @racket[alt] and +@racket[az] set the viewing altitude (in degrees) and the azimuth (also in degrees), respectively. -A 3-D @scheme[data] value is represented as a procedure that takes a -@scheme[3d-view%] instance and adds plot information to it.} +A 3-D @racket[data] value is represented as a procedure that takes a +@racket[3d-view%] instance and adds plot information to it.} @defproc[(points [vecs (listof (vector/c real? real?))] @@ -322,20 +280,19 @@ A 3-D @scheme[data] value is represented as a procedure that takes a [#:color color plot-color? 'black]) ((is-a?/c 2d-view%) . -> . void?)]{ -Creates 2-D plot data (to be provided to @scheme[plot]) given a list -of points specifying locations. The @scheme[sym] argument determines +Creates 2-D plot data (to be provided to @racket[plot]) given a list +of points specifying locations. The @racket[sym] argument determines the appearance of the points. It can be a symbol, an ASCII character, or a small integer (between -1 and 127). The following symbols are -known: @scheme['pixel], @scheme['dot], @scheme['plus], -@scheme['asterisk], @scheme['circle], @scheme['times], -@scheme['square], @scheme['triangle], @scheme['oplus], @scheme['odot], -@scheme['diamond], @scheme['5star], @scheme['6star], -@scheme['fullsquare], @scheme['bullet], @scheme['full5star], -@scheme['circle1], @scheme['circle2], @scheme['circle3], -@scheme['circle4], @scheme['circle5], @scheme['circle6], -@scheme['circle7], @scheme['circle8], @scheme['leftarrow], -@scheme['rightarrow], @scheme['uparrow], @scheme['downarrow]. } - +known: @racket['pixel], @racket['dot], @racket['plus], +@racket['asterisk], @racket['circle], @racket['times], +@racket['square], @racket['triangle], @racket['oplus], @racket['odot], +@racket['diamond], @racket['5star], @racket['6star], +@racket['fullsquare], @racket['bullet], @racket['full5star], +@racket['circle1], @racket['circle2], @racket['circle3], +@racket['circle4], @racket['circle5], @racket['circle6], +@racket['circle7], @racket['circle8], @racket['leftarrow], +@racket['rightarrow], @racket['uparrow], @racket['downarrow]. } @defproc[(line [f (real? . -> . (or/c real? (vector real? real?)))] @@ -352,8 +309,8 @@ Creates 2-D plot data to draw a line. The line is specified in either functional, i.e. @math{y = f(x)}, or parametric, i.e. @math{x,y = f(t)}, mode. If the function is -parametric, the @scheme[mode] argument must be set to -@scheme['parametric]. The @scheme[t-min] and @scheme[t-max] arguments +parametric, the @racket[mode] argument must be set to +@racket['parametric]. The @racket[t-min] and @racket[t-max] arguments set the parameter when in parametric mode.} @@ -396,7 +353,7 @@ function at that position.} 10]) ((is-a?/c 2d-view%) . -> . void?)]{ -Creates 2-D plot data to draw like @scheme[contour], except using +Creates 2-D plot data to draw like @racket[contour], except using shading instead of contour lines.} @@ -413,17 +370,17 @@ the @italic{top} of the surface.} @defproc[(mix [data (any/c . -> . void?)] ...+) (any/c . -> . void?)]{ -Creates a procedure that calls each @scheme[data] on its argument in -order. Thus, this function can composes multiple plot @scheme[data]s +Creates a procedure that calls each @racket[data] on its argument in +order. Thus, this function can composes multiple plot @racket[data]s into a single data.} @defproc[(plot-color? [v any/c]) boolean?]{ -Returns @scheme[#t] if @scheme[v] is one of the following symbols, -@scheme[#f] otherwise: +Returns @racket[#t] if @racket[v] is one of the following symbols, +@racket[#f] otherwise: -@schemeblock[ +@racketblock[ 'white 'black 'yellow 'green 'aqua 'pink 'wheat 'grey 'blown 'blue 'violet 'cyan 'turquoise 'magenta 'salmon 'red @@ -444,10 +401,10 @@ domain, and is used by the @tt{gnuplot} package. fit-result?]{ Attempts to fit a @defterm{fittable function} to the data that is -given. The @scheme[guess-list] should be a set of arguments and +given. The @racket[guess-list] should be a set of arguments and values. The more accurate your initial guesses are, the more likely the fit is to succeed; if there are no good values for the guesses, -leave them as @scheme[1].} +leave them as @racket[1].} @defstruct[fit-result ([rms real?] [variance real?] @@ -457,10 +414,10 @@ leave them as @scheme[1].} [std-error-percent (listof real?)] [function (real? ... . -> . real?)])]{ -The @scheme[params] field contains an associative list of the -parameters specified in @scheme[fit] and their values. Note that the +The @racket[params] field contains an associative list of the +parameters specified in @racket[fit] and their values. Note that the values may not be correct if the fit failed to converge. For a visual -test, use the @scheme[function] field to get the function with the +test, use the @racket[function] field to get the function with the parameters in place and plot it along with the original data.} @; ---------------------------------------- @@ -471,14 +428,14 @@ parameters in place and plot it along with the original data.} (real? . -> . real?)]{ Creates a function that evaluates the numeric derivative of -@scheme[f]. The given @scheme[h] is the divisor used in the +@racket[f]. The given @racket[h] is the divisor used in the calculation.} @defproc[(gradient [f (real? real? . -> . real?)] [h real? .000001]) ((vector/c real? real?) . -> . (vector/c real? real?))]{ Creates a vector-valued function that the numeric gradient of -@scheme[f].} +@racket[f].} @defproc[(make-vec [fx (real? real? . -> . real?)] [fy (real? real? . -> . real?)]) ((vector/c real? real?) . -> . (vector/c real? real?))]{ @@ -491,7 +448,7 @@ Creates a vector-values function from two parts.} @defmodule[plot/extend] -The @schememodname[plot/extend] module allows you to create your own +The @racketmodname[plot/extend] module allows you to create your own constructors, further customize the appearance of the plot windows, and in general extend the package. @@ -499,13 +456,14 @@ and in general extend the package. [x-min number] [x-max number]) real?]{ - -Given @scheme[sample-count], @scheme[x-min], and @scheme[x-max], returns the size of each sample.} + +Given @racket[sample-count], @racket[x-min], and @racket[x-max], returns the +size of each sample.} @defproc[(scale-vectors [vecs (listof vector?)] [x-sample-size real?] [y-sample-size real?]) (listof vector?)]{ - + Scales vectors, causing them to fit in their boxes.} @@ -513,27 +471,31 @@ Scales vectors, causing them to fit in their boxes.} [x-min number] [x-max number]) (listof real?)]{ - -Given @scheme[samples], @scheme[x-min], and @scheme[x-max], returns a -list of @scheme[x]s spread across the range.} - -@defproc[(normalize-vector [vec vector?] [x-sample-size real?] [y-sample-size real?]) vector?]{ - -Normalizes @scheme[vec] based on @scheme[x-sample-size] and @scheme[y-sample-size].} +Given @racket[samples], @racket[x-min], and @racket[x-max], returns a +list of @racket[x]s spread across the range.} + + +@defproc[(normalize-vector [vec vector?] [x-sample-size real?] [y-sample-size real?]) + vector?]{ + +Normalizes @racket[vec] based on @racket[x-sample-size] and +@racket[y-sample-size].} @defproc[(normalize-vectors [vecs (listof vector?)] [x-sample-size real?] [y-sample-size real?]) (listof vector?)]{ -Normalizes @scheme[vecs] based on @scheme[x-sample-size] and @scheme[y-sample-size].} +Normalizes @racket[vecs] based on @racket[x-sample-size] and +@racket[y-sample-size].} -@defproc[(make-column [x real?] [ys (listof real?)]) (listof (vector/c real? real?))]{ - -Given an @scheme[x] and a list of @scheme[_y]s, produces a list of -points pairing the @scheme[x] with each of the @scheme[_y]s.} - +@defproc[(make-column [x real?] [ys (listof real?)]) + (listof (vector/c real? real?))]{ + +Given an @racket[x] and a list of @racket[_y]s, produces a list of +points pairing the @racket[x] with each of the @racket[_y]s.} + @defproc[(xy-list [sample-count exact-positive-integer?] [x-min real?] @@ -543,44 +505,38 @@ points pairing the @scheme[x] with each of the @scheme[_y]s.} (listof (listof (vector/c real? real?)))]{ Makes a list of all the positions on the graph.} - + @defproc[(zgrid [f (real? real? . -> . real?)] [xs (listof real?)] [ys (listof real?)]) (listof (listof real?))]{ -Given a function that consumes @scheme[_x] and @scheme[_y] to produce -@scheme[_z], a list of @scheme[_x]s, and a list of @scheme[_y]s, -produces a list of @scheme[_z] column values.} +Given a function that consumes @racket[_x] and @racket[_y] to produce +@racket[_z], a list of @racket[_x]s, and a list of @racket[_y]s, produces a +list of @racket[_z] column values.} @; ---------------------------------------- @defclass[plot-view% image-snip% ()]{ @defmethod[(get-x-min) real?]{ - -Returns the minimum plottable @scheme[_x] coordinate.} - + Returns the minimum plottable @racket[_x] coordinate.} + @defmethod[(get-y-min) real?]{ - -Returns the minimum plottable @scheme[_y] coordinate.} - + Returns the minimum plottable @racket[_y] coordinate.} + @defmethod[(get-x-max) real?]{ - -Returns the maximum plottable @scheme[_x] coordinate.} + Returns the maximum plottable @racket[_x] coordinate.} @defmethod[(get-y-max) real?]{ - -Returns the maximum plottable @scheme[_y] coordinate.} + Returns the maximum plottable @racket[_y] coordinate.} @defmethod[(set-line-color [color plot-color?]) void?]{ - -Sets the drawing color.} + Sets the drawing color.} @defmethod[(set-line-width [width real?]) void?]{ - -Sets the drawing line width.} + Sets the drawing line width.} } @@ -589,37 +545,37 @@ Sets the drawing line width.} @defclass[2d-view% plot-view% ()]{ Provides an interface to drawing 2-D plots. An instance of -@scheme[2d-view%] is created by @scheme[plot], and the following +@racket[2d-view%] is created by @racket[plot], and the following methods can be used to adjust it. @defmethod[(set-labels [x-label string?] - [y-label string?] - [title string?]) - void?]{ + [y-label string?] + [title string?]) + void?]{ Sets the axis labels and title.} @defmethod[(plot-vector [head (vector/c real? real?)] - [tail (vector/c real? real?)]) - void?]{ + [tail (vector/c real? real?)]) + void?]{ Plots a single vector.} @defmethod[(plot-vectors [vecs (listof (list/c (vector/c real? real?) - (vector/c real? real?)))]) - void?]{ + (vector/c real? real?)))]) + void?]{ Plots a set of vectors.} @defmethod[(plot-points [points (listof (vector/c real? real?))] [sym (or/c character? integer? symbol?)]) - void?]{ + void?]{ -Plots points using a specified symbol. See @scheme[points] for -possible values for @scheme[sym]} +Plots points using a specified symbol. See @racket[points] for +possible values for @racket[sym]} @defmethod[(plot-line [points (listof (vector/c real? real?))]) void?]{ @@ -627,18 +583,18 @@ possible values for @scheme[sym]} Plots a line given a set of points.} -@defmethod[(plot-contours [grid (listof (listof real?))] - [xs (listof real?)] - [ys (listof real?)] - [levels (listof real?)]) void?]{ +@defmethod[(plot-contours [grid (listof (listof real?))] + [xs (listof real?)] + [ys (listof real?)] + [levels (listof real?)]) void?]{ Plots a grid representing a 3-D function using contours to distinguish levels.} -@defmethod[(plot-shades [grid (listof (listof real?))] +@defmethod[(plot-shades [grid (listof (listof real?))] [xs (listof real?)] [ys (listof real?)] [levels (listof real?)]) void?]{ - + Plots a grid representing a 3-D function using shades to show levels.} } @@ -648,40 +604,35 @@ Plots a grid representing a 3-D function using shades to show levels.} @defclass[3d-view% plot-view% ()]{ Provides an interface to drawing 3-D plots. An instance of -@scheme[3d-view%] is created by @scheme[plot3d], and the following +@racket[3d-view%] is created by @racket[plot3d], and the following methods can be used to adjust it. @defmethod[(plot-surface [xs (listof real?)] - [ys (listof real?)] - [zs (listof real?)]) void?]{ + [ys (listof real?)] + [zs (listof real?)]) void?]{ Plots a grid representing a 3d function in a 3d box, showing only the top of the surface.} @defmethod[(plot-line [xs (listof real?)] - [ys (listof real?)] - [zs (listof real?)]) void?]{ + [ys (listof real?)] + [zs (listof real?)]) void?]{ Plots a line in 3-D space.} @defmethod[(get-z-min) real?]{ - -Returns the minimum plottable @scheme[_z] coordinate.} - + Returns the minimum plottable @racket[_z] coordinate.} + @defmethod[(get-z-max) real?]{ - -Returns the maximum plottable @scheme[_z] coordinate.} + Returns the maximum plottable @racket[_z] coordinate.} - @defmethod[(get-alt) real?]{ + Returns the altitude (in degrees) from which the 3-D box is viewed.} -Returns the altitude (in degrees) from which the 3-D box is viewed.} - @defmethod[(get-az) real?]{ - -Returns the azimuthal angle.} + Returns the azimuthal angle.} } diff --git a/collects/preprocessor/scribblings/mzpp.scrbl b/collects/preprocessor/scribblings/mzpp.scrbl index d06e15d423..b84a3505c1 100644 --- a/collects/preprocessor/scribblings/mzpp.scrbl +++ b/collects/preprocessor/scribblings/mzpp.scrbl @@ -7,12 +7,12 @@ @title[#:tag "mzpp"]{@exec{mzpp}} -@exec{mzpp} is a simple preprocessor that allows mixing Scheme code with text +@exec{mzpp} is a simple preprocessor that allows mixing Racket code with text files in a similar way to PHP or BRL. Processing of input files works -by translating the input file to Scheme code that prints the contents, -except for marked portions that contain Scheme code. The Scheme parts -of a file are marked with @litchar{<<} and @litchar{>>} tokens by default. The Scheme -code is then passed through a read-eval-print loop that is similar to a +by translating the input file to Racket code that prints the contents, +except for marked portions that contain Racket code. The Racket parts +of a file are marked with @litchar{<<} and @litchar{>>} tokens by default. The +Racket code is then passed through a read-eval-print loop that is similar to a normal REPL with a few differences in how values are printed. @section{Invoking mzpp} @@ -32,7 +32,7 @@ and ending markers: foo3 }| -First, this file is converted to the following Scheme code: +First, this file is converted to the following Racket code: @verbatim[#:indent 2]|{ (thunk (cd "tmp/") (current-file "foo")) @@ -65,14 +65,14 @@ flag. Note that the processed code contains expressions that have no side-effects, only values---see below for an explanation of the REPL printing behavior. Some expressions produce values that change the REPL environment, for example, the indentation commands are used to keep -track of the column where the Scheme marker was found, and @exec{cd} is used +track of the column where the Racket marker was found, and @exec{cd} is used to switch to the directory where the file is (here it was in @filepath["/home/foo/tmp"]) so including a relative file works. Also, note that -the first @scheme[newline*] did not generate a newline, and that the one in the -embedded Scheme code added the appropriate spaces for indentation. +the first @racket[newline*] did not generate a newline, and that the one in the +embedded Racket code added the appropriate spaces for indentation. -It is possible to temporarily switch from Scheme to text-mode and back -in a way that does not respect a complete Scheme expression, but you +It is possible to temporarily switch from Racket to text-mode and back +in a way that does not respect a complete Racket expression, but you should be aware that text is converted to a @italic{sequence} of side-effect free expressions (not to a single string, and not expression that uses side effects). For example: @@ -89,21 +89,21 @@ side effects). For example: <<)) >> }| -will print two lines, each containing @litchar{foo1} or @litchar{foo} (the first -approach plays better with the smart space handling). The @scheme[show] function can be -used instead of @scheme[list] with the same results, since it will print out the -values in the same way the REPL does. The conversion process does not -transform every continuous piece of text into a single Scheme string -because doing this: +will print two lines, each containing @litchar{foo1} or @litchar{foo} (the +first approach plays better with the smart space handling). The @racket[show] +function can be used instead of @racket[list] with the same results, since it +will print out the values in the same way the REPL does. The conversion +process does not transform every continuous piece of text into a single Racket +string because doing this: @itemize[ - @item{the Scheme process will need to allocating big strings which makes - this unfeasible for big files,} + @item{the Racket process will need to allocating big strings which makes + this unfeasible for big files,} @item{it will not play well with ``interactive'' input feeding, for example, - piping in the output of some process will show results only on Scheme - marker boundaries,} + piping in the output of some process will show results only on Racket + marker boundaries,} @item{special treatment for newlines in these strings will become expensive.} @@ -114,7 +114,7 @@ because doing this: @section{Raw preprocessing directives} Some preprocessing directives happen at the "raw level"---the stage -where text is transformed into Scheme expressions. These directives +where text is transformed into Racket expressions. These directives cannot be changed from within transformed text because they change the way this transformation happens. Some of these transformation @@ -122,7 +122,7 @@ way this transformation happens. Some of these transformation @item{Skipping input: - First, the processing can be modified by specifying a @scheme[skip-to] string + First, the processing can be modified by specifying a @racket[skip-to] string that disables any output until a certain line is seen. This is useful for script files that use themselves for input. For example, the following script: @@ -158,48 +158,48 @@ way this transformation happens. Some of these transformation Finally, if the markers collide with a certain file contents, it is possible to change them. This is done by a line with a special - structure---if the current Scheme markers are @litchar{} and @litchar{} - then a line that contains exactly: + structure---if the current Racket markers are @litchar{} and + @litchar{} then a line that contains exactly: @verbatim[#:indent 2]|{ }| - will change the markers to @litchar{} and @litchar{}. It is possible to - change the markers from the Scheme side (see below), but this will not - change already-transformed text, which is the reason for this special - format.} + will change the markers to @litchar{} and @litchar{}. It is + possible to change the markers from the Racket side (see below), but this + will not change already-transformed text, which is the reason for this + special format.} ] @section{The mzpp read-eval-print loop} -The REPL is initialized by requiring @scheme[preprocessor/mzpp], so the same module -provides both the preprocessor functionality as well as bindings for -embedded Scheme code in processed files. The REPL is then fed the -transformed Scheme code that is generated from the source text (the same -code that @DFlag{debug} shows). Each expression is evaluated and its result -is printed using the @scheme[show] function (multiple values are all printed), where -@scheme[show] works in the following way: +The REPL is initialized by requiring @racket[preprocessor/mzpp], so the same +module provides both the preprocessor functionality as well as bindings for +embedded Racket code in processed files. The REPL is then fed the transformed +Racket code that is generated from the source text (the same code that +@DFlag{debug} shows). Each expression is evaluated and its result is printed +using the @racket[show] function (multiple values are all printed), where +@racket[show] works in the following way: @itemize[ - @item{@|void-const| and @scheme[#f] values are ignored.} + @item{@|void-const| and @racket[#f] values are ignored.} @item{Structures of pairs are recursively scanned and their parts printed - (no spaces are used, so to produce Scheme code as output you must use - format strings---again, this is not intended for preprocessing Scheme - code).} + (no spaces are used, so to produce Racket code as output you must use + format strings---again, this is not intended for preprocessing Racket + code).} @item{Procedures are applied to zero arguments (so a procedure that doesn't - accept zero arguments will cause an error) and the result is sent back - to @scheme[show]. This is useful for using thunks to wrap side-effects as - values (e.g, the @scheme[thunk] wraps shown by the debug output above).} + accept zero arguments will cause an error) and the result is sent back to + @racket[show]. This is useful for using thunks to wrap side-effects as + values (e.g, the @racket[thunk] wraps shown by the debug output above).} - @item{Promises are forced and the result is sent again to @scheme[show].} + @item{Promises are forced and the result is sent again to @racket[show].} - @item{All other values are printed with @scheme[display]. No newlines are used - after printing values.} + @item{All other values are printed with @racket[display]. No newlines are + used after printing values.} ] @@ -213,7 +213,7 @@ First, bindings that are mainly useful for invoking the preprocessor: This is the main entry point to the preprocessor---invoking it on the given list of files and input ports. This is quite similar to - @scheme[include], but it adds some setup of the preprocessed code environment + @racket[include], but it adds some setup of the preprocessed code environment (like requiring the @exec{mzpp} module).} @defparam[skip-to str string?]{ @@ -226,7 +226,7 @@ First, bindings that are mainly useful for invoking the preprocessor: @defboolparam[debug? on?]{ A boolean parameter. If true, then the REPL is not invoked, instead, - the converted Scheme code is printed as is.} + the converted Racket code is printed as is.} @defboolparam[no-spaces? on?]{ @@ -238,18 +238,18 @@ First, bindings that are mainly useful for invoking the preprocessor: @defparam[end-mark str string?] )]{ - These two parameters are used to specify the Scheme beginning and end + These two parameters are used to specify the Racket beginning and end markers.} -All of the above are accessible in preprocessed texts, but the only one -that might make any sense to use is @scheme[preprocess] and @scheme[include] is a -better choice. When @scheme[include] is used, it can be wrapped with parameter -settings, which is why they are available. Note in particular that -these parameters change the way that the text transformation works and -have no effect over the current preprocessed document (for example, the -Scheme marks are used in a different thread, and @scheme[skip-to] cannot be -re-set when processing has already began). The only one that could be -used is @scheme[no-spaces?] but even that makes little sense on selected parts. +All of the above are accessible in preprocessed texts, but the only one that +might make any sense to use is @racket[preprocess] and @racket[include] is a +better choice. When @racket[include] is used, it can be wrapped with parameter +settings, which is why they are available. Note in particular that these +parameters change the way that the text transformation works and have no effect +over the current preprocessed document (for example, the Racket marks are used +in a different thread, and @racket[skip-to] cannot be re-set when processing +has already began). The only one that could be used is @racket[no-spaces?] but +even that makes little sense on selected parts. The following are bindings that are used in preprocessed texts: @@ -258,9 +258,9 @@ The following are bindings that are used in preprocessed texts: @defproc[(pop-indentation) void?] )]{ - These two calls are used to save the indentation column where the - Scheme beginning mark was found, and will be used by @scheme[newline*] - (unless smart space handling mode is disabled).} + These two calls are used to save the indentation column where the Racket + beginning mark was found, and will be used by @racket[newline*] (unless smart + space handling mode is disabled).} @defproc[(show [v any/c]) void?]{ @@ -268,32 +268,31 @@ The following are bindings that are used in preprocessed texts: @defproc[(newline*) void?]{ - This is similar to @scheme[newline] except that it tries to handle spaces in + This is similar to @racket[newline] except that it tries to handle spaces in a ``smart'' way---it will print a newline and then spaces to reach the left margin of the opening @litchar{<<}. (Actually, it tries a bit more, for example, it won't print the spaces if nothing is printed before - another newline.) Setting @scheme[no-spaces?] to true disable this leaving - it equivalent to @scheme[newline].} + another newline.) Setting @racket[no-spaces?] to true disable this leaving + it equivalent to @racket[newline].} @defproc[(include [file path-string?] ...) void?]{ - This is the preferred way of including another file in the processing. - File names are searched relatively to the current preprocessed file, - and during processing the current directory is temporarily changed to - make this work. In addition to file names, the arguments can be input - ports (the current directory is not changed in this case). The files - that will be incorporated can use any current Scheme bindings etc, and - will use the current markers---but the included files cannot change - any of the parameter settings for the current processing - (specifically, the marks and the working directory will be restored - when the included files are processed).} + This is the preferred way of including another file in the processing. File + names are searched relatively to the current preprocessed file, and during + processing the current directory is temporarily changed to make this work. + In addition to file names, the arguments can be input ports (the current + directory is not changed in this case). The files that will be incorporated + can use any current Racket bindings etc, and will use the current + markers---but the included files cannot change any of the parameter settings + for the current processing (specifically, the marks and the working directory + will be restored when the included files are processed).} Note that when a sequence of files are processed (through command-line - arguments or through a single @scheme[include] expression), then they are all - taken as one textual unit---so changes to the markers, working - directory etc in one file can modify the way sequential files are - processed. This means that including two files in a single @scheme[include] - expression can be different than using two expressions. + arguments or through a single @racket[include] expression), then they are all + taken as one textual unit---so changes to the markers, working directory etc + in one file can modify the way sequential files are processed. This means + that including two files in a single @racket[include] expression can be + different than using two expressions. @deftogether[( @defthing[stdin parameter?] @@ -303,7 +302,7 @@ The following are bindings that are used in preprocessed texts: )]{ These are shorter names for the corresponding port parameters and - @scheme[current-directory].} + @racket[current-directory].} @defparam[current-file path path-string?]{ @@ -312,6 +311,4 @@ The following are bindings that are used in preprocessed texts: @defform[(thunk expr ...)]{ - Expands to @scheme[(lambda () expr ...)]. - -} + Expands to @racket[(lambda () expr ...)].} diff --git a/collects/preprocessor/scribblings/mztext.scrbl b/collects/preprocessor/scribblings/mztext.scrbl index a18790db43..400314e7da 100644 --- a/collects/preprocessor/scribblings/mztext.scrbl +++ b/collects/preprocessor/scribblings/mztext.scrbl @@ -8,11 +8,11 @@ @title[#:tag "mztext"]{@exec{mztext}} -@exec{mztext} is another Scheme-based preprocessing language. It can +@exec{mztext} is another Racket-based preprocessing language. It can be used as a preprocessor in a similar way to @exec{mzpp} since it -also uses @schememodname[preprocessor/pp-run] functionality. However, +also uses @racketmodname[preprocessor/pp-run] functionality. However, @exec{mztext} uses a completely different processing principle, it is -similar to TeX rather than the simple interleaving of text and Scheme +similar to TeX rather than the simple interleaving of text and Racket code done by @exec{mzpp}. Text is being input from file(s), and by default copied to the @@ -39,12 +39,12 @@ explanation of the @DFlag{run} flag. @section{mztext processing: the standard command dispatcher} @exec{mztext} can use arbitrary magic sequences, but for convenience, -there is a default built-in dispatcher that connects Scheme code with +there is a default built-in dispatcher that connects Racket code with the preprocessed text---by default, it is triggered by @litchar["@"]. When file processing encounters this marker, control is transferred to the command dispatcher. In its turn, the command dispatcher reads a -Scheme expression (using @scheme[read]), evaluates it, and decides -what to do next. In case of a simple Scheme value, it is converted to +Racket expression (using @racket[read]), evaluates it, and decides +what to do next. In case of a simple Racket value, it is converted to a string and pushed back on the preprocessed input. For example, the following text: @@ -70,7 +70,7 @@ An explanation of a few lines: @itemize[ - @item{@litchar|{@"bar"}|, @litchar|{@(+ 1 2)}|---the Scheme objects + @item{@litchar|{@"bar"}|, @litchar|{@(+ 1 2)}|---the Racket objects that is read is evaluated and displayed back on the input port which is then printed.} @@ -79,7 +79,7 @@ An explanation of a few lines: contains another use of @litchar["@"] which will then get read back in, evaluated, and displayed.} - @item{@litchar|{@(/ (read) 3)12}| --- demonstrates that the Scheme + @item{@litchar|{@(/ (read) 3)12}| --- demonstrates that the Racket code can do anything with the current input.} ] @@ -91,14 +91,14 @@ The complete behavior of the command dispatcher follows: @item{If the marker sequence is followed by itself, then it is simply displayed, using the default, @litchar["@@"] outputs a @litchar["@"].} - @item{Otherwise a Scheme expression is read and evaluated, and the result is + @item{Otherwise a Racket expression is read and evaluated, and the result is processed as follows: @itemize[ @item{If the result consists of multiple values, each one is processed,} - @item{If it is @|void-const| or @scheme[#f], nothing is done,} + @item{If it is @|void-const| or @racket[#f], nothing is done,} @item{If it is a structure of pairs, this structure is processed recursively,} @@ -126,16 +126,17 @@ The complete behavior of the command dispatcher follows: ] -A built-in convenient behavior is that if the evaluation of the Scheme -expression returned a @|void-const| or @scheme[#f] value (or multiple values that are -all @|void-const| or @scheme[#f]), then the next newline is swallowed using -@scheme[swallow-newline] (see below) if there is just white spaces before it. +A built-in convenient behavior is that if the evaluation of the Racket +expression returned a @|void-const| or @racket[#f] value (or multiple values +that are all @|void-const| or @racket[#f]), then the next newline is swallowed +using @racket[swallow-newline] (see below) if there is just white spaces before +it. During evaluation, printed output is displayed as is, without re-processing. It is not hard to do that, but it is a little expensive, so the choice is to ignore it. (A nice thing to do is to redesign this so each evaluation is taken as a real filter, which is done in its own -thread, so when a Scheme expression is about to evaluated, it is done in +thread, so when a Racket expression is about to evaluated, it is done in a new thread, and the current input is wired to that thread's output. However, this is much too heavy for a "simple" preprocesser...) @@ -166,12 +167,12 @@ their arity (preferring a the nullary treatment over the unary one): Scheme_Object * bar(int argc, Scheme_Object *argv[]) }| - Note how @scheme[read-line] is used to retrieve an argument, and how this + Note how @racket[read-line] is used to retrieve an argument, and how this results in an extra space in the actual argument value. Replacing - this with @scheme[read] will work slightly better, except that input will - have to be a Scheme token (in addition, this will not consume the + this with @racket[read] will work slightly better, except that input will + have to be a Racket token (in addition, this will not consume the final newline so the extra one in the format string should be - removed). The @scheme[get-arg] function can be used to retrieve arguments + removed). The @racket[get-arg] function can be used to retrieve arguments more easily---by default, it will return any text enclosed by parenthesis, brackets, braces, or angle brackets (see below). For example: @@ -194,11 +195,11 @@ their arity (preferring a the nullary treatment over the unary one): Racket }| - Note that in @scheme[reftt] we use @scheme[tt] without arguments since it will - retrieve its own arguments. This makes @scheme[ttref]'s approach more - natural, except that "calling" @scheme[tt] through a Scheme string doesn't - seem natural. For this there is a @scheme[defcommand] command (see below) - that can be used to define such functions without using Scheme code: + Note that in @racket[reftt] we use @racket[tt] without arguments since it will + retrieve its own arguments. This makes @racket[ttref]'s approach more + natural, except that "calling" @racket[tt] through a Racket string doesn't + seem natural. For this there is a @racket[defcommand] command (see below) + that can be used to define such functions without using Racket code: @verbatim[#:indent 2]|{ @defcommand{tt}{X}{X} @@ -215,8 +216,8 @@ their arity (preferring a the nullary treatment over the unary one): thunk that holds the "processing continuation". This application is not expected to return, instead, the procedure can decide to hand over control back to the main loop by using this thunk. This is a powerful - facility that is rarely needed, similarly to the fact that @scheme[call/cc] - is rarely needed in Scheme.} + facility that is rarely needed, similarly to the fact that @racket[call/cc] + is rarely needed in Racket.} ] @@ -227,7 +228,7 @@ reprocessed, just like evaluating other expressions. @defmodule[preprocessor/mztext] -Similarly to @exec{mzpp}, @schememodname[preprocessor/mztext] contains +Similarly to @exec{mzpp}, @racketmodname[preprocessor/mztext] contains both the implementation as well as user-visible bindings. Dispatching-related bindings: @@ -238,16 +239,16 @@ Dispatching-related bindings: A string parameter-like procedure that can be used to set a different command marker string. Defaults to @litchar["@"]. It can - also be set to @scheme[#f] which will disable the command dispatcher + also be set to @racket[#f] which will disable the command dispatcher altogether. Note that this is a procedure---it cannot be used with - @scheme[parameterize].} + @racket[parameterize].} @defproc*[([(dispatchers) (listof list?)] [(dispatchers [disps (listof list?)]) void?])]{ - A parameter-like procedure (same as @scheme[command-marker]) holding a list + A parameter-like procedure (same as @racket[command-marker]) holding a list of lists---each one a dispatcher regexp and a handler function. The - regexp should not have any parenthesized subgroups, use @scheme["(?:...)"] for + regexp should not have any parenthesized subgroups, use @racket["(?:...)"] for grouping. The handler function is invoked whenever the regexp is seen on the input stream: it is invoked on two arguments---the matched string and a continuation thunk. It is then responsible for the rest @@ -268,8 +269,8 @@ Dispatching-related bindings: }| Note that the standard command dispatcher uses the same facility, and - it is added by default to the dispatcher list unless @scheme[command-marker] - is set to @scheme[#f].} + it is added by default to the dispatcher list unless @racket[command-marker] + is set to @racket[#f].} @defproc[(make-composite-input [v any/c] ...) input-port?]{ @@ -278,9 +279,9 @@ Dispatching-related bindings: (input ports, strings, etc). The resulting port will read data from each of the values in sequence, appending them together to form a single input port. This is very similar to - @scheme[input-port-append], but it is extended to allow prepending + @racket[input-port-append], but it is extended to allow prepending additional values to the beginning of the port using - @scheme[add-to-input]. The @exec{mztext} executable relies on this + @racket[add-to-input]. The @exec{mztext} executable relies on this functionality to be able to push text back on the input when it is supposed to be reprocessed, so use only such ports for the current input port.} @@ -294,35 +295,35 @@ Dispatching-related bindings: instead. This is used to plant handlers that happen when reading beyond a specific point (for example, this is how the directory is changed to the processed file to allow relative includes). Other - simple values are converted to strings using @scheme[format], but + simple values are converted to strings using @racket[format], but this might change.} @defparam[paren-pairs pairs (listof (list/c string? string?))]{ This is a parameter holding a list of lists, each one holding two - strings which are matching open/close tokens for @scheme[get-arg].} + strings which are matching open/close tokens for @racket[get-arg].} @defboolparam[get-arg-reads-word? on?]{ - A parameter that holds a boolean value defaulting to @scheme[#f]. If true, - then @scheme[get-arg] will read a whole word (non-whitespace string delimited + A parameter that holds a boolean value defaulting to @racket[#f]. If true, + then @racket[get-arg] will read a whole word (non-whitespace string delimited by whitespaces) for arguments that are not parenthesized with a pair - in @scheme[paren-pairs].} + in @racket[paren-pairs].} @defproc[(get-arg) (or/c string? eof-object?)]{ This function will retrieve a text argument surrounded by a paren - pair specified by @scheme[paren-pairs]. First, an open-pattern is + pair specified by @racket[paren-pairs]. First, an open-pattern is searched, and then text is assembled making sure that open-close patterns are respected, until a matching close-pattern is found. When this scan is performed, other parens are ignored, so if the input stream has @litchar|{{[(}}|, the return value will be - @scheme["[("]. It is possible for both tokens to be the same, which + @racket["[("]. It is possible for both tokens to be the same, which will have no nesting possible. If no open-pattern is found, the first non-whitespace character is used, and if that is also not - found before the end of the input, an @scheme[eof] value is - returned. For example (using @scheme[defcommand] which uses - @scheme[get-arg]): + found before the end of the input, an @racket[eof] value is + returned. For example (using @racket[defcommand] which uses + @racket[get-arg]): @verbatim[#:indent 2]|{ @(paren-pairs (cons (list "|" "|") (paren-pairs))) @@ -345,25 +346,25 @@ Dispatching-related bindings: @defproc[(get-arg*) (or/c string? eof-object?)]{ - Similar to @scheme[get-arg], except that the resulting text is first + Similar to @racket[get-arg], except that the resulting text is first processed. Since arguments are usually text strings, ``programming'' can be considered as lazy evaluation, which sometimes can be too inefficient (TeX suffers from the same - problem). The @scheme[get-arg*] function can be used to reduce some + problem). The @racket[get-arg*] function can be used to reduce some inputs immediately after they have been read.} @defproc[(swallow-newline) void?]{ This is a simple command that simply does this: -@schemeblock[ +@racketblock[ (regexp-try-match #rx"^[ \t]*\r?\n" (stdin)) ] The result is that a newline will be swallowed if there is only whitespace from the current location to the end of the line. Note - that as a general principle @scheme[regexp-try-match] should be - preferred over @scheme[regexp-match] for @exec{mztext}'s + that as a general principle @racket[regexp-try-match] should be + preferred over @racket[regexp-match] for @exec{mztext}'s preprocessing. } @@ -372,7 +373,7 @@ Dispatching-related bindings: @defproc[(defcommand [name any/c][args list?][text string?]) void?]{ This is a command that can be used to define simple template - commands. It should be used as a command, not from Scheme code + commands. It should be used as a command, not from Racket code directly, and it should receive three arguments: @itemize[ @@ -396,14 +397,14 @@ Dispatching-related bindings: is translated to the following definition expression: -@schemeblock[ +@racketblock[ (define (ttref) (let ((url (get-arg)) (text (get-arg))) (list "@tt{" text "}"))) ] which is then evaluated. Note that the arguments play a role as both - Scheme identifiers and textual markers. + Racket identifiers and textual markers. } @@ -412,17 +413,17 @@ Dispatching-related bindings: This will add all of the given inputs to the composite port and run the preprocessor loop. In addition to the given inputs, some thunks - are added to the input port (see @scheme[add-to-input] above) to change + are added to the input port (see @racket[add-to-input] above) to change directory so relative includes work. - If it is called with no arguments, it will use @scheme[get-arg] to get an + If it is called with no arguments, it will use @racket[get-arg] to get an input filename, therefore making it possible to use this as a dispatcher command as well.} @defproc[(preprocess [in (or/c path-string? input-port?)]) void?]{ This is the main entry point to the preprocessor---creating a new - composite port, setting internal parameters, then calling @scheme[include] to + composite port, setting internal parameters, then calling @racket[include] to start the preprocessing.} @@ -434,7 +435,7 @@ Dispatching-related bindings: )]{ These are shorter names for the corresponding port parameters and - @scheme[current-directory].} + @racket[current-directory].} @defparam[current-file path path-string?]{ diff --git a/collects/preprocessor/scribblings/preprocessor.scrbl b/collects/preprocessor/scribblings/preprocessor.scrbl index 5d69401f1f..50887ea072 100644 --- a/collects/preprocessor/scribblings/preprocessor.scrbl +++ b/collects/preprocessor/scribblings/preprocessor.scrbl @@ -26,7 +26,7 @@ Racket code, since you have macros to do that. The preprocessors can be invoked from Racket programs, but the main usage should be through the launchers. Both launchers use code from -@schememodname[preprocessor/pp-run] that allows a special invocation +@racketmodname[preprocessor/pp-run] that allows a special invocation mode through the @DFlag{run} flag. The @DFlag{run} is a convenient way of making the preprocessors cooperate @@ -43,12 +43,12 @@ argument which is a string specifying a command to run: as @exec{mzpp foo | pr}. An error is raised if an output file is specified with such an argument.} -@item{2. If the command string contains a @scheme[*] and an output file is specified, - then the command will be executed on this output file after it is +@item{2. If the command string contains a @racket[*] and an output file is + specified, then the command will be executed on this output file after it is generated. For example, @exec{mzpp --run 'pr *' -o foo x y z} is the same as @exec{mzpp -o foo x y z; pr foo}.} -@item{3. If the command string contains a @scheme[*], and no output file is +@item{3. If the command string contains a @racket[*], and no output file is specified, and there is exactly one input file, then a temporary file will be used to save the original while the command is running. For example, @exec{mzpp --run 'pr *' foo} is the same as @exec{mv foo diff --git a/collects/profile/scribblings/analyzer.scrbl b/collects/profile/scribblings/analyzer.scrbl index 2b8fbd7c00..418458a250 100644 --- a/collects/profile/scribblings/analyzer.scrbl +++ b/collects/profile/scribblings/analyzer.scrbl @@ -12,14 +12,14 @@ step is to analyze the data. In this step the sample time are computed and summed, a call-graph representing the observed function calls is built, and per-node and per-edge information is created. This is the job of the main function provided by -@scheme[profile/analyzer]. +@racket[profile/analyzer]. @defproc[(analyze-samples [raw-sample-data any/c]) profile?]{ This function consumes the raw result of the @seclink["sampler"]{sampler} (which is given in an undocumented form), -analyzes it, and returns a @scheme[profile] value holding the analyzed +analyzes it, and returns a @racket[profile] value holding the analyzed results. Without this function, the results of the sampler are meaningless.} @@ -36,32 +36,32 @@ Represents the analyzed profile result. @itemize[ -@item{@scheme[total-time] is the total observed time (in milliseconds) +@item{@racket[total-time] is the total observed time (in milliseconds) included in the profile. This is different than the actual time the profiling took, due to unaccounted-for time spent in untracked threads. (E.g., the sampler thread itself.)} -@item{@scheme[cpu-time] is the actual cpu time consumed by the process +@item{@racket[cpu-time] is the actual cpu time consumed by the process during the profiler's work.} -@item{@scheme[sample-number] holds the number of samples taken during +@item{@racket[sample-number] holds the number of samples taken during the profile. This can be used to compute the average time frame each of the input samples represented.} -@item{@scheme[thread-times] holds an association list mapping thread +@item{@racket[thread-times] holds an association list mapping thread identifiers to cpu time for the corresponding threads. As samples are collected, each thread that is observed is assigned a small integer identifier. These identifiers are listed for each function call, and the total time spent in each thread is in this field.} -@item{@scheme[nodes] is a list of nodes representing all observed +@item{@racket[nodes] is a list of nodes representing all observed functions. These nodes are the components of the call-graph that - the analyzer assembles (see the @scheme[edge] field). The nodes are + the analyzer assembles (see the @racket[edge] field). The nodes are sorted by a topological top-to-bottom sort, and by decreasing total amount of time (time spent either in the function or in its callees) as a secondary key.} -@item{@scheme[*-node] holds a ``special'' node value that is +@item{@racket[*-node] holds a ``special'' node value that is constructed for every graph. This node is used as the caller for all top-level function nodes and as the callee for all leaf nodes. It can therefore be used to start a scan of the call graph. In @@ -88,32 +88,32 @@ profile result. @itemize[ -@item{The @scheme[id] and @scheme[src] field hold a symbol naming the - function and/or its source location as a @scheme[srcloc] value. +@item{The @racket[id] and @racket[src] field hold a symbol naming the + function and/or its source location as a @racket[srcloc] value. This is the same as the results of - @scheme[continuation-mark-set->context], so at most of of these can - be @scheme[#f], except for the special @scheme[*-node] (see the - @scheme[profile] struct) that can be identified by both of these - being @scheme[#f].} + @racket[continuation-mark-set->context], so at most of of these can + be @racket[#f], except for the special @racket[*-node] (see the + @racket[profile] struct) that can be identified by both of these + being @racket[#f].} -@item{@scheme[thread-ids] holds a list of thread identifiers that were +@item{@racket[thread-ids] holds a list of thread identifiers that were observed executing this function.} -@item{@scheme[total] holds the total time (in milliseconds) where this +@item{@racket[total] holds the total time (in milliseconds) where this function was anywhere on the stack. It is common to see a few toplevel functions that have close to a 100% total time, but - otherwise small @scheme[self] times --- these functions are the ones + otherwise small @racket[self] times --- these functions are the ones that derive the work that was done, but they don't do any hard work directly.} -@item{@scheme[self] holds the total time (in milliseconds) where this +@item{@racket[self] holds the total time (in milliseconds) where this function was observed as the leaf of the stack. It represents the - actual work done by this function, rather than @scheme[total] that + actual work done by this function, rather than @racket[total] that represents the work done by both the function and its callees.} -@item{@scheme[callers] and @scheme[callees] hold the list of caller +@item{@racket[callers] and @racket[callees] hold the list of caller and callee nodes. The nodes are not actually held in these lists, - instead, @scheme[edge] values are used --- and provide information + instead, @racket[edge] values are used --- and provide information specific to an edge in the call-graph.} ]} @@ -130,14 +130,14 @@ of an analyzed profile result. @itemize[ -@item{@scheme[total] is analogous to the @scheme[total] field of a - @scheme[node] value: the total time that this edge was anywhere on +@item{@racket[total] is analogous to the @racket[total] field of a + @racket[node] value: the total time that this edge was anywhere on the stack.} -@item{@scheme[caller] and @scheme[callee] hold the two nodes that are +@item{@racket[caller] and @racket[callee] hold the two nodes that are connected by this edge.} -@item{@scheme[caller-time] and @scheme[callee-time] hold the time +@item{@racket[caller-time] and @racket[callee-time] hold the time spent on this edge from the caller's or the callee's perspective. These times are different from each other (as well as from the total time) because the sums that make them are each divided by the number @@ -150,7 +150,7 @@ of an analyzed profile result. for the @tt{A @'rarr A} edge, for example). Its caller time is charged 1/2 second because @tt{A} appears twice in this stack snapshot (in the other half, @tt{A} is chared for being a leaf --- - the caller of the special @scheme[*-node]), and its callee time is + the caller of the special @racket[*-node]), and its callee time is charged 1/3 respectively.} ]} diff --git a/collects/profile/scribblings/profile.scrbl b/collects/profile/scribblings/profile.scrbl index 24fc1be709..6489cc7ae4 100644 --- a/collects/profile/scribblings/profile.scrbl +++ b/collects/profile/scribblings/profile.scrbl @@ -5,12 +5,12 @@ @title{@bold{Profile}: Statistical Profiler} -The @scheme[profile] collection implements a statistical profiler. +The @racket[profile] collection implements a statistical profiler. The profiling is done by running a background thread that collects -stack snapshots via @scheme[continuation-mark-set->context], meaning +stack snapshots via @racket[continuation-mark-set->context], meaning that the result is an estimate of the execution costs and it is limited to the kind of information that -@scheme[continuation-mark-set->context] produces (most notably being +@racket[continuation-mark-set->context] produces (most notably being limited to functions calls, and subject to compiler optimizations); but the result is often useful. In practice, since this method does not require recompilation of your source and has very little runtime diff --git a/collects/profile/scribblings/renderers.scrbl b/collects/profile/scribblings/renderers.scrbl index eff9cb6779..8486b58a6f 100644 --- a/collects/profile/scribblings/renderers.scrbl +++ b/collects/profile/scribblings/renderers.scrbl @@ -11,9 +11,9 @@ After collecting the profile samples and analyzing the data, the last aspect of profiling is to render the results. The profile collection provides several renderers, each providing a rendering function that -consumes a @scheme[profile] instance. See the +consumes a @racket[profile] instance. See the @seclink["analyzer"]{analyzer} section for a description of the -@scheme[profile] struct if you want to implement your own renderer. +@racket[profile] struct if you want to implement your own renderer. @;-------------------------------------------------------------------- @section{Textual Rendering} @@ -27,7 +27,7 @@ consumes a @scheme[profile] instance. See the [#:hide-subs hide-subs% (between/c 0 1) 2/100]) void?]{ -Prints the given @scheme[profile] results as a textual table. +Prints the given @racket[profile] results as a textual table. The printout begins with some general facts about the profile, and then a table that represents the call-graph is printed. Each row in @@ -52,7 +52,7 @@ numbers and labels is as follows: @item{@tt{N2} --- the time (in milliseconds) that this function has been anywhere in a stack snapshot. This is the total time that the execution was somewhere in this function or in its callees. - (Corresponds to the @scheme[node-total] field.)} + (Corresponds to the @racket[node-total] field.)} @item{@tt{N3} --- this is the percentage of the node's total time (@tt{N2}) from the total observed time of the profile. An entry with a 100% refers to a function that was active throughout the @@ -60,7 +60,7 @@ numbers and labels is as follows: @item{@tt{N4} --- the time (in milliseconds) that this function has been at the top of the stack snapshot. This is the time that this function consumed doing work itself rather than calling other - functions. (Corresponds to the @scheme[node-self] field.)} + functions. (Corresponds to the @racket[node-self] field.)} @item{@tt{N5} --- this is the percentage of @tt{N4} out of the total observed time of the profile. Functions with high values here can be good candidates for optimization, But, of course, they can @@ -84,22 +84,22 @@ numbers and labels is as follows: The total percentages for the all caller and for all callees should be close to 100% minus the time @tt{A} was the leaf or the root. - These values correspond to the @scheme[edge-caller-time] and - @scheme[edge-callee-time] fields; see the documentation for further + These values correspond to the @racket[edge-caller-time] and + @racket[edge-callee-time] fields; see the documentation for further details.} ] The function has a few keyword arguments to customize its output: @itemize[ -@item{The @scheme[truncate-source] argument determines the length that +@item{The @racket[truncate-source] argument determines the length that the source string should take (together with its label).} -@item{@scheme[hide-self%] and @scheme[hide-subs%] control hiding some +@item{@racket[hide-self%] and @racket[hide-subs%] control hiding some of the nodes. A node is hidden if its self time (@tt{N3} in the - above example) is smaller than @scheme[hide-self%] @emph{and} if all + above example) is smaller than @racket[hide-self%] @emph{and} if all places where it occurs as a caller or a callee have percentages that - are smaller than @scheme[hide-subs%]. The reason for requiring both + are smaller than @racket[hide-subs%]. The reason for requiring both conditions is to avoid having ``dangling references'' to hidden nodes.} @@ -117,7 +117,7 @@ The function has a few keyword arguments to customize its output: [#:hide-subs hide-subs% (between/c 0 1) 2/100]) void?]{ -Prints the given @scheme[profile] results as a Graphviz directed +Prints the given @racket[profile] results as a Graphviz directed graph. This is an experimental module, provided mostly as a proof-of-concept. diff --git a/collects/profile/scribblings/sampler.scrbl b/collects/profile/scribblings/sampler.scrbl index 19b96334df..f6d15307c2 100644 --- a/collects/profile/scribblings/sampler.scrbl +++ b/collects/profile/scribblings/sampler.scrbl @@ -14,11 +14,11 @@ ((symbol?) (any/c) . ->* . any/c)]{ Creates a sample collector thread, which tracks the given -@scheme[to-track] value every @scheme[delay] seconds. The -@scheme[to-track] value can be either a thread (track just that +@racket[to-track] value every @racket[delay] seconds. The +@racket[to-track] value can be either a thread (track just that thread), a custodian (track all threads managed by the custodian), or a list of threads and/or custodians. If a custodian is given, it must -be subordinate to @scheme[super-cust], which defaults to the current +be subordinate to @racket[super-cust], which defaults to the current custodian. The resulting value is a controller function, which consumes a message @@ -26,26 +26,26 @@ consisting of a symbol and an optional argument, and can affect the sampler. The following messages are currently supported: @itemize[ -@item{@scheme['pause] and @scheme['resume] will stop or resume data +@item{@racket['pause] and @racket['resume] will stop or resume data collection. These messages can be nested. Note that the thread will continue running it will just stop collecting snapshots.} -@item{@scheme['stop] kills the controlled thread. It should be called +@item{@racket['stop] kills the controlled thread. It should be called when no additional data should be collected. (This is currently irreversible: there is no message to start a new sampler thread.)} -@item{@scheme['set-tracked!] with a value will change the tracked - objects (initially specified as the @scheme[to-track] argument) to +@item{@racket['set-tracked!] with a value will change the tracked + objects (initially specified as the @racket[to-track] argument) to the given value.} -@item{@scheme['set-tracked!] with a value will change the delay that +@item{@racket['set-tracked!] with a value will change the delay that the sampler us taking between snapshots. Note that although changing this means that the snapshots are not uniformly distributed, the results will still be sensible --- this is because the cpu time between samples is taken into account when the resulting data is analyzed.} -@item{Finally, a @scheme['get-snapshots] message will make the +@item{Finally, a @racket['get-snapshots] message will make the controller return the currently collected data. Note that this can be called multiple times, each call will return the data thatis collected up to that point in time. In addition, it can be (and @@ -53,7 +53,7 @@ continue running it will just stop collecting snapshots.} The value that is returned should be considered as an undocumented internal detail of the profiler, to be sent to - @scheme[analyze-samples] for analysis. The reason this is not done + @racket[analyze-samples] for analysis. The reason this is not done automatically, is that a future extension might allow you to combine several sampler results, making it possible to combine a profile analysis from several individual runs, possibly from different diff --git a/collects/profile/scribblings/toplevel.scrbl b/collects/profile/scribblings/toplevel.scrbl index 4beabccf3e..de0ebe5d7f 100644 --- a/collects/profile/scribblings/toplevel.scrbl +++ b/collects/profile/scribblings/toplevel.scrbl @@ -29,40 +29,40 @@ Executes the given thunk while collecting profiling data, and render this data when done. Keyword arguments can customize the profiling: @itemize[ -@item{The profiler works by @scheme[create-sampler] starting a +@item{The profiler works by @racket[create-sampler] starting a ``sampler'' thread whose job is to collect stack samples - periodically (using @scheme[continuation-mark-set->context]). - @scheme[delay] determines the amount of time the sampler - @scheme[sleep]s for between samples. Note that this is will be + periodically (using @racket[continuation-mark-set->context]). + @racket[delay] determines the amount of time the sampler + @racket[sleep]s for between samples. Note that this is will be close, but not identical to, the frequency in which data is actually sampled.} @item{When the profiled computation takes a short amount of time, the collected data will not be accurate. In this case, you can specify - an @scheme[iterations] argument to repeat the evaluation a number of + an @racket[iterations] argument to repeat the evaluation a number of times which will improve the accuracy of the resulting report.} @item{Normally, the sampler collects snapshots of the - @scheme[current-thread]'s stack. If there is some computation that + @racket[current-thread]'s stack. If there is some computation that happens on a different thread, that work will not be reflected in the results: the only effect will be suspiciously small value for the observed time, because the collected data is taking into account the cpu time that the thread actually performed (it uses - @scheme[current-process-milliseconds] with the running thread as an - argument). Specifying a non-@scheme[#f] value for the - @scheme[threads?] argument will arrange for all threads that are + @racket[current-process-milliseconds] with the running thread as an + argument). Specifying a non-@racket[#f] value for the + @racket[threads?] argument will arrange for all threads that are started during the evaluation to be tracked. Note that this means that the computation will actually run in a new sub-custodian, as this is the only way to be able to track such threads.} @item{Once the computation has finished, the sampler is stopped, and the accumulated data is collected. It is then analyzed by - @scheme[analyze-samples], and the analyzed profile data is fed into - a renderer. Use an identity function (@scheme[values]) to get the + @racket[analyze-samples], and the analyzed profile data is fed into + a renderer. Use an identity function (@racket[values]) to get the analyzed result, and render it yourself, or use one of the existing renderers (see @secref["renderers"]).} -@item{The @scheme[periodic-renderer] argument can be set to a list +@item{The @racket[periodic-renderer] argument can be set to a list holding a delay time and a renderer. In this case, the given renderer will be called periodically. This is useful for cases where you want a dynamically updated display of the results. This @@ -72,6 +72,6 @@ this data when done. Keyword arguments can customize the profiling: @defform[(profile expr keyword-arguments ...)]{ -A macro version of @scheme[profile-thunk]. The keyword arguments can +A macro version of @racket[profile-thunk]. The keyword arguments can be specified in the same was as for a function call: they can appear before and/or after the expression to be profiled.} diff --git a/collects/racket/sandbox.rkt b/collects/racket/sandbox.rkt index d2a80866f6..9a3d7069e0 100644 --- a/collects/racket/sandbox.rkt +++ b/collects/racket/sandbox.rkt @@ -54,7 +54,7 @@ (define gui? (gui-available?)) -(define-syntax mz/mr ; use a value for mzracket, or pull a mred binding +(define-syntax mz/mr ; use a value for plain racket, or pull a gui binding (syntax-rules () [(mz/mr mzval mrsym) (if gui? (gui-dynamic-require 'mrsym) mzval)])) diff --git a/collects/racklog/racklog.scrbl b/collects/racklog/racklog.scrbl index ddd4c01e3e..d3af1fc349 100644 --- a/collects/racklog/racklog.scrbl +++ b/collects/racklog/racklog.scrbl @@ -11,7 +11,8 @@ @author{Dorai Sitaram} -@margin-note{Adapted from Schelog by Dorai Sitaram for Racket by Dorai Sitaram, John Clements, and Jay McCarthy.} +@margin-note{Adapted from Schelog by Dorai Sitaram for Racket by Dorai Sitaram, + John Clements, and Jay McCarthy.} @defmodule[racklog] @@ -1139,19 +1140,36 @@ The accepted syntax is available in the @secref[#:doc '(lib "datalog/scribblings @defproc[(logic-var? [x any/c]) boolean?]{Identifies a logic variable.} -@defproc[(atomic-struct? [x any/c]) boolean?]{Identifies structures that the @scheme[(current-inspector)] cannot inspect.} +@defproc[(atomic-struct? [x any/c]) boolean?]{ + Identifies structures that the @racket[(current-inspector)] cannot inspect.} -@defproc[(atom? [x any/c]) boolean?]{Identifies atomic values that may appear in Racklog programs. Equivalent to the contract @racket[(or/c boolean? number? string? bytes? char? symbol? regexp? pregexp? byte-regexp? byte-pregexp? keyword? null? procedure? void? set? atomic-struct?)].} +@defproc[(atom? [x any/c]) boolean?]{ + Identifies atomic values that may appear in Racklog programs. Equivalent to + the contract @racket[(or/c boolean? number? string? bytes? char? symbol? + regexp? pregexp? byte-regexp? byte-pregexp? keyword? null? procedure? void? + set? atomic-struct?)].} -@defproc[(compound-struct? [x any/c]) boolean?]{Identifies structures that the @scheme[(current-inspector)] can inspect.} +@defproc[(compound-struct? [x any/c]) boolean?]{ + Identifies structures that the @racket[(current-inspector)] can inspect.} -@defproc[(compound? [x any/c]) boolean?]{Identifies compound values that may appear in Racklog programs. Equivalent to the contract @racket[(or/c pair? vector? mpair? box? hash? compound-struct?)].} +@defproc[(compound? [x any/c]) boolean?]{ + Identifies compound values that may appear in Racklog programs. Equivalent to + the contract + @racket[(or/c pair? vector? mpair? box? hash? compound-struct?)].} -@defproc[(unifiable? [x any/c]) boolean?]{Identifies values that may appear in Racklog programs. Essentialy either an @racket[atom?], @racket[logic-var?], or @racket[compound?] that contains @scheme[unifiable?]s.} +@defproc[(unifiable? [x any/c]) boolean?]{ + Identifies values that may appear in Racklog programs. Essentialy either an + @racket[atom?], @racket[logic-var?], or @racket[compound?] that contains + @racket[unifiable?]s.} -@defproc[(answer-value? [x any/c]) boolean?]{Identifies values that may appear in @racket[answer?]. Essentially @racket[unifiable?]s that do not contain @racket[logic-var?]s.} +@defproc[(answer-value? [x any/c]) boolean?]{ + Identifies values that may appear in @racket[answer?]. Essentially + @racket[unifiable?]s that do not contain @racket[logic-var?]s.} -@defproc[(answer? [x any/c]) boolean?]{Identifies answers returned by @racket[%more] and @racket[%which]. Equivalent to the contract @racket[(or/c false/c (listof (cons/c symbol? answer-value?)))].} +@defproc[(answer? [x any/c]) boolean?]{ + Identifies answers returned by @racket[%more] and @racket[%which]. Equivalent + to the contract + @racket[(or/c false/c (listof (cons/c symbol? answer-value?)))].} @defthing[goal/c contract?]{A contract for goals.} @@ -1209,7 +1227,7 @@ local logic variables for @racket[clause], ....} [V identifier?])]{ Like @racket[%assert!], but adds the new clauses to the @emph{front} of the existing predicate.} - + @subsection{Racklog Variables} @defproc[(_) logic-var?]{ @@ -1223,7 +1241,7 @@ lexical names for the logic variables it creates.) #:contracts ([V identifier?])]{ Introduces @racket[V], ..., as lexically scoped logic variables to be used in @racket[expr], ...} - + @subsection{Cut} @defform[(%cut-delimiter . any)]{ @@ -1339,7 +1357,7 @@ instantiations of @racket[E1] for which goal @racket[G] succeeds.} @defpred[(%set-of-1 [E1 unifiable?] [G goal/c] [E2 unifiable?])]{ Similar to @racket[%set-of], but fails if the set is empty.} - + @defpred[(%bag-of [E1 unifiable?] [G goal/c] [E2 unifiable?])]{ The goal @racket[(%bag-of E1 G E2)] unifies with @racket[E2] the @emph{bag} (multiset) @@ -1399,7 +1417,7 @@ new logic variables are used for unbound logic variables in @defpred[(%copy [F unifiable?] [S unifiable?])]{ The goal @racket[(%copy F S)] unifies with @racket[S] a copy of the frozen structure in @racket[F].} - + @bibliography[ @bib-entry[#:key "aop" #:author "Leon Sterling and Ehud Shapiro" diff --git a/collects/rackunit/scribblings/internals.scrbl b/collects/rackunit/scribblings/internals.scrbl index 586ceb7d8f..15d68563f4 100644 --- a/collects/rackunit/scribblings/internals.scrbl +++ b/collects/rackunit/scribblings/internals.scrbl @@ -167,7 +167,7 @@ The @racket[test] argument is a test case or test suite. The @racket[run] argument is a function from a test case name (string) and action (thunk) to any values. The values produced by @racket[run] -are fed into the @scheme[result-fn]. +are fed into the @racket[result-fn]. The @racket[fdown] argument is a function from a test suite name (string) and the seed, to a new seed. diff --git a/collects/redex/redex.scrbl b/collects/redex/redex.scrbl index cb5e293ac0..0777924a0c 100644 --- a/collects/redex/redex.scrbl +++ b/collects/redex/redex.scrbl @@ -376,13 +376,13 @@ nested lists. pattern matching and metafunction evaluation. There is a separate cache for each pattern and metafunction; when one fills (see @racket[set-cache-size!]), Redex evicts all of the entries in that cache. - + Caching should be disabled when matching a pattern that depends on values other than the in-scope pattern variables or evaluating a metafunction that reads or writes mutable external state. } -@defproc[(set-cache-size! [size positive-integer?]) void?]{ +@defproc[(set-cache-size! [size positive-integer?]) void?]{ Changes the size of the per-pattern and per-metafunction caches. The default size is @racket[350]. } @@ -630,7 +630,7 @@ variables, @racket[c] for the evaluation contexts and @racket[v] for values. A non-terminal's names and productions may be separated by the keyword @racket[::=]. Use of the @racket[::=] keyword outside a language definition is a syntax error. } - + @defform/subs[(define-extended-language extended-lang base-lang non-terminal-def ...) ([non-terminal-def (non-terminal-name ...+ ::= @#,ttpattern ...+) @@ -914,7 +914,7 @@ it is traversing through the reduction graph. and @racket[test-->>]'s cycle checking. See @racket[apply-reduction-relation*] for more details. } - + @examples[ #:eval redex-eval (define-language empty-lang) @@ -926,7 +926,7 @@ it is traversing through the reduction graph. (--> 2 3) (--> 3 3))) (apply-reduction-relation R 0) - (apply-reduction-relation* R 0)] + (apply-reduction-relation* R 0)] @defidform[-->]{ Recognized specially within @racket[reduction-relation]. A @racket[-->] form is an @@ -1164,7 +1164,7 @@ Tests to see if the term @racket[e1-expr], reduces to the terms @racket[e2-expr] in a single @racket[rel-expr] step, using @racket[pred-expr] to determine equivalence. } - + @examples[ #:eval redex-eval (define-language L @@ -1286,7 +1286,7 @@ metafunctions or unnamed reduction-relation cases) to application counts.} #:contracts ([size-expr natural-number/c] [attempt-num-expr natural-number/c] [retries-expr natural-number/c])]{ - + In its first form, @racket[generate-term] produces a random term according to @racket[term-spec], which is either a language and a pattern, the name of a metafunction, or an expression producing a reduction relation. In the @@ -1329,7 +1329,7 @@ The argument @racket[size-expr] bounds the height of the generated term (define-metafunction L [(F one-clause n) ()] [(F another-clause n) ()]) - + (generate-term #:source F 5)] The optional keyword argument @racket[attempt-num-expr] @@ -1349,7 +1349,7 @@ repeating as necessary. The optional keyword argument @racket[retries-expr] @racket[generate-term] is unable to produce a satisfying term after @racket[retries-expr] attempts, it raises an exception recognized by @racket[exn:fail:redex:generation-failure?].} - + @defform/subs[(redex-check language @#,ttpattern property-expr kw-arg ...) ([kw-arg (code:line #:attempts attempts-expr) (code:line #:source metafunction) @@ -1518,7 +1518,7 @@ produces and consumes argument lists.} (Σ ,(+ (term number_1) (term number_2)) number_3 ...)]) (check-metafunction Σ (λ (args) (printf "~s\n" args)) #:attempts 2)] - + @defproc[(default-attempt-size [n natural-number/c]) natural-number/c]{ The default value of the @racket[#:attempt-size] argument to @racket[redex-check] and the other randomized testing forms, this @@ -1899,7 +1899,7 @@ color used to draw the label on the edge. parameters to adjust how printing happens. } - + @defproc[(default-pretty-printer [v any/c] [port output-port?] [width exact-nonnegative-integer?] [text (is-a?/c text%)]) void?]{ This is the default value of @racket[pp] used by @racket[traces] and @@ -1960,7 +1960,7 @@ sets @racket[dc-for-text-size] and the latter does not. @racket[render-language] for details on the construction of the pict. } - + @defproc[(term->pict [lang compiled-lang?] [term any/c]) pict?]{ Produces a pict like @racket[render-term], but without adjusting @racket[dc-for-text-size]. @@ -1969,7 +1969,7 @@ sets @racket[dc-for-text-size] and the latter does not. Slideshow or with other tools that combine picts together. } - + @defproc[(render-language [lang compiled-lang?] [file (or/c false/c path-string?) #f] [#:nts nts (or/c false/c (listof (or/c string? symbol?))) @@ -2203,8 +2203,8 @@ This parameter controls the typesetting of metafunction definitions and applications. When it is non-@racket[#f] (the default), commas precede ellipses that represent argument sequences; when it is @racket[#f] no commas appear in those positions. -} - +} + @defparam[linebreaks breaks (or/c #f (listof boolean?))]{ This parameter controls which cases in the metafunction are rendered on two lines and which are rendered on one. @@ -2215,7 +2215,7 @@ precede ellipses that represent argument sequences; when it is This influences the @racket['left/right] styles only. } - + @defparam[metafunction-cases cases (or/c #f (and/c (listof (and/c integer? diff --git a/collects/scheme/sandbox.rkt b/collects/scheme/sandbox.rkt index 75d4169142..49696fa322 100644 --- a/collects/scheme/sandbox.rkt +++ b/collects/scheme/sandbox.rkt @@ -12,7 +12,7 @@ [scheme:make-module-evaluator make-module-evaluator])) ;; copied from racket/sandbox :( -(define-syntax mz/mr ; use a value for mzracket, or pull a mred binding +(define-syntax mz/mr ; use a value for plain racket, or pull a gui binding (syntax-rules () [(mz/mr mzval mrsym) (if gui? (gui-dynamic-require 'mrsym) mzval)])) diff --git a/collects/scribble/private/lp.rkt b/collects/scribble/private/lp.rkt index b5b189b2a3..64039e787f 100644 --- a/collects/scribble/private/lp.rkt +++ b/collects/scribble/private/lp.rkt @@ -66,7 +66,7 @@ (list (smaller (elemref '(chunk tag) #:underline? #f str rest ...)))) - (schemeblock expr ...))))))])) + (racketblock expr ...))))))])) (define-syntax (chunkref stx) (syntax-case stx () diff --git a/collects/scribble/private/manual-class.rkt b/collects/scribble/private/manual-class.rkt index d4ced3a883..192304f74c 100644 --- a/collects/scribble/private/manual-class.rkt +++ b/collects/scribble/private/manual-class.rkt @@ -218,9 +218,9 @@ (car content))) spacer ":" spacer (case kind - [(class) (scheme class?)] - [(interface) (scheme interface?)] - [(mixin) (schemeblockelem (class? . -> . class?))]))))))) + [(class) (racket class?)] + [(interface) (racket interface?)] + [(mixin) (racketblockelem (class? . -> . class?))]))))))) (if super (list (list (make-flow diff --git a/collects/scribble/private/manual-form.rkt b/collects/scribble/private/manual-form.rkt index f0ab889a6b..5a03d100f5 100644 --- a/collects/scribble/private/manual-form.rkt +++ b/collects/scribble/private/manual-form.rkt @@ -55,21 +55,21 @@ stx id))) (syntax->list #'(lit ...))) - #'(with-togetherable-scheme-variables + #'(with-togetherable-racket-variables (lit ...) - ([form spec] [form spec1] ... + ([form spec] [form spec1] ... [non-term (non-term-id non-term-form ...)] ...) (*defforms (quote-syntax/loc defined-id) '(spec spec1 ...) - (list (lambda (x) (schemeblock0/form new-spec)) - (lambda (ignored) (schemeblock0/form spec1)) ...) + (list (lambda (x) (racketblock0/form new-spec)) + (lambda (ignored) (racketblock0/form spec1)) ...) '((non-term-id non-term-form ...) ...) - (list (list (lambda () (scheme non-term-id)) - (lambda () (schemeblock0/form non-term-form)) + (list (list (lambda () (racket non-term-id)) + (lambda () (racketblock0/form non-term-form)) ...) ...) - (list (list (lambda () (scheme contract-nonterm)) - (lambda () (schemeblock0 contract-expr))) + (list (list (lambda () (racket contract-nonterm)) + (lambda () (racketblock0 contract-expr))) ...) (lambda () (list desc ...)))))] [(fm #:id defined-id #:literals (lit ...) [spec spec1 ...] @@ -156,14 +156,14 @@ stx id))) (syntax->list #'(lit ...))) - #'(with-togetherable-scheme-variables + #'(with-togetherable-racket-variables (lit ...) ([form/none spec]) (*defforms #f - '(spec) (list (lambda (ignored) (schemeblock0/form spec))) + '(spec) (list (lambda (ignored) (racketblock0/form spec))) null null - (list (list (lambda () (scheme contract-id)) - (lambda () (schemeblock0 contract-expr))) + (list (list (lambda () (racket contract-id)) + (lambda () (racketblock0 contract-expr))) ...) (lambda () (list desc ...)))))] [(fm #:literals (lit ...) spec desc ...) @@ -182,7 +182,7 @@ (define-syntax (defidform stx) (syntax-case stx () [(_ spec-id desc ...) - #'(with-togetherable-scheme-variables + #'(with-togetherable-racket-variables () () (*defforms (quote-syntax/loc spec-id) @@ -212,18 +212,18 @@ [(_ has-kw? #:literals (lit ...) spec ([non-term-id non-term-form ...] ...) #:contracts ([contract-nonterm contract-expr] ...) desc ...) - (with-scheme-variables + (with-racket-variables (lit ...) ([form/maybe (has-kw? spec)] [non-term (non-term-id non-term-form ...)] ...) - (*specsubform 'spec '(lit ...) (lambda () (schemeblock0/form spec)) + (*specsubform 'spec '(lit ...) (lambda () (racketblock0/form spec)) '((non-term-id non-term-form ...) ...) - (list (list (lambda () (scheme non-term-id)) - (lambda () (schemeblock0/form non-term-form)) + (list (list (lambda () (racket non-term-id)) + (lambda () (racketblock0/form non-term-form)) ...) ...) - (list (list (lambda () (scheme contract-nonterm)) - (lambda () (schemeblock0 contract-expr))) + (list (list (lambda () (racket contract-nonterm)) + (lambda () (racketblock0 contract-expr))) ...) (lambda () (list desc ...))))] [(_ has-kw? #:literals (lit ...) spec ([non-term-id non-term-form ...] ...) @@ -272,7 +272,7 @@ desc ...)])) (define-syntax-rule (specsubform/inline spec desc ...) - (with-scheme-variables + (with-racket-variables () ([form/maybe (#f spec)]) (*specsubform 'spec null #f null null null (lambda () (list desc ...))))) @@ -280,26 +280,26 @@ (define-syntax racketgrammar (syntax-rules () [(_ #:literals (lit ...) id clause ...) - (with-scheme-variables + (with-racket-variables (lit ...) ([non-term (id clause ...)]) (*racketgrammar '(lit ...) '(id clause ...) (lambda () - (list (list (scheme id) - (schemeblock0/form clause) ...)))))] + (list (list (racket id) + (racketblock0/form clause) ...)))))] [(_ id clause ...) (racketgrammar #:literals () id clause ...)])) (define-syntax racketgrammar* (syntax-rules () [(_ #:literals (lit ...) [id clause ...] ...) - (with-scheme-variables + (with-racket-variables (lit ...) ([non-term (id clause ...)] ...) (*racketgrammar '(lit ...) '(id ... clause ... ...) (lambda () - (list (list (scheme id) (schemeblock0/form clause) ...) + (list (list (racket id) (racketblock0/form clause) ...) ...))))] [(_ [id clause ...] ...) (racketgrammar* #:literals () [id clause ...] ...)])) @@ -363,7 +363,7 @@ (list (let ([l (map (lambda (sub) (map (lambda (f) (f)) sub)) sub-procs)]) - (*schemerawgrammars "specgrammar" + (*racketrawgrammars "specgrammar" (map car l) (map cdr l)))))))) (make-contracts-table contract-procs))) @@ -391,13 +391,13 @@ (list (let ([l (map (lambda (sub) (map (lambda (f) (f)) sub)) sub-procs)]) - (*schemerawgrammars "specgrammar" + (*racketrawgrammars "specgrammar" (map car l) (map cdr l)))))))) (make-contracts-table contract-procs)))) (flow-paragraphs (decode-flow (content-thunk))))))) -(define (*schemerawgrammars style nonterms clauseses) +(define (*racketrawgrammars style nonterms clauseses) (make-table `((valignment baseline baseline baseline baseline baseline) (alignment right left center left left) @@ -417,12 +417,12 @@ (cdr clauses)))) nonterms clauseses)))) -(define (*schemerawgrammar style nonterm clause1 . clauses) - (*schemerawgrammars style (list nonterm) (list (cons clause1 clauses)))) +(define (*racketrawgrammar style nonterm clause1 . clauses) + (*racketrawgrammars style (list nonterm) (list (cons clause1 clauses)))) (define (*racketgrammar lits s-expr clauseses-thunk) (let ([l (clauseses-thunk)]) - (*schemerawgrammars #f + (*racketrawgrammars #f (map (lambda (x) (make-element #f (list (hspace 2) diff --git a/collects/scribble/private/manual-mod.rkt b/collects/scribble/private/manual-mod.rkt index 3c70def441..5bb0288730 100644 --- a/collects/scribble/private/manual-mod.rkt +++ b/collects/scribble/private/manual-mod.rkt @@ -22,7 +22,7 @@ (define-syntax defmodule*/no-declare (syntax-rules () [(_ #:require-form req (name ...) . content) - (*defmodule (list (schememodname name) ...) + (*defmodule (list (racketmodname name) ...) #f #f (list . content) @@ -52,19 +52,30 @@ (define-syntax defmodulelang*/no-declare (syntax-rules () [(_ (lang ...) #:module-paths (modpath ...) . content) - (*defmodule (list lang ...) (list (schememodname modpath) ...) #t (list . content) #f)] + (*defmodule (list lang ...) + (list (racketmodname modpath) ...) + #t (list . content) #f)] [(_ (lang ...) . content) - (*defmodule (list (schememodname lang) ...) #f #t (list . content) #f)])) + (*defmodule (list (racketmodname lang) ...) + #f #t (list . content) #f)])) (define-syntax defmodulelang* (syntax-rules () - [(_ (name ...) #:module-paths (modpath ...) #:use-sources (pname ...) . content) + [(_ (name ...) #:module-paths (modpath ...) + #:use-sources (pname ...) + . content) (begin (declare-exporting modpath ... #:use-sources (pname ...)) - (defmodulelang*/no-declare (name ...) #:module-paths (modpath ...) . content))] + (defmodulelang*/no-declare (name ...) + #:module-paths (modpath ...) + . content))] [(_ (name ...) #:module-paths (modpath ...) . content) - (defmodulelang* (name ...) #:module-paths (modpath ...) #:use-sources () . content)] + (defmodulelang* (name ...) + #:module-paths (modpath ...) + #:use-sources () . content)] [(_ (name ...) #:use-sources (pname ...) . content) - (defmodulelang* ((schememodname name) ...) #:module-paths (name ...) #:use-sources (pname ...) . content)] + (defmodulelang* ((racketmodname name) ...) + #:module-paths (name ...) + #:use-sources (pname ...) . content)] [(_ (name ...) . content) (defmodulelang* (name ...) #:use-sources () . content)])) @@ -76,7 +87,8 @@ (defmodulelang* (lang) . content)])) (define-syntax-rule (defmodulereader*/no-declare (lang ...) . content) - (*defmodule (list (schememodname lang) ...) #f 'reader (list . content) #f)) + (*defmodule (list (racketmodname lang) ...) + #f 'reader (list . content) #f)) (define-syntax defmodulereader* (syntax-rules () @@ -105,13 +117,13 @@ spacer (case lang [(#f) - (list (scheme (#,req #,(make-defschememodname name modpath))))] + (list (racket (#,req #,(make-defracketmodname name modpath))))] [(#t) - (list (hash-lang) spacer (make-defschememodname name modpath))] + (list (hash-lang) spacer (make-defracketmodname name modpath))] [(reader) - (list (schememetafont "#reader") spacer (make-defschememodname name modpath))] + (list (racketmetafont "#reader") spacer (make-defracketmodname name modpath))] [(just-lang) - (list (hash-lang) spacer (make-defschememodname name modpath))]))))))) + (list (hash-lang) spacer (make-defracketmodname name modpath))]))))))) names modpaths)) (append (map (lambda (modpath) @@ -119,7 +131,7 @@ modpaths) (flow-paragraphs (decode-flow content))))))) -(define (make-defschememodname mn mp) +(define (make-defracketmodname mn mp) (let ([name-str (element->string mn)] [path-str (element->string mp)]) (make-index-element #f diff --git a/collects/scribble/private/manual-proc.rkt b/collects/scribble/private/manual-proc.rkt index a01168bfe4..8ed3c3e045 100644 --- a/collects/scribble/private/manual-proc.rkt +++ b/collects/scribble/private/manual-proc.rkt @@ -34,26 +34,26 @@ (make-element meta-color (list "...+"))) (define (make-openers n) - (schemeparenfont + (racketparenfont (case n [(1) "("] [(0) ""] [(2) "(("] [else (make-string n #\()]))) (define (make-closers n) - (schemeparenfont + (racketparenfont (case n [(1) ")"] [(0) ""] [(2) "))"] [else (make-string n #\()]))) (define-syntax (arg-contract stx) (syntax-case stx (... ...+ _...superclass-args...) [(_ [id contract]) (identifier? #'id) - #'(schemeblock0 contract)] + #'(racketblock0 contract)] [(_ [id contract val]) (identifier? #'id) - #'(schemeblock0 contract)] + #'(racketblock0 contract)] [(_ [kw id contract]) (and (keyword? (syntax-e #'kw)) (identifier? #'id)) - #'(schemeblock0 contract)] + #'(racketblock0 contract)] [(_ [kw id contract val]) (and (keyword? (syntax-e #'kw)) (identifier? #'id)) - #'(schemeblock0 contract)] + #'(racketblock0 contract)] [(_ (... ...)) #'#f] [(_ (... ...+)) #'#f] [(_ _...superclass-args...) #'#f] @@ -66,13 +66,13 @@ #'#f] [(_ [id contract val]) (identifier? #'id) - #'(schemeblock0 val)] + #'(racketblock0 val)] [(_ [kw id contract]) (keyword? (syntax-e #'kw)) #'#f] [(_ [kw id contract val]) (keyword? (syntax-e #'kw)) - #'(schemeblock0 val)] + #'(racketblock0 val)] [_ #'#f])) (define-syntax (extract-proc-id stx) @@ -105,12 +105,12 @@ (define-syntax (result-contract stx) (syntax-case stx (values) [(_ (values c ...)) - #'(list (schemeblock0 c) ...)] + #'(list (racketblock0 c) ...)] [(_ c) (if (string? (syntax-e #'c)) (raise-syntax-error 'defproc "expected a result contract, found a string" #'c) - #'(schemeblock0 c))])) + #'(racketblock0 c))])) (define-syntax-rule (defproc (id arg ...) result desc ...) (defproc* [[(id arg ...) result]] desc ...)) @@ -120,7 +120,7 @@ [(_ [[proto result] ...] desc ...) (defproc* #:mode procedure #:within #f [[proto result] ...] desc ...)] [(_ #:mode m #:within cl [[proto result] ...] desc ...) - (with-togetherable-scheme-variables + (with-togetherable-racket-variables () ([proc proto] ...) (*defproc 'm (quote-syntax/loc cl) @@ -142,11 +142,11 @@ (if (arg-kw arg) (if (eq? mode 'new) (make-element - #f (list (schemeparenfont "[") - (schemeidfont (keyword->string (arg-kw arg))) + #f (list (racketparenfont "[") + (racketidfont (keyword->string (arg-kw arg))) spacer (to-element (make-var-id (arg-id arg))) - (schemeparenfont "]"))) + (racketparenfont "]"))) (make-element #f (list (to-element (arg-kw arg)) spacer @@ -237,14 +237,14 @@ (define tagged (cond [(eq? mode 'new) - (make-element #f (list (scheme new) spacer (to-element within-id)))] + (make-element #f (list (racket new) spacer (to-element within-id)))] [(eq? mode 'make) (make-element - #f (list (scheme make-object) spacer (to-element within-id)))] + #f (list (racket make-object) spacer (to-element within-id)))] [(eq? mode 'send) (make-element #f - (list (scheme send) spacer + (list (racket send) spacer (name-this-object (syntax-e within-id)) spacer (if first? (let* ([mname (extract-id prototype)] @@ -350,7 +350,7 @@ (append-map (lambda (arg) (list spacer ((arg->elem #t) arg))) args)) - ,(schemeparenfont ")")))) + ,(racketparenfont ")")))) (if result-next-line? null end)))) ;; The multi-line case: (let ([not-end (if result-next-line? @@ -403,7 +403,7 @@ [(null? ((if dots-next? cddr cdr) args)) (make-element #f - (list a next (schemeparenfont ")")))] + (list a next (racketparenfont ")")))] [(equal? next "") a] [else (make-element #f (list a next))]))) @@ -544,12 +544,12 @@ (define-syntax-rule (**defstruct name ([field field-contract] ...) immutable? transparent? prefab? cname extra-cname? desc ...) - (with-togetherable-scheme-variables + (with-togetherable-racket-variables () () (*defstruct (quote-syntax/loc name) 'name (quote-syntax/loc cname) extra-cname? '([field field-contract] ...) - (list (lambda () (schemeblock0 field-contract)) ...) + (list (lambda () (racketblock0 field-contract)) ...) immutable? transparent? prefab? (lambda () (list desc ...))))) (define (*defstruct stx-id name alt-cname-id extra-cname? @@ -640,7 +640,7 @@ (make-omitable-paragraph (list (to-element - `(,(scheme struct) + `(,(racket struct) ,the-name ,(map field-view fields))))) (let* ([one-right-column? @@ -658,8 +658,8 @@ (append (list (to-flow (make-element #f (list - (schemeparenfont "(") - (scheme struct)))) + (racketparenfont "(") + (racket struct)))) flow-spacer) (if one-right-column? (list (to-flow (make-element @@ -671,11 +671,11 @@ (if (and immutable? (not transparent?) (not cname-id)) - (list (schemeparenfont ")")) + (list (racketparenfont ")")) null))))) (list (to-flow the-name) (to-flow (make-element - #f (list spacer (schemeparenfont "(")))) + #f (list spacer (racketparenfont "(")))) (to-flow (to-element (field-view (car fields)))))))) (if (short-width . < . max-proto-width) null @@ -692,7 +692,7 @@ (if (null? (cdr fields)) (make-element #f - (list e (schemeparenfont + (list e (racketparenfont (if (and immutable? (not transparent?) (not cname-id)) @@ -712,7 +712,7 @@ (to-element cname-id)) (if (and immutable? (not transparent?)) - (list (schemeparenfont ")")) + (list (racketparenfont ")")) null)))))) null) (cond @@ -724,13 +724,13 @@ (list (if prefab? (to-element '#:prefab) (to-element '#:transparent)) - (schemeparenfont ")"))))))] + (racketparenfont ")"))))))] [(not immutable?) (list (a-right-column (to-flow (make-element #f (list (to-element '#:mutable) - (schemeparenfont ")"))))))] + (racketparenfont ")"))))))] [transparent? (list (a-right-column (to-flow (make-element @@ -738,7 +738,7 @@ (list (if prefab? (to-element '#:prefab) (to-element '#:transparent)) - (schemeparenfont ")"))))))] + (racketparenfont ")"))))))] [else null]))))))))) (map (lambda (v field-contract) (cond @@ -763,19 +763,19 @@ ;; ---------------------------------------- (define-syntax-rule (defthing id result desc ...) - (with-togetherable-scheme-variables + (with-togetherable-racket-variables () () (*defthing (list (quote-syntax/loc id)) (list 'id) #f - (list (schemeblock0 result)) + (list (racketblock0 result)) (lambda () (list desc ...))))) (define-syntax-rule (defthing* ([id result] ...) desc ...) - (with-togetherable-scheme-variables + (with-togetherable-racket-variables () () (*defthing (list (quote-syntax/loc id) ...) (list 'id ...) #f - (list (schemeblock0 result) ...) + (list (racketblock0 result) ...) (lambda () (list desc ...))))) (define (*defthing stx-ids names form? result-contracts content-thunk @@ -887,7 +887,7 @@ (list content) tag (list name) - (list (schemeidfont (make-element value-link-color + (list (racketidfont (make-element value-link-color (list name)))) (with-exporting-libraries (lambda (libs) diff --git a/collects/scribble/private/manual-scheme.rkt b/collects/scribble/private/manual-scheme.rkt index 9e9529c441..7d5467640c 100644 --- a/collects/scribble/private/manual-scheme.rkt +++ b/collects/scribble/private/manual-scheme.rkt @@ -15,9 +15,9 @@ racketresultblock racketresultblock0 RACKETRESULTBLOCK RACKETRESULTBLOCK0 racketblockelem - racketinput RACKETINPUT + racketinput RACKETINPUT racketinput0 RACKETINPUT0 - racketmod + racketmod racketmod0 racket RACKET racket/form racketresult racketid racketmodname diff --git a/collects/scribble/private/manual-style.rkt b/collects/scribble/private/manual-style.rkt index 520675b098..9b4091ecdc 100644 --- a/collects/scribble/private/manual-style.rkt +++ b/collects/scribble/private/manual-style.rkt @@ -46,7 +46,7 @@ [racketparenfont schemeparenfont] [racketkeywordfont schemekeywordfont] [racketmetafont schememetafont]) - + (provide void-const undefined-const) (provide/contract diff --git a/collects/scribble/private/manual-unit.rkt b/collects/scribble/private/manual-unit.rkt index b8dadcbddb..0e0330b817 100644 --- a/collects/scribble/private/manual-unit.rkt +++ b/collects/scribble/private/manual-unit.rkt @@ -20,7 +20,7 @@ sigelem) (define-syntax-rule (defsignature name (super ...) body ...) - (with-togetherable-scheme-variables + (with-togetherable-racket-variables () () (*defsignature (quote-syntax name) @@ -29,7 +29,7 @@ #t))) (define-syntax-rule (defsignature/splice name (super ...) body ...) - (with-togetherable-scheme-variables + (with-togetherable-racket-variables () () (*defsignature (quote-syntax name) diff --git a/collects/scribble/private/manual-vars.rkt b/collects/scribble/private/manual-vars.rkt index 8ab617b8a3..4e2fd8a78d 100644 --- a/collects/scribble/private/manual-vars.rkt +++ b/collects/scribble/private/manual-vars.rkt @@ -15,16 +15,16 @@ (provide/contract [struct (box-splice splice) ([run list?])]) ; XXX ugly copying (provide deftogether *deftogether - with-scheme-variables - with-togetherable-scheme-variables) + with-racket-variables + with-togetherable-racket-variables) (begin-for-syntax (define-struct deftogether-tag () #:omit-define-syntaxes)) -(define-syntax (with-togetherable-scheme-variables stx) +(define-syntax (with-togetherable-racket-variables stx) (syntax-case stx () [(_ . rest) (let ([result (syntax/loc stx - (with-togetherable-scheme-variables* . rest))] + (with-togetherable-racket-variables* . rest))] [ctx (syntax-local-context)]) (if (and (pair? ctx) (deftogether-tag? (car ctx))) ;; Make it transparent, so deftogether is allowed to pull it apart @@ -36,10 +36,10 @@ ;; that we introduce later. result))])) -(define-syntax-rule (with-togetherable-scheme-variables* . rest) - (with-scheme-variables . rest)) +(define-syntax-rule (with-togetherable-racket-variables* . rest) + (with-racket-variables . rest)) -(define-syntax (with-scheme-variables stx) +(define-syntax (with-racket-variables stx) (syntax-case stx () [(_ lits ([kind s-exp] ...) body) (let ([ht (make-bound-identifier-mapping)] @@ -137,10 +137,10 @@ def (list (make-deftogether-tag)) (cons - #'with-togetherable-scheme-variables* + #'with-togetherable-racket-variables* (kernel-form-identifier-list)))]) - (syntax-case exp-def (with-togetherable-scheme-variables*) - [(with-togetherable-scheme-variables* lits vars decl) + (syntax-case exp-def (with-togetherable-racket-variables*) + [(with-togetherable-racket-variables* lits vars decl) exp-def] [_ (raise-syntax-error @@ -149,7 +149,7 @@ stx def)]))) (syntax->list #'(def ...)))]) - #'(with-togetherable-scheme-variables + #'(with-togetherable-racket-variables (lit ... ...) (var ... ...) (*deftogether (list decl ...) (lambda () (list . body)))))])) diff --git a/collects/scribblings/draw/bitmap-class.scrbl b/collects/scribblings/draw/bitmap-class.scrbl index 51c275af3d..bb01c4fb48 100644 --- a/collects/scribblings/draw/bitmap-class.scrbl +++ b/collects/scribblings/draw/bitmap-class.scrbl @@ -3,7 +3,7 @@ @defclass/title[bitmap% object% ()]{ -A @scheme[bitmap%] object is a pixel-based image, either +A @racket[bitmap%] object is a pixel-based image, either monochrome, color, or color with an alpha channel. See also @racket[make-screen-bitmap] and @xmethod[canvas% make-bitmap]. @@ -34,25 +34,25 @@ The @racket[make-bitmap], @racket[make-monochrome-bitmap], and @racket[make-object] with @racket[bitmap%], because the functions are less overloaded and provide more useful defaults. -When @scheme[width] and @scheme[height] are provided: Creates a new - bitmap. If @scheme[monochrome?] is true, the bitmap is monochrome; if - @scheme[monochrome?] is @scheme[#f] and @racket[alpha?] is true, the +When @racket[width] and @racket[height] are provided: Creates a new + bitmap. If @racket[monochrome?] is true, the bitmap is monochrome; if + @racket[monochrome?] is @racket[#f] and @racket[alpha?] is true, the bitmap has an alpha channel; otherwise, the bitmap is color without an alpha channel. The initial content of the bitmap is ``empty'': all white, and with zero alpha in the case of a bitmap with an alpha channel. -When @scheme[in] is provided: Creates a bitmap from a file format, - where @scheme[kind] specifies the format. See @method[bitmap% +When @racket[in] is provided: Creates a bitmap from a file format, + where @racket[kind] specifies the format. See @method[bitmap% load-file] for details. -When a @scheme[bits] byte string is provided: Creates a monochrome - bitmap from an array of bit values, where each byte in @scheme[bits] +When a @racket[bits] byte string is provided: Creates a monochrome + bitmap from an array of bit values, where each byte in @racket[bits] specifies eight bits, and padding bits are added so that each bitmap - line starts on a character boundary. A @scheme[1] bit value indicates - black, and @scheme[0] indicates white. If @scheme[width] times - @scheme[height] is larger than 8 times the length of @scheme[bits], + line starts on a character boundary. A @racket[1] bit value indicates + black, and @racket[0] indicates white. If @racket[width] times + @racket[height] is larger than 8 times the length of @racket[bits], @|MismatchExn|. @@ -94,24 +94,24 @@ Gets the height of the bitmap in pixels. Returns a mask bitmap that is stored with this bitmap. -When a GIF file is loaded with @scheme['gif/mask] or - @scheme['unknown/mask] and the file contains a transparent ``color,'' +When a GIF file is loaded with @racket['gif/mask] or + @racket['unknown/mask] and the file contains a transparent ``color,'' a mask bitmap is generated to identify the transparent pixels. The mask bitmap is monochrome, with white pixels where the loaded bitmap is transparent and black pixels everywhere else. -When a PNG file is loaded with @scheme['png/mask] or - @scheme['unknown/mask] and the file contains a mask or alpha channel, +When a PNG file is loaded with @racket['png/mask] or + @racket['unknown/mask] and the file contains a mask or alpha channel, a mask bitmap is generated to identify the mask or alpha channel. If the file contains a mask or an alpha channel with only extreme values, the mask bitmap is monochrome, otherwise it is grayscale (representing the alpha channel inverted). -When an XPM file is loaded with @scheme['xpm/mask] or - @scheme['unknown/mask], a mask bitmap is generated to indicate which +When an XPM file is loaded with @racket['xpm/mask] or + @racket['unknown/mask], a mask bitmap is generated to indicate which pixels are set. -When @scheme['unknown/alpha] and similar modes are used to load a +When @racket['unknown/alpha] and similar modes are used to load a bitmap, transparency information is instead represented by an alpha channel, not by a mask bitmap. @@ -119,7 +119,7 @@ Unlike an alpha channel, the mask bitmap is @italic{not} used automatically by drawing routines. The mask bitmap can be extracted and supplied explicitly as a mask (e.g., as the sixth argument to @method[dc<%> draw-bitmap]). The mask bitmap is used by - @method[bitmap% save-file] when saving a bitmap as @scheme['png] if + @method[bitmap% save-file] when saving a bitmap as @racket['png] if the mask has the same dimensions as the saved bitmap. The mask bitmap is also used automatically when the bitmap is a control label. @@ -135,7 +135,7 @@ Gets the width of the bitmap in pixels. @defmethod[(is-color?) boolean?]{ -Returns @scheme[#f] if the bitmap is monochrome, @scheme[#t] otherwise. +Returns @racket[#f] if the bitmap is monochrome, @racket[#t] otherwise. } @@ -155,35 +155,46 @@ Loads a bitmap from a file format that read from @racket[in], unless the bitmap was produced by @racket[make-screen-bitmap] or @xmethod[canvas% make-bitmap] (in which case @|MismatchExn|). If the bitmap is in use by a - @scheme[bitmap-dc%] object or a control, the image data is not + @racket[bitmap-dc%] object or a control, the image data is not loaded. The bitmap changes its size and depth to match that of the loaded image. If an error is encountered when reading the file format, an exception is raised only if @racket[complain-on-failure?] is true (which is @emph{not} the default). -The @scheme[kind] argument specifies the file's format: +The @racket[kind] argument specifies the file's format: @itemize[ -@item{@scheme['unknown] --- examine the file to determine its format; creates either a monochrome - or color bitmap without an alpha channel} -@item{@scheme['unknown/mask] --- like @scheme['unknown], but see @method[bitmap% get-loaded-mask]} -@item{@scheme['unknown/alpha] --- like @scheme['unknown], but if the bitmap is color, it has an - alpha channel, and transparency in the image file is recorded - in the alpha channel} -@item{@scheme['gif] --- load a @as-index{GIF} bitmap file, creating a color bitmap} -@item{@scheme['gif/mask] --- like @scheme['gif], but see @method[bitmap% get-loaded-mask]} -@item{@scheme['gif/alpha] --- like @scheme['gif], but with an alpha channel} -@item{@scheme['jpeg] --- load a @as-index{JPEG} bitmap file, creating a color bitmap} -@item{@scheme['jpeg/alpha] --- like @racket['jpeg], but with an alpha channel} -@item{@scheme['png] --- load a @as-index{PNG} bitmap file, creating a color or monochrome bitmap} -@item{@scheme['png/mask] --- like @scheme['png], but see @method[bitmap% get-loaded-mask]} -@item{@scheme['png/alpha] --- like @scheme['png], but always color and with an alpha channel} -@item{@scheme['xbm] --- load an X bitmap (@as-index{XBM}) file; creates a monochrome bitmap} -@item{@scheme['xbm/alpha] --- like @racket['xbm], but creates a color bitmap with an alpha channel} -@item{@scheme['xpm] --- load an @as-index{XPM} bitmap file, creating a color bitmap} -@item{@scheme['xpm/alpha] --- like @racket['xpm], but with an alpha channel} -@item{@scheme['bmp] --- load a Windows bitmap file, creating a color bitmap} -@item{@scheme['bmp/alpha] --- like @racket['bmp], but with an alpha channel} + +@item{@racket['unknown] --- examine the file to determine its format; creates + either a monochrome or color bitmap without an alpha channel} +@item{@racket['unknown/mask] --- like @racket['unknown], but see + @method[bitmap% get-loaded-mask]} +@item{@racket['unknown/alpha] --- like @racket['unknown], but if the bitmap is + color, it has an alpha channel, and transparency in the image file is + recorded in the alpha channel} +@item{@racket['gif] --- load a @as-index{GIF} bitmap file, creating a color + bitmap} +@item{@racket['gif/mask] --- like @racket['gif], but see + @method[bitmap% get-loaded-mask]} +@item{@racket['gif/alpha] --- like @racket['gif], but with an alpha channel} +@item{@racket['jpeg] --- load a @as-index{JPEG} bitmap file, creating a color + bitmap} +@item{@racket['jpeg/alpha] --- like @racket['jpeg], but with an alpha channel} +@item{@racket['png] --- load a @as-index{PNG} bitmap file, creating a color or + monochrome bitmap} +@item{@racket['png/mask] --- like @racket['png], but see + @method[bitmap% get-loaded-mask]} +@item{@racket['png/alpha] --- like @racket['png], but always color and with an + alpha channel} +@item{@racket['xbm] --- load an X bitmap (@as-index{XBM}) file; creates a + monochrome bitmap} +@item{@racket['xbm/alpha] --- like @racket['xbm], but creates a color bitmap + with an alpha channel} +@item{@racket['xpm] --- load an @as-index{XPM} bitmap file, creating a color + bitmap} +@item{@racket['xpm/alpha] --- like @racket['xpm], but with an alpha channel} +@item{@racket['bmp] --- load a Windows bitmap file, creating a color bitmap} +@item{@racket['bmp/alpha] --- like @racket['bmp], but with an alpha channel} ] An XBM image is always loaded as a monochrome bitmap. A 1-bit @@ -191,12 +202,12 @@ An XBM image is always loaded as a monochrome bitmap. A 1-bit monochrome bitmap. An image in any other format is always loaded as a color bitmap. -For PNG loading, if @scheme[bg-color] is not @scheme[#f], then it is +For PNG loading, if @racket[bg-color] is not @racket[#f], then it is combined with the file's alpha channel or mask (if any) while loading the image; in this case, no separate mask bitmap is generated and the - alpha channel fills the bitmap, even if @scheme['unknown/mask], - @scheme['png/mask] is specified for the format. If the format is - specified as @scheme['unknown] or @scheme['png] and @scheme[bg-color] + alpha channel fills the bitmap, even if @racket['unknown/mask], + @racket['png/mask] is specified for the format. If the format is + specified as @racket['unknown] or @racket['png] and @racket[bg-color] is not specified, the PNG file is consulted for a background color to use for loading, and white is used if no background color is indicated in the file. @@ -213,7 +224,7 @@ For PNG loading, if @scheme[bg-color] is not @scheme[#f], then it is @defmethod[(ok?) boolean?]{ -Returns @scheme[#t] if the bitmap is valid in the sense that an image +Returns @racket[#t] if the bitmap is valid in the sense that an image file was loaded successfully. If @method[bitmap% ok?] returns @racket[#f], then drawing to or from the bitmap has no effect. @@ -227,35 +238,35 @@ Returns @scheme[#t] if the bitmap is valid in the sense that an image Writes a bitmap to the named file or output stream. -The @scheme[kind] argument determined the type of file that is created, +The @racket[kind] argument determined the type of file that is created, one of: @itemize[ - @item{@scheme['png] --- save a @as-index{PNG} file} + @item{@racket['png] --- save a @as-index{PNG} file} - @item{@scheme['jpeg] --- save a @as-index{JPEG} file} + @item{@racket['jpeg] --- save a @as-index{JPEG} file} - @item{@scheme['xbm] --- save an X bitmap (@as-index{XBM}) file} + @item{@racket['xbm] --- save an X bitmap (@as-index{XBM}) file} - @item{@scheme['xpm] --- save an @as-index{XPM} bitmap file} + @item{@racket['xpm] --- save an @as-index{XPM} bitmap file} - @item{@scheme['bmp] --- save a Windows bitmap file} + @item{@racket['bmp] --- save a Windows bitmap file} ] -The @scheme[quality] argument is used only for saving as @scheme['jpeg], in +The @racket[quality] argument is used only for saving as @racket['jpeg], in which case it specifies the trade-off between image precision (high - quality matches the content of the @scheme[bitmap%] object more + quality matches the content of the @racket[bitmap%] object more precisely) and size (low quality is smaller). -When saving as @scheme['png], if @method[bitmap% get-loaded-mask] +When saving as @racket['png], if @method[bitmap% get-loaded-mask] returns a bitmap of the same size as this one, a grayscale version is included in the PNG file as the alpha channel. -A monochrome bitmap saved as @scheme['png] without a mask bitmap +A monochrome bitmap saved as @racket['png] without a mask bitmap produces a 1-bit grayscale PNG file (which, when read with - @method[bitmap% load-file], creates a monochrome @scheme[bitmap%] + @method[bitmap% load-file], creates a monochrome @racket[bitmap%] object.) } diff --git a/collects/scribblings/draw/bitmap-dc-class.scrbl b/collects/scribblings/draw/bitmap-dc-class.scrbl index a5f34a7cc5..dff3a14bd1 100644 --- a/collects/scribblings/draw/bitmap-dc-class.scrbl +++ b/collects/scribblings/draw/bitmap-dc-class.scrbl @@ -3,25 +3,25 @@ @defclass/title[bitmap-dc% object% (dc<%>)]{ -A @scheme[bitmap-dc%] object allows drawing directly into a bitmap. A - @scheme[bitmap%] object must be supplied at initialization or +A @racket[bitmap-dc%] object allows drawing directly into a bitmap. A + @racket[bitmap%] object must be supplied at initialization or installed into a bitmap DC using @method[bitmap-dc% set-bitmap] before any other method of the DC is called, except @method[dc<%> get-text-extent], @method[dc<%> get-char-height], or @method[dc<%> - get-char-width]. If any other @scheme[bitmap-dc%] method is called + get-char-width]. If any other @racket[bitmap-dc%] method is called before a bitmap is selected, the method call is ignored. -Drawing to a @scheme[bitmap-dc%] with a color bitmap is guaranteed to - produce the same result as drawing into a @scheme[canvas%] instance - (with appropriate clipping and offsets). Thus, a @scheme[bitmap-dc%] +Drawing to a @racket[bitmap-dc%] with a color bitmap is guaranteed to + produce the same result as drawing into a @racket[canvas%] instance + (with appropriate clipping and offsets). Thus, a @racket[bitmap-dc%] can be used for offscreen staging of canvas content. @defconstructor[([bitmap (or/c (is-a?/c bitmap%) false/c)])]{ -Creates a new memory DC. If @scheme[bitmap] is not @scheme[#f], it is +Creates a new memory DC. If @racket[bitmap] is not @racket[#f], it is installed into the DC so that drawing commands on the DC draw to - @scheme[bitmap]. Otherwise, no bitmap is installed into the DC and + @racket[bitmap]. Otherwise, no bitmap is installed into the DC and @method[bitmap-dc% set-bitmap] must be called before any other method of the DC is called. @@ -61,29 +61,29 @@ In older versions, this method smoothed drawing more than Gets a rectangle of pixels in the bitmap, subject to the same rules and performance characteristics of @method[bitmap-dc% get-pixel], except that the block get is likely to be faster than the sequence of - individual gets. Also, the @scheme[bitmap%] class also provides the + individual gets. Also, the @racket[bitmap%] class also provides the same method directly, so it is not necessary to select a bitmap into a DC to extracts its pixel values. -The pixel RGB values are copied into @scheme[pixels]. The first byte - represents an alpha value of the pixel at (@scheme[x], @scheme[y]), - the second byte represents a red value of the pixel at (@scheme[x], - @scheme[y]), the third byte is the blue value, etc. In this way, the - first @math{@scheme[width] * @scheme[height] *4} bytes of - @scheme[pixels] are set to reflect the current pixel values in the +The pixel RGB values are copied into @racket[pixels]. The first byte + represents an alpha value of the pixel at (@racket[x], @racket[y]), + the second byte represents a red value of the pixel at (@racket[x], + @racket[y]), the third byte is the blue value, etc. In this way, the + first @math{@racket[width] * @racket[height] * 4} bytes of + @racket[pixels] are set to reflect the current pixel values in the DC. The pixels are in row-major order, left to right then top to bottom. -If @scheme[just-alpha?] is false, if the bitmap does not have an alpha +If @racket[just-alpha?] is false, if the bitmap does not have an alpha channel, then the alpha value for each pixel is set to 255. If - @scheme[just-alpha?] is true, then @italic{only} the alpha value is set + @racket[just-alpha?] is true, then @italic{only} the alpha value is set for each pixel; if the bitmap has no alpha channel, then the alpha value is based on each pixel's inverted RGB average. Thus, when a - bitmap has a separate mask bitmap, the same @scheme[pixels] byte + bitmap has a separate mask bitmap, the same @racket[pixels] byte string is in general filled from two bitmaps: one (the main image) for the pixel values and one (the mask) for the alpha values. -If @racket[pre-multiplied?] is true, @scheme[just-alpha?] is false, +If @racket[pre-multiplied?] is true, @racket[just-alpha?] is false, and the bitmap has an alpha channel, then RGB values in the result are scaled by the corresponding alpha value (i.e., multiplied by the alpha value and then divided by 255). @@ -93,7 +93,7 @@ If @racket[pre-multiplied?] is true, @scheme[just-alpha?] is false, @defmethod[(get-bitmap) (or/c (is-a?/c bitmap%) false/c)]{ -Gets the bitmap currently installed in the DC, or @scheme[#f] if no +Gets the bitmap currently installed in the DC, or @racket[#f] if no bitmap is installed. See @method[bitmap-dc% set-bitmap] for more information. @@ -104,10 +104,10 @@ Gets the bitmap currently installed in the DC, or @scheme[#f] if no [color (is-a?/c color%)]) boolean?]{ -Fills @scheme[color] with the color of the current pixel at position -(@scheme[x], @scheme[y]) in the drawing context. If the color is -successfully obtained, the return value is @scheme[#t], otherwise the -result is @scheme[#f]. +Fills @racket[color] with the color of the current pixel at position +(@racket[x], @racket[y]) in the drawing context. If the color is +successfully obtained, the return value is @racket[#t], otherwise the +result is @racket[#f]. } @@ -125,25 +125,25 @@ Sets a rectangle of pixels in the bitmap, unless the DC's current bitmap was produced by @racket[make-screen-bitmap] or @xmethod[canvas% make-bitmap] (in which case @|MismatchExn|). -The pixel RGB values are taken from @scheme[pixels]. The first byte +The pixel RGB values are taken from @racket[pixels]. The first byte represents an alpha value, the second byte represents a red value to - used for the pixel at (@scheme[x], @scheme[y]), the third byte is a blue + used for the pixel at (@racket[x], @racket[y]), the third byte is a blue value, etc. In this way, the first - @math{@scheme[width] * @scheme[height] * 4} bytes of @scheme[pixels] + @math{@racket[width] * @racket[height] * 4} bytes of @racket[pixels] determine the new pixel values in the DC. The pixels are in row-major order, left to right then top to bottom. -If @scheme[just-alpha?] is false, then the alpha value for each pixel is +If @racket[just-alpha?] is false, then the alpha value for each pixel is used only if the DC's current bitmap has an alpha channel. If - @scheme[just-alpha?] is true and the bitmap has no alpha channel, then each + @racket[just-alpha?] is true and the bitmap has no alpha channel, then each pixel is set based @italic{only} on the alpha value, but inverted to serve as a mask. Thus, when working with bitmaps that have an associated mask bitmap instead of an alpha channel, the same - @scheme[pixels] byte string is used with two bitmaps: one + @racket[pixels] byte string is used with two bitmaps: one (the main image) for the pixel values and one (the mask) for the alpha values. -If @racket[pre-multiplied?] is true, @scheme[just-alpha?] is false, +If @racket[pre-multiplied?] is true, @racket[just-alpha?] is false, and the bitmap has an alpha channel, then RGB values in @racket[pixels] are interpreted as scaled by the corresponding alpha value (i.e., multiplied by the alpha value and then divided by 255). If an @@ -158,13 +158,13 @@ If @racket[pre-multiplied?] is true, @scheme[just-alpha?] is false, Installs a bitmap into the DC, so that drawing operations on the bitmap DC draw to the bitmap. A bitmap is removed from a DC by setting the - bitmap to @scheme[#f]. + bitmap to @racket[#f]. A bitmap can be selected into at most one bitmap DC, and only when it - is not used by a control (as a label) or in a @scheme[pen%] or - @scheme[brush%] (as a stipple). If the argument to @method[bitmap-dc% + is not used by a control (as a label) or in a @racket[pen%] or + @racket[brush%] (as a stipple). If the argument to @method[bitmap-dc% set-bitmap] is already in use by another DC, a control, a - @scheme[pen%], or a @scheme[brush%], @|MismatchExn|. + @racket[pen%], or a @racket[brush%], @|MismatchExn|. } @@ -177,7 +177,7 @@ Sets a pixel in the bitmap. The current clipping region might not affect the pixel change. Under X, interleaving drawing commands with @method[bitmap-dc% set-pixel] - calls (for the same @scheme[bitmap-dc%] object) incurs a substantial + calls (for the same @racket[bitmap-dc%] object) incurs a substantial performance penalty, except for interleaved calls to @method[bitmap-dc% get-pixel], @method[bitmap-dc% get-argb-pixels], and @method[bitmap-dc% set-argb-pixels]. diff --git a/collects/scribblings/draw/blurbs.rkt b/collects/scribblings/draw/blurbs.rkt index 5ab77556fc..29cc70c2bc 100644 --- a/collects/scribblings/draw/blurbs.rkt +++ b/collects/scribblings/draw/blurbs.rkt @@ -29,7 +29,7 @@ (define DrawSizeNote "") - (define MismatchExn @elem{an @scheme[exn:fail:contract] exception is raised}) + (define MismatchExn @elem{an @racket[exn:fail:contract] exception is raised}) (define (colorName name name2 r g b) (make-element #f @@ -47,7 +47,7 @@ (define (boxisfill which what) @elem{The @|which| box is filled with @|what|.}) (define (boxisfillnull which what) - @elem{The @|which| box is filled with @|what|, unless @|which| is @scheme[#f].}) + @elem{The @|which| box is filled with @|what|, unless @|which| is @racket[#f].}) ) diff --git a/collects/scribblings/draw/brush-class.scrbl b/collects/scribblings/draw/brush-class.scrbl index 5e55c15521..dcc8093bb3 100644 --- a/collects/scribblings/draw/brush-class.scrbl +++ b/collects/scribblings/draw/brush-class.scrbl @@ -29,54 +29,54 @@ A brush's style is one of the following (but is ignored if the brush @itemize[ - @item{@indexed-scheme['transparent] --- Draws with no effect (on the + @item{@indexed-racket['transparent] --- Draws with no effect (on the interior of the drawn shape).} - @item{@indexed-scheme['solid] --- Draws using the brush's color. If a + @item{@indexed-racket['solid] --- Draws using the brush's color. If a monochrome stipple is installed into the brush, black pixels from the stipple are transferred to the destination using the brush's color, and white pixels from the stipple are not transferred.} - @item{@indexed-scheme['opaque] --- The same as @scheme['solid] for a color + @item{@indexed-racket['opaque] --- The same as @racket['solid] for a color stipple. For a monochrome stipple, white pixels from the stipple are transferred to the destination using the destination's background color.} - @item{@indexed-scheme['xor] --- The same as @racket['solid], accepted + @item{@indexed-racket['xor] --- The same as @racket['solid], accepted only for partial backward compatibility.} - @item{@indexed-scheme['hilite] --- Draws with black and a @racket[0.3] alpha.} + @item{@indexed-racket['hilite] --- Draws with black and a @racket[0.3] alpha.} - @item{@indexed-scheme['panel] --- The same as @scheme['solid], accepted + @item{@indexed-racket['panel] --- The same as @racket['solid], accepted only for partial backward compatibility.} @item{The following modes correspond to built-in stipples drawn in - @scheme['solid] mode: + @racket['solid] mode: @itemize[ - @item{@indexed-scheme['bdiagonal-hatch] --- diagonal lines, top-left to bottom-right} - @item{@indexed-scheme['crossdiag-hatch] --- crossed diagonal lines} - @item{@indexed-scheme['fdiagonal-hatch] --- diagonal lines, top-right to bottom-left} - @item{@indexed-scheme['cross-hatch] --- crossed horizontal and vertical lines} - @item{@indexed-scheme['horizontal-hatch] --- horizontal lines} - @item{@indexed-scheme['vertical-hatch] --- vertical lines} + @item{@indexed-racket['bdiagonal-hatch] --- diagonal lines, top-left to bottom-right} + @item{@indexed-racket['crossdiag-hatch] --- crossed diagonal lines} + @item{@indexed-racket['fdiagonal-hatch] --- diagonal lines, top-right to bottom-left} + @item{@indexed-racket['cross-hatch] --- crossed horizontal and vertical lines} + @item{@indexed-racket['horizontal-hatch] --- horizontal lines} + @item{@indexed-racket['vertical-hatch] --- vertical lines} ] However, when a specific stipple is installed into the brush, - the above modes are ignored and @scheme['solid] is + the above modes are ignored and @racket['solid] is used, instead.} ] @index['("drawing" "outlines")]{To} draw outline shapes (such as - unfilled boxes and ellipses), use the @scheme['transparent] brush + unfilled boxes and ellipses), use the @racket['transparent] brush style. To avoid creating multiple brushes with the same characteristics, use - the global @scheme[brush-list%] object - @indexed-scheme[the-brush-list], or provide a color and style to + the global @racket[brush-list%] object + @indexed-racket[the-brush-list], or provide a color and style to @xmethod[dc<%> set-brush]. @@ -96,7 +96,7 @@ To avoid creating multiple brushes with the same characteristics, use Creates a brush with the given color, style, stipple, and gradient. For the case that the color is specified using a name, see - @scheme[color-database<%>] for information about color names; if the + @racket[color-database<%>] for information about color names; if the name is not known, the brush's color is black. } @@ -111,7 +111,7 @@ Returns the brush's color. @defmethod[(get-stipple) (or/c (is-a?/c bitmap%) #f)]{ -Gets the stipple bitmap, or @scheme[#f] if the brush has no stipple. +Gets the stipple bitmap, or @racket[#f] if the brush has no stipple. } @@ -120,7 +120,7 @@ Gets the stipple bitmap, or @scheme[#f] if the brush has no stipple. (is-a?/c radial-gradient%) #f)]{ -Gets the gradient, or @scheme[#f] if the brush has no gradient. +Gets the gradient, or @racket[#f] if the brush has no gradient. } @@ -132,7 +132,7 @@ Gets the gradient, or @scheme[#f] if the brush has no gradient. 'fdiagonal-hatch 'cross-hatch 'horizontal-hatch 'vertical-hatch)]{ -Returns the brush's style. See @scheme[brush%] for information about +Returns the brush's style. See @racket[brush%] for information about brush styles. } @@ -147,24 +147,24 @@ brush styles. void?])]{ Sets the brush's color. A brush cannot be modified if it was obtained - from a @scheme[brush-list%] or while it is selected into a drawing + from a @racket[brush-list%] or while it is selected into a drawing context. For the case that the color is specified using a string, see - @scheme[color-database<%>] for information about color names. + @racket[color-database<%>] for information about color names. } @defmethod[(set-stipple [bitmap (or/c (is-a?/c bitmap%) #f)]) void?]{ -Sets or removes the stipple bitmap, where @scheme[#f] removes the - stipple. See @scheme[brush%] for information about drawing with +Sets or removes the stipple bitmap, where @racket[#f] removes the + stipple. See @racket[brush%] for information about drawing with stipples. If @racket[bitmap] is modified while is associated with a brush, the effect on the brush is unspecified. A brush cannot be modified if it - was obtained from a @scheme[brush-list%] or while it is selected into + was obtained from a @racket[brush-list%] or while it is selected into a drawing context. } @@ -177,10 +177,10 @@ If @racket[bitmap] is modified while is associated with a brush, the void?]{ Sets the brush's style. See -@scheme[brush%] for information about the possible styles. +@racket[brush%] for information about the possible styles. A brush cannot be modified if it was obtained from a - @scheme[brush-list%] or while it is selected into a drawing + @racket[brush-list%] or while it is selected into a drawing context. }} diff --git a/collects/scribblings/draw/brush-list-class.scrbl b/collects/scribblings/draw/brush-list-class.scrbl index f14a36e830..37d5b8569e 100644 --- a/collects/scribblings/draw/brush-list-class.scrbl +++ b/collects/scribblings/draw/brush-list-class.scrbl @@ -3,11 +3,11 @@ @defclass/title[brush-list% object% ()]{ -A @scheme[brush-list%] object maintains a list of @scheme[brush%] - objects to avoid creating brushes repeatedly. A @scheme[brush%] +A @racket[brush-list%] object maintains a list of @racket[brush%] + objects to avoid creating brushes repeatedly. A @racket[brush%] object in a brush list cannot be mutated. -A global brush list, @scheme[the-brush-list], is created +A global brush list, @racket[the-brush-list], is created automatically. @@ -33,8 +33,8 @@ Creates an empty brush list. (or/c (is-a?/c brush%) false/c)])]{ Finds a brush of the given specification, or creates one and adds it - to the list. See @scheme[brush%] for a further explanation of the - arguments, which are the same as @scheme[brush%]'s initialization + to the list. See @racket[brush%] for a further explanation of the + arguments, which are the same as @racket[brush%]'s initialization arguments. }} diff --git a/collects/scribblings/draw/color-class.scrbl b/collects/scribblings/draw/color-class.scrbl index 54dbb2c7a4..acdc3d82b7 100644 --- a/collects/scribblings/draw/color-class.scrbl +++ b/collects/scribblings/draw/color-class.scrbl @@ -11,7 +11,7 @@ A color is an object representing a red-green-blue (RGB) combination 255, 1.0) is solid white, (255, 0, 0, 1.0) is solid red, and (255, 0, 0, 0.5) is translucent red. -See @scheme[color-database<%>] for information about obtaining a color +See @racket[color-database<%>] for information about obtaining a color object using a color name. @@ -24,7 +24,7 @@ object using a color name. Creates a new color with the given RGB values and alpha, or matching the given color name (using ``black'' if no color is given or if the - name is not recognized). See @scheme[color-database<%>] for more + name is not recognized). See @racket[color-database<%>] for more information on color names. } @@ -61,7 +61,7 @@ Returns the green component of the color. @defmethod[(ok?) boolean?]{ -Returns @scheme[#t] if the color object is valid. +Returns @racket[#t] if the color object is valid. } diff --git a/collects/scribblings/draw/color-database-intf.scrbl b/collects/scribblings/draw/color-database-intf.scrbl index b40f51abd9..ef83bc5bd0 100644 --- a/collects/scribblings/draw/color-database-intf.scrbl +++ b/collects/scribblings/draw/color-database-intf.scrbl @@ -3,14 +3,14 @@ @definterface/title[color-database<%> ()]{ -The global @indexed-scheme[the-color-database] object is an instance of - @scheme[color-database<%>]. It maintains a database of standard RGB +The global @indexed-racket[the-color-database] object is an instance of + @racket[color-database<%>]. It maintains a database of standard RGB colors for a predefined set of named colors (such as ``black'' and ``light grey''). The following colors are in the database: -@schemeblock[ +@racketblock[ @#,colorName[#"Orange Red" #"OrangeRed" 255 69 0] @#,colorName[#"OrangeRed" #"OrangeRed" 255 69 0] @#,colorName[#"Tomato" #"Tomato" 255 99 71] @@ -196,7 +196,7 @@ The following colors are in the database: The names are not case-sensitive. -See also @scheme[color%]. +See also @racket[color%]. @@ -205,7 +205,7 @@ See also @scheme[color%]. (or/c (is-a?/c color%) false/c)]{ Finds a color by name (character case is ignored). If no color is - found for the name, @scheme[#f] is returned. + found for the name, @racket[#f] is returned. }} diff --git a/collects/scribblings/draw/dc-intf.scrbl b/collects/scribblings/draw/dc-intf.scrbl index 5faf40f8b4..131d1f6364 100644 --- a/collects/scribblings/draw/dc-intf.scrbl +++ b/collects/scribblings/draw/dc-intf.scrbl @@ -3,7 +3,7 @@ @definterface/title[dc<%> ()]{ -A @scheme[dc<%>] object is a drawing context for drawing graphics and +A @racket[dc<%>] object is a drawing context for drawing graphics and text. It represents output devices in a generic way; e.g., a canvas has a drawing context, as does a printer. @@ -11,13 +11,13 @@ A @scheme[dc<%>] object is a drawing context for drawing graphics and @defmethod[(cache-font-metrics-key) exact-integer?]{ -Returns an integer that, if not @scheme[0], corresponds to a +Returns an integer that, if not @racket[0], corresponds to a particular kind of device and scaling factor, such that text-extent information (from @method[dc<%> get-text-extent], @method[dc<%> get-char-height], etc.) is the same. The key is valid across all -@scheme[dc<%>] instances, even among different classes. +@racket[dc<%>] instances, even among different classes. -A @scheme[0] result indicates that the current configuration of +A @racket[0] result indicates that the current configuration of @this-obj[] does not fit into a common category, and so no key is available for caching text-extent information.} @@ -56,11 +56,11 @@ overlap.} void?]{ Draws a counter-clockwise circular arc, a part of the ellipse - inscribed in the rectangle specified by @scheme[x] (left), @scheme[y] - (top), @scheme[width], and @scheme[height]. The arc starts at the angle - specified by @scheme[start-radians] (@scheme[0] is three o'clock and + inscribed in the rectangle specified by @racket[x] (left), @racket[y] + (top), @racket[width], and @racket[height]. The arc starts at the angle + specified by @racket[start-radians] (@racket[0] is three o'clock and half-pi is twelve o'clock) and continues counter-clockwise to - @scheme[end-radians]. If @scheme[start-radians] and @scheme[end-radians] are + @racket[end-radians]. If @racket[start-radians] and @racket[end-radians] are the same, a full ellipse is drawn. The current pen is used for the arc. If the current brush is not @@ -88,20 +88,20 @@ If both the pen and brush are non-transparent, the wedge is filled [mask (or/c (is-a?/c bitmap%) false/c) #f]) boolean?]{ -Displays the @racket[source] bitmap. The @scheme[dest-x] and @scheme[dest-y] arguments +Displays the @racket[source] bitmap. The @racket[dest-x] and @racket[dest-y] arguments are in DC coordinates. For color bitmaps, the drawing style and color arguments are ignored. For monochrome bitmaps, @method[dc<%> draw-bitmap] uses the style and color arguments in the same way that a brush uses its style - and color settings to draw a monochrome stipple (see @scheme[brush%] + and color settings to draw a monochrome stipple (see @racket[brush%] for more information). If a @racket[mask] bitmap is supplied, it must have the same width and height as @racket[source], and its @method[bitmap% ok?] must return true, otherwise @|MismatchExn|. The @racket[source] bitmap and @racket[mask] bitmap can be the same object, but if the drawing context is a - @scheme[bitmap-dc%] object, both bitmaps must be distinct from the + @racket[bitmap-dc%] object, both bitmaps must be distinct from the destination bitmap, otherwise @|MismatchExn|. The effect of @racket[mask] on drawing depends on the type of the @@ -110,7 +110,7 @@ The effect of @racket[mask] on drawing depends on the type of the @itemlist[ @item{If the @racket[mask] bitmap is monochrome, drawing occurs in - the target @scheme[dc<%>] only where the mask bitmap contains + the target @racket[dc<%>] only where the mask bitmap contains black pixels (independent of @racket[style], which controls how the white pixels of a monochrome @racket[source] are handled).} @@ -134,13 +134,13 @@ The current brush, current pen, and current text for the DC have no any given @racket[mask], and the alpha component of @racket[color] when @racket[source] is monochrome). -For @scheme[post-script-dc%] and @racket[pdf-dc%] output, opacity from +For @racket[post-script-dc%] and @racket[pdf-dc%] output, opacity from an alpha channel in @racket[source], from @racket[mask], or from @racket[color] is rounded to full transparency or opacity. -The result is @scheme[#t] if the bitmap is successfully drawn, - @scheme[#f] otherwise (possibly because the bitmap's @method[bitmap% - ok?] method returns @scheme[#f]). +The result is @racket[#t] if the bitmap is successfully drawn, + @racket[#f] otherwise (possibly because the bitmap's @method[bitmap% + ok?] method returns @racket[#f]). See also @method[dc<%> draw-bitmap-section]. @@ -162,12 +162,12 @@ See also @method[dc<%> draw-bitmap-section]. Displays part of a bitmap. -The @scheme[src-x], @scheme[src-y], @scheme[src-width], and - @scheme[src-height] arguments specify a rectangle in the source +The @racket[src-x], @racket[src-y], @racket[src-width], and + @racket[src-height] arguments specify a rectangle in the source bitmap to copy into this drawing context. -See @method[dc<%> draw-bitmap] for information about @scheme[dest-x], - @scheme[dest-y], @scheme[style], @scheme[color], and @scheme[mask]. +See @method[dc<%> draw-bitmap] for information about @racket[dest-x], + @racket[dest-y], @racket[style], @racket[color], and @racket[mask]. } @@ -204,11 +204,11 @@ Draws a line from one point to another. The current pen is used for In unsmoothed mode, the points correspond to pixels, and the line covers both the start and end points. For a pen whose scaled width is - larger than @scheme[1], the line is drawn centered over the start and + larger than @racket[1], the line is drawn centered over the start and end points. See also @method[dc<%> set-smoothing] for information on the -@scheme['aligned] smoothing mode. +@racket['aligned] smoothing mode. @|DrawSizeNote| @@ -220,14 +220,14 @@ See also @method[dc<%> set-smoothing] for information on the [yoffset real? 0]) void?]{ -Draws lines using a list @scheme[points] of points, adding @scheme[xoffset] - and @scheme[yoffset] to each point. A pair is treated as a point where the +Draws lines using a list @racket[points] of points, adding @racket[xoffset] + and @racket[yoffset] to each point. A pair is treated as a point where the @racket[car] of the pair is the x-value and the @racket[cdr] is the y-value. The current pen is used for drawing the lines. See also @method[dc<%> set-smoothing] for information on the - @scheme['aligned] smoothing mode. + @racket['aligned] smoothing mode. @|DrawSizeNote| @@ -239,9 +239,9 @@ See also @method[dc<%> set-smoothing] for information on the [fill-style (one-of/c 'odd-even 'winding) 'odd-even]) void?]{ -Draws the sub-paths of the given @scheme[dc-path%] object, adding - @scheme[xoffset] and @scheme[yoffset] to each point. (See - @scheme[dc-path%] for general information on paths and sub-paths.) +Draws the sub-paths of the given @racket[dc-path%] object, adding + @racket[xoffset] and @racket[yoffset] to each point. (See + @racket[dc-path%] for general information on paths and sub-paths.) The current pen is used for drawing the path as a line, and the current brush is used for filling the area bounded by the path. @@ -253,15 +253,15 @@ If both the pen and brush are non-transparent, the path is filled with overlap. More generally, the pen is centered over the path, rounding left and down in unsmoothed mode. -The @scheme[fill-style] argument specifies the fill rule: - @scheme['odd-even] or @scheme['winding]. In @scheme['odd-even] mode, a +The @racket[fill-style] argument specifies the fill rule: + @racket['odd-even] or @racket['winding]. In @racket['odd-even] mode, a point is considered enclosed within the path if it is enclosed by an - odd number of sub-path loops. In @scheme['winding] mode, a point is + odd number of sub-path loops. In @racket['winding] mode, a point is considered enclosed within the path if it is enclosed by more or less clockwise sub-path loops than counter-clockwise sub-path loops. See also @method[dc<%> set-smoothing] for information on the - @scheme['aligned] smoothing mode. + @racket['aligned] smoothing mode. @|DrawSizeNote| @@ -284,8 +284,8 @@ Plots a single point using the current pen. [fill-style (one-of/c 'odd-even 'winding) 'odd-even]) void?]{ -Draw a filled polygon using a list @scheme[points] of points, adding - @scheme[xoffset] and @scheme[yoffset] to each point. +Draw a filled polygon using a list @racket[points] of points, adding + @racket[xoffset] and @racket[yoffset] to each point. A pair is treated as a point where the @racket[car] of the pair is the x-value and the @racket[cdr] is the y-value. The polygon is @@ -301,15 +301,15 @@ If both the pen and brush are non-transparent, the polygon is filled overlap. More generally, the pen is centered over the polygon lines, rounding left and down in unsmoothed mode. -The @scheme[fill-style] argument specifies the fill rule: - @scheme['odd-even] or @scheme['winding]. In @scheme['odd-even] mode, a +The @racket[fill-style] argument specifies the fill rule: + @racket['odd-even] or @racket['winding]. In @racket['odd-even] mode, a point is considered enclosed within the polygon if it is enclosed by - an odd number of loops. In @scheme['winding] mode, a point is + an odd number of loops. In @racket['winding] mode, a point is considered enclosed within the polygon if it is enclosed by more or less clockwise loops than counter-clockwise loops. See also @method[dc<%> set-smoothing] for information on the - @scheme['aligned] smoothing mode. + @racket['aligned] smoothing mode. @|DrawSizeNote| @@ -330,14 +330,14 @@ If both the pen and brush are non-transparent, the rectangle is filled with the brush before the outline is drawn with the pen. In unsmoothed mode, when the pen is size 0 or 1, the filling precisely overlaps the entire outline. As a result, if a rectangle is drawn - with a size-0 or size-1 @scheme['xor] @scheme[pen%] and an - @scheme['xor] @scheme[brush%], the outline is xored twice (first by + with a size-0 or size-1 @racket['xor] @racket[pen%] and an + @racket['xor] @racket[brush%], the outline is xored twice (first by the brush, then by the pen), leaving it unchanged. More generally, the pen is centered over the outline of the rectangle, rounding toward the center in unsmoothed mode. See also @method[dc<%> set-smoothing] for information on the -@scheme['aligned] smoothing mode. +@racket['aligned] smoothing mode. @|DrawSizeNote| @@ -356,13 +356,13 @@ Draws a rectangle with the given top-left corner, and with the given current pen is used for the outline and the current brush for filling the shape. -If @scheme[radius] is positive, the value is used as the radius of the - rounded corner. If @scheme[radius] is negative, the absolute value is +If @racket[radius] is positive, the value is used as the radius of the + rounded corner. If @racket[radius] is negative, the absolute value is used as the @italic{proportion} of the smallest dimension of the - rectangle. + rectangle. -If @scheme[radius] is less than @scheme[-0.5] or more than half of - @scheme[width] or @scheme[height], @|MismatchExn|. +If @racket[radius] is less than @racket[-0.5] or more than half of + @racket[width] or @racket[height], @|MismatchExn|. If both the pen and brush are non-transparent, the rectangle is filled with the brush before the outline is drawn with the pen. The filling @@ -374,7 +374,7 @@ If both the pen and brush are non-transparent, the rectangle is filled unsmoothed mode. See also @method[dc<%> set-smoothing] for information on the -@scheme['aligned] smoothing mode. +@racket['aligned] smoothing mode. @|DrawSizeNote| @@ -388,12 +388,12 @@ See also @method[dc<%> set-smoothing] for information on the [y3 real?]) void?]{ -@index['("drawing curves")]{Draws} a spline from (@scheme[x1], - @scheme[y1]) to (@scheme[x3], @scheme[y3]) using (@scheme[x2], - @scheme[y2]) as the control point. +@index['("drawing curves")]{Draws} a spline from (@racket[x1], + @racket[y1]) to (@racket[x3], @racket[y3]) using (@racket[x2], + @racket[y2]) as the control point. See also @method[dc<%> set-smoothing] for information on the - @scheme['aligned] smoothing mode. See also @scheme[dc-path%] and + @racket['aligned] smoothing mode. See also @racket[dc-path%] and @method[dc<%> draw-path] for drawing more complex curves. @|DrawSizeNote| @@ -415,19 +415,19 @@ Draws a text string at a specified point, using the current text font, location of the top-left pixel in the ``W''). Rotated text is rotated around this point. -The @scheme[text] string is drawn starting from the @scheme[offset] - character, and continuing until the end of @scheme[text] or the first +The @racket[text] string is drawn starting from the @racket[offset] + character, and continuing until the end of @racket[text] or the first null character. -If @scheme[combine?] is @scheme[#t], then @scheme[text] may be +If @racket[combine?] is @racket[#t], then @racket[text] may be measured with adjacent characters combined to ligature glyphs, with Unicode combining characters as a single glyph, with kerning, with - right-to-left rendering of characters, etc. If @scheme[combine?] is - @scheme[#f], then the result is the same as if each character is + right-to-left rendering of characters, etc. If @racket[combine?] is + @racket[#f], then the result is the same as if each character is measured separately, and Unicode control characters are ignored. -The string is rotated by @scheme[angle] radians counter-clockwise. If - @scheme[angle] is not zero, then the text is always drawn in +The string is rotated by @racket[angle] radians counter-clockwise. If + @racket[angle] is not zero, then the text is always drawn in transparent mode (see @method[dc<%> set-text-mode]). The current brush and current pen settings for the DC have no effect @@ -517,7 +517,7 @@ Gets the current brush. See also @method[dc<%> set-brush]. Gets the height of a character using the current font. Unlike most methods, this method can be called for a - @scheme[bitmap-dc%] object without a bitmap installed. + @racket[bitmap-dc%] object without a bitmap installed. } @@ -527,14 +527,14 @@ Unlike most methods, this method can be called for a Gets the average width of a character using the current font. Unlike most methods, this method can be called for a - @scheme[bitmap-dc%] object without a bitmap installed. + @racket[bitmap-dc%] object without a bitmap installed. } @defmethod[(get-clipping-region) (or/c (is-a?/c region%) false/c)]{ -Gets the current clipping region, returning @scheme[#f] if the drawing +Gets the current clipping region, returning @racket[#f] if the drawing context is not clipped (i.e., the clipping region is the entire drawing region). @@ -565,10 +565,10 @@ Gets the current font. See also @method[dc<%> set-font]. @defmethod[(get-gl-context) (or/c (is-a?/c gl-context<%>) false/c)]{ -Returns a @scheme[gl-context<%>] object for this drawing context - if it supports OpenGL, @scheme[#f] otherwise. +Returns a @racket[gl-context<%>] object for this drawing context + if it supports OpenGL, @racket[#f] otherwise. -See @scheme[gl-context<%>] for more information. +See @racket[gl-context<%>] for more information. } @@ -647,11 +647,11 @@ See also @method[dc<%> set-scale] and @method[dc<%> get-transformation]. (values (and/c real? (not/c negative?)) (and/c real? (not/c negative?)))]{ -Gets the size of the destination drawing area. For a @scheme[dc<%>] - object obtained from a @scheme[canvas<%>], this is the (virtual - client) size of the destination window; for a @scheme[bitmap-dc%] +Gets the size of the destination drawing area. For a @racket[dc<%>] + object obtained from a @racket[canvas<%>], this is the (virtual + client) size of the destination window; for a @racket[bitmap-dc%] object, this is the size of the selected bitmap (or 0 if no bitmap is - selected); for a @scheme[post-script-dc%] or @scheme[printer-dc%] + selected); for a @racket[post-script-dc%] or @racket[printer-dc%] drawing context, this gets the horizontal and vertical size of the drawing area. @@ -682,11 +682,11 @@ set-text-background]. (and/c real? (not/c negative?)))]{ -Returns the size of @scheme[str] at it would be drawn in the drawing - context, starting from the @scheme[offset] character of @scheme[str], - and continuing until the end of @scheme[str] or the first null - character. The @scheme[font] argument specifies the font to use in - measuring the text; if it is @scheme[#f], the current font of the +Returns the size of @racket[str] at it would be drawn in the drawing + context, starting from the @racket[offset] character of @racket[str], + and continuing until the end of @racket[str] or the first null + character. The @racket[font] argument specifies the font to use in + measuring the text; if it is @racket[#f], the current font of the drawing area is used. (See also @method[dc<%> set-font].) The result is four real numbers: @@ -713,15 +713,15 @@ The returned width and height define a rectangle is that guaranteed to depending on the whims of the font designer and the platform-specific font-scaling mechanism. -If @scheme[combine?] is @scheme[#t], then @scheme[text] may be drawn +If @racket[combine?] is @racket[#t], then @racket[text] may be drawn with adjacent characters combined to ligature glyphs, with Unicode combining characters as a single glyph, with kerning, with - right-to-left ordering of characters, etc. If @scheme[combine?] is - @scheme[#f], then the result is the same as if each character is + right-to-left ordering of characters, etc. If @racket[combine?] is + @racket[#f], then the result is the same as if each character is drawn separately, and Unicode control characters are ignored. Unlike most methods, this method can be called for a - @scheme[bitmap-dc%] object without a bitmap installed. + @racket[bitmap-dc%] object without a bitmap installed. } @@ -768,15 +768,15 @@ The vector content is as follows: @defmethod[(glyph-exists? [c char?]) boolean?]{ -Returns @scheme[#t] if the given character has a corresponding glyph - for this drawing context, @scheme[#f] otherwise. +Returns @racket[#t] if the given character has a corresponding glyph + for this drawing context, @racket[#f] otherwise. Due to automatic font substitution when drawing or measuring text, the result of this method does not depend on the given font, which merely - provides a hint for the glyph search. If the font is @scheme[#f], the + provides a hint for the glyph search. If the font is @racket[#f], the drawing context's current font is used. The result depends on the - type of the drawing context, but the result for @scheme[canvas%] - @scheme[dc<%>] instances and @scheme[bitmap-dc%] instances is always + type of the drawing context, but the result for @racket[canvas%] + @racket[dc<%>] instances and @racket[bitmap-dc%] instances is always the same for a given platform and a given set of installed fonts. See also @method[font% screen-glyph-exists?] . @@ -786,7 +786,7 @@ See also @method[font% screen-glyph-exists?] . @defmethod[(ok?) boolean?]{ -Returns @scheme[#t] if the drawing context is usable. +Returns @racket[#t] if the drawing context is usable. } @@ -827,8 +827,8 @@ rotation settings have their identity values. @defmethod[(set-alpha [opacity (real-in 0 1)]) void?]{ -Determines the opacity of drawing. A value of @scheme[0.0] corresponds -to completely transparent (i.e., invisible) drawing, and @scheme[1.0] +Determines the opacity of drawing. A value of @racket[0.0] corresponds +to completely transparent (i.e., invisible) drawing, and @racket[1.0] corresponds to completely opaque drawing. For intermediate values, drawing is blended with the existing content of the drawing context. A color (e.g. for a brush) also has an alpha value; it is combined @@ -841,8 +841,8 @@ with the drawing context's alpha by multiplying.} void?])]{ Sets the background color for drawing in this object (e.g., using -@method[dc<%> clear] or using a stippled @scheme[brush%] with the mode -@scheme['opaque]). For monochrome drawing, all non-black colors are +@method[dc<%> clear] or using a stippled @racket[brush%] with the mode +@racket['opaque]). For monochrome drawing, all non-black colors are treated as white. } @@ -891,11 +891,11 @@ get-clipping-region]. void?]{ Sets the clipping region for the drawing area, turning off all - clipping within the drawing region if @scheme[#f] is provided. + clipping within the drawing region if @racket[#f] is provided. -The clipping region must be reset after changing a @scheme[dc<%>] - object's origin or scale (unless it is @scheme[#f]); see - @scheme[region%] for more information. +The clipping region must be reset after changing a @racket[dc<%>] + object's origin or scale (unless it is @racket[#f]); see + @racket[region%] for more information. See also @method[dc<%> set-clipping-rect] and @method[dc<%> get-clipping-region]. @@ -1006,27 +1006,27 @@ See also @method[dc<%> scale], which adds a scale to the current Enables or disables anti-aliased smoothing for drawing. (Text smoothing is not affected by this method, and is instead controlled - through the @scheme[font%] object.) + through the @racket[font%] object.) -The smoothing mode is either @scheme['unsmoothed], @scheme['smoothed], - or @scheme['aligned]. Both @scheme['aligned] and @scheme['smoothed] +The smoothing mode is either @racket['unsmoothed], @racket['smoothed], + or @racket['aligned]. Both @racket['aligned] and @racket['smoothed] are smoothing modes. -In @scheme['smoothed] mode for a canvas or bitmap drawing context, +In @racket['smoothed] mode for a canvas or bitmap drawing context, integer drawing coordinates correspond to the boundary between pixels, and pen-based drawing is centered over a given line or - curve. Thus, drawing with pen width @scheme[1] from @math{(0, 10)} to + curve. Thus, drawing with pen width @racket[1] from @math{(0, 10)} to @math{(10, 10)} draws a 2-pixel wide line with @math{50%} opacity. -The @scheme['aligned] smoothing mode is like @scheme['smoothed], but - it paints pixels more like @scheme['unsmoothed] mode. Since it aligns - shapes to pixel boundaries, @scheme['aligned] mode often produces - better results than @scheme['smoothed], but the results depend on the - application. The @scheme['aligned] mode is defined in terms of - @scheme['smoothed] mode, except that drawing coordinates are rounded - down (via @scheme[floor], after scaling and origin translation). For +The @racket['aligned] smoothing mode is like @racket['smoothed], but + it paints pixels more like @racket['unsmoothed] mode. Since it aligns + shapes to pixel boundaries, @racket['aligned] mode often produces + better results than @racket['smoothed], but the results depend on the + application. The @racket['aligned] mode is defined in terms of + @racket['smoothed] mode, except that drawing coordinates are rounded + down (via @racket[floor], after scaling and origin translation). For line drawing, coordinates are then shifted right and down by the - @scheme[floor] of half a pen width. In addition, for pen drawing + @racket[floor] of half a pen width. In addition, for pen drawing through @method[dc<%> draw-rectangle], @method[dc<%> draw-ellipse], @method[dc<%> draw-rounded-rectangle], and @method[dc<%> draw-arc], the given width and height are each decreased by @math{1.0}. @@ -1040,7 +1040,7 @@ The @scheme['aligned] smoothing mode is like @scheme['smoothed], but Sets the current text background color for this object. The text background color is painted behind text that is drawn with - @method[dc<%> draw-text], but only for the @scheme['solid] text mode + @method[dc<%> draw-text], but only for the @racket['solid] text mode (see @method[dc<%> set-text-mode]). For monochrome drawing, all non-white colors are treated as black. @@ -1068,11 +1068,11 @@ Determines how text is drawn: @itemize[ - @item{@scheme['solid] --- Before text is drawn, the destination area + @item{@racket['solid] --- Before text is drawn, the destination area is filled with the text background color (see @method[dc<%> set-text-background]).} - @item{@scheme['transparent] --- Text is drawn directly over any + @item{@racket['transparent] --- Text is drawn directly over any existing image in the destination, as if overlaying text written on transparent film.} @@ -1095,7 +1095,7 @@ get-transformation] for information about @racket[t].} Starts a document, relevant only when drawing to a printer, PostScript, PDF, or SVG device. For some - platforms, the @scheme[message] string is displayed in a dialog until + platforms, the @racket[message] string is displayed in a dialog until @method[dc<%> end-doc] is called. For relevant devices, an exception is raised if @@ -1117,10 +1117,10 @@ Relevant devices, an exception is raised if @method[dc<%> start-doc] has not been called, or when @method[dc<%> end-doc] has been called already. In addition, in the case of PostScript output, Encapsulated PostScript (EPS) cannot contain - multiple pages, so calling @scheme[start-page] a second time for a - @scheme[post-script-dc%] instance raises an exception; to create - PostScript output with multiple pages, supply @scheme[#f] as the - @scheme[as-eps] initialization argument for @scheme[post-script-dc%]. + multiple pages, so calling @racket[start-page] a second time for a + @racket[post-script-dc%] instance raises an exception; to create + PostScript output with multiple pages, supply @racket[#f] as the + @racket[as-eps] initialization argument for @racket[post-script-dc%]. } @@ -1166,8 +1166,8 @@ rotation settings have their identity values. void?]{ Determines the actual color used for drawing requests with the given - color. The @scheme[result] color is set to the RGB values that are + color. The @racket[result] color is set to the RGB values that are actually produced for this drawing context to draw the color - @scheme[try]. + @racket[try]. }} diff --git a/collects/scribblings/draw/dc-path-class.scrbl b/collects/scribblings/draw/dc-path-class.scrbl index 325d8df14b..c3a8b1d27c 100644 --- a/collects/scribblings/draw/dc-path-class.scrbl +++ b/collects/scribblings/draw/dc-path-class.scrbl @@ -4,16 +4,16 @@ @defclass/title[dc-path% object% ()]{ A path is a set of figures defined by curves. A path can be used with -the @method[dc<%> draw-path] method of a @scheme[dc<%>] object to draw +the @method[dc<%> draw-path] method of a @racket[dc<%>] object to draw the path's curves as lines, fill the region bounded by the path's curves, or both. A path can also be used with the @method[region% -set-path] method of a @scheme[region%] object to generate a region +set-path] method of a @racket[region%] object to generate a region bounded by the path's curves. A path consists of zero or more @deftech{closed sub-paths}, and - possibly one @deftech{open sub-path}. Some @scheme[dc-path%] methods - extend the open sub-path, some @scheme[dc-path%] methods close the - open sub-path, and some @scheme[dc-path%] methods add closed + possibly one @deftech{open sub-path}. Some @racket[dc-path%] methods + extend the open sub-path, some @racket[dc-path%] methods close the + open sub-path, and some @racket[dc-path%] methods add closed sub-paths. This approach to drawing formulation is inherited from PostScript @cite["Adobe99"]. @@ -24,13 +24,13 @@ When a path is drawn as a line, a closed sub-path is drawn as a closed When a path is filled or used as a region, the open sub-path (if any) is treated as if it were closed. The content of a path is determined - either through the @scheme['even-odd] rule or the @scheme['winding] + either through the @racket['even-odd] rule or the @racket['winding] rule, as selected at the time when the path is filled or used to generate a region. -A path is not connected to any particular @scheme[dc<%>] object, so - setting a @scheme[dc<%>] origin or scale does not affect path - operations. Instead, a @scheme[dc<%>]'s origin and scale apply at the +A path is not connected to any particular @racket[dc<%>] object, so + setting a @racket[dc<%>] origin or scale does not affect path + operations. Instead, a @racket[dc<%>]'s origin and scale apply at the time that the path is drawn or used to set a region. @defconstructor[()]{ @@ -44,8 +44,8 @@ sub-path}). @defmethod[(append [path (is-a?/c dc-path%)]) void?]{ -Adds the sub-paths of @scheme[path] to @this-obj[]. @tech{Closed - sub-paths} of @scheme[path] are added as @tech{closed sub-paths} to +Adds the sub-paths of @racket[path] to @this-obj[]. @tech{Closed + sub-paths} of @racket[path] are added as @tech{closed sub-paths} to @this-obj[]. If both paths have an @tech{open sub-path}, then this path's sub-path is extended by the given path's @tech{open sub-path}, adding a line from this path's current ending point to the given @@ -67,9 +67,9 @@ Adds the sub-paths of @scheme[path] to @this-obj[]. @tech{Closed Extends or starts the path's @tech{open sub-path} with a curve that corresponds to a section of an ellipse. If @racket[width] and @racket[height] are non-negative, the ellipse is the one - bounded by a rectangle whose top-left corner is @math{(@scheme[x], - @scheme[y])} and whose dimensions are @scheme[width] by - @scheme[height]; if @racket[width] is negative, then + bounded by a rectangle whose top-left corner is @math{(@racket[x], + @racket[y])} and whose dimensions are @racket[width] by + @racket[height]; if @racket[width] is negative, then the rectangle's right edge is @racket[x], and the ellipse width is @racket[(abs width)], while a negative @racket[height] similarly makes @racket[y] is the bottom edge of the ellipse and @@ -80,11 +80,11 @@ Extends or starts the path's @tech{open sub-path} with a curve that In contrast, @xmethod[dc<%> draw-arc] can automatically correct for round off, since the drawing mode is known immediately.} The ellipse section starts a the angle - @scheme[start-radians] (@scheme[0] is three o'clock and half-π is - twelve o'clock) and continues to the angle @scheme[end-radians]; if - @scheme[counter-clockwise?] is true, then the arc runs - counter-clockwise from @scheme[start-radians] to - @scheme[end-radians], otherwise it runs clockwise. + @racket[start-radians] (@racket[0] is three o'clock and half-π is + twelve o'clock) and continues to the angle @racket[end-radians]; if + @racket[counter-clockwise?] is true, then the arc runs + counter-clockwise from @racket[start-radians] to + @racket[end-radians], otherwise it runs clockwise. If the path has no @tech{open sub-path}, a new one is started with the arc's starting point. Otherwise, the arc extends the existing @@ -110,9 +110,9 @@ Closes the path's @tech{open sub-path}. If the path has no @tech{open void?]{ Extends the path's @tech{open sub-path} with a Bezier curve to the - given point @math{(@scheme[x3],@scheme[y3])}, using the points - @math{(@scheme[x1], @scheme[y1])} and @math{(@scheme[x2], - @scheme[y2])} as control points. If the path has no @tech{open + given point @math{(@racket[x3],@racket[y3])}, using the points + @math{(@racket[x1], @racket[y1])} and @math{(@racket[x2], + @racket[y2])} as control points. If the path has no @tech{open sub-path}, @|MismatchExn|. } @@ -125,8 +125,8 @@ Extends the path's @tech{open sub-path} with a Bezier curve to the Closes the @tech{open sub-path}, if any, and adds a @tech{closed sub-path} that represents an ellipse bounded by a rectangle whose - top-left corner is @math{(@scheme[x], @scheme[y])} and whose - dimensions are @scheme[width] by @scheme[height]. (This convenience + top-left corner is @math{(@racket[x], @racket[y])} and whose + dimensions are @racket[width] by @racket[height]. (This convenience method is implemented in terms of @method[dc-path% close] and @method[dc-path% arc].) @@ -180,8 +180,8 @@ After closing the @tech{open sub-path}, if any, starts a new @defmethod[(open?) boolean?]{ -Returns @scheme[#t] if the path has an @tech{open sub-path}, -@scheme[#f] otherwise. +Returns @racket[#t] if the path has an @tech{open sub-path}, +@racket[#f] otherwise. } @@ -192,9 +192,9 @@ Returns @scheme[#t] if the path has an @tech{open sub-path}, void?]{ Closes the @tech{open sub-path}, if any, and adds a closed path that - represents a rectangle whose top-left corner is @math{(@scheme[x], - @scheme[y])} and whose dimensions are @scheme[width] by - @scheme[height]. (This convenience method is implemented in terms of + represents a rectangle whose top-left corner is @math{(@racket[x], + @racket[y])} and whose dimensions are @racket[width] by + @racket[height]. (This convenience method is implemented in terms of @method[dc-path% close], @method[dc-path% move-to], and @method[dc-path% line-to].) @@ -215,7 +215,7 @@ Reverses the order of all points in all sub-paths. If the path has an and extensions to the @tech{open sub-path} build on this new ending point. Reversing a @tech{closed sub-path} affects how it combines with other sub-paths when determining the content of a path in - @scheme['winding] mode. + @racket['winding] mode. } @@ -223,7 +223,7 @@ Reverses the order of all points in all sub-paths. If the path has an void?]{ Adjusts all points within the path (including all sub-paths), rotating - them @scheme[radians] counter-clockwise around @math{(0, 0)}. Future + them @racket[radians] counter-clockwise around @math{(0, 0)}. Future additions to the path are not rotated by this call. } @@ -237,18 +237,18 @@ Adjusts all points within the path (including all sub-paths), rotating Closes the @tech{open sub-path}, if any, and adds a @tech{closed sub-path} that represents a round-cornered rectangle whose top-left - corner is @math{(@scheme[x] @scheme[y])} and whose dimensions are - @scheme[width] by @scheme[height]. (This convenience method is + corner is @math{(@racket[x] @racket[y])} and whose dimensions are + @racket[width] by @racket[height]. (This convenience method is implemented in terms of @method[dc-path% close], @method[dc-path% move-to], @method[dc-path% arc], and @method[dc-path% line-to].) -If @scheme[radius] is positive, the value is used as the radius of the - rounded corner. If @scheme[radius] is negative, the absolute value is +If @racket[radius] is positive, the value is used as the radius of the + rounded corner. If @racket[radius] is negative, the absolute value is used as the @italic{proportion} of the smallest dimension of the rectangle. -If @scheme[radius] is less than @scheme[-0.5] or more than half of - @scheme[width] or @scheme[height], @|MismatchExn|. +If @racket[radius] is less than @racket[-0.5] or more than half of + @racket[width] or @racket[height], @|MismatchExn|. } @@ -258,7 +258,7 @@ If @scheme[radius] is less than @scheme[-0.5] or more than half of @index['("paths" "flipping")]{Adjusts} all points within the path (including all sub-paths), multiplying each x-coordinate by - @scheme[x] and each y-coordinate by @scheme[y]. Scaling by a negative + @racket[x] and each y-coordinate by @racket[y]. Scaling by a negative number flips the path over the corresponding axis. Future additions to the path are not scaled by this call. @@ -269,7 +269,7 @@ If @scheme[radius] is less than @scheme[-0.5] or more than half of void?]{ Adjusts all points within the path (including all sub-paths), shifting - then @scheme[x] to the right and @scheme[y] down. Future additions + then @racket[x] to the right and @racket[y] down. Future additions to the path are not translated by this call. }} diff --git a/collects/scribblings/draw/draw-funcs.scrbl b/collects/scribblings/draw/draw-funcs.scrbl index f7fc76a052..adc1398a98 100644 --- a/collects/scribblings/draw/draw-funcs.scrbl +++ b/collects/scribblings/draw/draw-funcs.scrbl @@ -8,7 +8,7 @@ @defparam[current-ps-setup pss (is-a?/c ps-setup%)]{ A parameter that determines the current PostScript configuration - settings. See @scheme[post-script-dc%] and @scheme[printer-dc%]. + settings. See @racket[post-script-dc%] and @racket[printer-dc%]. } @@ -16,7 +16,7 @@ A parameter that determines the current PostScript configuration (listof string?)]{ Returns a list of font face names available on the current system. If - @scheme['mono] is provided as the argument, then only faces that are + @racket['mono] is provided as the argument, then only faces that are known to correspond to monospace fonts are included in the list. } @@ -29,7 +29,7 @@ Returns a list of font face names available on the current system. If Returns the built-in default face mapping for a particular font family. -See @scheme[font%] for information about @scheme[family]. +See @racket[font%] for information about @racket[family]. } @@ -96,31 +96,31 @@ useful way.} @defthing[the-brush-list (is-a?/c brush-list%)]{ -See @scheme[brush-list%]. +See @racket[brush-list%]. } @defthing[the-color-database (is-a?/c color-database<%>)]{ -See @scheme[color-database<%>]. +See @racket[color-database<%>]. } @defthing[the-font-list (is-a?/c font-list%)]{ -See @scheme[font-list%]. +See @racket[font-list%]. } @defthing[the-font-name-directory (is-a?/c font-name-directory<%>)]{ -See @scheme[font-name-directory<%>]. +See @racket[font-name-directory<%>]. } @defthing[the-pen-list (is-a?/c pen-list%)]{ -See @scheme[pen-list%]. +See @racket[pen-list%]. } diff --git a/collects/scribblings/draw/font-class.scrbl b/collects/scribblings/draw/font-class.scrbl index c2514fe1b7..fea1f86e5a 100644 --- a/collects/scribblings/draw/font-class.scrbl +++ b/collects/scribblings/draw/font-class.scrbl @@ -17,14 +17,14 @@ A @defterm{font} is an object which determines the appearance of text, designation. The families are: @itemize[ - @item{@indexed-scheme['default]} - @item{@indexed-scheme['decorative]} - @item{@indexed-scheme['roman]} - @item{@indexed-scheme['script]} - @item{@indexed-scheme['swiss]} - @item{@indexed-scheme['modern] (fixed width)} - @item{@indexed-scheme['symbol] (Greek letters and more)} - @item{@indexed-scheme['system] (similar to the font to draw control labels, + @item{@indexed-racket['default]} + @item{@indexed-racket['decorative]} + @item{@indexed-racket['roman]} + @item{@indexed-racket['script]} + @item{@indexed-racket['swiss]} + @item{@indexed-racket['modern] (fixed width)} + @item{@indexed-racket['symbol] (Greek letters and more)} + @item{@indexed-racket['system] (similar to the font to draw control labels, but see @racket[normal-control-font])} ] @@ -34,53 +34,53 @@ A @defterm{font} is an object which determines the appearance of text, ``family'' is a kind of abstract font family that is mapped to a particular font family on a given platform.}} - @item{face --- A string face name, such as @scheme["Courier"]. The format + @item{face --- A string face name, such as @racket["Courier"]. The format and meaning of a face name is platform- and - device-specific. If a font's face name is @scheme[#f], + device-specific. If a font's face name is @racket[#f], then the font's appearance depends only on the family. If a face is provided but no mapping is available for the face name (for a specific platform or device), then the face name is ignored and the - family is used. See @scheme[font-name-directory<%>] + family is used. See @racket[font-name-directory<%>] for information about how face names are mapped for drawing text.} @item{style --- The slant style of the font, one of: @itemize[ - @item{@indexed-scheme['normal]} - @item{@indexed-scheme['slant] (a.k.a ``oblique'')} - @item{@indexed-scheme['italic]} + @item{@indexed-racket['normal]} + @item{@indexed-racket['slant] (a.k.a ``oblique'')} + @item{@indexed-racket['italic]} ]} @item{weight --- The weight of the font, one of: @itemize[ - @item{@indexed-scheme['normal]} - @item{@indexed-scheme['light]} - @item{@indexed-scheme['bold]} + @item{@indexed-racket['normal]} + @item{@indexed-racket['light]} + @item{@indexed-racket['bold]} ]} -@item{underline? --- @scheme[#t] for underlined, @scheme[#f] for plain.} +@item{underline? --- @racket[#t] for underlined, @racket[#f] for plain.} @item{smoothing --- Amount of anti-alias smoothing, one of: @itemize[ - @item{@indexed-scheme['default] (platform-specific, sometimes user-configurable)} - @item{@indexed-scheme['partly-smoothed] (gray anti-aliasing)} - @item{@indexed-scheme['smoothed] (sub-pixel anti-aliasing)} - @item{@indexed-scheme['unsmoothed]} + @item{@indexed-racket['default] (platform-specific, sometimes user-configurable)} + @item{@indexed-racket['partly-smoothed] (gray anti-aliasing)} + @item{@indexed-racket['smoothed] (sub-pixel anti-aliasing)} + @item{@indexed-racket['unsmoothed]} ]} -@item{size-in-pixels? --- @scheme[#t] if the size of the font +@item{size-in-pixels? --- @racket[#t] if the size of the font is in logical drawing units (i.e., pixels for an unscaled screen or - bitmap drawing context), @scheme[#f] if the size of the font is in + bitmap drawing context), @racket[#f] if the size of the font is in points (which can depend on screen resolution).} ] To avoid creating multiple fonts with the same characteristics, use - the global @scheme[font-list%] object @indexed-scheme[the-font-list]. + the global @racket[font-list%] object @indexed-racket[the-font-list]. See also -@scheme[font-name-directory<%>]. +@racket[font-name-directory<%>]. @@ -111,8 +111,8 @@ When no arguments are provided, creates an instance of the default font. If no face name is provided, the font is created without a face name. -See @scheme[font%] for information about @scheme[family], - @scheme[style], and @scheme[weight]. @scheme[font-name-directory<%>]. +See @racket[font%] for information about @racket[family], + @racket[style], and @racket[weight]. @racket[font-name-directory<%>]. See also @racket[make-font]. @@ -121,7 +121,7 @@ See also @racket[make-font]. @defmethod[(get-face) (or/c string? false/c)]{ -Gets the font's face name, or @scheme[#f] if none is specified. +Gets the font's face name, or @racket[#f] if none is specified. } @@ -129,7 +129,7 @@ Gets the font's face name, or @scheme[#f] if none is specified. (one-of/c 'default 'decorative 'roman 'script 'swiss 'modern 'symbol 'system)]{ -Gets the font's family. See @scheme[font%] for information about +Gets the font's family. See @racket[font%] for information about families. } @@ -138,7 +138,7 @@ families. exact-integer?]{ Gets the font's ID, for use with a -@scheme[font-name-directory<%>]. The ID is determined by the font's +@racket[font-name-directory<%>]. The ID is determined by the font's face and family specifications, only. } @@ -158,8 +158,8 @@ Due to space included in a font by a font designer, a font tends to @defmethod[(get-size-in-pixels) boolean?]{ -Returns @scheme[#t] if the size reported by @method[font% - get-point-size] is in logical drawing units, @scheme[#f] if it is in +Returns @racket[#t] if the size reported by @method[font% + get-point-size] is in logical drawing units, @racket[#f] if it is in points. For a size in points and a screen or bitmap drawing context, the @@ -170,7 +170,7 @@ For a size in points and a screen or bitmap drawing context, the @defmethod[(get-smoothing) (one-of/c 'default 'partly-smoothed 'smoothed 'unsmoothed)]{ -Gets the font's anti-alias smoothing mode. See @scheme[font%] for +Gets the font's anti-alias smoothing mode. See @racket[font%] for information about smoothing. } @@ -178,7 +178,7 @@ Gets the font's anti-alias smoothing mode. See @scheme[font%] for @defmethod[(get-style) (one-of/c 'normal 'italic 'slant)]{ -Gets the font's slant style. See @scheme[font%] for information about +Gets the font's slant style. See @racket[font%] for information about styles. } @@ -186,7 +186,7 @@ Gets the font's slant style. See @scheme[font%] for information about @defmethod[(get-underlined) boolean?]{ -Returns @scheme[#t] if the font is underlined or @scheme[#f] +Returns @racket[#t] if the font is underlined or @racket[#f] otherwise. } @@ -194,7 +194,7 @@ otherwise. @defmethod[(get-weight) (one-of/c 'normal 'bold 'light)]{ -Gets the font's weight. See @scheme[font%] for information about +Gets the font's weight. See @racket[font%] for information about weights. } @@ -203,14 +203,14 @@ Gets the font's weight. See @scheme[font%] for information about [for-label? any/c #f]) boolean?]{ -Returns @scheme[#t] if the given character has a corresponding glyph - when drawing to the screen or a bitmap, @scheme[#f] otherwise. +Returns @racket[#t] if the given character has a corresponding glyph + when drawing to the screen or a bitmap, @racket[#f] otherwise. If the second argument is true, the result indicates whether the glyph is available for control labels. Otherwise, it indicates whether the - glyph is available for @scheme[dc<%>] drawing. + glyph is available for @racket[dc<%>] drawing. -For @scheme[dc<%>] drawing, due to automatic font substitution when +For @racket[dc<%>] drawing, due to automatic font substitution when drawing or measuring text, the result of this method does not depend on this font's attributes (size, face, etc.). The font's attributes merely provide a hint for the glyph search. diff --git a/collects/scribblings/draw/font-list-class.scrbl b/collects/scribblings/draw/font-list-class.scrbl index d47d5825e2..b8a1351316 100644 --- a/collects/scribblings/draw/font-list-class.scrbl +++ b/collects/scribblings/draw/font-list-class.scrbl @@ -3,10 +3,10 @@ @defclass/title[font-list% object% ()]{ -A @scheme[font-list%] object maintains a list of @scheme[font%] +A @racket[font-list%] object maintains a list of @racket[font%] objects to avoid repeatedly creating fonts. -A global font list, @scheme[the-font-list], is created automatically. +A global font list, @racket[the-font-list], is created automatically. @defconstructor[()]{ @@ -37,6 +37,6 @@ Creates an empty font list. Finds an existing font in the list or creates a new one (that is automatically added to the list). The arguments are the same as for - creating a @scheme[font%] instance. + creating a @racket[font%] instance. }} diff --git a/collects/scribblings/draw/font-name-directory-intf.scrbl b/collects/scribblings/draw/font-name-directory-intf.scrbl index c4b83437e7..2199b734b3 100644 --- a/collects/scribblings/draw/font-name-directory-intf.scrbl +++ b/collects/scribblings/draw/font-name-directory-intf.scrbl @@ -3,18 +3,18 @@ @definterface/title[font-name-directory<%> ()]{ -There is one @scheme[font-name-directory<%>] object: - @scheme[the-font-name-directory]. It implements a mapping from font +There is one @racket[font-name-directory<%>] object: + @racket[the-font-name-directory]. It implements a mapping from font specifications (face, family, style, and weight) to information for rendering text on a specific device. Programmers rarely need to - directly invoke methods of @scheme[the-font-name-directory]. It is - used automatically when drawing text to a @scheme[dc<%>] - object. Nevertheless, @scheme[the-font-name-directory] is available + directly invoke methods of @racket[the-font-name-directory]. It is + used automatically when drawing text to a @racket[dc<%>] + object. Nevertheless, @racket[the-font-name-directory] is available so that programmers can query or modify the mapping manually. A programmer may also need to understand how the face-and-family mapping works. -To extract mapping information from @scheme[the-font-name-directory], +To extract mapping information from @racket[the-font-name-directory], first obtain a @defterm{font ID}, which is an index based on a family and optional face string. Font IDs are returned by @method[font-name-directory<%> find-or-create-font-id] and @@ -25,10 +25,10 @@ To extract mapping information from @scheme[the-font-name-directory], For a family without a face string, the corresponding font ID has a useful built-in mapping for every platform and device. For a family with a - face string, @scheme[the-font-name-directory] interprets the string + face string, @racket[the-font-name-directory] interprets the string (in a platform-specific way) to generate a mapping for ``screen'' - drawing (to a canvas's @scheme[dc<%>], a @scheme[bitmap-dc%], or a - @scheme[printer-dc%]). When drawing to a @scheme[post-script-dc%] + drawing (to a canvas's @racket[dc<%>], a @racket[bitmap-dc%], or a + @racket[printer-dc%]). When drawing to a @racket[post-script-dc%] object, the face-specific mapping defaults to the family's mapping. @@ -37,7 +37,7 @@ For a family without a face string, the corresponding font ID has a exact-integer?]{ Gets the font ID representing the default font for a family. See -@scheme[font%] for information about font families. +@racket[font%] for information about font families. } @@ -50,7 +50,7 @@ Gets the face name for a font ID, initializing the mapping for the face name if necessary. Font ID are useful only as mapping indices for - @indexed-scheme[the-font-name-directory]. + @indexed-racket[the-font-name-directory]. } @@ -58,7 +58,7 @@ Font ID are useful only as mapping indices for (or/c string? false/c)]{ Gets the face name for a font ID. If the font ID corresponds to - the default font for a particular family, @scheme[#f] is returned. + the default font for a particular family, @racket[#f] is returned. } @@ -67,7 +67,7 @@ Gets the face name for a font ID. If the font ID corresponds to 'swiss 'modern 'symbol 'system)]{ Gets the family for a font ID. See -@scheme[font%] for information about font families. +@racket[font%] for information about font families. } @@ -77,12 +77,12 @@ Gets the family for a font ID. See exact-integer?]{ Gets the font ID for a face name paired with a default family. If the - mapping for the given pair is not already initialized, @scheme[0] is + mapping for the given pair is not already initialized, @racket[0] is returned. See also @method[font-name-directory<%> find-or-create-font-id]. Font ID are useful only as mapping indices for - @indexed-scheme[the-font-name-directory]. + @indexed-racket[the-font-name-directory]. } @@ -94,8 +94,8 @@ Font ID are useful only as mapping indices for Gets a PostScript font name for a font ID, weight, and style combination. -See @scheme[font%] for information about @scheme[weight] and - @scheme[style]. +See @racket[font%] for information about @racket[weight] and + @racket[style]. } @@ -105,11 +105,11 @@ See @scheme[font%] for information about @scheme[weight] and (or/c string? false/c)]{ Gets a platform-dependent screen font name (used for drawing to a - canvas's @scheme[dc<%>], a @scheme[bitmap-dc%], or a - @scheme[printer-dc%]) for a font ID, weight, and style combination. + canvas's @racket[dc<%>], a @racket[bitmap-dc%], or a + @racket[printer-dc%]) for a font ID, weight, and style combination. -See @scheme[font%] for information about @scheme[weight] and -@scheme[style]. +See @racket[font%] for information about @racket[weight] and +@racket[style]. } @@ -123,7 +123,7 @@ Sets a PostScript font name for a font ID, weight, and style combination. See also @method[font-name-directory<%> get-post-script-name]. -See @scheme[font%] for information about @scheme[weight] and @scheme[style]. +See @racket[font%] for information about @racket[weight] and @racket[style]. } @@ -134,11 +134,11 @@ See @scheme[font%] for information about @scheme[weight] and @scheme[style]. void?]{ Sets a platform-dependent screen font name (used for drawing to a - canvas's @scheme[dc<%>], a @scheme[bitmap-dc%], or a - @scheme[printer-dc%]) for a font ID, weight, and style combination. + canvas's @racket[dc<%>], a @racket[bitmap-dc%], or a + @racket[printer-dc%]) for a font ID, weight, and style combination. -See @scheme[font%] for information about @scheme[weight] and - @scheme[style]. +See @racket[font%] for information about @racket[weight] and + @racket[style]. }} diff --git a/collects/scribblings/draw/gl-config-class.scrbl b/collects/scribblings/draw/gl-config-class.scrbl index df6824be42..3ada521871 100644 --- a/collects/scribblings/draw/gl-config-class.scrbl +++ b/collects/scribblings/draw/gl-config-class.scrbl @@ -3,9 +3,9 @@ @defclass/title[gl-config% object% ()]{ -A @scheme[gl-config%] object encapsulates configuration information - for an OpenGL drawing context. Use a @scheme[gl-config%] object as an - initialization argument for @scheme[canvas%] or provide it to +A @racket[gl-config%] object encapsulates configuration information + for an OpenGL drawing context. Use a @racket[gl-config%] object as an + initialization argument for @racket[canvas%] or provide it to @racket[make-gl-bitmap]. diff --git a/collects/scribblings/draw/gl-context-intf.scrbl b/collects/scribblings/draw/gl-context-intf.scrbl index 2a99ddf921..9b4741199e 100644 --- a/collects/scribblings/draw/gl-context-intf.scrbl +++ b/collects/scribblings/draw/gl-context-intf.scrbl @@ -3,29 +3,29 @@ @definterface/title[gl-context<%> ()]{ -A @scheme[gl-context<%>] object represents a context for drawing with - @as-index{OpenGL} to a specific @scheme[dc<%>] instance. To obtain a - @scheme[gl-context<%>] object, call @method[dc<%> get-gl-context] of +A @racket[gl-context<%>] object represents a context for drawing with + @as-index{OpenGL} to a specific @racket[dc<%>] instance. To obtain a + @racket[gl-context<%>] object, call @method[dc<%> get-gl-context] of the target drawing context. -Only canvas @scheme[dc<%>] and @scheme[bitmap-dc%] objects containing +Only canvas @racket[dc<%>] and @racket[bitmap-dc%] objects containing a bitmap from @racket[make-gl-bitmap] support OpenGL (always on Windows and Mac OS X, sometimes on Unix). Normal @racket[dc<%>] - drawing and OpenGL drawing can be mixed in a @scheme[bitmap-dc%], but + drawing and OpenGL drawing can be mixed in a @racket[bitmap-dc%], but a canvas that uses the @racket['gl] style to support OpenGL does not reliably support normal @racket[dc<%>] drawing; use a bitmap if you need to mix drawing modes, and use a canvas to maximize OpenGL performance. -When the target bitmap for a @scheme[bitmap-dc%] context is changed +When the target bitmap for a @racket[bitmap-dc%] context is changed via @method[bitmap-dc% set-bitmap], the associated - @scheme[gl-context<%>] changes. Canvas contexts are normally double + @racket[gl-context<%>] changes. Canvas contexts are normally double buffered, and bitmap contexts are single buffered. -The @schememodname[racket/gui/base] library provides no OpenGL +The @racketmodname[racket/gui/base] library provides no OpenGL routines. Instead, they must be obtained from a separate library, - such as @schememodname[sgl]. The facilities in - @schememodname[racket/gui/base] merely manage the current OpenGL + such as @racketmodname[sgl]. The facilities in + @racketmodname[racket/gui/base] merely manage the current OpenGL context, connecting it to windows and bitmaps. Only one OpenGL context can be active at a time across all threads and @@ -56,35 +56,35 @@ The method blocks to obtain a lock that protects the global OpenGL The lock prevents interference among OpenGL-using threads. If a thread is terminated while holding the context lock, the lock is released. Continuation jumps into the thunk do not grab the lock or - set the OpenGL context. See @scheme[gl-context<%>] for more + set the OpenGL context. See @racket[gl-context<%>] for more information on interference. The method accepts an alternate @tech[#:doc reference-doc]{synchronizable event} for use while blocking for the - context lock; see also @scheme[sync]. + context lock; see also @racket[sync]. The result of the method call is the result of the thunk if it is called, or the result of the alternate event if it is chosen instead of the context lock. -If @method[gl-context<%> ok?] returns @scheme[#f] at the time that +If @method[gl-context<%> ok?] returns @racket[#f] at the time that this method is called, then @|MismatchExn|. -If @scheme[enable-breaks?] is true, then the method uses - @scheme[sync/enable-break] while blocking for the context-setting - lock instead of @scheme[sync]. +If @racket[enable-breaks?] is true, then the method uses + @racket[sync/enable-break] while blocking for the context-setting + lock instead of @racket[sync]. } @defmethod[(ok?) boolean?]{ -Returns @scheme[#t] if this context is available OpenGL drawing, - @scheme[#f] otherwise. +Returns @racket[#t] if this context is available OpenGL drawing, + @racket[#f] otherwise. A context is unavailable if OpenGL support is disabled at compile time or run time, if the context is associated with a - @scheme[bitmap-dc%] with no selected bitmap or with a monochrome + @racket[bitmap-dc%] with no selected bitmap or with a monochrome selected bitmap, if the context is for a canvas that no longer exists, or if there was a low-level error when preparing the context. diff --git a/collects/scribblings/draw/guide.scrbl b/collects/scribblings/draw/guide.scrbl index 323f3edc21..f237cb8cd2 100644 --- a/collects/scribblings/draw/guide.scrbl +++ b/collects/scribblings/draw/guide.scrbl @@ -82,12 +82,12 @@ filling, bitmap copying, alpha blending, and affine transformations interfaces in Racket.} Drawing with @racketmodname[racket/draw] requires a @deftech{drawing context} -(@deftech{DC}), which is an instance of the @scheme[dc<%>] +(@deftech{DC}), which is an instance of the @racket[dc<%>] interface. For example, the @racket[post-script-dc%] class implements a @racket[dc<%>] for drawing to a PostScript file, while @racket[bitmap-dc%] draws to a bitmap. When using the @racketmodname[racket/gui] library for GUIs, the @method[canvas<%> get-dc] method of a -canvas returns a @scheme[dc<%>] instance for drawing into the canvas +canvas returns a @racket[dc<%>] instance for drawing into the canvas window. @margin-note{See @secref["canvas-drawing" #:doc '(lib @@ -206,10 +206,10 @@ pixels: @section{Pen, Brush, and Color Objects} The @racket[set-pen] and @racket[set-brush] methods of a @tech{DC} - accept @scheme[pen%] and @scheme[brush%] objects, which group + accept @racket[pen%] and @racket[brush%] objects, which group together pen and brush settings. -@schemeblock+eval[ +@racketblock+eval[ #:eval draw-eval (require racket/math) @@ -264,7 +264,7 @@ make the eval below work. } then it can be loaded with @racket[read-bitmap] and installed as the stipple for @racket[blue-brush]: -@schemeblock+eval[ +@racketblock+eval[ #:eval draw-eval (send blue-brush set-stipple (read-bitmap "water.png")) (send dc erase) @@ -279,7 +279,7 @@ color name. Due to the way that @racket[color%] initialization is overloaded, use @racket[make-object%] instead of @racket[new] to instantiate @racket[color%]: -@schemeblock+eval[ +@racketblock+eval[ #:eval draw-eval (define red-pen (new pen% [color (make-object color% 200 100 150)] [width 2])) @@ -300,7 +300,7 @@ rotate all drawing. The transformation can be set directly, or the current transformation can be transformed further with methods like @racket[scale], @racket[translate], or @racket[rotate]: -@schemeblock+eval[ +@racketblock+eval[ #:eval draw-eval (send dc erase) (send dc scale 0.5 0.5) diff --git a/collects/scribblings/draw/pen-list-class.scrbl b/collects/scribblings/draw/pen-list-class.scrbl index 9a0f5b857b..2b32994fcd 100644 --- a/collects/scribblings/draw/pen-list-class.scrbl +++ b/collects/scribblings/draw/pen-list-class.scrbl @@ -3,11 +3,11 @@ @defclass/title[pen-list% object% ()]{ -A @scheme[pen-list%] object maintains a list of @scheme[pen%] - objects to avoid repeatedly creating pen objects. A @scheme[pen%] +A @racket[pen-list%] object maintains a list of @racket[pen%] + objects to avoid repeatedly creating pen objects. A @racket[pen%] object in a pen list cannot be mutated. -A global pen list @indexed-scheme[the-pen-list] is created automatically. +A global pen list @indexed-racket[the-pen-list] is created automatically. @defconstructor[()]{ @@ -37,11 +37,11 @@ Creates an empty pen list. (or/c (is-a?/c pen%) false/c)])]{ Finds a pen of the given specification, or creates one and adds it to -the list. The arguments are the same as for creating a @scheme[pen%] +the list. The arguments are the same as for creating a @racket[pen%] instance plus a cap and join style as for @method[pen% set-cap] and -@method[pen% set-join]. When @scheme[color-name] is provided, however, the return -value is @scheme[#f] when no color matching @scheme[color-name] can be -found in @scheme[the-color-database]. +@method[pen% set-join]. When @racket[color-name] is provided, however, the return +value is @racket[#f] when no color matching @racket[color-name] can be +found in @racket[the-color-database]. }} diff --git a/collects/scribblings/draw/point-class.scrbl b/collects/scribblings/draw/point-class.scrbl index a492dca3f3..2522c5c40d 100644 --- a/collects/scribblings/draw/point-class.scrbl +++ b/collects/scribblings/draw/point-class.scrbl @@ -3,15 +3,15 @@ @defclass/title[point% object% ()]{ -A @scheme[point%] is used for certain drawing commands. It +A @racket[point%] is used for certain drawing commands. It encapsulates two real numbers. @defconstructor*/make[(() ([x real?] [y real?]))]{ -Creates a point. If @scheme[x] and @scheme[y] are not supplied, they - are set to @scheme[0]. +Creates a point. If @racket[x] and @racket[y] are not supplied, they + are set to @racket[0]. } @defmethod[(get-x) diff --git a/collects/scribblings/draw/post-script-dc-class.scrbl b/collects/scribblings/draw/post-script-dc-class.scrbl index cc07cea633..12e03ef5a8 100644 --- a/collects/scribblings/draw/post-script-dc-class.scrbl +++ b/collects/scribblings/draw/post-script-dc-class.scrbl @@ -3,13 +3,13 @@ @defclass/title[post-script-dc% object% (dc<%>)]{ -A @scheme[post-script-dc%] object is a PostScript device context, that +A @racket[post-script-dc%] object is a PostScript device context, that can write PostScript files on any platform. See also - @scheme[ps-setup%] and @racket[pdf-dc%]. + @racket[ps-setup%] and @racket[pdf-dc%]. @|PrintNote| -See also @scheme[printer-dc%]. +See also @racket[printer-dc%]. @defconstructor[([interactive any/c #t] @@ -20,35 +20,35 @@ See also @scheme[printer-dc%]. [height (or/c (and/c real? (not/c negative?)) #f) #f] [output (or/c path-string? output-port? #f) #f])]{ -If @scheme[interactive] is true, the user is given a dialog for - setting printing parameters (see @scheme[get-ps-setup-from-user]); +If @racket[interactive] is true, the user is given a dialog for + setting printing parameters (see @racket[get-ps-setup-from-user]); the resulting configuration is installed as the current configuration). If the user chooses to print to a file (the only possibility on Windows and Mac OS X), another dialog is given to select the filename. If the user hits cancel in either of these - dialogs, then @method[dc<%> ok?] returns @scheme[#f]. + dialogs, then @method[dc<%> ok?] returns @racket[#f]. -If @scheme[parent] is not @scheme[#f], it is used as the parent window of +If @racket[parent] is not @racket[#f], it is used as the parent window of the configuration dialog. -If @scheme[interactive] is @scheme[#f], then the settings returned by - @scheme[current-ps-setup] are used. A file dialog is still presented +If @racket[interactive] is @racket[#f], then the settings returned by + @racket[current-ps-setup] are used. A file dialog is still presented to the user if the @method[ps-setup% get-file] method returns - @scheme[#f] and @racket[output] is @racket[#f], and the user may - hit @onscreen{Cancel} in that case so that @method[dc<%> ok?] returns @scheme[#f]. + @racket[#f] and @racket[output] is @racket[#f], and the user may + hit @onscreen{Cancel} in that case so that @method[dc<%> ok?] returns @racket[#f]. -If @scheme[use-paper-bbox] is @scheme[#f], then the PostScript +If @racket[use-paper-bbox] is @racket[#f], then the PostScript bounding box for the output is determined by @racket[width] and @racket[height] (which are rounded upward using @racket[ceiling]). - If @scheme[use-paper-bbox] is not @scheme[#f], then + If @racket[use-paper-bbox] is not @racket[#f], then the bounding box is determined by the current paper size (as - specified by @scheme[current-ps-setup]). When @racket[width] or + specified by @racket[current-ps-setup]). When @racket[width] or @racket[height] is @racket[#f], then the corresponding dimension is determined by the paper size, even if @racket[use-paper-bbox] is @racket[#f]. -@index["Encapsulated PostScript (EPS)"]{If} @scheme[as-eps] is - @scheme[#f], then the generated PostScript does not include an +@index["Encapsulated PostScript (EPS)"]{If} @racket[as-eps] is + @racket[#f], then the generated PostScript does not include an Encapsulated PostScript (EPS) header, and instead includes a generic PostScript header. The margin and translation factors specified by @racket[current-ps-setup] are used only when @racket[as-eps] is @@ -65,10 +65,10 @@ When @racket[output] is not @racket[#f], then file-mode output is resumes the port-writing thread with @racket[thread-resume] and @racket[(current-thread)] as the second argument. -See also @scheme[ps-setup%] and @scheme[current-ps-setup]. The -settings for a particular @scheme[post-script-dc%] object are fixed to +See also @racket[ps-setup%] and @racket[current-ps-setup]. The +settings for a particular @racket[post-script-dc%] object are fixed to the values in the current configuration when the object is created (after the user has interactively adjusted them when -@scheme[interactive] is true). +@racket[interactive] is true). }} diff --git a/collects/scribblings/draw/ps-setup-class.scrbl b/collects/scribblings/draw/ps-setup-class.scrbl index d0855d11c3..a0e1a80216 100644 --- a/collects/scribblings/draw/ps-setup-class.scrbl +++ b/collects/scribblings/draw/ps-setup-class.scrbl @@ -3,21 +3,21 @@ @defclass/title[ps-setup% object% ()]{ -A @scheme[ps-setup%] object contains configuration information for - producing PostScript files using a @scheme[post-script-dc%] object. +A @racket[ps-setup%] object contains configuration information for + producing PostScript files using a @racket[post-script-dc%] object. To a lesser extent, it contains information for printing with a - @scheme[printer-dc%] object. + @racket[printer-dc%] object. -When a @scheme[post-script-dc%] object is created, its configuration - is determined by the @scheme[current-ps-setup] parameter's - @scheme[ps-setup%] value. After a @scheme[post-script-dc%] object is - created, it is unaffected by changes to the @scheme[current-ps-setup] - parameter or mutations to the @scheme[ps-setup%] object. +When a @racket[post-script-dc%] object is created, its configuration + is determined by the @racket[current-ps-setup] parameter's + @racket[ps-setup%] value. After a @racket[post-script-dc%] object is + created, it is unaffected by changes to the @racket[current-ps-setup] + parameter or mutations to the @racket[ps-setup%] object. @defconstructor[()]{ -Creates a new @scheme[ps-setup%] object with the (platform-specific) +Creates a new @racket[ps-setup%] object with the (platform-specific) default configuration. } @@ -26,7 +26,7 @@ Creates a new @scheme[ps-setup%] object with the (platform-specific) [copy-filename? any/c #f]) void?]{ -Copies the settings @scheme[copy-from] to @this-obj[], excluding the +Copies the settings @racket[copy-from] to @this-obj[], excluding the filename unless @racket[copy-filename?] is true. } @@ -35,7 +35,7 @@ filename unless @racket[copy-filename?] is true. string?]{ Historically, gets the printer command used to print a file on - Unix. The default is @scheme["lpr"]. This value is not currently used + Unix. The default is @racket["lpr"]. This value is not currently used by any platforms. } @@ -45,7 +45,7 @@ Historically, gets the printer command used to print a file on void?]{ Returns the current settings for horizontal and vertical margins when - printing an @scheme[editor<%>]. See also @method[ps-setup% + printing an @racket[editor<%>]. See also @method[ps-setup% set-editor-margin]. } @@ -53,9 +53,9 @@ Returns the current settings for horizontal and vertical margins when @defmethod[(get-file) (or/c path-string? false/c)]{ -Gets the PostScript output filename. A @scheme[#f] value (the default) +Gets the PostScript output filename. A @racket[#f] value (the default) indicates that the user should be prompted for a filename when a - @scheme[post-script-dc%] object is created. + @racket[post-script-dc%] object is created. } @@ -85,18 +85,18 @@ Returns the current settings for horizontal and vertical PostScript (one-of/c 'preview 'file 'printer)]{ Gets the printing mode that determines where output is sent: - @scheme['preview], @scheme['file], or @scheme['printer]. The default - for X is @scheme['preview]. The value in Windows and Mac OS X is - always @scheme['file]. + @racket['preview], @racket['file], or @racket['printer]. The default + for X is @racket['preview]. The value in Windows and Mac OS X is + always @racket['file]. } @defmethod[(get-orientation) (one-of/c 'portrait 'landscape)]{ -Gets the orientation: @scheme['portrait] or @scheme['landscape]. The - default is @scheme['portrait]. Unlike most other settings, this one - affects native printing (via @scheme[printer-dc%]) as well as +Gets the orientation: @racket['portrait] or @racket['landscape]. The + default is @racket['portrait]. Unlike most other settings, this one + affects native printing (via @racket[printer-dc%]) as well as PostScript output. Landscaped orientation affects the size of the drawing area as @@ -109,16 +109,16 @@ Landscaped orientation affects the size of the drawing area as @defmethod[(get-paper-name) string?]{ -Returns the name of the current paper type: @scheme["A4 210 x 297 mm"], - @scheme["A3 297 x 420 mm"], @scheme["Letter 8 1/2 x 11 in"], or - @scheme["Legal 8 1/2 x 14 in"]. The default is @scheme["Letter 8 1/2 x 11 in"]. +Returns the name of the current paper type: @racket["A4 210 x 297 mm"], + @racket["A3 297 x 420 mm"], @racket["Letter 8 1/2 x 11 in"], or + @racket["Legal 8 1/2 x 14 in"]. The default is @racket["Letter 8 1/2 x 11 in"]. The paper name determines the size of the drawing area as reported by @method[dc<%> get-size] (along with landscape transformations from @method[ps-setup% get-orientation] and/or the scaling factors of @method[ps-setup% get-scaling]). It also determines the bounding box - of PostScript output when a @scheme[post-script-dc%] context is - created with a true value for the @scheme[use-paper-bbox?] + of PostScript output when a @racket[post-script-dc%] context is + created with a true value for the @racket[use-paper-bbox?] initialization argument. } @@ -127,7 +127,7 @@ The paper name determines the size of the drawing area as reported by string?]{ Gets the command used to view a PostScript file for X. The default is - @scheme["gv"]. This value is not used by other platforms. + @racket["gv"]. This value is not used by other platforms. } @@ -137,11 +137,11 @@ Gets the command used to view a PostScript file for X. The default is Gets the scaling factor for PostScript output. @boxisfill[(scheme x) @elem{the horizontal scaling factor}] @boxisfill[(scheme y) @elem{the - vertical scaling factor}] The default is @scheme[0.8] by - @scheme[0.8]. + vertical scaling factor}] The default is @racket[0.8] by + @racket[0.8]. This scale is in addition to a scale that can be set by @method[dc<%> - set-scale] in a @scheme[post-script-dc%] context. The size reported + set-scale] in a @racket[post-script-dc%] context. The size reported by @method[dc<%> get-size] is the size of the selected paper type (transposed for landscaped mode) divided by this scale. @@ -152,9 +152,9 @@ This scale is in addition to a scale that can be set by @method[dc<%> void?]{ Gets the translation (from the bottom left corner) for PostScript - output. @boxisfill[@scheme[x] @elem{the horizontal offset}] - @boxisfill[@scheme[y] @elem{the vertical offset}] The default is - @scheme[0.0] and @scheme[0.0]. + output. @boxisfill[@racket[x] @elem{the horizontal offset}] + @boxisfill[@racket[y] @elem{the vertical offset}] The default is + @racket[0.0] and @racket[0.0]. The translation is not scaled by the numbers returned from @method[ps-setup% get-scaling] and the translation does not affect @@ -177,9 +177,9 @@ Historically, sets the printer command that was used to print a file Sets the horizontal and vertical margins used when printing an editor with the @method[editor<%> print] method. These margins are always used for printing, whether the drawing destination is a - @scheme[post-script-dc%] or @scheme[printer-dc%]. The margins are in - the units of the destination @scheme[printer-dc%] or - @scheme[post-script-dc%]. In the case of @scheme[post-script-dc%] + @racket[post-script-dc%] or @racket[printer-dc%]. The margins are in + the units of the destination @racket[printer-dc%] or + @racket[post-script-dc%]. In the case of @racket[post-script-dc%] printing, the editor margin is in addition to the PostScript margin that is determined by @method[ps-setup% set-margin]. @@ -206,18 +206,18 @@ Sets whether Level 2 commands are output in PostScript files. See void?]{ Sets the horizontal and vertical PostScript margins. When drawing to a - @scheme[post-script-dc%], the page size reported by @method[dc<%> + @racket[post-script-dc%], the page size reported by @method[dc<%> get-size] subtracts these margins from the normal page area (before taking into account scaling affects). In addition, drawing into the - @scheme[post-script-dc%] produces PostScript output that is offset by + @racket[post-script-dc%] produces PostScript output that is offset by the margins. -When using the output of a @scheme[post-script-dc%] as +When using the output of a @racket[post-script-dc%] as Encapsulated PostScript, the margin values are effectively irrelevant. Changing the margins moves the PostScript image in absolute coordinates, but it also moves the bounding box. -The margins are in unscaled @scheme[post-script-dc%] units, which +The margins are in unscaled @racket[post-script-dc%] units, which are points. The default margins are 16 points. } @@ -228,7 +228,7 @@ The margins are in unscaled @scheme[post-script-dc%] units, which Sets the printing mode controlling where output is sent. See @method[ps-setup% get-mode]. -On Windows and Mac OS X, if @scheme['preview] or @scheme['printer] +On Windows and Mac OS X, if @racket['preview] or @racket['printer] is provided, @|MismatchExn|. } diff --git a/collects/scribblings/draw/region-class.scrbl b/collects/scribblings/draw/region-class.scrbl index 38fff43654..48b3f44d89 100644 --- a/collects/scribblings/draw/region-class.scrbl +++ b/collects/scribblings/draw/region-class.scrbl @@ -3,17 +3,17 @@ @defclass/title[region% object% ()]{ -A @scheme[region%] object specifies a portion of a drawing area +A @racket[region%] object specifies a portion of a drawing area (possibly discontinuous). It is normally used for clipping drawing operations. -A @scheme[region%] object can be associated to a particular - @scheme[dc<%>] object when the region is created. In that case, the +A @racket[region%] object can be associated to a particular + @racket[dc<%>] object when the region is created. In that case, the region uses the drawing context's current transformation matrix, translation, scaling, and rotation, independent of the transformation that is in place when the region is installed. Otherwise, the region is transformed as usual when it is installed into a - @scheme[dc<%>]. For an auto-scrolled canvas, the canvas's current + @racket[dc<%>]. For an auto-scrolled canvas, the canvas's current scrolling always applies when the region is used (and it does not affect the region's bounding box). @@ -32,8 +32,8 @@ See also @xmethod[dc<%> set-clipping-region] and @xmethod[dc<%> @defconstructor[([dc (or/c (is-a?/c dc<%>) #f)])]{ -Creates an empty region. If @racket[dc] is a @scheme[dc<%>] object, -the @scheme[dc<%>]'s current transformation matrix is essentially +Creates an empty region. If @racket[dc] is a @racket[dc<%>] object, +the @racket[dc<%>]'s current transformation matrix is essentially recorded in the region. } @@ -59,10 +59,10 @@ Returns the region's drawing context, if it was created for one. [y real?]) boolean?]{ -Returns @scheme[#t] if the given point is approximately within the - region, @scheme[#f] otherwise. If the region has an associated +Returns @racket[#t] if the given point is approximately within the + region, @racket[#f] otherwise. If the region has an associated drawing context, the given point is effectively transformed according - to the region's @scheme[dc<%>]'s current transformation matrix. + to the region's @racket[dc<%>]'s current transformation matrix. } @@ -71,7 +71,7 @@ Returns @scheme[#t] if the given point is approximately within the Sets the region to the intersection of itself with the given region. -The drawing context of @scheme[rgn] and @this-obj[] must be the same, +The drawing context of @racket[rgn] and @this-obj[] must be the same, or they must both be unassociated to any drawing context. An intersect corresponds to clipping with this region's path, and then @@ -89,9 +89,9 @@ An intersect corresponds to clipping with this region's path, and then @defmethod[(is-empty?) boolean?]{ -Returns @scheme[#t] if the region is approximately empty, @scheme[#f] +Returns @racket[#t] if the region is approximately empty, @racket[#f] otherwise, but only if the region is associated with a drawing context. - If the region is unassociated to any drawing context, the + If the region is unassociated to any drawing context, the @racket[exn:fail:contract] exception is raised. } @@ -107,7 +107,7 @@ Returns @scheme[#t] if the region is approximately empty, @scheme[#f] Sets the region to the interior of the specified wedge. See also @xmethod[dc<%> draw-ellipse], since the region content is - determined the same way as brush-based filling in a @scheme[dc<%>]. + determined the same way as brush-based filling in a @racket[dc<%>]. The region corresponds to a clockwise path with a @tech{flexible fill}. The region is also @tech{atomic} for the purposes of region @@ -124,7 +124,7 @@ The region corresponds to a clockwise path with a @tech{flexible Sets the region to the interior of the specified ellipse. See also @xmethod[dc<%> draw-ellipse], since the region content is - determined the same way as brush-based filling in a @scheme[dc<%>]. + determined the same way as brush-based filling in a @racket[dc<%>]. The region corresponds to a clockwise path with a @tech{flexible fill}. The region is also @tech{atomic} for the purposes of region @@ -143,7 +143,7 @@ The region corresponds to a clockwise path with a @tech{flexible Sets the region to the content of the given path. See also @xmethod[dc<%> draw-path], since the region content is - determined the same way as brush-based filling in a @scheme[dc<%>]. + determined the same way as brush-based filling in a @racket[dc<%>]. The fill style affects how well the region reliably combines with other regions (via @method[region% union], @method[region% xor], and @@ -164,7 +164,7 @@ Sets the region to the interior of the polygon specified by of the pair is the x-value and the @racket[cdr] is the y-value. See also @xmethod[dc<%> draw-polygon], since the region content is - determined the same way as brush-based filling in a @scheme[dc<%>]. + determined the same way as brush-based filling in a @racket[dc<%>]. The fill style affects how well the region reliably combines with other regions (via @method[region% union], @method[region% xor], and @@ -200,7 +200,7 @@ Sets the region to the interior of the specified rounded rectangle. See also @xmethod[dc<%> draw-rounded-rectangle], since the region content is determined the same way as brush-based filling in a - @scheme[dc<%>]. + @racket[dc<%>]. The region corresponds to a clockwise path with a @tech{flexible fill}. The region is also @tech{atomic} for the purposes of region @@ -227,7 +227,7 @@ The result is consistent across platforms and devices, but it is never sub-paths of this region with the reversed sub-paths of the given region, then intersecting the result with this region. This fails as a true subtraction, because the boundary of loops (with either - @scheme['odd-even] or @scheme['winding] filling) is ambiguous. + @racket['odd-even] or @racket['winding] filling) is ambiguous. } @@ -241,16 +241,16 @@ This region's drawing context and given region's drawing context must context. A union corresponds to combining the sub-paths of each region into one - path, using an @scheme['odd-even] fill if either of the region uses - an @scheme['odd-even] fill (otherwise using a @scheme['winding] - fill), a @scheme['winding] fill in either region uses a - @scheme[winding] fill, or the fill remains a @tech{flexible fill} + path, using an @racket['odd-even] fill if either of the region uses + an @racket['odd-even] fill (otherwise using a @racket['winding] + fill), a @racket['winding] fill in either region uses a + @racket[winding] fill, or the fill remains a @tech{flexible fill} if both paths have a @tech{flexible fill}. Consequently, while the result is consistent across platforms and devices, it is a true union only for certain input regions. For example, it is a true union for non-overlapping @deftech{atomic} and union regions. It is also a true union for @tech{atomic} and union regions (potentially overlapping) - that are all clockwise and use @scheme['winding] fill or if the fills + that are all clockwise and use @racket['winding] fill or if the fills are all @tech{flexible fills}. } @@ -268,13 +268,13 @@ This region's drawing context and given region's drawing context must The result is consistent across platforms and devices, but it is not necessarily a true xoring. An xoring corresponds to combining the sub-paths of this region with the reversed sub-paths of the given - region. The result uses an @scheme['odd-even] fill if either of the - region uses an @scheme['odd-even] fill, a @scheme['winding] fill in - either region uses a @scheme[winding] fill, or the fill remains a + region. The result uses an @racket['odd-even] fill if either of the + region uses an @racket['odd-even] fill, a @racket['winding] fill in + either region uses a @racket[winding] fill, or the fill remains a @tech{flexible fill} if both paths have a @tech{flexible fill}. Consequently, the result is a reliable xoring only for certain input regions. For example, it is reliable for @tech{atomic} and - xoring regions that all use @scheme['even-odd] fill. + xoring regions that all use @racket['even-odd] fill. }} diff --git a/collects/scribblings/drracket/extending.scrbl b/collects/scribblings/drracket/extending.scrbl index a9b96bf406..e17fb6369c 100644 --- a/collects/scribblings/drracket/extending.scrbl +++ b/collects/scribblings/drracket/extending.scrbl @@ -168,8 +168,8 @@ Several environment variables can affect DrRacket's behavior: variable, and then run @exec{setup-plt} again.} @item{@indexed-envvar{PLTDRXREFDELAY} : When this environment variable - is set, DrRacket uses an ordinary @scheme[delay] (instead of - @scheme[delay/idle]) delay the computation of the searching + is set, DrRacket uses an ordinary @racket[delay] (instead of + @racket[delay/idle]) delay the computation of the searching indicies. This means that Check Syntax will start more slowly the first time, but that the startup performance is more predictable. In addition, when the environment variable is diff --git a/collects/scribblings/foreign/alloc.scrbl b/collects/scribblings/foreign/alloc.scrbl index 51370429ef..b5e3d587db 100644 --- a/collects/scribblings/foreign/alloc.scrbl +++ b/collects/scribblings/foreign/alloc.scrbl @@ -5,23 +5,23 @@ @title{Allocation and Finalization} @defmodule[ffi/unsafe/alloc]{The -@schememodname[ffi/unsafe/alloc] library provides utilities for +@racketmodname[ffi/unsafe/alloc] library provides utilities for ensuring that values allocated through foreign functions are reliably deallocated.} @defproc[((allocator [dealloc (any/c . -> . any)]) [alloc procedure?]) procedure?]{ -Produces a procedure that behaves like @scheme[alloc], but the result -of @scheme[alloc] is given a finalizer that calls @scheme[dealloc] on +Produces a procedure that behaves like @racket[alloc], but the result +of @racket[alloc] is given a finalizer that calls @racket[dealloc] on the result if it is not otherwise freed through a deallocator (as -designated with @scheme[deallocator]). In addition, @scheme[alloc] is -called in atomic mode (see @scheme[start-atomic]); its result is +designated with @racket[deallocator]). In addition, @racket[alloc] is +called in atomic mode (see @racket[start-atomic]); its result is received and registered in atomic mode, so that the result is reliably freed. -The @scheme[dealloc] procedure itself need not be specifically -designated a deallocator (via @scheme[deallocator]). If a deallocator -is called explicitly, it need not be the same as @scheme[dealloc].} +The @racket[dealloc] procedure itself need not be specifically +designated a deallocator (via @racket[deallocator]). If a deallocator +is called explicitly, it need not be the same as @racket[dealloc].} @deftogether[( @defproc[((deallocator [get-arg (list? . -> . any/c) car]) [dealloc procedure?]) @@ -30,21 +30,21 @@ is called explicitly, it need not be the same as @scheme[dealloc].} procedure?] )]{ -Produces a procedure that behaves like @scheme[dealloc]. The -@scheme[dealloc] procedure is called in atomic mode (see -@scheme[start-atomic]), and the reference count on one of its +Produces a procedure that behaves like @racket[dealloc]. The +@racket[dealloc] procedure is called in atomic mode (see +@racket[start-atomic]), and the reference count on one of its arguments is decremented; if the reference count reaches zero, no -finalizer associated by an @scheme[allocator]- or -@scheme[referencer]-wrapped procedure is invoked when the value +finalizer associated by an @racket[allocator]- or +@racket[referencer]-wrapped procedure is invoked when the value becomes inaccessible. -The optional @scheme[get-arg] procedure determines which of -@scheme[dealloc]'s arguments correspond to the released object; -@scheme[get-arg] receives a list of arguments passed to -@scheme[dealloc], so the default @scheme[car] selects the first one. +The optional @racket[get-arg] procedure determines which of +@racket[dealloc]'s arguments correspond to the released object; +@racket[get-arg] receives a list of arguments passed to +@racket[dealloc], so the default @racket[car] selects the first one. -The @scheme[releaser] procedure is a synonym for -@scheme[deallocator].} +The @racket[releaser] procedure is a synonym for +@racket[deallocator].} @defproc[((retainer [release (any/c . -> . any)] @@ -52,19 +52,19 @@ The @scheme[releaser] procedure is a synonym for [retain procedure?]) procedure?]{ -Produces a procedure that behaves like @scheme[retain]. The procedure -is called in atomic mode (see @scheme[start-atomic]), and the +Produces a procedure that behaves like @racket[retain]. The procedure +is called in atomic mode (see @racket[start-atomic]), and the reference count on one of its arguments is incremented, with -@scheme[release] recorded as the corresponding release procedure to be +@racket[release] recorded as the corresponding release procedure to be called by the finalizer on the retained object (unless some -deallocator, as wrapped by @scheme[deallocate], is explicitly called +deallocator, as wrapped by @racket[deallocate], is explicitly called first). -The optional @scheme[get-arg] procedure determines which of -@scheme[retain]'s arguments correspond to the retained object; -@scheme[get-arg] receives a list of arguments passed to -@scheme[retain], so the default @scheme[car] selects the first one. +The optional @racket[get-arg] procedure determines which of +@racket[retain]'s arguments correspond to the retained object; +@racket[get-arg] receives a list of arguments passed to +@racket[retain], so the default @racket[car] selects the first one. -The @scheme[release] procedure itself need not be specifically -designated a deallocator (via @scheme[deallocator]). If a deallocator -is called explicitly, it need not be the same as @scheme[release].} +The @racket[release] procedure itself need not be specifically +designated a deallocator (via @racket[deallocator]). If a deallocator +is called explicitly, it need not be the same as @racket[release].} diff --git a/collects/scribblings/foreign/atomic.scrbl b/collects/scribblings/foreign/atomic.scrbl index d32545ec01..35ff2a9655 100644 --- a/collects/scribblings/foreign/atomic.scrbl +++ b/collects/scribblings/foreign/atomic.scrbl @@ -11,13 +11,13 @@ )]{ Disables and enables context switches and delivery of break exceptions -at the level of Racket threads. Calls to @scheme[start-atomic] and -@scheme[end-atomic] can be nested. +at the level of Racket threads. Calls to @racket[start-atomic] and +@racket[end-atomic] can be nested. -Using @scheme[call-as-atomic] is somewhat safer, in that -@scheme[call-as-atomic] correctly catches exceptions and re-raises +Using @racket[call-as-atomic] is somewhat safer, in that +@racket[call-as-atomic] correctly catches exceptions and re-raises them after exiting atomic mode. For simple uses where exceptions need -not be handled, however, @scheme[start-atomic] and @scheme[end-atomic] +not be handled, however, @racket[start-atomic] and @racket[end-atomic] are faster.} @deftogether[( @@ -35,22 +35,22 @@ faster than plan @racket[start-atomic] and @racket[end-atomic].} @defproc[(call-as-atomic [thunk (-> any)]) any]{ -Calls @scheme[thunk] in atomic mode. If @scheme[thunk] raises and +Calls @racket[thunk] in atomic mode. If @racket[thunk] raises and exception, the exception is caught and re-raised after exiting atomic mode. -When @scheme[call-as-atomic] is used in the dynamic extent of -@scheme[call-as-atomic], then @scheme[thunk] is simply called directly +When @racket[call-as-atomic] is used in the dynamic extent of +@racket[call-as-atomic], then @racket[thunk] is simply called directly (as a tail call).} @defproc[(call-as-nonatomic [thunk (-> any)]) any]{ -Within the dynamic extent of a @scheme[call-as-atomic], calls -@scheme[thunk] in non-atomic mode. Beware that the current thread -maybe suspended or terminated by other threads during @scheme[thunk], +Within the dynamic extent of a @racket[call-as-atomic], calls +@racket[thunk] in non-atomic mode. Beware that the current thread +maybe suspended or terminated by other threads during @racket[thunk], in which case the call never returns. -When used not in the dynamic extent of @scheme[call-as-atomic], -@scheme[call-as-nonatomic] raises @scheme[exn:fail:contract].} +When used not in the dynamic extent of @racket[call-as-atomic], +@racket[call-as-nonatomic] raises @racket[exn:fail:contract].} diff --git a/collects/scribblings/foreign/cpointer.scrbl b/collects/scribblings/foreign/cpointer.scrbl index 611ccd1564..00e0e7c2d5 100644 --- a/collects/scribblings/foreign/cpointer.scrbl +++ b/collects/scribblings/foreign/cpointer.scrbl @@ -3,7 +3,7 @@ @title[#:tag "foreign:tagged-pointers"]{Tagged C Pointer Types} -The unsafe @scheme[cpointer-has-tag?] and @scheme[cpointer-push-tag!] +The unsafe @racket[cpointer-has-tag?] and @racket[cpointer-push-tag!] operations manage tags to distinguish pointer types. @defproc*[([(_cpointer [tag any/c] @@ -19,25 +19,25 @@ operations manage tags to distinguish pointer types. Construct a kind of a pointer that gets a specific tag when converted to Racket, and accept only such tagged pointers when going to C. An -optional @scheme[ptr-type] can be given to be used as the base pointer -type, instead of @scheme[_pointer]. +optional @racket[ptr-type] can be given to be used as the base pointer +type, instead of @racket[_pointer]. -Pointer tags are checked with @scheme[cpointer-has-tag?] and changed -with @scheme[cpointer-push-tag!] which means that other tags are -preserved. Specifically, if a base @scheme[ptr-type] is given and is -itself a @scheme[_cpointer], then the new type will handle pointers -that have the new tag in addition to @scheme[ptr-type]'s tag(s). When +Pointer tags are checked with @racket[cpointer-has-tag?] and changed +with @racket[cpointer-push-tag!] which means that other tags are +preserved. Specifically, if a base @racket[ptr-type] is given and is +itself a @racket[_cpointer], then the new type will handle pointers +that have the new tag in addition to @racket[ptr-type]'s tag(s). When the tag is a pair, its first value is used for printing, so the most recently pushed tag which corresponds to the inheriting type will be displayed. -Note that tags are compared with @scheme[eq?] (or @scheme[memq]), which means +Note that tags are compared with @racket[eq?] (or @racket[memq]), which means an interface can hide its value from users (e.g., not provide the -@scheme[cpointer-tag] accessor), which makes such pointers un-fake-able. +@racket[cpointer-tag] accessor), which makes such pointers un-fake-able. -@scheme[_cpointer/null] is similar to @scheme[_cpointer] except that +@racket[_cpointer/null] is similar to @racket[_cpointer] except that it tolerates @cpp{NULL} pointers both going to C and back. Note that -@cpp{NULL} pointers are represented as @scheme[#f] in Racket, so they +@cpp{NULL} pointers are represented as @racket[#f] in Racket, so they are not tagged.} @@ -45,18 +45,18 @@ are not tagged.} (define-cpointer-type _id scheme-to-c-expr) (define-cpointer-type _id scheme-to-c-expr c-to-scheme-expr)]]{ -A macro version of @scheme[_cpointer] and @scheme[_cpointer/null], +A macro version of @racket[_cpointer] and @racket[_cpointer/null], using the defined name for a tag string, and defining a predicate -too. The @scheme[_id] must start with @litchar{_}. +too. The @racket[_id] must start with @litchar{_}. -The optional expression produces optional arguments to @scheme[_cpointer]. +The optional expression produces optional arguments to @racket[_cpointer]. -In addition to defining @scheme[_id] to a type generated by -@scheme[_cpointer], @scheme[_id]@schemeidfont{/null} is bound to a -type produced by @scheme[_cpointer/null] type. Finally, -@schemevarfont{id}@schemeidfont{?} is defined as a predicate, and -@schemevarfont{id}@schemeidfont{-tag} is defined as an accessor to -obtain a tag. The tag is the string form of @schemevarfont{id}.} +In addition to defining @racket[_id] to a type generated by +@racket[_cpointer], @racket[_id]@racketidfont{/null} is bound to a +type produced by @racket[_cpointer/null] type. Finally, +@racketvarfont{id}@racketidfont{?} is defined as a predicate, and +@racketvarfont{id}@racketidfont{-tag} is defined as an accessor to +obtain a tag. The tag is the string form of @racketvarfont{id}.} @defproc*[([(cpointer-has-tag? [cptr any/c] [tag any/c]) boolean?] [(cpointer-push-tag! [cptr any/c] [tag any/c]) void])]{ @@ -69,15 +69,15 @@ possible to construct pointer types that can be treated as other pointer types, mainly for implementing inheritance via upcasts (when a struct contains a super struct as its first element). -The @scheme[cpointer-has-tag?] function checks whether if the given -@scheme[cptr] has the @scheme[tag]. A pointer has a tag @scheme[tag] -when its tag is either @scheme[eq?] to @scheme[tag] or a list that -contains (in the sense of @scheme[memq]) @scheme[tag]. +The @racket[cpointer-has-tag?] function checks whether if the given +@racket[cptr] has the @racket[tag]. A pointer has a tag @racket[tag] +when its tag is either @racket[eq?] to @racket[tag] or a list that +contains (in the sense of @racket[memq]) @racket[tag]. -The @scheme[cpointer-push-tag!] function pushes the given @scheme[tag] -value on @scheme[cptr]'s tags. The main properties of this operation +The @racket[cpointer-push-tag!] function pushes the given @racket[tag] +value on @racket[cptr]'s tags. The main properties of this operation are: (a) pushing any tag will make later calls to -@scheme[cpointer-has-tag?] succeed with this tag, and (b) the pushed tag +@racket[cpointer-has-tag?] succeed with this tag, and (b) the pushed tag will be used when printing the pointer (until a new value is pushed). Technically, pushing a tag will simply set it if there is no tag set, otherwise push it on an existing list or an existing value (treated as diff --git a/collects/scribblings/foreign/cvector.scrbl b/collects/scribblings/foreign/cvector.scrbl index d277e1e038..27d9c31376 100644 --- a/collects/scribblings/foreign/cvector.scrbl +++ b/collects/scribblings/foreign/cvector.scrbl @@ -5,39 +5,39 @@ @defmodule*[(ffi/cvector ffi/unsafe/cvector) #:use-sources (ffi/unsafe/cvector)]{The -@schememodname[ffi/unsafe/cvector] library exports the bindings of -this section. The @schememodname[ffi/cvector] library exports the same -bindings, except for the unsafe @scheme[make-cvector*] operation.} +@racketmodname[ffi/unsafe/cvector] library exports the bindings of +this section. The @racketmodname[ffi/cvector] library exports the same +bindings, except for the unsafe @racket[make-cvector*] operation.} -The @scheme[cvector] form can be used as a type C vectors (i.e., a +The @racket[cvector] form can be used as a type C vectors (i.e., a pointer to a memory block). @defform*[[(_cvector mode type maybe-len) _cvector]]{ -Like @scheme[_bytes], @scheme[_cvector] can be used as a simple type +Like @racket[_bytes], @racket[_cvector] can be used as a simple type that corresponds to a pointer that is managed as a safe C vector on the Racket side. The longer form behaves similarly to the -@scheme[_list] and @scheme[_vector] custom types, except that -@scheme[_cvector] is more efficient; no Racket list or vector is +@racket[_list] and @racket[_vector] custom types, except that +@racket[_cvector] is more efficient; no Racket list or vector is needed.} @defproc[(make-cvector [type ctype?] [length exact-nonnegative-integer?]) cvector?]{ -Allocates a C vector using the given @scheme[type] and -@scheme[length]. The resulting vector is not guaranteed to +Allocates a C vector using the given @racket[type] and +@racket[length]. The resulting vector is not guaranteed to contain any particular values.} @defproc[(cvector [type ctype?] [val any/c] ...) cvector?]{ -Creates a C vector of the given @scheme[type], initialized to the -given list of @scheme[val]s.} +Creates a C vector of the given @racket[type], initialized to the +given list of @racket[val]s.} @defproc[(cvector? [v any/c]) boolean?]{ -Returns @scheme[#t] if @scheme[v] is a C vector, @scheme[#f] otherwise.} +Returns @racket[#t] if @racket[v] is a C vector, @racket[#f] otherwise.} @defproc[(cvector-length [cvec cvector?]) exact-nonnegative-integer?]{ @@ -57,26 +57,26 @@ Returns the pointer that points at the beginning block of the given C vector.} @defproc[(cvector-ref [cvec cvector?] [k exact-nonnegative-integer?]) any]{ -References the @scheme[k]th element of the @scheme[cvec] C vector. +References the @racket[k]th element of the @racket[cvec] C vector. The result has the type that the C vector uses.} @defproc[(cvector-set! [cvec cvector?] [k exact-nonnegative-integer?] [val any]) void?]{ -Sets the @scheme[k]th element of the @scheme[cvec] C vector to -@scheme[val]. The @scheme[val] argument should be a value that can be +Sets the @racket[k]th element of the @racket[cvec] C vector to +@racket[val]. The @racket[val] argument should be a value that can be used with the type that the C vector uses.} @defproc[(cvector->list [cvec cvector?]) list?]{ -Converts the @scheme[cvec] C vector object to a list of values.} +Converts the @racket[cvec] C vector object to a list of values.} @defproc[(list->cvector [lst list?] [type ctype?]) cvector?]{ -Converts the list @scheme[lst] to a C vector of the given -@scheme[type].} +Converts the list @racket[lst] to a C vector of the given +@racket[type].} @defproc[(make-cvector* [cptr any/c] [type ctype?] @@ -85,6 +85,6 @@ Converts the list @scheme[lst] to a C vector of the given Constructs a C vector using an existing pointer object. This operation is not safe, so it is intended to be used in specific -situations where the @scheme[type] and @scheme[length] are known.} +situations where the @racket[type] and @racket[length] are known.} diff --git a/collects/scribblings/foreign/define.scrbl b/collects/scribblings/foreign/define.scrbl index 9a2615f3e9..ffb07fc9fe 100644 --- a/collects/scribblings/foreign/define.scrbl +++ b/collects/scribblings/foreign/define.scrbl @@ -11,9 +11,9 @@ (code:line #:define core-define-id) (code:line #:default-make-fail default-make-fail-expr)])]{ -Binds @scheme[define-id] as a definition form to extract bindings from -the library produced by @scheme[ffi-lib-expr]. The syntax of -@scheme[define-id] is +Binds @racket[define-id] as a definition form to extract bindings from +the library produced by @racket[ffi-lib-expr]. The syntax of +@racket[define-id] is @specform/subs[(define-id id type-expr bind-option ...) @@ -22,78 +22,78 @@ the library produced by @scheme[ffi-lib-expr]. The syntax of (code:line #:make-fail make-fail-expr) (code:line #:fail fail-expr)])] -A @scheme[define-id] form binds @scheme[id] by extracting a binding -with the name @scheme[c-id] from the library produced by -@scheme[ffi-lib-expr], where @scheme[c-id] defaults to @scheme[id]. +A @racket[define-id] form binds @racket[id] by extracting a binding +with the name @racket[c-id] from the library produced by +@racket[ffi-lib-expr], where @racket[c-id] defaults to @racket[id]. The other options support further wrapping and configuration: @itemize[ - @item{Before the extracted result is bound as @scheme[_id], it is - passed to the result of @scheme[_wrap-expr], which defaults to - @scheme[values]. Expressions such as @scheme[(allocator - _delete)] or @scheme[(deallocator)] are useful as - @scheme[_wrap-expr]s.} + @item{Before the extracted result is bound as @racket[_id], it is + passed to the result of @racket[_wrap-expr], which defaults to + @racket[values]. Expressions such as @racket[(allocator + _delete)] or @racket[(deallocator)] are useful as + @racket[_wrap-expr]s.} - @item{The @scheme[#:make-fail] and @scheme[#:fail] options are - mutually exclusive; if @scheme[_make-fail-expr] is provided, it - is applied to @scheme['@#,scheme[_id]] to obtain the last - argument to @scheme[get-ffi-obj]; if @scheme[_fail-expr] is + @item{The @racket[#:make-fail] and @racket[#:fail] options are + mutually exclusive; if @racket[_make-fail-expr] is provided, it + is applied to @racket['@#,scheme[_id]] to obtain the last + argument to @racket[get-ffi-obj]; if @racket[_fail-expr] is provided, it is supplied directly as the last argument to - @scheme[get-ffi-obj]. The @scheme[make-not-available] function - is useful as @scheme[_make-fail-expr] to cause a use of - @scheme[_id] to report an error when it is applied if - @scheme[_c-id] was not found in the foreign library.} + @racket[get-ffi-obj]. The @racket[make-not-available] function + is useful as @racket[_make-fail-expr] to cause a use of + @racket[_id] to report an error when it is applied if + @racket[_c-id] was not found in the foreign library.} ] -If @scheme[provide-id] is provided to @scheme[define-ffi-definer], then -@scheme[define-id] also provides its binding using -@scheme[provide-id]. The @scheme[provide-protected] form is usually a -good choice for @scheme[provide-id]. +If @racket[provide-id] is provided to @racket[define-ffi-definer], then +@racket[define-id] also provides its binding using +@racket[provide-id]. The @racket[provide-protected] form is usually a +good choice for @racket[provide-id]. -If @scheme[core-define-id] is provided to @scheme[define-ffi-definer], -then @scheme[code-define-id] is used in place of @scheme[define] in -the expansion of @scheme[define-id] for each binding. +If @racket[core-define-id] is provided to @racket[define-ffi-definer], +then @racket[code-define-id] is used in place of @racket[define] in +the expansion of @racket[define-id] for each binding. -If @scheme[default-make-fail-expr] is provided to -@scheme[define-ffi-definer], it serves as the default -@scheme[#:make-fail] value for @scheme[define-id]. +If @racket[default-make-fail-expr] is provided to +@racket[define-ffi-definer], it serves as the default +@racket[#:make-fail] value for @racket[define-id]. For example, -@schemeblock[ +@racketblock[ (define-ffi-definer define-gtk gtk-lib) ] -binds @scheme[define-gtk] to extract FFI bindings from -@scheme[gtk-lib], so that @scheme[gtk_rc_parse] could be bound as +binds @racket[define-gtk] to extract FFI bindings from +@racket[gtk-lib], so that @racket[gtk_rc_parse] could be bound as -@schemeblock[ +@racketblock[ (define-gtk gtk_rc_parse (_fun _path -> _void)) ] -If @tt{gtk_rc_parse} is not found, then @scheme[define-gtk] reports an -error immediately. If @scheme[define-gtk] is instead defined with +If @tt{gtk_rc_parse} is not found, then @racket[define-gtk] reports an +error immediately. If @racket[define-gtk] is instead defined with -@schemeblock[ +@racketblock[ (define-ffi-definer define-gtk gtk-lib #:default-make-fail make-not-available) ] -then if @tt{gtk_rc_parse} is not found in @scheme[gtk-lib], an error -is reported only when @scheme[gtk_rc_parse] is called.} +then if @tt{gtk_rc_parse} is not found in @racket[gtk-lib], an error +is reported only when @racket[gtk_rc_parse] is called.} @defproc[(make-not-available [name symbol?]) (#:rest list? -> any/c)]{ Returns a procedure that takes any number of arguments and reports an -error message from @scheme[name]. This function is intended for using -with @scheme[#:make-fail] or @scheme[#:default-make-fail] in -@scheme[define-ffi-definer]} +error message from @racket[name]. This function is intended for using +with @racket[#:make-fail] or @racket[#:default-make-fail] in +@racket[define-ffi-definer]} @defform[(provide-protected provide-spec ...)]{ -Equivalent to @scheme[(provide (protect-out provide-spec ...))]. The -@scheme[provide-protected] identifier is useful with -@scheme[#:provide] in @scheme[define-ffi-definer].} +Equivalent to @racket[(provide (protect-out provide-spec ...))]. The +@racket[provide-protected] identifier is useful with +@racket[#:provide] in @racket[define-ffi-definer].} diff --git a/collects/scribblings/foreign/foreign.scrbl b/collects/scribblings/foreign/foreign.scrbl index 7b898a1636..306f3dbae9 100644 --- a/collects/scribblings/foreign/foreign.scrbl +++ b/collects/scribblings/foreign/foreign.scrbl @@ -7,7 +7,7 @@ @defmodule[ffi/unsafe #:use-sources ('#%foreign)] -The @schememodname[ffi/unsafe] library enables the direct use of +The @racketmodname[ffi/unsafe] library enables the direct use of C-based APIs within Racket programs---without writing any new C code. From the Racket perspective, functions and data with a C-based API are @idefterm{foreign}, hence the term @defterm{foreign diff --git a/collects/scribblings/foreign/intro.scrbl b/collects/scribblings/foreign/intro.scrbl index 5b3bb8a691..d2ca27ee1e 100644 --- a/collects/scribblings/foreign/intro.scrbl +++ b/collects/scribblings/foreign/intro.scrbl @@ -13,11 +13,11 @@ interacts with C APIs in general. Since using the FFI entails many safety concerns that Racket programmers can normally ignore, the library name includes -@schemeidfont{unsafe}. Importing the library macro should be +@racketidfont{unsafe}. Importing the library macro should be considered as a declaration that your code is itself unsafe, therefore can lead to serious problems in case of bugs: it is your responsibility to provide a safe interface. If your library provides -an unsafe interface, then it should have @schemeidfont{unsafe} in its +an unsafe interface, then it should have @racketidfont{unsafe} in its name, too. For examples of common FFI usage patterns, see the defined interfaces diff --git a/collects/scribblings/foreign/libs.scrbl b/collects/scribblings/foreign/libs.scrbl index 8a70b3a95a..85f2ade530 100644 --- a/collects/scribblings/foreign/libs.scrbl +++ b/collects/scribblings/foreign/libs.scrbl @@ -6,12 +6,12 @@ The FFI is normally used by extracting functions and other objects from @as-index{shared objects} (a.k.a. @defterm{@as-index{shared libraries}} or @defterm{@as-index{dynamically loaded libraries}}). The -@scheme[ffi-lib] function loads a shared object. +@racket[ffi-lib] function loads a shared object. @defproc[(ffi-lib? [v any/c]) boolean?]{ -Returns @scheme[#t] if @scheme[v] is the result of @scheme[ffi-lib], -@scheme[#f] otherwise.} +Returns @racket[#t] if @racket[v] is the result of @racket[ffi-lib], +@racket[#f] otherwise.} @defproc[(ffi-lib [path (or/c path-string? #f)] @@ -42,14 +42,14 @@ packages. At the same time, other platforms may require a versionless fallback. A list of version strings followed by @racket[#f] is typically best for @racket[version]. -Assuming that @scheme[path] is not @racket[#f], the result from +Assuming that @racket[path] is not @racket[#f], the result from @racket[ffi-lib] represents the library found by the following search process: @itemlist[ @item{If @racket[path] is not an absolute path, look in each - directory reported by @scheme[get-lib-search-dirs]. In each + directory reported by @racket[get-lib-search-dirs]. In each directory, try @racket[path] with the first version in @racket[version], adding a suitable suffix if @racket[path] does not already end in the suffix, then try the second version @@ -82,10 +82,10 @@ unfortunately name the fallback from the second or third bullet, since some operating systems offer no way to determine why a given library path failed. -If @scheme[path] is @scheme[#f], then the resulting foreign-library +If @racket[path] is @racket[#f], then the resulting foreign-library value represents all libraries loaded in the current process, -including libraries previously opened with @scheme[ffi-lib]. In -particular, use @scheme[#f] to access C-level functionality exported +including libraries previously opened with @racket[ffi-lib]. In +particular, use @racket[#f] to access C-level functionality exported by the run-time system (as described in @|InsideRacket|). The @racket[version] argument is ignored when @racket[path] is @racket[#f]. @@ -102,22 +102,22 @@ corresponding library.} [failure-thunk (or/c (-> any) #f) #f]) any]{ -Looks for the given object name @scheme[objname] in the given -@scheme[lib] library. If @scheme[lib] is not a foreign-library value -produced by @scheme[ffi-lib], it is converted to one by calling -@scheme[ffi-lib]. If @scheme[objname] is found in @scheme[lib], it is -converted to Racket using the given @scheme[type]. Types are described -in @secref["types"]; in particular the @scheme[get-ffi-obj] procedure -is most often used with function types created with @scheme[_fun]. +Looks for the given object name @racket[objname] in the given +@racket[lib] library. If @racket[lib] is not a foreign-library value +produced by @racket[ffi-lib], it is converted to one by calling +@racket[ffi-lib]. If @racket[objname] is found in @racket[lib], it is +converted to Racket using the given @racket[type]. Types are described +in @secref["types"]; in particular the @racket[get-ffi-obj] procedure +is most often used with function types created with @racket[_fun]. -Keep in mind that @scheme[get-ffi-obj] is an unsafe procedure; see +Keep in mind that @racket[get-ffi-obj] is an unsafe procedure; see @secref["intro"] for details. -If the object is not found, and @scheme[failure-thunk] is provided, it is +If the object is not found, and @racket[failure-thunk] is provided, it is used to produce a return value. For example, a failure thunk can be provided to report a specific error if an object is not found: -@schemeblock[ +@racketblock[ (define foo (get-ffi-obj "foo" foolib (_fun _int -> _int) (lambda () @@ -125,7 +125,7 @@ provided to report a specific error if an object is not found: "installed foolib does not provide \"foo\"")))) ] -The default (also when @scheme[failure-thunk] is provided as @scheme[#f]) is to +The default (also when @racket[failure-thunk] is provided as @racket[#f]) is to raise an exception.} @@ -135,8 +135,8 @@ raise an exception.} [new any/c]) void?]{ -Looks for @scheme[objname] in @scheme[lib] similarly to -@scheme[get-ffi-obj], but then it stores the given @scheme[new] value +Looks for @racket[objname] in @racket[lib] similarly to +@racket[get-ffi-obj], but then it stores the given @racket[new] value into the library, converting it to a C value. This can be used for setting library customization variables that are part of its interface, including Racket callbacks.} @@ -150,11 +150,11 @@ interface, including Racket callbacks.} Returns a parameter-like procedure that can either references the specified foreign value, or set it. The arguments are handled as in -@scheme[get-ffi-obj]. +@racket[get-ffi-obj]. A parameter-like function is useful in case Racket code and library code interact through a library value. Although -@scheme[make-c-parameter] can be used with any time, it is not +@racket[make-c-parameter] can be used with any time, it is not recommended to use this for foreign functions, since each reference through the parameter will construct the low-level interface before the actual call.} @@ -162,9 +162,9 @@ actual call.} @defform[(define-c id lib-expr type-expr)]{ -Defines @scheme[id] behave like a Racket binding, but @scheme[id] is +Defines @racket[id] behave like a Racket binding, but @racket[id] is actually redirected through a parameter-like procedure created by -@scheme[make-c-parameter]. The @scheme[id] is used both for the Racket +@racket[make-c-parameter]. The @racket[id] is used both for the Racket binding and for the foreign object's name.} @defproc[(ffi-obj-ref [objname (or/c string? bytes? symbol?)] @@ -173,6 +173,6 @@ binding and for the foreign object's name.} any]{ Returns a pointer object for the specified foreign object. This -procedure is for rare cases where @scheme[make-c-parameter] is +procedure is for rare cases where @racket[make-c-parameter] is insufficient, because there is no type to cast the foreign object to (e.g., a vector of numbers).} diff --git a/collects/scribblings/foreign/misc.scrbl b/collects/scribblings/foreign/misc.scrbl index 2b1c323939..35bd690790 100644 --- a/collects/scribblings/foreign/misc.scrbl +++ b/collects/scribblings/foreign/misc.scrbl @@ -10,21 +10,21 @@ A function that is convenient for many interfaces where the foreign library has some naming convention that you want to use in your -interface as well. The @scheme[objname] argument can be any value +interface as well. The @racket[objname] argument can be any value that will be used to name the foreign object; it is first converted into a string, and then modified according to the given -@scheme[substs] list in sequence, where each element in this list is a +@racket[substs] list in sequence, where each element in this list is a list of a regular expression and a substitution string. Usually, -@scheme[regexp-replace*] is used to perform the substitution, except +@racket[regexp-replace*] is used to perform the substitution, except for cases where the regular expression begins with a @litchar{^} or -ends with a @litchar{$}, in which case @scheme[regexp-replace] is +ends with a @litchar{$}, in which case @racket[regexp-replace] is used. For example, the following makes it convenient to define Racket -bindings such as @scheme[foo-bar] for foreign names like -@scheme[MyLib_foo_bar]: +bindings such as @racket[foo-bar] for foreign names like +@racket[MyLib_foo_bar]: -@schemeblock[ +@racketblock[ (define mylib (ffi-lib "mylib")) (define-syntax defmyobj (syntax-rules (:) @@ -41,31 +41,31 @@ bindings such as @scheme[foo-bar] for foreign names like @defproc[(list->cblock [lst list?] [type ctype?]) any]{ Allocates a memory block of an appropriate size, and initializes it -using values from @scheme[lst] and the given @scheme[type]. The -@scheme[lst] must hold values that can all be converted to C values -according to the given @scheme[type].} +using values from @racket[lst] and the given @racket[type]. The +@racket[lst] must hold values that can all be converted to C values +according to the given @racket[type].} @defproc[(vector->cblock [vec vector?] [type type?]) any]{ -Like @scheme[list->cblock], but for Racket vectors.} +Like @racket[list->cblock], but for Racket vectors.} @defproc[(vector->cpointer [vec vector?]) cpointer?]{ -Returns a pointer to an array of @scheme[_scheme] values, which is the -internal representation of @scheme[vec].} +Returns a pointer to an array of @racket[_scheme] values, which is the +internal representation of @racket[vec].} @defproc[(flvector->cpointer [flvec flvector?]) cpointer?]{ -Returns a pointer to an array of @scheme[_double] values, which is the -internal representation of @scheme[flvec].} +Returns a pointer to an array of @racket[_double] values, which is the +internal representation of @racket[flvec].} @defproc[(saved-errno) exact-integer?]{ Returns the value most recently saved (in the current thread) after a -foreign call with a non-@scheme[#f] @scheme[#:save-errno] option (see -@scheme[_fun] and @scheme[_cprocedure]).} +foreign call with a non-@racket[#f] @racket[#:save-errno] option (see +@racket[_fun] and @racket[_cprocedure]).} @defproc[(lookup-errno [sym (or/c 'EINTR 'EEXIST 'EAGAIN)]) exact-integer?]{ @@ -77,13 +77,13 @@ future.} @defproc[(cast [v any/c] [from-type ctype?] [to-type ctype?]) any/c]{ -Converts @scheme[v] from a value matching @scheme[from-type] to a -value matching @scheme[to-type], where @scheme[(ctype-sizeof from-type)] -matches @scheme[(ctype-sizeof to-type)]. +Converts @racket[v] from a value matching @racket[from-type] to a +value matching @racket[to-type], where @racket[(ctype-sizeof from-type)] +matches @racket[(ctype-sizeof to-type)]. The conversion is equivalent to -@schemeblock[ +@racketblock[ (let ([p (malloc from-type)]) (ptr-set! p from-type v) (ptr-ref p to-type)) @@ -92,13 +92,13 @@ The conversion is equivalent to @defproc[(cblock->list [cblock any/c] [type ctype?] [length exact-nonnegative-integer?]) list?]{ -Converts C @scheme[cblock], which is a vector of @scheme[type]s, to a +Converts C @racket[cblock], which is a vector of @racket[type]s, to a Racket list. The arguments are the same as in the -@scheme[list->cblock]. The @scheme[length] must be specified because +@racket[list->cblock]. The @racket[length] must be specified because there is no way to know where the block ends.} @defproc[(cblock->vector [cblock any/c] [type ctype?] [length exact-nonnegative-integer?]) vector?]{ -Like @scheme[cblock->vector], but for Racket vectors.} +Like @racket[cblock->vector], but for Racket vectors.} diff --git a/collects/scribblings/foreign/pointers.scrbl b/collects/scribblings/foreign/pointers.scrbl index 3b0b76084a..5fa4f1f2b5 100644 --- a/collects/scribblings/foreign/pointers.scrbl +++ b/collects/scribblings/foreign/pointers.scrbl @@ -5,11 +5,11 @@ @defproc[(cpointer? [v any/c]) boolean?]{ -Returns @scheme[#t] if @scheme[v] is a C pointer or a value that can -be used as a pointer: @scheme[#f] (used as a @cpp{NULL} pointer), byte +Returns @racket[#t] if @racket[v] is a C pointer or a value that can +be used as a pointer: @racket[#f] (used as a @cpp{NULL} pointer), byte strings (used as memory blocks), or some additional internal objects -(@scheme[ffi-obj]s and callbacks, see @secref["foreign:c-only"]). -Returns @scheme[#f] for other values.} +(@racket[ffi-obj]s and callbacks, see @secref["foreign:c-only"]). +Returns @racket[#f] for other values.} @defproc[(ptr-equal? [cptr1 cpointer?] [cptr2 cpointer?]) boolean?]{ @@ -17,15 +17,15 @@ Compares the values of the two pointers. Two different Racket pointer objects can contain the same pointer. If the values are both C pointers---as opposed to @racket[#f], a byte -string, @scheme[ffi-obj], or callback---this comparison is the same as +string, @racket[ffi-obj], or callback---this comparison is the same as @racket[equal?].} @defproc[(ptr-add [cptr cpointer?] [offset exact-integer?] [type ctype? _byte]) cpointer?]{ -Returns a cpointer that is like @scheme[cptr] offset by -@scheme[offset] instances of @scheme[ctype]. +Returns a cpointer that is like @racket[cptr] offset by +@racket[offset] instances of @racket[ctype]. The resulting cpointer keeps the base pointer and offset separate. The two pieces are combined at the last minute before any operation on the @@ -40,8 +40,8 @@ of a GCable object.} @defproc[(offset-ptr? [cptr cpointer?]) boolean?]{ A predicate for cpointers that have an offset, such as pointers that -were created using @scheme[ptr-add]. Returns @scheme[#t] even if such -an offset happens to be 0. Returns @scheme[#f] for other cpointers +were created using @racket[ptr-add]. Returns @racket[#t] even if such +an offset happens to be 0. Returns @racket[#f] for other cpointers and non-cpointers.} @@ -58,16 +58,16 @@ offset is always in bytes.} void?]{ Sets the offset component of an offset pointer. The arguments are -used in the same way as @scheme[ptr-add]. If @scheme[cptr] has no -offset, the @scheme[exn:fail:contract] exception is raised.} +used in the same way as @racket[ptr-add]. If @racket[cptr] has no +offset, the @racket[exn:fail:contract] exception is raised.} @defproc[(ptr-add! [cptr cpointer?] [offset exact-integer?] [ctype ctype? _byte]) void?]{ -Like @scheme[ptr-add], but destructively modifies the offset contained +Like @racket[ptr-add], but destructively modifies the offset contained in a pointer. The same operation could be performed using -@scheme[ptr-offset] and @scheme[set-ptr-offset!].} +@racket[ptr-offset] and @racket[set-ptr-offset!].} @defproc*[([(ptr-ref [cptr cpointer?] @@ -95,34 +95,34 @@ in a pointer. The same operation could be performed using [val any/c]) void?])]{ -The @scheme[ptr-ref] procedure returns the object referenced by -@scheme[cptr], using the given @scheme[type]. The @scheme[ptr-set!] -procedure stores the @scheme[val] in the memory @scheme[cptr] points -to, using the given @scheme[type] for the conversion. +The @racket[ptr-ref] procedure returns the object referenced by +@racket[cptr], using the given @racket[type]. The @racket[ptr-set!] +procedure stores the @racket[val] in the memory @racket[cptr] points +to, using the given @racket[type] for the conversion. -In each case, @scheme[offset] defaults to @scheme[0] (which is the -only value that should be used with @scheme[ffi-obj] objects, see -@secref["foreign:c-only"]). If an @scheme[offset] index is -non-@scheme[0], the value is read or stored at that location, -considering the pointer as a vector of @scheme[type]s --- so the -actual address is the pointer plus the size of @scheme[type] -multiplied by @scheme[offset]. In addition, a @scheme['abs] flag can -be used to use the @scheme[offset] as counting bytes rather then -increments of the specified @scheme[type]. +In each case, @racket[offset] defaults to @racket[0] (which is the +only value that should be used with @racket[ffi-obj] objects, see +@secref["foreign:c-only"]). If an @racket[offset] index is +non-@racket[0], the value is read or stored at that location, +considering the pointer as a vector of @racket[type]s --- so the +actual address is the pointer plus the size of @racket[type] +multiplied by @racket[offset]. In addition, a @racket['abs] flag can +be used to use the @racket[offset] as counting bytes rather then +increments of the specified @racket[type]. -Beware that the @scheme[ptr-ref] and @scheme[ptr-set!] procedure do +Beware that the @racket[ptr-ref] and @racket[ptr-set!] procedure do not keep any meta-information on how pointers are used. It is the programmer's responsibility to use this facility only when appropriate. For example, on a little-endian machine: -@schemeblock[ +@racketblock[ > (define block (malloc _int 5)) > (ptr-set! block _int 0 196353) > (map (lambda (i) (ptr-ref block _byte i)) '(0 1 2 3)) -@#,(schemeresultfont "(1 255 2 0)") +@#,(racketresultfont "(1 255 2 0)") ] -In addition, @scheme[ptr-ref] and @scheme[ptr-set!] cannot detect when +In addition, @racket[ptr-ref] and @racket[ptr-set!] cannot detect when offsets are beyond an object's memory bounds; out-of-bounds access can easily lead to a segmentation fault or memory corruption.} @@ -146,11 +146,11 @@ easily lead to a segmentation fault or memory corruption.} [type ctype? _byte]) void?])]{ -Copies to @scheme[cptr] from @scheme[src-cptr]. The destination -pointer can be offset by an optional @scheme[offset], which is in -@scheme[type] instances. The source pointer can be similarly offset -by @scheme[src-offset]. The number of bytes copied from source to -destination is determined by @scheme[count], which is in @scheme[type] +Copies to @racket[cptr] from @racket[src-cptr]. The destination +pointer can be offset by an optional @racket[offset], which is in +@racket[type] instances. The source pointer can be similarly offset +by @racket[src-offset]. The number of bytes copied from source to +destination is determined by @racket[count], which is in @racket[type] instances when supplied.} @defproc*[([(memcpy [cptr cpointer?] @@ -172,7 +172,7 @@ instances when supplied.} [type ctype? _byte]) void?])]{ -Like @scheme[memmove], but the result is undefined if the destination +Like @racket[memmove], but the result is undefined if the destination and source overlap.} @defproc*[([(memset [cptr cpointer?] @@ -187,26 +187,26 @@ and source overlap.} [type ctype? _byte]) void?])]{ -Similar to @scheme[memmove], but the destination is uniformly filled -with @scheme[byte] (i.e., an exact integer between 0 and 255 -inclusive). When a @scheme[type] argument is present, the result -is that of a call to memset with no @scheme[type] argument and the -@scheme[count] multiplied by the size associated with the -@scheme[type].} +Similar to @racket[memmove], but the destination is uniformly filled +with @racket[byte] (i.e., an exact integer between 0 and 255 +inclusive). When a @racket[type] argument is present, the result +is that of a call to memset with no @racket[type] argument and the +@racket[count] multiplied by the size associated with the +@racket[type].} @defproc[(cpointer-tag [cptr cpointer?]) any]{ -Returns the Racket object that is the tag of the given @scheme[cptr] +Returns the Racket object that is the tag of the given @racket[cptr] pointer.} @defproc[(set-cpointer-tag! [cptr cpointer?] [tag any/c]) void?]{ -Sets the tag of the given @scheme[cptr]. The @scheme[tag] argument can +Sets the tag of the given @racket[cptr]. The @racket[tag] argument can be any arbitrary value; other pointer operations ignore it. When a cpointer value is printed, its tag is shown if it is a symbol, a byte string, a string. In addition, if the tag is a pair holding one of -these in its @scheme[car], the @scheme[car] is shown (so that the tag +these in its @racket[car], the @racket[car] is shown (so that the tag can contain other information).} @@ -228,53 +228,53 @@ see @|InsideRacket|. cpointer?]{ Allocates a memory block of a specified size using a specified -allocation. The result is a @scheme[cpointer] to the allocated +allocation. The result is a @racket[cpointer] to the allocated memory. Although not reflected above, the four arguments can appear in any order since they are all different types of Racket objects; a size specification is required at minimum: @itemize[ - @item{If a C type @scheme[bytes-or-type] is given, its size is used + @item{If a C type @racket[bytes-or-type] is given, its size is used to the block allocation size.} - @item{If an integer @scheme[bytes-or-type] is given, it specifies the + @item{If an integer @racket[bytes-or-type] is given, it specifies the required size in bytes.} - @item{If both @scheme[bytes-or-type] and @scheme[type-or-bytes] are given, then the - allocated size is for a vector of values (the multiplication of the size of - the C type and the integer).} + @item{If both @racket[bytes-or-type] and @racket[type-or-bytes] are given, + then the allocated size is for a vector of values (the multiplication of + the size of the C type and the integer).} - @item{If a @scheme[cptr] pointer is given, its content is copied to + @item{If a @racket[cptr] pointer is given, its content is copied to the new block.} - @item{A symbol @scheme[mode] argument can be given, which specifies + @item{A symbol @racket[mode] argument can be given, which specifies what allocation function to use. It should be one of - @indexed-scheme['nonatomic] (uses @cpp{scheme_malloc} from - Racket's C API), @indexed-scheme['atomic] - (@cpp{scheme_malloc_atomic}), @indexed-scheme['stubborn] - (@cpp{scheme_malloc_stubborn}), @indexed-scheme['uncollectable] - (@cpp{scheme_malloc_uncollectable}), @indexed-scheme['eternal] - (@cpp{scheme_malloc_eternal}), @indexed-scheme['interior] + @indexed-racket['nonatomic] (uses @cpp{scheme_malloc} from + Racket's C API), @indexed-racket['atomic] + (@cpp{scheme_malloc_atomic}), @indexed-racket['stubborn] + (@cpp{scheme_malloc_stubborn}), @indexed-racket['uncollectable] + (@cpp{scheme_malloc_uncollectable}), @indexed-racket['eternal] + (@cpp{scheme_malloc_eternal}), @indexed-racket['interior] (@cpp{scheme_malloc_allow_interior}), - @indexed-scheme['atomic-interior] + @indexed-racket['atomic-interior] (@cpp{scheme_malloc_atomic_allow_interior}), or - @indexed-scheme['raw] (uses the operating system's @cpp{malloc}, + @indexed-racket['raw] (uses the operating system's @cpp{malloc}, creating a GC-invisible block).} @item{If an additional - @indexed-scheme['failok] flag is given, then + @indexed-racket['failok] flag is given, then @cpp{scheme_malloc_fail_ok} is used to wrap the call.} ] -If no mode is specified, then @scheme['nonatomic] allocation is used -when the type is a @scheme[_gcpointer]- or @scheme[_scheme]-based -type, and @scheme['atomic] allocation is used otherwise.} +If no mode is specified, then @racket['nonatomic] allocation is used +when the type is a @racket[_gcpointer]- or @racket[_scheme]-based +type, and @racket['atomic] allocation is used otherwise.} @defproc[(free [cptr cpointer?]) void]{ Uses the operating system's @cpp{free} function for -@scheme['raw]-allocated pointers, and for pointers that a foreign +@racket['raw]-allocated pointers, and for pointers that a foreign library allocated and we should free. Note that this is useful as part of a finalizer (see below) procedure hook (e.g., on the Racket pointer object, freeing the memory when the pointer object is @@ -291,24 +291,24 @@ pointer.} Allocates memory large enough to hold one arbitrary (collectable) Racket value, but that is not itself collectable or moved by the -memory manager. The cell is initialized with @scheme[v]; use the type -@scheme[_scheme] with @scheme[ptr-ref] and @scheme[ptr-set!] to get +memory manager. The cell is initialized with @racket[v]; use the type +@racket[_scheme] with @racket[ptr-ref] and @racket[ptr-set!] to get or set the cell's value. The cell must be explicitly freed with -@scheme[free-immobile-cell].} +@racket[free-immobile-cell].} @defproc[(free-immobile-cell [cptr cpointer?]) void?]{ -Frees an immobile cell created by @scheme[malloc-immobile-cell].} +Frees an immobile cell created by @racket[malloc-immobile-cell].} @defproc[(register-finalizer [obj any/c] [finalizer (any/c . -> . any)]) void?]{ -Registers a finalizer procedure @scheme[finalizer-proc] with the given -@scheme[obj], which can be any Racket (GC-able) object. The finalizer +Registers a finalizer procedure @racket[finalizer-proc] with the given +@racket[obj], which can be any Racket (GC-able) object. The finalizer is registered with a will executor; see -@scheme[make-will-executor]. The finalizer is invoked when -@scheme[obj] is about to be collected. (This is done by a thread that +@racket[make-will-executor]. The finalizer is invoked when +@racket[obj] is about to be collected. (This is done by a thread that is in charge of triggering these will executors.) Finalizers are mostly intended to be used with cpointer objects (for @@ -320,10 +320,10 @@ you must be careful to not register finalizers for two cpointers that point to the same address. Also, be careful to not make the finalizer a closure that holds on to the object. -For example, suppose that you're dealing with a foreign function that returns a C -string that you should free. Here is an attempt at creating a suitable type: +For example, suppose that you're dealing with a foreign function that returns a +C string that you should free. Here is an attempt at creating a suitable type: -@schemeblock[ +@racketblock[ (define bytes/free (make-ctype _pointer #f (code:comment @#,t{a Racket bytes can be used as a pointer}) @@ -333,14 +333,14 @@ string that you should free. Here is an attempt at creating a suitable type: b)))) ] -The above code is wrong: the finalizer is registered for @scheme[x], +The above code is wrong: the finalizer is registered for @racket[x], which is no longer needed once the byte string is created. Changing -this to register the finalizer for @scheme[b] correct this problem, -but then @scheme[free] will be invoked on it instead of on @scheme[x]. +this to register the finalizer for @racket[b] correct this problem, +but then @racket[free] will be invoked on it instead of on @racket[x]. In an attempt to fix this, we will be careful and print out a message for debugging: -@schemeblock[ +@racketblock[ (define bytes/free (make-ctype _pointer #f (code:comment @#,t{a Racket bytes can be used as a pointer}) @@ -354,11 +354,11 @@ for debugging: ] but we never see any printout. The problem is that the finalizer is a -closure that keeps a reference to @scheme[b]. To fix this, you should +closure that keeps a reference to @racket[b]. To fix this, you should use the input argument to the finalizer. Simply changing -@scheme[ignored] to @scheme[b] will solve this problem. (Removing the +@racket[ignored] to @racket[b] will solve this problem. (Removing the debugging message also avoids the problem, since the finalization -procedure would then not close over @scheme[b].)} +procedure would then not close over @racket[b].)} @defproc[(make-sized-byte-string [cptr cpointer?] [length exact-nonnegative-integer?]) @@ -368,8 +368,8 @@ Returns a byte string made of the given pointer and the given length. No copying is done. This can be used as an alternative to make pointer values accessible in Racket when the size is known. -If @scheme[cptr] is an offset pointer created by @scheme[ptr-add], the +If @racket[cptr] is an offset pointer created by @racket[ptr-add], the offset is immediately added to the pointer. Thus, this function cannot -be used with @scheme[ptr-add] to create a substring of a Racket byte +be used with @racket[ptr-add] to create a substring of a Racket byte string, because the offset pointer would be to the middle of a collectable object (which is not allowed).} diff --git a/collects/scribblings/foreign/types.scrbl b/collects/scribblings/foreign/types.scrbl index 3ff33be87d..c3f426520d 100644 --- a/collects/scribblings/foreign/types.scrbl +++ b/collects/scribblings/foreign/types.scrbl @@ -21,23 +21,23 @@ along with conversion functions to and from the existing types. ctype?]{ Creates a new @tech{C type} value whose representation for foreign -code is the same as @scheme[type]'s. The given conversions functions -convert to and from the Racket representation of @scheme[type]. Either -conversion function can be @scheme[#f], meaning that the conversion +code is the same as @racket[type]'s. The given conversions functions +convert to and from the Racket representation of @racket[type]. Either +conversion function can be @racket[#f], meaning that the conversion for the corresponding direction is the identity function. If both -functions are @scheme[#f], @scheme[type] is returned.} +functions are @racket[#f], @racket[type] is returned.} @defproc[(ctype? [v any/c]) boolean?]{ -Returns @scheme[#t] if @scheme[v] is a @tech{C type}, @scheme[#f] +Returns @racket[#t] if @racket[v] is a @tech{C type}, @racket[#f] otherwise.} @defproc*[([(ctype-sizeof [type ctype?]) exact-nonnegative-integer?] [(ctype-alignof [type ctype?]) exact-nonnegative-integer?])]{ -Returns the size or alignment of a given @scheme[type] for the current +Returns the size or alignment of a given @racket[type] for the current platform.} @@ -47,7 +47,7 @@ platform.} Returns a value to describe the eventual C representation of the type. It can be any of the following symbols: -@schemeblock[ +@racketblock[ 'int8 'uint8 'int16 'uint16 'int32 'uint32 'int64 'uint64 'float 'double 'bool 'void 'pointer 'fpointer 'bytes 'string/ucs-4 'string/utf-16 @@ -59,14 +59,14 @@ element representations are provided in order within the list.} @defproc[(compiler-sizeof [sym symbol?]) exact-nonnegative-integer?]{ -Possible values for @scheme[symbol] are @scheme['int], @scheme['char], -@scheme['short], @scheme['long], @scheme['*], @scheme['void], -@scheme['float], @scheme['double]. The result is the size of the +Possible values for @racket[symbol] are @racket['int], @racket['char], +@racket['short], @racket['long], @racket['*], @racket['void], +@racket['float], @racket['double]. The result is the size of the correspond type according to the C @cpp{sizeof} operator for the -current platform. The @scheme[compiler-sizeof] operation should be +current platform. The @racket[compiler-sizeof] operation should be used to gather information about the current platform, such as -defining alias type like @scheme[_int] to a known type like -@scheme[_int32].} +defining alias type like @racket[_int] to a known type like +@racket[_int32].} @; ---------------------------------------------------------------------- @@ -85,8 +85,8 @@ defining alias type like @scheme[_int] to a known type like [_sint64 ctype?] [_uint64 ctype?])]{ -The basic integer types at various sizes. The @schemeidfont{s} or -@schemeidfont{u} prefix specifies a signed or an unsigned integer, +The basic integer types at various sizes. The @racketidfont{s} or +@racketidfont{u} prefix specifies a signed or an unsigned integer, respectively; the ones with no prefix are signed.} @defthing*[([_byte ctype?] @@ -111,26 +111,26 @@ respectively; the ones with no prefix are signed.} [_sintptr ctype?] [_uintptr ctype?])]{ -Aliases for basic integer types. The @scheme[_byte] aliases correspond -to @scheme[_int8]. The @scheme[_short] and @scheme[_word] aliases -correspond to @scheme[_int16]. The @scheme[_int] aliases correspond to -@scheme[_int32]. The @scheme[_long] aliases correspond to either -@scheme[_int32] or @scheme[_int64], depending on the platform. Similarly, -the @scheme[_intptr] aliases correspond to either -@scheme[_int32] or @scheme[_int64], depending on the platform.} +Aliases for basic integer types. The @racket[_byte] aliases correspond +to @racket[_int8]. The @racket[_short] and @racket[_word] aliases +correspond to @racket[_int16]. The @racket[_int] aliases correspond to +@racket[_int32]. The @racket[_long] aliases correspond to either +@racket[_int32] or @racket[_int64], depending on the platform. Similarly, +the @racket[_intptr] aliases correspond to either +@racket[_int32] or @racket[_int64], depending on the platform.} @defthing*[([_fixnum ctype?] [_ufixnum ctype?])]{ For cases where speed matters and where you know that the integer is -small enough, the types @scheme[_fixnum] and @scheme[_ufixnum] are -similar to @scheme[_intptr] and @scheme[_uintptr] but assume that the +small enough, the types @racket[_fixnum] and @racket[_ufixnum] are +similar to @racket[_intptr] and @racket[_uintptr] but assume that the quantities fit in Racket's immediate integers (i.e., not bignums).} @defthing*[([_fixint ctype?] [_ufixint ctype?])]{ -Similar to @scheme[_fixnum]/@scheme[_ufixnum], but based on +Similar to @racket[_fixnum]/@racket[_ufixnum], but based on @racket[_int]/@racket[_uint] instead of @racket[_intptr]/@racket[_uintptr], and coercions from C are checked to be in range.} @@ -139,12 +139,12 @@ to be in range.} [_double ctype?] [_double* ctype?])]{ -The @scheme[_float] and @scheme[_double] types represent the +The @racket[_float] and @racket[_double] types represent the corresponding C types. Both single- and double-precision Racket -numbers are accepted for conversion via both @scheme[_float] and -@scheme[_double], while both @scheme[_float] and @scheme[_double] +numbers are accepted for conversion via both @racket[_float] and +@racket[_double], while both @racket[_float] and @racket[_double] coerce C values to double-precision Racket numbers. -The type @scheme[_double*] +The type @racket[_double*] coerces any Racket real number to a C @cpp{double}.} @; ------------------------------------------------------------ @@ -153,8 +153,8 @@ coerces any Racket real number to a C @cpp{double}.} @defthing[_bool ctype?]{ -Translates @scheme[#f] to a @scheme[0] @scheme[_int], and any other -value to @scheme[1].} +Translates @racket[#f] to a @racket[0] @racket[_int], and any other +value to @racket[1].} @defthing[_void ctype?]{ @@ -171,9 +171,9 @@ inputs.} The five primitive string types correspond to cases where a C representation matches Racket's representation without encodings. -The form @scheme[_bytes] form can be used type for Racket byte +The form @racket[_bytes] form can be used type for Racket byte strings, which corresponds to C's @cpp{char*} type. In addition to -translating byte strings, @scheme[#f] corresponds to the @cpp{NULL} +translating byte strings, @racket[#f] corresponds to the @cpp{NULL} pointer. @deftogether[( @@ -182,7 +182,7 @@ pointer. A type for Racket's native Unicode strings, which are in UCS-4 format. These correspond to the C @cpp{mzchar*} type used by Racket. As usual, the types -treat @scheme[#f] as @cpp{NULL} and vice versa.} +treat @racket[#f] as @cpp{NULL} and vice versa.} @deftogether[( @@ -190,19 +190,19 @@ treat @scheme[#f] as @cpp{NULL} and vice versa.} )]{ Unicode strings in UTF-16 format. As usual, the types treat -@scheme[#f] as @cpp{NULL} and vice versa.} +@racket[#f] as @cpp{NULL} and vice versa.} @defthing[_path ctype?]{ Simple @cpp{char*} strings, corresponding to Racket's paths. As usual, -the types treat @scheme[#f] as @cpp{NULL} and vice versa. +the types treat @racket[#f] as @cpp{NULL} and vice versa. Beware that changing the current directory via -@scheme[current-directory] does not change the OS-level current +@racket[current-directory] does not change the OS-level current directory as seen by foreign library functions. Paths normally should -be converted to absolute form using @scheme[path->complete-path] -(which uses the @scheme[current-directory] parameter) before passing +be converted to absolute form using @racket[path->complete-path] +(which uses the @racket[current-directory] parameter) before passing them to a foreign function.} @@ -221,38 +221,38 @@ Return values using this type are interned as symbols.} Types that correspond to (character) strings on the Racket side and @cpp{char*} strings on the C side. The bridge between the two requires a transformation on the content of the string. As usual, the types -treat @scheme[#f] as @cpp{NULL} and vice versa.} +treat @racket[#f] as @cpp{NULL} and vice versa.} @defthing*[([_string*/utf-8 ctype?] [_string*/latin-1 ctype?] [_string*/locale ctype?])]{ -Similar to @scheme[_string/utf-8], etc., but accepting a wider range +Similar to @racket[_string/utf-8], etc., but accepting a wider range of values: Racket byte strings are allowed and passed as is, and -Racket paths are converted using @scheme[path->bytes].} +Racket paths are converted using @racket[path->bytes].} @subsection{Variable Auto-Converting String Type} -The @scheme[_string/ucs-4] type is rarely useful when interacting with -foreign code, while using @scheme[_bytes] is somewhat unnatural, since +The @racket[_string/ucs-4] type is rarely useful when interacting with +foreign code, while using @racket[_bytes] is somewhat unnatural, since it forces Racket programmers to use byte strings. Using -@scheme[_string/utf-8], etc., meanwhile, may prematurely commit to a -particular encoding of strings as bytes. The @scheme[_string] type +@racket[_string/utf-8], etc., meanwhile, may prematurely commit to a +particular encoding of strings as bytes. The @racket[_string] type supports conversion between Racket strings and @cpp{char*} strings using a parameter-determined conversion. @defthing[_string ctype?]{ -Expands to a use of the @scheme[default-_string-type] parameter. The -parameter's value is consulted when @scheme[_string] is evaluated, so +Expands to a use of the @racket[default-_string-type] parameter. The +parameter's value is consulted when @racket[_string] is evaluated, so the parameter should be set before any interface definition that uses -@scheme[_string].} +@racket[_string].} @defparam[default-_string-type type ctype?]{ -A parameter that determines the current meaning of @scheme[_string]. -It is initially set to @scheme[_string*/utf-8]. If you change it, do +A parameter that determines the current meaning of @racket[_string]. +It is initially set to @racket[_string*/utf-8]. If you change it, do so @italic{before} interfaces are defined.} @@ -260,19 +260,19 @@ so @italic{before} interfaces are defined.} @defthing[_file ctype?]{ -Like @scheme[_path], but when values go from Racket to C, -@scheme[cleanse-path] is used on the given value. As an output value, -it is identical to @scheme[_path].} +Like @racket[_path], but when values go from Racket to C, +@racket[cleanse-path] is used on the given value. As an output value, +it is identical to @racket[_path].} @defthing[_bytes/eof ctype?]{ -Similar to the @scheme[_bytes] type, except that a foreign return -value of @cpp{NULL} is translated to a Racket @scheme[eof] value.} +Similar to the @racket[_bytes] type, except that a foreign return +value of @cpp{NULL} is translated to a Racket @racket[eof] value.} @defthing[_string/eof ctype?]{ -Similar to the @scheme[_string] type, except that a foreign return -value of @cpp{NULL} is translated to a Racket @scheme[eof] value.} +Similar to the @racket[_string] type, except that a foreign return +value of @cpp{NULL} is translated to a Racket @racket[eof] value.} @; ------------------------------------------------------------ @@ -284,10 +284,10 @@ Corresponds to Racket ``C pointer'' objects. These pointers can have an arbitrary Racket object attached as a type tag. The tag is ignored by built-in functionality; it is intended to be used by interfaces. See @secref["foreign:tagged-pointers"] for creating pointer types that -use these tags for safety. A @scheme[#f] value is converted to +use these tags for safety. A @racket[#f] value is converted to @cpp{NULL} and vice versa. -The address referenced by a @scheme[_pointer] value must not refer to +The address referenced by a @racket[_pointer] value must not refer to memory managed by the garbage collector (unless the address corresponds to a value that supports interior pointers and that is otherwise referenced to preserve the value from garbage collection). @@ -300,14 +300,14 @@ refer to the same address.} @defthing[_gcpointer ctype?]{ -Like @scheme[_pointer], but for a value that can refer to memory +Like @racket[_pointer], but for a value that can refer to memory managed by the garbage collector. -Although a @scheme[_gcpointer] can reference to memory that is not +Although a @racket[_gcpointer] can reference to memory that is not managed by the garbage collector, beware of using an address that might eventually become managed by the garbage collector. For example, -if a reference is created by @scheme[malloc] with @scheme['raw] and -released by @scheme[free], then the @scheme[free] may allow the memory +if a reference is created by @racket[malloc] with @racket['raw] and +released by @racket[free], then the @racket[free] may allow the memory formerly occupied by the reference to be used later by the garbage collector.} @@ -325,33 +325,33 @@ Racket's C API.} @defthing[_fpointer ctype?]{ -Similar to @scheme[_pointer], except that when an @scheme[_fpointer] -is extracted from a pointer produced by @scheme[ffi-obj-ref], then a +Similar to @racket[_pointer], except that when an @racket[_fpointer] +is extracted from a pointer produced by @racket[ffi-obj-ref], then a level of indirection is skipped. A level of indirection is similarly -skipped when extracting a pointer via @scheme[get-ffi-obj]. Like -@scheme[_pointer], @scheme[_fpointer] treats @scheme[#f] as @cpp{NULL} +skipped when extracting a pointer via @racket[get-ffi-obj]. Like +@racket[_pointer], @racket[_fpointer] treats @racket[#f] as @cpp{NULL} and vice versa. -A type generated by @scheme[_cprocedure] builds on @scheme[_fpointer], -and normally @scheme[_cprocedure] should be used instead of -@scheme[_fpointer].} +A type generated by @racket[_cprocedure] builds on @racket[_fpointer], +and normally @racket[_cprocedure] should be used instead of +@racket[_fpointer].} @defproc[(_or-null [ctype ctype?]) ctype?]{ -Creates a type that is like @scheme[ctype], but @scheme[#f] is -converted to @cpp{NULL} and vice versa. The given @scheme[ctype] must -have the same C representation as @scheme[_pointer], -@scheme[_gcpointer], or @scheme[_fpointer].} +Creates a type that is like @racket[ctype], but @racket[#f] is +converted to @cpp{NULL} and vice versa. The given @racket[ctype] must +have the same C representation as @racket[_pointer], +@racket[_gcpointer], or @racket[_fpointer].} @defproc[(_gcable [ctype ctype?]) ctype?]{ -Creates a type that is like @scheme[ctype], but whose base -representation is like @scheme[_gcpointer] instead of -@scheme[_pointer]. The given @scheme[ctype] must have a base -representation like @scheme[_pointer] or @scheme[_gcpointer] (and in -the later case, the result is the @scheme[ctype]).} +Creates a type that is like @racket[ctype], but whose base +representation is like @racket[_gcpointer] instead of +@racket[_pointer]. The given @racket[ctype] must have a base +representation like @racket[_pointer] or @racket[_gcpointer] (and in +the later case, the result is the @racket[ctype]).} @; ------------------------------------------------------------ @@ -372,31 +372,31 @@ the later case, the result is the @scheme[ctype]).} any]{ A type constructor that creates a new function type, which is -specified by the given @scheme[input-types] list and @scheme[output-type]. -Usually, the @scheme[_fun] syntax (described below) should be used +specified by the given @racket[input-types] list and @racket[output-type]. +Usually, the @racket[_fun] syntax (described below) should be used instead, since it manages a wide range of complicated cases. The resulting type can be used to reference foreign functions (usually -@scheme[ffi-obj]s, but any pointer object can be referenced with this type), +@racket[ffi-obj]s, but any pointer object can be referenced with this type), generating a matching foreign callout object. Such objects are new primitive procedure objects that can be used like any other Racket procedure. -As with other pointer types, @scheme[#f] is treated as a @cpp{NULL} +As with other pointer types, @racket[#f] is treated as a @cpp{NULL} function pointer and vice versa. -A type created with @scheme[_cprocedure] can also be used for passing +A type created with @racket[_cprocedure] can also be used for passing Racket procedures to foreign functions, which will generate a foreign function pointer that calls the given Racket procedure when it is used. There are no restrictions on the Racket procedure; in particular, its lexical context is properly preserved. -The optional @scheme[abi] keyword argument determines the foreign ABI -that is used. Supplying @scheme[#f] or @scheme['default] indicates the +The optional @racket[abi] keyword argument determines the foreign ABI +that is used. Supplying @racket[#f] or @racket['default] indicates the platform-dependent default. The other possible -values---@scheme['stdcall]and @scheme['sysv] (i.e., ``cdecl'')---are +values---@racket['stdcall]and @racket['sysv] (i.e., ``cdecl'')---are currently supported only for 32-bit Windows; using them on other platforms raises an exception. -If @scheme[atomic?] is true, then when a Racket procedure is given +If @racket[atomic?] is true, then when a Racket procedure is given this procedure type and called from foreign code, then the Racket process is put into atomic mode while evaluating the Racket procedure body. In atomic mode, other Racket threads do not run, so the Racket @@ -408,23 +408,23 @@ must not perform any escaping continuation jumps, and its non-tail recursion must be minimal to avoid C-level stack overflow; otherwise, the process may crash or misbehave. -If an @scheme[async-apply] procedure is provided, then a Racket +If an @racket[async-apply] procedure is provided, then a Racket procedure with the generated procedure type can be applied in a foreign thread (i.e., an OS-level thread other than the one used to run Racket). The call in the foreign thread is transferred to the OS-level thread that runs Racket, but the Racket-level thread (in the sense of @racket[thread]) is unspecified; the job of the provided -@scheme[async-apply] procedure is to arrange for the callback procedure to be -run in a suitable Racket thread. The given @scheme[async-apply] procedure is +@racket[async-apply] procedure is to arrange for the callback procedure to be +run in a suitable Racket thread. The given @racket[async-apply] procedure is applied to a thunk that encapsulates the specific callback invocation, and the foreign OS-level thread blocks until the thunk is called and completes; the thunk must be called exactly once, and the callback -invocation must return normally. The given @scheme[async-apply] procedure -itself is called in atomic mode (see @scheme[atomic?] above). If the +invocation must return normally. The given @racket[async-apply] procedure +itself is called in atomic mode (see @racket[atomic?] above). If the callback is known to complete quickly, requires no synchronization, and works independent of the Racket thread in which it runs, then it is safe for the given -@scheme[async-apply] procedure to apply the thunk directly. Otherwise, +@racket[async-apply] procedure to apply the thunk directly. Otherwise, the given @racket[async-apply] procedure must arrange for the thunk to be applied in a suitable Racket thread sometime after the given @@ -432,17 +432,17 @@ suitable Racket thread sometime after the given returns; if the thunk raises an exception or synchronizes within an unsuitable Racket-level thread, it can deadlock or otherwise damage the Racket process. Foreign-thread detection to trigger -@scheme[async-apply] works only when Racket is compiled with OS-level +@racket[async-apply] works only when Racket is compiled with OS-level thread support, which is the default for many platforms. If a callback -with an @scheme[async-apply] is called from foreign code in the same -OS-level thread that runs Racket, then the @scheme[async-apply] wrapper is +with an @racket[async-apply] is called from foreign code in the same +OS-level thread that runs Racket, then the @racket[async-apply] wrapper is not used. @margin-note{The @racket[atomic?] and @racket[async-apply] arguments -affect callbacks into Racket, while @scheme[in-original-place?] +affect callbacks into Racket, while @racket[in-original-place?] affects calls from Racket into foreign code.} -If @scheme[in-original-place?] is true, then when a foreign procedure +If @racket[in-original-place?] is true, then when a foreign procedure with the generated type is called in any Racket @tech[#:doc '(lib "scribblings/reference/reference.scrbl")]{place}, the procedure is called from the original Racket place. Use this mode for a foreign @@ -452,25 +452,25 @@ code back into Racket at a non-original place typically will not work, since the place of the Racket code may have a different allocator than the original place. -If @scheme[save-errno] is @scheme['posix], then the value of +If @racket[save-errno] is @racket['posix], then the value of @as-index{@tt{errno}} is saved (specific to the current thread) immediately after a foreign function returns. The saved value is -accessible through @scheme[saved-errno]. If @scheme[save-errno] is -@scheme['windows], then the value of +accessible through @racket[saved-errno]. If @racket[save-errno] is +@racket['windows], then the value of @as-index{@tt{GetLastError}}@tt{()} is saved for later use via -@scheme[saved-errno]; the @scheme['windows] option is available only -on Windows (on other platforms @scheme[saved-errno] will return -0). If @scheme[save-errno] is @scheme[#f], no error value is saved +@racket[saved-errno]; the @racket['windows] option is available only +on Windows (on other platforms @racket[saved-errno] will return +0). If @racket[save-errno] is @racket[#f], no error value is saved automatically. The error-recording support provided by -@scheme[save-errno] is needed because the Racket runtime system +@racket[save-errno] is needed because the Racket runtime system may otherwise preempt the current Racket thread and itself call functions that set error values. -The optional @scheme[wrapper], if provided, is expected to be a +The optional @racket[wrapper], if provided, is expected to be a function that can change a callout procedure: when a callout is generated, the wrapper is applied on the newly created primitive procedure, and its result is used as the new function. Thus, -@scheme[wrapper] is a hook that can perform various argument +@racket[wrapper] is a hook that can perform various argument manipulations before the foreign function is invoked, and return different results (for example, grabbing a value stored in an ``output'' pointer and returning multiple values). It can also be @@ -483,11 +483,11 @@ translating them to a foreign ``closure,'' which foreign code can call as plain C functions. Additional care must be taken in case the foreign code might hold on to the callback function. In these cases you must arrange for the callback value to not be garbage-collected, -or the held callback will become invalid. The optional @scheme[keep] +or the held callback will become invalid. The optional @racket[keep] keyword argument is used to achieve this. It can have the following values: @itemize[ -@item{@scheme[#t] makes the callback value stay in memory as long as +@item{@racket[#t] makes the callback value stay in memory as long as the converted function is. In order to use this, you need to hold on to the original function, for example, have a binding for it. Note that each function can hold onto one callback value (it is @@ -495,7 +495,7 @@ values: @itemize[ multiple callbacks you will need to use one of the last two options below. (This is the default, as it is fine in most cases.)} -@item{@scheme[#f] means that the callback value is not held. This may +@item{@racket[#f] means that the callback value is not held. This may be useful for a callback that is only used for the duration of the foreign call --- for example, the comparison function argument to the standard C library @tt{qsort} function is only used while @@ -503,7 +503,7 @@ values: @itemize[ comparison function are kept. Use this option only in such cases, when no holding is necessary and you want to avoid the extra cost.} -@item{A box holding @scheme[#f] (or a callback value) --- in this case +@item{A box holding @racket[#f] (or a callback value) --- in this case the callback value will be stored in the box, overriding any value that was in the box (making it useful for holding a single callback value). When you know that it is no longer needed, you can @@ -515,14 +515,14 @@ values: @itemize[ callback box as a field in new instances or instantiations of the unit.} -@item{A box holding @scheme[null] (or any list) -- this is similar to +@item{A box holding @racket[null] (or any list) -- this is similar to the previous case, except that new callback values are consed onto the contents of the box. It is therefore useful in (rare) cases when a Racket function is used in multiple callbacks (that is, sent to foreign code to hold onto multiple times).} @item{Finally, if a one-argument function is provided as - @scheme[keep], it will be invoked with the callback value when it + @racket[keep], it will be invoked with the callback value when it is generated. This allows you to grab the value directly and use it in any way.} @@ -548,46 +548,46 @@ values: @itemize[ [maybe-wrapper code:blank (code:line -> output-expr)])]{ -Creates a new function type. The @scheme[_fun] form is a convenient -syntax for the @scheme[_cprocedure] type constructor. In its simplest -form, only the input @scheme[type-expr]s and the output @scheme[type-expr] are +Creates a new function type. The @racket[_fun] form is a convenient +syntax for the @racket[_cprocedure] type constructor. In its simplest +form, only the input @racket[type-expr]s and the output @racket[type-expr] are specified, and each types is a simple expression, which creates a straightforward function type. For instance, -@schemeblock[ +@racketblock[ (_fun _int _string -> _int) ] specifies a function that receives an integer and a string, and returns an integer. -In its full form, the @scheme[_fun] syntax provides an IDL-like +In its full form, the @racket[_fun] syntax provides an IDL-like language that can be used to create a wrapper function around the primitive foreign function. These wrappers can implement complex foreign interfaces given simple specifications. The full form of each of the type specifications can include an optional label and an -expression. If a @scheme[= value-expr] is provided, then the resulting +expression. If a @racket[= value-expr] is provided, then the resulting function will be a wrapper that calculates the argument for that position itself, meaning that it does not expect an argument for that position. The expression can use previous arguments if they were -labeled with @scheme[id :]. In addition, the result of a function +labeled with @racket[id :]. In addition, the result of a function call need not be the value returned from the foreign call: if the -optional @scheme[output-expr] is specified, or if an expression is +optional @racket[output-expr] is specified, or if an expression is provided for the output type, then this specifies an expression that will be used as a return value. This expression can use any of the previous labels, including a label given for the output which can be used to access the actual foreign return value. In rare cases where complete control over the input arguments is needed, the -wrapper's argument list can be specified as @scheme[args], in any form (including -a ``rest'' argument). Identifiers in this place are related to type labels, so -if an argument is there is no need to use an expression. +wrapper's argument list can be specified as @racket[args], in any form +(including a ``rest'' argument). Identifiers in this place are related to type +labels, so if an argument is there is no need to use an expression. For example, -@schemeblock[ +@racketblock[ (_fun (n s) :: (s : _string) (n : _int) -> _int) ] @@ -598,17 +598,17 @@ foreign function receives the string first.} [fun-type ctype?]) cpointer?]{ -Casts @scheme[ptr-or-proc] to a function pointer of type @scheme[fun-type].} +Casts @racket[ptr-or-proc] to a function pointer of type @racket[fun-type].} @; ---------------------------------------------------------------------- @subsection[#:tag "foreign:custom-types"]{Custom Function Types} -The behavior of the @scheme[_fun] type can be customized via +The behavior of the @racket[_fun] type can be customized via @deftech{custom function types}, which are pieces of syntax that can behave as C types and C type constructors, but they can interact with function calls in several ways that are not possible otherwise. When -the @scheme[_fun] form is expanded, it tries to expand each of the +the @racket[_fun] form is expanded, it tries to expand each of the given type expressions, and ones that expand to certain keyword-value lists interact with the generation of the foreign function wrapper. This expansion makes it possible to construct a single wrapper @@ -616,64 +616,64 @@ function, avoiding the costs involved in compositions of higher-order functions. Custom function types are macros that expand to a sequence -@scheme[(_key: _val ...)], where each @scheme[_key:] is from a short list +@racket[(_key: _val ...)], where each @racket[_key:] is from a short list of known keys. Each key interacts with generated wrapper functions in a different way, which affects how its corresponding argument is treated: @itemize[ - @item{@scheme[type:] specifies the foreign type that should be used, if it is - @scheme[#f] then this argument does not participate in the foreign call.} + @item{@racket[type:] specifies the foreign type that should be used, if it is + @racket[#f] then this argument does not participate in the foreign call.} - @item{@scheme[expr:] specifies an expression to be used for arguments of this + @item{@racket[expr:] specifies an expression to be used for arguments of this type, removing it from wrapper arguments.} - @item{@scheme[bind:] specifies a name that is bound to the original - argument if it is required later (e.g., @scheme[_box] converts its + @item{@racket[bind:] specifies a name that is bound to the original + argument if it is required later (e.g., @racket[_box] converts its associated value to a C pointer, and later needs to refer back to the original box).} - @item{@scheme[1st-arg:] specifies a name that can be used to refer to + @item{@racket[1st-arg:] specifies a name that can be used to refer to the first argument of the foreign call (good for common cases where the first argument has a special meaning, e.g., for method calls).} - @item{@scheme[prev-arg:] similar to @scheme[1st-arg:], but refers to the + @item{@racket[prev-arg:] similar to @racket[1st-arg:], but refers to the previous argument.} - @item{@scheme[pre:] a pre-foreign code chunk that is used to change the + @item{@racket[pre:] a pre-foreign code chunk that is used to change the argument's value.} - @item{@scheme[post:] a similar post-foreign code chunk.} + @item{@racket[post:] a similar post-foreign code chunk.} - @item{@scheme[keywords:] specifies keyword/value expressions that will - be used with the surrounding @scheme[_fun] form. (Note: the - keyword/value sequence follows @scheme[keywords:], not parenthesized.)} + @item{@racket[keywords:] specifies keyword/value expressions that will + be used with the surrounding @racket[_fun] form. (Note: the + keyword/value sequence follows @racket[keywords:], not parenthesized.)} ] -The @scheme[pre:] and @scheme[post:] bindings can be of the form -@scheme[(_id => _expr)] to use the existing value. Note that if the -@scheme[pre:] expression is not @scheme[(_id => _expr)], then it means +The @racket[pre:] and @racket[post:] bindings can be of the form +@racket[(_id => _expr)] to use the existing value. Note that if the +@racket[pre:] expression is not @racket[(_id => _expr)], then it means that there is no input for this argument to the -@scheme[_fun]-generated procedure. Also note that if a custom type is -used as an output type of a function, then only the @scheme[post:] +@racket[_fun]-generated procedure. Also note that if a custom type is +used as an output type of a function, then only the @racket[post:] code is used. -Most custom types are meaningful only in a @scheme[_fun] context, and +Most custom types are meaningful only in a @racket[_fun] context, and will raise a syntax error if used elsewhere. A few such types can be -used in non-@scheme[_fun] contexts: types which use only -@scheme[type:], @scheme[pre:], @scheme[post:], and no others. Such -custom types can be used outside a @scheme[_fun] by expanding them -into a usage of @scheme[make-ctype], using other keywords makes this +used in non-@racket[_fun] contexts: types which use only +@racket[type:], @racket[pre:], @racket[post:], and no others. Such +custom types can be used outside a @racket[_fun] by expanding them +into a usage of @racket[make-ctype], using other keywords makes this impossible, because it means that the type has specific interaction with a function call. @defform[(define-fun-syntax id transformer-expr)]{ -Binds @scheme[id] as a @tech{custom function type}. The type is +Binds @racket[id] as a @tech{custom function type}. The type is expanded by applying the procedure produced by -@scheme[transformer-expr] to a use of the @tech{custom function +@racket[transformer-expr] to a use of the @tech{custom function type}. For instance, the following defines a new type that automatically coerces @@ -699,29 +699,29 @@ to specify wrapper arguments that are not sent to the foreign function (_ptr mode type-expr) ([mode i o io])]{ -Creates a C pointer type, where @scheme[mode] indicates input or -output pointers (or both). The @scheme[mode] can be one of the +Creates a C pointer type, where @racket[mode] indicates input or +output pointers (or both). The @racket[mode] can be one of the following: @itemize[ - @item{@scheme[i] --- indicates an @italic{input} pointer argument: + @item{@racket[i] --- indicates an @italic{input} pointer argument: the wrapper arranges for the function call to receive a value that - can be used with the @scheme[type] and to send a pointer to this + can be used with the @racket[type] and to send a pointer to this value to the foreign function. After the call, the value is discarded.} - @item{@scheme[o] --- indicates an @italic{output} pointer argument: + @item{@racket[o] --- indicates an @italic{output} pointer argument: the foreign function expects a pointer to a place where it will save some value, and this value is accessible after the call, to be used - by an extra return expression. If @scheme[_ptr] is used in this + by an extra return expression. If @racket[_ptr] is used in this mode, then the generated wrapper does not expect an argument since one will be freshly allocated before the call.} - @item{@scheme[io] --- combines the above into an + @item{@racket[io] --- combines the above into an @italic{input/output} pointer argument: the wrapper gets the Racket value, allocates and set a pointer using this value, and then - references the value after the call. The ``@scheme[_ptr]'' name can + references the value after the call. The ``@racket[_ptr]'' name can be confusing here: it means that the foreign function expects a pointer, but the generated wrapper uses an actual value. (Note that if this is used with structs, a struct is created when calling the @@ -730,11 +730,11 @@ following: ] -For example, the @scheme[_ptr] type can be used in output mode to create a +For example, the @racket[_ptr] type can be used in output mode to create a foreign function wrapper that returns more than a single argument. The following type: -@schemeblock[ +@racketblock[ (_fun (i : (_ptr o _int)) -> (d : _double) -> (values d i)) @@ -747,7 +747,7 @@ return value.} @defidform[_box]{ -A @tech{custom function type} similar to a @scheme[(_ptr io _type)] +A @tech{custom function type} similar to a @racket[(_ptr io _type)] argument, where the input is expected to be a box holding an appropriate value, which is unboxed on entry and modified accordingly on exit.} @@ -757,16 +757,16 @@ on exit.} [maybe-len code:blank len-expr])]{ -A @tech{custom function type} that is similar to @scheme[_ptr], except +A @tech{custom function type} that is similar to @racket[_ptr], except that it is used for converting lists to/from C vectors. The optional -@scheme[maybe-len] argument is needed for output values where it is used in +@racket[maybe-len] argument is needed for output values where it is used in the post code, and in the pre code of an output mode to allocate the block. In either case, it can refer to a previous binding for the length of the list which the C function will most likely require.} @defform[(_vector mode type maybe-len)]{ -A @tech{custom function type} like @scheme[_list], except that it uses +A @tech{custom function type} like @racket[_list], except that it uses Racket vectors instead of lists.} @@ -780,8 +780,8 @@ is for a pointer return value, where the size should be explicitly specified. There is no need for other modes: input or input/output would be just -like @scheme[_bytes], since the string carries its size information -(there is no real need for the @scheme[o] part of the syntax, but it +like @racket[_bytes], since the string carries its size information +(there is no real need for the @racket[o] part of the syntax, but it is present for consistency with the above macros).} @@ -800,7 +800,7 @@ functions associated. The corresponding Racket objects that are used for structs are pointers, but when these types are used, the value that the pointer @italic{refers to} is used, rather than the pointer itself. This value is basically made of a number of bytes that is -known according to the given list of @scheme[types] list. +known according to the given list of @racket[types] list. If @racket[alignment] is @racket[#f], then the natural alignment of each type in @racket[types] is used for its alignment within the @@ -813,11 +813,11 @@ members.} ctype?]{ A type constructor that builds a struct type using -@scheme[make-cstruct-type] function and wraps it in a type that +@racket[make-cstruct-type] function and wraps it in a type that marshals a struct as a list of its components. Note that space for structs must to be allocated; the converter for a -@scheme[_list-struct] type immediately allocates and uses a list from -the allocated space, so it is inefficient. Use @scheme[define-cstruct] +@racket[_list-struct] type immediately allocates and uses a list from +the allocated space, so it is inefficient. Use @racket[define-cstruct] below for a more efficient approach.} @@ -827,52 +827,52 @@ below for a more efficient approach.} (alignment code:blank (code:line #:alignment alignment-expr))]]{ -Defines a new C struct type, but unlike @scheme[_list-struct], the +Defines a new C struct type, but unlike @racket[_list-struct], the resulting type deals with C structs in binary form, rather than marshaling them to Racket values. The syntax is similar to -@scheme[define-struct], providing accessor functions for raw struct +@racket[define-struct], providing accessor functions for raw struct values (which are pointer objects). The new type uses pointer tags to -guarantee that only proper struct objects are used. The @scheme[_id] +guarantee that only proper struct objects are used. The @racket[_id] must start with @litchar{_}. The resulting bindings are as follows: @itemize[ - @item{@scheme[_id] : the new C type for this struct.} + @item{@racket[_id] : the new C type for this struct.} - @item{@scheme[_id]@schemeidfont{-pointer}: a pointer type that should + @item{@racket[_id]@racketidfont{-pointer}: a pointer type that should be used when a pointer to values of this struct are used.} - @item{@schemevarfont{id}@schemeidfont{?}: a predicate for the new type.} + @item{@racketvarfont{id}@racketidfont{?}: a predicate for the new type.} - @item{@schemevarfont{id}@schemeidfont{-tag}: the tag string object that is + @item{@racketvarfont{id}@racketidfont{-tag}: the tag string object that is used with instances.} - @item{@schemeidfont{make-}@schemevarfont{id} : a constructor, which expects + @item{@racketidfont{make-}@racketvarfont{id} : a constructor, which expects an argument for each type.} - @item{@schemevarfont{id}@schemeidfont{-}@scheme[field-id] : an accessor - function for each @scheme[field-id]; if the field has a cstruct type, then + @item{@racketvarfont{id}@racketidfont{-}@racket[field-id] : an accessor + function for each @racket[field-id]; if the field has a cstruct type, then the result of the accessor is a pointer to the field within the enclosing structure, rather than a copy of the field.} - @item{@schemeidfont{set-}@schemevarfont{id}@schemeidfont{-}@scheme[field-id]@schemeidfont{!} - : a mutator function for each @scheme[field-id].} + @item{@racketidfont{set-}@racketvarfont{id}@racketidfont{-}@racket[field-id]@racketidfont{!} + : a mutator function for each @racket[field-id].} - @item{@schemevarfont{id}: structure-type information compatible with - @scheme[struct-out] or @scheme[match] (but not @scheme[define-struct]); - currently, this information is correct only when no @scheme[super-id] + @item{@racketvarfont{id}: structure-type information compatible with + @racket[struct-out] or @racket[match] (but not @racket[define-struct]); + currently, this information is correct only when no @racket[super-id] is specified.} ] Objects of the new type are actually C pointers, with a type tag that -is a list that contains the string form of @schemevarfont{id}. Since +is a list that contains the string form of @racketvarfont{id}. Since structs are implemented as pointers, they can be used for a -@scheme[_pointer] input to a foreign function: their address will be +@racket[_pointer] input to a foreign function: their address will be used. To make this a little safer, the corresponding cpointer type is -defined as @scheme[_id]@schemeidfont{-pointer}. The @scheme[_id] type +defined as @racket[_id]@racketidfont{-pointer}. The @racket[_id] type should not be used when a pointer is expected, since it will cause the struct to be copied rather than use the pointer value, leading to memory corruption. @@ -887,18 +887,18 @@ behavior is implemented in Racket; for example, accessors and mutators of the super-cstruct can be used with the new sub-cstruct. See the example below. -Providing a @scheme[super-id] is shorthand for using an initial field -named @scheme[super-id] and using @schemeidfont{_}@scheme[super-id] +Providing a @racket[super-id] is shorthand for using an initial field +named @racket[super-id] and using @racketidfont{_}@racket[super-id] as its type. Thus, the new struct will use -@schemeidfont{_}@scheme[super-id]'s tag in addition to its own tag, -meaning that instances of @scheme[_id] can be used as instances of -@schemeidfont{_}@scheme[super-id]. Aside from the syntactic sugar, +@racketidfont{_}@racket[super-id]'s tag in addition to its own tag, +meaning that instances of @racket[_id] can be used as instances of +@racketidfont{_}@racket[super-id]. Aside from the syntactic sugar, the constructor function is different when this syntax is used: instead of expecting a first argument that is an instance of -@schemeidfont{_}@scheme[super-id], the constructor will expect -arguments for each of @schemeidfont{_}@scheme[super-id]'s fields, in +@racketidfont{_}@racket[super-id], the constructor will expect +arguments for each of @racketidfont{_}@racket[super-id]'s fields, in addition for the new fields. This adjustment of the constructor is, -again, in analogy to using a supertype with @scheme[define-struct]. +again, in analogy to using a supertype with @racket[define-struct]. Note that structs are allocated as atomic blocks, which means that the garbage collector ignores their content. Thus, struct fields can hold @@ -933,72 +933,72 @@ As an example, consider the following C code: } } -Using the simple @scheme[_list-struct], you might expect this code to +Using the simple @racket[_list-struct], you might expect this code to work: -@schemeblock[ +@racketblock[ (define makeB (get-ffi-obj 'makeB "foo.so" (_fun -> (_list-struct (_list-struct _int _byte) _int)))) -(makeB) (code:comment @#,t{should return @scheme['((1 2) 3)]}) +(makeB) (code:comment @#,t{should return @racket['((1 2) 3)]}) ] The problem here is that @cpp{makeB} returns a pointer to the struct rather than the struct itself. The following works as expected: -@schemeblock[ +@racketblock[ (define makeB (get-ffi-obj 'makeB "foo.so" (_fun -> _pointer))) (ptr-ref (makeB) (_list-struct (_list-struct _int _byte) _int)) ] -As described above, @scheme[_list-struct]s should be used in cases where -efficiency is not an issue. We continue using @scheme[define-cstruct], first +As described above, @racket[_list-struct]s should be used in cases where +efficiency is not an issue. We continue using @racket[define-cstruct], first define a type for @cpp{A} which makes it possible to use @cpp{makeA}: -@schemeblock[ -(define-cstruct #,(schemeidfont "_A") ([x _int] [y _byte])) +@racketblock[ +(define-cstruct #,(racketidfont "_A") ([x _int] [y _byte])) (define makeA (get-ffi-obj 'makeA "foo.so" - (_fun -> #,(schemeidfont "_A-pointer")))) (code:comment @#,t{using @schemeidfont{_A} is a memory-corrupting bug!}) + (_fun -> #,(racketidfont "_A-pointer")))) (code:comment @#,t{using @racketidfont{_A} is a memory-corrupting bug!}) (define a (makeA)) (list a (A-x a) (A-y a)) -(code:comment @#,t{produces an @scheme[A] containing @scheme[1] and @scheme[2]}) +(code:comment @#,t{produces an @racket[A] containing @racket[1] and @racket[2]}) ] Using @cpp{gety} is also simple: -@schemeblock[ +@racketblock[ (define gety (get-ffi-obj 'gety "foo.so" - (_fun #,(schemeidfont "_A-pointer") -> _byte))) -(gety a) (code:comment @#,t{produces @scheme[2]}) + (_fun #,(racketidfont "_A-pointer") -> _byte))) +(gety a) (code:comment @#,t{produces @racket[2]}) ] We now define another C struct for @cpp{B}, and expose @cpp{makeB} using it: -@schemeblock[ -(define-cstruct #,(schemeidfont "_B") ([a #,(schemeidfont "_A")] [z _int])) +@racketblock[ +(define-cstruct #,(racketidfont "_B") ([a #,(racketidfont "_A")] [z _int])) (define makeB (get-ffi-obj 'makeB "foo.so" - (_fun -> #,(schemeidfont "_B-pointer")))) + (_fun -> #,(racketidfont "_B-pointer")))) (define b (makeB)) ] -We can access all values of @scheme[b] using a naive approach: +We can access all values of @racket[b] using a naive approach: -@schemeblock[ +@racketblock[ (list (A-x (B-a b)) (A-y (B-a b)) (B-z b)) ] but this is inefficient as it allocates and copies an instance of -@cpp{A} on every access. Inspecting the tags @scheme[(cpointer-tag +@cpp{A} on every access. Inspecting the tags @racket[(cpointer-tag b)] we can see that @cpp{A}'s tag is included, so we can simply use its accessors and mutators, as well as any function that is defined to take an @cpp{A} pointer: -@schemeblock[ +@racketblock[ (list (A-x b) (A-y b) (B-z b)) (gety b) ] @@ -1006,16 +1006,16 @@ take an @cpp{A} pointer: Constructing a @cpp{B} instance in Racket requires allocating a temporary @cpp{A} struct: -@schemeblock[ +@racketblock[ (define b (make-B (make-A 1 2) 3)) ] To make this more efficient, we switch to the alternative -@scheme[define-cstruct] syntax, which creates a constructor that +@racket[define-cstruct] syntax, which creates a constructor that expects arguments for both the super fields and the new ones: -@schemeblock[ - (define-cstruct (#,(schemeidfont "_B") #,(schemeidfont "_A")) ([z _int])) +@racketblock[ + (define-cstruct (#,(racketidfont "_B") #,(racketidfont "_A")) ([z _int])) (define b (make-B 1 2 3)) ]} @@ -1034,18 +1034,18 @@ where the syntactic context implies one. ctype?]{ Takes a list of symbols and generates an enumeration type. The -enumeration maps between a symbol in the given @scheme[symbols] list and -corresponding integers, counting from @scheme[0]. +enumeration maps between a symbol in the given @racket[symbols] list and +corresponding integers, counting from @racket[0]. -The list @scheme[symbols] can also set the values of symbols by -putting @scheme['=] and an exact integer after the symbol. For -example, the list @scheme['(x y = 10 z)] maps @scheme['x] to -@scheme[0], @scheme['y] to @scheme[10], and @scheme['z] to -@scheme[11]. +The list @racket[symbols] can also set the values of symbols by +putting @racket['=] and an exact integer after the symbol. For +example, the list @racket['(x y = 10 z)] maps @racket['x] to +@racket[0], @racket['y] to @racket[10], and @racket['z] to +@racket[11]. -The @scheme[basetype] argument specifies the base type to use. +The @racket[basetype] argument specifies the base type to use. -The @scheme[unknown] argument specifies the result of converting an +The @racket[unknown] argument specifies the result of converting an unknown integer from the foreign side: it can be a one-argument function to be applied on the integer, or a value to return instead. The default is to throw an exception.} @@ -1053,8 +1053,8 @@ is to throw an exception.} @defproc[(_bitmask [symbols (or symbol? list?)] [basetype ctype? _uint]) ctype?]{ -Similar to @scheme[_enum], but the resulting mapping translates a list -of symbols to a number and back, using @scheme[bitwise-ior]. A single +Similar to @racket[_enum], but the resulting mapping translates a list +of symbols to a number and back, using @racket[bitwise-ior]. A single symbol is equivalent to a list containing just the symbol. The -default @scheme[basetype] is @scheme[_uint], since high bits are often +default @racket[basetype] is @racket[_uint], since high bits are often used for flags.} diff --git a/collects/scribblings/foreign/unexported.scrbl b/collects/scribblings/foreign/unexported.scrbl index ecec829654..f1130c2172 100644 --- a/collects/scribblings/foreign/unexported.scrbl +++ b/collects/scribblings/foreign/unexported.scrbl @@ -9,9 +9,9 @@ @declare-exporting['#%foreign] -Parts of the @schememodname[ffi/unsafe] library are implemented by -the Racket built-in @schememodname['#%foreign] module. The -@schememodname['#%foreign] module is not intended for direct use, but +Parts of the @racketmodname[ffi/unsafe] library are implemented by +the Racket built-in @racketmodname['#%foreign] module. The +@racketmodname['#%foreign] module is not intended for direct use, but it exports the following procedures. If you find any of these useful, please let us know. @@ -21,7 +21,7 @@ please let us know. Pulls out a foreign object from a library, returning a Racket value that can be used as a pointer. If a name is provided instead of a -foreign-library value, @scheme[ffi-lib] is used to create a library +foreign-library value, @racket[ffi-lib] is used to create a library object.} @@ -29,7 +29,7 @@ object.} [(ffi-obj-lib [obj ffi-obj?]) ffi-lib?] [(ffi-obj-name [obj ffi-obj?]) string?])]{ -A predicate for objects returned by @scheme[ffi-obj], and accessor +A predicate for objects returned by @racket[ffi-obj], and accessor functions that return its corresponding library object and name. These values can also be used as C pointer objects.} @@ -39,7 +39,7 @@ These values can also be used as C pointer objects.} [(ctype-c->scheme [type ctype?]) procedure?])]{ Accessors for the components of a C type object, made by -@scheme[make-ctype]. The @scheme[ctype-basetype] selector returns a +@racket[make-ctype]. The @racket[ctype-basetype] selector returns a symbol for primitive types that names the type, a list of ctypes for cstructs, and another ctype for user-defined ctypes.} @@ -49,16 +49,16 @@ cstructs, and another ctype for user-defined ctypes.} any]{ The primitive mechanism that creates Racket ``callout'' values. The -given @scheme[ptr] (any pointer value, including @scheme[ffi-obj] +given @racket[ptr] (any pointer value, including @racket[ffi-obj] values) is wrapped in a Racket-callable primitive function that uses the types to specify how values are marshaled. -The optional @scheme[abi] argument determines the foreign ABI that is -used. @scheme[#f] or @scheme['default] will use a platform-dependent -default; other possible values are @scheme['stdcall] and -@scheme['sysv] (the latter corresponds to ``cdecl''). This is +The optional @racket[abi] argument determines the foreign ABI that is +used. @racket[#f] or @racket['default] will use a platform-dependent +default; other possible values are @racket['stdcall] and +@racket['sysv] (the latter corresponds to ``cdecl''). This is especially important on Windows, where most system functions are -@scheme['stdcall], which is not the default.} +@racket['stdcall], which is not the default.} @defproc[(ffi-callback [proc any/c] [in-types any/c] [out-type any/c] @@ -66,14 +66,14 @@ especially important on Windows, where most system functions are [atomic? any/c #f]) ffi-callback?]{ -The symmetric counterpart of @scheme[ffi-call]. It receives a Racket +The symmetric counterpart of @racket[ffi-call]. It receives a Racket procedure and creates a callback object, which can also be used as a pointer. This object can be used as a C-callable function, which -invokes @scheme[proc] using the types to specify how values are +invokes @racket[proc] using the types to specify how values are marshaled.} @defproc[(ffi-callback? [x any/c]) boolean?]{ -A predicate for callback values that are created by @scheme[ffi-callback]. +A predicate for callback values that are created by @racket[ffi-callback]. } diff --git a/collects/scribblings/foreign/vector.scrbl b/collects/scribblings/foreign/vector.scrbl index 5e62b57732..832b4b26b1 100644 --- a/collects/scribblings/foreign/vector.scrbl +++ b/collects/scribblings/foreign/vector.scrbl @@ -8,8 +8,8 @@ Homogenous vectors are similar to C vectors (see @secref["foreign:cvector"]), except that they define different types of vectors, each with a hard-wired type. An exception is the -@schemeidfont{u8} family of bindings, which are just aliases for -byte-string bindings; for example, @scheme[make-u8vector] is an alias +@racketidfont{u8} family of bindings, which are just aliases for +byte-string bindings; for example, @racket[make-u8vector] is an alias for @racket[make-bytes]. @(begin @@ -95,8 +95,8 @@ for @racket[make-bytes]. @srfi-4-vector/desc[u8 _uint8 (lambda (x) (make-splice null))]{ -Like @scheme[_cvector], but for vectors of @scheme[_byte] elements. These are -aliases for @schemeidfont{byte} operations, where @racket[u8vector->cpointer] +Like @racket[_cvector], but for vectors of @racket[_byte] elements. These are +aliases for @racketidfont{byte} operations, where @racket[u8vector->cpointer] is the identity function.} @srfi-4-vector[s8 _int8] diff --git a/collects/scribblings/framework/autosave.scrbl b/collects/scribblings/framework/autosave.scrbl index 167ac8cd72..47bdd51012 100644 --- a/collects/scribblings/framework/autosave.scrbl +++ b/collects/scribblings/framework/autosave.scrbl @@ -8,7 +8,7 @@ Classes that implement this interface can be autosaved. @defmethod*[(((do-autosave) void?))]{ This method is called when the object is registered to be - autosaved (see @scheme[autosave:register]). + autosaved (see @racket[autosave:register]). } } diff --git a/collects/scribblings/framework/canvas.scrbl b/collects/scribblings/framework/canvas.scrbl index fbb9f4af42..8de31c8637 100644 --- a/collects/scribblings/framework/canvas.scrbl +++ b/collects/scribblings/framework/canvas.scrbl @@ -14,7 +14,7 @@ Mixins that implement this interface initialize the background color of the canvas to the value of the @index{'framework:basic-canvas-background} - @scheme['framework:basic-canvas-background] preference. + @racket['framework:basic-canvas-background] preference. Adds a callback so that when that preference is modified, the background color changes. @@ -26,7 +26,7 @@ } @defmixin[canvas:delegate-mixin (canvas:basic<%>) (canvas:delegate<%>)]{ Provides an implementation of - @scheme[canvas:delegate<%>]. + @racket[canvas:delegate<%>]. @defmethod*[#:mode override (((on-superwindow-show (shown? boolean?)) void?))]{ Notifies the delegate window when the original window is @@ -51,7 +51,7 @@ } @definterface[canvas:wide-snip<%> (canvas:basic<%>)]{ Any - @scheme[canvas%] + @racket[canvas%] that matches this interface will automatically resize selected snips when its size changes. Use @method[canvas:wide-snip<%> add-tall-snip] @@ -66,14 +66,11 @@ Snips passed to this method will be resized when the canvas's size changes. Their width will be set so they take up all of the space from their lefts to the right edge of the canvas. - - } @defmethod*[(((add-tall-snip (snip (is-a?/c snip%))) void?))]{ Snips passed to this method will be resized when the canvas's size changes. Their height will be set so they take up all of the space from their tops to the bottom of the canvas. - } } @defmixin[canvas:wide-snip-mixin (canvas:basic<%>) (canvas:wide-snip<%>)]{ diff --git a/collects/scribblings/framework/color.scrbl b/collects/scribblings/framework/color.scrbl index f6b2502133..067c6bb05b 100644 --- a/collects/scribblings/framework/color.scrbl +++ b/collects/scribblings/framework/color.scrbl @@ -28,99 +28,93 @@ (pairs (listof (list/c symbol? symbol?)))) void?))]{ Starts tokenizing the buffer for coloring and parenthesis matching. - The @scheme[token-sym->style] argument will be passed the first return symbol from @scheme[get-token], - and it should return the style-name that the token should be colored. + The @racket[token-sym->style] argument will be passed the first return + symbol from @racket[get-token], and it should return the style-name that + the token should be colored. - The @scheme[get-token] argument takes an input port and optionally an offset and mode value. - When it accepts just an input port, @scheme[get-token] returns the next token as 5 values: + The @racket[get-token] argument takes an input port and optionally an + offset and mode value. When it accepts just an input port, + @racket[get-token] returns the next token as 5 values: @itemize[ - @item{ - An unused value. This value is intended to represent the textual - component of the token and may be used as such in the future.} - @item{ - A symbol describing the type of the token. This symbol is transformed - into a style-name via the @scheme[token-sym->style] argument. The symbols - @scheme['white-space] and @scheme['comment] have special meaning and should always be - returned for white space and comment tokens respectively. The symbol - @scheme['no-color] can be used to indicate that although the token is not white - space, it should not be colored. The symbol @scheme['eof] must be used to - indicate when all the tokens have been consumed.} - @item{ - A symbol indicating how the token should be treated by the paren - matcher or @scheme[#f]. This symbol should be in the pairs argument.} - @item{ - The starting position of the token (or @scheme[#f] if eof).} - @item{ - The ending position of the token (or @scheme[#f] if eof).}] + @item{An unused value. This value is intended to represent the textual + component of the token and may be used as such in the future.} + @item{A symbol describing the type of the token. This symbol is + transformed into a style-name via the @racket[token-sym->style] argument. + The symbols @racket['white-space] and @racket['comment] have special + meaning and should always be returned for white space and comment tokens + respectively. The symbol @racket['no-color] can be used to indicate that + although the token is not white space, it should not be colored. The + symbol @racket['eof] must be used to indicate when all the tokens have + been consumed.} + @item{A symbol indicating how the token should be treated by the paren + matcher or @racket[#f]. This symbol should be in the pairs argument.} + @item{The starting position of the token (or @racket[#f] if eof).} + @item{The ending position of the token (or @racket[#f] if eof).}] - When @scheme[get-token] accepts an offset and mode value in addition to an + When @racket[get-token] accepts an offset and mode value in addition to an input port, it must also return two extra results, which are a backup - distance and new mode. The offset given to @scheme[get-token] can be added - to the position of the input port to obtain absolute coordinates within a - text stream. The mode argument allows @scheme[get-token] to communicate information - from earlier parsing to later. - When @scheme[get-token] is called for the beginning on a - stream, the mode argument is @scheme[#f]; thereafter, the mode - returned for the previous token is provided to @scheme[get-token] - for the next token. The mode should not be a mutable value; if - part of the stream is re-tokenized, the mode saved from the - immediately preceding token is given again to the - @scheme[get-token] function. The backup distance returned by @scheme[get-token] - indicates the maximum number of characters to back up (counting from the start of the token) - and for re-parsing after a change to the editor within the token's region. + distance and new mode. The offset given to @racket[get-token] can be added + to the position of the input port to obtain absolute coordinates within a + text stream. The mode argument allows @racket[get-token] to communicate + information from earlier parsing to later. When @racket[get-token] is + called for the beginning on a stream, the mode argument is @racket[#f]; + thereafter, the mode returned for the previous token is provided to + @racket[get-token] for the next token. The mode should not be a mutable + value; if part of the stream is re-tokenized, the mode saved from the + immediately preceding token is given again to the @racket[get-token] + function. The backup distance returned by @racket[get-token] indicates the + maximum number of characters to back up (counting from the start of the + token) and for re-parsing after a change to the editor within the token's + region. - The @scheme[get-token] function is usually be implemented with a lexer using the - @scheme[parser-tools/lex] library. The - @scheme[get-token] function must obey the following invariants: + The @racket[get-token] function is usually be implemented with a lexer using the + @racket[parser-tools/lex] library. The + @racket[get-token] function must obey the following invariants: @itemize[ - @item{ - Every position in the buffer must be accounted for in exactly one - token, and every token must have a non-zero width.} - @item{ - The token returned by @scheme[get-token] must rely only on the contents of the - input port argument plus the mode argument. This constraint means that the - tokenization of some part of the input cannot depend on earlier parts of the - input except through the mode (and implicitly through the starting positions - for tokens).} - @item{ - A change to the stream must not change the tokenization of the stream prior - to the token immediately preceding the change plus the backup distance. In the following - example, this invariant does not hold for a zero backup distance: If the buffer contains - @verbatim[#:indent 2]{" 1 2 3} - and the tokenizer treats the unmatched " as its own token (a string - error token), and separately tokenizes the 1 2 and 3, an edit to make - the buffer look like - @verbatim[#:indent 2]{" 1 2 3"} - would result in a single string token modifying previous tokens. To - handle these situations, @scheme[get-token] can treat the first line as a - single token, or it can precisely track backup distances.}] + @item{Every position in the buffer must be accounted for in exactly one + token, and every token must have a non-zero width.} + @item{The token returned by @racket[get-token] must rely only on the + contents of the input port argument plus the mode argument. This + constraint means that the tokenization of some part of the input cannot + depend on earlier parts of the input except through the mode (and + implicitly through the starting positions for tokens).} + @item{A change to the stream must not change the tokenization of the + stream prior to the token immediately preceding the change plus the + backup distance. In the following example, this invariant does not hold + for a zero backup distance: If the buffer contains + @verbatim[#:indent 2]{" 1 2 3} + and the tokenizer treats the unmatched " as its own token (a string error + token), and separately tokenizes the 1 2 and 3, an edit to make the + buffer look like + @verbatim[#:indent 2]{" 1 2 3"} + would result in a single string token modifying previous tokens. To + handle these situations, @racket[get-token] can treat the first line as a + single token, or it can precisely track backup distances.}] - The @scheme[pairs] argument is a list of different kinds of matching parens. The second - value returned by @scheme[get-token] is compared to this list to see how the - paren matcher should treat the token. An example: Suppose pairs is - @scheme['((|(| |)|) (|[| |]|) (begin end))]. This means that there - are three kinds of parens. Any token which has @scheme['begin] as its second - return value will act as an open for matching tokens with @scheme['end]. - Similarly any token with @scheme['|]|] will act as a closing match for - tokens with @scheme['|[|]. When trying to correct a mismatched - closing parenthesis, each closing symbol in pairs will be converted to - a string and tried as a closing parenthesis. + The @racket[pairs] argument is a list of different kinds of matching + parens. The second value returned by @racket[get-token] is compared to + this list to see how the paren matcher should treat the token. An example: + Suppose pairs is @racket['((|(| |)|) (|[| |]|) (begin end))]. This means + that there are three kinds of parens. Any token which has @racket['begin] + as its second return value will act as an open for matching tokens with + @racket['end]. Similarly any token with @racket['|]|] will act as a + closing match for tokens with @racket['|[|]. When trying to correct a + mismatched closing parenthesis, each closing symbol in pairs will be + converted to a string and tried as a closing parenthesis. } @defmethod*[(((stop-colorer (clear-colors boolean? #t)) void?))]{ Stops coloring and paren matching the buffer. - - If @scheme[clear-colors] is true all the text in the buffer will have its + If @racket[clear-colors] is true all the text in the buffer will have its style set to Standard. } @defmethod*[(((force-stop-colorer (stop? boolean?)) void?))]{ Causes the entire tokenizing/coloring system to become inactive. Intended for debugging purposes only. - - @scheme[stop?] determines whether the system is being forced to stop or allowed - to wake back up. + @racket[stop?] determines whether the system is being forced to stop or + allowed to wake back up. } @defmethod*[(((is-stopped?) boolean?))]{ Indicates if the colorer for this editor has been stopped, or not. @@ -136,21 +130,20 @@ @defmethod*[(((freeze-colorer) void?))]{ Keep the text tokenized and paren matched, but stop altering the colors. - @scheme[freeze-colorer] will not return until the coloring/tokenization of the - entire text is brought up-to-date. It must not be called on a locked + @racket[freeze-colorer] will not return until the coloring/tokenization of + the entire text is brought up-to-date. It must not be called on a locked text. } @defmethod*[(((thaw-colorer (recolor boolean? #t) (retokenize boolean? #f)) void?))]{ Start coloring a frozen buffer again. - - If @scheme[recolor?] is @scheme[#t], the text is re-colored. If it is - @scheme[#f] the text is not recolored. When @scheme[recolor?] is @scheme[#t], - @scheme[retokenize?] controls how the text is recolored. @scheme[#f] causes - the text to be entirely re-colored before thaw-colorer returns using - the existing tokenization. @scheme[#t] causes the entire text to be - retokenized and recolored from scratch. This will happen in the - background after the call to @scheme[thaw-colorer] returns. + If @racket[recolor?] is @racket[#t], the text is re-colored. If it is + @racket[#f] the text is not recolored. When @racket[recolor?] is + @racket[#t], @racket[retokenize?] controls how the text is recolored. + @racket[#f] causes the text to be entirely re-colored before thaw-colorer + returns using the existing tokenization. @racket[#t] causes the entire + text to be retokenized and recolored from scratch. This will happen in the + background after the call to @racket[thaw-colorer] returns. } @defmethod*[(((reset-region (start natural-number/c) (end (or/c (quote end) natural-number/c))) void?))]{ @@ -159,90 +152,92 @@ } @defmethod*[(((reset-regions (regions (listof (list/c number? (or/c (quote end) number?))))) void?))]{ - Sets the currently active regions to be @scheme[regions]. + Sets the currently active regions to be @racket[regions]. } @defmethod*[(((get-regions) (listof (list/c number? (or/c (quote end) number?)))))]{ - This returns the list of regions that are currently being colored in the editor. + This returns the list of regions that are currently being colored in the + editor. } @defmethod*[(((skip-whitespace (position natural-number/c) (direction (symbols (quote forward) (quote backward))) (comments? boolean?)) natural-number/c))]{ Returns the next non-whitespace character. - Starts from position and skips whitespace in the direction indicated - by direction. If @scheme[comments?] is true, comments are skipped as well as + Starts from position and skips whitespace in the direction indicated by + direction. If @racket[comments?] is true, comments are skipped as well as whitespace. skip-whitespace determines whitespaces and comments by - comparing the token type to @scheme['white-space] and @scheme['comment]. + comparing the token type to @racket['white-space] and @racket['comment]. Must only be called while the tokenizer is started. } @defmethod*[(((backward-match (position natural-number/c) (cutoff natural-number/c)) (or/c natural-number/c false?)))]{ - Skip all consecutive whitespaces and comments (using @scheme[skip-whitespace]) - immediately preceding the position. If the token at this position is - a close, return the position of the matching open, or @scheme[#f] if - there is none. If the token was an open, return @scheme[#f]. For any - other token, return the start of that token. + Skip all consecutive whitespaces and comments (using + @racket[skip-whitespace]) immediately preceding the position. If the token + at this position is a close, return the position of the matching open, or + @racket[#f] if there is none. If the token was an open, return + @racket[#f]. For any other token, return the start of that token. Must only be called while the tokenizer is started. } @defmethod*[(((backward-containing-sexp (position natural-number/c) (cutoff natural-number/c)) (or/c natural-number/c false?)))]{ Return the starting position of the interior of the (non-atomic) - s-expression containing position, or @scheme[#f] is there is none. + s-expression containing position, or @racket[#f] is there is none. Must only be called while the tokenizer is started. } @defmethod*[(((forward-match (position natural-number/c) (cutoff natural-number/c)) (or/c natural-number/c false?)))]{ - Skip all consecutive whitespaces and comments (using @scheme[skip-whitespace]) - immediately following position. If the token at this position is an - open, return the position of the matching close, or @scheme[#f] if - there is none. For any other token, return the end of that token. + Skip all consecutive whitespaces and comments (using + @racket[skip-whitespace]) immediately following position. If the token at + this position is an open, return the position of the matching close, or + @racket[#f] if there is none. For any other token, return the end of that + token. Must only be called while the tokenizer is started. } @defmethod*[(((insert-close-paren (position natural-number/c) (char char?) (flash? boolean?) (fixup? boolean?)) void?))]{ - The @scheme[position] is the place to put the parenthesis, and @scheme[char] is the - parenthesis to be added (e.g., that the user typed). If @scheme[fixup?] is true, the right kind of closing - parenthesis will be chosen from the set previously passed to - @scheme[start-colorer]---but only if an inserted @scheme[char] would be colored - as a parenthesis (i.e., with the @scheme['parenthesis] classification). - Otherwise, @scheme[char] will be inserted, even if it is not the - right kind. If @scheme[flash?] is true, the matching open parenthesis will be - flashed. + The @racket[position] is the place to put the parenthesis, and + @racket[char] is the parenthesis to be added (e.g., that the user typed). + If @racket[fixup?] is true, the right kind of closing parenthesis will be + chosen from the set previously passed to @racket[start-colorer]---but only + if an inserted @racket[char] would be colored as a parenthesis (i.e., with + the @racket['parenthesis] classification). Otherwise, @racket[char] will + be inserted, even if it is not the right kind. If @racket[flash?] is true, + the matching open parenthesis will be flashed. } @defmethod*[(((classify-position (position exact-nonnegative-integer?)) symbol?))]{ - Return a symbol for the lexer-determined token type for the token that - contains the item after @scheme[position]. + contains the item after @racket[position]. Must only be called while the tokenizer is started. } - + @defmethod[(get-token-range [position exact-nonnegative-integer?]) (values (or/c #f exact-nonnegative-integer?) (or/c #f exact-nonnegative-integer?))]{ - - Returns the range of the token surrounding @racket[position], if there is a token there. - + + Returns the range of the token surrounding @racket[position], if there is a + token there. + This method must be called only when the tokenizer is started. - } - + @defmethod[#:mode augment (on-lexer-valid [valid? boolean?]) any]{ - This method is an observer for when the lexer is working. - It is called when the lexer's state changes from valid to invalid (and back). - The @racket[valid?] argument indicates if the lexer has finished running over the editor (or not). - + This method is an observer for when the lexer is working. It is called + when the lexer's state changes from valid to invalid (and back). The + @racket[valid?] argument indicates if the lexer has finished running over + the editor (or not). + The default method just returns @racket[(void?)]. } - + @defmethod[#:mode public-final (is-lexer-valid?) boolean?]{ Indicates if the lexer is currently valid for this editor. } - + } @defmixin[color:text-mixin (text:basic<%>) (color:text<%>)]{ Adds the functionality needed for on-the-fly coloring and parenthesis diff --git a/collects/scribblings/framework/comment-box.scrbl b/collects/scribblings/framework/comment-box.scrbl index cc8ac3af47..946ebe2199 100644 --- a/collects/scribblings/framework/comment-box.scrbl +++ b/collects/scribblings/framework/comment-box.scrbl @@ -9,40 +9,26 @@ DrRacket. @defmethod*[#:mode override (((make-editor) (is-a?/c text%)))]{ + Makes an instance of + @racketblock[(scheme:text-mixin text:keymap%)]} - Makes an instance of - @schemeblock[ - (scheme:text-mixin text:keymap%)] - - } @defmethod*[#:mode override (((make-snip) (is-a?/c comment-snip%)))]{ + Returns an instance of the @racket[comment-snip%] class.} - Returns an instance of the - @scheme[comment-snip%] - class. - } @defmethod*[#:mode override (((get-corner-bitmap) (is-a?/c bitmap%)))]{ - Returns the semicolon bitmap from the file - @schemeblock[ - (build-path (collection-path "icons") "semicolon.gif")] + @racketblock[(build-path (collection-path "icons") "semicolon.gif")]} - } @defmethod*[#:mode override (((get-position) (symbols (quote left-top) (quote top-right))))]{ + Returns @racket['left-top]} - Returns @scheme['left-top] - } @defmethod*[#:mode override (((get-text) string))]{ - Returns the same string as the super method, but with - newlines replaced by newline-semicolon-space. - } + newlines replaced by newline-semicolon-space.} + @defmethod*[#:mode override (((get-menu) (is-a?/c popup-menu%)))]{ - Returns a menu with a single item to change the box into - semicolon comments. - - } + semicolon comments.} } @(include-previously-extracted "main-extracts.rkt" #rx"^comment-box:") diff --git a/collects/scribblings/framework/editor-snip.scrbl b/collects/scribblings/framework/editor-snip.scrbl index d3146d76ec..ca17c3a850 100644 --- a/collects/scribblings/framework/editor-snip.scrbl +++ b/collects/scribblings/framework/editor-snip.scrbl @@ -16,8 +16,8 @@ } @defmethod[(get-position) (symbols 'top-right 'left-top)]{ Returns the location of the image and the clickable - region. The symbol @scheme['top-right] indicates top portion is clickable - and icon on right. The symbol @scheme['left-top] means left portion is + region. The symbol @racket['top-right] indicates top portion is clickable + and icon on right. The symbol @racket['left-top] means left portion is clickable and icon on top. } @defmethod[(reset-min-sizes) void?]{ @@ -29,25 +29,25 @@ @defmixin[editor-snip:decorated-mixin (editor-snip%) (editor-snip:decorated<%>)]{ @defmethod[(get-corner-bitmap) (or/c false/c (is-a?/c bitmap%))]{ - Returns @scheme[#f]. + Returns @racket[#f]. } @defmethod[(get-color) (or/c string? (is-a?/c color%))]{ - Returns @schemeblock[ + Returns @racketblock[ (if (preferences:get 'framework:white-on-black?) "white" "black")] } @defmethod[(get-menu) (or/c false/c (is-a?/c popup-menu%))]{ - Returns @scheme[#f]. + Returns @racket[#f]. } @defmethod[(get-position) (symbols 'top-right 'left-top)]{ - Returns @scheme['top-right]. + Returns @racket['top-right]. } } @defclass[editor-snip:decorated% (editor-snip:decorated-mixin editor-snip%) ()]{ @defconstructor/auto-super[()]{ - Invokes the super constructor with the keyword @scheme[editor] as a call to + Invokes the super constructor with the keyword @racket[editor] as a call to @method[editor-snip:decorated% make-editor]. } @@ -64,7 +64,7 @@ Uses the @method[editor-snip:decorated% make-editor] and @method[editor-snip:decorated% make-snip] methods to create a copy of this snip, as follows: - @schememod[ + @racketmod[ (let ([snip (make-snip)]) (send snip set-editor (send (get-editor) copy-self)) (send snip set-style (get-style)) @@ -74,13 +74,13 @@ @defclass[editor-snip:decorated-snipclass% snip-class% ()]{ @defmethod[(make-snip [stream-in (is-a?/c editor-stream-in%)]) (is-a?/c editor-snip:decorated<%>)]{ - Returns an instance of @scheme[editor-snip:decorated%]. + Returns an instance of @racket[editor-snip:decorated%]. } @defmethod[(read [stream-in (is-a?/c editor-stream-in%)]) (is-a?/c editor-snip:decorated<%>)]{ Calls @method[editor-snip:decorated-snipclass% make-snip] to get an object and - then invokes its @scheme[editor<%>]'s @method[editor<%> read-from-file] method - in order to read a snip from @scheme[stream-in], eg: - @schemeblock[ + then invokes its @racket[editor<%>]'s @method[editor<%> read-from-file] method + in order to read a snip from @racket[stream-in], eg: + @racketblock[ (let ([snip (make-snip stream-in)]) (send (send snip get-editor) read-from-file stream-in #f) snip) diff --git a/collects/scribblings/framework/editor.scrbl b/collects/scribblings/framework/editor.scrbl index bcfce271a8..0eecdae442 100644 --- a/collects/scribblings/framework/editor.scrbl +++ b/collects/scribblings/framework/editor.scrbl @@ -6,10 +6,10 @@ @definterface[editor:basic<%> (editor<%>)]{ Classes matching this interface support the basic - @scheme[editor<%>] + @racket[editor<%>] functionality required by the framework. @defmethod*[(((has-focus?) boolean?))]{ - This function returns @scheme[#t] when the editor has the keyboard + This function returns @racket[#t] when the editor has the keyboard focus. It is implemented using: @method[editor<%> on-focus] @@ -30,11 +30,11 @@ edit-sequence completes. - The procedure @scheme[thunk] will be called immediately if the edit is + The procedure @racket[thunk] will be called immediately if the edit is not in an edit-sequence. If the edit is in an edit-sequence, it will be called when the edit-sequence completes. - If @scheme[tag] is a symbol, the @scheme[thunk] is keyed on that symbol, and + If @racket[tag] is a symbol, the @racket[thunk] is keyed on that symbol, and only one thunk per symbol will be called after the edit-sequence. Specifically, the last call to @method[editor:basic<%> run-after-edit-sequence]'s argument will be called. @@ -42,7 +42,7 @@ } @defmethod*[(((get-top-level-window) (or/c #f (is-a?/c top-level-window<%>))))]{ Returns the - @scheme[top-level-window<%>] + @racket[top-level-window<%>] currently associated with this buffer. This does not work for embedded editors. @@ -50,7 +50,7 @@ } @defmethod*[(((save-file-out-of-date?) boolean?))]{ - Returns @scheme[#t] if the file on disk has been modified, by some other program. + Returns @racket[#t] if the file on disk has been modified, by some other program. } @defmethod*[(((save-file/gui-error (filename (or/c path? #f) #f) (format (or/c (quote guess) (quote standard) (quote text) (quote text-force-cr) (quote same) (quote copy)) (quote same)) (show-errors? boolean? #t)) boolean?))]{ @@ -59,8 +59,8 @@ opens a dialog with an error message showing the error. The result indicates if an error happened (the error has - already been shown to the user). It returns @scheme[#t] if - no error occurred and @scheme[#f] if an error occurred. + already been shown to the user). It returns @racket[#t] if + no error occurred and @racket[#f] if an error occurred. } @defmethod*[(((load-file/gui-error (filename (or/c string? #f) #f) (format (or/c (quote guess) (quote standard) (quote text) (quote text-force-cr) (quote same) (quote copy)) (quote guess)) (show-errors? boolean? #t)) boolean?))]{ @@ -69,8 +69,8 @@ opens a dialog with an error message showing the error. The result indicates if an error happened (the error has - already been shown to the user). It returns @scheme[#t] if - no error occurred and @scheme[#f] if an error occurred. + already been shown to the user). It returns @racket[#t] if + no error occurred and @racket[#f] if an error occurred. } @defmethod*[(((on-close) void?))]{ @@ -81,13 +81,9 @@ editor is considered ``closed'' before the frame it is in is closed (e.g., when a tab in DrRacket is closed), and thus @method[editor:basic<%> on-close] will be called at that point. - - - See also - @method[editor:basic<%> can-close?] - and - @method[editor:basic<%> close]. + See also @method[editor:basic<%> can-close?] and @method[editor:basic<%> + close]. Does nothing. } @@ -103,11 +99,11 @@ @method[editor:basic<%> close]. - Returns @scheme[#t]. + Returns @racket[#t]. } @defmethod*[(((close) boolean?))]{ This method is merely - @schemeblock[ + @racketblock[ (if (can-close?) (begin (on-close) #t) #f)] @@ -117,27 +113,25 @@ @method[editor:basic<%> can-close?] and @method[editor:basic<%> on-close]. - } @defmethod*[(((get-filename/untitled-name) string?))]{ Returns the printed version of the filename for this editor. If the editor doesn't yet have a filename, it returns a symbolic name (something like "Untitled"). - } @defmethod[(get-pos/text [event (is-a?/c mouse-event%)]) (values (or/c false/c number?) (or/c false/c (is-a?/c editor<%>)))]{ - This method's first result is @scheme[#f] when the mouse + This method's first result is @racket[#f] when the mouse event does not correspond to a location in the editor. - - If the second result is a @scheme[text%] object, then the - first result will be a position in the editor and - otherwise the first result will be @scheme[#f]. - The @scheme[editor<%>] object will always be the nearest + If the second result is a @racket[text%] object, then the + first result will be a position in the editor and + otherwise the first result will be @racket[#f]. + + The @racket[editor<%>] object will always be the nearest enclosing editor containing the mouse click. } } @@ -149,11 +143,11 @@ mixin's argument. Each instance of a class created with this mixin contains a private - @scheme[keymap%] that is chained to the global keymap via: - @scheme[(send keymap chain-to-keymap (keymap:get-global) #f)]. + @racket[keymap%] that is chained to the global keymap via: + @racket[(send keymap chain-to-keymap (keymap:get-global) #f)]. - This installs the global keymap @scheme[keymap:get-global] to - handle keyboard and mouse mappings not handled by @scheme[keymap]. The + This installs the global keymap @racket[keymap:get-global] to + handle keyboard and mouse mappings not handled by @racket[keymap]. The global keymap is created when the framework is invoked. @defmethod*[#:mode augment (((can-save-file? (filename string?) (format symbol?)) boolean?))]{ @@ -166,7 +160,7 @@ @defmethod*[#:mode augment (((after-save-file (success? boolean?)) void?))]{ If the current filename is not a temporary filename, this method calls - @scheme[handler:add-to-recent]with the current filename. + @racket[handler:add-to-recent]with the current filename. to add the new filename to the list of recently opened files. @@ -189,7 +183,7 @@ } @defmethod*[#:mode augment (((on-edit-sequence) boolean?))]{ - Always returns @scheme[#t]. Updates a flag for + Always returns @racket[#t]. Updates a flag for @method[editor:basic<%> local-edit-sequence?] } @defmethod*[#:mode augment (((after-edit-sequence) void?))]{ @@ -200,21 +194,21 @@ @defmethod*[#:mode override (((on-new-box (type (or/c (quote pasteboard) (quote text)))) (is-a?/c editor-snip%)))]{ Creates instances of - @scheme[pasteboard:basic%] + @racket[pasteboard:basic%] or - @scheme[text:basic%] + @racket[text:basic%] instead of the built in - @scheme[pasteboard%] + @racket[pasteboard%] and - @scheme[text%] - classes. + @racket[text%] + classes. } @defmethod[#:mode override (on-new-image-snip [filename (or/c path? false/c)] - [kind (one-of/c 'unknown 'gif 'jpeg 'xbm 'xpm 'bmp 'pict)] + [kind (one-of/c 'unknown 'gif 'jpeg 'xbm 'xpm 'bmp 'pict)] [relative-path? any/c] [inline? any/c]) (is-a?/c image-snip%)]{ - @schemeblock[ + @racketblock[ (super on-new-image-snip (if (eq? kind 'unknown) 'unknown/mask kind) relative-path? @@ -224,25 +218,25 @@ @defmethod*[#:mode override (((get-file (directory (or/c path-string? false/c))) string))]{ Uses - @scheme[finder:get-file] + @racket[finder:get-file] to find a filename. Also, sets the parameter - @scheme[finder:dialog-parent-parameter] + @racket[finder:dialog-parent-parameter] to the result of @method[editor:basic<%> get-top-level-window]. } @defmethod*[#:mode override (((put-file (directory (or/c path? false/c)) (default-name (or/c path? false/c))) string))]{ Uses - @scheme[finder:put-file] + @racket[finder:put-file] to find a filename. Also, sets the parameter - @scheme[finder:dialog-parent-parameter] + @racket[finder:dialog-parent-parameter] to the result of @method[editor:basic<%> get-top-level-window]. } } @definterface[editor:standard-style-list<%> (editor<%>)]{ This interface is implemented by the results of - @scheme[editor:standard-style-list-mixin]. + @racket[editor:standard-style-list-mixin]. } @defmixin[editor:standard-style-list-mixin (editor<%>) (editor:standard-style-list<%>)]{ The mixin adds code to the initialization @@ -250,11 +244,11 @@ list (via @method[editor<%> set-style-list]) to the result of - @scheme[editor:get-standard-style-list]. + @racket[editor:get-standard-style-list]. In addition, it calls @method[editor<%> set-load-overwrites-styles] - with @scheme[#f]. + with @racket[#f]. This ensures that saved files with different settings for the style list do not clobber the shared style list. @@ -267,46 +261,46 @@ method. This editor is initialized by calling - @scheme[add-editor-keymap-functions], - @scheme[add-text-keymap-functions], and - @scheme[add-pasteboard-keymap-functions]. + @racket[add-editor-keymap-functions], + @racket[add-text-keymap-functions], and + @racket[add-pasteboard-keymap-functions]. @defmethod*[(((get-keymaps) (list-of (is-a?/c keymap%))))]{ The keymaps returned from this method are chained to this - @scheme[editor<%>]'s keymap. + @racket[editor<%>]'s keymap. The result of this method should not change -- that is, it should return the same list of keymaps each time it is called. - See also @scheme[editor:add-after-user-keymap]. + See also @racket[editor:add-after-user-keymap]. - Defaultly returns @scheme[(list (keymap:get-user) (keymap:get-global))] + Defaultly returns @racket[(list (keymap:get-user) (keymap:get-global))] } } @defmixin[editor:keymap-mixin (editor:basic<%>) (editor:keymap<%>)]{ This provides a mixin that implements the - @scheme[editor:keymap<%>] + @racket[editor:keymap<%>] interface. } @definterface[editor:autowrap<%> (editor:basic<%>)]{ Classes implementing this interface keep the @method[editor<%> auto-wrap] state set based on the - @scheme['framework:auto-set-wrap?] preference - (see @scheme[preferences:get] for more information about preferences). + @racket['framework:auto-set-wrap?] preference + (see @racket[preferences:get] for more information about preferences). They install a preferences callback with - @scheme[preferences:add-callback] + @racket[preferences:add-callback] that sets the state when the preference changes and initialize the value of @method[editor<%> auto-wrap] - to the current value of @scheme['framework:auto-set-wrap?] + to the current value of @racket['framework:auto-set-wrap?] via - @scheme[preferences:get]. + @racket[preferences:get]. } @defmixin[editor:autowrap-mixin (editor:basic<%>) (editor:autowrap<%>)]{ See - @scheme[editor:autowrap<%>] + @racket[editor:autowrap<%>] } @definterface[editor:file<%> (editor:keymap<%>)]{ Objects supporting this interface are expected to support files. @@ -314,8 +308,7 @@ The result of this method is used as the parent for the dialog that asks about closing. - - Defaultly returns @scheme[#f]. + Defaultly returns @racket[#f]. } @defmethod*[(((update-frame-filename) void?))]{ Attempts to find a frame that displays this editor. If it @@ -328,15 +321,14 @@ been saved is a reason to alert the user. See also @method[editor:file-mixin can-close?]. - - Defaultly returns @scheme[#f]. + Defaultly returns @racket[#f]. } @defmethod[(user-saves-or-not-modified? [allow-cancel? #t]) boolean?]{ If the file has not been saved, this prompts the user about saving and, if the user says to save, then it saves the file. - - The result is @scheme[#t] if the save file is up to date, or if + + The result is @racket[#t] if the save file is up to date, or if the user says it is okay to continue without saving. Generally used when closing the file or quiting the app. } @@ -351,19 +343,19 @@ Updates the filename on each frame displaying this editor, for each frame that matches - @scheme[frame:editor<%>]. + @racket[frame:editor<%>]. } @defmethod*[#:mode augment (((can-close?) boolean?))]{ If the @method[editor:file<%> allow-close-with-no-filename?] - method returns @scheme[#f], this method checks to see if the file + method returns @racket[#f], this method checks to see if the file has been saved at all yet. If not, it asks the user about saving (and saves if they ask). If the @method[editor:file<%> allow-close-with-no-filename?] - method returns @scheme[#t], this method does as before, + method returns @racket[#t], this method does as before, except only asks if the editor's @method[editor<%> get-filename]method returns a path. @@ -373,60 +365,47 @@ This returns a list containing the super-class's keymaps, plus the result of - @scheme[keymap:get-file] + @racket[keymap:get-file] } } @definterface[editor:backup-autosave<%> (editor:basic<%>)]{ Classes matching this interface support backup files and autosaving. @defmethod*[(((backup?) boolean?))]{ Indicates whether this - @scheme[editor<%>] + @racket[editor<%>] should be backed up. - - Returns the value of the - @scheme[preferences:get] - applied to - @scheme['framework:backup-files?]. - @index{'framework:backup-files?} - + Returns the value of the @racket[preferences:get] applied to + @racket['framework:backup-files?]. @index{'framework:backup-files?} } @defmethod*[(((autosave?) boolean?))]{ Indicates whether this - @scheme[editor<%>] + @racket[editor<%>] should be autosaved. - - Returns @scheme[#t]. + Returns @racket[#t]. } @defmethod*[(((do-autosave) (or/c #f path?)))]{ - This method is called to perform the autosaving. - See also - @scheme[autosave:register] + This method is called to perform the autosaving. See also + @racket[autosave:register] + When the file has been modified since it was last saved and autosaving it + turned on (via the @method[editor:backup-autosave<%> autosave?] method) an + autosave file is created for this @racket[editor<%>]. - When the file has been modified since it was last saved and autosaving - it turned on (via the - @method[editor:backup-autosave<%> autosave?] - method) an autosave file is created for this - @scheme[editor<%>]. - - Returns the filename where the autosave took place, or - @scheme[#f] if none did. + Returns the filename where the autosave took place, or @racket[#f] if none + did. } @defmethod*[(((remove-autosave) void?))]{ This method removes the autosave file associated with this - @scheme[editor<%>]. - - + @racket[editor<%>]. } } @defmixin[editor:backup-autosave-mixin (editor:basic<%>) (editor:backup-autosave<%> autosave:autosavable<%>)]{ This mixin adds backup and autosave functionality to an editor. - During initialization, this object is registered - with - @scheme[autosave:register]. + During initialization, this object is registered with + @racket[autosave:register]. The result of this mixin uses the same initialization arguments as the mixin's argument. @@ -436,7 +415,7 @@ If a backup file has not been created this session for this file, deletes any existing backup file and copies the old save file into the backup file. For the backup file's name, see - @scheme[path-utils:generate-backup-name] + @racket[path-utils:generate-backup-name] } @defmethod*[#:mode augment (((on-close) void?))]{ @@ -444,7 +423,7 @@ } @defmethod*[#:mode augment (((on-change) void?))]{ - Sets a flag indicating that this @scheme[editor<%>] needs to be autosaved. + Sets a flag indicating that this @racket[editor<%>] needs to be autosaved. } @defmethod*[#:mode override (((set-modified (modified? any/c)) void?))]{ @@ -454,13 +433,12 @@ } } @definterface[editor:info<%> (editor:basic<%>)]{ - An @scheme[editor<%>] - matching this interface provides information about its lock state to its - @scheme[top-level-window<%>]. + An @racket[editor<%>] matching this interface provides information about its + lock state to its @racket[top-level-window<%>]. } @defmixin[editor:info-mixin (editor:basic<%>) (editor:info<%>)]{ This editor tells the frame when it is locked and unlocked. - See also @scheme[frame:text-info<%>]. + See also @racket[frame:text-info<%>]. @defmethod*[#:mode override (((lock (lock? boolean?)) void?))]{ diff --git a/collects/scribblings/framework/frame.scrbl b/collects/scribblings/framework/frame.scrbl index 0758ab3cb6..5a1816dcb9 100644 --- a/collects/scribblings/framework/frame.scrbl +++ b/collects/scribblings/framework/frame.scrbl @@ -8,17 +8,17 @@ @definterface[frame:basic<%> (frame%)]{ Classes matching this interface support the basic - @scheme[frame%] + @racket[frame%] functionality required by the framework. @defmethod*[(((get-area-container%) (implementation?/c area-container<%>)))]{ The class that this method returns is used to create the - @scheme[area-container<%>] + @racket[area-container<%>] in this frame. } @defmethod*[(((get-area-container) (is-a?/c area-container<%>)))]{ This returns the main - @scheme[area-container<%>] + @racket[area-container<%>] in the frame } @@ -26,16 +26,14 @@ The result of this method is used to create the initial menu bar for this frame. - - Return - @scheme[menu-bar%]. + Return @racket[menu-bar%]. } @defmethod*[(((make-root-area-container (class (implementation?/c area-container<%>)) (parent (is-a?/c area-container<%>))) (is-a?/c area-container<%>)))]{ Override this method to insert a panel in between the panel used by the clients of this frame and the frame itself. For example, to insert a status line panel override this method with something like this: - @schemeblock[ + @racketblock[ (class ... ... (define status-panel #f) @@ -54,7 +52,7 @@ The searching frame is implemented using this method. - Calls @scheme[make-object] with @scheme[class] and @scheme[parent]. + Calls @racket[make-object] with @racket[class] and @racket[parent]. } @defmethod*[(((close) void?))]{ This method closes the frame by calling the @@ -64,7 +62,7 @@ methods. It's implementation is: - @schemeblock[ + @racketblock[ (inherit can-close? on-close) (public [show @@ -78,132 +76,116 @@ Indicates if this frame contains this buffer (and can edit that file). - - Returns @scheme[#f]. + Returns @racket[#f]. } @defmethod*[(((get-filename (temp (or/c #f (box boolean?)) #f)) (or/c #f path?)))]{ This returns the filename that the frame is currently being saved as, - or @scheme[#f] if there is no appropriate filename. + or @racket[#f] if there is no appropriate filename. + Defaultly returns @racket[#f]. - Defaultly returns @scheme[#f]. - - If @scheme[temp] is a box, it is filled with @scheme[#t] or @scheme[#f], + If @racket[temp] is a box, it is filled with @racket[#t] or @racket[#f], depending if the filename is a temporary filename. } @defmethod*[(((make-visible (filename string?)) void?))]{ - Makes the file named by @scheme[filename] visible (intended for + Makes the file named by @racket[filename] visible (intended for use with tabbed editing). } } @defmixin[frame:basic-mixin (frame%) (frame:basic<%>)]{ - This mixin provides the basic functionality that the framework - expects. It helps manage the list of frames in the - @scheme[group:%] - object returned by - @scheme[group:get-the-frame-group]. + This mixin provides the basic functionality that the framework expects. It + helps manage the list of frames in the @racket[group:%] object returned by + @racket[group:get-the-frame-group]. - Do not give @scheme[panel%] or @scheme[control<%>] objects this frame as - parent. Instead, use the result of the - @method[frame:basic<%> get-area-container] - method. + Do not give @racket[panel%] or @racket[control<%>] objects this frame as + parent. Instead, use the result of the @method[frame:basic<%> + get-area-container] method. @index{Windows menu} + This mixin also creates a menu bar for the frame, as the frame is initialized. It uses the class returned by - @method[frame:basic<%> get-menu-bar%]. It only passes the frame as an initialization argument. - In addition, it creates the windows menu in the menu bar. + @method[frame:basic<%> get-menu-bar%]. It only passes the frame as an + initialization argument. In addition, it creates the windows menu in the + menu bar. + + This mixin calls its @method[window<%> accept-drop-files] with @racket[#t]. - This mixin calls its @method[window<%> accept-drop-files] with @scheme[#t]. - It also calls its @method[frame% set-icon] method according to the current - value of @scheme[frame:current-icon]. - - See also - @scheme[frame:reorder-menus]. + value of @racket[frame:current-icon]. + + See also @racket[frame:reorder-menus]. + @defmethod*[#:mode override (((show (on? boolean?)) void?))]{ Calls the super method. - When @scheme[on?] is @scheme[#t], inserts the frame into the - frame group and when it is @scheme[#f], removes the frame + When @racket[on?] is @racket[#t], inserts the frame into the + frame group and when it is @racket[#f], removes the frame from the group. } @defmethod*[#:mode override (((can-exit?) boolean?))]{ - This, together with - @method[frame:basic-mixin on-exit] - mimics - @scheme[exit:exit]. + This, together with @method[frame:basic-mixin on-exit] mimics + @racket[exit:exit]. - First, it calls - @scheme[exit:set-exiting] - with @scheme[#t]. - Then, it calls - @scheme[exit:can-exit?]. If it returns @scheme[#t], - so does this method. If - it returns @scheme[#f], - this method calls - @scheme[exit:set-exiting] - with @scheme[#f]. + First, it calls @racket[exit:set-exiting] with @racket[#t]. Then, it calls + @racket[exit:can-exit?]. If it returns @racket[#t], so does this method. If + it returns @racket[#f], this method calls @racket[exit:set-exiting] with + @racket[#f]. } @defmethod*[#:mode override (((on-exit) void?))]{ - Together with - @method[frame:basic-mixin can-exit?] - this mimics the behavior of - @scheme[exit:exit]. + Together with @method[frame:basic-mixin can-exit?] this mimics the + behavior of @racket[exit:exit]. - Calls - @scheme[exit:on-exit] - and then queues a callback - to call Racket's @scheme[exit] - function. If that returns, it - calls - @scheme[exit:set-exiting] - to reset that flag to - @scheme[#f]. + Calls @racket[exit:on-exit] and then queues a callback to call Racket's + @racket[exit] function. If that returns, it calls @racket[exit:set-exiting] + to reset that flag to @racket[#f]. } @defmethod*[#:mode override (((on-superwindow-show (shown? any/c)) void?))]{ - Notifies the result of (@scheme[group:get-the-frame-group]) that a frame has been shown, by calling - the - @method[group:% frame-shown/hidden] - method. + Notifies the result of @racket[(group:get-the-frame-group)] that a frame + has been shown, by calling the @method[group:% frame-shown/hidden] method. } @defmethod*[#:mode override (((on-drop-file (pathname string?)) void?))]{ - Calls - @scheme[handler:edit-file] - with @scheme[pathname] as an argument. + Calls @racket[handler:edit-file] with @racket[pathname] as an argument. } @defmethod*[#:mode override (((after-new-child) void?))]{ - Raises an exception if attempting to add a child to this frame (except if using the - @method[frame:basic<%> make-root-area-container] - method). + Raises an exception if attempting to add a child to this frame (except if + using the @method[frame:basic<%> make-root-area-container] method). } } @definterface[frame:size-pref<%> (frame:basic<%>)]{ } @defmixin[frame:size-pref-mixin (frame:basic<%>) (frame:size-pref<%>)]{ - @defconstructor[((size-preferences-key symbol?) (label label-string?) (parent (or/c (is-a?/c frame%) false/c) #f) (x (or/c (integer-in -10000 10000) false/c) #f) (y (or/c (integer-in -10000 10000) false/c) #f) (style (listof (or/c (quote no-resize-border) (quote no-caption) (quote no-system-menu) (quote hide-menu-bar) (quote mdi-parent) (quote mdi-child) (quote toolbar-button) (quote float) (quote metal))) null) (enabled any/c #t) (border (integer-in 0 1000) 0) (spacing (integer-in 0 1000) 0) (alignment (list/c (or/c (quote left) (quote center) (quote right)) (or/c (quote top) (quote center) (quote bottom))) (quote (center top))) (min-width (integer-in 0 10000) graphical-minimum-width) (min-height (integer-in 0 10000) graphical-minimum-height) (stretchable-width any/c #t) (stretchable-height any/c #t))]{ + @defconstructor[((size-preferences-key symbol?) + (label label-string?) + (parent (or/c (is-a?/c frame%) false/c) #f) + (x (or/c (integer-in -10000 10000) false/c) #f) + (y (or/c (integer-in -10000 10000) false/c) #f) + (style (listof (or/c 'no-resize-border 'no-caption 'no-system-menu 'hide-menu-bar 'mdi-parent 'mdi-child 'toolbar-button 'float 'metal)) null) + (enabled any/c #t) + (border (integer-in 0 1000) 0) + (spacing (integer-in 0 1000) 0) + (alignment (list/c (or/c 'left 'center 'right) (or/c 'top 'center 'bottom)) '(center top)) + (min-width (integer-in 0 10000) graphical-minimum-width) + (min-height (integer-in 0 10000) graphical-minimum-height) + (stretchable-width any/c #t) (stretchable-height any/c #t))]{ - The size @scheme[size-preferences-key] symbol is used with - @scheme[preferences:get] - and - @scheme[preferences:set] - to track the current size. + The size @racket[size-preferences-key] symbol is used with + @racket[preferences:get] and @racket[preferences:set] to track the current + size. - Passes the @scheme[width] and @scheme[height] initialization - arguments to the superclass based on the current value - of the preference. + Passes the @racket[width] and @racket[height] initialization arguments to + the superclass based on the current value of the preference. - See also - @scheme[frame:setup-size-pref]. + See also @racket[frame:setup-size-pref]. } @defmethod*[#:mode override (((on-size (width number?) (height number?)) void?))]{ @@ -215,98 +197,70 @@ } @definterface[frame:register-group<%> ()]{ Frames that implement this interface are registered with the group. See - @scheme[group:get-the-frame-group] - and - @scheme[frame:register-group-mixin]. + @racket[group:get-the-frame-group] and @racket[frame:register-group-mixin]. } @defmixin[frame:register-group-mixin (frame:basic<%>) (frame:register-group<%>)]{ During initialization, calls - @method[group:% insert-frame]with @scheme[this]. + @method[group:% insert-frame]with @racket[this]. @defmethod*[#:mode augment (((can-close?) boolean?))]{ - Calls the inner method, with a default of @scheme[#t]. - If that returns @scheme[#t], - it checks for one of the these three conditions: + Calls the inner method, with a default of @racket[#t]. If that returns + @racket[#t], it checks for one of the these three conditions: @itemize[ - @item{ - @scheme[exit:exiting?] - returns @scheme[#t]} - @item{there is more than one - frame in the group returned - by - @scheme[group:get-the-frame-group], or} - @item{the procedure - @scheme[exit:user-oks-exit] - returns @scheme[#t].}] - If any of those conditions hold, the - method returns @scheme[#t]. + @item{@racket[exit:exiting?] returns @racket[#t]} + @item{there is more than one frame in the group returned by + @racket[group:get-the-frame-group], or} + @item{the procedure @racket[exit:user-oks-exit] returns @racket[#t].}] + + If any of those conditions hold, the method returns @racket[#t]. } @defmethod*[#:mode augment (((on-close) void?))]{ - First calls the inner method. - Next, calls the - @method[group:% remove-frame] - method of the result of - @scheme[group:get-the-frame-group] - with @scheme[this] as an argument. - Finally, unless - @scheme[exit:exiting?] - returns @scheme[#t], - and if there are no more - frames open, it calls - @scheme[exit:exit]. + First calls the inner method. Next, calls the @method[group:% + remove-frame] method of the result of @racket[group:get-the-frame-group] + with @racket[this] as an argument. Finally, unless @racket[exit:exiting?] + returns @racket[#t], and if there are no more frames open, it calls + @racket[exit:exit]. } @defmethod*[#:mode override (((on-activate (on? boolean?)) void?))]{ - Calls - @method[group:% set-active-frame] - with @scheme[this] when - @scheme[on?] is true. + Calls @method[group:% set-active-frame] with @racket[this] when + @racket[on?] is true. } } @definterface[frame:status-line<%> (frame:basic<%>)]{ - The mixin that implements this interface provides an - interface to a set of status lines at the bottom of this - frame. + The mixin that implements this interface provides an interface to a set of + status lines at the bottom of this frame. - Each status line must be opened with - @method[frame:status-line<%> open-status-line] - before any messages are shown in the status line and - once - @method[frame:status-line<%> close-status-line] - is called, no more messages may be displayed, - unless the status line is re-opened. + Each status line must be opened with @method[frame:status-line<%> + open-status-line] before any messages are shown in the status line and once + @method[frame:status-line<%> close-status-line] is called, no more messages + may be displayed, unless the status line is re-opened. + + The screen space for status lines is not created until + @method[frame:status-line<%> update-status-line] is called with a + string. Additionally, the screen space for one status line is re-used when by + another status line when the first passes @racket[#f] to + @method[frame:status-line<%> update-status-line]. In this manner, the status + line frame avoids opening too many status lines and avoids flashing the + status lines open and closed too often. - The screen space for status lines is not created - until - @method[frame:status-line<%> update-status-line] - is called with a string. Additionally, - the screen space for one status line is re-used - when by another status line when the first - passes @scheme[#f] to - @method[frame:status-line<%> update-status-line]. In this manner, the status line frame avoids - opening too many status lines and avoids - flashing the status lines open and closed too - often. @defmethod*[(((open-status-line (id symbol?)) void?))]{ Creates a new status line identified by the symbol argument. The line will not appear in the frame until a message is put into it, via @method[frame:status-line<%> update-status-line]. - - } - @defmethod*[(((close-status-line (id symbol?)) void?))]{ - Closes the status line @scheme[id]. + @defmethod*[(((close-status-line (id symbol?)) void?))]{ + Closes the status line @racket[id]. } @defmethod*[(((update-status-line (id symbol?) (status (or/c #f string))) void?))]{ - Updates the status line named by @scheme[id] with - @scheme[status]. If @scheme[status] is @scheme[#f], the status - line is becomes blank (and may be used by other ids). - + Updates the status line named by @racket[id] with @racket[status]. If + @racket[status] is @racket[#f], the status line is becomes blank (and may + be used by other ids). } } @defmixin[frame:status-line-mixin (frame:basic<%>) (frame:status-line<%>)]{ @@ -321,139 +275,126 @@ @definterface[frame:info<%> (frame:basic<%>)]{ Frames matching this interface support a status line. - The preference @scheme['framework:show-status-line] controls - the visibility of the status line. If it is @scheme[#t], the - status line is visible and if it is @scheme[#f], the - status line is not visible (see - @scheme[preferences:get] for more info about preferences) + The preference @racket['framework:show-status-line] controls the visibility + of the status line. If it is @racket[#t], the status line is visible and if + it is @racket[#f], the status line is not visible (see + @racket[preferences:get] for more info about preferences) + @defmethod*[(((determine-width (str string) (canvas (is-a?/c editor-canvas%)) (text (is-a?/c text%))) integer))]{ - This method is used to calculate the size of an - @scheme[editor-canvas%] - with a particular set of characters in it. - It is used to calculate the sizes of the edits in the status line. - + This method is used to calculate the size of an @racket[editor-canvas%] + with a particular set of characters in it. It is used to calculate the + sizes of the edits in the status line. } - @defmethod*[(((lock-status-changed) void?))]{ - This method is called when the lock status of the - @scheme[editor<%>] - changes. + @defmethod*[(((lock-status-changed) void?))]{ + This method is called when the lock status of the @racket[editor<%>] + changes. Updates the lock icon in the status line panel. } @defmethod*[(((update-info) void?))]{ This method updates all of the information in the panel. - } @defmethod*[(((set-info-canvas (canvas (or/c (is-a?/c canvas:basic%) #f))) void?))]{ Sets this canvas to be the canvas that the info frame shows info about. The - @method[canvas:info-mixin% on-focus] - and - @method[canvas:info-mixin% set-editor] - methods call this method to ensure that the info canvas is set correctly. - + @method[canvas:info-mixin% on-focus] and @method[canvas:info-mixin% + set-editor] methods call this method to ensure that the info canvas is set + correctly. } + @defmethod*[(((get-info-canvas) (or/c (is-a?/c canvas:basic%) #f)))]{ - Returns the canvas that the - @scheme[frame:info<%>] - currently shows info about. See also - @method[frame:info<%> set-info-canvas] - + Returns the canvas that the @racket[frame:info<%>] currently shows info + about. See also @method[frame:info<%> set-info-canvas] } + @defmethod*[(((get-info-editor) (or/c #f (is-a?/c editor<%>))))]{ Override this method to specify the editor that the status line contains information about. - - Returns the result of - @method[frame:editor<%> get-editor]. + Returns the result of @method[frame:editor<%> get-editor]. } @defmethod*[(((get-info-panel) (is-a?/c horizontal-panel%)))]{ - This method returns the panel where the information about this editor - is displayed. - + This method returns the panel where the information about this editor is + displayed. } + @defmethod*[(((show-info) void?))]{ - Shows the info panel. - - See also - @method[frame:info<%> is-info-hidden?]. + Shows the info panel. + See also @method[frame:info<%> is-info-hidden?]. } + @defmethod*[(((hide-info) void?))]{ Hides the info panel. - See also - @method[frame:info<%> is-info-hidden?]. - + See also @method[frame:info<%> is-info-hidden?]. } @defmethod*[(((is-info-hidden?) boolean?))]{ Result indicates if the show info panel has been explicitly hidden with @method[frame:info<%> hide-info]. - If this method returns @scheme[#t] and - @scheme[(preferences:get 'framework:show-status-line)] is - @scheme[#f], then the info panel will not be visible. - Otherwise, it is visible. + If this method returns @racket[#t] and @racket[(preferences:get + 'framework:show-status-line)] is @racket[#f], then the info panel will not + be visible. Otherwise, it is visible. } } @defmixin[frame:info-mixin (frame:basic<%>) (frame:info<%>)]{ - This mixin provides support for displaying various info in the status - line of the frame. + This mixin provides support for displaying various info in the status line of + the frame. The result of this mixin uses the same initialization arguments as the mixin's argument. + @defmethod*[#:mode override (((make-root-area-container (class (subclass?/c area-container<%>)) (parent (is-a?/c area-container<%>))) (is-a?/c area-container<%>)))]{ Builds an extra panel for displaying various information. } @defmethod*[#:mode augment (((on-close) void?))]{ - - Removes the GC icon with - @scheme[unregister-collecting-blit] - and cleans up other callbacks. + Removes the GC icon with @racket[unregister-collecting-blit] and cleans up + other callbacks. } + } @definterface[frame:text-info<%> (frame:info<%>)]{ - Objects matching this interface receive information from editors - constructed with - @scheme[editor:info-mixin] - and display it. - @defmethod*[(((set-macro-recording (on? boolean?)) void?))]{ - Shows/hides the icon in the info bar that indicates if a - macro recording is in progress. + Objects matching this interface receive information from editors constructed + with @racket[editor:info-mixin] and display it. + @defmethod*[(((set-macro-recording (on? boolean?)) void?))]{ + Shows/hides the icon in the info bar that indicates if a macro recording is + in progress. } + @defmethod*[(((overwrite-status-changed) void?))]{ - This method is called when the overwrite mode is turned either on or off in the - @scheme[editor<%>] - in this frame. + This method is called when the overwrite mode is turned either on or off in + the @racket[editor<%>] in this frame. } + @defmethod*[(((anchor-status-changed) void?))]{ This method is called when the anchor is turned either on or off in the - @scheme[editor<%>] + @racket[editor<%>] in this frame. } + @defmethod*[(((editor-position-changed) void?))]{ - This method is called when the position in the - @scheme[editor<%>] - changes. + This method is called when the position in the @racket[editor<%>] changes. } + @defmethod[(add-line-number-menu-items [menu (is-a?/c menu-item-container<%>)]) void?]{ - This method is called when the line/column display in the info bar is clicked. - It is passed a @racket[menu-item-container<%>] that can be filled in with - menu items; those menu items will appear in the menu that appears when line/colun - display is clicked. + This method is called when the line/column display in the info bar is + clicked. It is passed a @racket[menu-item-container<%>] that can be filled + in with menu items; those menu items will appear in the menu that appears + when line/colun display is clicked. } } + @defmixin[frame:text-info-mixin (frame:info<%>) (frame:text-info<%>)]{ This mixin adds status information to the info panel relating to an edit. @defmethod*[#:mode augment (((on-close) void?))]{ - removes a preferences callback for @scheme['framework:line-offsets]. - See @scheme[preferences:add-callback] for more information. + removes a preferences callback for @racket['framework:line-offsets]. + See @racket[preferences:add-callback] for more information. } @defmethod*[#:mode override (((update-info) void?))]{ @@ -473,107 +414,92 @@ @(include/reader "standard-menus.scrbl" s:read-syntax) @defmixin[frame:standard-menus-mixin (frame:basic<%>) (frame:standard-menus<%>)]{ - The result of this mixin implements - @scheme[frame:standard-menus<%>]. + The result of this mixin implements @racket[frame:standard-menus<%>]. + @defmethod*[#:mode augment (((on-close) void?))]{ Removes the preferences callbacks for the menu items } } + @definterface[frame:editor<%> (frame:standard-menus<%>)]{ Frame classes matching this interface support embedded editors. @defmethod*[(((get-entire-label) string))]{ - This method returns the entire label for the frame. - See also - @method[window<%> set-label] - and - @method[frame:editor<%> set-label-prefix]. - + This method returns the entire label for the frame. See also + @method[window<%> set-label] and @method[frame:editor<%> set-label-prefix]. } + @defmethod*[(((get-label-prefix) string?))]{ This returns the prefix for the frame's label. - } + @defmethod*[(((set-label-prefix (prefix string?)) void?))]{ Sets the prefix for the label of the frame. - } + @defmethod*[(((get-canvas%) (subclass?/c editor-canvas%)))]{ The result of this method is used to create the canvas for the - @scheme[editor<%>] - in this frame. + @racket[editor<%>] in this frame. - - Returns - @scheme[editor-canvas%]. + Returns @racket[editor-canvas%]. } + @defmethod*[(((get-canvas<%>) (is-a?/c canvas:basic%)))]{ The result of this method is used to guard the result of the - @method[frame:editor<%> get-canvas%] - method. - + @method[frame:editor<%> get-canvas%] method. } + @defmethod*[(((get-editor%) (implementation?/c editor<%>)))]{ - The result of this class is used to create the - @scheme[editor<%>] - in this frame. + The result of this class is used to create the @racket[editor<%>] in this + frame. Override this method to specify a different editor class. - - Returns the value of the init-field @scheme[editor%]. + Returns the value of the init-field @racket[editor%]. } + @defmethod*[(((get-editor<%>) interface?))]{ - The result of this method is used by - @method[frame:editor<%> make-editor] - to check that - @method[frame:editor<%> get-editor%] - is returning a reasonable editor. + The result of this method is used by @method[frame:editor<%> make-editor] + to check that @method[frame:editor<%> get-editor%] is returning a + reasonable editor. - - Returns - @scheme[editor<%>]. + Returns @racket[editor<%>]. } + @defmethod*[(((make-editor) (is-a?/c editor<%>)))]{ - This method is called to create the editor in this frame. - It calls - @method[frame:editor<%> get-editor<%>] - and uses that interface to make sure the result of - @method[frame:editor<%> get-editor%] - is reasonable. - - - - Calls @scheme[(make-object @#,method[frame:editor<%> get-editor%])]. + This method is called to create the editor in this frame. It calls + @method[frame:editor<%> get-editor<%>] and uses that interface to make sure + the result of @method[frame:editor<%> get-editor%] is reasonable. + Calls @racket[(make-object @#,method[frame:editor<%> get-editor%])]. } + @defmethod*[(((revert) void?))]{ - - Loads the most recently saved version of the file to the disk. If the - @scheme[editor<%>] - is a - @scheme[text%], the start and end positions are restored. + Loads the most recently saved version of the file to the disk. If the + @racket[editor<%>] is a @racket[text%], the start and end positions are + restored. } - @defmethod*[(((save (format (or/c (quote guess) (quote standard) (quote text) (quote text-force-cr) (quote same) (quote copy)) (quote same))) boolean?))]{ + + @defmethod*[(((save (format (or/c 'guess 'standard 'text 'text-force-cr 'same 'copy) 'same)) + boolean?))]{ Saves the file being edited, possibly calling @method[frame:editor<%> save-as] if the editor has no filename yet. - - Returns @scheme[#f] if the user cancels this operation - (only possible when the file has not been saved before and - the user is prompted for a new filename) and returns - @scheme[#t] if not. + Returns @racket[#f] if the user cancels this operation (only possible when + the file has not been saved before and the user is prompted for a new + filename) and returns @racket[#t] if not. } - @defmethod*[(((save-as (format (or/c (quote guess) (quote standard) (quote text) (quote text-force-cr) (quote same) (quote copy)) (quote same))) boolean?))]{ + + @defmethod*[(((save-as (format (or/c 'guess 'standard 'text 'text-force-cr 'same 'copy) 'same)) + boolean?))]{ Queries the use for a file name and saves the file with that name. - - Returns @scheme[#f] if the user cancells the file-choosing - dialog and returns @scheme[#t] otherwise. + Returns @racket[#f] if the user cancells the file-choosing + dialog and returns @racket[#t] otherwise. } @defmethod*[(((get-canvas) (is-a?/c canvas%)))]{ Returns the canvas used to display the - @scheme[editor<%>] + @racket[editor<%>] in this frame. @@ -584,457 +510,427 @@ } @defmixin[frame:editor-mixin (frame:standard-menus<%>) (frame:editor<%>)]{ This mixin adds functionality to support an - @scheme[editor<%>] + @racket[editor<%>] in the frame. This includes management of the title, implementations of some of the menu items, a reasonable initial size, and access to the - @scheme[editor<%>] + @racket[editor<%>] itself. The size of this frame with be either 600 by 650 or 65 less than the width and height of the screen, whichever is smaller. - @defconstructor[((filename string?) (editor% (is-a?/c editor<%>)) (parent (or/c (is-a?/c frame%) false/c) #f) (width (or/c (integer-in 0 10000) false/c) #f) (height (or/c (integer-in 0 10000) false/c) #f) (x (or/c (integer-in -10000 10000) false/c) #f) (y (or/c (integer-in -10000 10000) false/c) #f) (style (listof (or/c (quote no-resize-border) (quote no-caption) (quote no-system-menu) (quote hide-menu-bar) (quote mdi-parent) (quote mdi-child) (quote toolbar-button) (quote float) (quote metal))) null) (enabled any/c #t) (border (integer-in 0 1000) 0) (spacing (integer-in 0 1000) 0) (alignment (list/c (or/c (quote left) (quote center) (quote right)) (or/c (quote top) (quote center) (quote bottom))) (quote (center top))) (min-width (integer-in 0 10000) graphical-minimum-width) (min-height (integer-in 0 10000) graphical-minimum-height) (stretchable-width any/c #t) (stretchable-height any/c #t))]{ + @defconstructor[((filename string?) + (editor% (is-a?/c editor<%>)) + (parent (or/c (is-a?/c frame%) false/c) #f) + (width (or/c (integer-in 0 10000) false/c) #f) + (height (or/c (integer-in 0 10000) false/c) #f) + (x (or/c (integer-in -10000 10000) false/c) #f) + (y (or/c (integer-in -10000 10000) false/c) #f) + (style (listof (or/c 'no-resize-border 'no-caption 'no-system-menu 'hide-menu-bar 'mdi-parent 'mdi-child 'toolbar-button 'float 'metal)) null) + (enabled any/c #t) + (border (integer-in 0 1000) 0) + (spacing (integer-in 0 1000) 0) + (alignment (list/c (or/c 'left 'center 'right) (or/c 'top 'center 'bottom)) '(center top)) + (min-width (integer-in 0 10000) graphical-minimum-width) + (min-height (integer-in 0 10000) graphical-minimum-height) + (stretchable-width any/c #t) + (stretchable-height any/c #t))]{ } @defmethod*[#:mode override (((get-filename) (or/c #f path?)))]{ - Returns the filename in the editor returned by @method[frame:editor<%> get-editor]. } + @defmethod*[#:mode override (((editing-this-file? (filename path?)) boolean?))]{ - - Returns @scheme[#t] if the filename is the file that this - frame is editing. + Returns @racket[#t] if the filename is the file that this frame is editing. } + @defmethod*[#:mode augment (((on-close) void?))]{ - - Calls the - @scheme[editor:basic<%>]'s method - @method[editor:basic<%> on-close]. + Calls the @racket[editor:basic<%>]'s method @method[editor:basic<%> + on-close]. } + @defmethod*[#:mode augment (((can-close?) void?))]{ - - Calls the - @scheme[editor:basic<%>]'s method - @method[editor:basic<%> can-close?]. + Calls the @racket[editor:basic<%>]'s method @method[editor:basic<%> + can-close?]. } - @defmethod*[#:mode override (((get-label) string?))]{ + @defmethod*[#:mode override (((get-label) string?))]{ Returns the portion of the label after the hyphen. See also @method[frame:editor<%> get-entire-label]. } - @defmethod*[#:mode override (((set-label (label string?)) void?))]{ + @defmethod*[#:mode override (((set-label (label string?)) void?))]{ Sets the label, but preserves the label's prefix. See also @method[frame:editor<%> set-label-prefix]. } + @defmethod*[#:mode override (((file-menu:open-callback (item (is-a?/c menu-item<%>)) (evt (is-a?/c mouse-event%))) void?))]{ - - Calls - @scheme[handler:open-file] - with the directory of the saved file associated with this editor - (if any). + Calls @racket[handler:open-file] with the directory of the saved file + associated with this editor (if any). } - @defmethod*[#:mode override (((file-menu:revert-on-demand) void?))]{ + @defmethod*[#:mode override (((file-menu:revert-on-demand) void?))]{ Disables the menu item when the editor is locked. } - @defmethod*[#:mode override (((file-menu:revert-callback (item (is-a?/c menu-item%)) (evt (is-a?/c control-event%))) void?))]{ - Informs the user that this action is not undoable and, - if they still want to continue, calls - @method[frame:editor<%> revert]. + @defmethod*[#:mode override (((file-menu:revert-callback (item (is-a?/c menu-item%)) (evt (is-a?/c control-event%))) void?))]{ + Informs the user that this action is not undoable and, if they still want + to continue, calls @method[frame:editor<%> revert]. } @defmethod*[#:mode override (((file-menu:create-revert?) boolean?))]{ - - returns #t + returns @racket[#t]. } @defmethod*[#:mode override (((file-menu:save-callback (item (is-a?/c menu-item%)) (evt (is-a?/c control-event%))) void?))]{ - Saves the file in the editor. } + @defmethod*[#:mode override (((file-menu:create-save?) boolean?))]{ - - returns #t + returns @racket[#t]. } + @defmethod*[#:mode override (((file-menu:save-as-callback (item (is-a?/c menu-item%)) (evt (is-a?/c control-event%))) void?))]{ - - Prompts the user for a file name and uses that filename to save the buffer. - Calls - @method[frame:editor<%> save-as] - with no arguments. + Prompts the user for a file name and uses that filename to save the buffer. + Calls @method[frame:editor<%> save-as] with no arguments. } + @defmethod*[#:mode override (((file-menu:create-save-as?) boolean?))]{ - - returns #t + returns @racket[#t]. } + @defmethod*[#:mode override (((file-menu:print-callback (item (is-a?/c menu-item%)) (evt (is-a?/c control-event%))) void?))]{ - - Calls the - @method[editor<%> print] - method of - @scheme[editor<%>] - with the default arguments, except that - the @scheme[output-mode] argument - is the result of calling - @scheme[preferences:get] - with @scheme['framework:print-output-mode]. + Calls the @method[editor<%> print] method of @racket[editor<%>] with the + default arguments, except that the @racket[output-mode] argument is the + result of calling @racket[preferences:get] with + @racket['framework:print-output-mode]. } + @defmethod*[#:mode override (((file-menu:create-print?) boolean?))]{ - - returns #t + returns @racket[#t]. } - @defmethod*[#:mode override (((file-menu:between-save-as-and-print (file-menu (is-a?/c menu%))) void?))]{ + @defmethod*[#:mode override (((file-menu:between-save-as-and-print (file-menu (is-a?/c menu%))) void?))]{ Creates a Print Setup menu item. } + @defmethod*[#:mode override (((edit-menu:between-select-all-and-find (edit-menu (is-a?/c menu%))) void?))]{ - - Adds a menu item for toggling - @method[editor<%> auto-wrap] - in the focused text. - + Adds a menu item for toggling @method[editor<%> auto-wrap] in the focused + text. } + @defmethod*[#:mode override (((help-menu:about-callback (item (is-a?/c menu-item%)) (evt (is-a?/c control-event%))) void?))]{ - - Calls - @scheme[message-box] - with a message welcoming the user to the application named by - @scheme[application:current-app-name] - + Calls @racket[message-box] with a message welcoming the user to the + application named by @racket[application:current-app-name] } + @defmethod*[#:mode override (((help-menu:about-string) string))]{ - - Returns the result of (@scheme[application:current-app-name]) + Returns the result of (@racket[application:current-app-name]) } - @defmethod*[#:mode override (((help-menu:create-about?) boolean?))]{ - returns #t + @defmethod*[#:mode override (((help-menu:create-about?) boolean?))]{ + returns @racket[#t]. } } + @definterface[frame:open-here<%> (frame:editor<%>)]{ - Frames implementing this mixin can change the file they are - displaying. + Frames implementing this mixin can change the file they are displaying. - The frame is only re-used when the - @scheme['framework:open-here?] preference is set - (see - @scheme[preferences:get] - and - @scheme[preferences:set] - for details on preferences). + The frame is only re-used when the @racket['framework:open-here?] preference + is set (see @racket[preferences:get] and @racket[preferences:set] for details + on preferences). + + The @racket[frame:open-here-mixin] implements this interface. - The - @scheme[frame:open-here-mixin] - implements this interface. @defmethod*[(((get-open-here-editor) (is-a?/c editor<%>)))]{ - When the user switches the visible file in this frame, - the of this method is the editor that gets switched. + When the user switches the visible file in this frame, the of this method + is the editor that gets switched. - - Defaultly returns the result of - @method[frame:editor<%> get-editor]. + Defaultly returns the result of @method[frame:editor<%> get-editor]. } + @defmethod*[(((open-here (filename string)) void?))]{ - - Opens @scheme[filename] in the current frame, possibly - prompting the user about saving a file (in which case the - frame might not get switched). + Opens @racket[filename] in the current frame, possibly prompting the user + about saving a file (in which case the frame might not get switched). } + } @defmixin[frame:open-here-mixin (frame:editor<%>) (frame:open-here<%>)]{ - Provides an implementation of - @scheme[frame:open-here<%>] + Provides an implementation of @racket[frame:open-here<%>] + @defmethod*[#:mode override (((file-menu:new-on-demand (item (is-a?/c menu-item%))) void?))]{ - - Sets the label of @scheme[item] to - @scheme["New..."] if the preference @scheme['framework:open-here?] is set. + Sets the label of @racket[item] to @racket["New..."] if the preference + @racket['framework:open-here?] is set. } - @defmethod*[#:mode override (((file-menu:new-callback (item (is-a?/c menu-item%)) (evt (is-a?/c control-event%))) void?))]{ - When the preference @scheme['framework:open-here?] - preference is set, this method prompts the user, asking if - they would like to create a new frame, or just clear out - this one. If they clear it out and the file hasn't been + @defmethod*[#:mode override (((file-menu:new-callback (item (is-a?/c menu-item%)) (evt (is-a?/c control-event%))) void?))]{ + When the preference @racket['framework:open-here?] preference is set, this + method prompts the user, asking if they would like to create a new frame, + or just clear out this one. If they clear it out and the file hasn't been saved, they are asked about saving. } + @defmethod*[#:mode override (((file-menu:open-on-demand (item (is-a?/c menu-item%))) void?))]{ - - Sets the label of @scheme[item] to - "Open Here..." if the preference @scheme['framework:open-here?] is set. + Sets the label of @racket[item] to "Open Here..." if the preference + @racket['framework:open-here?] is set. } + @defmethod*[#:mode augment (((on-close) void?))]{ - - Calls - @method[group:% set-open-here-frame] - with @scheme[#f] if - the result of - @method[group:% get-open-here-frame] - is @scheme[eq?] to @scheme[this]. + Calls @method[group:% set-open-here-frame] with @racket[#f] if the result + of @method[group:% get-open-here-frame] is @racket[eq?] to @racket[this]. } + @defmethod*[#:mode override (((on-activate (on? boolean?)) void?))]{ - - When @scheme[on?] is @scheme[#t], calls - @method[group:% set-open-here-frame] - with @scheme[this]. + When @racket[on?] is @racket[#t], calls @method[group:% + set-open-here-frame] with @racket[this]. } } -@definterface[frame:text<%> (frame:editor<%>)]{ - Frames matching this interface provide support for - @scheme[text%]s. +@definterface[frame:text<%> (frame:editor<%>)]{ + Frames matching this interface provide support for @racket[text%]s. } + @defmixin[frame:text-mixin (frame:editor<%>) (frame:text<%>)]{ - This mixins adds support for - @scheme[text%]s in the frame. + This mixins adds support for @racket[text%]s in the frame. @defconstructor[((editor% (extends text%)))]{ - Calls the super initialization with either the value of the - @scheme[editor%] init or, if none was supplied, it passes @scheme[text%]. + @racket[editor%] init or, if none was supplied, it passes @racket[text%]. } - @defmethod*[#:mode override (((get-editor<%>) interface))]{ - Returns @scheme[(class->interface text%)]. + @defmethod*[#:mode override (((get-editor<%>) interface))]{ + Returns @racket[(class->interface text%)]. } } + @definterface[frame:pasteboard<%> (frame:editor<%>)]{ Frames matching this interface provide support for - @scheme[pasteboard%]s. + @racket[pasteboard%]s. } + @defmixin[frame:pasteboard-mixin (frame:editor<%>) (frame:pasteboard<%>)]{ This mixin provides support for pasteboards in a frame. @defconstructor[((editor% (extends pasteboard%)))]{ - Calls the super initialization with either the value of the - @scheme[editor%] init or, if none was supplied, it passes @scheme[pasteboard%]. - + @racket[editor%] init or, if none was supplied, it passes + @racket[pasteboard%]. } - @defmethod*[#:mode override (((get-editor<%>) interface))]{ - Returns @scheme[(class->interface pasteboard%)]. + @defmethod*[#:mode override (((get-editor<%>) interface))]{ + Returns @racket[(class->interface pasteboard%)]. } } + @definterface[frame:delegate<%> (frame:status-line<%> frame:text<%>)]{ - Frames that implement this interface provide a 20,000 feet - overview of the text in the main editor. The term @bold{delegate} - in these method descriptions refers to the - original editor and the term @bold{delegatee} refers to the - editor showing the 20,000 feet overview. + Frames that implement this interface provide a 20,000 feet overview of the + text in the main editor. The term @bold{delegate} in these method + descriptions refers to the original editor and the term @bold{delegatee} + refers to the editor showing the 20,000 feet overview. + @defmethod*[(((get-delegated-text) (is-a?/c text:delegate<%>)))]{ Returns the delegate text. - } + @defmethod*[(((delegated-text-shown?) boolean?))]{ - Returns @scheme[#t] if the delegate is visible, and - @scheme[#f] if it isn't. - + Returns @racket[#t] if the delegate is visible, and @racket[#f] if it + isn't. } + @defmethod*[(((hide-delegated-text) void?))]{ Hides the delegated text. - When the delegated text is hidden, it is not being - updated. This is accomplished by calling the - @method[text:delegate<%> set-delegate] - method of - @method[frame:editor<%> get-editor]with @scheme[#f]. - - See also - @method[frame:delegate<%> show-delegated-text] + When the delegated text is hidden, it is not being updated. This is + accomplished by calling the @method[text:delegate<%> set-delegate] method + of @method[frame:editor<%> get-editor]with @racket[#f]. + See also @method[frame:delegate<%> show-delegated-text] } @defmethod*[(((show-delegated-text) void?))]{ Makes the delegated text visible. - When the delegated text is shown, the - @method[text:delegate<%> set-delegate] - method of - @method[frame:delegate<%> get-delegated-text]is called with - the text to delegate messages to. - - See also - @method[frame:delegate<%> hide-delegated-text]. + When the delegated text is shown, the @method[text:delegate<%> + set-delegate] method of @method[frame:delegate<%> get-delegated-text]is + called with the text to delegate messages to. + See also @method[frame:delegate<%> hide-delegated-text]. } + @defmethod*[(((delegate-moved) void?))]{ - This method is called when the visible region of the - delegate editor changes, so that the blue region in the - delegatee is updated. - + This method is called when the visible region of the delegate editor + changes, so that the blue region in the delegatee is updated. } } + @defmixin[frame:delegate-mixin (frame:status-line<%> frame:text<%>) (frame:delegate<%>)]{ - Adds support for a 20,000-feet view via - @scheme[text:delegate<%>] and @scheme[text:delegate-mixin] + Adds support for a 20,000-feet view via @racket[text:delegate<%>] and + @racket[text:delegate-mixin]. + @defmethod*[#:mode override (((make-root-area-container (class (subclass?/c panel%)) (parent (is-a?/c panel%))) (is-a?/c panel%)))]{ - - adds a panel outside to hold the delegate - @scheme[editor-canvas%] and @scheme[text%]. - + Adds a panel outside to hold the delegate @racket[editor-canvas%] and + @racket[text%]. } + @defmethod*[#:mode override (((get-editor<%>) interface))]{ - - Returns @scheme[text:delegate]. - + Returns @racket[text:delegate]. } - @defmethod*[#:mode override (((get-editor%) (is-a?/c text:delegate<%>)))]{ - returns the super result, with the - @scheme[text:delegate-mixin] - mixed in. + @defmethod*[#:mode override (((get-editor%) (is-a?/c text:delegate<%>)))]{ + returns the super result, with the @racket[text:delegate-mixin] mixed in. } } + @definterface[frame:searchable<%> (frame:basic<%>)]{ Frames that implement this interface support searching. @defmethod[(search (direction (symbols 'forward 'backward))) void?]{ Searches for the text in the search edit in the result of - @method[frame:searchable<%> get-text-to-search]. + @method[frame:searchable<%> get-text-to-search]. - If the text is found and it sets the selection to the - found text. + If the text is found and it sets the selection to the found text. } + @defmethod[(search-replace) boolean?]{ - If there is a dark purple bubble (ie, if the replace portion - of the search bar is visible and there is a search hit after - the insertion point), then this will replace it with the - contents of the replace editor and move the insertion point - to just after that, or to the end of the editor (if there - are no more search hits after the insertion point, but there are - search hits before it). + If there is a dark purple bubble (ie, if the replace portion of the search + bar is visible and there is a search hit after the insertion point), then + this will replace it with the contents of the replace editor and move the + insertion point to just after that, or to the end of the editor (if there + are no more search hits after the insertion point, but there are search + hits before it). } + @defmethod[(replace-all) void?]{ - Loops through the text from the beginning to the end, replacing - all occurrences of the search string with the contents of the replace - edit. + Loops through the text from the beginning to the end, replacing all + occurrences of the search string with the contents of the replace edit. } + @defmethod[(get-text-to-search) (is-a?/c text%)]{ - Returns the last value passed to + Returns the last value passed to @method[frame:searchable<%> set-text-to-search]. } + @defmethod[(set-text-to-search [txt (or/c false/c (is-a?/c (subclass?/c text%)))]) void?]{ Sets the current text to be searched. } - @defmethod[(search-hidden?) boolean?]{ - Returns @scheme[#t] if the search subwindow is visiable and @scheme[#f] otherwise. - } - @defmethod[(hide-search) void?]{ - This method hides the searching information on the bottom of the - frame. + @defmethod[(search-hidden?) boolean?]{ + Returns @racket[#t] if the search subwindow is visiable and @racket[#f] + otherwise. } + + @defmethod[(hide-search) void?]{ + This method hides the searching information on the bottom of the frame. + } + @defmethod[(unhide-search [move-focus? boolean?]) void?]{ - When the searching sub window is hidden, makes it visible. If - @scheme[move-focus?] is @scheme[#f], the focus is not moved, - but if it is any other value, the focus is moved to the find - window. + When the searching sub window is hidden, makes it visible. If + @racket[move-focus?] is @racket[#f], the focus is not moved, but if it is + any other value, the focus is moved to the find window. } @defmethod[(get-case-sensitive-search?) boolean?]{ - Returns @scheme[#t] if the search is currently case-sensitive. - (This method's value depends on the preference - @scheme['framework:case-sensitive-search?], but - the preference is only consulted when the frame is created.) + Returns @racket[#t] if the search is currently case-sensitive. (This + method's value depends on the preference + @racket['framework:case-sensitive-search?], but the preference is only + consulted when the frame is created.) } @defmethod[#:mode public-final (search-hits-changed) void?]{ - This method is called when the number of search matches changes and - it updates the GUI. + This method is called when the number of search matches changes and it + updates the GUI. } - } + @defmixin[frame:searchable-mixin (frame:standard-menus<%>) (frame:searchable<%>)]{ - This mixin adds support for searching in the - @scheme[editor<%>] - in this frame. + This mixin adds support for searching in the @racket[editor<%>] in this + frame. @defmethod*[#:mode override (((edit-menu:find-callback) boolean?))]{ Toggles the focus between the find window and the window being searched. - When moving to the window with the search string, selects the entire - range in the buffer. + When moving to the window with the search string, selects the entire range + in the buffer. } + @defmethod*[#:mode override (((edit-menu:create-find?) boolean?))]{ - returns @scheme[#t]. + returns @racket[#t]. } - @defmethod*[#:mode override (((edit-menu:find-again-callback (item (is-a?/c menu-item%)) (evt (is-a?/c control-event%))) void?))]{ - - Calls @method[frame:searchable unhide-search] and then + @defmethod*[#:mode override + (((edit-menu:find-again-callback (item (is-a?/c menu-item%)) + (evt (is-a?/c control-event%))) + void?))]{ + Calls @method[frame:searchable unhide-search] and then @method[frame:searchable<%> search]. } + @defmethod*[#:mode override (((edit-menu:create-find-again?) boolean?))]{ - returns @scheme[#t]. + returns @racket[#t]. } - @defmethod*[#:mode override (((edit-menu:find-again-backwards-callback (item (is-a?/c menu-item%)) (evt (is-a?/c control-event%))) void?))]{ - Calls @method[frame:searchable unhide-search] and then + @defmethod*[#:mode override (((edit-menu:find-again-backwards-callback (item (is-a?/c menu-item%)) (evt (is-a?/c control-event%))) void?))]{ + Calls @method[frame:searchable unhide-search] and then @method[frame:searchable<%> search]. } + @defmethod*[#:mode override (((edit-menu:create-find-again-backwards?) boolean?))]{ - returns @scheme[#t]. + returns @racket[#t]. } @defmethod*[#:mode override (((edit-menu:replace-all-callback) boolean?))]{ Calls @method[frame:searchable<%> replace-all]. } - @defmethod*[#:mode override (((edit-menu:replace-all-on-demand (item menu-item%)) void?))]{ - Disables @scheme[item] when - @method[frame:searchable<%> search-hidden?] - returns @scheme[#t] and enables it when that method returns - @scheme[#f]. + @defmethod*[#:mode override (((edit-menu:replace-all-on-demand (item menu-item%)) void?))]{ + Disables @racket[item] when @method[frame:searchable<%> search-hidden?] + returns @racket[#t] and enables it when that method returns @racket[#f]. } + @defmethod*[#:mode override (((edit-menu:create-replace-all?) boolean?))]{ - returns @scheme[#t]. + returns @racket[#t]. } @defmethod*[#:mode override (((edit-menu:find-case-sensitive-callback) boolean?))]{ - Updates the state of the case-sensitive searching for this frame, - and sets the @scheme['framework:case-sensitive-search?] preference - for later frames. + Updates the state of the case-sensitive searching for this frame, and sets + the @racket['framework:case-sensitive-search?] preference for later + frames. } + @defmethod*[#:mode override (((edit-menu:find-case-sensitive-on-demand (item menu-item%)) void?))]{ - - Checks @scheme[item] when searching is case-sensitive and unchecks - it otherwise. + Checks @racket[item] when searching is case-sensitive and unchecks it + otherwise. } - @defmethod*[#:mode override (((edit-menu:create-find-case-sensitive?) boolean?))]{ - returns @scheme[#t]. + @defmethod*[#:mode override (((edit-menu:create-find-case-sensitive?) boolean?))]{ + returns @racket[#t]. } @defmethod*[#:mode override (((make-root-area-container) (is-a?/c area-container<%>)))]{ - Builds a panel for the searching information. } - @defmethod*[#:mode augment (((on-close) void?))]{ + @defmethod*[#:mode augment (((on-close) void?))]{ Cleans up after the searching frame. } } -@definterface[frame:searchable-text<%> (frame:searchable<%> frame:text<%>)]{ +@definterface[frame:searchable-text<%> (frame:searchable<%> frame:text<%>)]{ } + @defmixin[frame:searchable-text-mixin (frame:text<%> frame:searchable<%>) (frame:searchable-text<%>)]{ @defmethod*[#:mode override-final (((get-text-to-search) (is-a?/c text%)))]{ - - Returns the result of - @method[frame:editor<%> get-editor]. + Returns the result of @method[frame:editor<%> get-editor]. } - @defmethod*[#:mode override (((get-editor<%>) (is-a?/c editor<%>)))]{ - Returns - @scheme[text:searching<%>]. + @defmethod*[#:mode override (((get-editor<%>) (is-a?/c editor<%>)))]{ + Returns @racket[text:searching<%>]. } @defmethod*[#:mode override (((get-editor%) (is-a?/c editor<%>)))]{ - - Returns - @scheme[(text:searching-mixin (super get-editor%))]. + Returns @racket[(text:searching-mixin (super get-editor%))]. } } + @defclass[frame:basic% (frame:register-group-mixin (frame:basic-mixin frame%)) ()]{} @defclass[frame:size-pref% (frame:size-pref-mixin frame:basic%) ()]{} @defclass[frame:info% (frame:info-mixin frame:basic%) ()]{} diff --git a/collects/scribblings/framework/group.scrbl b/collects/scribblings/framework/group.scrbl index 0949ab1452..f89e289ae1 100644 --- a/collects/scribblings/framework/group.scrbl +++ b/collects/scribblings/framework/group.scrbl @@ -5,119 +5,96 @@ @title{Group} @defclass[group:% object% ()]{ - This class manages a group of frames matching the - @scheme[frame:basic<%>] - interface. There is one instance created by - the framework, returned by the function - @scheme[group:get-the-frame-group] - and every frame that was constructed with - @scheme[frame:basic-mixin] - adds itself to the result of - @scheme[group:get-the-frame-group]. + This class manages a group of frames matching the @racket[frame:basic<%>] + interface. There is one instance created by the framework, returned by the + function @racket[group:get-the-frame-group] and every frame that was + constructed with @racket[frame:basic-mixin] adds itself to the result of + @racket[group:get-the-frame-group]. + @defmethod*[(((set-open-here-frame (frame (is-a?/c frame:editor%))) void?))]{ - Sets the frame to load new files into. - See also - @scheme[frame:open-here<%>]. - - + Sets the frame to load new files into. See also + @racket[frame:open-here<%>]. } + @defmethod*[(((get-open-here-frame) (or/c false/c (is-a?/c frame:editor<%>))))]{ - Returns the currently saved frame - to load new files into. - + Returns the currently saved frame to load new files into. } + @defmethod*[(((get-mdi-parent) (or/c false/c (is-a?/c frame%))))]{ - The result of this method must be used as the parent frame for each - frame in the group. - + The result of this method must be used as the parent frame for each frame + in the group. } + @defmethod*[(((get-frames) (list-of (is-a?/c frame:basic<%>))))]{ Returns the frames in the group. - } - @defmethod*[(((frame-label-changed (frame (is-a?/c frame:basic<%>))) void?))]{ - This method is called by frames constructed with - @scheme[frame:basic-mixin] - when their titles change. + @defmethod*[(((frame-label-changed (frame (is-a?/c frame:basic<%>))) void?))]{ + This method is called by frames constructed with @racket[frame:basic-mixin] + when their titles change. Updates the windows menu of each frame in the group. } - @defmethod*[(((frame-shown/hidden) void?))]{ - This method is called by instances of - @scheme[frame:basic%] - to notify the frame group that - a frame's visibility is changed. + @defmethod*[(((frame-shown/hidden) void?))]{ + This method is called by instances of @racket[frame:basic%] to notify the + frame group that a frame's visibility is changed. Updates the Windows menus of all of the frames in the frame group. } + @defmethod*[(((for-each-frame (f ((is-a?/c frame:basic<%>) -> void?))) void?))]{ This method applies a function to each frame in the group. It also - remembers the function and applies it to any new frames that are added - to the group when they are added. + remembers the function and applies it to any new frames that are added to + the group when they are added. - See also - @method[group:% get-frames]. + See also @method[group:% get-frames]. - - Applies @scheme[f] to each frame in the group + Applies @racket[f] to each frame in the group } + @defmethod*[(((get-active-frame) (is-a?/c frame:basic<%>)))]{ - Returns the frame with the keyboard focus or the first frame in the - group. - + Returns the frame with the keyboard focus or the first frame in the group. } + @defmethod*[(((set-active-frame (frame (is-a?/c frame:basic<%>))) void?))]{ - Sets the active frame in the group. - This method is called by + Sets the active frame in the group. This method is called by @method[frame:register-group-mixin on-activate]. - } + @defmethod*[(((insert-frame (frame (is-a?/c frame:basic<%>))) void?))]{ Inserts a frame into the group. - } + @defmethod*[(((remove-frame (frame (is-a?/c frame:basic<%>))) void?))]{ Removes a frame from the group. - - } + @defmethod*[(((clear) boolean?))]{ - This removes all of the frames in the group. It does not close the frames. See also - @method[group:% on-close-all]and - @method[group:% can-close-all?]. - + This removes all of the frames in the group. It does not close the frames. + See also @method[group:% on-close-all]and @method[group:% can-close-all?]. } + @defmethod*[(((on-close-all) void?))]{ - Call this method to close all of the frames in the group. - The function - @method[group:% can-close-all?] - must have been called just before this function and it must have returned - @scheme[#t]. + Call this method to close all of the frames in the group. The function + @method[group:% can-close-all?] must have been called just before this + function and it must have returned @racket[#t]. - - Calls the - @method[top-level-window<%> on-close] - method and the - @method[top-level-window<%> show] - method (with @scheme[#f] as argument) - on each frame in the group. + Calls the @method[top-level-window<%> on-close] method and the + @method[top-level-window<%> show] method (with @racket[#f] as argument) on + each frame in the group. } + @defmethod*[(((can-close-all?) void?))]{ - Call this method to make sure that closing all of the frames in the frame groups is - permitted by the user. The function - @method[group:% on-close-all] + Call this method to make sure that closing all of the frames in the frame + groups is permitted by the user. The function @method[group:% on-close-all] is expected to be called just after this method is called. - - Calls the - @method[top-level-window<%> can-close?] - method of each frame in the group. + Calls the @method[top-level-window<%> can-close?] method of each frame in + the group. } @defmethod*[(((locate-file [name path?]) (or/c false/c (is-a?/c frame:basic<%>))))]{ - Returns the frame that is editing or viewing the file @scheme[name]. - + Returns the frame that is editing or viewing the file @racket[name]. } } diff --git a/collects/scribblings/framework/keymap.scrbl b/collects/scribblings/framework/keymap.scrbl index d2ecc6d409..d372a78501 100644 --- a/collects/scribblings/framework/keymap.scrbl +++ b/collects/scribblings/framework/keymap.scrbl @@ -5,41 +5,40 @@ @title{Keymap} @definterface[keymap:aug-keymap<%> (keymap%)]{ - This keymap overrides some of the built in @scheme[keymap%] methods - to be able to extract the keybindings from the keymap. - @defmethod*[(((get-chained-keymaps) (listof (is-a?/c keymap%))))]{ + This keymap overrides some of the built in @racket[keymap%] methods to be + able to extract the keybindings from the keymap. + @defmethod*[(((get-chained-keymaps) (listof (is-a?/c keymap%))))]{ Returns the list of keymaps that are chained to this one. } + @defmethod*[(((get-map-function-table) hash?))]{ - - Returns a hash-table that maps symbols naming key sequences to the - names of the keymap functions the are bound to. + Returns a hash-table that maps symbols naming key sequences to the names of + the keymap functions the are bound to. } - @defmethod*[(((get-map-function-table/ht (ht hash?)) hash?))]{ - This is a helper function for - @method[keymap:aug-keymap<%> get-map-function-table] - that returns the same result, except it accepts a hash-table that - it inserts the bindings into. It does not replace any bindings already in - @scheme[ht]. + @defmethod*[(((get-map-function-table/ht (ht hash?)) hash?))]{ + This is a helper function for @method[keymap:aug-keymap<%> + get-map-function-table] that returns the same result, except it accepts a + hash-table that it inserts the bindings into. It does not replace any + bindings already in @racket[ht]. } } @defmixin[keymap:aug-keymap-mixin (keymap%) (keymap:aug-keymap<%>)]{ @defmethod*[#:mode override (((chain-to-keymap (next (is-a?/c keymap%)) (prefix? boolean?)) void))]{ - Keeps a list of the keymaps chained to this one. } - @defmethod*[#:mode override (((remove-chained-keymap (keymap (is-a?/c keymap))) void))]{ + @defmethod*[#:mode override (((remove-chained-keymap (keymap (is-a?/c keymap))) void))]{ Keeps the list of the keymaps chained to this one up to date. } - @defmethod*[#:mode override (((map-function (key-name string) (function-name string)) void))]{ - Keeps a separate record of the key names and functions that they are - bound to in this keymap. + @defmethod*[#:mode override (((map-function (key-name string) (function-name string)) void))]{ + Keeps a separate record of the key names and functions that they are bound + to in this keymap. } } + @defclass[keymap:aug-keymap% (keymap:aug-keymap-mixin keymap%) ()]{} @(include-previously-extracted "main-extracts.rkt" #rx"^keymap:") diff --git a/collects/scribblings/framework/menu.scrbl b/collects/scribblings/framework/menu.scrbl index 117cdd1518..6d8943900a 100644 --- a/collects/scribblings/framework/menu.scrbl +++ b/collects/scribblings/framework/menu.scrbl @@ -5,42 +5,40 @@ @title{Menu} @definterface[menu:can-restore<%> (selectable-menu-item<%>)]{ - Classes created with this mixin remember their keybindings so the - keybindings can be removed and then restored. + Classes created with this mixin remember their keybindings so the keybindings + can be removed and then restored. + @defmethod*[(((restore-keybinding) void?))]{ Sets the keyboard shortcut to the setting it had when the class was created. - } } + @defmixin[menu:can-restore-mixin (selectable-menu-item<%>) (menu:can-restore<%>)]{ - } + @definterface[menu:can-restore-underscore<%> (labelled-menu-item<%>)]{ - These menus can save and restore the underscores (indicated - via the @litchar{&} characters in the original labels) in their - labels. + These menus can save and restore the underscores (indicated via the + @litchar{&} characters in the original labels) in their labels. + + If the preference @racket['framework:menu-bindings] is @racket[#f], calls + @method[menu:can-restore-underscore<%> erase-underscores] during + initialization. - If the preference @scheme['framework:menu-bindings] - is @scheme[#f], calls - @method[menu:can-restore-underscore<%> erase-underscores] - during initialization. @defmethod*[(((erase-underscores) void?))]{ - Erases the underscores in the label of this menu, but - remembers them so they can be restores with - @method[menu:can-restore-underscore<%> restore-underscores]. - + Erases the underscores in the label of this menu, but remembers them so + they can be restores with @method[menu:can-restore-underscore<%> + restore-underscores]. } + @defmethod*[(((restore-underscores) void?))]{ - Restores underscores in the menu's label to their original - state. - - + Restores underscores in the menu's label to their original state. } } -@defmixin[menu:can-restore-underscore-mixin (labelled-menu-item<%>) (menu:can-restore-underscore<%>)]{ +@defmixin[menu:can-restore-underscore-mixin (labelled-menu-item<%>) (menu:can-restore-underscore<%>)]{ } + @defclass[menu:can-restore-menu-item% (menu:can-restore-mixin menu-item%) ()]{} @defclass[menu:can-restore-checkable-menu-item% (menu:can-restore-mixin checkable-menu-item%) ()]{} @defclass[menu:can-restore-underscore-menu% (menu:can-restore-underscore-mixin menu%) ()]{} diff --git a/collects/scribblings/framework/mode-helpers.rkt b/collects/scribblings/framework/mode-helpers.rkt index c6ed06de04..c45b99f3bf 100644 --- a/collects/scribblings/framework/mode-helpers.rkt +++ b/collects/scribblings/framework/mode-helpers.rkt @@ -10,19 +10,19 @@ (syntax-case* spec (override augment) (λ (x y) (eq? (syntax-e x) (syntax-e y))) [(override mtd (x ...) ...) #'@defmethod*[(((mtd (x any/c) ...) any) ...)]{ - Delegates to the result of @method[mode:host-text<%> get-surrogate] if it is not @scheme[#f].}] + Delegates to the result of @method[mode:host-text<%> get-surrogate] if it is not @racket[#f].}] [(augment default mtd (x ...) ...) #'@defmethod*[(((mtd (x any/c) ...) any) ...)]{ - Delegates to the result of @method[mode:host-text<%> get-surrogate] if it is not @scheme[#f].}])) + Delegates to the result of @method[mode:host-text<%> get-surrogate] if it is not @racket[#f].}])) (define (spec->surrogate-method spec) (syntax-case* spec (override augment) (λ (x y) (eq? (syntax-e x) (syntax-e y))) [(override method (x ...) ...) #'@defmethod*[(((method (orig (is-a?/c text%)) (call-super (-> any)) (x any/c) ...) any) ...)]{ - Returns the result of invoking @scheme[call-super]. + Returns the result of invoking @racket[call-super]. }] [(augment default method (x ...) ...) #'@defmethod*[(((method (orig (is-a?/c text%)) (call-inner (-> any)) (x any/c) ...) any) ...)]{ - Returns the result of invoking @scheme[call-super]. + Returns the result of invoking @racket[call-super]. }])) diff --git a/collects/scribblings/framework/mode.scrbl b/collects/scribblings/framework/mode.scrbl index 44f367f923..839052e673 100644 --- a/collects/scribblings/framework/mode.scrbl +++ b/collects/scribblings/framework/mode.scrbl @@ -12,32 +12,32 @@ [(_ spec ...) #`(begin @definterface[mode:surrogate-text<%> ()]{ - @defmethod[(on-enable-surrogate) any]{ - Called by @method[mode:host-text<%> set-surrogate] to - notify the surrogate that it has just become active. - } - @defmethod[(on-disable-surrogate) any]{ - Called by @method[mode:host-text<%> set-surrogate] to - notify the surrogate that it has just been disabled. - } - } + @defmethod[(on-enable-surrogate) any]{ + Called by @method[mode:host-text<%> set-surrogate] to notify the + surrogate that it has just become active. + } + @defmethod[(on-disable-surrogate) any]{ + Called by @method[mode:host-text<%> set-surrogate] to notify the + surrogate that it has just been disabled. + } + } @defclass[mode:surrogate-text% object% (mode:surrogate-text<%>)]{ - @#,@(map spec->surrogate-method (syntax->list #'(spec ...))) + @#,@(map spec->surrogate-method (syntax->list #'(spec ...))) } @definterface[mode:host-text<%> ()]{ - @defmethod[(get-surrogate) - (or/c false/c (is-a?/c mode:surrogate-text<%>))]{ - Returns the currently active surrogate. - } - @defmethod[(set-surrogate - [surrogate (or/c false/c (is-a?/c mode:surrogate-text<%>))]) - void?]{ - Sets the current surrogate to @scheme[surrogate]. - } + @defmethod[(get-surrogate) + (or/c false/c (is-a?/c mode:surrogate-text<%>))]{ + Returns the currently active surrogate. + } + @defmethod[(set-surrogate + [surrogate (or/c false/c (is-a?/c mode:surrogate-text<%>))]) + void?]{ + Sets the current surrogate to @racket[surrogate]. + } } @defmixin[mode:host-text-mixin () (mode:host-text<%>)]{ - @#,@(map spec->host-method (syntax->list #'(spec ...))) -})])) + @#,@(map spec->host-method (syntax->list #'(spec ...))) + })])) (surrogate-methods docs) ) diff --git a/collects/scribblings/framework/panel.scrbl b/collects/scribblings/framework/panel.scrbl index 1de2ea31b5..f48b41435c 100644 --- a/collects/scribblings/framework/panel.scrbl +++ b/collects/scribblings/framework/panel.scrbl @@ -5,178 +5,164 @@ @title{Panel} @definterface[panel:single<%> (area-container<%>)]{ - See - @scheme[panel:single-mixin%]. + See @racket[panel:single-mixin%]. + @defmethod*[(((active-child (child (is-a?/c area<%>))) void?) ((active-child) (is-a?/c area<%>)))]{ - - Sets the active child to be @scheme[child] - + Sets the active child to be @racket[child] Returns the current active child. } } + @defmixin[panel:single-mixin (area-container<%>) (panel:single<%>)]{ - This mixin adds single panel functionality to an implementation of the - @scheme[area-container<%>] interface. + This mixin adds single panel functionality to an implementation of the + @racket[area-container<%>] interface. - Single panels place all of the children in the center of the panel, - and allow make one child to be visible at a time. The - @method[panel:single<%> active-child] - method controls which panel is currently active. + Single panels place all of the children in the center of the panel, and allow + make one child to be visible at a time. The + @method[panel:single<%> active-child] method controls which panel is + currently active. + + The @method[window<%> show] method is used to hide and show the children of a + single panel. - The - @method[window<%> show] - method is used to hide and show the children of a single panel. @defmethod*[#:mode override (((after-new-child (child (is-a?/c subarea<%>))) void?))]{ - - Hides this child by calling @scheme[(send child show #f)], unless - this is the first child in which case it does nothing. + Hides this child by calling @racket[(send child show #f)], unless this is + the first child in which case it does nothing. } + @defmethod*[#:mode override (((container-size) (values exact-integer? exact-integer?)))]{ - - Returns the maximum width of all the children and the maximum height - of all of the children. + Returns the maximum width of all the children and the maximum height of all + of the children. } - @defmethod*[#:mode override (((place-children) (listof (list/c exact-integer? exact-integer? exact-integer? exact-integer?))))]{ + @defmethod*[#:mode override (((place-children) (listof (list/c exact-integer? exact-integer? exact-integer? exact-integer?))))]{ Returns the positions for single panels and panes. } } + @definterface[panel:single-window<%> (panel:single<%> window<%>)]{ - } + @defmixin[panel:single-window-mixin (panel:single<%> window<%>) (panel:single-window<%>)]{ - @defmethod*[#:mode override (((container-size (info (listof (list/c exact-integer? exact-integer? boolean? boolean?)))) (values exact-integer? exact-integer?)))]{ - Factors the border width into the size calculation. } } + @defclass[panel:single% (panel:single-window-mixin (panel:single-mixin panel%)) ()]{} @defclass[panel:single-pane% (panel:single-mixin pane%) ()]{} + @definterface[panel:dragable<%> (window<%> area-container<%>)]{ - Classes matching this interface implement a panel where the - user can adjust the percentage of the space that each takes - up. The user adjusts the size by clicking and dragging the - empty space between the children. + Classes matching this interface implement a panel where the user can adjust + the percentage of the space that each takes up. The user adjusts the size by + clicking and dragging the empty space between the children. + @defmethod*[(((after-percentage-change) void?))]{ - This method is called when the user changes the percentage - by dragging the bar between the children, or when a new - child is added to the frame, but not when - @method[panel:dragable<%> set-percentages] - is called. - - Use - @method[panel:dragable<%> get-percentages] - to find the current percentages. - + This method is called when the user changes the percentage by dragging the + bar between the children, or when a new child is added to the frame, but + not when @method[panel:dragable<%> set-percentages] is called. + Use @method[panel:dragable<%> get-percentages] to find the current + percentages. } + @defmethod*[(((set-percentages (new-percentages (listof number?))) void?))]{ - Call this method to set the percentages that each window - takes up of the panel. + Call this method to set the percentages that each window takes up of the + panel. - - The argument, @scheme[new-percentages] must be a list of - numbers that sums to 1. It's length must be equal to the - number of children of the panel (see - @method[area-container<%> get-children]) and each percentage must correspond to a number of pixels - that is equal to or larger than the - minimum with of the child, as reported by - @method[area<%> min-width]. + The argument, @racket[new-percentages] must be a list of numbers that sums + to 1. It's length must be equal to the number of children of the panel (see + @method[area-container<%> get-children]) and each percentage must + correspond to a number of pixels that is equal to or larger than the + minimum with of the child, as reported by @method[area<%> min-width]. } + @defmethod*[(((get-percentages) (listof number?)))]{ Return the current percentages of the children. - } + @defmethod*[(((get-vertical?) boolean?))]{ - This method controls the behavior of the other overridden - methods in mixins that implement this interface. - - If it returns @scheme[#t], the panel will be vertically - aligned and if it returns @scheme[#f], they will be - horizontally aligned. + This method controls the behavior of the other overridden methods in mixins + that implement this interface. + If it returns @racket[#t], the panel will be vertically aligned and if it + returns @racket[#f], they will be horizontally aligned. } - + @defmethod[(set-orientation [horizontal? boolean?]) void?]{ - Sets the orientation of the panel, switching it from behaving - like a @racket[panel:horizontal-dragable<%>] and + Sets the orientation of the panel, switching it from behaving like a + @racket[panel:horizontal-dragable<%>] and @racket[panel:vertical-dragable<%>]. } } + @definterface[panel:vertical-dragable<%> (panel:dragable<%>)]{ - A panel that implements - @scheme[panel:vertical-dragable<%>]. It aligns its children vertically. + A panel that implements @racket[panel:vertical-dragable<%>]. It aligns its + children vertically. } + @definterface[panel:horizontal-dragable<%> (panel:dragable<%>)]{ - A panel that implements - @scheme[panel:horizontal-dragable<%>]. It aligns its children horizontally. + A panel that implements @racket[panel:horizontal-dragable<%>]. It aligns its + children horizontally. } + @defmixin[panel:dragable-mixin (window<%> area-container<%>) (panel:dragable<%>)]{ - This mixin adds the - @scheme[panel:dragable<%>] - functionality to a - @scheme[panel%]. - - It is not useful unless the - @method[panel:dragable<%> get-vertical?] - method is overridden. + This mixin adds the @racket[panel:dragable<%>] functionality to a + @racket[panel%]. + It is not useful unless the @method[panel:dragable<%> get-vertical?] method + is overridden. @defmethod*[#:mode override (((after-new-child (child (is-a?/c subarea<%>))) void?))]{ - - Updates the number of percentages to make sure that it - matches the number of children and calls - @method[panel:dragable<%> after-percentage-change]. + Updates the number of percentages to make sure that it matches the number + of children and calls @method[panel:dragable<%> after-percentage-change]. } + @defmethod*[#:mode override (((on-subwindow-event (receiver (is-a?/c window<%>)) (event (is-a?/c mouse-event%))) boolean?))]{ - - When the cursor is dragging the middle bar around, this - method handles the resizing of the two panes. + When the cursor is dragging the middle bar around, this method handles the + resizing of the two panes. } - @defmethod*[#:mode override (((place-children (info (listof (list/c exact-integer? exact-integer?))) (w exact-integer?) (h exact-integer?)) (listof (list/c exact-integer? exact-integer? exact-integer? exact-integer?))))]{ + @defmethod*[#:mode override + (((place-children (info (listof (list/c exact-integer? exact-integer?))) + (w exact-integer?) + (h exact-integer?)) + (listof (list/c exact-integer? exact-integer? exact-integer? exact-integer?))))]{ Places the children vertically in the panel, based on the percentages - returned from - @method[panel:dragable<%> get-percentages]. Also leaves a little gap between each pair of children. + returned from @method[panel:dragable<%> get-percentages]. Also leaves a + little gap between each pair of children. } + @defmethod*[#:mode override (((container-size (info (listof (list/c exact-integer? exact-integer? any/c any/c)))) - (values exact-integer? exact-integer?)))]{ - - Computes the minimum size the panel would have to be in - order to have the current percentages (see - @method[panel:dragable<%> get-percentages]). - + (values exact-integer? exact-integer?)))]{ + Computes the minimum size the panel would have to be in order to have the + current percentages (see @method[panel:dragable<%> get-percentages]). } } -@defmixin[panel:vertical-dragable-mixin (panel:dragable<%>) (panel:vertical-dragable<%>)]{ - This mixin merely overrides the - @method[panel:dragable<%> get-vertical?] - method of the - @scheme[panel:dragable-mixin] - to return @scheme[#t]. - @defmethod*[#:mode override (((get-vertical?) boolean?))]{ - Returns @scheme[#t]. +@defmixin[panel:vertical-dragable-mixin (panel:dragable<%>) (panel:vertical-dragable<%>)]{ + This mixin merely overrides the @method[panel:dragable<%> get-vertical?] + method of the @racket[panel:dragable-mixin] to return @racket[#t]. + + @defmethod*[#:mode override (((get-vertical?) boolean?))]{ + Returns @racket[#t]. } } @defmixin[panel:horizontal-dragable-mixin (panel:dragable<%>) (panel:vertical-dragable<%>)]{ - This mixin merely overrides the - @method[panel:dragable<%> get-vertical?] - method of the - @scheme[panel:dragable-mixin] - to return @scheme[#f]. - @defmethod*[#:mode override (((get-vertical?) boolean?))]{ + This mixin merely overrides the @method[panel:dragable<%> get-vertical?] + method of the @racket[panel:dragable-mixin] to return @racket[#f]. - Returns @scheme[#f]. + @defmethod*[#:mode override (((get-vertical?) boolean?))]{ + Returns @racket[#f]. } } + @defclass[panel:vertical-dragable% (panel:vertical-dragable-mixin (panel:dragable-mixin panel%)) ()]{} @defclass[panel:horizontal-dragable% (panel:horizontal-dragable-mixin (panel:dragable-mixin panel%)) ()]{} @definterface[panel:splitter<%> ()]{ - A panel that implements @scheme[panel:splitter<%>]. Children can be split + A panel that implements @racket[panel:splitter<%>]. Children can be split horizonally or vertically. } @@ -189,9 +175,9 @@ (maker (-> (is-a?/c panel:splitter<%>) (is-a?/c canvas<%>)))) (is-a?/c canvas<%>)]{ - Splits the @scheme[canvas] vertically by creating a new instance using - @scheme[maker]. This splitter object is passed as the argument to - @scheme[maker] and should be used as the @scheme[parent] field of the newly + Splits the @racket[canvas] vertically by creating a new instance using + @racket[maker]. This splitter object is passed as the argument to + @racket[maker] and should be used as the @racket[parent] field of the newly created canvas. } @@ -199,11 +185,11 @@ (maker (-> (is-a?/c panel:splitter<%>) (is-a?/c canvas<%>)))) (is-a?/c canvas<%>)]{ - Similar to @scheme[split-vertical] but splits horizontally. + Similar to @racket[split-vertical] but splits horizontally. } @defmethod[(collapse (canvas (is-a?/c canvas<%>))) void]{ - Removes the given @scheme[canvas] from the splitter hierarchy and collapses + Removes the given @racket[canvas] from the splitter hierarchy and collapses any split panes as necessary. } diff --git a/collects/scribblings/framework/scheme.scrbl b/collects/scribblings/framework/scheme.scrbl index 576aca589e..4a822f9009 100644 --- a/collects/scribblings/framework/scheme.scrbl +++ b/collects/scribblings/framework/scheme.scrbl @@ -43,159 +43,183 @@ } @definterface[scheme:text<%> (text:basic<%> mode:host-text<%> color:text<%>)]{ Texts matching this interface support Racket mode operations. + @defmethod*[(((get-limit (start exact-integer?)) exact-integer?))]{ - Returns a limit for backward-matching parenthesis starting at - position @scheme[start]. + Returns a limit for backward-matching parenthesis starting at position + @racket[start]. } + @defmethod*[(((balance-parens (key-event (is-a?/c key-event%))) void?))]{ - This function is called when the user types a close parenthesis in - the @scheme[text%]. If the close parenthesis that the user inserted - does not match the corresponding open parenthesis and the - @scheme['framework:fixup-parens] preference is @scheme[#t] (see - @scheme[preferences:get]) the correct closing parenthesis is - inserted. If the @scheme['framework:paren-match] preference is - @scheme[#t] (see @scheme[preferences:get]) the matching open - parenthesis is flashed. + This function is called when the user types a close parenthesis in the + @racket[text%]. If the close parenthesis that the user inserted does not + match the corresponding open parenthesis and the + @racket['framework:fixup-parens] preference is @racket[#t] (see + @racket[preferences:get]) the correct closing parenthesis is inserted. If + the @racket['framework:paren-match] preference is @racket[#t] (see + @racket[preferences:get]) the matching open parenthesis is flashed. } + @defmethod*[(((tabify-on-return?) boolean?))]{ The result of this method is used to determine if the return key automatically tabs over to the correct position. Override it to change its behavior. } + @defmethod*[(((tabify (start-pos exact-integer? (send this text get-start-position))) void?))]{ - Tabs the line containing by @scheme[start-pos] + Tabs the line containing by @racket[start-pos] } + @defmethod*[(((tabify-selection (start exact-integer?) (end exact-integer?)) void?))]{ - Sets the tabbing for the lines containing positions @scheme[start] - through @scheme[end]. + Sets the tabbing for the lines containing positions @racket[start] + through @racket[end]. } + @defmethod*[(((tabify-all) void?))]{ Tabs all lines. } + @defmethod*[(((insert-return) void?))]{ - Inserts a newline into the buffer. If - @method[scheme:text<%> tabify-on-return?] returns @scheme[#t], this - will tabify the new line. + Inserts a newline into the buffer. If @method[scheme:text<%> + tabify-on-return?] returns @racket[#t], this will tabify the new line. } + @defmethod*[(((box-comment-out-selection (start-pos (or/c (symbols 'start) exact-integer?)) (end-pos (or/c (symbols 'end) exact-integer?))) void?))]{ - This method comments out a selection in the text by putting it into - a comment box. + This method comments out a selection in the text by putting it into a + comment box. - Removes the region from @scheme[start-pos] to @scheme[end-pos] from - the editor and inserts a comment box with that region of text - inserted into the box. + Removes the region from @racket[start-pos] to @racket[end-pos] from the + editor and inserts a comment box with that region of text inserted into the + box. - If @scheme[start-pos] is @scheme['start], the starting point of the - selection is used. If @scheme[end-pos] is @scheme['end], the ending - point of the selection is used. + If @racket[start-pos] is @racket['start], the starting point of the + selection is used. If @racket[end-pos] is @racket['end], the ending point + of the selection is used. } + @defmethod*[(((comment-out-selection (start exact-integer?) (end exact-integer?)) void?))]{ - Comments the lines containing positions @scheme[start] through - @scheme[end] by inserting a semi-colon at the front of each line. + Comments the lines containing positions @racket[start] through @racket[end] + by inserting a semi-colon at the front of each line. } + @defmethod*[(((uncomment-selection (start exact-integer?) (end exact-integer?)) void?))]{ - Uncomments the lines containing positions @scheme[start] through - @scheme[end]. + Uncomments the lines containing positions @racket[start] through + @racket[end]. } + @defmethod*[(((get-forward-sexp (start exact-integer?)) (or/c #f exact-integer?)))]{ Returns the position of the end of next S-expression after position - @scheme[start], or @scheme[#f] if there is no appropriate answer. + @racket[start], or @racket[#f] if there is no appropriate answer. } + @defmethod*[(((remove-sexp (start exact-integer?)) void?))]{ Forward-deletes the S-expression starting after the position - @scheme[start]. + @racket[start]. } + @defmethod*[(((forward-sexp (start exact-integer?)) void?))]{ - Moves forward over the S-expression starting at position - @scheme[start]. + Moves forward over the S-expression starting at position @racket[start]. } + @defmethod*[(((flash-forward-sexp (start-pos exact-integer?)) void?))]{ - Flashes the parenthesis that closes the sexpression at - @scheme[start-pos]. + Flashes the parenthesis that closes the sexpression at @racket[start-pos]. } + @defmethod*[(((get-backward-sexp (start exact-integer?)) (or/c exact-integer? #f)))]{ - Returns the position of the start of the S-expression before or - containing @scheme[start], or @scheme[#f] if there is no appropriate - answer. + Returns the position of the start of the S-expression before or containing + @racket[start], or @racket[#f] if there is no appropriate answer. } + @defmethod*[(((flash-backward-sexp (start-pos exact-integer?)) void?))]{ - Flashes the parenthesis that opens the sexpression at - @scheme[start-pos]. + Flashes the parenthesis that opens the sexpression at @racket[start-pos]. } + @defmethod*[(((backward-sexp (start-pos exact-integer?)) void?))]{ Move the caret backwards one sexpression Moves the caret to the beginning of the sexpression that ends at - @scheme[start-pos]. + @racket[start-pos]. } + @defmethod*[(((find-up-sexp (start-pos exact-integer?)) (or/c #f exact-integer?)))]{ - Returns the position of the beginning of the next sexpression - outside the sexpression that contains @scheme[start-pos]. If there - is no such sexpression, it returns @scheme[#f]. + Returns the position of the beginning of the next sexpression outside the + sexpression that contains @racket[start-pos]. If there is no such + sexpression, it returns @racket[#f]. } + @defmethod*[(((up-sexp (start exact-integer?)) void?))]{ Moves backward out of the S-expression containing the position - @scheme[start]. + @racket[start]. } + @defmethod*[(((find-down-sexp (start-pos exact-integer?)) (or/c #f exact-integer?)))]{ - Returns the position of the beginning of the next sexpression inside - the sexpression that contains @scheme[start-pos]. If there is no - such sexpression, it returns @scheme[#f]. + Returns the position of the beginning of the next sexpression inside the + sexpression that contains @racket[start-pos]. If there is no such + sexpression, it returns @racket[#f]. } + @defmethod*[(((down-sexp (start exact-integer?)) void?))]{ - Moves forward into the next S-expression after the position - @scheme[start]. + Moves forward into the next S-expression after the position @racket[start]. } + @defmethod*[(((remove-parens-forward (start exact-integer?)) void?))]{ - Removes the parentheses from the S-expression starting after the - position @scheme[start]. + Removes the parentheses from the S-expression starting after the position + @racket[start]. } + @defmethod*[(((select-forward-sexp) void?))]{ Selects the next S-expression, starting at the start of the current selection. } + @defmethod*[(((select-backward-sexp) void?))]{ Selects the previous S-expression, starting at the start of the current selection. - } + @defmethod*[(((select-up-sexp) void?))]{ Selects the region to the enclosing S-expression, starting at the start of the current selection. + } - } @defmethod*[(((select-down-sexp) void?))]{ - Selects the region to the next contained S-expression, starting at the start of the current selection. + Selects the region to the next contained S-expression, starting at the + start of the current selection. } + @defmethod*[(((transpose-sexp (start exact-integer?)) void?))]{ - Swaps the S-expression beginning before the position @scheme[start] with - the next S-expression following @scheme[start]. + Swaps the S-expression beginning before the position @racket[start] with + the next S-expression following @racket[start]. } + @defmethod*[(((mark-matching-parenthesis (pos exact-positive-integer?)) void?))]{ - If the paren after @scheme[pos] is matched, this method - highlights it and its matching counterpart in dark green. + If the paren after @racket[pos] is matched, this method highlights it and + its matching counterpart in dark green. } + @defmethod*[(((get-tab-size) exact-integer?))]{ This method returns the current size of the tabs for scheme mode. See also @method[scheme:text<%> set-tab-size]. } + @defmethod*[(((set-tab-size (new-size exact-integer?)) void?))]{ This method sets the tab size for this text. } + @defmethod*[(((introduce-let-ans (start-pos exact-integer?)) void?))]{ Adds a let around the current s-expression and a printf into the body of the let. } + @defmethod*[(((move-sexp-out (start-pos exact-integer?)) void?))]{ Replaces the sexpression surrounding the insertion point with the sexpression following the insertion point. @@ -210,48 +234,54 @@ mixin's argument. @defmethod*[#:mode override (((get-word-at (pos exact-positive-integer?)) string?))]{ - Returns the word just before @scheme[pos], which is then used as the - prefix for auto-completion. + Returns the word just before @racket[pos], which is then used as the prefix + for auto-completion. } @defmethod[#:mode override (get-start-of-line [pos exact-nonnegative-integer?]) exact-nonnegative-integer?]{ - Returns the first non-whitespace character in the paragraph - containing @racket[pos], unless the position is already there, in - which case it returns the first position of the paragraph. + Returns the first non-whitespace character in the paragraph containing + @racket[pos], unless the position is already there, in which case it + returns the first position of the paragraph. } } + @definterface[scheme:text-mode<%> ()]{ - The result of @scheme[scheme:text-mode-mixin] implements this + The result of @racket[scheme:text-mode-mixin] implements this interface. } + @defmixin[scheme:text-mode-mixin (color:text-mode<%> mode:surrogate-text<%>) (scheme:text-mode<%>)]{ - This mixin adds Racket mode functionality to the mode that it is mixed - into. The resulting mode assumes that it is only set to an editor - that is the result of @scheme[scheme:text-mixin]. + This mixin adds Racket mode functionality to the mode that it is mixed into. + The resulting mode assumes that it is only set to an editor that is the + result of @racket[scheme:text-mixin]. @defmethod*[#:mode override (((on-disable-surrogate) void?))]{ - Removes the scheme keymap (see also @scheme[scheme:get-keymap]) and + Removes the scheme keymap (see also @racket[scheme:get-keymap]) and disables any parenthesis highlighting in the host editor. } + @defmethod*[#:mode override (((on-enable-surrogate) void?))]{ - Adds the scheme keymap (see also @scheme[scheme:get-keymap]) and - enables a parenthesis highlighting in the host editor. + Adds the scheme keymap (see also @racket[scheme:get-keymap]) and enables a + parenthesis highlighting in the host editor. } } + @defmixin[scheme:set-mode-mixin (scheme:text<%> mode:host-text<%>) ()]{ - This mixin creates a new instance of @scheme[scheme:text-mode%] and - installs it, by calling its own @method[mode:host-text<%> - set-surrogate] method with the object. + This mixin creates a new instance of @racket[scheme:text-mode%] and installs + it, by calling its own @method[mode:host-text<%> set-surrogate] method with + the object. } + @defclass[scheme:text% (scheme:set-mode-mixin (scheme:text-mixin (text:autocomplete-mixin (mode:host-text-mixin color:text%)))) ()]{} + @defclass[scheme:text-mode% (scheme:text-mode-mixin color:text-mode%) ()]{} @(include-previously-extracted "main-extracts.rkt" #rx"^scheme:") diff --git a/collects/scribblings/framework/splash.scrbl b/collects/scribblings/framework/splash.scrbl index 80335dd59a..482d658efc 100644 --- a/collects/scribblings/framework/splash.scrbl +++ b/collects/scribblings/framework/splash.scrbl @@ -73,7 +73,7 @@ that number to control the gauge along the bottom of the splash screen. the initial bitmap, use @racket[start-splash] instead. } @defproc[(get-splash-canvas) (is-a?/c canvas%)]{ - Returns the canvas where the splash screen bitmap is drawn (if there is a bitmap; see @racket[start-splash] for how the splash is drawn. + Returns the canvas where the splash screen bitmap is drawn (if there is a bitmap); see @racket[start-splash] for how the splash is drawn. } @defproc[(get-splash-eventspace) eventspace?]{ Returns the splash screen's eventspace. @@ -129,5 +129,5 @@ that number to control the gauge along the bottom of the splash screen. Triggers a refresh of the splash, handling the details of double buffering and doing the drawing on the splash's @tech[#:doc '(lib "scribblings/gui/gui.scrbl") #:key "eventspace"]{eventspace's} - main thread. + main thread. } diff --git a/collects/scribblings/framework/standard-menus.scrbl b/collects/scribblings/framework/standard-menus.scrbl index 0fcd3170d0..1ae7104690 100644 --- a/collects/scribblings/framework/standard-menus.scrbl +++ b/collects/scribblings/framework/standard-menus.scrbl @@ -1,13 +1,14 @@ ;; THIS FILE IS GENERATED. DO NOT EDIT. @definterface[frame:standard-menus<%> (frame:basic<%>)]{ - @(defmethod (on-close) void? "Removes the preferences callbacks for the menu items") + +@(defmethod (on-close) void? "Removes the preferences callbacks for the menu items") @(defmethod (get-menu%) (is-a?/c menu:can-restore-underscore-menu%) "The result of this method is used as the class" "\n" " " "for creating the result of these methods:" "\n" " " (method frame:standard-menus get-file-menu) "," "\n" " " (method frame:standard-menus get-edit-menu) ", and" "\n" " " (method frame:standard-menus get-help-menu) ".") -@(defmethod (get-menu-item%) (is-a?/c menu:can-restore-menu-item%) "The result of this method is used as the class for creating" "\n" "the menu items in this frame." "\n" "\n" "Defaultly returns " (scheme menu:can-restore-menu-item) ".") +@(defmethod (get-menu-item%) (is-a?/c menu:can-restore-menu-item%) "The result of this method is used as the class for creating" "\n" "the menu items in this frame." "\n" "\n" "Defaultly returns " (racket menu:can-restore-menu-item) ".") -@(defmethod (get-checkable-menu-item%) (is-a?/c menu:can-restore-checkable-menu-item%) "The result of this method is used as the class for creating" "\n" "checkable menu items in this class." "\n" "\n" "Defaultly returns " (scheme menu:can-restore-checkable-menu-item) ".") +@(defmethod (get-checkable-menu-item%) (is-a?/c menu:can-restore-checkable-menu-item%) "The result of this method is used as the class for creating" "\n" "checkable menu items in this class." "\n" "\n" "Defaultly returns " (racket menu:can-restore-checkable-menu-item) ".") @(defmethod (get-file-menu) (is-a?/c menu%) "Returns the file menu." "\n" "See also " (method frame:standard-menus<%> get-menu%) ".") @@ -15,337 +16,337 @@ @(defmethod (get-help-menu) (is-a?/c menu%) "Returns the help menu." "\n" "See also " (method frame:standard-menus<%> get-menu%) ".") -@(defmethod (file-menu:get-new-item) (or/c false/c (is-a?/c menu-item<%>)) "This method returns the " (scheme menu-item<%>) " object corresponding" "\n" "to this menu item, if it has been created (as controlled by" "\n" (method frame:standard-menus<%> file-menu:create-new?) ").") +@(defmethod (file-menu:get-new-item) (or/c false/c (is-a?/c menu-item<%>)) "This method returns the " (racket menu-item<%>) " object corresponding" "\n" "to this menu item, if it has been created (as controlled by" "\n" (method frame:standard-menus<%> file-menu:create-new?) ").") -@(defmethod (file-menu:create-new?) boolean? "The result of this method determines if the corresponding" "\n" "menu item is created. Override it to control the creation of the menu item." "\n" "\n" "Defaults to " (scheme #t) ".") +@(defmethod (file-menu:create-new?) boolean? "The result of this method determines if the corresponding" "\n" "menu item is created. Override it to control the creation of the menu item." "\n" "\n" "Defaults to " (racket #t) ".") -@(defmethod (file-menu:new-callback (item (is-a?/c menu-item<%>)) (control (is-a?/c control-event%))) void? "Defaults to " (schemeblock (begin (handler:edit-file #f) #t)) " ") +@(defmethod (file-menu:new-callback (item (is-a?/c menu-item<%>)) (control (is-a?/c control-event%))) void? "Defaults to " (racketblock (begin (handler:edit-file #f) #t)) " ") -@(defmethod (file-menu:new-on-demand (menu-item (is-a?/c menu-item<%>))) void? "The menu item's on-demand proc calls this method." "\n" "\n" "Defaults to " (schemeblock (void))) +@(defmethod (file-menu:new-on-demand (menu-item (is-a?/c menu-item<%>))) void? "The menu item's on-demand proc calls this method." "\n" "\n" "Defaults to " (racketblock (void))) -@(defmethod (file-menu:new-string) string? "The result of this method is used as the name of the " (scheme menu-item<%>) "." "\n" "\n" "Defaults to " (scheme (string-constant new-menu-item)) ".") +@(defmethod (file-menu:new-string) string? "The result of this method is used as the name of the " (racket menu-item<%>) "." "\n" "\n" "Defaults to " (racket (string-constant new-menu-item)) ".") -@(defmethod (file-menu:new-help-string) string? "The result of this method is used as the help string" "\n" "when the " (scheme menu-item<%>) " object is created." "\n" "\n" "Defaults to " (scheme (string-constant new-info)) ".") +@(defmethod (file-menu:new-help-string) string? "The result of this method is used as the help string" "\n" "when the " (racket menu-item<%>) " object is created." "\n" "\n" "Defaults to " (racket (string-constant new-info)) ".") @(defmethod (file-menu:between-new-and-open (menu (is-a?/c menu-item<%>))) void? "This method is called between the addition of the" "\n" (tt "new") " and the " (tt "open") " menu-item." "\n" "Override it to add additional menu items at that point. ") -@(defmethod (file-menu:get-open-item) (or/c false/c (is-a?/c menu-item<%>)) "This method returns the " (scheme menu-item<%>) " object corresponding" "\n" "to this menu item, if it has been created (as controlled by" "\n" (method frame:standard-menus<%> file-menu:create-open?) ").") +@(defmethod (file-menu:get-open-item) (or/c false/c (is-a?/c menu-item<%>)) "This method returns the " (racket menu-item<%>) " object corresponding" "\n" "to this menu item, if it has been created (as controlled by" "\n" (method frame:standard-menus<%> file-menu:create-open?) ").") -@(defmethod (file-menu:create-open?) boolean? "The result of this method determines if the corresponding" "\n" "menu item is created. Override it to control the creation of the menu item." "\n" "\n" "Defaults to " (scheme #t) ".") +@(defmethod (file-menu:create-open?) boolean? "The result of this method determines if the corresponding" "\n" "menu item is created. Override it to control the creation of the menu item." "\n" "\n" "Defaults to " (racket #t) ".") -@(defmethod (file-menu:open-callback (item (is-a?/c menu-item<%>)) (control (is-a?/c control-event%))) void? "Defaults to " (schemeblock (begin (handler:open-file) #t)) " ") +@(defmethod (file-menu:open-callback (item (is-a?/c menu-item<%>)) (control (is-a?/c control-event%))) void? "Defaults to " (racketblock (begin (handler:open-file) #t)) " ") -@(defmethod (file-menu:open-on-demand (menu-item (is-a?/c menu-item<%>))) void? "The menu item's on-demand proc calls this method." "\n" "\n" "Defaults to " (schemeblock (void))) +@(defmethod (file-menu:open-on-demand (menu-item (is-a?/c menu-item<%>))) void? "The menu item's on-demand proc calls this method." "\n" "\n" "Defaults to " (racketblock (void))) -@(defmethod (file-menu:open-string) string? "The result of this method is used as the name of the " (scheme menu-item<%>) "." "\n" "\n" "Defaults to " (scheme (string-constant open-menu-item)) ".") +@(defmethod (file-menu:open-string) string? "The result of this method is used as the name of the " (racket menu-item<%>) "." "\n" "\n" "Defaults to " (racket (string-constant open-menu-item)) ".") -@(defmethod (file-menu:open-help-string) string? "The result of this method is used as the help string" "\n" "when the " (scheme menu-item<%>) " object is created." "\n" "\n" "Defaults to " (scheme (string-constant open-info)) ".") +@(defmethod (file-menu:open-help-string) string? "The result of this method is used as the help string" "\n" "when the " (racket menu-item<%>) " object is created." "\n" "\n" "Defaults to " (racket (string-constant open-info)) ".") -@(defmethod (file-menu:get-open-recent-item) (or/c false/c (is-a?/c menu-item<%>)) "This method returns the " (scheme menu-item<%>) " object corresponding" "\n" "to this menu item, if it has been created (as controlled by" "\n" (method frame:standard-menus<%> file-menu:create-open-recent?) ").") +@(defmethod (file-menu:get-open-recent-item) (or/c false/c (is-a?/c menu-item<%>)) "This method returns the " (racket menu-item<%>) " object corresponding" "\n" "to this menu item, if it has been created (as controlled by" "\n" (method frame:standard-menus<%> file-menu:create-open-recent?) ").") -@(defmethod (file-menu:create-open-recent?) boolean? "The result of this method determines if the corresponding" "\n" "menu item is created. Override it to control the creation of the menu item." "\n" "\n" "Defaults to " (scheme #t) ".") +@(defmethod (file-menu:create-open-recent?) boolean? "The result of this method determines if the corresponding" "\n" "menu item is created. Override it to control the creation of the menu item." "\n" "\n" "Defaults to " (racket #t) ".") -@(defmethod (file-menu:open-recent-callback (x (is-a?/c menu-item<%>)) (y (is-a?/c control-event%))) void? "Defaults to " (schemeblock (void)) " ") +@(defmethod (file-menu:open-recent-callback (x (is-a?/c menu-item<%>)) (y (is-a?/c control-event%))) void? "Defaults to " (racketblock (void)) " ") -@(defmethod (file-menu:open-recent-on-demand (menu (is-a?/c menu-item<%>))) void? "The menu item's on-demand proc calls this method." "\n" "\n" "Defaults to " (schemeblock (handler:install-recent-items menu))) +@(defmethod (file-menu:open-recent-on-demand (menu (is-a?/c menu-item<%>))) void? "The menu item's on-demand proc calls this method." "\n" "\n" "Defaults to " (racketblock (handler:install-recent-items menu))) -@(defmethod (file-menu:open-recent-string) string? "The result of this method is used as the name of the " (scheme menu-item<%>) "." "\n" "\n" "Defaults to " (scheme (string-constant open-recent-menu-item)) ".") +@(defmethod (file-menu:open-recent-string) string? "The result of this method is used as the name of the " (racket menu-item<%>) "." "\n" "\n" "Defaults to " (racket (string-constant open-recent-menu-item)) ".") -@(defmethod (file-menu:open-recent-help-string) string? "The result of this method is used as the help string" "\n" "when the " (scheme menu-item<%>) " object is created." "\n" "\n" "Defaults to " (scheme (string-constant open-recent-info)) ".") +@(defmethod (file-menu:open-recent-help-string) string? "The result of this method is used as the help string" "\n" "when the " (racket menu-item<%>) " object is created." "\n" "\n" "Defaults to " (racket (string-constant open-recent-info)) ".") @(defmethod (file-menu:between-open-and-revert (menu (is-a?/c menu-item<%>))) void? "This method is called between the addition of the" "\n" (tt "open") " and the " (tt "revert") " menu-item." "\n" "Override it to add additional menu items at that point. ") -@(defmethod (file-menu:get-revert-item) (or/c false/c (is-a?/c menu-item<%>)) "This method returns the " (scheme menu-item<%>) " object corresponding" "\n" "to this menu item, if it has been created (as controlled by" "\n" (method frame:standard-menus<%> file-menu:create-revert?) ").") +@(defmethod (file-menu:get-revert-item) (or/c false/c (is-a?/c menu-item<%>)) "This method returns the " (racket menu-item<%>) " object corresponding" "\n" "to this menu item, if it has been created (as controlled by" "\n" (method frame:standard-menus<%> file-menu:create-revert?) ").") -@(defmethod (file-menu:create-revert?) boolean? "The result of this method determines if the corresponding" "\n" "menu item is created. Override it to control the creation of the menu item." "\n" "\n" "Defaults to " (scheme #f) ".") +@(defmethod (file-menu:create-revert?) boolean? "The result of this method determines if the corresponding" "\n" "menu item is created. Override it to control the creation of the menu item." "\n" "\n" "Defaults to " (racket #f) ".") -@(defmethod (file-menu:revert-callback (item (is-a?/c menu-item<%>)) (control (is-a?/c control-event%))) void? "Defaults to " (schemeblock (void)) " ") +@(defmethod (file-menu:revert-callback (item (is-a?/c menu-item<%>)) (control (is-a?/c control-event%))) void? "Defaults to " (racketblock (void)) " ") -@(defmethod (file-menu:revert-on-demand (menu-item (is-a?/c menu-item<%>))) void? "The menu item's on-demand proc calls this method." "\n" "\n" "Defaults to " (schemeblock (void))) +@(defmethod (file-menu:revert-on-demand (menu-item (is-a?/c menu-item<%>))) void? "The menu item's on-demand proc calls this method." "\n" "\n" "Defaults to " (racketblock (void))) -@(defmethod (file-menu:revert-string) string? "The result of this method is used as the name of the " (scheme menu-item<%>) "." "\n" "\n" "Defaults to " (scheme (string-constant revert-menu-item)) ".") +@(defmethod (file-menu:revert-string) string? "The result of this method is used as the name of the " (racket menu-item<%>) "." "\n" "\n" "Defaults to " (racket (string-constant revert-menu-item)) ".") -@(defmethod (file-menu:revert-help-string) string? "The result of this method is used as the help string" "\n" "when the " (scheme menu-item<%>) " object is created." "\n" "\n" "Defaults to " (scheme (string-constant revert-info)) ".") +@(defmethod (file-menu:revert-help-string) string? "The result of this method is used as the help string" "\n" "when the " (racket menu-item<%>) " object is created." "\n" "\n" "Defaults to " (racket (string-constant revert-info)) ".") @(defmethod (file-menu:between-revert-and-save (menu (is-a?/c menu-item<%>))) void? "This method is called between the addition of the" "\n" (tt "revert") " and the " (tt "save") " menu-item." "\n" "Override it to add additional menu items at that point. ") -@(defmethod (file-menu:get-save-item) (or/c false/c (is-a?/c menu-item<%>)) "This method returns the " (scheme menu-item<%>) " object corresponding" "\n" "to this menu item, if it has been created (as controlled by" "\n" (method frame:standard-menus<%> file-menu:create-save?) ").") +@(defmethod (file-menu:get-save-item) (or/c false/c (is-a?/c menu-item<%>)) "This method returns the " (racket menu-item<%>) " object corresponding" "\n" "to this menu item, if it has been created (as controlled by" "\n" (method frame:standard-menus<%> file-menu:create-save?) ").") -@(defmethod (file-menu:create-save?) boolean? "The result of this method determines if the corresponding" "\n" "menu item is created. Override it to control the creation of the menu item." "\n" "\n" "Defaults to " (scheme #f) ".") +@(defmethod (file-menu:create-save?) boolean? "The result of this method determines if the corresponding" "\n" "menu item is created. Override it to control the creation of the menu item." "\n" "\n" "Defaults to " (racket #f) ".") -@(defmethod (file-menu:save-callback (item (is-a?/c menu-item<%>)) (control (is-a?/c control-event%))) void? "Defaults to " (schemeblock (void)) " ") +@(defmethod (file-menu:save-callback (item (is-a?/c menu-item<%>)) (control (is-a?/c control-event%))) void? "Defaults to " (racketblock (void)) " ") -@(defmethod (file-menu:save-on-demand (menu-item (is-a?/c menu-item<%>))) void? "The menu item's on-demand proc calls this method." "\n" "\n" "Defaults to " (schemeblock (void))) +@(defmethod (file-menu:save-on-demand (menu-item (is-a?/c menu-item<%>))) void? "The menu item's on-demand proc calls this method." "\n" "\n" "Defaults to " (racketblock (void))) -@(defmethod (file-menu:save-string) string? "The result of this method is used as the name of the " (scheme menu-item<%>) "." "\n" "\n" "Defaults to " (scheme (string-constant save-menu-item)) ".") +@(defmethod (file-menu:save-string) string? "The result of this method is used as the name of the " (racket menu-item<%>) "." "\n" "\n" "Defaults to " (racket (string-constant save-menu-item)) ".") -@(defmethod (file-menu:save-help-string) string? "The result of this method is used as the help string" "\n" "when the " (scheme menu-item<%>) " object is created." "\n" "\n" "Defaults to " (scheme (string-constant save-info)) ".") +@(defmethod (file-menu:save-help-string) string? "The result of this method is used as the help string" "\n" "when the " (racket menu-item<%>) " object is created." "\n" "\n" "Defaults to " (racket (string-constant save-info)) ".") -@(defmethod (file-menu:get-save-as-item) (or/c false/c (is-a?/c menu-item<%>)) "This method returns the " (scheme menu-item<%>) " object corresponding" "\n" "to this menu item, if it has been created (as controlled by" "\n" (method frame:standard-menus<%> file-menu:create-save-as?) ").") +@(defmethod (file-menu:get-save-as-item) (or/c false/c (is-a?/c menu-item<%>)) "This method returns the " (racket menu-item<%>) " object corresponding" "\n" "to this menu item, if it has been created (as controlled by" "\n" (method frame:standard-menus<%> file-menu:create-save-as?) ").") -@(defmethod (file-menu:create-save-as?) boolean? "The result of this method determines if the corresponding" "\n" "menu item is created. Override it to control the creation of the menu item." "\n" "\n" "Defaults to " (scheme #f) ".") +@(defmethod (file-menu:create-save-as?) boolean? "The result of this method determines if the corresponding" "\n" "menu item is created. Override it to control the creation of the menu item." "\n" "\n" "Defaults to " (racket #f) ".") -@(defmethod (file-menu:save-as-callback (item (is-a?/c menu-item<%>)) (control (is-a?/c control-event%))) void? "Defaults to " (schemeblock (void)) " ") +@(defmethod (file-menu:save-as-callback (item (is-a?/c menu-item<%>)) (control (is-a?/c control-event%))) void? "Defaults to " (racketblock (void)) " ") -@(defmethod (file-menu:save-as-on-demand (menu-item (is-a?/c menu-item<%>))) void? "The menu item's on-demand proc calls this method." "\n" "\n" "Defaults to " (schemeblock (void))) +@(defmethod (file-menu:save-as-on-demand (menu-item (is-a?/c menu-item<%>))) void? "The menu item's on-demand proc calls this method." "\n" "\n" "Defaults to " (racketblock (void))) -@(defmethod (file-menu:save-as-string) string? "The result of this method is used as the name of the " (scheme menu-item<%>) "." "\n" "\n" "Defaults to " (scheme (string-constant save-as-menu-item)) ".") +@(defmethod (file-menu:save-as-string) string? "The result of this method is used as the name of the " (racket menu-item<%>) "." "\n" "\n" "Defaults to " (racket (string-constant save-as-menu-item)) ".") -@(defmethod (file-menu:save-as-help-string) string? "The result of this method is used as the help string" "\n" "when the " (scheme menu-item<%>) " object is created." "\n" "\n" "Defaults to " (scheme (string-constant save-as-info)) ".") +@(defmethod (file-menu:save-as-help-string) string? "The result of this method is used as the help string" "\n" "when the " (racket menu-item<%>) " object is created." "\n" "\n" "Defaults to " (racket (string-constant save-as-info)) ".") @(defmethod (file-menu:between-save-as-and-print (menu (is-a?/c menu-item<%>))) void? "This method is called between the addition of the" "\n" (tt "save-as") " and the " (tt "print") " menu-item." "\n" "Override it to add additional menu items at that point. ") -@(defmethod (file-menu:get-print-item) (or/c false/c (is-a?/c menu-item<%>)) "This method returns the " (scheme menu-item<%>) " object corresponding" "\n" "to this menu item, if it has been created (as controlled by" "\n" (method frame:standard-menus<%> file-menu:create-print?) ").") +@(defmethod (file-menu:get-print-item) (or/c false/c (is-a?/c menu-item<%>)) "This method returns the " (racket menu-item<%>) " object corresponding" "\n" "to this menu item, if it has been created (as controlled by" "\n" (method frame:standard-menus<%> file-menu:create-print?) ").") -@(defmethod (file-menu:create-print?) boolean? "The result of this method determines if the corresponding" "\n" "menu item is created. Override it to control the creation of the menu item." "\n" "\n" "Defaults to " (scheme #f) ".") +@(defmethod (file-menu:create-print?) boolean? "The result of this method determines if the corresponding" "\n" "menu item is created. Override it to control the creation of the menu item." "\n" "\n" "Defaults to " (racket #f) ".") -@(defmethod (file-menu:print-callback (item (is-a?/c menu-item<%>)) (control (is-a?/c control-event%))) void? "Defaults to " (schemeblock (void)) " ") +@(defmethod (file-menu:print-callback (item (is-a?/c menu-item<%>)) (control (is-a?/c control-event%))) void? "Defaults to " (racketblock (void)) " ") -@(defmethod (file-menu:print-on-demand (menu-item (is-a?/c menu-item<%>))) void? "The menu item's on-demand proc calls this method." "\n" "\n" "Defaults to " (schemeblock (void))) +@(defmethod (file-menu:print-on-demand (menu-item (is-a?/c menu-item<%>))) void? "The menu item's on-demand proc calls this method." "\n" "\n" "Defaults to " (racketblock (void))) -@(defmethod (file-menu:print-string) string? "The result of this method is used as the name of the " (scheme menu-item<%>) "." "\n" "\n" "Defaults to " (scheme (string-constant print-menu-item)) ".") +@(defmethod (file-menu:print-string) string? "The result of this method is used as the name of the " (racket menu-item<%>) "." "\n" "\n" "Defaults to " (racket (string-constant print-menu-item)) ".") -@(defmethod (file-menu:print-help-string) string? "The result of this method is used as the help string" "\n" "when the " (scheme menu-item<%>) " object is created." "\n" "\n" "Defaults to " (scheme (string-constant print-info)) ".") +@(defmethod (file-menu:print-help-string) string? "The result of this method is used as the help string" "\n" "when the " (racket menu-item<%>) " object is created." "\n" "\n" "Defaults to " (racket (string-constant print-info)) ".") @(defmethod (file-menu:between-print-and-close (menu (is-a?/c menu-item<%>))) void? "This method is called between the addition of the" "\n" (tt "print") " and the " (tt "close") " menu-item." "\n" "Override it to add additional menu items at that point. ") -@(defmethod (file-menu:get-close-item) (or/c false/c (is-a?/c menu-item<%>)) "This method returns the " (scheme menu-item<%>) " object corresponding" "\n" "to this menu item, if it has been created (as controlled by" "\n" (method frame:standard-menus<%> file-menu:create-close?) ").") +@(defmethod (file-menu:get-close-item) (or/c false/c (is-a?/c menu-item<%>)) "This method returns the " (racket menu-item<%>) " object corresponding" "\n" "to this menu item, if it has been created (as controlled by" "\n" (method frame:standard-menus<%> file-menu:create-close?) ").") -@(defmethod (file-menu:create-close?) boolean? "The result of this method determines if the corresponding" "\n" "menu item is created. Override it to control the creation of the menu item." "\n" "\n" "Defaults to " (scheme #t) ".") +@(defmethod (file-menu:create-close?) boolean? "The result of this method determines if the corresponding" "\n" "menu item is created. Override it to control the creation of the menu item." "\n" "\n" "Defaults to " (racket #t) ".") -@(defmethod (file-menu:close-callback (item (is-a?/c menu-item<%>)) (control (is-a?/c control-event%))) void? "Defaults to " (schemeblock (begin (when (can-close?) (on-close) (show #f)) #t)) " ") +@(defmethod (file-menu:close-callback (item (is-a?/c menu-item<%>)) (control (is-a?/c control-event%))) void? "Defaults to " (racketblock (begin (when (can-close?) (on-close) (show #f)) #t)) " ") -@(defmethod (file-menu:close-on-demand (menu-item (is-a?/c menu-item<%>))) void? "The menu item's on-demand proc calls this method." "\n" "\n" "Defaults to " (schemeblock (void))) +@(defmethod (file-menu:close-on-demand (menu-item (is-a?/c menu-item<%>))) void? "The menu item's on-demand proc calls this method." "\n" "\n" "Defaults to " (racketblock (void))) -@(defmethod (file-menu:close-string) string? "The result of this method is used as the name of the " (scheme menu-item<%>) "." "\n" "\n" "Defaults to " (scheme (string-constant close-menu-item)) ".") +@(defmethod (file-menu:close-string) string? "The result of this method is used as the name of the " (racket menu-item<%>) "." "\n" "\n" "Defaults to " (racket (string-constant close-menu-item)) ".") -@(defmethod (file-menu:close-help-string) string? "The result of this method is used as the help string" "\n" "when the " (scheme menu-item<%>) " object is created." "\n" "\n" "Defaults to " (scheme (string-constant close-info)) ".") +@(defmethod (file-menu:close-help-string) string? "The result of this method is used as the help string" "\n" "when the " (racket menu-item<%>) " object is created." "\n" "\n" "Defaults to " (racket (string-constant close-info)) ".") @(defmethod (file-menu:between-close-and-quit (menu (is-a?/c menu-item<%>))) void? "This method is called between the addition of the" "\n" (tt "close") " and the " (tt "quit") " menu-item." "\n" "Override it to add additional menu items at that point. ") -@(defmethod (file-menu:get-quit-item) (or/c false/c (is-a?/c menu-item<%>)) "This method returns the " (scheme menu-item<%>) " object corresponding" "\n" "to this menu item, if it has been created (as controlled by" "\n" (method frame:standard-menus<%> file-menu:create-quit?) ").") +@(defmethod (file-menu:get-quit-item) (or/c false/c (is-a?/c menu-item<%>)) "This method returns the " (racket menu-item<%>) " object corresponding" "\n" "to this menu item, if it has been created (as controlled by" "\n" (method frame:standard-menus<%> file-menu:create-quit?) ").") -@(defmethod (file-menu:create-quit?) boolean? "The result of this method determines if the corresponding" "\n" "menu item is created. Override it to control the creation of the menu item." "\n" "\n" "Defaults to " (scheme (not (eq? (system-type) (quote macosx)))) ".") +@(defmethod (file-menu:create-quit?) boolean? "The result of this method determines if the corresponding" "\n" "menu item is created. Override it to control the creation of the menu item." "\n" "\n" "Defaults to " (racket (not (eq? (system-type) (quote macosx)))) ".") -@(defmethod (file-menu:quit-callback (item (is-a?/c menu-item<%>)) (control (is-a?/c control-event%))) void? "Defaults to " (schemeblock (when (exit:user-oks-exit) (exit:exit))) " ") +@(defmethod (file-menu:quit-callback (item (is-a?/c menu-item<%>)) (control (is-a?/c control-event%))) void? "Defaults to " (racketblock (when (exit:user-oks-exit) (exit:exit))) " ") -@(defmethod (file-menu:quit-on-demand (menu-item (is-a?/c menu-item<%>))) void? "The menu item's on-demand proc calls this method." "\n" "\n" "Defaults to " (schemeblock (void))) +@(defmethod (file-menu:quit-on-demand (menu-item (is-a?/c menu-item<%>))) void? "The menu item's on-demand proc calls this method." "\n" "\n" "Defaults to " (racketblock (void))) -@(defmethod (file-menu:quit-string) string? "The result of this method is used as the name of the " (scheme menu-item<%>) "." "\n" "\n" "Defaults to " (scheme (if (eq? (system-type) (quote windows)) (string-constant quit-menu-item-windows) (string-constant quit-menu-item-others))) ".") +@(defmethod (file-menu:quit-string) string? "The result of this method is used as the name of the " (racket menu-item<%>) "." "\n" "\n" "Defaults to " (racket (if (eq? (system-type) (quote windows)) (string-constant quit-menu-item-windows) (string-constant quit-menu-item-others))) ".") -@(defmethod (file-menu:quit-help-string) string? "The result of this method is used as the help string" "\n" "when the " (scheme menu-item<%>) " object is created." "\n" "\n" "Defaults to " (scheme (string-constant quit-info)) ".") +@(defmethod (file-menu:quit-help-string) string? "The result of this method is used as the help string" "\n" "when the " (racket menu-item<%>) " object is created." "\n" "\n" "Defaults to " (racket (string-constant quit-info)) ".") @(defmethod (file-menu:after-quit (menu (is-a?/c menu-item<%>))) void? "This method is called " "after" " the addition of the" "\n" (tt "quit") " menu-item. Override it to add additional" "\n" "menu items at that point. ") -@(defmethod (edit-menu:get-undo-item) (or/c false/c (is-a?/c menu-item<%>)) "This method returns the " (scheme menu-item<%>) " object corresponding" "\n" "to this menu item, if it has been created (as controlled by" "\n" (method frame:standard-menus<%> edit-menu:create-undo?) ").") +@(defmethod (edit-menu:get-undo-item) (or/c false/c (is-a?/c menu-item<%>)) "This method returns the " (racket menu-item<%>) " object corresponding" "\n" "to this menu item, if it has been created (as controlled by" "\n" (method frame:standard-menus<%> edit-menu:create-undo?) ").") -@(defmethod (edit-menu:create-undo?) boolean? "The result of this method determines if the corresponding" "\n" "menu item is created. Override it to control the creation of the menu item." "\n" "\n" "Defaults to " (scheme #t) ".") +@(defmethod (edit-menu:create-undo?) boolean? "The result of this method determines if the corresponding" "\n" "menu item is created. Override it to control the creation of the menu item." "\n" "\n" "Defaults to " (racket #t) ".") -@(defmethod (edit-menu:undo-callback (menu (is-a?/c menu-item<%>)) (evt (is-a?/c control-event%))) void? "Defaults to " (schemeblock (begin (let ((edit (get-edit-target-object))) (when (and edit (is-a? edit editor<%>)) (send edit do-edit-operation (quote undo)))) #t)) " ") +@(defmethod (edit-menu:undo-callback (menu (is-a?/c menu-item<%>)) (evt (is-a?/c control-event%))) void? "Defaults to " (racketblock (begin (let ((edit (get-edit-target-object))) (when (and edit (is-a? edit editor<%>)) (send edit do-edit-operation (quote undo)))) #t)) " ") -@(defmethod (edit-menu:undo-on-demand (item (is-a?/c menu-item<%>))) void? "The menu item's on-demand proc calls this method." "\n" "\n" "Defaults to " (schemeblock (let* ((editor (get-edit-target-object)) (enable? (and editor (is-a? editor editor<%>) (send editor can-do-edit-operation? (quote undo))))) (send item enable enable?)))) +@(defmethod (edit-menu:undo-on-demand (item (is-a?/c menu-item<%>))) void? "The menu item's on-demand proc calls this method." "\n" "\n" "Defaults to " (racketblock (let* ((editor (get-edit-target-object)) (enable? (and editor (is-a? editor editor<%>) (send editor can-do-edit-operation? (quote undo))))) (send item enable enable?)))) -@(defmethod (edit-menu:undo-string) string? "The result of this method is used as the name of the " (scheme menu-item<%>) "." "\n" "\n" "Defaults to " (scheme (string-constant undo-menu-item)) ".") +@(defmethod (edit-menu:undo-string) string? "The result of this method is used as the name of the " (racket menu-item<%>) "." "\n" "\n" "Defaults to " (racket (string-constant undo-menu-item)) ".") -@(defmethod (edit-menu:undo-help-string) string? "The result of this method is used as the help string" "\n" "when the " (scheme menu-item<%>) " object is created." "\n" "\n" "Defaults to " (scheme (string-constant undo-info)) ".") +@(defmethod (edit-menu:undo-help-string) string? "The result of this method is used as the help string" "\n" "when the " (racket menu-item<%>) " object is created." "\n" "\n" "Defaults to " (racket (string-constant undo-info)) ".") -@(defmethod (edit-menu:get-redo-item) (or/c false/c (is-a?/c menu-item<%>)) "This method returns the " (scheme menu-item<%>) " object corresponding" "\n" "to this menu item, if it has been created (as controlled by" "\n" (method frame:standard-menus<%> edit-menu:create-redo?) ").") +@(defmethod (edit-menu:get-redo-item) (or/c false/c (is-a?/c menu-item<%>)) "This method returns the " (racket menu-item<%>) " object corresponding" "\n" "to this menu item, if it has been created (as controlled by" "\n" (method frame:standard-menus<%> edit-menu:create-redo?) ").") -@(defmethod (edit-menu:create-redo?) boolean? "The result of this method determines if the corresponding" "\n" "menu item is created. Override it to control the creation of the menu item." "\n" "\n" "Defaults to " (scheme #t) ".") +@(defmethod (edit-menu:create-redo?) boolean? "The result of this method determines if the corresponding" "\n" "menu item is created. Override it to control the creation of the menu item." "\n" "\n" "Defaults to " (racket #t) ".") -@(defmethod (edit-menu:redo-callback (menu (is-a?/c menu-item<%>)) (evt (is-a?/c control-event%))) void? "Defaults to " (schemeblock (begin (let ((edit (get-edit-target-object))) (when (and edit (is-a? edit editor<%>)) (send edit do-edit-operation (quote redo)))) #t)) " ") +@(defmethod (edit-menu:redo-callback (menu (is-a?/c menu-item<%>)) (evt (is-a?/c control-event%))) void? "Defaults to " (racketblock (begin (let ((edit (get-edit-target-object))) (when (and edit (is-a? edit editor<%>)) (send edit do-edit-operation (quote redo)))) #t)) " ") -@(defmethod (edit-menu:redo-on-demand (item (is-a?/c menu-item<%>))) void? "The menu item's on-demand proc calls this method." "\n" "\n" "Defaults to " (schemeblock (let* ((editor (get-edit-target-object)) (enable? (and editor (is-a? editor editor<%>) (send editor can-do-edit-operation? (quote redo))))) (send item enable enable?)))) +@(defmethod (edit-menu:redo-on-demand (item (is-a?/c menu-item<%>))) void? "The menu item's on-demand proc calls this method." "\n" "\n" "Defaults to " (racketblock (let* ((editor (get-edit-target-object)) (enable? (and editor (is-a? editor editor<%>) (send editor can-do-edit-operation? (quote redo))))) (send item enable enable?)))) -@(defmethod (edit-menu:redo-string) string? "The result of this method is used as the name of the " (scheme menu-item<%>) "." "\n" "\n" "Defaults to " (scheme (string-constant redo-menu-item)) ".") +@(defmethod (edit-menu:redo-string) string? "The result of this method is used as the name of the " (racket menu-item<%>) "." "\n" "\n" "Defaults to " (racket (string-constant redo-menu-item)) ".") -@(defmethod (edit-menu:redo-help-string) string? "The result of this method is used as the help string" "\n" "when the " (scheme menu-item<%>) " object is created." "\n" "\n" "Defaults to " (scheme (string-constant redo-info)) ".") +@(defmethod (edit-menu:redo-help-string) string? "The result of this method is used as the help string" "\n" "when the " (racket menu-item<%>) " object is created." "\n" "\n" "Defaults to " (racket (string-constant redo-info)) ".") @(defmethod (edit-menu:between-redo-and-cut (menu (is-a?/c menu-item<%>))) void? "This method is called between the addition of the" "\n" (tt "redo") " and the " (tt "cut") " menu-item." "\n" "Override it to add additional menu items at that point. ") -@(defmethod (edit-menu:get-cut-item) (or/c false/c (is-a?/c menu-item<%>)) "This method returns the " (scheme menu-item<%>) " object corresponding" "\n" "to this menu item, if it has been created (as controlled by" "\n" (method frame:standard-menus<%> edit-menu:create-cut?) ").") +@(defmethod (edit-menu:get-cut-item) (or/c false/c (is-a?/c menu-item<%>)) "This method returns the " (racket menu-item<%>) " object corresponding" "\n" "to this menu item, if it has been created (as controlled by" "\n" (method frame:standard-menus<%> edit-menu:create-cut?) ").") -@(defmethod (edit-menu:create-cut?) boolean? "The result of this method determines if the corresponding" "\n" "menu item is created. Override it to control the creation of the menu item." "\n" "\n" "Defaults to " (scheme #t) ".") +@(defmethod (edit-menu:create-cut?) boolean? "The result of this method determines if the corresponding" "\n" "menu item is created. Override it to control the creation of the menu item." "\n" "\n" "Defaults to " (racket #t) ".") -@(defmethod (edit-menu:cut-callback (menu (is-a?/c menu-item<%>)) (evt (is-a?/c control-event%))) void? "Defaults to " (schemeblock (begin (let ((edit (get-edit-target-object))) (when (and edit (is-a? edit editor<%>)) (send edit do-edit-operation (quote cut)))) #t)) " ") +@(defmethod (edit-menu:cut-callback (menu (is-a?/c menu-item<%>)) (evt (is-a?/c control-event%))) void? "Defaults to " (racketblock (begin (let ((edit (get-edit-target-object))) (when (and edit (is-a? edit editor<%>)) (send edit do-edit-operation (quote cut)))) #t)) " ") -@(defmethod (edit-menu:cut-on-demand (item (is-a?/c menu-item<%>))) void? "The menu item's on-demand proc calls this method." "\n" "\n" "Defaults to " (schemeblock (let* ((editor (get-edit-target-object)) (enable? (and editor (is-a? editor editor<%>) (send editor can-do-edit-operation? (quote cut))))) (send item enable enable?)))) +@(defmethod (edit-menu:cut-on-demand (item (is-a?/c menu-item<%>))) void? "The menu item's on-demand proc calls this method." "\n" "\n" "Defaults to " (racketblock (let* ((editor (get-edit-target-object)) (enable? (and editor (is-a? editor editor<%>) (send editor can-do-edit-operation? (quote cut))))) (send item enable enable?)))) -@(defmethod (edit-menu:cut-string) string? "The result of this method is used as the name of the " (scheme menu-item<%>) "." "\n" "\n" "Defaults to " (scheme (string-constant cut-menu-item)) ".") +@(defmethod (edit-menu:cut-string) string? "The result of this method is used as the name of the " (racket menu-item<%>) "." "\n" "\n" "Defaults to " (racket (string-constant cut-menu-item)) ".") -@(defmethod (edit-menu:cut-help-string) string? "The result of this method is used as the help string" "\n" "when the " (scheme menu-item<%>) " object is created." "\n" "\n" "Defaults to " (scheme (string-constant cut-info)) ".") +@(defmethod (edit-menu:cut-help-string) string? "The result of this method is used as the help string" "\n" "when the " (racket menu-item<%>) " object is created." "\n" "\n" "Defaults to " (racket (string-constant cut-info)) ".") @(defmethod (edit-menu:between-cut-and-copy (menu (is-a?/c menu-item<%>))) void? "This method is called between the addition of the" "\n" (tt "cut") " and the " (tt "copy") " menu-item." "\n" "Override it to add additional menu items at that point. ") -@(defmethod (edit-menu:get-copy-item) (or/c false/c (is-a?/c menu-item<%>)) "This method returns the " (scheme menu-item<%>) " object corresponding" "\n" "to this menu item, if it has been created (as controlled by" "\n" (method frame:standard-menus<%> edit-menu:create-copy?) ").") +@(defmethod (edit-menu:get-copy-item) (or/c false/c (is-a?/c menu-item<%>)) "This method returns the " (racket menu-item<%>) " object corresponding" "\n" "to this menu item, if it has been created (as controlled by" "\n" (method frame:standard-menus<%> edit-menu:create-copy?) ").") -@(defmethod (edit-menu:create-copy?) boolean? "The result of this method determines if the corresponding" "\n" "menu item is created. Override it to control the creation of the menu item." "\n" "\n" "Defaults to " (scheme #t) ".") +@(defmethod (edit-menu:create-copy?) boolean? "The result of this method determines if the corresponding" "\n" "menu item is created. Override it to control the creation of the menu item." "\n" "\n" "Defaults to " (racket #t) ".") -@(defmethod (edit-menu:copy-callback (menu (is-a?/c menu-item<%>)) (evt (is-a?/c control-event%))) void? "Defaults to " (schemeblock (begin (let ((edit (get-edit-target-object))) (when (and edit (is-a? edit editor<%>)) (send edit do-edit-operation (quote copy)))) #t)) " ") +@(defmethod (edit-menu:copy-callback (menu (is-a?/c menu-item<%>)) (evt (is-a?/c control-event%))) void? "Defaults to " (racketblock (begin (let ((edit (get-edit-target-object))) (when (and edit (is-a? edit editor<%>)) (send edit do-edit-operation (quote copy)))) #t)) " ") -@(defmethod (edit-menu:copy-on-demand (item (is-a?/c menu-item<%>))) void? "The menu item's on-demand proc calls this method." "\n" "\n" "Defaults to " (schemeblock (let* ((editor (get-edit-target-object)) (enable? (and editor (is-a? editor editor<%>) (send editor can-do-edit-operation? (quote copy))))) (send item enable enable?)))) +@(defmethod (edit-menu:copy-on-demand (item (is-a?/c menu-item<%>))) void? "The menu item's on-demand proc calls this method." "\n" "\n" "Defaults to " (racketblock (let* ((editor (get-edit-target-object)) (enable? (and editor (is-a? editor editor<%>) (send editor can-do-edit-operation? (quote copy))))) (send item enable enable?)))) -@(defmethod (edit-menu:copy-string) string? "The result of this method is used as the name of the " (scheme menu-item<%>) "." "\n" "\n" "Defaults to " (scheme (string-constant copy-menu-item)) ".") +@(defmethod (edit-menu:copy-string) string? "The result of this method is used as the name of the " (racket menu-item<%>) "." "\n" "\n" "Defaults to " (racket (string-constant copy-menu-item)) ".") -@(defmethod (edit-menu:copy-help-string) string? "The result of this method is used as the help string" "\n" "when the " (scheme menu-item<%>) " object is created." "\n" "\n" "Defaults to " (scheme (string-constant copy-info)) ".") +@(defmethod (edit-menu:copy-help-string) string? "The result of this method is used as the help string" "\n" "when the " (racket menu-item<%>) " object is created." "\n" "\n" "Defaults to " (racket (string-constant copy-info)) ".") @(defmethod (edit-menu:between-copy-and-paste (menu (is-a?/c menu-item<%>))) void? "This method is called between the addition of the" "\n" (tt "copy") " and the " (tt "paste") " menu-item." "\n" "Override it to add additional menu items at that point. ") -@(defmethod (edit-menu:get-paste-item) (or/c false/c (is-a?/c menu-item<%>)) "This method returns the " (scheme menu-item<%>) " object corresponding" "\n" "to this menu item, if it has been created (as controlled by" "\n" (method frame:standard-menus<%> edit-menu:create-paste?) ").") +@(defmethod (edit-menu:get-paste-item) (or/c false/c (is-a?/c menu-item<%>)) "This method returns the " (racket menu-item<%>) " object corresponding" "\n" "to this menu item, if it has been created (as controlled by" "\n" (method frame:standard-menus<%> edit-menu:create-paste?) ").") -@(defmethod (edit-menu:create-paste?) boolean? "The result of this method determines if the corresponding" "\n" "menu item is created. Override it to control the creation of the menu item." "\n" "\n" "Defaults to " (scheme #t) ".") +@(defmethod (edit-menu:create-paste?) boolean? "The result of this method determines if the corresponding" "\n" "menu item is created. Override it to control the creation of the menu item." "\n" "\n" "Defaults to " (racket #t) ".") -@(defmethod (edit-menu:paste-callback (menu (is-a?/c menu-item<%>)) (evt (is-a?/c control-event%))) void? "Defaults to " (schemeblock (begin (let ((edit (get-edit-target-object))) (when (and edit (is-a? edit editor<%>)) (send edit do-edit-operation (quote paste)))) #t)) " ") +@(defmethod (edit-menu:paste-callback (menu (is-a?/c menu-item<%>)) (evt (is-a?/c control-event%))) void? "Defaults to " (racketblock (begin (let ((edit (get-edit-target-object))) (when (and edit (is-a? edit editor<%>)) (send edit do-edit-operation (quote paste)))) #t)) " ") -@(defmethod (edit-menu:paste-on-demand (item (is-a?/c menu-item<%>))) void? "The menu item's on-demand proc calls this method." "\n" "\n" "Defaults to " (schemeblock (let* ((editor (get-edit-target-object)) (enable? (and editor (is-a? editor editor<%>) (send editor can-do-edit-operation? (quote paste))))) (send item enable enable?)))) +@(defmethod (edit-menu:paste-on-demand (item (is-a?/c menu-item<%>))) void? "The menu item's on-demand proc calls this method." "\n" "\n" "Defaults to " (racketblock (let* ((editor (get-edit-target-object)) (enable? (and editor (is-a? editor editor<%>) (send editor can-do-edit-operation? (quote paste))))) (send item enable enable?)))) -@(defmethod (edit-menu:paste-string) string? "The result of this method is used as the name of the " (scheme menu-item<%>) "." "\n" "\n" "Defaults to " (scheme (string-constant paste-menu-item)) ".") +@(defmethod (edit-menu:paste-string) string? "The result of this method is used as the name of the " (racket menu-item<%>) "." "\n" "\n" "Defaults to " (racket (string-constant paste-menu-item)) ".") -@(defmethod (edit-menu:paste-help-string) string? "The result of this method is used as the help string" "\n" "when the " (scheme menu-item<%>) " object is created." "\n" "\n" "Defaults to " (scheme (string-constant paste-info)) ".") +@(defmethod (edit-menu:paste-help-string) string? "The result of this method is used as the help string" "\n" "when the " (racket menu-item<%>) " object is created." "\n" "\n" "Defaults to " (racket (string-constant paste-info)) ".") @(defmethod (edit-menu:between-paste-and-clear (menu (is-a?/c menu-item<%>))) void? "This method is called between the addition of the" "\n" (tt "paste") " and the " (tt "clear") " menu-item." "\n" "Override it to add additional menu items at that point. ") -@(defmethod (edit-menu:get-clear-item) (or/c false/c (is-a?/c menu-item<%>)) "This method returns the " (scheme menu-item<%>) " object corresponding" "\n" "to this menu item, if it has been created (as controlled by" "\n" (method frame:standard-menus<%> edit-menu:create-clear?) ").") +@(defmethod (edit-menu:get-clear-item) (or/c false/c (is-a?/c menu-item<%>)) "This method returns the " (racket menu-item<%>) " object corresponding" "\n" "to this menu item, if it has been created (as controlled by" "\n" (method frame:standard-menus<%> edit-menu:create-clear?) ").") -@(defmethod (edit-menu:create-clear?) boolean? "The result of this method determines if the corresponding" "\n" "menu item is created. Override it to control the creation of the menu item." "\n" "\n" "Defaults to " (scheme #t) ".") +@(defmethod (edit-menu:create-clear?) boolean? "The result of this method determines if the corresponding" "\n" "menu item is created. Override it to control the creation of the menu item." "\n" "\n" "Defaults to " (racket #t) ".") -@(defmethod (edit-menu:clear-callback (menu (is-a?/c menu-item<%>)) (evt (is-a?/c control-event%))) void? "Defaults to " (schemeblock (begin (let ((edit (get-edit-target-object))) (when (and edit (is-a? edit editor<%>)) (send edit do-edit-operation (quote clear)))) #t)) " ") +@(defmethod (edit-menu:clear-callback (menu (is-a?/c menu-item<%>)) (evt (is-a?/c control-event%))) void? "Defaults to " (racketblock (begin (let ((edit (get-edit-target-object))) (when (and edit (is-a? edit editor<%>)) (send edit do-edit-operation (quote clear)))) #t)) " ") -@(defmethod (edit-menu:clear-on-demand (item (is-a?/c menu-item<%>))) void? "The menu item's on-demand proc calls this method." "\n" "\n" "Defaults to " (schemeblock (let* ((editor (get-edit-target-object)) (enable? (and editor (is-a? editor editor<%>) (send editor can-do-edit-operation? (quote clear))))) (send item enable enable?)))) +@(defmethod (edit-menu:clear-on-demand (item (is-a?/c menu-item<%>))) void? "The menu item's on-demand proc calls this method." "\n" "\n" "Defaults to " (racketblock (let* ((editor (get-edit-target-object)) (enable? (and editor (is-a? editor editor<%>) (send editor can-do-edit-operation? (quote clear))))) (send item enable enable?)))) -@(defmethod (edit-menu:clear-string) string? "The result of this method is used as the name of the " (scheme menu-item<%>) "." "\n" "\n" "Defaults to " (scheme (if (eq? (system-type) (quote windows)) (string-constant clear-menu-item-windows) (string-constant clear-menu-item-windows))) ".") +@(defmethod (edit-menu:clear-string) string? "The result of this method is used as the name of the " (racket menu-item<%>) "." "\n" "\n" "Defaults to " (racket (if (eq? (system-type) (quote windows)) (string-constant clear-menu-item-windows) (string-constant clear-menu-item-windows))) ".") -@(defmethod (edit-menu:clear-help-string) string? "The result of this method is used as the help string" "\n" "when the " (scheme menu-item<%>) " object is created." "\n" "\n" "Defaults to " (scheme (string-constant clear-info)) ".") +@(defmethod (edit-menu:clear-help-string) string? "The result of this method is used as the help string" "\n" "when the " (racket menu-item<%>) " object is created." "\n" "\n" "Defaults to " (racket (string-constant clear-info)) ".") @(defmethod (edit-menu:between-clear-and-select-all (menu (is-a?/c menu-item<%>))) void? "This method is called between the addition of the" "\n" (tt "clear") " and the " (tt "select-all") " menu-item." "\n" "Override it to add additional menu items at that point. ") -@(defmethod (edit-menu:get-select-all-item) (or/c false/c (is-a?/c menu-item<%>)) "This method returns the " (scheme menu-item<%>) " object corresponding" "\n" "to this menu item, if it has been created (as controlled by" "\n" (method frame:standard-menus<%> edit-menu:create-select-all?) ").") +@(defmethod (edit-menu:get-select-all-item) (or/c false/c (is-a?/c menu-item<%>)) "This method returns the " (racket menu-item<%>) " object corresponding" "\n" "to this menu item, if it has been created (as controlled by" "\n" (method frame:standard-menus<%> edit-menu:create-select-all?) ").") -@(defmethod (edit-menu:create-select-all?) boolean? "The result of this method determines if the corresponding" "\n" "menu item is created. Override it to control the creation of the menu item." "\n" "\n" "Defaults to " (scheme #t) ".") +@(defmethod (edit-menu:create-select-all?) boolean? "The result of this method determines if the corresponding" "\n" "menu item is created. Override it to control the creation of the menu item." "\n" "\n" "Defaults to " (racket #t) ".") -@(defmethod (edit-menu:select-all-callback (menu (is-a?/c menu-item<%>)) (evt (is-a?/c control-event%))) void? "Defaults to " (schemeblock (begin (let ((edit (get-edit-target-object))) (when (and edit (is-a? edit editor<%>)) (send edit do-edit-operation (quote select-all)))) #t)) " ") +@(defmethod (edit-menu:select-all-callback (menu (is-a?/c menu-item<%>)) (evt (is-a?/c control-event%))) void? "Defaults to " (racketblock (begin (let ((edit (get-edit-target-object))) (when (and edit (is-a? edit editor<%>)) (send edit do-edit-operation (quote select-all)))) #t)) " ") -@(defmethod (edit-menu:select-all-on-demand (item (is-a?/c menu-item<%>))) void? "The menu item's on-demand proc calls this method." "\n" "\n" "Defaults to " (schemeblock (let* ((editor (get-edit-target-object)) (enable? (and editor (is-a? editor editor<%>) (send editor can-do-edit-operation? (quote select-all))))) (send item enable enable?)))) +@(defmethod (edit-menu:select-all-on-demand (item (is-a?/c menu-item<%>))) void? "The menu item's on-demand proc calls this method." "\n" "\n" "Defaults to " (racketblock (let* ((editor (get-edit-target-object)) (enable? (and editor (is-a? editor editor<%>) (send editor can-do-edit-operation? (quote select-all))))) (send item enable enable?)))) -@(defmethod (edit-menu:select-all-string) string? "The result of this method is used as the name of the " (scheme menu-item<%>) "." "\n" "\n" "Defaults to " (scheme (string-constant select-all-menu-item)) ".") +@(defmethod (edit-menu:select-all-string) string? "The result of this method is used as the name of the " (racket menu-item<%>) "." "\n" "\n" "Defaults to " (racket (string-constant select-all-menu-item)) ".") -@(defmethod (edit-menu:select-all-help-string) string? "The result of this method is used as the help string" "\n" "when the " (scheme menu-item<%>) " object is created." "\n" "\n" "Defaults to " (scheme (string-constant select-all-info)) ".") +@(defmethod (edit-menu:select-all-help-string) string? "The result of this method is used as the help string" "\n" "when the " (racket menu-item<%>) " object is created." "\n" "\n" "Defaults to " (racket (string-constant select-all-info)) ".") @(defmethod (edit-menu:between-select-all-and-find (menu (is-a?/c menu-item<%>))) void? "This method is called between the addition of the" "\n" (tt "select-all") " and the " (tt "find") " menu-item." "\n" "Override it to add additional menu items at that point. ") -@(defmethod (edit-menu:get-find-item) (or/c false/c (is-a?/c menu-item<%>)) "This method returns the " (scheme menu-item<%>) " object corresponding" "\n" "to this menu item, if it has been created (as controlled by" "\n" (method frame:standard-menus<%> edit-menu:create-find?) ").") +@(defmethod (edit-menu:get-find-item) (or/c false/c (is-a?/c menu-item<%>)) "This method returns the " (racket menu-item<%>) " object corresponding" "\n" "to this menu item, if it has been created (as controlled by" "\n" (method frame:standard-menus<%> edit-menu:create-find?) ").") -@(defmethod (edit-menu:create-find?) boolean? "The result of this method determines if the corresponding" "\n" "menu item is created. Override it to control the creation of the menu item." "\n" "\n" "Defaults to " (scheme #f) ".") +@(defmethod (edit-menu:create-find?) boolean? "The result of this method determines if the corresponding" "\n" "menu item is created. Override it to control the creation of the menu item." "\n" "\n" "Defaults to " (racket #f) ".") -@(defmethod (edit-menu:find-callback (item (is-a?/c menu-item<%>)) (control (is-a?/c control-event%))) void? "Defaults to " (schemeblock (void)) " ") +@(defmethod (edit-menu:find-callback (item (is-a?/c menu-item<%>)) (control (is-a?/c control-event%))) void? "Defaults to " (racketblock (void)) " ") -@(defmethod (edit-menu:find-on-demand (item (is-a?/c menu-item<%>))) void? "The menu item's on-demand proc calls this method." "\n" "\n" "Defaults to " (schemeblock (send item enable (let ((target (get-edit-target-object))) (and target (is-a? target editor<%>)))))) +@(defmethod (edit-menu:find-on-demand (item (is-a?/c menu-item<%>))) void? "The menu item's on-demand proc calls this method." "\n" "\n" "Defaults to " (racketblock (send item enable (let ((target (get-edit-target-object))) (and target (is-a? target editor<%>)))))) -@(defmethod (edit-menu:find-string) string? "The result of this method is used as the name of the " (scheme menu-item<%>) "." "\n" "\n" "Defaults to " (scheme (string-constant find-menu-item)) ".") +@(defmethod (edit-menu:find-string) string? "The result of this method is used as the name of the " (racket menu-item<%>) "." "\n" "\n" "Defaults to " (racket (string-constant find-menu-item)) ".") -@(defmethod (edit-menu:find-help-string) string? "The result of this method is used as the help string" "\n" "when the " (scheme menu-item<%>) " object is created." "\n" "\n" "Defaults to " (scheme (string-constant find-info)) ".") +@(defmethod (edit-menu:find-help-string) string? "The result of this method is used as the help string" "\n" "when the " (racket menu-item<%>) " object is created." "\n" "\n" "Defaults to " (racket (string-constant find-info)) ".") -@(defmethod (edit-menu:get-find-next-item) (or/c false/c (is-a?/c menu-item<%>)) "This method returns the " (scheme menu-item<%>) " object corresponding" "\n" "to this menu item, if it has been created (as controlled by" "\n" (method frame:standard-menus<%> edit-menu:create-find-next?) ").") +@(defmethod (edit-menu:get-find-next-item) (or/c false/c (is-a?/c menu-item<%>)) "This method returns the " (racket menu-item<%>) " object corresponding" "\n" "to this menu item, if it has been created (as controlled by" "\n" (method frame:standard-menus<%> edit-menu:create-find-next?) ").") -@(defmethod (edit-menu:create-find-next?) boolean? "The result of this method determines if the corresponding" "\n" "menu item is created. Override it to control the creation of the menu item." "\n" "\n" "Defaults to " (scheme #f) ".") +@(defmethod (edit-menu:create-find-next?) boolean? "The result of this method determines if the corresponding" "\n" "menu item is created. Override it to control the creation of the menu item." "\n" "\n" "Defaults to " (racket #f) ".") -@(defmethod (edit-menu:find-next-callback (item (is-a?/c menu-item<%>)) (control (is-a?/c control-event%))) void? "Defaults to " (schemeblock (void)) " ") +@(defmethod (edit-menu:find-next-callback (item (is-a?/c menu-item<%>)) (control (is-a?/c control-event%))) void? "Defaults to " (racketblock (void)) " ") -@(defmethod (edit-menu:find-next-on-demand (item (is-a?/c menu-item<%>))) void? "The menu item's on-demand proc calls this method." "\n" "\n" "Defaults to " (schemeblock (send item enable (let ((target (get-edit-target-object))) (and target (is-a? target editor<%>)))))) +@(defmethod (edit-menu:find-next-on-demand (item (is-a?/c menu-item<%>))) void? "The menu item's on-demand proc calls this method." "\n" "\n" "Defaults to " (racketblock (send item enable (let ((target (get-edit-target-object))) (and target (is-a? target editor<%>)))))) -@(defmethod (edit-menu:find-next-string) string? "The result of this method is used as the name of the " (scheme menu-item<%>) "." "\n" "\n" "Defaults to " (scheme (string-constant find-next-menu-item)) ".") +@(defmethod (edit-menu:find-next-string) string? "The result of this method is used as the name of the " (racket menu-item<%>) "." "\n" "\n" "Defaults to " (racket (string-constant find-next-menu-item)) ".") -@(defmethod (edit-menu:find-next-help-string) string? "The result of this method is used as the help string" "\n" "when the " (scheme menu-item<%>) " object is created." "\n" "\n" "Defaults to " (scheme (string-constant find-next-info)) ".") +@(defmethod (edit-menu:find-next-help-string) string? "The result of this method is used as the help string" "\n" "when the " (racket menu-item<%>) " object is created." "\n" "\n" "Defaults to " (racket (string-constant find-next-info)) ".") -@(defmethod (edit-menu:get-find-previous-item) (or/c false/c (is-a?/c menu-item<%>)) "This method returns the " (scheme menu-item<%>) " object corresponding" "\n" "to this menu item, if it has been created (as controlled by" "\n" (method frame:standard-menus<%> edit-menu:create-find-previous?) ").") +@(defmethod (edit-menu:get-find-previous-item) (or/c false/c (is-a?/c menu-item<%>)) "This method returns the " (racket menu-item<%>) " object corresponding" "\n" "to this menu item, if it has been created (as controlled by" "\n" (method frame:standard-menus<%> edit-menu:create-find-previous?) ").") -@(defmethod (edit-menu:create-find-previous?) boolean? "The result of this method determines if the corresponding" "\n" "menu item is created. Override it to control the creation of the menu item." "\n" "\n" "Defaults to " (scheme #f) ".") +@(defmethod (edit-menu:create-find-previous?) boolean? "The result of this method determines if the corresponding" "\n" "menu item is created. Override it to control the creation of the menu item." "\n" "\n" "Defaults to " (racket #f) ".") -@(defmethod (edit-menu:find-previous-callback (item (is-a?/c menu-item<%>)) (control (is-a?/c control-event%))) void? "Defaults to " (schemeblock (void)) " ") +@(defmethod (edit-menu:find-previous-callback (item (is-a?/c menu-item<%>)) (control (is-a?/c control-event%))) void? "Defaults to " (racketblock (void)) " ") -@(defmethod (edit-menu:find-previous-on-demand (item (is-a?/c menu-item<%>))) void? "The menu item's on-demand proc calls this method." "\n" "\n" "Defaults to " (schemeblock (send item enable (let ((target (get-edit-target-object))) (and target (is-a? target editor<%>)))))) +@(defmethod (edit-menu:find-previous-on-demand (item (is-a?/c menu-item<%>))) void? "The menu item's on-demand proc calls this method." "\n" "\n" "Defaults to " (racketblock (send item enable (let ((target (get-edit-target-object))) (and target (is-a? target editor<%>)))))) -@(defmethod (edit-menu:find-previous-string) string? "The result of this method is used as the name of the " (scheme menu-item<%>) "." "\n" "\n" "Defaults to " (scheme (string-constant find-previous-menu-item)) ".") +@(defmethod (edit-menu:find-previous-string) string? "The result of this method is used as the name of the " (racket menu-item<%>) "." "\n" "\n" "Defaults to " (racket (string-constant find-previous-menu-item)) ".") -@(defmethod (edit-menu:find-previous-help-string) string? "The result of this method is used as the help string" "\n" "when the " (scheme menu-item<%>) " object is created." "\n" "\n" "Defaults to " (scheme (string-constant find-previous-info)) ".") +@(defmethod (edit-menu:find-previous-help-string) string? "The result of this method is used as the help string" "\n" "when the " (racket menu-item<%>) " object is created." "\n" "\n" "Defaults to " (racket (string-constant find-previous-info)) ".") -@(defmethod (edit-menu:get-show/hide-replace-item) (or/c false/c (is-a?/c menu-item<%>)) "This method returns the " (scheme menu-item<%>) " object corresponding" "\n" "to this menu item, if it has been created (as controlled by" "\n" (method frame:standard-menus<%> edit-menu:create-show/hide-replace?) ").") +@(defmethod (edit-menu:get-show/hide-replace-item) (or/c false/c (is-a?/c menu-item<%>)) "This method returns the " (racket menu-item<%>) " object corresponding" "\n" "to this menu item, if it has been created (as controlled by" "\n" (method frame:standard-menus<%> edit-menu:create-show/hide-replace?) ").") -@(defmethod (edit-menu:create-show/hide-replace?) boolean? "The result of this method determines if the corresponding" "\n" "menu item is created. Override it to control the creation of the menu item." "\n" "\n" "Defaults to " (scheme #f) ".") +@(defmethod (edit-menu:create-show/hide-replace?) boolean? "The result of this method determines if the corresponding" "\n" "menu item is created. Override it to control the creation of the menu item." "\n" "\n" "Defaults to " (racket #f) ".") -@(defmethod (edit-menu:show/hide-replace-callback (item (is-a?/c menu-item<%>)) (control (is-a?/c control-event%))) void? "Defaults to " (schemeblock (void)) " ") +@(defmethod (edit-menu:show/hide-replace-callback (item (is-a?/c menu-item<%>)) (control (is-a?/c control-event%))) void? "Defaults to " (racketblock (void)) " ") -@(defmethod (edit-menu:show/hide-replace-on-demand (menu-item (is-a?/c menu-item<%>))) void? "The menu item's on-demand proc calls this method." "\n" "\n" "Defaults to " (schemeblock (void))) +@(defmethod (edit-menu:show/hide-replace-on-demand (menu-item (is-a?/c menu-item<%>))) void? "The menu item's on-demand proc calls this method." "\n" "\n" "Defaults to " (racketblock (void))) -@(defmethod (edit-menu:show/hide-replace-string) string? "The result of this method is used as the name of the " (scheme menu-item<%>) "." "\n" "\n" "Defaults to " (scheme (string-constant show-replace-menu-item)) ".") +@(defmethod (edit-menu:show/hide-replace-string) string? "The result of this method is used as the name of the " (racket menu-item<%>) "." "\n" "\n" "Defaults to " (racket (string-constant show-replace-menu-item)) ".") -@(defmethod (edit-menu:show/hide-replace-help-string) string? "The result of this method is used as the help string" "\n" "when the " (scheme menu-item<%>) " object is created." "\n" "\n" "Defaults to " (scheme (string-constant show/hide-replace-info)) ".") +@(defmethod (edit-menu:show/hide-replace-help-string) string? "The result of this method is used as the help string" "\n" "when the " (racket menu-item<%>) " object is created." "\n" "\n" "Defaults to " (racket (string-constant show/hide-replace-info)) ".") -@(defmethod (edit-menu:get-replace-item) (or/c false/c (is-a?/c menu-item<%>)) "This method returns the " (scheme menu-item<%>) " object corresponding" "\n" "to this menu item, if it has been created (as controlled by" "\n" (method frame:standard-menus<%> edit-menu:create-replace?) ").") +@(defmethod (edit-menu:get-replace-item) (or/c false/c (is-a?/c menu-item<%>)) "This method returns the " (racket menu-item<%>) " object corresponding" "\n" "to this menu item, if it has been created (as controlled by" "\n" (method frame:standard-menus<%> edit-menu:create-replace?) ").") -@(defmethod (edit-menu:create-replace?) boolean? "The result of this method determines if the corresponding" "\n" "menu item is created. Override it to control the creation of the menu item." "\n" "\n" "Defaults to " (scheme #f) ".") +@(defmethod (edit-menu:create-replace?) boolean? "The result of this method determines if the corresponding" "\n" "menu item is created. Override it to control the creation of the menu item." "\n" "\n" "Defaults to " (racket #f) ".") -@(defmethod (edit-menu:replace-callback (item (is-a?/c menu-item<%>)) (control (is-a?/c control-event%))) void? "Defaults to " (schemeblock (void)) " ") +@(defmethod (edit-menu:replace-callback (item (is-a?/c menu-item<%>)) (control (is-a?/c control-event%))) void? "Defaults to " (racketblock (void)) " ") -@(defmethod (edit-menu:replace-on-demand (menu-item (is-a?/c menu-item<%>))) void? "The menu item's on-demand proc calls this method." "\n" "\n" "Defaults to " (schemeblock (void))) +@(defmethod (edit-menu:replace-on-demand (menu-item (is-a?/c menu-item<%>))) void? "The menu item's on-demand proc calls this method." "\n" "\n" "Defaults to " (racketblock (void))) -@(defmethod (edit-menu:replace-string) string? "The result of this method is used as the name of the " (scheme menu-item<%>) "." "\n" "\n" "Defaults to " (scheme (string-constant replace-menu-item)) ".") +@(defmethod (edit-menu:replace-string) string? "The result of this method is used as the name of the " (racket menu-item<%>) "." "\n" "\n" "Defaults to " (racket (string-constant replace-menu-item)) ".") -@(defmethod (edit-menu:replace-help-string) string? "The result of this method is used as the help string" "\n" "when the " (scheme menu-item<%>) " object is created." "\n" "\n" "Defaults to " (scheme (string-constant replace-info)) ".") +@(defmethod (edit-menu:replace-help-string) string? "The result of this method is used as the help string" "\n" "when the " (racket menu-item<%>) " object is created." "\n" "\n" "Defaults to " (racket (string-constant replace-info)) ".") -@(defmethod (edit-menu:get-replace-all-item) (or/c false/c (is-a?/c menu-item<%>)) "This method returns the " (scheme menu-item<%>) " object corresponding" "\n" "to this menu item, if it has been created (as controlled by" "\n" (method frame:standard-menus<%> edit-menu:create-replace-all?) ").") +@(defmethod (edit-menu:get-replace-all-item) (or/c false/c (is-a?/c menu-item<%>)) "This method returns the " (racket menu-item<%>) " object corresponding" "\n" "to this menu item, if it has been created (as controlled by" "\n" (method frame:standard-menus<%> edit-menu:create-replace-all?) ").") -@(defmethod (edit-menu:create-replace-all?) boolean? "The result of this method determines if the corresponding" "\n" "menu item is created. Override it to control the creation of the menu item." "\n" "\n" "Defaults to " (scheme #f) ".") +@(defmethod (edit-menu:create-replace-all?) boolean? "The result of this method determines if the corresponding" "\n" "menu item is created. Override it to control the creation of the menu item." "\n" "\n" "Defaults to " (racket #f) ".") -@(defmethod (edit-menu:replace-all-callback (item (is-a?/c menu-item<%>)) (control (is-a?/c control-event%))) void? "Defaults to " (schemeblock (void)) " ") +@(defmethod (edit-menu:replace-all-callback (item (is-a?/c menu-item<%>)) (control (is-a?/c control-event%))) void? "Defaults to " (racketblock (void)) " ") -@(defmethod (edit-menu:replace-all-on-demand (menu-item (is-a?/c menu-item<%>))) void? "The menu item's on-demand proc calls this method." "\n" "\n" "Defaults to " (schemeblock (void))) +@(defmethod (edit-menu:replace-all-on-demand (menu-item (is-a?/c menu-item<%>))) void? "The menu item's on-demand proc calls this method." "\n" "\n" "Defaults to " (racketblock (void))) -@(defmethod (edit-menu:replace-all-string) string? "The result of this method is used as the name of the " (scheme menu-item<%>) "." "\n" "\n" "Defaults to " (scheme (string-constant replace-all-menu-item)) ".") +@(defmethod (edit-menu:replace-all-string) string? "The result of this method is used as the name of the " (racket menu-item<%>) "." "\n" "\n" "Defaults to " (racket (string-constant replace-all-menu-item)) ".") -@(defmethod (edit-menu:replace-all-help-string) string? "The result of this method is used as the help string" "\n" "when the " (scheme menu-item<%>) " object is created." "\n" "\n" "Defaults to " (scheme (string-constant replace-all-info)) ".") +@(defmethod (edit-menu:replace-all-help-string) string? "The result of this method is used as the help string" "\n" "when the " (racket menu-item<%>) " object is created." "\n" "\n" "Defaults to " (racket (string-constant replace-all-info)) ".") -@(defmethod (edit-menu:get-find-case-sensitive-item) (or/c false/c (is-a?/c menu-item<%>)) "This method returns the " (scheme menu-item<%>) " object corresponding" "\n" "to this menu item, if it has been created (as controlled by" "\n" (method frame:standard-menus<%> edit-menu:create-find-case-sensitive?) ").") +@(defmethod (edit-menu:get-find-case-sensitive-item) (or/c false/c (is-a?/c menu-item<%>)) "This method returns the " (racket menu-item<%>) " object corresponding" "\n" "to this menu item, if it has been created (as controlled by" "\n" (method frame:standard-menus<%> edit-menu:create-find-case-sensitive?) ").") -@(defmethod (edit-menu:create-find-case-sensitive?) boolean? "The result of this method determines if the corresponding" "\n" "menu item is created. Override it to control the creation of the menu item." "\n" "\n" "Defaults to " (scheme #f) ".") +@(defmethod (edit-menu:create-find-case-sensitive?) boolean? "The result of this method determines if the corresponding" "\n" "menu item is created. Override it to control the creation of the menu item." "\n" "\n" "Defaults to " (racket #f) ".") -@(defmethod (edit-menu:find-case-sensitive-callback (item (is-a?/c menu-item<%>)) (control (is-a?/c control-event%))) void? "Defaults to " (schemeblock (void)) " ") +@(defmethod (edit-menu:find-case-sensitive-callback (item (is-a?/c menu-item<%>)) (control (is-a?/c control-event%))) void? "Defaults to " (racketblock (void)) " ") -@(defmethod (edit-menu:find-case-sensitive-on-demand (item (is-a?/c menu-item<%>))) void? "The menu item's on-demand proc calls this method." "\n" "\n" "Defaults to " (schemeblock (send item enable (let ((target (get-edit-target-object))) (and target (is-a? target editor<%>)))))) +@(defmethod (edit-menu:find-case-sensitive-on-demand (item (is-a?/c menu-item<%>))) void? "The menu item's on-demand proc calls this method." "\n" "\n" "Defaults to " (racketblock (send item enable (let ((target (get-edit-target-object))) (and target (is-a? target editor<%>)))))) -@(defmethod (edit-menu:find-case-sensitive-string) string? "The result of this method is used as the name of the " (scheme menu-item<%>) "." "\n" "\n" "Defaults to " (scheme (string-constant find-case-sensitive-menu-item)) ".") +@(defmethod (edit-menu:find-case-sensitive-string) string? "The result of this method is used as the name of the " (racket menu-item<%>) "." "\n" "\n" "Defaults to " (racket (string-constant find-case-sensitive-menu-item)) ".") -@(defmethod (edit-menu:find-case-sensitive-help-string) string? "The result of this method is used as the help string" "\n" "when the " (scheme menu-item<%>) " object is created." "\n" "\n" "Defaults to " (scheme (string-constant find-case-sensitive-info)) ".") +@(defmethod (edit-menu:find-case-sensitive-help-string) string? "The result of this method is used as the help string" "\n" "when the " (racket menu-item<%>) " object is created." "\n" "\n" "Defaults to " (racket (string-constant find-case-sensitive-info)) ".") @(defmethod (edit-menu:between-find-and-preferences (menu (is-a?/c menu-item<%>))) void? "This method is called between the addition of the" "\n" (tt "find") " and the " (tt "preferences") " menu-item." "\n" "Override it to add additional menu items at that point. ") -@(defmethod (edit-menu:get-preferences-item) (or/c false/c (is-a?/c menu-item<%>)) "This method returns the " (scheme menu-item<%>) " object corresponding" "\n" "to this menu item, if it has been created (as controlled by" "\n" (method frame:standard-menus<%> edit-menu:create-preferences?) ").") +@(defmethod (edit-menu:get-preferences-item) (or/c false/c (is-a?/c menu-item<%>)) "This method returns the " (racket menu-item<%>) " object corresponding" "\n" "to this menu item, if it has been created (as controlled by" "\n" (method frame:standard-menus<%> edit-menu:create-preferences?) ").") -@(defmethod (edit-menu:create-preferences?) boolean? "The result of this method determines if the corresponding" "\n" "menu item is created. Override it to control the creation of the menu item." "\n" "\n" "Defaults to " (scheme (not (current-eventspace-has-standard-menus?))) ".") +@(defmethod (edit-menu:create-preferences?) boolean? "The result of this method determines if the corresponding" "\n" "menu item is created. Override it to control the creation of the menu item." "\n" "\n" "Defaults to " (racket (not (current-eventspace-has-standard-menus?))) ".") -@(defmethod (edit-menu:preferences-callback (item (is-a?/c menu-item<%>)) (control (is-a?/c control-event%))) void? "Defaults to " (schemeblock (begin (preferences:show-dialog) #t)) " ") +@(defmethod (edit-menu:preferences-callback (item (is-a?/c menu-item<%>)) (control (is-a?/c control-event%))) void? "Defaults to " (racketblock (begin (preferences:show-dialog) #t)) " ") -@(defmethod (edit-menu:preferences-on-demand (menu-item (is-a?/c menu-item<%>))) void? "The menu item's on-demand proc calls this method." "\n" "\n" "Defaults to " (schemeblock (void))) +@(defmethod (edit-menu:preferences-on-demand (menu-item (is-a?/c menu-item<%>))) void? "The menu item's on-demand proc calls this method." "\n" "\n" "Defaults to " (racketblock (void))) -@(defmethod (edit-menu:preferences-string) string? "The result of this method is used as the name of the " (scheme menu-item<%>) "." "\n" "\n" "Defaults to " (scheme (string-constant preferences-menu-item)) ".") +@(defmethod (edit-menu:preferences-string) string? "The result of this method is used as the name of the " (racket menu-item<%>) "." "\n" "\n" "Defaults to " (racket (string-constant preferences-menu-item)) ".") -@(defmethod (edit-menu:preferences-help-string) string? "The result of this method is used as the help string" "\n" "when the " (scheme menu-item<%>) " object is created." "\n" "\n" "Defaults to " (scheme (string-constant preferences-info)) ".") +@(defmethod (edit-menu:preferences-help-string) string? "The result of this method is used as the help string" "\n" "when the " (racket menu-item<%>) " object is created." "\n" "\n" "Defaults to " (racket (string-constant preferences-info)) ".") @(defmethod (edit-menu:after-preferences (menu (is-a?/c menu-item<%>))) void? "This method is called " "after" " the addition of the" "\n" (tt "preferences") " menu-item. Override it to add additional" "\n" "menu items at that point. ") @(defmethod (help-menu:before-about (menu (is-a?/c menu-item<%>))) void? "This method is called " "before" " the addition of the" "\n" (tt "about") " menu-item. Override it to add additional" "\n" "menu items at that point. ") -@(defmethod (help-menu:get-about-item) (or/c false/c (is-a?/c menu-item<%>)) "This method returns the " (scheme menu-item<%>) " object corresponding" "\n" "to this menu item, if it has been created (as controlled by" "\n" (method frame:standard-menus<%> help-menu:create-about?) ").") +@(defmethod (help-menu:get-about-item) (or/c false/c (is-a?/c menu-item<%>)) "This method returns the " (racket menu-item<%>) " object corresponding" "\n" "to this menu item, if it has been created (as controlled by" "\n" (method frame:standard-menus<%> help-menu:create-about?) ").") -@(defmethod (help-menu:create-about?) boolean? "The result of this method determines if the corresponding" "\n" "menu item is created. Override it to control the creation of the menu item." "\n" "\n" "Defaults to " (scheme #f) ".") +@(defmethod (help-menu:create-about?) boolean? "The result of this method determines if the corresponding" "\n" "menu item is created. Override it to control the creation of the menu item." "\n" "\n" "Defaults to " (racket #f) ".") -@(defmethod (help-menu:about-callback (item (is-a?/c menu-item<%>)) (control (is-a?/c control-event%))) void? "Defaults to " (schemeblock (void)) " ") +@(defmethod (help-menu:about-callback (item (is-a?/c menu-item<%>)) (control (is-a?/c control-event%))) void? "Defaults to " (racketblock (void)) " ") -@(defmethod (help-menu:about-on-demand (menu-item (is-a?/c menu-item<%>))) void? "The menu item's on-demand proc calls this method." "\n" "\n" "Defaults to " (schemeblock (void))) +@(defmethod (help-menu:about-on-demand (menu-item (is-a?/c menu-item<%>))) void? "The menu item's on-demand proc calls this method." "\n" "\n" "Defaults to " (racketblock (void))) -@(defmethod (help-menu:about-string) string? "The result of this method is used as the name of the " (scheme menu-item<%>) "." "\n" "\n" "Defaults to " (scheme (string-constant about-menu-item)) ".") +@(defmethod (help-menu:about-string) string? "The result of this method is used as the name of the " (racket menu-item<%>) "." "\n" "\n" "Defaults to " (racket (string-constant about-menu-item)) ".") -@(defmethod (help-menu:about-help-string) string? "The result of this method is used as the help string" "\n" "when the " (scheme menu-item<%>) " object is created." "\n" "\n" "Defaults to " (scheme (string-constant about-info)) ".") +@(defmethod (help-menu:about-help-string) string? "The result of this method is used as the help string" "\n" "when the " (racket menu-item<%>) " object is created." "\n" "\n" "Defaults to " (racket (string-constant about-info)) ".") @(defmethod (help-menu:after-about (menu (is-a?/c menu-item<%>))) void? "This method is called " "after" " the addition of the" "\n" (tt "about") " menu-item. Override it to add additional" "\n" "menu items at that point. ") diff --git a/collects/scribblings/framework/test.scrbl b/collects/scribblings/framework/test.scrbl index 594cea24d4..20b7fc0e99 100644 --- a/collects/scribblings/framework/test.scrbl +++ b/collects/scribblings/framework/test.scrbl @@ -7,110 +7,95 @@ @defmodule*/no-declare[(framework/test)] @declare-exporting[framework/test framework] -The framework provides several new primitive functions that simulate -user actions, which may be used to test applications. You use these -primitives and combine them just as regular Racket functions. For -example, -@schemeblock[ -(test:keystroke #\A) -(test:menu-select "File" "Save") +The framework provides several new primitive functions that simulate user +actions, which may be used to test applications. You use these primitives and +combine them just as regular Racket functions. For example, +@racketblock[ + (test:keystroke #\A) + (test:menu-select "File" "Save") ] -sends a keystroke event to the window with the keyboard focus and invokes -the callback function for the ``Save'' menu item from the ``File'' menu. -This has the same effect as if the user typed the key ``A'', pulled -down the ``File'' menu and selected ``Save''. +sends a keystroke event to the window with the keyboard focus and invokes the +callback function for the ``Save'' menu item from the ``File'' menu. This has +the same effect as if the user typed the key ``A'', pulled down the ``File'' +menu and selected ``Save''. -It is possible to load this portion of the framework without loading -the rest of the framework. Use -@scheme[(require framework/test)]. +It is possible to load this portion of the framework without loading the rest +of the framework. Use @racket[(require framework/test)]. -Currently, the test engine has primitives for pushing -buttons, setting check-boxes and choices, sending keystrokes, -selecting menu items and clicking the mouse. Many functions -that are also useful in application testing, such as -traversing a tree of panels, getting the text from a canvas, -determining if a window is shown, and so on, exist in GRacket. +Currently, the test engine has primitives for pushing buttons, setting +check-boxes and choices, sending keystrokes, selecting menu items and clicking +the mouse. Many functions that are also useful in application testing, such as +traversing a tree of panels, getting the text from a canvas, determining if a +window is shown, and so on, exist in GRacket. @section[#:tag "test:actions-completeness"]{Actions and completeness} -The actions associated with a testing primitive may not have finished -when the primitive returns to its caller. -Some actions may yield control before they can complete. -For example, selecting ``Save As...'' from the ``File'' menu -opens a dialog box and will not complete until the ``OK'' -or ``Cancel'' button is pushed. +The actions associated with a testing primitive may not have finished when the +primitive returns to its caller. Some actions may yield control before they +can complete. For example, selecting ``Save As...'' from the ``File'' menu +opens a dialog box and will not complete until the ``OK'' or ``Cancel'' button +is pushed. -However, all testing functions wait at least a minimum interval -before returning to give the action a chance to finish. -This interval controls the speed at which the test suite runs, -and gives some slack time for events to complete. -The default interval is 100 milliseconds. The interval can be queried -or set with @scheme[test:run-interval]. +However, all testing functions wait at least a minimum interval before +returning to give the action a chance to finish. This interval controls the +speed at which the test suite runs, and gives some slack time for events to +complete. The default interval is 100 milliseconds. The interval can be +queried or set with @racket[test:run-interval]. -A primitive action will not return until the run-interval has -expired and the action has finished, raised an error, or yielded. -The number of incomplete actions is given by -@scheme[test:number-pending-actions]. +A primitive action will not return until the run-interval has expired and the +action has finished, raised an error, or yielded. The number of incomplete +actions is given by @racket[test:number-pending-actions]. @italic{Note:} -Once a primitive action is started, it is not possible to undo it -or kill its remaining effect. -Thus, it is not possible to write a utility that flushes the +Once a primitive action is started, it is not possible to undo it or kill its +remaining effect. Thus, it is not possible to write a utility that flushes the incomplete actions and resets number-pending-actions to zero. -However, actions which do not complete right away often provide a -way to cancel themselves. -For example, many dialog boxes have a ``Cancel'' button which will -terminate the action with no further effect. -But this is accomplished by sending an additional action -(the button push), not by undoing the original action. +However, actions which do not complete right away often provide a way to cancel +themselves. For example, many dialog boxes have a ``Cancel'' button which will +terminate the action with no further effect. But this is accomplished by +sending an additional action (the button push), not by undoing the original +action. @section[#:tag "test:errors"]{Errors} -Errors in the primitive actions (which necessarily run in the -handler thread) are caught and reraised in the calling thread. +Errors in the primitive actions (which necessarily run in the handler thread) +are caught and reraised in the calling thread. -However, the primitive actions can only guarantee that the action -has started, and they may return before the action has completed. -As a consequence, an action may raise an error long after the -function that started it has returned. -In this case, the error is saved and reraised at the first opportunity -(the next primitive action). +However, the primitive actions can only guarantee that the action has started, +and they may return before the action has completed. As a consequence, an +action may raise an error long after the function that started it has returned. +In this case, the error is saved and reraised at the first opportunity (the +next primitive action). -The test engine keeps a buffer for one error, saving only the -first error. Any subsequent errors are discarded. -Reraising an error empties the buffer, allowing the next error -to be saved. +The test engine keeps a buffer for one error, saving only the first error. Any +subsequent errors are discarded. Reraising an error empties the buffer, +allowing the next error to be saved. -The function @scheme[test:reraise-error] -reraises any pending errors. +The function @racket[test:reraise-error] reraises any pending errors. @section{Technical Issues} @subsection{Active Frame} -The Self Test primitive actions all implicitly apply to the -top-most (active) frame. +The Self Test primitive actions all implicitly apply to the top-most (active) +frame. @subsection{Thread Issues} -The code started by the primitive actions must run in the handler -thread of the eventspace where the event takes place. As a result, -the test suite that invokes the primitive actions must @italic{not} run -in that handler thread (or else some actions will deadlock). See -@scheme[make-eventspace] -for more info. +The code started by the primitive actions must run in the handler thread of the +eventspace where the event takes place. As a result, the test suite that +invokes the primitive actions must @italic{not} run in that handler thread (or +else some actions will deadlock). See @racket[make-eventspace] for more info. @subsection{Window Manager (Unix only)} -In order for the Self Tester to work correctly, the window manager -must set the keyboard focus to follow the active frame. -This is the default behavior in Microsoft Windows and MacOS, -but not in X windows. +In order for the Self Tester to work correctly, the window manager must set the +keyboard focus to follow the active frame. This is the default behavior in +Microsoft Windows and MacOS, but not in X windows. -In X windows, you must explicitly tell your window manager to set the -keyboard focus to the top-most frame, regardless of the position of the -actual mouse. +In X windows, you must explicitly tell your window manager to set the keyboard +focus to the top-most frame, regardless of the position of the actual mouse. @section{Test Functions} diff --git a/collects/scribblings/framework/text.scrbl b/collects/scribblings/framework/text.scrbl index 319b6b6bc3..cca7242100 100644 --- a/collects/scribblings/framework/text.scrbl +++ b/collects/scribblings/framework/text.scrbl @@ -16,41 +16,35 @@ (-> void?)))]{ This function highlights a region of text in the buffer. - The range between @scheme[start] and @scheme[end] will - be highlighted with the color in color, if the style is - @scheme['rectangle] (the default). - If the style is @scheme['ellipse], then an ellipse is drawn - around the range in the editor, using the color. - If the style is - @scheme['hollow-ellipse], then the outline of an ellipse is - drawn around the range in the editor, using the color. + The range between @racket[start] and @racket[end] will be highlighted with + the color in color, if the style is @racket['rectangle] (the default). If + the style is @racket['ellipse], then an ellipse is drawn around the range + in the editor, using the color. If the style is @racket['hollow-ellipse], + then the outline of an ellipse is drawn around the range in the editor, + using the color. - If the style is @scheme['dot], then @scheme[start] and - @scheme[end] must be the same, and a dot is drawn at the bottom of - that position in the editor. + If the style is @racket['dot], then @racket[start] and @racket[end] must be + the same, and a dot is drawn at the bottom of that position in the editor. - If @scheme[caret-space?] is not @scheme[#f], the left - edge of the range will be one pixel short, to leave - space for the caret. The caret does not interfere with - the right hand side of the range. Note that under some - platforms, the caret is drawn with XOR, which means - almost anything can happen. So if the caret is in the - middle of the range it may be hard to see, or if it is - on the left of the range and @scheme[caret-space?] is - @scheme[#f] it may also be hard to see. + If @racket[caret-space?] is not @racket[#f], the left edge of the range + will be one pixel short, to leave space for the caret. The caret does not + interfere with the right hand side of the range. Note that under some + platforms, the caret is drawn with XOR, which means almost anything can + happen. So if the caret is in the middle of the range it may be hard to + see, or if it is on the left of the range and @racket[caret-space?] is + @racket[#f] it may also be hard to see. - The @scheme[priority] argument indicates the relative - priority for drawing overlapping regions. If two regions - overlap and have different priorities, the region with - @scheme['high] priority will be drawn second and only it + The @racket[priority] argument indicates the relative priority for drawing + overlapping regions. If two regions overlap and have different priorities, + the region with @racket['high] priority will be drawn second and only it will be visible in the overlapping region. - This method returns a thunk, which, when invoked, will turn off - the highlighting from this range. + This method returns a thunk, which, when invoked, will turn off the + highlighting from this range. - See also - @method[text:basic<%> unhighlight-range]. + See also @method[text:basic<%> unhighlight-range]. } + @defmethod[(unhighlight-range (start exact-nonnegative-integer?) (end exact-nonnegative-integer?) @@ -58,378 +52,348 @@ (caret-space boolean? #f) (style (symbols 'rectangle 'ellipse 'hollow-ellipse) 'rectangle)) void?]{ - This method removes the highlight from a region of text in - the buffer. + This method removes the highlight from a region of text in the buffer. - The region must match up to a region specified - from an earlier call to + The region must match up to a region specified from an earlier call to @method[text:basic<%> highlight-range]. } + @defmethod*[(((get-highlighted-ranges) (listof text:range?)))]{ - - Returns a list of (opaque) values representing the active - ranges in the editor. + Returns a list of (opaque) values representing the active ranges in the + editor. } + @defmethod*[(((get-styles-fixed) boolean?))]{ - If the result of this function is @scheme[#t], the styles in this - @scheme[text:basic<%>] - will be fixed. This means - that any text inserted to this editor - has its style set to this editor's - @scheme[style-list%]'s @scheme["Standard"] style. - - See also - @method[text:basic<%> set-styles-fixed]. + If the result of this function is @racket[#t], the styles in this + @racket[text:basic<%>] will be fixed. This means that any text inserted to + this editor has its style set to this editor's @racket[style-list%]'s + @racket["Standard"] style. + See also @method[text:basic<%> set-styles-fixed]. } + @defmethod*[(((get-fixed-style) (is-a?/c style<%>)))]{ - Returns the style used by - @method[text:basic<%> set-styles-fixed]when setting the styles. - + Returns the style used by @method[text:basic<%> set-styles-fixed]when + setting the styles. } + @defmethod*[(((set-styles-fixed (fixed? boolean?)) void?))]{ - Sets the styles fixed parameter of this - @scheme[text%]. See also - @method[text:basic<%> get-styles-fixed] - and - @method[text:basic<%> get-fixed-style]. - + Sets the styles fixed parameter of this @racket[text%]. See also + @method[text:basic<%> get-styles-fixed] and @method[text:basic<%> + get-fixed-style]. } + @defmethod*[(((move/copy-to-edit (dest-text (is-a?/c text%)) (start exact-integer?) (end exact-integer?) (dest-pos exact-integer?)) void?))]{ This moves or copies text and snips to another edit. - - Moves or copies from the edit starting at @scheme[start] and ending at - @scheme[end]. It puts the copied text and snips in @scheme[dest-text] - starting at location @scheme[dest-pos]. + Moves or copies from the edit starting at @racket[start] and ending at + @racket[end]. It puts the copied text and snips in @racket[dest-text] + starting at location @racket[dest-pos]. If a snip refused to be moved, it will be copied, otherwise it will be - moved. A snip may refuse to be moved by returning @scheme[#f] from + moved. A snip may refuse to be moved by returning @racket[#f] from @method[snip% release-from-owner]. } + @defmethod*[(((initial-autowrap-bitmap) (or/c #f (is-a?/c bitmap%))))]{ - The result of this method is used as the initial autowrap - bitmap. Override this method to change the initial - @scheme[bitmap%]. See also - @method[text% set-autowrap-bitmap] + The result of this method is used as the initial autowrap bitmap. Override + this method to change the initial @racket[bitmap%]. See also @method[text% + set-autowrap-bitmap] - - Defaultly returns the result of - @scheme[icon:get-autowrap-bitmap] + Defaultly returns the result of @racket[icon:get-autowrap-bitmap] } + @defmethod*[(((get-port-name) (or/c path-string? symbol? #f)))]{ - - The result of this method is a symbol that identifies this - editor and that is used as the port-name of a port that is - read from this editor if this editor is used in DrRacket. - See also - @method[text:basic<%> port-name-matches?]. + The result of this method is a symbol that identifies this editor and that + is used as the port-name of a port that is read from this editor if this + editor is used in DrRacket. See also @method[text:basic<%> + port-name-matches?]. } + @defmethod[(port-name-matches? (id any/c)) boolean?]{ + Indicates if @racket[id] matches the port name of this file. If the file is + saved, the port name matches when the save file is the path as + @racket[id]. If the file has not been saved, the port name matches if the + symbol is the same as the result of @method[text:basic<%> get-port-name]. - Indicates if @scheme[id] matches the port name of this file. If - the file is saved, the port name matches when the save file - is the path as @scheme[id]. If the file has not been saved, the - port name matches if the symbol is the same as the result of - @method[text:basic<%> get-port-name]. - - This method calls @racket[normalize-path] and thus can be very - expensive on some filesystems. If it is called many times in a - loop, cache the results to avoid calling it too often. + This method calls @racket[normalize-path] and thus can be very expensive on + some filesystems. If it is called many times in a loop, cache the results + to avoid calling it too often. } + @defmethod[(get-edition-number) exact-nonnegative-integer?]{ - Returns a number that increments every time something in - the editor changes. - + Returns a number that increments every time something in the editor + changes. + The number is updated in @xmethod[text% after-insert] and @xmethod[text% after-delete]. } - + @defmethod[(get-start-of-line [pos exact-nonnegative-integer?]) exact-nonnegative-integer?]{ - This method is used by @racket[keymap:setup-global] to implement - a keybinding for the @racket["home"] key and for @racket["c:a"]. - - Its default implementation is @racket[(#,(method text% line-start-position) (#,(method text% position-line) pos))]. + This method is used by @racket[keymap:setup-global] to implement a + keybinding for the @racket["home"] key and for @racket["c:a"]. + + Its default implementation is + @racket[(#,(method text% line-start-position) (#,(method text% position-line) pos))]. } - } + @defmixin[text:basic-mixin (editor:basic<%> text%) (text:basic<%>)]{ - This mixin implements the basic functionality needed for - @scheme[text%] + This mixin implements the basic functionality needed for @racket[text%] objects in the framework. - The class that this mixin produces uses the same initialization - arguments as its input. + The class that this mixin produces uses the same initialization arguments as + its input. + @defmethod*[#:mode override (((on-paint (before? any/c) (dc (is-a?/c dc<%>)) (left real?) (top real?) (right real?) (bottom real?) (dx real?) (dy real?) (draw-caret (one-of/c (quote no-caret) (quote show-inactive-caret) (quote show-caret)))) void?))]{ - - Draws the rectangles installed by - @method[text:basic<%> highlight-range]. + Draws the rectangles installed by @method[text:basic<%> highlight-range]. } + @defmethod*[#:mode augment (((on-insert (start exact-nonnegative-integer?) (end exact-nonnegative-integer?)) void?))]{ - - See - @method[text:basic<%> set-styles-fixed]. + See @method[text:basic<%> set-styles-fixed]. } + @defmethod*[#:mode augment (((after-insert (start exact-nonnegative-integer?) (len exact-nonnegative-integer?)) void?))]{ - - See - @method[text:basic<%> set-styles-fixed]. + See @method[text:basic<%> set-styles-fixed]. } + @defmethod*[#:mode override (((put-file (directory (or/c path? #f)) (default-name string?)) (or/c path? #f)))]{ - - Like - @method[editor<%> put-file] - but uses - @scheme[finder:put-file] - instead of @scheme[put-file]. - + Like @method[editor<%> put-file] but uses @racket[finder:put-file] instead + of @racket[put-file]. } } @definterface[text:first-line<%> (text%)]{ - Objects implementing this interface, when - @method[text:first-line<%> highlight-first-line] - is invoked with @scheme[#t], always show their - first line, even with scrolled (as long as - @method[text:first-line<%> first-line-currently-drawn-specially?] - returns @scheme[#t]). + Objects implementing this interface, when @method[text:first-line<%> + highlight-first-line] is invoked with @racket[#t], always show their first + line, even with scrolled (as long as @method[text:first-line<%> + first-line-currently-drawn-specially?] returns @racket[#t]). @defmethod[#:mode public-final (highlight-first-line [on? boolean?]) void?]{ Call this method to enable special treatment of the first line in the editor. } @defmethod[#:mode public-final (first-line-currently-drawn-specially?) boolean?]{ - Returns @scheme[#t] if @method[text:first-line<%> is-special-first-line?] - returned @scheme[#t] for the current first line - and if the buffer is scrolled down so that the first - line would not (ordinarily) be visible. + Returns @racket[#t] if @method[text:first-line<%> is-special-first-line?] + returned @racket[#t] for the current first line and if the buffer is + scrolled down so that the first line would not (ordinarily) be visible. } @defmethod[#:mode public-final (get-first-line-height) number?]{ - Returns the height, in pixels, of the first line. + Returns the height, in pixels, of the first line. } @defmethod[(is-special-first-line? [line string?]) boolean?]{ - Override this method to control when the first line is always - visible. The argument is the first line, as a string. + Override this method to control when the first line is always visible. The + argument is the first line, as a string. } - } @defmixin[text:first-line-mixin (text%) (text:first-line<%>)]{ - Provides the implementation of @scheme[text:first-line<%>]. - Does so by just painting the text of the first - line over top of what is already there and overriding - @method[text:first-line-mixin scroll-editor-to] to patch - up scrolling and - @method[text:first-line-mixin on-event] to patch up - mouse handling. + Provides the implementation of @racket[text:first-line<%>]. Does so by just + painting the text of the first line over top of what is already there and + overriding @method[text:first-line-mixin scroll-editor-to] to patch up + scrolling and @method[text:first-line-mixin on-event] to patch up mouse + handling. @defmethod[#:mode override (on-paint [before? any/c] - [dc (is-a?/c dc<%>)] - [left real?] - [top real?] - [right real?] - [bottom real?] - [dx real?] - [dy real?] - [draw-caret (one-of/c 'no-caret 'show-inactive-caret 'show-caret)]) - void?]{ - - Based on the various return values of the methods in @scheme[text:first-line], - draws the first actual line of the editor over top of the first - visible line in the editor. + [dc (is-a?/c dc<%>)] + [left real?] + [top real?] + [right real?] + [bottom real?] + [dx real?] + [dy real?] + [draw-caret (one-of/c 'no-caret 'show-inactive-caret 'show-caret)]) + void?]{ + Based on the various return values of the methods in + @racket[text:first-line], draws the first actual line of the editor over + top of the first visible line in the editor. } @defmethod[#:mode override - (on-event [event (is-a?/c mouse-event%)]) - void?]{ - Clicks in the first line cause the editor to scroll to the - actual first line. + (on-event [event (is-a?/c mouse-event%)]) + void?]{ + Clicks in the first line cause the editor to scroll to the actual first + line. + } + + @defmethod[#:mode override + (scroll-editor-to [localx real?] + [localy real?] + [width (and/c real? (not/c negative?))] + [height (and/c real? (not/c negative?))] + [refresh? any/c] + [bias (one-of/c 'start 'end 'none)]) + void?]{ + Scrolls a little bit more, when a scroll would be requested that scrolls + something so that it is line underneath the first line. } - - @defmethod[#:mode override - (scroll-editor-to [localx real?] - [localy real?] - [width (and/c real? (not/c negative?))] - [height (and/c real? (not/c negative?))] - [refresh? any/c] - [bias (one-of/c 'start 'end 'none)]) - void?]{ - Scrolls a little bit more, when a scroll would be requested - that scrolls something so that it is line underneath the first line. - } } @definterface[text:foreground-color<%> (text:basic<%> editor:standard-style-list<%>)]{ - } @defmixin[text:foreground-color-mixin (text:basic<%> editor:standard-style-list<%>) (text:foreground-color<%>)]{ - This mixin changes the default text style to have - the foreground color controlled by - @scheme[editor:set-default-font-color]. + This mixin changes the default text style to have the foreground color + controlled by @racket[editor:set-default-font-color]. + @defmethod*[#:mode override (((default-style-name) string?))]{ - - Returns the result of - @scheme[editor:get-default-color-style-name]. + Returns the result of @racket[editor:get-default-color-style-name]. } + @defmethod*[#:mode override (((get-fixed-style) (is-a?/c style<%>)))]{ - - Returns the style named by - @scheme[editor:get-default-color-style-name]. + Returns the style named by @racket[editor:get-default-color-style-name]. } } + @definterface[text:hide-caret/selection<%> (text:basic<%>)]{ - This class hides the caret, except when the selection is active. + This class hides the caret, except when the selection is active. - Instances of this class are useful for editors that used for - displaying purposes, but still allow users to copy their text. + Instances of this class are useful for editors that used for displaying + purposes, but still allow users to copy their text. } + @defmixin[text:hide-caret/selection-mixin (text:basic<%>) (text:hide-caret/selection<%>)]{ - @defmethod*[#:mode augment (((after-set-position) void?))]{ - - Calls - @method[text% hide-caret] - to hide the caret when there is only a caret and no selection. - + Calls @method[text% hide-caret] to hide the caret when there is only a + caret and no selection. } } -@definterface[text:nbsp->space<%> (text%)]{ - Classes that implement this interface silently change - non-breaking spaces, ie the character @scheme[(integer->char 160)], to regular spaces when inserted into the editor. +@definterface[text:nbsp->space<%> (text%)]{ + Classes that implement this interface silently change non-breaking spaces, ie + the character @racket[(integer->char 160)], to regular spaces when inserted + into the editor. } + @defmixin[text:nbsp->space-mixin (text%) (text:nbsp->space<%>)]{ @defmethod*[#:mode augment (((on-insert (start exact-nonnegative-integer?) (end exact-nonnegative-integer?)) void?))]{ - - Starts an edit-sequence by calling - @method[editor<%> begin-edit-sequence]. + Starts an edit-sequence by calling @method[editor<%> begin-edit-sequence]. } + @defmethod*[#:mode augment (((after-insert (start exact-nonnegative-integer?) (len exact-nonnegative-integer?)) void?))]{ + Replaces all non-breaking space characters @racket[(integer->char 160)] by + @racket[#\space] characters. - Replaces all non-breaking space characters - @scheme[(integer->char 160)] - by @scheme[#\space] characters. - - Ends the edit sequence (by calling - @method[editor<%> end-edit-sequence]) started in - @method[text:nbsp->space-mixin on-insert]. + Ends the edit sequence (by calling @method[editor<%> end-edit-sequence]) + started in @method[text:nbsp->space-mixin on-insert]. } } @definterface[text:normalize-paste<%> (text:basic<%>)]{ @defmethod[(ask-normalize?) boolean?]{ - Prompts the user if the pasted text should be normalized - (and updates various preferences based on the response). + Prompts the user if the pasted text should be normalized (and updates + various preferences based on the response). - Override this method in the mixin to avoid all GUI and preferences interactions. + Override this method in the mixin to avoid all GUI and preferences + interactions. } + @defmethod[(string-normalize [s string?]) string?]{ - Normalizes @scheme[s]. Defaults to @scheme[string-normalize-nfkc]. + Normalizes @racket[s]. Defaults to @racket[string-normalize-nfkc]. } } @defmixin[text:normalize-paste-mixin (text:basic<%>) (text:normalize-paste<%>)]{ - @defmethod[#:mode override (do-paste [start exact-nonnegative-integer?] [time exact-integer?]) void?]{ - Overridden to detect when insertions are due to pasting. Sets some internal state and calls the super. + @defmethod[#:mode override + (do-paste [start exact-nonnegative-integer?] [time exact-integer?]) + void?]{ + Overridden to detect when insertions are due to pasting. Sets some internal + state and calls the super. } + @defmethod[#:mode augment (on-insert [start exact-nonnegative-integer?] [len exact-nonnegative-integer?]) void?]{ - Calls @method[editor<%> begin-edit-sequence]. + Calls @method[editor<%> begin-edit-sequence]. } + @defmethod[#:mode augment (after-insert [start exact-nonnegative-integer?] [len exact-nonnegative-integer?]) void?]{ Normalizes any next text and calls @method[editor<%> end-edit-sequence]. } - } @definterface[text:searching<%> (editor:keymap<%> text:basic<%>)]{ Any object matching this interface can be searched. - Searches using this class has a non-traditional feature - for performance reasons. Specifically, multiple adjacent - hits are coalesced into a single search results when - bubbles are drawn. This means, for example, that searching - for a space in a file with 80,000 spaces (as one file in - the Racket code base has) is still tractable, since - many of those spaces will be next to each other and thus - there will be far fewer bubbles (the file in question has + Searches using this class has a non-traditional feature for performance + reasons. Specifically, multiple adjacent hits are coalesced into a single + search results when bubbles are drawn. This means, for example, that + searching for a space in a file with 80,000 spaces (as one file in the Racket + code base has) is still tractable, since many of those spaces will be next to + each other and thus there will be far fewer bubbles (the file in question has only 20,000 such bubbles). -@defmethod[(set-searching-state [str (or/c false/c string?)] [cs? boolean?] [replace-start (or/c false/c number?)]) void?]{ + @defmethod[(set-searching-state [str (or/c false/c string?)] + [cs? boolean?] + [replace-start (or/c false/c number?)]) + void?]{ + If @racket[str] is not @racket[#f], then this method highlights every + occurrence of @racket[str] in the editor. If @racket[str] is @racket[#f], + then it clears all of the highlighting in the buffer. - If @scheme[str] is not @scheme[#f], then this method highlights - every occurrence of @scheme[str] in the editor. If @scheme[str] is - @scheme[#f], then it clears all of the highlighting in the buffer. + If @racket[cs?] is @racket[#f], the search is case-insensitive, and otherwise + it is case-sensitive. - If @scheme[cs?] is @scheme[#f], the search is case-insensitive, and - otherwise it is case-sensitive. + If the @racket[replace-start] argument is @racket[#f], then the search is not + in replacement mode. If it is a number, then the first search hit after that + position in the editor is where the next replacement will take place. + } - If the @scheme[replace-start] argument is @scheme[#f], - then the search is not in replacement mode. If it is a - number, then the first search hit after that position in - the editor is where the next replacement will take place. + @defmethod[(set-search-anchor [position (or/c false/c number?)]) void?]{ + Sets the anchor's position in the editor. Only takes effect if the + @racket['framework:anchored-search] preference is on. + } -} -@defmethod[(set-search-anchor [position (or/c false/c number?)]) void?]{ - Sets the anchor's position in the editor. Only takes effect if - the @scheme['framework:anchored-search] preference is on. -} -@defmethod[(get-search-hit-count) number?]{ - Returns the number of hits for the search in the buffer, based on the - count found last time that a search happened. + @defmethod[(get-search-hit-count) number?]{ + Returns the number of hits for the search in the buffer, based on the count + found last time that a search happened. + } + + @defmethod[(set-replace-start [pos (or/c false/c number?)]) void?]{ + Sets the position where replacement next occurs. This is equivalent to + calling @method[text:searching<%> set-searching-state] with a new + @racket[replace-start] argument, but the other arguments the same as the + last call to @method[text:searching<%> set-searching-state], but is more + efficient (since @method[text:searching<%> set-searching-state] will search + the entire buffer and re-build all of the bubbles). + } + + @defmethod[(get-search-bubbles) + (listof (list/c (cons/c number? number?) + (list/c number? number? number?)))]{ + Returns information about the search bubbles in the editor. Each item in + the outermost list corresponds to a single bubble. The pair of numbers is + the range of the bubble and the triple of numbers is the color of the + bubble, in RGB coordinates. + + If @tt{replace-start} has been set (via @method[text:searching<%> + set-replace-start]) and the closest search hit following @tt{replace-start} + does not collapse with an adjacent bubble,the result will include that + bubble. If the closest search hit after @tt{replace-start} is collpased + with another bubble, then the search hit is not reflected in the result. + + This method is intended for use in test suites. + } } -@defmethod[(set-replace-start [pos (or/c false/c number?)]) void?]{ - Sets the position where replacement next occurs. This is equivalent - to calling @method[text:searching<%> set-searching-state] with - a new @scheme[replace-start] argument, but the other arguments the same - as the last call to @method[text:searching<%> set-searching-state], - but is more efficient (since @method[text:searching<%> set-searching-state] - will search the entire buffer and re-build all of the bubbles). -} - -@defmethod[(get-search-bubbles) - (listof (list/c (cons/c number? number?) - (list/c number? number? number?)))]{ - Returns information about the search bubbles in the editor. Each - item in the outermost list corresponds to a single bubble. The pair - of numbers is the range of the bubble and the triple of numbers is - the color of the bubble, in RGB coordinates. - - If @tt{replace-start} has been set (via - @method[text:searching<%> set-replace-start]) and the - closest search hit following @tt{replace-start} does not - collapse with an adjacent bubble,the result will include - that bubble. If the closest search hit after - @tt{replace-start} is collpased with another bubble, then - the search hit is not reflected in the result. - - This method is intended for use in test suites. -} - -} @defmixin[text:searching-mixin (editor:keymap<%> text:basic<%>) (text:searching<%>)]{ - This - @scheme[text%] - can be searched. + This @racket[text%] can be searched. The result of this mixin uses the same initialization arguments as the mixin's argument. - @defmethod*[#:mode override (((get-keymaps) (listof (is-a?/c keymap%))))]{ - This returns a list containing the super-class's keymaps, plus the - result of - @scheme[keymap:get-search] + @defmethod*[#:mode override (((get-keymaps) (listof (is-a?/c keymap%))))]{ + This returns a list containing the super-class's keymaps, plus the result + of @racket[keymap:get-search] } @defmethod[#:mode augment (after-insert [start exact-nonnegative-integer?] [len exact-nonnegative-integer?]) void?]{ Re-does any search now that the contents of the window have changed. } + @defmethod[#:mode augment (after-delete [start exact-nonnegative-integer?] [len exact-nonnegative-integer?]) void?]{ Re-does any search now that the contents of the window have changed. } @@ -439,22 +403,24 @@ the @method[frame:searchable<%> set-text-to-search] method. } } + @definterface[text:return<%> (text%)]{ - Objects supporting this interface were created by - @scheme[text:return-mixin]. + Objects supporting this interface were created by @racket[text:return-mixin]. } + @defmixin[text:return-mixin (text%) (text:return<%>)]{ Use this buffer to perform some special action when return is typed. @defconstructor[((return (-> boolean?)))]{ - } - @defmethod*[#:mode override (((on-local-char (event (is-a?/c key-event%))) void?))]{ - If @scheme[key] is either return or newline, only invoke the @scheme[return] - thunk (initialization argument) and do nothing else. + @defmethod*[#:mode override + (((on-local-char (event (is-a?/c key-event%))) void?))]{ + If @racket[key] is either return or newline, only invoke the + @racket[return] thunk (initialization argument) and do nothing else. } } + @definterface[text:wide-snip<%> (text:basic<%>)]{ @defmethod*[(((add-wide-snip (snip (is-a?/c snip%))) void?))]{ @@ -463,77 +429,63 @@ This method should only be called by @xmethod[canvas:wide-snip<%> add-wide-snip]. - } + @defmethod*[(((add-tall-snip (snip (is-a?/c snip%))) void?))]{ - Registers a snip in this editor. It is resized when the - viewing area of the editor changes. + Registers a snip in this editor. It is resized when the viewing area of the + editor changes. This method should only be called by @xmethod[canvas:wide-snip<%> add-tall-snip]. - } } + @defmixin[text:wide-snip-mixin (text:basic<%>) (text:wide-snip<%>)]{ - } + @definterface[text:delegate<%> (text:basic<%>)]{ - Implementations of this interface copy all of the - changes to this editor to the result of - @method[text:delegate<%> get-delegate] - except instead of regular string and tab snips, - instead instances of - @scheme[text:1-pixel-string-snip%] - and - @scheme[text:1-pixel-tab-snip%] - are created. + Implementations of this interface copy all of the changes to this editor to + the result of @method[text:delegate<%> get-delegate] except instead of + regular string and tab snips, instead instances of + @racket[text:1-pixel-string-snip%] and @racket[text:1-pixel-tab-snip%] are + created. + + The contents of the two editor are kept in sync, as modifications to this + object happen. - The contents of the two - editor are kept in sync, as modifications - to this object happen. @defmethod*[(((get-delegate) (or/c #f (is-a?/c text%))))]{ - The result of this method is the @scheme[text%] object - that the contents of this editor are being delegated to, or - @scheme[#f], if there is none. - + The result of this method is the @racket[text%] object that the contents of + this editor are being delegated to, or @racket[#f], if there is none. } + @defmethod*[(((set-delegate (delegate (or/c #f (is-a?/c text%)))) void?))]{ - This method sets the current delegate. + This method sets the current delegate. - - When it is set, all of the snips are copied from this object - to @scheme[delegate]. Additionally, if this object implements - @scheme[scheme:text<%>] - the tab settings of @scheme[delegate] are updated to match this - objects. + When it is set, all of the snips are copied from this object to + @racket[delegate]. Additionally, if this object implements + @racket[scheme:text<%>] the tab settings of @racket[delegate] are updated + to match this objects. } } + @defclass[text:1-pixel-string-snip% string-snip% ()]{ - This class re-uses the implementation of - @scheme[string-snip%] - to implement a string snip that just draws - a single pixel for each character in the string. + This class re-uses the implementation of @racket[string-snip%] to implement a + string snip that just draws a single pixel for each character in the string. - See also - @scheme[text:1-pixel-tab-snip%] - for a similar extension to the - @scheme[tab-snip%]class. + See also @racket[text:1-pixel-tab-snip%] for a similar extension to the + @racket[tab-snip%]class. + + This snip is used in conjunction with the @racket[frame:delegate<%>] and + @racket[text:delegate<%>] interfaces. - This snip is used in conjunction with the - @scheme[frame:delegate<%>] - and - @scheme[text:delegate<%>] - interfaces. @defmethod*[#:mode override (((split (position exact) (first (box/c (is-a?/c snip%))) (second (box/c (is-a?/c snip%)))) void?))]{ - - Fills the boxes with instance of - @scheme[text:1-pixel-string-snip%]s. + Fills the boxes with instance of @racket[text:1-pixel-string-snip%]s. } + @defmethod*[#:mode override (((copy) (is-a?/c snip%)))]{ - - Creates and returns an instance of - @scheme[text:1-pixel-string-snip%]. + Creates and returns an instance of @racket[text:1-pixel-string-snip%]. } + @defmethod*[#:mode override (((get-extent (dc (is-a?/c dc<%>)) @@ -546,65 +498,52 @@ (rspace (or/c (box/c (or/c (and/c real? (not/c negative?)))) #f) #f)) void?))]{ - Sets the descent, space, lspace, and rspace to zero. Sets - the height to 1. Sets the width to the number of characters - in the string. - + Sets the descent, space, lspace, and rspace to zero. Sets the height to + 1. Sets the width to the number of characters in the string. } + @defmethod*[#:mode override (((insert (s string?) (len exact-nonnegative-integer?) (pos exact-nonnegative-integer? 0)) void?))]{ } + @defmethod*[#:mode override (((draw (dc (is-a?/c dc<%>)) (x real?) (y real?) (left real?) (top real?) (right real?) (bottom real?) (dx real?) (dy real?) (draw-caret (or/c (quote no-caret) (quote show-inactive-caret) (quote show-caret)))) void?))]{ - - Draws black pixels for non-whitespace characters and draws - nothing for whitespace characters. - + Draws black pixels for non-whitespace characters and draws nothing for + whitespace characters. } } + @defclass[text:1-pixel-tab-snip% tab-snip% ()]{ - This class re-uses the implementation of - @scheme[tab-snip%] - to implement a string snip that is always one pixel - high. + This class re-uses the implementation of @racket[tab-snip%] to implement a + string snip that is always one pixel high. - See also - @scheme[text:1-pixel-string-snip%] - for a similar extension to the - @scheme[string-snip%]class. + See also @racket[text:1-pixel-string-snip%] for a similar extension to the + @racket[string-snip%]class. + + This snip is used in conjunction with the @racket[frame:delegate<%>] and + @racket[text:delegate<%>] interfaces. - This snip is used in conjunction with the - @scheme[frame:delegate<%>] - and - @scheme[text:delegate<%>] - interfaces. @defmethod*[#:mode override (((split (position exact) (first (box/c (is-a?/c snip%))) (second (box/c (is-a?/c snip%)))) void?))]{ - - Fills the boxes with instance of - @scheme[text:1-pixel-tab-snip%]s. + Fills the boxes with instance of @racket[text:1-pixel-tab-snip%]s. } + @defmethod*[#:mode override (((copy) (is-a?/c snip%)))]{ - - Creates and returns an instance of - @scheme[text:1-pixel-tab-snip%]. + Creates and returns an instance of @racket[text:1-pixel-tab-snip%]. } + @defmethod*[#:mode override (((get-extent (dc (is-a?/c dc<%>)) (x real?) (y real?) (w (or/c (box/c (and/c real? (not/c negative?)) #f)) #f) (h (or/c (box/c (and/c real? (not/c negative?)) #f)) #f) (descent (or/c (box/c (and/c real? (not/c negative?)) #f)) #f) (space (or/c (box/c (and/c real? (not/c negative?)) #f)) #f) (lspace (or/c (box/c (and/c real? (not/c negative?)) #f)) #f) (rspace (or/c (box/c (and/c real? (not/c negative?)) #f)) #f)) void?))]{ - - Sets the descent, space, lspace, and rspace to zero. Sets - the height to 1. Sets the width to the width of tabs as - returned in the @scheme[tab-width] parameter of the - @method[text% get-tabs] - method. - + Sets the descent, space, lspace, and rspace to zero. Sets the height to + 1. Sets the width to the width of tabs as returned in the + @racket[tab-width] parameter of the @method[text% get-tabs] method. } + @defmethod*[#:mode override (((draw (dc (is-a?/c dc<%>)) (x real?) (y real?) (left real?) (top real?) (right real?) (bottom real?) (dx real?) (dy real?) (draw-caret (or/c (quote no-caret) (quote show-inactive-caret) (quote show-caret)))) void?))]{ - Draws nothing. - } } + @defmixin[text:delegate-mixin (text:basic<%>) (text:delegate<%>)]{ - This mixin provides an implementation of the - @scheme[text:delegate<%>] + This mixin provides an implementation of the @racket[text:delegate<%>] interface. + @defmethod*[#:mode override (((highlight-range (start exact-integer?) (end exact-nonnegative-integer?) (color (or/c string? (is-a?/c color%))) @@ -612,11 +551,10 @@ (priority (symbols 'high 'low) 'low) (style (symbols 'rectangle 'ellipse 'hollow-ellipse 'dot) 'rectangle)) (-> void?)))]{ - - In addition to calling the super method, - @method[text:basic<%> highlight-range], this method forwards the highlighting to - the delegatee. + In addition to calling the super method, @method[text:basic<%> + highlight-range], this method forwards the highlighting to the delegatee. } + @defmethod[#:mode override (unhighlight-range (start exact-nonnegative-integer?) @@ -627,552 +565,494 @@ void?]{ This method propagates the call to the delegate and calls the super method. } - @defmethod*[#:mode override (((on-paint (before? any/c) (dc (is-a?/c dc<%>)) (left real?) (top real?) (right real?) (bottom real?) (dx real?) (dy real?) (draw-caret (one-of/c (quote no-caret) (quote show-inactive-caret) (quote show-caret)))) void?))]{ - - Draws a blue region in the delegatee editor that shows where - the visible region of the delegate editor is. + @defmethod*[#:mode override + (((on-paint (before? any/c) + (dc (is-a?/c dc<%>)) + (left real?) + (top real?) + (right real?) + (bottom real?) + (dx real?) + (dy real?) + (draw-caret (one-of/c 'no-caret 'show-inactive-caret 'show-caret))) + void?))]{ + Draws a blue region in the delegatee editor that shows where the visible + region of the delegate editor is. } - @defmethod*[#:mode augment (((on-edit-sequence) void?))]{ + @defmethod*[#:mode augment (((on-edit-sequence) void?))]{ starts an edit sequence in the delegate. } - @defmethod*[#:mode augment (((after-edit-sequence) void?))]{ + @defmethod*[#:mode augment (((after-edit-sequence) void?))]{ ends an edit sequence in the delegate. } + @defmethod*[#:mode override (((resized (snip (is-a?/c snip%)) (redraw-now? boolean?)) void?))]{ - - Sends a message to the delegate to update the size of the - copied snip, if there is one. + Sends a message to the delegate to update the size of the copied snip, if + there is one. } - @defmethod*[#:mode augment (((after-insert (start exact-nonnegative-integer?) (len exact-nonnegative-integer?)) void?))]{ + @defmethod*[#:mode augment (((after-insert (start exact-nonnegative-integer?) (len exact-nonnegative-integer?)) void?))]{ forwards the change to the delegate } - @defmethod*[#:mode augment (((after-delete (start exact-nonnegative-integer?) (len exact-nonnegative-integer?)) void?))]{ + @defmethod*[#:mode augment (((after-delete (start exact-nonnegative-integer?) (len exact-nonnegative-integer?)) void?))]{ forwards the change to the delegate. } - @defmethod*[#:mode augment (((after-change-style (start exact-nonnegative-integer?) (len exact-nonnegative-integer?)) void?))]{ + @defmethod*[#:mode augment (((after-change-style (start exact-nonnegative-integer?) (len exact-nonnegative-integer?)) void?))]{ forwards the changed style to the delegate. } - @defmethod*[#:mode augment (((on-load-file (filename string?) (format symbol?)) void?))]{ - remembers the filename, for use in + @defmethod*[#:mode augment (((on-load-file (filename string?) (format symbol?)) void?))]{ + remembers the filename, for use in @method[text:delegate-mixin after-load-file]. } - @defmethod*[#:mode augment (((after-load-file (success? boolean?)) void?))]{ + @defmethod*[#:mode augment (((after-load-file (success? boolean?)) void?))]{ updates the delegate with the new contents of the text. } } + @definterface[text:info<%> (text:basic<%>)]{ - Objects supporting this interface are expected to send information - about themselves to the frame that is displaying them. + Objects supporting this interface are expected to send information about + themselves to the frame that is displaying them. } @defmixin[text:info-mixin (editor:keymap<%> text:basic<%>) (text:info<%>)]{ This mixin adds support for supplying information to objects created with - @scheme[frame:info-mixin]. When this - @scheme[editor:basic<%>] - is displayed in a frame, that frame must have been created with - @scheme[frame:info-mixin]. + @racket[frame:info-mixin]. When this @racket[editor:basic<%>] is displayed in + a frame, that frame must have been created with @racket[frame:info-mixin]. + @defmethod*[#:mode override (((set-anchor (on? any/c)) void?))]{ - - Calls the - @method[frame:text-info<%> anchor-status-changed] - method of the frame that is viewing this object. It uses - @method[editor<%> get-canvas] - to get the canvas for this frame, and uses that canvas's - @scheme[top-level-window<%>] - as the frame. + Calls the @method[frame:text-info<%> anchor-status-changed] method of the + frame that is viewing this object. It uses @method[editor<%> get-canvas] to + get the canvas for this frame, and uses that canvas's + @racket[top-level-window<%>] as the frame. } + @defmethod*[#:mode override (((set-overwrite-mode (on? any/c)) void?))]{ - - Calls the - @method[frame:text-info<%> overwrite-status-changed]method of the frame that is viewing this object. It uses - @method[editor<%> get-canvas] - to get the canvas for this frame, and uses that canvas's - @scheme[top-level-window<%>] - as the frame. + Calls the @method[frame:text-info<%> overwrite-status-changed]method of the + frame that is viewing this object. It uses @method[editor<%> get-canvas] to + get the canvas for this frame, and uses that canvas's + @racket[top-level-window<%>] as the frame. } + @defmethod*[#:mode augment (((after-set-position) void?))]{ - - Calls the - @method[frame:text-info<%> editor-position-changed] - method of the frame that is viewing this object. It uses - @method[editor<%> get-canvas] - to get the canvas for this frame, and uses that canvas's - @scheme[top-level-window<%>] - as the frame. + Calls the @method[frame:text-info<%> editor-position-changed] method of the + frame that is viewing this object. It uses @method[editor<%> get-canvas] to + get the canvas for this frame, and uses that canvas's + @racket[top-level-window<%>] as the frame. } + @defmethod*[#:mode augment (((after-insert (start exact-nonnegative-integer?) (len exact-nonnegative-integer?)) void?))]{ - - Calls the - @method[frame:text-info<%> editor-position-changed] - method of the frame that is viewing this object. It uses - @method[editor<%> get-canvas] - to get the canvas for this frame, and uses that canvas's - @scheme[top-level-window<%>] - as the frame. + Calls the @method[frame:text-info<%> editor-position-changed] method of the + frame that is viewing this object. It uses @method[editor<%> get-canvas] to + get the canvas for this frame, and uses that canvas's + @racket[top-level-window<%>] as the frame. } - @defmethod*[#:mode augment (((after-delete (start exact-nonnegative-integer?) (len exact-nonnegative-integer?)) void?))]{ - Calls the - @method[frame:text-info<%> editor-position-changed] - method of the frame that is viewing this object. It uses - @method[editor<%> get-canvas] - to get the canvas for this frame, and uses that canvas's - @scheme[top-level-window<%>] - as the frame. + @defmethod*[#:mode augment (((after-delete (start exact-nonnegative-integer?) (len exact-nonnegative-integer?)) void?))]{ + Calls the @method[frame:text-info<%> editor-position-changed] method of the + frame that is viewing this object. It uses @method[editor<%> get-canvas] to + get the canvas for this frame, and uses that canvas's + @racket[top-level-window<%>] as the frame. } } + @definterface[text:clever-file-format<%> (text%)]{ Objects supporting this interface are expected to support a clever file format when saving. - } + @defmixin[text:clever-file-format-mixin (text%) (text:clever-file-format<%>)]{ The result of this mixin uses the same initialization arguments as the mixin's argument. - When files are saved from this - @scheme[text%], a check is made to see if there are any non-@scheme[string-snip%] - objects in the - @scheme[text%]. If so, it is saved using the file format @scheme['std]. (see - @method[text% set-file-format] - for more information. If not, the file format passed to - @method[editor<%> save-file] - is used. + When files are saved from this @racket[text%], a check is made to see if + there are any non-@racket[string-snip%] objects in the @racket[text%]. If so, + it is saved using the file format @racket['std]. (see @method[text% + set-file-format] for more information. If not, the file format passed to + @method[editor<%> save-file] is used. + @defmethod*[#:mode augment (((on-save-file (filename path?) (format (one-of/c (quote guess) (quote standard) (quote text) (quote text-force-cr) (quote same) (quote copy)))) void?))]{ + If the method @method[text% get-file-format] returns @racket['standard] and + the text has only @racket[string-snip%]s, the file format is set to + @racket['text]. - If the method - @method[text% get-file-format] - returns @scheme['standard] and the text has only - @scheme[string-snip%]s, the file format is set to @scheme['text]. - - If the method - @method[text% get-file-format] - returns @scheme['text] and the text has some non - @scheme[string-snip%]s, the file format is set to @scheme['standard]. + If the method @method[text% get-file-format] returns @racket['text] and the + text has some non @racket[string-snip%]s, the file format is set to + @racket['standard]. Depending on the user's preferences, the user may also be queried. Also, the changes to the file format only happen if the argument - @scheme[file-format] is @scheme['copy] or @scheme['same]. + @racket[file-format] is @racket['copy] or @racket['same]. } } + @definterface[text:file<%> (editor:file<%> text:basic<%>)]{ - Mixins that implement this interface lock themselves when - the file they are editing is read only. + Mixins that implement this interface lock themselves when the file they are + editing is read only. + @defmethod*[(((get-read-write?) boolean?))]{ Indicates whether or not this editor is in read-write mode. - } + @defmethod*[(((while-unlocked (thunk (-> any/c))) any/c))]{ - - Unlocks the editor, calls the thunk, and then relocks the - editor, all using a @scheme[dynamic-wind]. + Unlocks the editor, calls the thunk, and then relocks the editor, all using + a @racket[dynamic-wind]. } } + @defmixin[text:file-mixin (editor:file<%> text:basic<%>) (text:file<%>)]{ - @defmethod*[#:mode augment (((can-insert? (start exact-nonnegative-integer?) (len exact-nonnegative-integer?)) boolean?))]{ + @defmethod*[#:mode augment + (((can-insert? (start exact-nonnegative-integer?) + (len exact-nonnegative-integer?)) + boolean?))]{ - Returns false if the result of - @method[text:file<%> get-read-write?] - is true, otherwise returns the - result of calling @scheme[inner]. + Returns false if the result of @method[text:file<%> get-read-write?] is + true, otherwise returns the result of calling @racket[inner]. } + @defmethod*[#:mode augment (((can-delete? (start exact-nonnegative-integer?) (len exact-nonnegative-integer?)) boolean?))]{ - - Returns false if the result of - @method[text:file<%> get-read-write?] - is true, otherwise returns the - result of calling @scheme[inner]. + Returns false if the result of @method[text:file<%> get-read-write?] is + true, otherwise returns the result of calling @racket[inner]. } + @defmethod*[#:mode augment (((after-save-file) void?))]{ + Checks if the newly saved file is write-only in the filesystem. If so, + locks the editor with the @method[editor<%> lock] method. Otherwise unlocks + the buffer - Checks if the newly saved file is write-only in the filesystem. If - so, locks the editor with the - @method[editor<%> lock] - method. Otherwise unlocks the buffer - - For each canvas returned from - @method[editor<%> get-canvases] - it checks to see if the - @scheme[canvas%]'s - @method[area<%> get-top-level-window] - matches the - @scheme[frame:editor<%>] - interface. If so, it calls - @method[frame:editor-mixin set-label] - with the last part of the filename (ie, the name of the file, not the - directory the file is in). + For each canvas returned from @method[editor<%> get-canvases] it checks to + see if the @racket[canvas%]'s @method[area<%> get-top-level-window] matches + the @racket[frame:editor<%>] interface. If so, it calls + @method[frame:editor-mixin set-label] with the last part of the filename + (ie, the name of the file, not the directory the file is in). } + @defmethod*[#:mode augment (((after-load-file) void?))]{ + Checks if the newly loaded file is write-only in the filesystem. If so, + locks the editor with the @method[editor<%> lock] method. Otherwise unlocks + the buffer - Checks if the newly loaded file is write-only in the filesystem. If - so, locks the editor with the - @method[editor<%> lock] - method. Otherwise unlocks the buffer - - For each canvas returned from - @method[editor<%> get-canvases] - it checks to see if the - @scheme[canvas%]'s - @method[area<%> get-top-level-window] - matches the - @scheme[frame:editor<%>] - interface. If so, it calls - @method[frame:editor-mixin set-label] - with the last part of the filename (ie, the name of the file, not the - directory the file is in). + For each canvas returned from @method[editor<%> get-canvases] it checks to + see if the @racket[canvas%]'s @method[area<%> get-top-level-window] matches + the @racket[frame:editor<%>] interface. If so, it calls + @method[frame:editor-mixin set-label] with the last part of the filename + (ie, the name of the file, not the directory the file is in). } } + @definterface[text:ports<%> ()]{ - Classes implementing this interface (via the associated - mixin) support input and output ports that read from and to the - editor. + Classes implementing this interface (via the associated mixin) support input + and output ports that read from and to the editor. - There are two input ports: the normal input port just reads - from the editor's contents directly and the box input port - inserts an editor snip into this text and uses input typed - into the box as input into the port. + There are two input ports: the normal input port just reads from the editor's + contents directly and the box input port inserts an editor snip into this + text and uses input typed into the box as input into the port. + + There are three output ports, designed to match stdout, stderr, and a special + port for printing values. The only difference between them is the output is + rendered in different colors when it comes in via the different ports. + + They create three threads to mediate access to the input and output ports + (one for each input port and one for all of the output ports). - There are three output ports, designed to match stdout, stderr, - and a special port for printing values. The only difference - between them is the output is rendered in different colors - when it comes in via the different ports. - - They create three threads to mediate access to the input and - output ports (one for each input port and one for all of the - output ports). @defmethod*[(((delete/io (start exact-integer?) (end exact-integer?)) void?))]{ - Deletes the text between @scheme[start] and @scheme[end] without - changing the behavior of the ports (otherwise, deleting the - text would break internal invariants of the port). - - Both @scheme[start] and @scheme[end] must be less than - @method[text:ports<%> get-insertion-point] - (or else it is safe to delete them so you don't need this - method). - + Deletes the text between @racket[start] and @racket[end] without changing + the behavior of the ports (otherwise, deleting the text would break + internal invariants of the port). + Both @racket[start] and @racket[end] must be less than + @method[text:ports<%> get-insertion-point] (or else it is safe to delete + them so you don't need this method). } + @defmethod*[(((get-insertion-point) exact-integer?))]{ - Returns the position where characters put into the output - port will appear. - + Returns the position where characters put into the output port will appear. } + @defmethod*[(((set-insertion-point (ip exact-integer?)) void?))]{ - Sets the position where the output port will insert characters. - See also + Sets the position where the output port will insert characters. See also @method[text:ports<%> get-insertion-point]. - } + @defmethod*[(((get-unread-start-point) exact-integer?))]{ - Returns the position where input will be taken into the - input port (after the next time return is typed). - + Returns the position where input will be taken into the input port (after + the next time return is typed). } + @defmethod*[(((set-unread-start-point (usp exact-integer?)) void?))]{ - Sets the position where input will be taken into the - input port (after the next time return is typed). - - See also - @method[text:ports<%> get-unread-start-point]. + Sets the position where input will be taken into the input port (after the + next time return is typed). + See also @method[text:ports<%> get-unread-start-point]. } + @defmethod*[(((set-allow-edits (allow-edits? boolean?)) void?))]{ - Enables or disables editing in the buffer. Be sure to update - the unread start point (via - @method[text:ports<%> set-unread-start-point]) and the insertion point (via - @method[text:ports<%> set-insertion-point]) after making changes to the buffer. - + Enables or disables editing in the buffer. Be sure to update the unread + start point (via @method[text:ports<%> set-unread-start-point]) and the + insertion point (via @method[text:ports<%> set-insertion-point]) after + making changes to the buffer. } + @defmethod*[(((get-allow-edits) boolean?))]{ Indicates if editing is allowed in the buffer at this point. - } + @defmethod*[(((insert-between (str (or/c (is-a?/c snip%) string?))) void?))]{ - Inserts some text between the unread start point and the - insertion point (and updates them properly). To insert - before the two points, see + Inserts some text between the unread start point and the insertion point + (and updates them properly). To insert before the two points, see @method[text:ports<%> insert-before]. - See also - @method[text:ports<%> set-unread-start-point] - and + See also @method[text:ports<%> set-unread-start-point] and @method[text:ports<%> set-insertion-point]. - } + @defmethod*[(((insert-before (str (or/c (is-a?/c snip%) string?))) void?))]{ - Inserts some text before the unread start point and updates - it and the insertion point properly. To insert between - the two points, see + Inserts some text before the unread start point and updates it and the + insertion point properly. To insert between the two points, see @method[text:ports<%> insert-between]. - See also - @method[text:ports<%> set-unread-start-point] - and + See also @method[text:ports<%> set-unread-start-point] and @method[text:ports<%> set-insertion-point]. - } + @defmethod*[(((submit-to-port? (key (is-a?/c key-event%))) boolean?))]{ - Augment this method to help control when characters should - be submitted to the input port. + Augment this method to help control when characters should be submitted to + the input port. - - Return @scheme[#t] or the result of calling @scheme[inner]. + Return @racket[#t] or the result of calling @racket[inner]. } + @defmethod*[(((on-submit) void?))]{ This method is called when text is sent into the input port. - Does nothing. } + @defmethod*[(((send-eof-to-in-port) void?))]{ This method puts an eof into the input port. - } + @defmethod*[(((send-eof-to-box-in-port) void?))]{ This method puts an eof into the box input port. - } + @defmethod*[(((reset-input-box) void?))]{ - This method removes the current input box from the editor - (and all input in it is lost). - + This method removes the current input box from the editor (and all input in + it is lost). } + @defmethod*[(((clear-output-ports) void?))]{ - Flushes all of the data in all of the output ports that - hasn't appeared in the editor yet. - + Flushes all of the data in all of the output ports that hasn't appeared in + the editor yet. } + @defmethod*[(((clear-input-port) void?))]{ - Flushes all of the data in the input port that hasn't yet - been read. Reading will now block. - + Flushes all of the data in the input port that hasn't yet been + read. Reading will now block. } + @defmethod*[(((clear-box-input-port) void?))]{ - Flushes all of the data in the box input port that hasn't - yet been read. Reading will now block. - + Flushes all of the data in the box input port that hasn't yet been + read. Reading will now block. } + @defmethod*[(((get-out-style-delta) (or/c (is-a?/c style-delta%) string?)))]{ - The result of this method is the style that is used to color - text submitted to the result of - @method[text:ports<%> get-out-port]. + The result of this method is the style that is used to color text submitted + to the result of @method[text:ports<%> get-out-port]. - If the result is a string that is not mapped in the editor's - style list, the style named @scheme["Standard"] is used and - if that isn't mapped, the style named @scheme["Basic"] is used. + If the result is a string that is not mapped in the editor's style list, + the style named @racket["Standard"] is used and if that isn't mapped, the + style named @racket["Basic"] is used. This method is called during the initialization of the class. - - Defaultly returns @scheme["text:ports out"] which is mapped - to a blue style in the style list returned by - @scheme[editor:get-standard-style-list]. + Defaultly returns @racket["text:ports out"] which is mapped to a blue style + in the style list returned by @racket[editor:get-standard-style-list]. } + @defmethod*[(((get-err-style-delta) (or/c (is-a?/c style-delta%) string?)))]{ - The result of this method is the style that is used to color - text submitted to the result of - @method[text:ports<%> get-err-port]. + The result of this method is the style that is used to color text submitted + to the result of @method[text:ports<%> get-err-port]. - If the result is a string that is not mapped in the editor's - style list, the style named @scheme["Standard"] is used and - if that isn't mapped, the style named @scheme["Basic"] is used. + If the result is a string that is not mapped in the editor's style list, + the style named @racket["Standard"] is used and if that isn't mapped, the + style named @racket["Basic"] is used. This method is called during the initialization of the class. - - Defaultly returns @scheme["text:ports err"] which is mapped - to a red italic style in the style list returned by - @scheme[editor:get-standard-style-list]. + Defaultly returns @racket["text:ports err"] which is mapped to a red italic + style in the style list returned by + @racket[editor:get-standard-style-list]. } + @defmethod*[(((get-value-style-delta) (or/c (is-a?/c style-delta%) string?)))]{ - The result of this method is the style (or the name of the - style) that is used to color text submitted to the result of - @method[text:ports<%> get-value-port]. + The result of this method is the style (or the name of the style) that is + used to color text submitted to the result of @method[text:ports<%> + get-value-port]. - If the result is a string that is not mapped in the editor's - style list, the style named @scheme["Standard"] is used and - if that isn't mapped, the style named @scheme["Basic"] is used. + If the result is a string that is not mapped in the editor's style list, + the style named @racket["Standard"] is used and if that isn't mapped, the + style named @racket["Basic"] is used. This method is called during the initialization of the class. - - - Defaultly returns @scheme["text:ports value"] which is mapped - to a blue style in the style list returned by - @scheme[editor:get-standard-style-list]. - + Defaultly returns @racket["text:ports value"] which is mapped to a blue + style in the style list returned by + @racket[editor:get-standard-style-list]. } + @defmethod*[(((get-in-port) input-port?))]{ Returns the input port that data in this editor is sent to. - } + @defmethod*[(((get-in-box-port) input-port?))]{ Returns the box input port that data in this editor is sent to. - } + @defmethod*[(((get-out-port) output-port?))]{ - Returns an output port that writes into this editor. The - only difference between this port and the ports returned by - @method[text:ports<%> get-err-port] - and - @method[text:ports<%> get-value-port] - is the font style and color. - + Returns an output port that writes into this editor. The only difference + between this port and the ports returned by @method[text:ports<%> + get-err-port] and @method[text:ports<%> get-value-port] is the font style + and color. } + @defmethod*[(((get-err-port) output-port?))]{ - Returns an output port that writes into this editor. The - only difference between this port and the ports returned by - @method[text:ports<%> get-err-port] - and - @method[text:ports<%> get-out-port] - is the font style and color. - + Returns an output port that writes into this editor. The only difference + between this port and the ports returned by @method[text:ports<%> + get-err-port] and @method[text:ports<%> get-out-port] is the font style and + color. } + @defmethod*[(((get-value-port) output-port?))]{ - Returns an output port that writes into this editor. The - only difference between this port and the ports returned by - @method[text:ports<%> get-err-port] - and - @method[text:ports<%> get-out-port] - is the font style and color. - + Returns an output port that writes into this editor. The only difference + between this port and the ports returned by @method[text:ports<%> + get-err-port] and @method[text:ports<%> get-out-port] is the font style and + color. } + @defmethod*[(((after-io-insertion) void?))]{ This method is called after an insertion due to IO occurs. - } + @defmethod*[(((get-box-input-editor-snip%) (subclass?/c editor-snip%)))]{ - The result of this method is used as the class of editor - snips that is inserted by the box port in this editor. - + The result of this method is used as the class of editor snips that is + inserted by the box port in this editor. } + @defmethod*[(((get-box-input-text%) (is-a?/c text:input-box<%>)))]{ The result of this method is instantiated and placed inside the result of @method[text:ports<%> get-box-input-editor-snip%]. - } } + @defmixin[text:ports-mixin (text:wide-snip<%>) (text:ports<%>)]{ @defmethod*[#:mode augment (((can-insert? (start exact-integer?) (len exact-integer?)) boolean?))]{ - - Returns the results of the @scheme[inner] call, unless - @method[text:ports<%> get-allow-edits] - returns @scheme[#f]. + Returns the results of the @racket[inner] call, unless + @method[text:ports<%> get-allow-edits] returns @racket[#f]. } + @defmethod*[#:mode augment (((can-delete? (start exact-integer?) (len exact-integer?)) boolean?))]{ - - Returns the results of the @scheme[inner] call, unless - @method[text:ports<%> get-allow-edits] - returns @scheme[#f]. + Returns the results of the @racket[inner] call, unless + @method[text:ports<%> get-allow-edits] returns @racket[#f]. } + @defmethod*[#:mode override (((on-local-char (event (is-a?/c key-event%))) void?))]{ + Sends the data between the last position and the result of + @method[text:ports<%> get-unread-start-point] to the input port, unless + @method[text:ports<%> submit-to-port?] returns @racket[#f]. - Sends the data between the last position and the result of - @method[text:ports<%> get-unread-start-point] - to the input port, unless - @method[text:ports<%> submit-to-port?] - returns @scheme[#f]. - - Also calls - @method[text:ports<%> on-submit]. + Also calls @method[text:ports<%> on-submit]. } - @defmethod*[#:mode augment (((on-display-size) void?))]{ + @defmethod*[#:mode augment (((on-display-size) void?))]{ Adjusts the embedded editor-snip (used for reading input to the @method[text:ports<%> get-in-box-port]) to match the width of the editor. } } + @definterface[text:input-box<%> (text%)]{ - Classes that implement this interface are used as the - editors for the box input port in - @scheme[text:ports%]. - + Classes that implement this interface are used as the editors for the box + input port in @racket[text:ports%]. } -@defmixin[text:input-box-mixin (text%) (text:input-box<%>)]{ - This mixin provides an implementation of - @scheme[text:input-box<%>] - for use with - @scheme[text:ports<%>]. - @defmethod*[#:mode override (((on-default-char (event (is-a?/c key-event%))) void?))]{ - Notifies the - @scheme[text:ports<%>] - enclosing this editor that a new line of input has been provided. +@defmixin[text:input-box-mixin (text%) (text:input-box<%>)]{ + This mixin provides an implementation of @racket[text:input-box<%>] for use + with @racket[text:ports<%>]. + + @defmethod*[#:mode override + (((on-default-char (event (is-a?/c key-event%))) void?))]{ + Notifies the @racket[text:ports<%>] enclosing this editor that a new line + of input has been provided. } } + @definterface[text:autocomplete<%> (text%)]{ - The mixin implementing this interface provides an - unintrusive autocompletion menu when a particular - (configurable) keystroke is pressed. + The mixin implementing this interface provides an unintrusive autocompletion + menu when a particular (configurable) keystroke is pressed. @defmethod*[(((auto-complete) void?))]{ Starts a completion. - } + @defmethod*[(((get-autocomplete-border-color) (or/c string? (is-a?/c color%))))]{ - The border color for the autocomplete menu. Defaults to - @scheme["black"]. - + The border color for the autocomplete menu. Defaults to @racket["black"]. } + @defmethod*[(((get-autocomplete-background-color) (or/c string? (is-a?/c color%))))]{ - The background color for the non-selected menu - items. Defaults to @scheme["lavender"]. - + The background color for the non-selected menu items. Defaults to + @racket["lavender"]. } + @defmethod*[(((get-autocomplete-selected-color) (or/c string? (is-a?/c color%))))]{ The background color for the selected menu item. Defaults to - @scheme[(make-object color% 204 153 255)]. - + @racket[(make-object color% 204 153 255)]. } + @defmethod*[(((completion-mode-key-event? (key-event (is-a?/c key-event%))) boolean?))]{ - Returns true when the key event passed to it should initiate - the completions menu. - + Returns true when the key event passed to it should initiate the + completions menu. } + @defmethod*[(((get-all-words) (listof string?)))]{ - Returns the list of the words that autocompletion should - choose from. + choose from. } - @defmethod*[(((get-word-at (pos exact-positive-integer?)) string?))]{ + @defmethod*[(((get-word-at (pos exact-positive-integer?)) string?))]{ Given an editor location, returns the prefix ending at that location that autocompletion should try to complete. } } + @defmixin[text:autocomplete-mixin (text%) (text:autocomplete<%>)]{ @defmethod*[#:mode override (((on-paint) void?))]{ - Draws the completion menu (when it is popped up). } + @defmethod*[#:mode override (((on-char) void?))]{ - - Takes over the handling of key events when the completions - menu is visible. Also, when the completions menu is not - visible, it calls the - @method[text:completion<%> completion-mode-key-event?] - method to see if it should start completing. + Takes over the handling of key events when the completions menu is + visible. Also, when the completions menu is not visible, it calls the + @method[text:completion<%> completion-mode-key-event?] method to see if it + should start completing. } + @defmethod*[#:mode override (((on-event) void?))]{ + This method is overridden to allow mouse access of the completions menu. It + only handles events when there is a menu open and the mouse is in the menu, + in which case it makes the menu trace the mouse. - This method is overridden to allow mouse access of the - completions menu. It only handles events when there is a - menu open and the mouse is in the menu, in which case it - makes the menu trace the mouse. - - The only time it does not call the super method is when - the mouse is button is pushed. + The only time it does not call the super method is when the mouse is button + is pushed. } } + @defclass[text:basic% (text:basic-mixin (editor:basic-mixin text%)) ()]{} @defclass[text:hide-caret/selection% (text:hide-caret/selection-mixin text:basic%) ()]{} @defclass[text:nbsp->space% (text:nbsp->space-mixin text:basic%) ()]{} @@ -1193,17 +1073,14 @@ @definterface[text:line-numbers<%> ()]{ @defmethod*[(((show-line-numbers! (show boolean?)) void?))]{ - Enables or disables line number drawing. } - - @defmethod*[(((show-line-numbers?) boolean?))]{ + @defmethod*[(((show-line-numbers?) boolean?))]{ Returns whether or not line drawing is enabled. } - - @defmethod*[(((set-line-numbers-color (color string?)) void?))]{ + @defmethod*[(((set-line-numbers-color (color string?)) void?))]{ Sets the color of the line numbers. } } @@ -1211,7 +1088,6 @@ @defmixin[text:line-numbers-mixin (text%) (text:line-numbers<%>)]{ @defmethod*[#:mode override (((on-paint) void?))]{ - Draws the line numbers. } diff --git a/collects/scribblings/gui/add-color-intf.scrbl b/collects/scribblings/gui/add-color-intf.scrbl index d207f565aa..5adae03698 100644 --- a/collects/scribblings/gui/add-color-intf.scrbl +++ b/collects/scribblings/gui/add-color-intf.scrbl @@ -3,33 +3,27 @@ @definterface/title[add-color<%> ()]{ -An @scheme[add-color<%>] object is used to additively change the RGB - values of a @scheme[color%] object. An @scheme[add-color<%>] object - only exists within a @scheme[style-delta%] object. - -See also @method[style-delta% get-foreground-add] and - @method[style-delta% get-background-add]. - +An @racket[add-color<%>] object is used to additively change the RGB values of +a @racket[color%] object. An @racket[add-color<%>] object only exists within a +@racket[style-delta%] object. +See also @method[style-delta% get-foreground-add] and @method[style-delta% +get-background-add]. @defmethod[(get [r (box/c (integer-in -1000 1000))] [g (box/c (integer-in -1000 1000))] [b (box/c (integer-in -1000 1000))]) void?]{ + Gets all of the additive values. -Gets all of the additive values. - -@boxisfill[(scheme r) @elem{the additive value for the red component of the color}] -@boxisfill[(scheme g) @elem{the additive value for the green component of the color}] -@boxisfill[(scheme b) @elem{the additive value for the blue component of the color}] - + @boxisfill[(scheme r) @elem{the additive value for the red component of the color}] + @boxisfill[(scheme g) @elem{the additive value for the green component of the color}] + @boxisfill[(scheme b) @elem{the additive value for the blue component of the color}] } @defmethod[(get-b) (integer-in -1000 1000)]{ - -Gets the additive value for the blue component of the color. - + Gets the additive value for the blue component of the color. } @defmethod[(get-g) @@ -41,38 +35,28 @@ Gets the additive value for the green component of the color. @defmethod[(get-r) (integer-in -1000 1000)]{ - -Gets the additive value for the red component of the color. - + Gets the additive value for the red component of the color. } @defmethod[(set [r (integer-in -1000 1000)] [g (integer-in -1000 1000)] [b (integer-in -1000 1000)]) void?]{ - -Sets all of the additive values. - + Sets all of the additive values. } @defmethod[(set-b [v (integer-in -1000 1000)]) void?]{ - -Sets the additive value for the blue component of the color. - + Sets the additive value for the blue component of the color. } @defmethod[(set-g [v (integer-in -1000 1000)]) void?]{ - -Sets the additive value for the green component of the color. - + Sets the additive value for the green component of the color. } @defmethod[(set-r [v (integer-in -1000 1000)]) void?]{ - -Sets the additive value for the red component of the color. - + Sets the additive value for the red component of the color. }} diff --git a/collects/scribblings/gui/area-container-intf.scrbl b/collects/scribblings/gui/area-container-intf.scrbl index 6bea8e6476..51620a2a9f 100644 --- a/collects/scribblings/gui/area-container-intf.scrbl +++ b/collects/scribblings/gui/area-container-intf.scrbl @@ -3,18 +3,18 @@ @definterface/title[area-container<%> (area<%>)]{ -An @scheme[area-container<%>] is a container @scheme[area<%>]. +An @racket[area-container<%>] is a container @racket[area<%>]. -All @scheme[area-container<%>] classes accept the following named - instantiation arguments: +All @racket[area-container<%>] classes accept the following named +instantiation arguments: @itemize[ - @item{@indexed-scheme[border] --- default is @scheme[0]; passed to + @item{@indexed-racket[border] --- default is @racket[0]; passed to @method[area-container<%> border]} - @item{@indexed-scheme[spacing] --- default is @scheme[0]; passed to + @item{@indexed-racket[spacing] --- default is @racket[0]; passed to @method[area-container<%> spacing]} - @item{@indexed-scheme[alignment] --- default is class-specific, such as - @scheme['(center top)] for @scheme[vertical-panel%]; the list + @item{@indexed-racket[alignment] --- default is class-specific, such as + @racket['(center top)] for @racket[vertical-panel%]; the list elements are passed to @method[area-container<%> set-alignment]} ] @@ -200,15 +200,15 @@ Sets the alignment specification for a container, which determines how it positions its children when the container has leftover space (when a child was not stretchable in a particular dimension). -When the container's horizontal alignment is @scheme['left], the +When the container's horizontal alignment is @racket['left], the children are left-aligned in the container and whitespace is inserted to the right. When the container's horizontal alignment is - @scheme['center], each child is horizontally centered in the + @racket['center], each child is horizontally centered in the container. When the container's horizontal alignment is - @scheme['right], leftover whitespace is inserted to the left. + @racket['right], leftover whitespace is inserted to the left. -Similarly, a container's vertical alignment can be @scheme['top], - @scheme['center], or @scheme['bottom]. +Similarly, a container's vertical alignment can be @racket['top], + @racket['center], or @racket['bottom]. } diff --git a/collects/scribblings/gui/area-intf.scrbl b/collects/scribblings/gui/area-intf.scrbl index a52055fd48..d06de46a1e 100644 --- a/collects/scribblings/gui/area-intf.scrbl +++ b/collects/scribblings/gui/area-intf.scrbl @@ -3,22 +3,22 @@ @definterface/title[area<%> ()]{ -An @scheme[area<%>] object is either a window or a windowless +An @racket[area<%>] object is either a window or a windowless container for managing the position and size of other areas. An - @scheme[area<%>] can be a container, a containee, or both. The only + @racket[area<%>] can be a container, a containee, or both. The only areas without a parent are top-level windows. -All @scheme[area<%>] classes accept the following named instantiation +All @racket[area<%>] classes accept the following named instantiation arguments: @itemize[ - @item{@indexed-scheme[min-width] --- default is the initial graphical minimum width; passed to + @item{@indexed-racket[min-width] --- default is the initial graphical minimum width; passed to @method[area<%> min-width]} - @item{@indexed-scheme[min-height] --- default is the initial graphical minimum height; passed to + @item{@indexed-racket[min-height] --- default is the initial graphical minimum height; passed to @method[area<%> min-height]} - @item{@indexed-scheme[stretchable-width] --- default is class-specific; passed to + @item{@indexed-racket[stretchable-width] --- default is class-specific; passed to @method[area<%> stretchable-width]} - @item{@indexed-scheme[stretchable-height] --- default is class-specific; passed to + @item{@indexed-racket[stretchable-height] --- default is class-specific; passed to @method[area<%> stretchable-height]} ] @@ -42,7 +42,7 @@ See @|geomdiscuss| for more information. Note that the return value (or/c (is-a?/c area-container<%>) false/c)]{ Returns the area's parent. A top-level window may have no parent (in - which case @scheme[#f] is returned), or it may have another top-level + which case @racket[#f] is returned), or it may have another top-level window as its parent. } @@ -72,7 +72,7 @@ An area's initial minimum width is its graphical minimum width. See also @method[area<%> get-graphical-min-size] . -When setting the minimum width, if @scheme[w] is smaller than the +When setting the minimum width, if @racket[w] is smaller than the internal hard minimum, @|MismatchExn|. } @@ -93,7 +93,7 @@ An area's initial minimum height is its graphical minimum height. See also @method[area<%> get-graphical-min-size] . -When setting the minimum height (in pixels); if @scheme[h] is smaller +When setting the minimum height (in pixels); if @racket[h] is smaller than the internal hard minimum, @|MismatchExn|. } diff --git a/collects/scribblings/gui/blurbs.rkt b/collects/scribblings/gui/blurbs.rkt index eb97d645b8..9367409887 100644 --- a/collects/scribblings/gui/blurbs.rkt +++ b/collects/scribblings/gui/blurbs.rkt @@ -35,8 +35,8 @@ @method[top-level-window<%> on-traverse-char]).}) (define (labelstripped where detail what) - @elem{If @litchar{&} occurs in @|where|@|detail|, it - is specially parsed as for @scheme[button%].}) + @elem{If @litchar{&} occurs in @|where|@|detail|, it + is specially parsed as for @racket[button%].}) (define (bitmapuseinfo pre what thing and the) @elem{@|pre| @|what| is @|thing|,@|and| if @|the| @@ -62,7 +62,7 @@ (define (popupmenuinfo what other more) (make-splice (list* - @p{Pops up the given @scheme[popup-menu%] object at the specified + @p{Pops up the given @racket[popup-menu%] object at the specified coordinates (in this window's coordinates), and returns after handling an unspecified number of events; the menu may still be popped up when this method returns. If a menu item is selected from @@ -105,7 +105,7 @@ information@|details|, even if the editor currently has delayed refreshing (see (define FCA (FCAX "C" "")) (define FCAMW (FCAX "C" " if a maximum width is set for the editor")) - (define (FCAME) (FCAX @elem{For @scheme[text%] objects, c} " if a maximum width is set for the editor")) + (define (FCAME) (FCAX @elem{For @racket[text%] objects, c} " if a maximum width is set for the editor")) (define EVD @elem{If the editor is not displayed and the editor has a @@ -158,20 +158,20 @@ information@|details|, even if the editor currently has delayed refreshing (see (define DrawSizeNote "") - (define LineNumbering @elem{Lines are numbered starting with @scheme[0].}) - (define ParagraphNumbering @elem{Paragraphs are numbered starting with @scheme[0].}) + (define LineNumbering @elem{Lines are numbered starting with @racket[0].}) + (define ParagraphNumbering @elem{Paragraphs are numbered starting with @racket[0].}) (define (italicptyStyleNote style) @elem{The @|style| argument is provided for future extensions. Currently, @|style| must be the empty list.}) (define (HVLabelNote style what) - @elem{If @|style| includes @scheme['vertical-label], then the @|what| is + @elem{If @|style| includes @racket['vertical-label], then the @|what| is created with a label above the control; if @|style| does not include - @scheme['vertical-label] (and optionally includes @scheme['horizontal-label]), then the + @racket['vertical-label] (and optionally includes @racket['horizontal-label]), then the label is created to the left of the @|what|.}) (define (DeletedStyleNote style parent what) - @elem{If @|style| includes @scheme['deleted], then the @|what| is created as hidden, + @elem{If @|style| includes @racket['deleted], then the @|what| is created as hidden, and it does not affect its parent's geometry; the @|what| can be made active later by calling @|parent|'s @method[area-container<%> add-child] method.}) @@ -183,18 +183,18 @@ information@|details|, even if the editor currently has delayed refreshing (see (define (FontLabelKWs font label-font) @elem{The @|font| argument determines the font for the control content, and @|label-font| determines the font for the control label.}) - (define (WindowKWs enabled) @elem{For information about the @|enabled| argument, see @scheme[window<%>].}) + (define (WindowKWs enabled) @elem{For information about the @|enabled| argument, see @racket[window<%>].}) (define-inline (SubareaKWs) - @elem{For information about the @scheme[horiz-margin] and @scheme[vert-margin] - arguments, see @scheme[subarea<%>].}) + @elem{For information about the @racket[horiz-margin] and @racket[vert-margin] + arguments, see @racket[subarea<%>].}) (define-inline (AreaContKWs) - @elem{For information about the @scheme[border], @scheme[spacing], and @scheme[alignment] - arguments, see @scheme[area-container<%>].}) + @elem{For information about the @racket[border], @racket[spacing], and @racket[alignment] + arguments, see @racket[area-container<%>].}) (define-inline (AreaKWs) @elem{For information about the - @scheme[min-width], @scheme[min-height], @scheme[stretchable-width], and - @scheme[stretchable-height] arguments, see @scheme[area<%>].}) + @racket[min-width], @racket[min-height], @racket[stretchable-width], and + @racket[stretchable-height] arguments, see @racket[area<%>].}) (define AFM @elem{Adobe Font Metrics}) @@ -246,7 +246,7 @@ information@|details|, even if the editor currently has delayed refreshing (see (bytes->string/latin-1 name)))) (define (edsnipsize a b c) - @elem{An @scheme[editor-snip%] normally stretches to wrap around the size + @elem{An @racket[editor-snip%] normally stretches to wrap around the size of the editor it contains. This method @|a| of the snip (and if the editor is @|b|, @|c|).}) (define (edsnipmax n) diff --git a/collects/scribblings/gui/button-class.scrbl b/collects/scribblings/gui/button-class.scrbl index 099f07d2bb..25369ef6a4 100644 --- a/collects/scribblings/gui/button-class.scrbl +++ b/collects/scribblings/gui/button-class.scrbl @@ -31,7 +31,7 @@ Creates a button with a string label, bitmap label, or both. symbol @racket['left], @racket['top], @racket['right], or @racket['bottom] specifies the location of the image relative to the text on the button. -If @litchar{&} occurs in @scheme[label] (when @scheme[label] includes a +If @litchar{&} occurs in @racket[label] (when @racket[label] includes a string), it is specially parsed; on Windows and Unix, the character following @litchar{&} is underlined in the displayed control to indicate a keyboard mnemonic. (On Mac OS X, mnemonic underlines are @@ -41,8 +41,8 @@ mnemonic when the control's top-level-window contains the keyboard focus. The user must also hold down the Meta or Alt key if the keyboard focus is currently in a control that handles normal alphanumeric input. The @litchar{&} itself is removed from -@scheme[label] before it is displayed for the control; a @litchar{&&} -in @scheme[label] is converted to @litchar{&} (with no mnemonic +@racket[label] before it is displayed for the control; a @litchar{&&} +in @racket[label] is converted to @litchar{&} (with no mnemonic underlining). On Mac OS X, a parenthesized mnemonic character is removed (along with any surrounding space) before the label is displayed, since a parenthesized mnemonic is often used for non-Roman @@ -51,15 +51,15 @@ platforms. Mnemonic keyboard events are handled by @method[top-level-window<%> on-traverse-char] (but not on Mac OS X). -The @scheme[callback] procedure is called (with the event type -@indexed-scheme['button]) whenever the user clicks the button. +The @racket[callback] procedure is called (with the event type +@indexed-racket['button]) whenever the user clicks the button. -If @scheme[style] includes @scheme['border], the button is drawn with +If @racket[style] includes @racket['border], the button is drawn with a special border that indicates to the user that it is the default action button (see @method[top-level-window<%> -on-traverse-char]). @DeletedStyleNote[@scheme[style] @scheme[parent]]{button} +on-traverse-char]). @DeletedStyleNote[@racket[style] @racket[parent]]{button} -@FontKWs[@scheme[font]] @WindowKWs[@scheme[enabled]] @SubareaKWs[] @AreaKWs[]} +@FontKWs[@racket[font]] @WindowKWs[@racket[enabled]] @SubareaKWs[] @AreaKWs[]} @defmethod[#:mode override @@ -67,7 +67,7 @@ on-traverse-char]). @DeletedStyleNote[@scheme[style] @scheme[parent]]{button} (is-a?/c bitmap%))]) void?]{ -The same as @xmethod[window<%> set-label] when @scheme[label] is a +The same as @xmethod[window<%> set-label] when @racket[label] is a string. Otherwise, sets the bitmap label for a bitmap button. @bitmaplabeluseisbm[label] diff --git a/collects/scribblings/gui/canvas-class.scrbl b/collects/scribblings/gui/canvas-class.scrbl index a9e04451f6..bfca4ca60f 100644 --- a/collects/scribblings/gui/canvas-class.scrbl +++ b/collects/scribblings/gui/canvas-class.scrbl @@ -3,7 +3,7 @@ @defclass/title[canvas% object% (canvas<%>)]{ -A @scheme[canvas%] object is a general-purpose window for drawing and +A @racket[canvas%] object is a general-purpose window for drawing and handling events. See @racket[canvas<%>] for information about drawing onto a canvas. @@ -25,77 +25,77 @@ A @scheme[canvas%] object is a general-purpose window for drawing and [stretchable-width any/c #t] [stretchable-height any/c #t])]{ -The @scheme[style] argument indicates one or more of the following styles: +The @racket[style] argument indicates one or more of the following styles: @itemize[ - @item{@scheme['border] --- gives the canvas a thin border} + @item{@racket['border] --- gives the canvas a thin border} - @item{@scheme['control-border] --- gives the canvas a border that is - like a @scheme[text-field%] control} + @item{@racket['control-border] --- gives the canvas a border that is + like a @racket[text-field%] control} - @item{@scheme['combo] --- gives the canvas a combo button that is like - a @scheme[combo-field%] control; this style is intended for use - with @scheme['control-border] and not with @scheme['hscroll] or - @scheme['vscroll]} + @item{@racket['combo] --- gives the canvas a combo button that is like + a @racket[combo-field%] control; this style is intended for use + with @racket['control-border] and not with @racket['hscroll] or + @racket['vscroll]} - @item{@scheme['hscroll] --- enables horizontal scrolling (initially visible but inactive)} + @item{@racket['hscroll] --- enables horizontal scrolling (initially visible but inactive)} - @item{@scheme['vscroll] --- enables vertical scrolling (initially visible but inactive)} + @item{@racket['vscroll] --- enables vertical scrolling (initially visible but inactive)} - @item{@scheme['resize-corner] --- leaves room for a resize control at the canvas's + @item{@racket['resize-corner] --- leaves room for a resize control at the canvas's bottom right when only one scrollbar is visible} - @item{@scheme['gl] --- creates a canvas for OpenGL drawing instead of + @item{@racket['gl] --- creates a canvas for OpenGL drawing instead of normal @racket[dc<%>] drawing; call the @method[dc<%> get-gl-context] method on the result of @method[canvas<%> get-dc]; this style is usually combined with @racket['no-autoclear]} - @item{@scheme['no-autoclear] --- prevents automatic erasing of the + @item{@racket['no-autoclear] --- prevents automatic erasing of the canvas by the windowing system; see @racket[canvas<%>] for information on canvas refresh} - @item{@scheme['transparent] --- the canvas is ``erased'' by the + @item{@racket['transparent] --- the canvas is ``erased'' by the windowing system by letting its parent show through; see @racket[canvas<%>] for information on window refresh and on the interaction of @racket['transparent] and offscreen buffering; the result is undefined if this flag is combined with - @scheme['no-autoclear]} + @racket['no-autoclear]} - @item{@scheme['no-focus] --- prevents the canvas from accepting the + @item{@racket['no-focus] --- prevents the canvas from accepting the keyboard focus when the canvas is clicked, or when the @method[window<%> focus] method is called} - @item{@scheme['deleted] --- creates the canvas as initially hidden and without affecting - @scheme[parent]'s geometry; the canvas can be made active - later by calling @scheme[parent]'s @method[area-container<%> add-child] + @item{@racket['deleted] --- creates the canvas as initially hidden and without affecting + @racket[parent]'s geometry; the canvas can be made active + later by calling @racket[parent]'s @method[area-container<%> add-child] method} ] -The @scheme['hscroll] and @scheme['vscroll] styles create a +The @racket['hscroll] and @racket['vscroll] styles create a canvas with an initially inactive scrollbar. The scrollbars are activated with either @method[canvas% init-manual-scrollbars] or @method[canvas% init-auto-scrollbars], and they can be hidden and re-shown with @method[canvas% show-scrollbars]. -The @scheme[paint-callback] argument is called by the default +The @racket[paint-callback] argument is called by the default @method[canvas% on-paint] method, using the canvas and the DC returned by @method[canvas<%> get-dc] as the argument. -The @scheme[label] argument names the canvas for +The @racket[label] argument names the canvas for @method[window<%> get-label], but it is not displayed with the canvas. -The @scheme[gl-config] argument determines properties of an OpenGL +The @racket[gl-config] argument determines properties of an OpenGL context for this canvas, as obtained through the canvas's drawing context. See also @method[canvas<%> get-dc] and @xmethod[dc<%> get-gl-context]. -@WindowKWs[@scheme[enabled]] @SubareaKWs[] @AreaKWs[] +@WindowKWs[@racket[enabled]] @SubareaKWs[] @AreaKWs[] } @@ -104,10 +104,10 @@ The @scheme[gl-config] argument determines properties of an OpenGL (integer-in 1 1000000)]{ Get the current page step size of a manual scrollbar. The result is - @scheme[0] if the scrollbar is not active or it is automatic. + @racket[0] if the scrollbar is not active or it is automatic. -The @scheme[which] argument is either @scheme['horizontal] or - @scheme['vertical], indicating whether to get the page step size of +The @racket[which] argument is either @racket['horizontal] or + @racket['vertical], indicating whether to get the page step size of the horizontal or vertical scrollbar, respectively. See also @@ -119,10 +119,10 @@ See also (integer-in 0 1000000)]{ Gets the current value of a manual scrollbar. The result is always - @scheme[0] if the scrollbar is not active or it is automatic. + @racket[0] if the scrollbar is not active or it is automatic. -The @scheme[which] argument is either @scheme['horizontal] or - @scheme['vertical], indicating that the value of the horizontal or +The @racket[which] argument is either @racket['horizontal] or + @racket['vertical], indicating that the value of the horizontal or vertical scrollbar should be returned, respectively. See also @@ -134,10 +134,10 @@ See also (integer-in 0 1000000)]{ Gets the current maximum value of a manual scrollbar. The result is - always @scheme[0] if the scrollbar is not active or it is automatic. + always @racket[0] if the scrollbar is not active or it is automatic. -The @scheme[which] argument is either @scheme['horizontal] or - @scheme['vertical], indicating whether to get the maximum value of the +The @racket[which] argument is either @racket['horizontal] or + @racket['vertical], indicating whether to get the maximum value of the horizontal or vertical scrollbar, respectively. See also @@ -157,7 +157,7 @@ efficiently redraw only the visible portion of the canvas. The values are in pixels. If the scrollbars are disabled or initialized as manual (see -@method[canvas% init-manual-scrollbars]), the result is @scheme[(values 0 0)]. +@method[canvas% init-manual-scrollbars]), the result is @racket[(values 0 0)]. } @@ -181,8 +181,8 @@ Gets the size in device units of the scrollable canvas area (as Enables and initializes automatic scrollbars for the canvas. A horizontal or vertical scrollbar can be activated only in a canvas - that was created with the @indexed-scheme['hscroll] or - @indexed-scheme['vscroll] style flag, respectively. + that was created with the @indexed-racket['hscroll] or + @indexed-racket['vscroll] style flag, respectively. With automatic scrollbars, the programmer specifies the desired virtual size of the canvas, and the scrollbars are automatically @@ -196,15 +196,15 @@ See also are independently enabled. Automatic scrollbars can be re-initialized as manual, and vice versa. -If either @scheme[horiz-pixels] or @scheme[vert-pixels] is - @scheme[#f], the scrollbar is not enabled in the corresponding +If either @racket[horiz-pixels] or @racket[vert-pixels] is + @racket[#f], the scrollbar is not enabled in the corresponding direction, and the canvas's virtual size in that direction is the same as its client size. -The @scheme[h-value] and @scheme[v-value] arguments specify the initial +The @racket[h-value] and @racket[v-value] arguments specify the initial values of the scrollbars as a fraction of the scrollbar's range. A - @scheme[0.0] value initializes the scrollbar to its left/top, while a - @scheme[1.0] value initializes the scrollbar to its right/bottom. + @racket[0.0] value initializes the scrollbar to its left/top, while a + @racket[1.0] value initializes the scrollbar to its right/bottom. See also @method[canvas% on-scroll] and @@ -222,8 +222,8 @@ See also Enables and initializes manual scrollbars for the canvas. A horizontal or vertical scrollbar can be activated only in a canvas - that was created with the @indexed-scheme['hscroll] or - @indexed-scheme['vscroll] style flag, respectively. + that was created with the @indexed-racket['hscroll] or + @indexed-racket['vscroll] style flag, respectively. With manual scrollbars, the programmer is responsible for managing all details of the scrollbars, and the scrollbar state has no effect on @@ -236,20 +236,20 @@ See also are independently enabled. Automatic scrollbars can be re-initialized as manual, and vice versa. -The @scheme[h-length] and @scheme[v-length] arguments specify the length of +The @racket[h-length] and @racket[v-length] arguments specify the length of each scrollbar in scroll steps (i.e., the maximum value of each - scrollbar). If either is @scheme[#f], the scrollbar is disabled in the + scrollbar). If either is @racket[#f], the scrollbar is disabled in the corresponding direction. -The @scheme[h-page] and @scheme[v-page] arguments set the number of +The @racket[h-page] and @racket[v-page] arguments set the number of scrollbar steps in a page, i.e., the amount moved when pressing above or below the value indicator in the scrollbar control. -The @scheme[h-value] and @scheme[v-value] arguments specify the initial +The @racket[h-value] and @racket[v-value] arguments specify the initial values of the scrollbars. -If @scheme[h-value] is greater than @scheme[h-length] or @scheme[v-value] is - greater than @scheme[v-length], @|MismatchExn|. (The page step may be +If @racket[h-value] is greater than @racket[h-length] or @racket[v-value] is + greater than @racket[v-length], @|MismatchExn|. (The page step may be larger than the total size of a scrollbar.) See also @@ -270,16 +270,15 @@ canvas. See also @racket[make-screen-bitmap].} (on-paint) void?]{ -Calls the procedure supplied as the @scheme[paint-callback] argument when - the @scheme[canvas%] was created. - +Calls the procedure supplied as the @racket[paint-callback] argument when + the @racket[canvas%] was created. } @defmethod[(on-scroll [event (is-a?/c scroll-event%)]) void?]{ Called when the user changes one of the canvas's scrollbars. A - @scheme[scroll-event%] argument provides information about the + @racket[scroll-event%] argument provides information about the scroll action. This method is called only when manual @@ -313,16 +312,16 @@ flushing is enabled, and if @racket[flush?] is true, then Sets the values of automatic scrollbars. (This method has no effect on manual scrollbars.) -If either argument is @scheme[#f], the scrollbar value is not changed in +If either argument is @racket[#f], the scrollbar value is not changed in the corresponding direction. -The @scheme[h-value] and @scheme[v-value] arguments each specify a fraction - of the scrollbar's movement. A @scheme[0.0] value sets the scrollbar to - its left/top, while a @scheme[1.0] value sets the scrollbar to its - right/bottom. A @scheme[0.5] value sets the scrollbar to its middle. In - general, if the canvas's virtual size is @scheme[_v], its client size is - @scheme[_c], and @scheme[(> _v _c)], then scrolling to @scheme[_p] - sets the view start to @scheme[(floor (* _p (- _v _c)))]. +The @racket[h-value] and @racket[v-value] arguments each specify a fraction + of the scrollbar's movement. A @racket[0.0] value sets the scrollbar to + its left/top, while a @racket[1.0] value sets the scrollbar to its + right/bottom. A @racket[0.5] value sets the scrollbar to its middle. In + general, if the canvas's virtual size is @racket[_v], its client size is + @racket[_c], and @racket[(> _v _c)], then scrolling to @racket[_p] + sets the view start to @racket[(floor (* _p (- _v _c)))]. See also @method[canvas% init-auto-scrollbars] and @@ -338,8 +337,8 @@ See also Set the current page step size of a manual scrollbar. (This method has no effect on automatic scrollbars.) -The @scheme[which] argument is either @scheme['horizontal] or - @scheme['vertical], indicating whether to set the page step size of +The @racket[which] argument is either @racket['horizontal] or + @racket['vertical], indicating whether to set the page step size of the horizontal or vertical scrollbar, respectively. See also @@ -355,8 +354,8 @@ See also Sets the current value of a manual scrollbar. (This method has no effect on automatic scrollbars.) -The @scheme[which] argument is either @scheme['horizontal] or - @scheme['vertical], indicating whether to set the value of the +The @racket[which] argument is either @racket['horizontal] or + @racket['vertical], indicating whether to set the value of the horizontal or vertical scrollbar set, respectively. @MonitorMethod[@elem{The value of the canvas's scrollbar} @elem{the user scrolling} @elem{@method[canvas% on-scroll]} @elem{scrollbar value}] @@ -375,8 +374,8 @@ See also Sets the current maximum value of a manual scrollbar. (This method has no effect on automatic scrollbars.) -The @scheme[which] argument is either @scheme['horizontal] or - @scheme['vertical], indicating whether to set the maximum value of the +The @racket[which] argument is either @racket['horizontal] or + @racket['vertical], indicating whether to set the maximum value of the horizontal or vertical scrollbar, respectively. See also @@ -389,17 +388,17 @@ See also void?]{ Shows or hides the scrollbars as indicated by -@scheme[show-horiz?] and @scheme[show-vert?]. If -@scheme[show-horiz?] is true and the canvas was not created with -the @scheme['hscroll] style, @|MismatchExn|. Similarly, if -@scheme[show-vert?] is true and the canvas was not created with -the @scheme['vscroll] style, @|MismatchExn|. +@racket[show-horiz?] and @racket[show-vert?]. If +@racket[show-horiz?] is true and the canvas was not created with +the @racket['hscroll] style, @|MismatchExn|. Similarly, if +@racket[show-vert?] is true and the canvas was not created with +the @racket['vscroll] style, @|MismatchExn|. The horizontal scrollbar can be shown only if the canvas was -created with the @scheme['hscroll] style, and the vertical +created with the @racket['hscroll] style, and the vertical scrollbar can be shown only if the canvas was created with the -@scheme['vscroll] style. See also @method[canvas% +@racket['vscroll] style. See also @method[canvas% init-auto-scrollbars] and @method[canvas% init-manual-scrollbars]. diff --git a/collects/scribblings/gui/canvas-intf.scrbl b/collects/scribblings/gui/canvas-intf.scrbl index 36124fdab3..fdd326f852 100644 --- a/collects/scribblings/gui/canvas-intf.scrbl +++ b/collects/scribblings/gui/canvas-intf.scrbl @@ -6,14 +6,14 @@ A canvas is a subwindow onto which graphics and text can be drawn. Canvases also receive mouse and keyboard events. -The @scheme[canvas<%>] interface is implemented by two classes: +The @racket[canvas<%>] interface is implemented by two classes: @itemize[ - @item{@scheme[canvas%] --- a canvas for arbitrary drawing and + @item{@racket[canvas%] --- a canvas for arbitrary drawing and event handling; and} - @item{@scheme[editor-canvas%] --- a canvas for displaying - @scheme[editor<%>] objects.} + @item{@racket[editor-canvas%] --- a canvas for displaying + @racket[editor<%>] objects.} ] @@ -92,19 +92,19 @@ recorded in the canvas's offscreen buffer, however. @index['("keyboard focus" "navigation")]{Gets} or sets whether tab-focus is enabled for the canvas (assuming that the canvas is -not created with the @scheme['no-focus] style for @scheme[canvas%]). When tab-focus is +not created with the @racket['no-focus] style for @racket[canvas%]). When tab-focus is enabled, the canvas can receive the keyboard focus when the user navigates among a frame or dialog's controls with the Tab and arrow keys. By default, tab-focus is disabled. -When tab-focus is enabled for a @scheme[canvas%] object, Tab, arrow, +When tab-focus is enabled for a @racket[canvas%] object, Tab, arrow, Enter, and Escape keyboard events are consumed by a frame's default @method[top-level-window<%> on-traverse-char] method. (In addition, a dialog's default method consumes Escape key events.) Otherwise, @method[top-level-window<%> on-traverse-char] allows the keyboard events to be propagated to the canvas. -For an @scheme[editor-canvas%] object, handling of Tab, arrow, Enter, +For an @racket[editor-canvas%] object, handling of Tab, arrow, Enter, and Escape keyboard events is determined by the @method[editor-canvas% allow-tab-exit] method. @@ -123,17 +123,17 @@ Returns the color currently used to ``erase'' the canvas content before @method[canvas<%> on-paint] is called. See also @method[canvas<%> set-canvas-background]. -The result is @scheme[#f] if the canvas was created with the - @indexed-scheme['transparent] style, otherwise it is always a - @scheme[color%] object. +The result is @racket[#f] if the canvas was created with the + @indexed-racket['transparent] style, otherwise it is always a + @racket[color%] object. } @defmethod[(get-dc) (is-a?/c dc<%>)]{ -Gets the canvas's device context. See -@scheme[dc<%>] for more information about drawing. +Gets the canvas's device context. See @racket[dc<%>] for more information about +drawing. } @@ -267,7 +267,7 @@ Sets the color used to ``erase'' the canvas content before low level, so that it is used even when a complete refresh of the canvas is delayed by other activity.) -If the canvas was created with the @indexed-scheme['transparent] style, +If the canvas was created with the @indexed-racket['transparent] style, @|MismatchExn|. } @@ -280,7 +280,7 @@ On Mac OS X, enables or disables space for a resize tab at the method has no effect on Windows or Unix, and it has no effect when both or no scrollbars are visible. The resize corner is disabled by default, but it can be enabled when a canvas is created with the - @scheme['resize-corner] style. + @racket['resize-corner] style. } diff --git a/collects/scribblings/gui/check-box-class.scrbl b/collects/scribblings/gui/check-box-class.scrbl index 1fa60f6b83..51d2b47e92 100644 --- a/collects/scribblings/gui/check-box-class.scrbl +++ b/collects/scribblings/gui/check-box-class.scrbl @@ -30,17 +30,17 @@ Whenever a check box is clicked by the user, the check box's value is Creates a check box with a string or bitmap label. @bitmaplabeluse[label] -@labelstripped[(scheme label) @elem{ (when @scheme[label] is a string)} @elem{effectively click the check box}] +@labelstripped[(scheme label) @elem{ (when @racket[label] is a string)} @elem{effectively click the check box}] -The @scheme[callback] procedure is called (with the event type - @indexed-scheme['check-box]) whenever the user clicks the check box. +The @racket[callback] procedure is called (with the event type + @indexed-racket['check-box]) whenever the user clicks the check box. -@DeletedStyleNote[@scheme[style] @scheme[parent]]{check box} +@DeletedStyleNote[@racket[style] @racket[parent]]{check box} -If @scheme[value] is true, it is passed to +If @racket[value] is true, it is passed to @method[check-box% set-value] so that the box is initially checked. -@FontKWs[@scheme[font]] @WindowKWs[@scheme[enabled]] @SubareaKWs[] @AreaKWs[] +@FontKWs[@racket[font]] @WindowKWs[@racket[enabled]] @SubareaKWs[] @AreaKWs[] @@ -48,7 +48,7 @@ If @scheme[value] is true, it is passed to @defmethod[(get-value) boolean?]{ -Gets the state of the check box: @scheme[#t] if it is checked, @scheme[#f] +Gets the state of the check box: @racket[#t] if it is checked, @racket[#f] otherwise. } @@ -57,7 +57,7 @@ Gets the state of the check box: @scheme[#t] if it is checked, @scheme[#f] (set-label [label (or/c label-string? (is-a?/c bitmap%))]) void?]{ -The same as @xmethod[window<%> set-label] when @scheme[label] is a +The same as @xmethod[window<%> set-label] when @racket[label] is a string. Otherwise, sets the bitmap label for a bitmap check box. @@ -74,7 +74,7 @@ Sets the check box's state. (The control's callback procedure is @MonitorCallback[@elem{The check box's state} @elem{the user clicking the control} @elem{state}] -If @scheme[state] is @scheme[#f], the box is +If @racket[state] is @racket[#f], the box is unchecked, otherwise it is checked. }} diff --git a/collects/scribblings/gui/checkable-menu-item-class.scrbl b/collects/scribblings/gui/checkable-menu-item-class.scrbl index fa8b5300af..c5c095a330 100644 --- a/collects/scribblings/gui/checkable-menu-item-class.scrbl +++ b/collects/scribblings/gui/checkable-menu-item-class.scrbl @@ -3,9 +3,9 @@ @defclass/title[checkable-menu-item% object% (selectable-menu-item<%>)]{ -A @scheme[checkable-menu-item%] is a string-labelled menu item that - maintains a check mark. Its parent must be a @scheme[menu%] or - @scheme[popup-menu%]. When the user selects the menu item, the +A @racket[checkable-menu-item%] is a string-labelled menu item that + maintains a check mark. Its parent must be a @racket[menu%] or + @racket[popup-menu%]. When the user selects the menu item, the item's check mark is toggled and its callback procedure is called. @@ -22,29 +22,29 @@ A @scheme[checkable-menu-item%] is a string-labelled menu item that 'shift 'option)) (get-default-shortcut-prefix)])]{ -Creates a new menu item in @scheme[parent]. The item is initially +Creates a new menu item in @racket[parent]. The item is initially shown, appended to the end of its parent, and unchecked. The - @scheme[callback] procedure is called (with the event type - @indexed-scheme['menu]) when the menu item is selected (either via a + @racket[callback] procedure is called (with the event type + @indexed-racket['menu]) when the menu item is selected (either via a menu bar, @xmethod[window<%> popup-menu], or @xmethod[editor-admin% popup-menu]). See @method[labelled-menu-item<%> set-label] for information about -mnemonic @litchar{&}s in @scheme[label]. +mnemonic @litchar{&}s in @racket[label]. -If @scheme[shortcut] is not @scheme[#f], the item has a shortcut. See +If @racket[shortcut] is not @racket[#f], the item has a shortcut. See @method[selectable-menu-item<%> get-shortcut] for more information. -The @scheme[shortcut-prefix] argument determines the set of modifier +The @racket[shortcut-prefix] argument determines the set of modifier keys for the shortcut; see @method[selectable-menu-item<%> get-shortcut-prefix]. -If @scheme[help] is not @scheme[#f], the item has a help string. See +If @racket[help] is not @racket[#f], the item has a help string. See @method[labelled-menu-item<%> get-help-string] for more information. -The @scheme[demand-callback] procedure is called by the default +The @racket[demand-callback] procedure is called by the default @method[labelled-menu-item<%> on-demand] method with the object itself. -By default, the menu item is initially unchecked. If @scheme[checked] +By default, the menu item is initially unchecked. If @racket[checked] is true, then @method[checkable-menu-item% check] is called so that the menu item is initially checked. @@ -62,7 +62,7 @@ Checks or unchecks the menu item. @defmethod[(is-checked?) boolean?]{ -Returns @scheme[#t] if the item is checked, @scheme[#f] otherwise. +Returns @racket[#t] if the item is checked, @racket[#f] otherwise. }} diff --git a/collects/scribblings/gui/choice-class.scrbl b/collects/scribblings/gui/choice-class.scrbl index 9b2a211522..7724c2d9e6 100644 --- a/collects/scribblings/gui/choice-class.scrbl +++ b/collects/scribblings/gui/choice-class.scrbl @@ -12,8 +12,7 @@ Whenever the selection of a choice item is changed by the user, the provided as an initialization argument when each choice item is created. -See also -@scheme[list-box%]. +See also @racket[list-box%]. @defconstructor[([label (or/c label-string? false/c)] @@ -35,29 +34,30 @@ See also [stretchable-width any/c #f] [stretchable-height any/c #f])]{ -Creates a choice item. If @scheme[label] is a string, it is used as the - label for the choice item. +Creates a choice item. If @racket[label] is a string, it is used as the + label for the choice item. @labelstripped[(scheme label) @elem{} @elem{move the keyboard focus to the choice item}] -The @scheme[choices] list specifies the initial list of user-selectable +The @racket[choices] list specifies the initial list of user-selectable items for the control. The initial set of choices determines the control's minimum graphical width (see @|geomdiscuss| for more information). -The @scheme[callback] procedure is called (with the event type - @indexed-scheme['choice]) when the user selects a choice item (or +The @racket[callback] procedure is called (with the event type + @indexed-racket['choice]) when the user selects a choice item (or re-selects the currently selected item). -@HVLabelNote[@scheme[style]]{choice item} @DeletedStyleNote[@scheme[style] @scheme[parent]]{choice item} +@HVLabelNote[@racket[style]]{choice item} +@DeletedStyleNote[@racket[style] @racket[parent]]{choice item} By default, the first choice (if any) is initially selected. If - @scheme[selection] is positive, it is passed to -@method[list-control<%> set-selection] to set the initial choice selection. Although @scheme[selection] normally - must be less than the length of @scheme[choices], it can be @scheme[0] - when @scheme[choices] is empty. + @racket[selection] is positive, it is passed to +@method[list-control<%> set-selection] to set the initial choice selection. Although @racket[selection] normally + must be less than the length of @racket[choices], it can be @racket[0] + when @racket[choices] is empty. -@FontKWs[@scheme[font]] @WindowKWs[@scheme[enabled]] @SubareaKWs[] @AreaKWs[] +@FontKWs[@racket[font]] @WindowKWs[@racket[enabled]] @SubareaKWs[] @AreaKWs[] }} diff --git a/collects/scribblings/gui/clipboard-client-class.scrbl b/collects/scribblings/gui/clipboard-client-class.scrbl index 9cabd9d7af..2a6c438f43 100644 --- a/collects/scribblings/gui/clipboard-client-class.scrbl +++ b/collects/scribblings/gui/clipboard-client-class.scrbl @@ -3,11 +3,11 @@ @defclass/title[clipboard-client% object% ()]{ -A @scheme[clipboard-client%] object allows a program to take over +A @racket[clipboard-client%] object allows a program to take over the clipboard and service requests for clipboard data. See - @scheme[clipboard<%>] for more information. + @racket[clipboard<%>] for more information. -A @scheme[clipboard-client%] object is associated to an eventspace +A @racket[clipboard-client%] object is associated to an eventspace when it becomes the current client; see @method[clipboard<%> set-clipboard-client] for more information. @@ -24,9 +24,9 @@ Creates a clipboard client that supports no data formats. Adds a new data format name to the list supported by the clipboard client. -The @scheme[format] string is typically four capital letters. (On - Mac OS X, only four characters for @scheme[format] are ever used.) - For example, @scheme["TEXT"] is the name of the UTF-8-encoded string +The @racket[format] string is typically four capital letters. (On + Mac OS X, only four characters for @racket[format] are ever used.) + For example, @racket["TEXT"] is the name of the UTF-8-encoded string format. New format names can be used to communicate application- and platform-specific data formats. @@ -38,7 +38,7 @@ The @scheme[format] string is typically four capital letters. (On Called when a process requests clipboard data while this client is the current one for the clipboard. The requested format is passed to the method, and the result should be a byte string matching the requested - format, or @scheme[#f] if the request cannot be fulfilled. + format, or @racket[#f] if the request cannot be fulfilled. Only data format names in the client's list will be passed to this method; see @method[clipboard-client% add-type]. diff --git a/collects/scribblings/gui/clipboard-intf.scrbl b/collects/scribblings/gui/clipboard-intf.scrbl index 01483df36a..1155754ff6 100644 --- a/collects/scribblings/gui/clipboard-intf.scrbl +++ b/collects/scribblings/gui/clipboard-intf.scrbl @@ -3,23 +3,23 @@ @definterface/title[clipboard<%> ()]{ -A single @scheme[clipboard<%>] object, @indexed-scheme[the-clipboard], +A single @racket[clipboard<%>] object, @indexed-racket[the-clipboard], manages the content of the system-wide clipboard for cut and paste. -On Unix, a second @scheme[clipboard<%>] object, - @indexed-scheme[the-x-selection-clipboard], manages the content of the +On Unix, a second @racket[clipboard<%>] object, + @indexed-racket[the-x-selection-clipboard], manages the content of the system-wide X11 selection. If the @ResourceFirst{selectionAsClipboard} preference (see @|mrprefsdiscuss|) is set to a non-zero true value, - however, then @scheme[the-clipboard] is always the same as - @scheme[the-x-selection-clipboard], and the system-wide X11 clipboard + however, then @racket[the-clipboard] is always the same as + @racket[the-x-selection-clipboard], and the system-wide X11 clipboard is not used. -On Windows and Mac OS X, @scheme[the-x-selection-clipboard] is - always the same as @scheme[the-clipboard]. +On Windows and Mac OS X, @racket[the-x-selection-clipboard] is + always the same as @racket[the-clipboard]. Data can be entered into a clipboard in one of two ways: by setting the current clipboard string or byte string, or by installing a - @scheme[clipboard-client%] object. When a client is installed, + @racket[clipboard-client%] object. When a client is installed, requests for clipboard data are directed to the client. Generic data is always retrieved from the clipboard as a byte @@ -32,13 +32,13 @@ Generic data is always retrieved from the clipboard as a byte (or/c (is-a?/c bitmap%) false/c)]{ Gets the current clipboard contents as a bitmap (Windows, Mac OS X), - returning @scheme[#f] if the clipboard does not contain a bitmap. + returning @racket[#f] if the clipboard does not contain a bitmap. See @method[clipboard<%> get-clipboard-data] for information on eventspaces and the current clipboard client. -See @|timediscuss| for a discussion of the @scheme[time] argument. If - @scheme[time] is outside the platform-specific range of times, +See @|timediscuss| for a discussion of the @racket[time] argument. If + @racket[time] is outside the platform-specific range of times, @|MismatchExn|. } @@ -48,19 +48,19 @@ See @|timediscuss| for a discussion of the @scheme[time] argument. If (or/c bytes? string? false/c)]{ Gets the current clipboard contents in a specific format, returning - @scheme[#f] if the clipboard does not contain data in the requested + @racket[#f] if the clipboard does not contain data in the requested format. If the clipboard client is associated to an eventspace that is not the current one, the data is retrieved through a callback event in the client's eventspace. If no result is available within one second, the - request is abandoned and @scheme[#f] is returned. + request is abandoned and @racket[#f] is returned. See @xmethod[clipboard-client% add-type] for information on -@scheme[format]. +@racket[format]. -See @|timediscuss| for a discussion of the @scheme[time] argument. If - @scheme[time] is outside the platform-specific range of times, +See @|timediscuss| for a discussion of the @racket[time] argument. If + @racket[time] is outside the platform-specific range of times, @|MismatchExn|. } @@ -69,13 +69,13 @@ See @|timediscuss| for a discussion of the @scheme[time] argument. If (or/c string false/c)]{ Gets the current clipboard contents as simple text, returning - @scheme[#f] if the clipboard does not contain any text. + @racket[#f] if the clipboard does not contain any text. See @method[clipboard<%> get-clipboard-data] for information on eventspaces and the current clipboard client. -See @|timediscuss| for a discussion of the @scheme[time] argument. If - @scheme[time] is outside the platform-specific range of times, +See @|timediscuss| for a discussion of the @racket[time] argument. If + @racket[time] is outside the platform-specific range of times, @|MismatchExn|. } @@ -84,19 +84,19 @@ See @|timediscuss| for a discussion of the @scheme[time] argument. If @defmethod[(same-clipboard-client? [owner (is-a?/c clipboard-client%)]) boolean?]{ -Returns @scheme[#t] if @scheme[owner] currently owns the clipboard, -@scheme[#f] otherwise.} +Returns @racket[#t] if @racket[owner] currently owns the clipboard, +@racket[#f] otherwise.} @defmethod[(set-clipboard-bitmap [new-bitmap (is-a?/c bitmap%)] [time exact-integer?]) void?]{ -Changes the current clipboard contents to @scheme[new-bitmap] (Windows, Mac OS X) +Changes the current clipboard contents to @racket[new-bitmap] (Windows, Mac OS X) and releases the current clipboard client (if any). See @|timediscuss| for - a discussion of the @scheme[time] argument. If @scheme[time] is outside + a discussion of the @racket[time] argument. If @racket[time] is outside the platform-specific range of times, @|MismatchExn|. } @@ -106,13 +106,13 @@ See @|timediscuss| for void?]{ Changes the clipboard-owning client: sets the client to - @scheme[new-owner] and associates @scheme[new-owner] with the current - eventspace (as determined by @scheme[current-eventspace]). The + @racket[new-owner] and associates @racket[new-owner] with the current + eventspace (as determined by @racket[current-eventspace]). The eventspace association is removed when the client is no longer the current one. -See @|timediscuss| for a discussion of the @scheme[time] argument. If - @scheme[time] is outside the platform-specific range of times, +See @|timediscuss| for a discussion of the @racket[time] argument. If + @racket[time] is outside the platform-specific range of times, @|MismatchExn|. } @@ -121,11 +121,11 @@ See @|timediscuss| for a discussion of the @scheme[time] argument. If [time exact-integer?]) void?]{ -Changes the current clipboard contents to @scheme[new-text], +Changes the current clipboard contents to @racket[new-text], and releases the current clipboard client (if any). See @|timediscuss| for - a discussion of the @scheme[time] argument. If @scheme[time] is outside + a discussion of the @racket[time] argument. If @racket[time] is outside the platform-specific range of times, @|MismatchExn|. } } diff --git a/collects/scribblings/gui/column-control-event-class.scrbl b/collects/scribblings/gui/column-control-event-class.scrbl index cbc2636536..05124afbef 100644 --- a/collects/scribblings/gui/column-control-event-class.scrbl +++ b/collects/scribblings/gui/column-control-event-class.scrbl @@ -3,7 +3,7 @@ @defclass/title[column-control-event% control-event% ()]{ -A @scheme[column-control-event%] object contains information about a +A @racket[column-control-event%] object contains information about a event on an @racket[list-box%] column header. @defconstructor[([column exact-nonnegative-integer?] diff --git a/collects/scribblings/gui/combo-field-class.scrbl b/collects/scribblings/gui/combo-field-class.scrbl index 007c52151b..7b974a4e2b 100644 --- a/collects/scribblings/gui/combo-field-class.scrbl +++ b/collects/scribblings/gui/combo-field-class.scrbl @@ -3,8 +3,8 @@ @defclass/title[combo-field% text-field% ()]{ -A @scheme[combo-field%] object is a @scheme[text-field%] - object that also resembles a @scheme[choice%] object, because it +A @racket[combo-field%] object is a @racket[text-field%] + object that also resembles a @racket[choice%] object, because it has a small popup button to the right of the text field. Clicking the button pops up a menu, and selecting a menu item typically copies the item into the text field. @@ -31,32 +31,32 @@ A @scheme[combo-field%] object is a @scheme[text-field%] [stretchable-width any/c #t] [stretchable-height any/c #f])]{ -If @scheme[label] is not @scheme[#f], it is used as the combo label. +If @racket[label] is not @racket[#f], it is used as the combo label. Otherwise, the combo does not display its label. @labelstripped[(scheme label) @elem{} @elem{move the keyboard focus to the combo}] -The @scheme[choices] list specifies the initial list of items for the +The @racket[choices] list specifies the initial list of items for the combo's popup menu. The @method[combo-field% append] method adds a new item to the menu with a callback to install the appended item into the combo's text field. The @method[combo-field% get-menu] method returns a menu that can be changed to adjust the content and actions of the combo's menu. -The @scheme[callback] procedure is called when the user changes the text +The @racket[callback] procedure is called when the user changes the text in the combo or presses the Enter key (and Enter is not handled by the combo's frame or dialog; see @xmethod[top-level-window<%> on-traverse-char] ). If the user presses Enter, the type of event passed to the callback - is @indexed-scheme['text-field-enter], otherwise it is - @indexed-scheme['text-field]. + is @indexed-racket['text-field-enter], otherwise it is + @indexed-racket['text-field]. -If @scheme[init-value] is not @scheme[""], the minimum width of the text item - is made wide enough to show @scheme[init-value]. Otherwise, a built-in +If @racket[init-value] is not @racket[""], the minimum width of the text item + is made wide enough to show @racket[init-value]. Otherwise, a built-in default width is selected. -@HVLabelNote[@scheme[style]]{combo} @DeletedStyleNote[@scheme[style] @scheme[parent]]{combo}. +@HVLabelNote[@racket[style]]{combo} @DeletedStyleNote[@racket[style] @racket[parent]]{combo}. -@FontKWs[@scheme[font]] @WindowKWs[@scheme[enabled]] @SubareaKWs[] @AreaKWs[] +@FontKWs[@racket[font]] @WindowKWs[@racket[enabled]] @SubareaKWs[] @AreaKWs[] } @@ -74,7 +74,7 @@ Adds a new item to the combo's popup menu. The given label is used for @defmethod[(get-menu) (is-a?/c popup-menu%)]{ -Returns a @scheme[popup-menu%] that is effectively copied into the +Returns a @racket[popup-menu%] that is effectively copied into the combo's popup menu when the combo is clicked. Only the labels can callbacks of the menu's items are used; the enable state, submenus, or separators are ignored. diff --git a/collects/scribblings/gui/control-event-class.scrbl b/collects/scribblings/gui/control-event-class.scrbl index fd377191bd..5394c81058 100644 --- a/collects/scribblings/gui/control-event-class.scrbl +++ b/collects/scribblings/gui/control-event-class.scrbl @@ -3,8 +3,8 @@ @defclass/title[control-event% event% ()]{ -A @scheme[control-event%] object contains information about a - control event. An instance of @scheme[control-event%] is always +A @racket[control-event%] object contains information about a + control event. An instance of @racket[control-event%] is always provided to a control or menu item callback procedure. @defconstructor[([event-type (one-of/c 'button 'check-box 'choice @@ -14,31 +14,31 @@ A @scheme[control-event%] object contains information about a 'menu-popdown 'menu-popdown-none)] [time-stamp exact-integer? 0])]{ -The @scheme[event-type] argument is one of the following: +The @racket[event-type] argument is one of the following: @itemize[ -@item{@scheme['button] --- for @scheme[button%] clicks} -@item{@scheme['check-box] --- for @scheme[check-box%] toggles} -@item{@scheme['choice] --- for @scheme[choice%] item selections} -@item{@scheme['list-box] --- for @scheme[list-box%] selections and deselections} -@item{@scheme['list-box-dclick] --- for @scheme[list-box%] double-clicks} -@item{@scheme['list-box-column] --- for @scheme[list-box%] column clicks in +@item{@racket['button] --- for @racket[button%] clicks} +@item{@racket['check-box] --- for @racket[check-box%] toggles} +@item{@racket['choice] --- for @racket[choice%] item selections} +@item{@racket['list-box] --- for @racket[list-box%] selections and deselections} +@item{@racket['list-box-dclick] --- for @racket[list-box%] double-clicks} +@item{@racket['list-box-column] --- for @racket[list-box%] column clicks in a @racket[column-control-event%] instance} -@item{@scheme['text-field] --- for @scheme[text-field%] changes} -@item{@scheme['text-field-enter] --- for single-line @scheme[text-field%] Enter event} -@item{@scheme['menu] --- for @scheme[selectable-menu-item<%>] callbacks} -@item{@scheme['slider] --- for @scheme[slider%] changes} -@item{@scheme['radio-box] --- for @scheme[radio-box%] selection changes} -@item{@scheme['tab-panel] --- for @scheme[tab-panel%] tab changes} -@item{@scheme['menu-popdown] --- for @scheme[popup-menu%] callbacks (item selected)} -@item{@scheme['menu-popdown-none] --- for @scheme[popup-menu%] callbacks (no item selected)} +@item{@racket['text-field] --- for @racket[text-field%] changes} +@item{@racket['text-field-enter] --- for single-line @racket[text-field%] Enter event} +@item{@racket['menu] --- for @racket[selectable-menu-item<%>] callbacks} +@item{@racket['slider] --- for @racket[slider%] changes} +@item{@racket['radio-box] --- for @racket[radio-box%] selection changes} +@item{@racket['tab-panel] --- for @racket[tab-panel%] tab changes} +@item{@racket['menu-popdown] --- for @racket[popup-menu%] callbacks (item selected)} +@item{@racket['menu-popdown-none] --- for @racket[popup-menu%] callbacks (no item selected)} ] -This value is extracted out of a @scheme[control-event%] object with +This value is extracted out of a @racket[control-event%] object with the @method[control-event% get-event-type] method. See @method[event% get-time-stamp] for information about -@scheme[time-stamp]. +@racket[time-stamp]. } @@ -48,7 +48,7 @@ See @method[event% get-time-stamp] for information about 'text-field-enter 'menu 'slider 'radio-box 'menu-popdown 'menu-popdown-none 'tab-panel)]{ Returns the type of the control event. See -@scheme[control-event%] for information about each event type symbol. +@racket[control-event%] for information about each event type symbol. } @@ -60,6 +60,6 @@ Returns the type of the control event. See void?]{ Sets the type of the event. See -@scheme[control-event%] for information about each event type symbol. +@racket[control-event%] for information about each event type symbol. }} diff --git a/collects/scribblings/gui/control-intf.scrbl b/collects/scribblings/gui/control-intf.scrbl index d270343de8..a45e48272e 100644 --- a/collects/scribblings/gui/control-intf.scrbl +++ b/collects/scribblings/gui/control-intf.scrbl @@ -3,18 +3,18 @@ @definterface/title[control<%> (subwindow<%>)]{ -The @scheme[control<%>] interface is implemented by the built-in +The @racket[control<%>] interface is implemented by the built-in control window classes: @itemize[ -@item{@scheme[message%]} -@item{@scheme[button%]} -@item{@scheme[check-box%]} -@item{@scheme[slider%]} -@item{@scheme[gauge%]} -@item{@scheme[text-field%]} -@item{@scheme[radio-box%]} -@item{@scheme[choice%]} -@item{@scheme[list-box%]} +@item{@racket[message%]} +@item{@racket[button%]} +@item{@racket[check-box%]} +@item{@racket[slider%]} +@item{@racket[gauge%]} +@item{@racket[text-field%]} +@item{@racket[radio-box%]} +@item{@racket[choice%]} +@item{@racket[list-box%]} ] @@ -23,7 +23,7 @@ The @scheme[control<%>] interface is implemented by the built-in void?]{ Calls the control's callback function, passing on the given - @scheme[control-event%] object. + @racket[control-event%] object. }} diff --git a/collects/scribblings/gui/cursor-class.scrbl b/collects/scribblings/gui/cursor-class.scrbl index 9a86e296d4..70785e12fd 100644 --- a/collects/scribblings/gui/cursor-class.scrbl +++ b/collects/scribblings/gui/cursor-class.scrbl @@ -23,7 +23,7 @@ A cursor is assigned to each window (or the window may use its The first case creates a cursor using an image bitmap and a mask bitmap. Both bitmaps must have depth 1 and size 16 by 16 -pixels. The @scheme[hot-spot-x] and @scheme[hot-spot-y] arguments +pixels. The @racket[hot-spot-x] and @racket[hot-spot-y] arguments determine the focus point of the cursor within the cursor image, relative to its top-left corner. @@ -32,38 +32,38 @@ as one of the following: @itemize[ - @item{@scheme['arrow] --- the default cursor} + @item{@racket['arrow] --- the default cursor} - @item{@scheme['bullseye] --- concentric circles} + @item{@racket['bullseye] --- concentric circles} - @item{@scheme['cross] --- a crosshair} + @item{@racket['cross] --- a crosshair} - @item{@scheme['hand] --- an open hand} + @item{@racket['hand] --- an open hand} - @item{@scheme['ibeam] --- a vertical line, indicating that clicks + @item{@racket['ibeam] --- a vertical line, indicating that clicks control a text-selection caret} - @item{@scheme['watch] --- a watch or hourglass, indicating that + @item{@racket['watch] --- a watch or hourglass, indicating that the user must wait for a computation to complete} - @item{@scheme['arrow+watch] --- the default cursor with a watch or + @item{@racket['arrow+watch] --- the default cursor with a watch or hourglass, indicating that some computation is in progress, but the cursor can still be used} - @item{@scheme['blank] --- invisible} + @item{@racket['blank] --- invisible} - @item{@scheme['size-e/w] --- arrows left and right} + @item{@racket['size-e/w] --- arrows left and right} - @item{@scheme['size-n/s] --- arrows up and down} + @item{@racket['size-n/s] --- arrows up and down} - @item{@scheme['size-ne/sw] --- arrows up-right and down-left} + @item{@racket['size-ne/sw] --- arrows up-right and down-left} - @item{@scheme['size-nw/se] --- arrows up-left and down-right} + @item{@racket['size-nw/se] --- arrows up-left and down-right} ] If the cursor is created successfully, @method[cursor% ok?] -returns @scheme[#t], otherwise the cursor object cannot be +returns @racket[#t], otherwise the cursor object cannot be assigned to a window. } @@ -71,8 +71,8 @@ assigned to a window. @defmethod[(ok?) boolean?]{ -Returns @scheme[#t] if the cursor is can be assigned to a window, - @scheme[#f] otherwise. +Returns @racket[#t] if the cursor is can be assigned to a window, + @racket[#f] otherwise. }} diff --git a/collects/scribblings/gui/dialog-class.scrbl b/collects/scribblings/gui/dialog-class.scrbl index 3e15c7a231..cd6c362bee 100644 --- a/collects/scribblings/gui/dialog-class.scrbl +++ b/collects/scribblings/gui/dialog-class.scrbl @@ -27,47 +27,47 @@ A dialog is a top-level window that is @defterm{modal}: while the [stretchable-width any/c #t] [stretchable-height any/c #t])]{ -The @scheme[label] string is used as the dialog's title in its +The @racket[label] string is used as the dialog's title in its title bar. If the dialog's label is changed (see @method[window<%> set-label]), the title bar is updated. -The @scheme[parent] argument can be @scheme[#f] or an existing - frame. On Windows, if @scheme[parent] is an existing frame, the +The @racket[parent] argument can be @racket[#f] or an existing + frame. On Windows, if @racket[parent] is an existing frame, the new dialog is always on top of its parent. On Windows and Unix, a dialog is iconized when its parent is iconized. -If @scheme[parent] is @scheme[#f], then the eventspace for the new +If @racket[parent] is @racket[#f], then the eventspace for the new dialog is the current eventspace, as determined by - @scheme[current-eventspace]. Otherwise, @scheme[parent]'s eventspace + @racket[current-eventspace]. Otherwise, @racket[parent]'s eventspace is the new dialog's eventspace. -If the @scheme[width] or @scheme[height] argument is not @scheme[#f], +If the @racket[width] or @racket[height] argument is not @racket[#f], it specifies an initial size for the dialog (in pixels) assuming that it is larger than the minimum size, otherwise the minimum size is used. On Windows and Mac OS X (and with some Unix window managers) dialogs are not resizeable. -If the @scheme[x] or @scheme[y] argument is not @scheme[#f], it +If the @racket[x] or @racket[y] argument is not @racket[#f], it specifies an initial location for the dialog. Otherwise, if no location is set before the dialog is shown, it is centered (with - respect @scheme[parent] if not @scheme[#f], the screen otherwise). + respect @racket[parent] if not @racket[#f], the screen otherwise). -The @scheme[style] flags adjust the appearance of the dialog on some +The @racket[style] flags adjust the appearance of the dialog on some platforms: @itemize[ - @item{@scheme['no-caption] --- omits the title bar for the dialog + @item{@racket['no-caption] --- omits the title bar for the dialog (Windows)} - @item{@scheme['resize-border] --- adds a resizeable border + @item{@racket['resize-border] --- adds a resizeable border around the window (Windows) or grow box in the bottom right corner (Mac OS X)} - @item{@scheme['no-sheet] --- uses a movable window for the dialog, + @item{@racket['no-sheet] --- uses a movable window for the dialog, even if a parent window is provided (Mac OS X)} - @item{@scheme['close-button] --- include a close button in the + @item{@racket['close-button] --- include a close button in the dialog's title bar, which would not normally be included (Mac OS X)} ] @@ -77,7 +77,7 @@ Even if the dialog is not shown, a few notification events may be resources (e.g., memory) cannot be reclaimed until some events are handled, or the dialog's eventspace is shut down. -@WindowKWs[@scheme[enabled]] @AreaContKWs[] @AreaKWs[] +@WindowKWs[@racket[enabled]] @AreaContKWs[] @AreaKWs[] } @defmethod[#:mode override @@ -87,7 +87,7 @@ Even if the dialog is not shown, a few notification events may be Returns the result of -@schemeblock[ +@racketblock[ (or (send this #,(:: top-level-window<%> on-system-menu-char) event) (send this #,(:: top-level-window<%> on-traverse-char) event)) ] @@ -98,16 +98,16 @@ Returns the result of (show [show? any/c]) void?]{ -If @scheme[show?] is true, the dialog is shown and all frames (and other +If @racket[show?] is true, the dialog is shown and all frames (and other dialogs) in the eventspace become disabled until the dialog is - closed. If @scheme[show?] is false, the dialog is hidden and other + closed. If @racket[show?] is false, the dialog is hidden and other frames and dialogs are re-enabled (unless a different, pre-existing dialog is still shown). -If @scheme[show?] is true, the method does not immediately return. Instead, - it loops with @scheme[yield] until the dialog is found to be hidden - between calls to @scheme[yield]. An internal semaphore is used with - @scheme[yield] to avoid a busy-wait, and to ensure that the @scheme[show] +If @racket[show?] is true, the method does not immediately return. Instead, + it loops with @racket[yield] until the dialog is found to be hidden + between calls to @racket[yield]. An internal semaphore is used with + @racket[yield] to avoid a busy-wait, and to ensure that the @racket[show] method returns as soon as possible after the dialog is hidden. } diff --git a/collects/scribblings/gui/dialog-funcs.scrbl b/collects/scribblings/gui/dialog-funcs.scrbl index 098efa1a87..e3e761aacb 100644 --- a/collects/scribblings/gui/dialog-funcs.scrbl +++ b/collects/scribblings/gui/dialog-funcs.scrbl @@ -19,42 +19,42 @@ These functions get input from the user and/or display (or/c path? #f)]{ Obtains a file pathname from the user via the platform-specific - standard (modal) dialog, using @scheme[parent] as the parent window if - it is specified, and using @scheme[message] as a message at the top of - the dialog if it is not @scheme[#f]. + standard (modal) dialog, using @racket[parent] as the parent window if + it is specified, and using @racket[message] as a message at the top of + the dialog if it is not @racket[#f]. -The result is @scheme[#f] if the user cancels the dialog, the selected +The result is @racket[#f] if the user cancels the dialog, the selected pathname otherwise. The returned pathname may or may not exist, although the style of the dialog is directed towards selecting existing files. -If @scheme[directory] is not @scheme[#f], it is used as the starting +If @racket[directory] is not @racket[#f], it is used as the starting directory for the file selector (otherwise the starting directory is chosen automatically in a platform-specific manner, usually based on the current directory and the user's interactions in previous calls - to @scheme[get-file], @scheme[put-file], etc.). If - @scheme[filename] is not @scheme[#f], it is used as the default filename + to @racket[get-file], @racket[put-file], etc.). If + @racket[filename] is not @racket[#f], it is used as the default filename when appropriate, and it should @italic{not} contain a directory path prefix. -Under Windows, if @scheme[extension] is not @scheme[#f], the returned path +Under Windows, if @racket[extension] is not @racket[#f], the returned path will use the extension if the user does not supply one; the - @scheme[extension] string should not contain a period. The extension is + @racket[extension] string should not contain a period. The extension is ignored on other platforms. -The @scheme[style] list can contain @scheme['common], a +The @racket[style] list can contain @racket['common], a platform-independent version of the dialog is used instead of a - native dialog. On Mac OS X, if the @scheme[style] list - contains @scheme['packages], a user is allowed to select a package + native dialog. On Mac OS X, if the @racket[style] list + contains @racket['packages], a user is allowed to select a package directory, which is a directory with a special suffix (e.g., ``.app'') that the Finder normally displays like a file. If the list - contains @scheme['enter-packages], a user is allowed to select a file + contains @racket['enter-packages], a user is allowed to select a file within a package directory. If the list contains both - @scheme['packages] and @scheme['enter-packages], the former is ignored. + @racket['packages] and @racket['enter-packages], the former is ignored. -On Windows and Unix, @scheme[filters] determines a set of filters from +On Windows and Unix, @racket[filters] determines a set of filters from which the user can choose in the dialog. Each element of the - @scheme[filters] list contains two strings: a description of the filter + @racket[filters] list contains two strings: a description of the filter as seen by the user, and a filter pattern matched against file names. Pattern strings can be a simple ``glob'' pattern, or a number of glob patterns separated by a @litchar[";"] character. @@ -65,7 +65,7 @@ On Windows and Unix, @scheme[filters] determines a set of filters from that have any of these suffixes in any filter are selectable; a @racket["*.*"] glob makes all files available for selection. -See also @scheme[path-dialog%]. +See also @racket[path-dialog%]. } @@ -79,8 +79,8 @@ See also @scheme[path-dialog%]. [filters (listof (list/c string? string?)) '(("Any" "*.*"))]) (or/c (listof path?) #f)]{ Like -@scheme[get-file], except that the user can select multiple files, and the - result is either a list of file paths of @scheme[#f]. +@racket[get-file], except that the user can select multiple files, and the + result is either a list of file paths of @racket[#f]. } @@ -94,62 +94,62 @@ Like (or/c path? #f)]{ Obtains a file pathname from the user via the platform-specific - standard (modal) dialog, using @scheme[parent] as the parent window if - it is specified, and using @scheme[message] as a message at the top of - the dialog if it is not @scheme[#f]. + standard (modal) dialog, using @racket[parent] as the parent window if + it is specified, and using @racket[message] as a message at the top of + the dialog if it is not @racket[#f]. -The result is @scheme[#f] if the user cancels the dialog, the selected +The result is @racket[#f] if the user cancels the dialog, the selected pathname otherwise. The returned pathname may or may not exist, although the style of the dialog is directed towards creating a new file. -If @scheme[directory] is not @scheme[#f], it is used as the starting +If @racket[directory] is not @racket[#f], it is used as the starting directory for the file selector (otherwise the starting directory is chosen automatically in a platform-specific manner, usually based on the current directory and the user's interactions in previous calls - to @scheme[get-file], @scheme[put-file], etc.). If - @scheme[filename] is not @scheme[#f], it is used as the default filename + to @racket[get-file], @racket[put-file], etc.). If + @racket[filename] is not @racket[#f], it is used as the default filename when appropriate, and it should @italic{not} contain a directory path prefix. -On Windows, if @scheme[extension] is not @scheme[#f], the returned path +On Windows, if @racket[extension] is not @racket[#f], the returned path will get a default extension if the user does not supply one. If - @scheme[extension] is the empty string, then the extension is derived - from the user's @scheme[filters] choice if the corresponding pattern is - of the form @scheme[(string-append "*." extension)]; if the pattern is - @scheme["*.*"], then no default extension is added. Finally, if - @scheme[extension] is any string other than the empty string, - @scheme[extension] is used as the default extension when the user's - @scheme[filters] choice has the pattern @scheme["*.*"]. Meanwhile, the - @scheme[filters] argument has the same format and auxiliary role as for - @scheme[get-file]. In particular, if the only pattern in @scheme[filters] - is @scheme[(string-append "*." extension)], then the result pathname is guaranteed - to have an extension mapping @scheme[extension]. + @racket[extension] is the empty string, then the extension is derived + from the user's @racket[filters] choice if the corresponding pattern is + of the form @racket[(string-append "*." extension)]; if the pattern is + @racket["*.*"], then no default extension is added. Finally, if + @racket[extension] is any string other than the empty string, + @racket[extension] is used as the default extension when the user's + @racket[filters] choice has the pattern @racket["*.*"]. Meanwhile, the + @racket[filters] argument has the same format and auxiliary role as for + @racket[get-file]. In particular, if the only pattern in @racket[filters] + is @racket[(string-append "*." extension)], then the result pathname is guaranteed + to have an extension mapping @racket[extension]. -On Mac OS X 10.5 and later, if @scheme[extension] is not - @scheme[#f] or @racket[""], the returned path will get a default extension if the - user does not supply one. If @scheme[filters] contains as - @scheme["*.*"] pattern, then the user can supply any extension that +On Mac OS X 10.5 and later, if @racket[extension] is not + @racket[#f] or @racket[""], the returned path will get a default extension if the + user does not supply one. If @racket[filters] contains as + @racket["*.*"] pattern, then the user can supply any extension that is recognized by the system; otherwise, the extension on the returned - path will be either @scheme[extension] or @scheme[_other-extension] - for any @scheme[(string-append "*." _other-extension)] pattern in - @scheme[filters]. In particular, if the only pattern in - @scheme[filters] is empty or contains only @scheme[(string-append + path will be either @racket[extension] or @racket[_other-extension] + for any @racket[(string-append "*." _other-extension)] pattern in + @racket[filters]. In particular, if the only pattern in + @racket[filters] is empty or contains only @racket[(string-append "*." extension)], then the result pathname is guaranteed to have an - extension mapping @scheme[extension]. + extension mapping @racket[extension]. On Mac OS X versions before 10.5, the returned path will get a - default extension only if @scheme[extension] is not @scheme[#f], - @scheme[extension] is not @racket[""], and - @scheme[filters] contains only @scheme[(string-append "*." + default extension only if @racket[extension] is not @racket[#f], + @racket[extension] is not @racket[""], and + @racket[filters] contains only @racket[(string-append "*." extension)]. On Unix, @racket[extension] is ignored, and @racket[filters] is used to filter the visible list of files as in @racket[get-file]. -The @scheme[style] list is treated as for @scheme[get-file]. +The @racket[style] list is treated as for @racket[get-file]. -See also @scheme[path-dialog%]. +See also @racket[path-dialog%]. } @@ -160,25 +160,25 @@ See also @scheme[path-dialog%]. (or/c path #f)]{ Obtains a directory pathname from the user via the platform-specific - standard (modal) dialog, using @scheme[parent] as the parent window if + standard (modal) dialog, using @racket[parent] as the parent window if it is specified. -If @scheme[directory] is not @scheme[#f], it is used on some platforms as +If @racket[directory] is not @racket[#f], it is used on some platforms as the starting directory for the directory selector (otherwise the starting directory is chosen automatically in a platform-specific manner, usually based on the current directory and the user's - interactions in previous calls to @scheme[get-file], - @scheme[put-file], etc.). + interactions in previous calls to @racket[get-file], + @racket[put-file], etc.). -The @scheme[style] argument is treated as for -@scheme[get-file], except that only @scheme['common] or @scheme['enter-packages] can be +The @racket[style] argument is treated as for +@racket[get-file], except that only @racket['common] or @racket['enter-packages] can be specified. The latter - matters only on Mac OS X, where @scheme['enter-packages] + matters only on Mac OS X, where @racket['enter-packages] enables the user to select package directory or a directory within a package. A package is a directory with a special suffix (e.g., ``.app'') that the Finder normally displays like a file. -See also @scheme[path-dialog%]. +See also @racket[path-dialog%]. } @defproc[(message-box [title label-string?] @@ -187,45 +187,45 @@ See also @scheme[path-dialog%]. [style (listof (or/c 'ok 'ok-cancel 'yes-no 'caution 'stop)) '(ok)]) (or/c 'ok 'cancel 'yes 'no)]{ -See also @scheme[message-box/custom]. +See also @racket[message-box/custom]. Displays a message to the user in a (modal) dialog, using - @scheme[parent] as the parent window if it is specified. The dialog's - title is @scheme[title]. The @scheme[message] string can be arbitrarily + @racket[parent] as the parent window if it is specified. The dialog's + title is @racket[title]. The @racket[message] string can be arbitrarily long, and can contain explicit linefeeds or carriage returns for breaking lines. The style must include exactly one of the following: @itemize[ - @item{@scheme['ok] --- the dialog only has an @onscreen{OK} button - and always returns @scheme['ok].} + @item{@racket['ok] --- the dialog only has an @onscreen{OK} button + and always returns @racket['ok].} - @item{@scheme['ok-cancel] --- the message dialog has + @item{@racket['ok-cancel] --- the message dialog has @onscreen{Cancel} and @onscreen{OK} buttons. If the user clicks - @onscreen{Cancel}, the result is @scheme['cancel], otherwise the - result is @scheme['ok].} + @onscreen{Cancel}, the result is @racket['cancel], otherwise the + result is @racket['ok].} - @item{@scheme['yes-no] --- the message dialog has @onscreen{Yes} and + @item{@racket['yes-no] --- the message dialog has @onscreen{Yes} and @onscreen{No} buttons. If the user clicks @onscreen{Yes}, the result - is @scheme['yes], otherwise the result is @scheme['no]. Note: instead + is @racket['yes], otherwise the result is @racket['no]. Note: instead of a @onscreen{Yes}/@onscreen{No} dialog, best-practice GUI design is - to use @scheme[message-box/custom] and give the buttons meaningful + to use @racket[message-box/custom] and give the buttons meaningful labels, so that the user does not have to read the message text carefully to make a selection.} ] -In addition, @scheme[style] can contain @scheme['caution] to make the +In addition, @racket[style] can contain @racket['caution] to make the dialog use a caution icon instead of the application (or generic - ``info'') icon. Alternately, it can contain @scheme['stop] to make the - dialog use a stop icon. If @scheme[style] contains both @scheme['caution] - and @scheme['stop], then @scheme['caution] is ignored. + ``info'') icon. Alternately, it can contain @racket['stop] to make the + dialog use a stop icon. If @racket[style] contains both @racket['caution] + and @racket['stop], then @racket['caution] is ignored. -The class that implements the dialog provides a @scheme[get-message] +The class that implements the dialog provides a @racket[get-message] method that takes no arguments and returns the text of the message as a string. (The dialog is accessible through the - @scheme[get-top-level-windows] function.) + @racket[get-top-level-windows] function.) The @racket[message-box] function can be called int a thread other than the handler thread of the relevant eventspace (i.e., the eventspace of @@ -246,26 +246,26 @@ The @racket[message-box] function can be called int a thread other (or/c 1 2 3 close-result)]{ Displays a message to the user in a (modal) dialog, using - @scheme[parent] as the parent window if it is specified. The dialog's - title is @scheme[title]. The @scheme[message] string can be arbitrarily + @racket[parent] as the parent window if it is specified. The dialog's + title is @racket[title]. The @racket[message] string can be arbitrarily long, and can contain explicit linefeeds or carriage returns for breaking lines. The dialog contains up to three buttons for the user to click. The - buttons have the labels @scheme[button1-label], - @scheme[button2-label], and @scheme[button3-label], where @scheme[#f] for a + buttons have the labels @racket[button1-label], + @racket[button2-label], and @racket[button3-label], where @racket[#f] for a label indicates that the button should be hidden. -If the user clicks the button labelled @scheme[button1-label], a @scheme[1] - is returned, and so on for @scheme[2] and @scheme[3]. If the user closes - the dialog some other way---which is only allowed when @scheme[style] - does not contain @scheme['disallow-close]---then the result is the - value of @scheme[close-result]. For example, the user can usually close - a dialog by typing an Escape. Often, @scheme[2] is an appropriate value - for @scheme[close-result], especially when Button 2 is a @onscreen{Cancel} +If the user clicks the button labelled @racket[button1-label], a @racket[1] + is returned, and so on for @racket[2] and @racket[3]. If the user closes + the dialog some other way---which is only allowed when @racket[style] + does not contain @racket['disallow-close]---then the result is the + value of @racket[close-result]. For example, the user can usually close + a dialog by typing an Escape. Often, @racket[2] is an appropriate value + for @racket[close-result], especially when Button 2 is a @onscreen{Cancel} button. -If @scheme[style] does not include @scheme['number-order], the order of +If @racket[style] does not include @racket['number-order], the order of the buttons is platform-specific, and labels should be assigned to the buttons based on their role: @itemize[ @@ -274,7 +274,7 @@ If @scheme[style] does not include @scheme['number-order], the order of button. For example, if the dialog has an @onscreen{OK} button, it is this one. On Windows, this button is leftmost; on Unix and Mac OS X, it is rightmost. (See also - @scheme[system-position-ok-before-cancel?].) Use this button for + @racket[system-position-ok-before-cancel?].) Use this button for dialogs that contain only one button.} @item{Button 2 is next to Button 1, and it often plays the role of @@ -289,28 +289,28 @@ If @scheme[style] does not include @scheme['number-order], the order of Despite the above guidelines, any combination of visible buttons is allowed in the dialog. -If @scheme[style] includes @scheme['number-order], then the buttons are +If @racket[style] includes @racket['number-order], then the buttons are displayed in the dialog left-to-right with equal spacing between all buttons, though aligned within the dialog (centered or right-aligned) - in a platform-specific manner. Use @scheme['number-order] sparingly. + in a platform-specific manner. Use @racket['number-order] sparingly. -The @scheme[style] list must contain exactly one of @scheme['default=1], - @scheme['default=2], @scheme['default=3], and @scheme['no-default] to +The @racket[style] list must contain exactly one of @racket['default=1], + @racket['default=2], @racket['default=3], and @racket['no-default] to determine which button (if any) is the default. The default button is - ``clicked'' when the user types Return. If @scheme['default=]@scheme[n] - is supplied but button @scheme[n] has no label, then it is equivalent to - @scheme['no-default]. + ``clicked'' when the user types Return. If @racket['default=]@racket[n] + is supplied but button @racket[n] has no label, then it is equivalent to + @racket['no-default]. -In addition, @scheme[style] can contain @scheme['caution] to make the +In addition, @racket[style] can contain @racket['caution] to make the dialog use a caution icon instead of the application (or generic - ``info'') icon. Alternately, it can contain @scheme['stop] to make the - dialog use a stop icon. If @scheme[style] contains both @scheme['caution] - and @scheme['stop], then @scheme['caution] is ignored. + ``info'') icon. Alternately, it can contain @racket['stop] to make the + dialog use a stop icon. If @racket[style] contains both @racket['caution] + and @racket['stop], then @racket['caution] is ignored. -The class that implements the dialog provides a @scheme[get-message] +The class that implements the dialog provides a @racket[get-message] method that takes no arguments and returns the text of the message as a string. (The dialog is accessible through the -@scheme[get-top-level-windows] function.) +@racket[get-top-level-windows] function.) The @racket[message-box/custom] function can be called int a thread other than the handler thread of the relevant eventspace (i.e., the eventspace of @@ -326,15 +326,15 @@ The @racket[message-box/custom] function can be called int a thread '(ok)]) (values (or/c 'ok 'cancel 'yes 'no) boolean?)]{ -See also @scheme[message+check-box/custom]. +See also @racket[message+check-box/custom]. -Like @scheme[message-box], except that +Like @racket[message-box], except that @itemize[ - @item{the dialog contains a check box whose label is @scheme[check-label];} - @item{the result is two values: the @scheme[message-box] result, and a + @item{the dialog contains a check box whose label is @racket[check-label];} + @item{the result is two values: the @racket[message-box] result, and a boolean indicating whether the box was checked; and} - @item{@scheme[style] can contain @scheme['checked] to indicate that the check box + @item{@racket[style] can contain @racket['checked] to indicate that the check box should be initially checked.} ]} @@ -352,12 +352,12 @@ Like @scheme[message-box], except that [close-result any/c #f]) (or/c 1 2 3 (λ (x) (eq? x close-result)))]{ -Like @scheme[message-box/custom], except that +Like @racket[message-box/custom], except that @itemize[ - @item{the dialog contains a check box whose label is @scheme[check-label];} - @item{the result is two values: the @scheme[message-box] result, and a + @item{the dialog contains a check box whose label is @racket[check-label];} + @item{the result is two values: the @racket[message-box] result, and a boolean indicating whether the box was checked; and} - @item{@scheme[style] can contain @scheme['checked] to indicate that the check box + @item{@racket[style] can contain @racket['checked] to indicate that the check box should be initially checked.} ] @@ -374,15 +374,15 @@ Like @scheme[message-box/custom], except that (or/c string? #f)]{ Gets a text string from the user via a modal dialog, using - @scheme[parent] as the parent window if it is specified. The dialog's - title is @scheme[title]. The dialog's text field is labelled with - @scheme[message] and initialized to @scheme[init-val] (but @scheme[init-val] + @racket[parent] as the parent window if it is specified. The dialog's + title is @racket[title]. The dialog's text field is labelled with + @racket[message] and initialized to @racket[init-val] (but @racket[init-val] does not determine the size of the dialog). -The result is @scheme[#f] if the user cancels the dialog, the +The result is @racket[#f] if the user cancels the dialog, the user-provided string otherwise. -If @scheme[style] includes @scheme['password], the dialog's text field +If @racket[style] includes @racket['password], the dialog's text field draws each character of its content using a generic symbol, instead of the actual character. @@ -399,18 +399,18 @@ If @scheme[style] includes @scheme['password], the dialog's text field (or/c (listof exact-nonnegative-integer?) #f)]{ Gets a list box selection from the user via a modal dialog, using - @scheme[parent] as the parent window if it is specified. The dialog's - title is @scheme[title]. The dialog's list box is labelled with - @scheme[message] and initialized by selecting the items in - @scheme[init-choices]. + @racket[parent] as the parent window if it is specified. The dialog's + title is @racket[title]. The dialog's list box is labelled with + @racket[message] and initialized by selecting the items in + @racket[init-choices]. -The style must contain exactly one of @indexed-scheme['single], - @indexed-scheme['multiple], or @indexed-scheme['extended]. The styles have - the same meaning as for creating a @scheme[list-box%] object. (For +The style must contain exactly one of @indexed-racket['single], + @indexed-racket['multiple], or @indexed-racket['extended]. The styles have + the same meaning as for creating a @racket[list-box%] object. (For the single-selection style, only the last selection in - @scheme[init-choices] matters.) + @racket[init-choices] matters.) -The result is @scheme[#f] if the user cancels the dialog, the +The result is @racket[#f] if the user cancels the dialog, the list of selections otherwise. @@ -424,14 +424,14 @@ The result is @scheme[#f] if the user cancels the dialog, the (or/c (is-a?/c color%) #f)]{ Lets the user select a color though the platform-specific - (modal) dialog, using @scheme[parent] as the parent window if it is - specified. The @scheme[message] string is displayed as a prompt in the - dialog if possible. If @scheme[init-color] is provided, the dialog is + (modal) dialog, using @racket[parent] as the parent window if it is + specified. The @racket[message] string is displayed as a prompt in the + dialog if possible. If @racket[init-color] is provided, the dialog is initialized to the given color. -@italicptyStyleNote[@scheme[style]] +@italicptyStyleNote[@racket[style]] -The result is @scheme[#f] if the user cancels the dialog, the selected +The result is @racket[#f] if the user cancels the dialog, the selected color otherwise. @@ -445,14 +445,14 @@ The result is @scheme[#f] if the user cancels the dialog, the selected (or/c (is-a?/c font%) #f)]{ Lets the user select a font though the platform-specific - (modal) dialog, using @scheme[parent] as the parent window if it is - specified. The @scheme[message] string is displayed as a prompt in the - dialog if possible. If @scheme[init-font] is provided, the dialog is + (modal) dialog, using @racket[parent] as the parent window if it is + specified. The @racket[message] string is displayed as a prompt in the + dialog if possible. If @racket[init-font] is provided, the dialog is initialized to the given font. -@italicptyStyleNote[@scheme[style]] +@italicptyStyleNote[@racket[style]] -The result is @scheme[#f] if the user cancels the dialog, the selected +The result is @racket[#f] if the user cancels the dialog, the selected font otherwise. @@ -466,16 +466,16 @@ The result is @scheme[#f] if the user cancels the dialog, the selected (or/c (is-a?/c ps-setup%) #f)]{ Lets the user select a PostScript configuration though a (modal) - dialog, using @scheme[parent] as the parent window if it is - specified. The @scheme[message] string is displayed as a prompt in the - dialog. If @scheme[init-setup] is provided, the dialog is initialized to + dialog, using @racket[parent] as the parent window if it is + specified. The @racket[message] string is displayed as a prompt in the + dialog. If @racket[init-setup] is provided, the dialog is initialized to the given configuration, otherwise the current configuration from -@scheme[current-ps-setup] is used. +@racket[current-ps-setup] is used. -@italicptyStyleNote[@scheme[style]] +@italicptyStyleNote[@racket[style]] -The result is @scheme[#f] if the user cancels the dialog, , a - @scheme[ps-setup%] object that encapsulates the selected PostScript +The result is @racket[#f] if the user cancels the dialog, , a + @racket[ps-setup%] object that encapsulates the selected PostScript configuration otherwise. @@ -489,22 +489,22 @@ The result is @scheme[#f] if the user cancels the dialog, , a (or/c (is-a?/c ps-setup%) #f)]{ Like -@scheme[get-ps-setup-from-user], but the dialog configures page layout for native printing - with @scheme[printer-dc%]. A dialog is shown only if -@scheme[can-get-page-setup-from-user?] returns @scheme[#t], otherwise no dialog is shown and the result - is @scheme[#f]. +@racket[get-ps-setup-from-user], but the dialog configures page layout for native printing + with @racket[printer-dc%]. A dialog is shown only if +@racket[can-get-page-setup-from-user?] returns @racket[#t], otherwise no dialog is shown and the result + is @racket[#f]. -The @scheme[parent] argument is used as the parent window for a dialog if - it is specified. The @scheme[message] string might be displayed as a - prompt in the dialog. If @scheme[init-setup] is provided, the dialog is +The @racket[parent] argument is used as the parent window for a dialog if + it is specified. The @racket[message] string might be displayed as a + prompt in the dialog. If @racket[init-setup] is provided, the dialog is initialized to the given configuration, otherwise the current configuration from -@scheme[current-ps-setup] is used. +@racket[current-ps-setup] is used. -@italicptyStyleNote[@scheme[style]] +@italicptyStyleNote[@racket[style]] -The result is @scheme[#f] if the user cancels the dialog, a - @scheme[ps-setup%] object that encapsulates the selected +The result is @racket[#f] if the user cancels the dialog, a + @racket[ps-setup%] object that encapsulates the selected configuration otherwise. @@ -513,11 +513,11 @@ The result is @scheme[#f] if the user cancels the dialog, a @defproc[(can-get-page-setup-from-user?) boolean?]{ -Returns @scheme[#t] if the current platform (Mac OS X) supports a - page-layout dialog for use with @scheme[printer-dc%] printing, and +Returns @racket[#t] if the current platform (Mac OS X) supports a + page-layout dialog for use with @racket[printer-dc%] printing, and if the page-layout dialog is different from the print-job dialog that - is automatically shown when a @scheme[printer-dc%] is - created. Returns @scheme[#f] if no separate page-layout dialog is + is automatically shown when a @racket[printer-dc%] is + created. Returns @racket[#f] if no separate page-layout dialog is needed (Windows and Unix). } diff --git a/collects/scribblings/gui/editor-admin-class.scrbl b/collects/scribblings/gui/editor-admin-class.scrbl index 8e1420be53..14c6ee6f6b 100644 --- a/collects/scribblings/gui/editor-admin-class.scrbl +++ b/collects/scribblings/gui/editor-admin-class.scrbl @@ -4,20 +4,18 @@ @defclass/title[editor-admin% object% ()]{ See @|admindiscuss| for information about the role of administrators. - The @scheme[editor-admin%] class is never instantiated directly. It + The @racket[editor-admin%] class is never instantiated directly. It is not even instantiated through derived classes by most programmers; - each @scheme[editor-canvas%] and @scheme[editor-snip%] object + each @racket[editor-canvas%] and @racket[editor-snip%] object creates its own administrator. However, it may be useful to derive a new instance of this class to display editors in a new context. Also, it may be useful to call the methods of an existing administrator from an owned editor. -To create a new @scheme[editor-admin%] class, all methods described +To create a new @racket[editor-admin%] class, all methods described here must be overridden. They are all invoked by the administrator's editor. - - @defconstructor[()]{ Creates a (useless) editor administrator. @@ -34,7 +32,7 @@ Returns either the drawing context into which the editor is displayed, or the context into which it is currently being drawn. When the editor is not embedded, the returned context is always the drawing content into which the editor is displayed. If the editor is not - displayed, @scheme[#f] is returned. + displayed, @racket[#f] is returned. The origin of the drawing context is also returned, translated into the local coordinates of the editor. For an embedded editor, the @@ -50,11 +48,10 @@ See also @xmethod[editor<%> editor-location-to-dc-location] and } @methimpl{ -Fills all boxes with @scheme[0.0] and returns @scheme[#f]. +Fills all boxes with @racket[0.0] and returns @racket[#f]. }} - @defmethod[(get-max-view [x (or/c (box/c real?) false/c)] [y (or/c (box/c real?) false/c)] [w (or/c (box/c (and/c real? (not/c negative?))) false/c)] @@ -73,7 +70,7 @@ See @method[editor-admin% get-view]. } @methimpl{ -Fills all boxes with @scheme[0.0]. +Fills all boxes with @racket[0.0]. }} @@ -108,20 +105,20 @@ The calculation of the editor's visible region is based on the current @boxisfillnull[(scheme w) @elem{the width of the visible region, which may be larger than the editor itself}] @boxisfillnull[(scheme h) @elem{the height of the visible region, which may be larger than the editor itself}] -If an editor is fully visible and @scheme[full?] is @scheme[#f], then - @scheme[x] and @scheme[y] will both be filled with @scheme[0]. +If an editor is fully visible and @racket[full?] is @racket[#f], then + @racket[x] and @racket[y] will both be filled with @racket[0]. -If @scheme[full?] is a true value, then the returned area is the view +If @racket[full?] is a true value, then the returned area is the view area of the top-level @techlink{display} for the editor. This result is different only when the editor is embedded in another editor; in - that case, the @scheme[x] and @scheme[y] values may be meaningless, + that case, the @racket[x] and @racket[y] values may be meaningless, because they are in the coordinate system of the immediate editor within the top-level @techlink{display}. } @methimpl{ -Fills all boxes with @scheme[0.0]. +Fills all boxes with @racket[0.0]. }} @@ -134,7 +131,7 @@ Called by the editor to request the keyboard focus. If the request is method will be called. See @method[editor<%> set-caret-owner] for information about the - possible values of @scheme[domain]. + possible values of @racket[domain]. } @methimpl{ @@ -172,7 +169,7 @@ Called by the editor to request a refresh to its displayed should be refreshed, it calls the editor's @method[editor<%> refresh] method. -The @scheme[localx], @scheme[localy], @scheme[w], and @scheme[h] +The @racket[localx], @racket[localy], @racket[w], and @racket[h] arguments specify a region of the editor to be updated (in editor coordinates). @@ -192,16 +189,16 @@ Does nothing. @popupmenuinfo[@elem{administrator's @techlink{display}} @elem{top-level editor in this administrator's @techlink{display}} - @elem{The result is @scheme[#t] if the popup succeeds, - @scheme[#f] otherwise (independent of whether the + @elem{The result is @racket[#t] if the popup succeeds, + @racket[#f] otherwise (independent of whether the user selects an item in the popup menu).}] -The menu is displayed at @scheme[x] and @scheme[y] in editor coordinates. +The menu is displayed at @racket[x] and @racket[y] in editor coordinates. } @methimpl{ -Returns @scheme[#f]. +Returns @racket[#f]. }} @@ -211,14 +208,14 @@ Returns @scheme[#f]. @methspec{ -Returns @scheme[#t] if updating on this administrator's +Returns @racket[#t] if updating on this administrator's @techlink{display} is currently delayed (usually by @xmethod[editor<%> begin-edit-sequence] in an enclosing editor). } @methimpl{ -Returns @scheme[#f]. +Returns @racket[#f]. }} @@ -232,7 +229,7 @@ Called by the editor to notify its @techlink{display} that the editor's size or scroll count has changed, so the scrollbars need to be adjusted to reflect the new size. The editor generally needs to be updated after a resize, but the editor decides whether the update - should occur immediately. If @scheme[refresh?] is not @scheme[#f], + should occur immediately. If @racket[refresh?] is not @racket[#f], then the editor is requesting to be updated immediately. } @@ -256,22 +253,22 @@ Called by the editor to request scrolling so that the given region is visible. The editor generally needs to be updated after a scroll, but the editor decides whether the update should occur immediately. -The @scheme[localx], @scheme[localy], @scheme[w], and @scheme[h] +The @racket[localx], @racket[localy], @racket[w], and @racket[h] arguments specify a region of the editor to be made visible by the scroll (in editor coordinates). -If @scheme[refresh?] is not @scheme[#f], then the editor is requesting +If @racket[refresh?] is not @racket[#f], then the editor is requesting to be updated immediately. -The @scheme[bias] argument is one of: +The @racket[bias] argument is one of: @itemize[ -@item{@scheme['start] --- if the range doesn't fit in the visible area, show the top-left region} -@item{@scheme['none] --- no special scrolling instructions} -@item{@scheme['end] --- if the range doesn't fit in the visible area, show the bottom-right region} +@item{@racket['start] --- if the range doesn't fit in the visible area, show the top-left region} +@item{@racket['none] --- no special scrolling instructions} +@item{@racket['end] --- if the range doesn't fit in the visible area, show the bottom-right region} ] -The return value is @scheme[#t] if the @techlink{display} is scrolled, - @scheme[#f] if not (either because the requested region is already +The return value is @racket[#t] if the @techlink{display} is scrolled, + @racket[#f] if not (either because the requested region is already visible, because the @techlink{display} has zero size, or because the editor is currently printing). @@ -283,7 +280,7 @@ If an editor has multiple @techlink{displays}, then if any display } @methimpl{ -Return @scheme[#f] +Return @racket[#f] }} diff --git a/collects/scribblings/gui/editor-canvas-class.scrbl b/collects/scribblings/gui/editor-canvas-class.scrbl index a90f21626c..d1a420b888 100644 --- a/collects/scribblings/gui/editor-canvas-class.scrbl +++ b/collects/scribblings/gui/editor-canvas-class.scrbl @@ -3,8 +3,8 @@ @defclass/title[editor-canvas% object% (canvas<%>)]{ -An @scheme[editor-canvas%] object manages and displays a - @scheme[text%] or @scheme[pasteboard%] object. +An @racket[editor-canvas%] object manages and displays a + @racket[text%] or @racket[pasteboard%] object. @defconstructor[([parent (or/c (is-a?/c frame%) (is-a?/c dialog%) @@ -29,48 +29,48 @@ An @scheme[editor-canvas%] object manages and displays a [stretchable-width any/c #t] [stretchable-height any/c #t])]{ -If a canvas is initialized with @scheme[#f] for @scheme[editor], +If a canvas is initialized with @racket[#f] for @racket[editor], install an editor later with @method[editor-canvas% set-editor]. -The @scheme[style] list can contain the following flags: +The @racket[style] list can contain the following flags: @itemize[ - @item{@scheme['no-border] --- omits a border around the canvas} + @item{@racket['no-border] --- omits a border around the canvas} - @item{@scheme['control-border] --- gives the canvas a border that is - like a @scheme[text-field%] control} + @item{@racket['control-border] --- gives the canvas a border that is + like a @racket[text-field%] control} - @item{@scheme['combo] --- gives the canvas a combo button that is like - a @scheme[combo-field%] control; this + @item{@racket['combo] --- gives the canvas a combo button that is like + a @racket[combo-field%] control; this style is intended for use with - @scheme['control-border], - @scheme['hide-hscroll], and - @scheme['hide-vscroll]} + @racket['control-border], + @racket['hide-hscroll], and + @racket['hide-vscroll]} - @item{@scheme['no-hscroll] --- disallows horizontal scrolling and hides the horizontal scrollbar} + @item{@racket['no-hscroll] --- disallows horizontal scrolling and hides the horizontal scrollbar} - @item{@scheme['no-vscroll] --- disallows vertical scrolling and hides the vertical scrollbar} + @item{@racket['no-vscroll] --- disallows vertical scrolling and hides the vertical scrollbar} - @item{@scheme['hide-hscroll] --- allows horizontal scrolling, but hides the horizontal scrollbar} + @item{@racket['hide-hscroll] --- allows horizontal scrolling, but hides the horizontal scrollbar} - @item{@scheme['hide-vscroll] --- allows vertical scrolling, but hides the vertical scrollbar} + @item{@racket['hide-vscroll] --- allows vertical scrolling, but hides the vertical scrollbar} - @item{@scheme['auto-hscroll] --- automatically hides the horizontal scrollbar when unneeded - (unless @scheme['no-hscroll] or @scheme['hide-hscroll] is specified)} + @item{@racket['auto-hscroll] --- automatically hides the horizontal scrollbar when unneeded + (unless @racket['no-hscroll] or @racket['hide-hscroll] is specified)} - @item{@scheme['auto-vscroll] --- automatically hides the vertical scrollbar when unneeded - (unless @scheme['no-vscroll] or @scheme['hide-vscroll] is specified)} + @item{@racket['auto-vscroll] --- automatically hides the vertical scrollbar when unneeded + (unless @racket['no-vscroll] or @racket['hide-vscroll] is specified)} - @item{@scheme['resize-corner] --- leaves room for a resize control at the canvas's + @item{@racket['resize-corner] --- leaves room for a resize control at the canvas's bottom right when only one scrollbar is visible} - @item{@scheme['deleted] --- creates the canvas as initially hidden and without affecting - @scheme[parent]'s geometry; the canvas can be made active - later by calling @scheme[parent]'s @method[area-container<%> add-child] + @item{@racket['deleted] --- creates the canvas as initially hidden and without affecting + @racket[parent]'s geometry; the canvas can be made active + later by calling @racket[parent]'s @method[area-container<%> add-child] method} - @item{@scheme['transparent] --- the canvas is ``erased'' before an + @item{@racket['transparent] --- the canvas is ``erased'' before an update using its parent window's background; see @racket[canvas<%>] for information on the interaction of @racket['transparent] and offscreen buffering} @@ -79,23 +79,23 @@ The @scheme[style] list can contain the following flags: While vertical scrolling of text editors is based on lines, horizontal scrolling and pasteboard vertical scrolling is based on a - fixed number of steps per horizontal page. The @scheme[scrolls-per-page] + fixed number of steps per horizontal page. The @racket[scrolls-per-page] argument sets this value. -@index["wheel on mouse"]{If} provided, the @scheme[wheel-step] +@index["wheel on mouse"]{If} provided, the @racket[wheel-step] argument is passed on to the @method[editor-canvas% wheel-step] method. The default wheel step can be overridden globally though the @ResourceFirst{wheelStep}; see @|mrprefsdiscuss|. -If @scheme[line-count] is not @scheme[#f], it is passed on to the +If @racket[line-count] is not @racket[#f], it is passed on to the @method[editor-canvas% set-line-count] method. -If @scheme[horizontal-inset] is not @scheme[5], it is passed on to the +If @racket[horizontal-inset] is not @racket[5], it is passed on to the @method[editor-canvas% horizontal-inset] method. Similarly, if - @scheme[vertical-inset] is not @scheme[5], it is passed on to the + @racket[vertical-inset] is not @racket[5], it is passed on to the @method[editor-canvas% vertical-inset] method. -@WindowKWs[@scheme[enabled]] @SubareaKWs[] @AreaKWs[] +@WindowKWs[@racket[enabled]] @SubareaKWs[] @AreaKWs[] } @@ -162,7 +162,7 @@ Enables or disables force-focus mode. In force-focus mode, the caret @defmethod[(get-editor) (or/c (or/c (is-a?/c text%) (is-a?/c pasteboard%)) false/c)]{ -Returns the editor currently displayed by this canvas, or @scheme[#f] +Returns the editor currently displayed by this canvas, or @racket[#f] if the canvas does not have an editor. } @@ -172,7 +172,7 @@ Returns the editor currently displayed by this canvas, or @scheme[#f] (or/c (integer-in 1 1000) false/c)]{ Returns a line count installed with @method[editor-canvas% - set-line-count], or @scheme[#f] if no minimum line count is set. + set-line-count], or @racket[#f] if no minimum line count is set. } @@ -182,7 +182,7 @@ Returns a line count installed with @method[editor-canvas% void?])]{ Gets or sets the number of pixels within the canvas reserved to - the left and right of editor content. The default is @scheme[5]. + the left and right of editor content. The default is @racket[5]. } @@ -196,7 +196,7 @@ Enables or disables lazy-refresh mode, or gets the current enable state. In lazy-refresh mode, the canvas's @method[window<%> refresh] method is called when the window needs to be updated, rather than @method[editor-canvas% on-paint]. By default, an - @scheme[editor-canvas%] object is @italic{not} in lazy-refresh mode. + @racket[editor-canvas%] object is @italic{not} in lazy-refresh mode. } @@ -205,7 +205,7 @@ Enables or disables lazy-refresh mode, or gets the current enable (on-char [event (is-a?/c key-event%)]) void?]{ -Handles @scheme['wheel-up] and @scheme['wheel-down] events by +Handles @racket['wheel-up] and @racket['wheel-down] events by scrolling vertically. Otherwise, passes the event to the canvas's editor, if any, by calling its @method[editor<%> on-char] method. @@ -242,10 +242,10 @@ Repaints the editor, or clears the canvas if no editor is being displayed. This method is called after clearing the margin around the editor, -unless the canvas is created with the @scheme['transparent] style, but +unless the canvas is created with the @racket['transparent] style, but the editor area is not automatically cleared. In other words, -@scheme[editor-canvas%] update by default is like @scheme[canvas%] -update with the @scheme['no-autoclear] style, except that the margin +@racket[editor-canvas%] update by default is like @racket[canvas%] +update with the @racket['no-autoclear] style, except that the margin around the editor area is always cleared. } @@ -271,27 +271,27 @@ on-display-size] method is called. Requests scrolling so that the given region in the currently displayed editor is made visible. -The @scheme[localx], @scheme[localy], @scheme[w], and @scheme[h] arguments specify +The @racket[localx], @racket[localy], @racket[w], and @racket[h] arguments specify a region of the editor to be made visible by the scroll (in editor coordinates). -If @scheme[refresh?] is not @scheme[#f], then the editor is updated +If @racket[refresh?] is not @racket[#f], then the editor is updated immediately after a successful scroll. -The @scheme[bias] argument is one of: +The @racket[bias] argument is one of: @itemize[ - @item{@scheme['start] --- if the range doesn't fit in the visible + @item{@racket['start] --- if the range doesn't fit in the visible area, show the top-left region} - @item{@scheme['none] --- no special scrolling instructions} + @item{@racket['none] --- no special scrolling instructions} - @item{@scheme['end] --- if the range doesn't fit in the visible area, + @item{@racket['end] --- if the range doesn't fit in the visible area, show the bottom-right region} ] -The return value is @scheme[#t] if the @techlink{display} is scrolled, @scheme[#f] +The return value is @racket[#t] if the @techlink{display} is scrolled, @racket[#f] if not (either because the requested region is already visible, because the @techlink{display} has zero size, or because the editor is currently printing). @@ -324,10 +324,10 @@ Enables or disables bottom-base scrolling, or gets the current enable Sets the editor that is displayed by the canvas, releasing the current editor (if any). If the new editor already has an administrator that - is not associated with an @scheme[editor-canvas%], then the new + is not associated with an @racket[editor-canvas%], then the new editor is @italic{not} installed into the canvas. -If @scheme[redraw?] is @scheme[#f], then the editor is not immediately +If @racket[redraw?] is @racket[#f], then the editor is not immediately drawn; in this case, something must force a redraw later (e.g., a call to the @method[editor-canvas% on-paint] method). @@ -347,7 +347,7 @@ Sets the canvas's graphical minimum height to display a particular an editor. When the canvas's editor is changed, the minimum height is recalculated. -If the line count is set to @scheme[#f], then the canvas's graphical +If the line count is set to @racket[#f], then the canvas's graphical minimum height is restored to its original value. } @@ -359,7 +359,7 @@ If the line count is set to @scheme[#f], then the canvas's graphical void?])]{ Gets or sets the number of pixels within the canvas reserved above - and below editor content. The default is @scheme[5]. + and below editor content. The default is @racket[5]. } @@ -370,8 +370,8 @@ Gets or sets the number of pixels within the canvas reserved above void?])]{ Gets or sets the number of vertical scroll steps taken for one click - of the mouse wheel via a @scheme['wheel-up] or @scheme['wheel-down] - @scheme[key-event%]. A @scheme[#f] value disables special handling + of the mouse wheel via a @racket['wheel-up] or @racket['wheel-down] + @racket[key-event%]. A @racket[#f] value disables special handling for wheel events (i.e., wheel events are passed on to the canvas's editor). diff --git a/collects/scribblings/gui/editor-data-class-class.scrbl b/collects/scribblings/gui/editor-data-class-class.scrbl index 293b713671..3f924d9625 100644 --- a/collects/scribblings/gui/editor-data-class-class.scrbl +++ b/collects/scribblings/gui/editor-data-class-class.scrbl @@ -3,9 +3,8 @@ @defclass/title[editor-data-class% object% ()]{ -An @scheme[editor-data-class%] object defines a type for -@scheme[editor-data%] objects. See also @|editordatadiscuss|. - +An @racket[editor-data-class%] object defines a type for +@racket[editor-data%] objects. See also @|editordatadiscuss|. @defconstructor[()]{ @@ -25,7 +24,7 @@ internal use. @defmethod[(read [f (is-a?/c editor-stream-in%)]) (or/c (is-a?/c editor-data%) false/c)]{ -Reads a new data object from the given stream, returning @scheme[#f] if +Reads a new data object from the given stream, returning @racket[#f] if there is an error. } @@ -36,7 +35,7 @@ Reads a new data object from the given stream, returning @scheme[#f] if Sets the name of the class. Names starting with @litchar{wx} are reserved for internal use. -An editor data class name should usually have the form @scheme["(lib +An editor data class name should usually have the form @racket["(lib ...)"] to enable on-demand loading of the class; see @|editordatadiscuss| for details. diff --git a/collects/scribblings/gui/editor-data-class-list-intf.scrbl b/collects/scribblings/gui/editor-data-class-list-intf.scrbl index 98d02cbad7..98623ecaef 100644 --- a/collects/scribblings/gui/editor-data-class-list-intf.scrbl +++ b/collects/scribblings/gui/editor-data-class-list-intf.scrbl @@ -3,8 +3,8 @@ @definterface/title[editor-data-class-list<%> ()]{ -Each eventspace has an instance of @scheme[editor-data-class-list<%>], - obtained with @scheme[(get-the-editor-data-class-list)]. New +Each eventspace has an instance of @racket[editor-data-class-list<%>], + obtained with @racket[(get-the-editor-data-class-list)]. New instances cannot be created directly. This list keeps a list of editor data classes; this list is needed for loading snips from a file. See also @|editordatadiscuss|. @@ -20,7 +20,7 @@ exists in the list, this one will not be added. @defmethod[(find [name string?]) (or/c (is-a?/c snip-class%) false/c)]{ Finds a snip data class from the list with the given name, returning - @scheme[#f] if none can be found. + @racket[#f] if none can be found. } @@ -32,8 +32,8 @@ Returns an index into the list for the specified class. @defmethod[(nth [n exact-nonnegative-integer?]) (or/c (is-a?/c editor-data-class%) false/c)]{ -Returns the @scheme[n]th class in the list (counting from 0), returning - @scheme[#f] if the list has @scheme[n] or less classes. +Returns the @racket[n]th class in the list (counting from 0), returning + @racket[#f] if the list has @racket[n] or less classes. } diff --git a/collects/scribblings/gui/editor-data-class.scrbl b/collects/scribblings/gui/editor-data-class.scrbl index 7a85a8e929..76a882bd83 100644 --- a/collects/scribblings/gui/editor-data-class.scrbl +++ b/collects/scribblings/gui/editor-data-class.scrbl @@ -3,7 +3,7 @@ @defclass/title[editor-data% object% ()]{ -An @scheme[editor-data%] object contains extra data associated to a +An @racket[editor-data%] object contains extra data associated to a snip or region in an editor. See also @|editordatadiscuss|. @@ -11,7 +11,7 @@ snip or region in an editor. See also @|editordatadiscuss|. @defconstructor[()]{ The element returned by @method[editor-data% get-next] is initialized -to @scheme[#f]. +to @racket[#f]. } @@ -23,7 +23,7 @@ Gets the class for this data. @defmethod[(get-next) (or/c (is-a?/c editor-data%) false/c)]{ Gets the next editor data element in a list of editor data elements. -A @scheme[#f] terminates the list. +A @racket[#f] terminates the list. } @defmethod[(set-dataclass [v (is-a?/c editor-data-class%)]) @@ -32,20 +32,20 @@ A @scheme[#f] terminates the list. @defmethod[(set-next [v (or/c (is-a?/c editor-data%) false/c)]) void?]{Sets the next editor data element in a list of editor data elements. -A @scheme[#f] terminates the list. +A @racket[#f] terminates the list. } @defmethod[(write [f (is-a?/c editor-stream-out%)]) boolean?]{ @methspec{ -Writes the data to the specified stream, returning @scheme[#t] if data -is written successfully or @scheme[#f] otherwise. +Writes the data to the specified stream, returning @racket[#t] if data +is written successfully or @racket[#f] otherwise. } @methimpl{ -Returns @scheme[#f]. +Returns @racket[#f]. }}} diff --git a/collects/scribblings/gui/editor-intf.scrbl b/collects/scribblings/gui/editor-intf.scrbl index f629bfbd79..9ea8ae6d15 100644 --- a/collects/scribblings/gui/editor-intf.scrbl +++ b/collects/scribblings/gui/editor-intf.scrbl @@ -3,8 +3,8 @@ @definterface/title[editor<%> ()]{ -The @scheme[editor<%>] interface is implemented by @scheme[text%] and - @scheme[pasteboard%]. +The @racket[editor<%>] interface is implemented by @racket[text%] and + @racket[pasteboard%]. @defmethod[(add-canvas [canvas (is-a?/c editor-canvas%)]) void?]{ @@ -47,7 +47,7 @@ After an undoer returns, the undoer is popped off the editor's undo sequence. To extend the previous example, if a label change is paired with a move to realign the snip, then the label-change undoer should be added to the editor @italic{after} the call to @method[pasteboard% - move], and it should return @scheme[#t] when it is called. As a + move], and it should return @racket[#t] when it is called. As a result, the move will be undone immediately after the label change is undone. (If the opposite order is needed, use @method[editor<%> begin-edit-sequence] and @method[editor<%> end-edit-sequence] to @@ -64,7 +64,7 @@ The system adds undoers to an editor (in response to other method @methspec{ Gets a cursor to be used in the editor's @techlink{display}. If the - return value is @scheme[#f], a default cursor is used. + return value is @racket[#f], a default cursor is used. See also @method[editor<%> set-cursor]. @@ -125,7 +125,7 @@ Called just after the editor is loaded from a file. The argument to the method originally specified whether the save was successful, but failures now trigger exceptions such that the method is -not even called. Consequently, the argument is always @scheme[#t]. +not even called. Consequently, the argument is always @racket[#t]. See also @method[editor<%> can-load-file?] and @@ -150,7 +150,7 @@ Called just after the editor is saved to a file. The argument to the method originally specified whether the save was successful, but failures now trigger exceptions such that the method is -not even called. Consequently, the argument is always @scheme[#t]. +not even called. Consequently, the argument is always @racket[#t]. See also @method[editor<%> can-save-file?] and @@ -208,15 +208,15 @@ See also @method[editor<%> refresh-delayed?] and @method[editor<%> in-edit-sequence?], and see @secref["editorthreads"] for information about edit sequences and refresh requests. -If the @scheme[undoable?] flag is @scheme[#f], then the changes made +If the @racket[undoable?] flag is @racket[#f], then the changes made in the sequence cannot be reversed through the @method[editor<%> undo] method. This flag is only effective for the outermost @method[editor<%> begin-edit-sequence] when nested sequences are - used. Note that, for a @scheme[text%] object, the character-inserting + used. Note that, for a @racket[text%] object, the character-inserting version of @method[text% insert] interferes with sequence-based undo groupings. -If the @scheme[interrupt-streak?] flag is @scheme[#f] and the sequence is +If the @racket[interrupt-streak?] flag is @racket[#f] and the sequence is outermost, then special actions before and after the sequence count as consecutive actions. For example, kills just before and after the sequence are appended in the copy buffer. @@ -237,9 +237,9 @@ This method must be called before writing any special header data to a stream. See @|filediscuss| and @method[editor<%> write-headers-to-file] for more information. -The @scheme[name] string must be a unique name that can be used by a +The @racket[name] string must be a unique name that can be used by a header reader to recognize the data. This method will store a value - in @scheme[buffer] that should be passed on to @method[editor<%> + in @racket[buffer] that should be passed on to @method[editor<%> end-write-header-footer-to-file]. } @@ -270,7 +270,7 @@ Propagates the request to any snip with the editor-local focus. Checks whether a generic edit command would succeed for the editor. This check is especially useful for enabling and disabling menus on demand. See @method[editor<%> do-edit-operation] for information - about the @scheme[op] and @scheme[recursive?] arguments. + about the @racket[op] and @racket[recursive?] arguments. } @methimpl{ @@ -288,21 +288,21 @@ locked, etc. @methspec{ Called just before the editor is loaded from a file. If the return -value is @scheme[#f], the file is not loaded. See also +value is @racket[#f], the file is not loaded. See also @method[editor<%> on-load-file] and @method[editor<%> after-load-file]. -The @scheme[filename] argument is the name the file will be loaded +The @racket[filename] argument is the name the file will be loaded from. See @method[editor<%> load-file] for information about - @scheme[format]. + @racket[format]. -Note that the @scheme[filename] argument cannot be a string; it must +Note that the @racket[filename] argument cannot be a string; it must be a path value. - + } @methimpl{ -Returns @scheme[#t]. +Returns @racket[#t]. }} @@ -314,21 +314,21 @@ Returns @scheme[#t]. @methspec{ Called just before the editor is saved to a file. If the return value -is @scheme[#f], the file is not saved. See also @method[editor<%> +is @racket[#f], the file is not saved. See also @method[editor<%> on-save-file] and @method[editor<%> after-save-file]. -The @scheme[filename] argument is the name the file will be saved +The @racket[filename] argument is the name the file will be saved to. See @method[editor<%> load-file] for information about - @scheme[format]. + @racket[format]. -Note that the @scheme[filename] argument cannot be a string; it must +Note that the @racket[filename] argument cannot be a string; it must be a path value. } @methimpl{ -Returns @scheme[#t]. +Returns @racket[#t]. }} @@ -352,16 +352,16 @@ Destroys the undo history of the editor. [time exact-integer? 0]) void?]{ -Copies @techlink{item}s into the clipboard. If @scheme[extend?] is not - @scheme[#f], the old clipboard contents are appended. +Copies @techlink{item}s into the clipboard. If @racket[extend?] is not + @racket[#f], the old clipboard contents are appended. The system may execute a copy (in response to other method calls) without calling this method. To extend or re-implement copying, override the @xmethod[text% do-copy] or @xmethod[pasteboard% do-copy] method of an editor. -See @|timediscuss| for a discussion of the @scheme[time] argument. If - @scheme[time] is outside the platform-specific range of times, +See @|timediscuss| for a discussion of the @racket[time] argument. If + @racket[time] is outside the platform-specific range of times, @|MismatchExn|. @@ -371,7 +371,7 @@ See @|timediscuss| for a discussion of the @scheme[time] argument. If (or/c (is-a?/c text%) (is-a?/c pasteboard%))]{ Creates a new editor with the same properties as this one. After an - editor is created (either a @scheme[text%] or @scheme[pasteboard%] + editor is created (either a @racket[text%] or @racket[pasteboard%] instance, as appropriate), the new editor is passed to @method[editor<%> copy-self-to]. @@ -381,14 +381,14 @@ Creates a new editor with the same properties as this one. After an @defmethod[(copy-self-to [dest (or/c (is-a?/c text%) (is-a?/c pasteboard%))]) void?]{ -Copies the properties of @this-obj[] to @scheme[dest]. +Copies the properties of @this-obj[] to @racket[dest]. -Each snip in @this-obj[] is copied and inserted into @scheme[dest]. +Each snip in @this-obj[] is copied and inserted into @racket[dest]. In addition, @this-obj[]'s filename, maximum undo history setting, keymap, interactive caret threshold, and overwrite-styles-on-load -settings are installed into @scheme[dest]. Finally, @this-obj[]'s +settings are installed into @racket[dest]. Finally, @this-obj[]'s style list is copied and the copy is installed as the style list for -@scheme[dest]. +@racket[dest]. } @@ -397,7 +397,7 @@ style list is copied and the copy is installed as the style list for void?]{ Copies and then deletes the currently selected @techlink{item}s. If - @scheme[extend?] is not @scheme[#f], the old clipboard contents are + @racket[extend?] is not @racket[#f], the old clipboard contents are appended. The system may execute a cut (in response to other method calls) @@ -407,8 +407,8 @@ The system may execute a cut (in response to other method calls) deletions in an editor, override @xmethod[text% on-delete] or @xmethod[pasteboard% on-delete]. -See @|timediscuss| for a discussion of the @scheme[time] argument. If - @scheme[time] is outside the platform-specific range of times, +See @|timediscuss| for a discussion of the @racket[time] argument. If + @racket[time] is outside the platform-specific range of times, @|MismatchExn|. } @@ -432,7 +432,7 @@ See also @method[editor<%> editor-location-to-dc-location]. string?]{ Returns the name of a style to be used for newly inserted text, - etc. The default is @scheme["Standard"]. + etc. The default is @racket["Standard"]. } @@ -444,31 +444,31 @@ Returns the name of a style to be used for newly inserted text, [time exact-integer? 0]) void?]{ -Performs a generic edit command. The @scheme[op] argument must be a +Performs a generic edit command. The @racket[op] argument must be a valid edit command, one of: @itemize[ -@item{@scheme['undo] --- undoes the last operation} -@item{@scheme['redo] --- undoes the last undo} -@item{@scheme['clear] --- deletes the current selection} -@item{@scheme['cut] --- cuts} -@item{@scheme['copy] --- copies} -@item{@scheme['paste] --- pastes} -@item{@scheme['kill] --- cuts to the end of the current line, or cuts a newline if there is only whitespace between the selection and end of line} -@item{@scheme['select-all] --- selects everything in the editor} -@item{@scheme['insert-text-box] --- inserts a text editor as an @techlink{item} in this editor; see also +@item{@racket['undo] --- undoes the last operation} +@item{@racket['redo] --- undoes the last undo} +@item{@racket['clear] --- deletes the current selection} +@item{@racket['cut] --- cuts} +@item{@racket['copy] --- copies} +@item{@racket['paste] --- pastes} +@item{@racket['kill] --- cuts to the end of the current line, or cuts a newline if there is only whitespace between the selection and end of line} +@item{@racket['select-all] --- selects everything in the editor} +@item{@racket['insert-text-box] --- inserts a text editor as an @techlink{item} in this editor; see also @method[editor<%> on-new-box] .} -@item{@scheme['insert-pasteboard-box] --- inserts a pasteboard editor as an @techlink{item} in this editor; see also +@item{@racket['insert-pasteboard-box] --- inserts a pasteboard editor as an @techlink{item} in this editor; see also @method[editor<%> on-new-box] .} -@item{@scheme['insert-image] --- gets a filename from the user and inserts the image as an @techlink{item} in this editor; see also +@item{@racket['insert-image] --- gets a filename from the user and inserts the image as an @techlink{item} in this editor; see also @method[editor<%> on-new-image-snip] .} ] -If @scheme[recursive?] is not @scheme[#f], then the command is passed on to +If @racket[recursive?] is not @racket[#f], then the command is passed on to any active snips of this editor (i.e., snips which own the caret). -See @|timediscuss| for a discussion of the @scheme[time] argument. If - @scheme[time] is outside the platform-specific range of times, +See @|timediscuss| for a discussion of the @racket[time] argument. If + @racket[time] is outside the platform-specific range of times, @|MismatchExn|. } @@ -501,8 +501,8 @@ See @method[editor<%> begin-edit-sequence]. void?]{ This method must be called after writing any special header data to a -stream. The @scheme[buffer-value] argument must be the value put in -the @scheme[buffer] argument box by @method[editor<%> +stream. The @racket[buffer-value] argument must be the value put in +the @racket[buffer] argument box by @method[editor<%> begin-write-header-footer-to-file]. See @|filediscuss| and @method[editor<%> write-headers-to-file] for @@ -514,7 +514,7 @@ more information. @defmethod[(find-first-snip) (or/c (is-a?/c snip%) #f)]{ -Returns the first snip in the editor, or @scheme[#f] if the editor is +Returns the first snip in the editor, or @racket[#f] if the editor is empty. To get all of the snips in the editor, use the @xmethod[snip% next] on the resulting snip. @@ -530,7 +530,7 @@ The first snip in a text editor is the one at @techlink{position} Maps a vertical @techlink{location} within the editor to a vertical scroll position. -For @scheme[text%] objects: @|FCA| @|OVD| +For @racket[text%] objects: @|FCA| @|OVD| } @@ -539,15 +539,15 @@ For @scheme[text%] objects: @|FCA| @|OVD| If the editor is displayed in a canvas, this method returns the canvas that most recently had the keyboard focus (while the editor was - displayed). If no such canvas exists, @scheme[#f] is returned. + displayed). If no such canvas exists, @racket[#f] is returned. } @defmethod[(get-admin) (or/c (is-a?/c editor-admin%) #f)]{ -Returns the @scheme[editor-admin%] object currently managing this - editor or @scheme[#f] if the editor is not displayed. +Returns the @racket[editor-admin%] object currently managing this + editor or @racket[#f] if the editor is not displayed. } @@ -557,7 +557,7 @@ Returns the @scheme[editor-admin%] object currently managing this If @method[editor<%> get-active-canvas] returns a canvas, that canvas is also returned by this method. Otherwise, if @method[editor<%> get-canvases] returns a non-empty list, the first canvas in the list - is returned, otherwise @scheme[#f] is returned. + is returned, otherwise @racket[#f] is returned. } @@ -568,7 +568,7 @@ Returns a list of canvases displaying the editor. An editor may be displayed in multiple canvases and no other kind of @techlink{display}, or one instance of another kind of @techlink{display} and no canvases. If the editor is not displayed or the editor's current @techlink{display} is not a canvas, - @scheme[null] is returned. + @racket[null] is returned. } @@ -577,7 +577,7 @@ Returns a list of canvases displaying the editor. An editor may be Typically used (indirectly) by snip objects belonging to the editor. Returns a destination drawing context which is suitable for - determining display sizing information, or @scheme[#f] if the editor + determining display sizing information, or @racket[#f] if the editor is not displayed. } @@ -614,15 +614,15 @@ padding (see @method[text% set-padding]). Called when the user must be queried for a filename to load an editor. A starting-directory path is passed in, but is may be - @scheme[#f] to indicate that any directory is fine. + @racket[#f] to indicate that any directory is fine. -Note that the @scheme[directory] argument cannot be a string; it must - be a path value or @scheme[#f]. +Note that the @racket[directory] argument cannot be a string; it must + be a path value or @racket[#f]. } @methimpl{ -Calls the global @scheme[get-file] procedure. +Calls the global @racket[get-file] procedure. If the editor is displayed in a single canvas, then the canvas's top-level frame is used as the parent for the file dialog. Otherwise, @@ -634,10 +634,10 @@ If the editor is displayed in a single canvas, then the canvas's (or/c path-string? #f)]{ Returns the path name of the last file saved from or loaded into this - editor, @scheme[#f] if the editor has no filename. + editor, @racket[#f] if the editor has no filename. -@boxisfill[(scheme temp) @elem{@scheme[#t] if the filename is temporary or @scheme[#f] -otherwise}] +@boxisfill[(scheme temp) @elem{@racket[#t] if the filename is temporary or +@racket[#f] otherwise}] } @@ -655,12 +655,12 @@ a discussion of flattened vs. non-flattened text. @index['("keyboard focus" "snips")]{Returns} the snip within the editor that gets the keyboard focus when the editor has the focus, or - @scheme[#f] if the editor does not delegate the focus. + @racket[#f] if the editor does not delegate the focus. -The returned snip might be an @scheme[editor-snip%] object. In that +The returned snip might be an @racket[editor-snip%] object. In that case, the embedded editor might delegate the focus to one of its own snips. However, the @method[editor<%> get-focus-snip] method returns - only the @scheme[editor-snip%] object, because it is the focus-owning + only the @racket[editor-snip%] object, because it is the focus-owning snip within the immediate editor. See also @method[editor<%> set-caret-owner]. @@ -672,9 +672,9 @@ See also @method[editor<%> set-caret-owner]. (or/c 'no-caret 'show-inactive-caret 'show-caret)]{ Returns the threshold for painting an inactive selection. This - threshold is compared with the @scheme[draw-caret] argument to + threshold is compared with the @racket[draw-caret] argument to @method[editor<%> refresh] and if the argument is as least as large - as the threshold (but larger than @indexed-scheme['show-caret]), the + as the threshold (but larger than @indexed-racket['show-caret]), the selection is drawn as inactive. See also @method[editor<%> set-inactive-caret-threshold] and @@ -706,7 +706,7 @@ See also @method[editor<%> set-load-overwrites-styles]. (or/c (and/c real? (not/c negative?)) 'none)]{ Gets the maximum display height for the contents of the editor; zero or - @scheme['none] indicates that there is no maximum. + @racket['none] indicates that there is no maximum. } @@ -742,8 +742,8 @@ If the @techlink{display} is an editor canvas, see also (or/c (and/c real? (not/c negative?)) 'none)]{ Gets the maximum display width for the contents of the editor; zero or - @scheme['none] indicates that there is no maximum. In a text editor, - zero of @scheme['none] disables automatic line breaking. + @racket['none] indicates that there is no maximum. In a text editor, + zero of @racket['none] disables automatic line breaking. } @@ -751,7 +751,7 @@ Gets the maximum display width for the contents of the editor; zero or (or/c (and/c real? (not/c negative?)) 'none)]{ Gets the minimum display height for the contents of the editor; zero - or @scheme['none] indicates that there is no minimum. + or @racket['none] indicates that there is no minimum. } @@ -760,15 +760,15 @@ Gets the minimum display height for the contents of the editor; zero (or/c (and/c real? (not/c negative?)) 'none)]{ Gets the minimum display width for the contents of the editor; zero or - @scheme['none] indicates that there is no minimum. + @racket['none] indicates that there is no minimum. } @defmethod[(get-paste-text-only) boolean?]{ -If the result is @scheme[#t], then the editor accepts only plain-text - data from the clipboard. If the result is @scheme[#f], the editor +If the result is @racket[#t], then the editor accepts only plain-text + data from the clipboard. If the result is @racket[#f], the editor accepts both text and snip data from the clipboard. } @@ -779,13 +779,13 @@ If the result is @scheme[#t], then the editor accepts only plain-text @methspec{ Gets extra data associated with a snip (e.g., @techlink{location} - information in a pasteboard) or returns @scheme[#f] is there is no + information in a pasteboard) or returns @racket[#f] is there is no information. See @|editordatadiscuss| for more information. } @methimpl{ -Returns @scheme[#f]. +Returns @racket[#f]. }} @@ -797,21 +797,21 @@ Returns @scheme[#f]. boolean?]{ Gets the @techlink{location} of the given snip. If the snip is found in - the editor, @scheme[#t] is returned; otherwise, @scheme[#f] is returned. + the editor, @racket[#t] is returned; otherwise, @racket[#f] is returned. @boxisfillnull[(scheme x) @elem{the x-coordinate of the snip's @techlink{location}}] @boxisfillnull[(scheme y) @elem{the y-coordinate of the snip's @techlink{location}}] -If @scheme[bottom-right?] is not @scheme[#f], the values in the - @scheme[x] and @scheme[y] boxes are for the snip's bottom right +If @racket[bottom-right?] is not @racket[#f], the values in the + @racket[x] and @racket[y] boxes are for the snip's bottom right corner instead of its top-left corner. Obtaining the @techlink{location} if the bottom-right corner may trigger delayed size calculations (including snips other than the one whose @techlink{location} was requested). -@|OVD| As a special case, however, a @scheme[pasteboard%] object - always reports valid answers when @scheme[bottom-right?] is @scheme[#f]. +@|OVD| As a special case, however, a @racket[pasteboard%] object + always reports valid answers when @racket[bottom-right?] is @racket[#f]. @FCAME[] } @@ -866,9 +866,9 @@ Converts the given coordinates from top-level @techlink{display} coordinates @method[editor<%> dc-location-to-editor-location]. @boxisfillnull[(scheme x) @elem{the translated x-coordinate of the value initially -in @scheme[x]}] +in @racket[x]}] @boxisfillnull[(scheme y) @elem{the translated x-coordinate of the value initially -in @scheme[y]}] +in @racket[y]}] @|OVD| @@ -879,7 +879,7 @@ See also @method[editor<%> local-to-global]. @defmethod[#:mode public-final (in-edit-sequence?) boolean?]{ -Returns @scheme[#t] if updating on this editor is currently delayed +Returns @racket[#t] if updating on this editor is currently delayed because @method[editor<%> begin-edit-sequence] has been called for this editor. @@ -903,7 +903,7 @@ Inserts data into the editor. A snip cannot be inserted into multiple void?]{ Inserts a box (a sub-editor) into the editor by calling -@method[editor<%> on-new-box], then passing along @scheme[type] and +@method[editor<%> on-new-box], then passing along @racket[type] and inserts the resulting snip into the editor. @|OnInsertNote| @@ -918,11 +918,11 @@ inserts the resulting snip into the editor. boolean?]{ Inserts the content of a file or port into the editor (at the current - selection @techlink{position} in @scheme[text%] editors). The result - is @scheme[#t]; if an error occurs, an exception is raised. + selection @techlink{position} in @racket[text%] editors). The result + is @racket[#t]; if an error occurs, an exception is raised. -For information on @scheme[format], see @method[editor<%> load-file]. -The @scheme[show-errors?] argument is no longer used. +For information on @racket[format], see @method[editor<%> load-file]. +The @racket[show-errors?] argument is no longer used. @|OnInsertNote| @@ -941,15 +941,15 @@ The @scheme[show-errors?] argument is no longer used. Inserts an image into the editor. -If @scheme[filename] is @scheme[#f], then the -user is queried for a filename. The @scheme[kind] must one of +If @racket[filename] is @racket[#f], then the +user is queried for a filename. The @racket[kind] must one of the symbols that can be passed to @method[bitmap% load-file]. After the filename has been determined, an image is created by calling @method[editor<%> on-new-image-snip]. See also -@scheme[image-snip%]. +@racket[image-snip%]. @|OnInsertNote| @@ -962,19 +962,19 @@ calling (or/c 'standard 'text 'text-force-cr)]{ Inserts the content of a port into the editor (at the current - selection @techlink{position} in @scheme[text%] editors) without wrapping + selection @techlink{position} in @racket[text%] editors) without wrapping the insert operations as an edit sequence. The result is the actual format of the loaded content (which is different from the given - format type if the given format is @scheme['guess], @scheme['same], or - @scheme['copy]). + format type if the given format is @racket['guess], @racket['same], or + @racket['copy]). -The @scheme[port] must support position setting with @scheme[file-position]. +The @racket[port] must support position setting with @racket[file-position]. -For information on @scheme[format], see +For information on @racket[format], see @method[editor<%> load-file]. -if @scheme[replace-styles?] is true, then styles in the current style - list are replaced by style specifications in @scheme[port]'s stream. +if @racket[replace-styles?] is true, then styles in the current style + list are replaced by style specifications in @racket[port]'s stream. See also @method[editor<%> insert-file]. } @@ -988,17 +988,17 @@ See also @method[editor<%> insert-file]. When @method[editor<%> on-paint] is overridden, call this method when the state of @method[editor<%> on-paint]'s drawing changes. -The @scheme[x], @scheme[y], @scheme[width], and @scheme[height] +The @racket[x], @racket[y], @racket[width], and @racket[height] arguments specify the area that needs repainting in editor - coordinates. If @scheme[width]/@scheme[height] is @scheme['end], then + coordinates. If @racket[width]/@racket[height] is @racket['end], then the total height/width of the editor (as reported by @method[editor<%> get-extent]) is used. Note that the editor's size can be smaller than the visible region of its @techlink{display}. If - @scheme[width]/@scheme[height] is @scheme['display-end], then the + @racket[width]/@racket[height] is @racket['display-end], then the largest height/width of the editor's views (as reported by @method[editor-admin% get-max-view]) is used. If - @scheme[width]/@scheme[height] is not @scheme['display-end], then - the given @scheme[width]/@scheme[height] is constrained to the + @racket[width]/@racket[height] is not @racket['display-end], then + the given @racket[width]/@racket[height] is constrained to the editor's size. The default implementation triggers a redraw of the editor, either @@ -1011,7 +1011,7 @@ See also @method[editor<%> size-cache-invalid].} @defmethod[(is-locked?) boolean?]{ -Returns @scheme[#t] if the editor is currently locked, @scheme[#f] +Returns @racket[#t] if the editor is currently locked, @racket[#f] otherwise. See @method[editor<%> lock] for more information. } @@ -1020,9 +1020,9 @@ Returns @scheme[#t] if the editor is currently locked, @scheme[#f] @defmethod[(is-modified?) boolean?]{ -Returns @scheme[#t] if the editor has been modified since the last +Returns @racket[#t] if the editor has been modified since the last save or load (or the last call to @method[editor<%> set-modified] - with @scheme[#f]), @scheme[#f] otherwise. + with @racket[#f]), @racket[#f] otherwise. } @@ -1030,8 +1030,8 @@ Returns @scheme[#t] if the editor has been modified since the last @defmethod[(is-printing?) boolean?]{ -Returns @scheme[#t] if the editor is currently being printed through -the @method[editor<%> print] method, @scheme[#f] otherwise.} +Returns @racket[#t] if the editor is currently being printed through +the @method[editor<%> print] method, @racket[#f] otherwise.} @defmethod[(kill [time exact-integer? 0]) @@ -1042,8 +1042,8 @@ In a text editor, cuts to the end of the current line, or cuts a line. Multiple consecutive kills are appended. In a pasteboard editor, cuts the current selection. -See @|timediscuss| for a discussion of the @scheme[time] argument. If - @scheme[time] is outside the platform-specific range of times, +See @|timediscuss| for a discussion of the @racket[time] argument. If + @racket[time] is outside the platform-specific range of times, @|MismatchExn|. See also @method[editor<%> cut]. @@ -1060,53 +1060,53 @@ See also @method[editor<%> cut]. boolean?]{ -Loads a file into the editor and returns @scheme[#t]. If an error +Loads a file into the editor and returns @racket[#t]. If an error occurs, an exception is raised. -If @scheme[filename] is @scheme[#f], then the -internally stored filename will be used; if @scheme[filename] is @scheme[""] or +If @racket[filename] is @racket[#f], then the +internally stored filename will be used; if @racket[filename] is @racket[""] or if the internal name is unset or temporary, then the user will be prompted for a name. -The possible values for @scheme[format] are listed below. A single set of -@scheme[format] values are used for loading and saving files: +The possible values for @racket[format] are listed below. A single set of +@racket[format] values are used for loading and saving files: @itemize[ -@item{@scheme['guess] --- guess the format based on +@item{@racket['guess] --- guess the format based on extension and/or contents; when saving a file, this is the same as -@scheme['standard]} +@racket['standard]} -@item{@scheme['same] --- read in whatever format was last loaded or saved} +@item{@racket['same] --- read in whatever format was last loaded or saved} -@item{@scheme['standard] --- read/write a standard file (binary format)} +@item{@racket['standard] --- read/write a standard file (binary format)} -@item{@scheme['copy] --- write using whatever format was last loaded +@item{@racket['copy] --- write using whatever format was last loaded or saved, but do not change the modification flag or remember - @scheme[filename] (saving only)} + @racket[filename] (saving only)} -@item{@scheme['text] --- read/write a text file (@scheme[text%] only); +@item{@racket['text] --- read/write a text file (@racket[text%] only); file writing uses the platform's text-mode conventions (e.g., newlines as return--linefeed combinations on Windows) when not specifically disabled via @method[editor<%> use-file-text-mode]} -@item{@scheme['text-force-cr] --- read/write a text file -(@scheme[text%] only); when writing, change automatic newlines (from +@item{@racket['text-force-cr] --- read/write a text file +(@racket[text%] only); when writing, change automatic newlines (from word-wrapping) into real carriage returns} ] -In a @scheme[text%] instance, the format returned from @method[text% - get-file-format] is always one of @scheme['standard], @scheme['text], - or @scheme['text-force-cr]. +In a @racket[text%] instance, the format returned from @method[text% + get-file-format] is always one of @racket['standard], @racket['text], + or @racket['text-force-cr]. -The @scheme[show-errors?] argument is no longer used. +The @racket[show-errors?] argument is no longer used. The filename used to load the file can be retrieved with - @method[editor<%> get-filename]. For a @scheme[text%] instance, the + @method[editor<%> get-filename]. For a @racket[text%] instance, the format can be retrieved with @method[text% get-file-format]. However, if an error occurs while loading the file, the filename is set to - @scheme[#f]. + @racket[#f]. See also @method[editor<%> on-load-file], @method[editor<%> after-load-file], @method[editor<%> can-load-file?], and @@ -1124,9 +1124,9 @@ Converts the given coordinates from editor @techlink{location} @method[editor<%> editor-location-to-dc-location]. @boxisfillnull[(scheme x) @elem{the translated x-coordinate of the value initially -in @scheme[x]}] +in @racket[x]}] @boxisfillnull[(scheme y) @elem{the translated x-coordinate of the value initially -in @scheme[y]}] +in @racket[y]}] @|OVD| @@ -1138,9 +1138,9 @@ See also @method[editor<%> global-to-local]. @defmethod[(locations-computed?) boolean?]{ -Returns @scheme[#t] if all @techlink{location} information has been +Returns @racket[#t] if all @techlink{location} information has been computed after recent changes to the editor's content or to its - snips, @scheme[#f] otherwise. + snips, @racket[#f] otherwise. Location information is often computed on demand, and @method[editor<%> begin-edit-sequence] tends to delay the @@ -1201,9 +1201,9 @@ Reports whether the editor is internally locked for writing. See Typically called (indirectly) by a snip within the editor to force the editor to be redrawn. -The @scheme[localx], @scheme[localy], @scheme[width], and @scheme[height] +The @racket[localx], @racket[localy], @racket[width], and @racket[height] arguments specify the area that needs repainting in the coordinate - system of @scheme[snip]. + system of @racket[snip]. @FCAME[] @@ -1215,7 +1215,7 @@ The @scheme[localx], @scheme[localy], @scheme[width], and @scheme[height] Reports the number of scroll positions available within the editor. -For @scheme[text%] objects: @|FCA| @|EVD| +For @racket[text%] objects: @|FCA| @|EVD| } @@ -1258,8 +1258,8 @@ Consider overriding @method[editor<%> on-local-char] or @methimpl{ Either passes this event on to a caret-owning snip or calls - @method[editor<%> on-local-char]. In the latter case, @scheme[text%] - first calls @scheme[hide-cursor-until-moved]. + @method[editor<%> on-local-char]. In the latter case, @racket[text%] + first calls @racket[hide-cursor-until-moved]. }} @@ -1392,9 +1392,9 @@ Consider overriding @method[editor<%> on-local-event] or @methimpl{ Either passes this event on to a caret-owning snip, selects a new - caret-owning snip (@scheme[text%] only) and passes the event on to + caret-owning snip (@racket[text%] only) and passes the event on to the selected snip, or calls @method[editor<%> on-local-event]. A new - caret-owning snip is selected in a @scheme[text%] object when the + caret-owning snip is selected in a @racket[text%] object when the click is on an event-handling snip, and not too close to the space between snips (see @method[text% get-between-threshold] ). @@ -1406,8 +1406,8 @@ Either passes this event on to a caret-owning snip, selects a new @index['("keyboard focus" "notification")]{Called} when the keyboard focus changes into or out of this editor (and not to/from a snip - within the editor) with @scheme[#t] if the focus is being turned on, - @scheme[#f] otherwise. + within the editor) with @racket[#t] if the focus is being turned on, + @racket[#f] otherwise. } @@ -1423,11 +1423,11 @@ Called just before the editor is loaded from a file, after calling @method[editor<%> can-load-file?] to verify that the load is allowed. See also @method[editor<%> after-load-file]. -The @scheme[filename] argument is the name the file will be loaded +The @racket[filename] argument is the name the file will be loaded from. See @method[editor<%> load-file] for information about - @scheme[format]. + @racket[format]. -Note that the @scheme[filename] argument cannot be a string; it must +Note that the @racket[filename] argument cannot be a string; it must be a path value. } @@ -1485,11 +1485,11 @@ Creates and returns a new snip for an embedded editor. This method is } @methimpl{ -Creates a @scheme[editor-snip%] with either a sub-editor from - @scheme[text%] or sub-pasteboard from @scheme[pasteboard%], depending - on whether @scheme[type] is @scheme['text] or - @scheme['pasteboard]. The keymap (see @scheme[keymap%]) and style - list (see @scheme[style-list%]) for of the new sub-editor are set to +Creates a @racket[editor-snip%] with either a sub-editor from + @racket[text%] or sub-pasteboard from @racket[pasteboard%], depending + on whether @racket[type] is @racket['text] or + @racket['pasteboard]. The keymap (see @racket[keymap%]) and style + list (see @racket[style-list%]) for of the new sub-editor are set to the keymap and style list of this editor. }} @@ -1505,16 +1505,16 @@ Creates a @scheme[editor-snip%] with either a sub-editor from (is-a?/c image-snip%)]{ @methspec{ -Creates and returns a new instance of @scheme[image-snip%] for +Creates and returns a new instance of @racket[image-snip%] for @method[editor<%> insert-image]. -Note that the @scheme[filename] argument cannot be a string; it must be a +Note that the @racket[filename] argument cannot be a string; it must be a path value. } @methimpl{ -Returns @scheme[(make-object image-snip% filename kind relative-path? inline?)]. +Returns @racket[(make-object image-snip% filename kind relative-path? inline?)]. }} @@ -1537,13 +1537,13 @@ Provides a way to add arbitrary graphics to an editor's @techlink{display}. Thi method is called just before and just after every painting of the editor. -The @scheme[before?] argument is @scheme[#t] when the method is called just - before a painting the contents of the editor or @scheme[#f] when it is - called after painting. The @scheme[left], @scheme[top], @scheme[right], and - @scheme[bottom] arguments specify which region of the editor is being +The @racket[before?] argument is @racket[#t] when the method is called just + before a painting the contents of the editor or @racket[#f] when it is + called after painting. The @racket[left], @racket[top], @racket[right], and + @racket[bottom] arguments specify which region of the editor is being repainted, in editor coordinates. To get the coordinates for - @scheme[dc], offset editor coordinates by adding (@scheme[dx], @scheme[dy]). - See @|drawcaretdiscuss| for information about @scheme[draw-caret]. + @racket[dc], offset editor coordinates by adding (@racket[dx], @racket[dy]). + See @|drawcaretdiscuss| for information about @racket[draw-caret]. The @method[editor<%> on-paint] method, together with the snips' @method[snip% draw] methods, must be able to draw the entire state of @@ -1588,11 +1588,11 @@ Called just before the editor is saved to a file, after calling @method[editor<%> can-save-file?] to verify that the save is allowed. See also @method[editor<%> after-save-file]. -The @scheme[filename] argument is the name the file will be saved +The @racket[filename] argument is the name the file will be saved to. See @method[editor<%> load-file] for information about -@scheme[format]. +@racket[format]. -Note that the @scheme[filename] argument cannot be a string; it must +Note that the @racket[filename] argument cannot be a string; it must be a path value. @@ -1621,16 +1621,16 @@ See also @method[editor<%> set-modified]. } @methimpl{ -If @scheme[modified?] is true and the editor was not already modified +If @racket[modified?] is true and the editor was not already modified (i.e., its @method[editor<%> is-modified?] method reports - @scheme[#f]), then the @method[editor<%> set-modified] method is - called with @scheme[#t]. If the editor was already modified, then the + @racket[#f]), then the @method[editor<%> set-modified] method is + called with @racket[#t]. If the editor was already modified, then the internal modify-counter is incremented. -If @scheme[modified?] is @scheme[#f], and if the modify-counter is - @scheme[1], then the @method[editor<%> set-modified] method is called - with @scheme[#f] (on the assumption that the modify-counter was set - to @scheme[1] by an earlier call to this method for the same snip). +If @racket[modified?] is @racket[#f], and if the modify-counter is + @racket[1], then the @method[editor<%> set-modified] method is called + with @racket[#f] (on the assumption that the modify-counter was set + to @racket[1] by an earlier call to this method for the same snip). }} @@ -1656,8 +1656,8 @@ Propagates the flag to any snip with the editor-local focus. If no Pastes the current contents of the clipboard into the editor. -See @|timediscuss| for a discussion of the @scheme[time] argument. If - @scheme[time] is outside the platform-specific range of times, +See @|timediscuss| for a discussion of the @racket[time] argument. If + @racket[time] is outside the platform-specific range of times, @|MismatchExn|. The system may execute a paste (in response to other method calls) @@ -1676,8 +1676,8 @@ See also @method[editor<%> get-paste-text-only]. Like @method[editor<%> paste], but on Unix, uses the X11 selection instead of the clipboard. -See @|timediscuss| for a discussion of the @scheme[time] argument. If - @scheme[time] is outside the platform-specific range of times, +See @|timediscuss| for a discussion of the @racket[time] argument. If + @racket[time] is outside the platform-specific range of times, @|MismatchExn|. To extend or re-implement copying, override the @xmethod[text% @@ -1697,18 +1697,18 @@ To extend or re-implement copying, override the @xmethod[text% Prints the editor. -If @scheme[interactive?] is true and a PostScript file is created, the +If @racket[interactive?] is true and a PostScript file is created, the is given a dialog for adjusting printing parameters; see also - @scheme[get-ps-setup-from-user]. Otherwise, if a PostScript file is - created, the settings returned by @scheme[current-ps-setup] are + @racket[get-ps-setup-from-user]. Otherwise, if a PostScript file is + created, the settings returned by @racket[current-ps-setup] are used. (The user may still get a dialog to select an output file name; - see @scheme[post-script-dc%] for more details.) + see @racket[post-script-dc%] for more details.) -If @scheme[fit-on-page?] is a true value, then during printing for a - @scheme[text%] editor, the editor's maximum width is set to the width +If @racket[fit-on-page?] is a true value, then during printing for a + @racket[text%] editor, the editor's maximum width is set to the width of the page (less margins) and the autowrapping bitmap is removed. -The @scheme[output-mode] setting +The @racket[output-mode] setting determines whether the output is generated directly as a PostScript file, generated directly as a PDF file, or generated using the platform-specific standard printing mechanism. The possible @@ -1716,39 +1716,39 @@ The @scheme[output-mode] setting @itemize[ - @item{@scheme['standard] --- print using the platform-standard - mechanism (via a @scheme[printer-dc%])} + @item{@racket['standard] --- print using the platform-standard + mechanism (via a @racket[printer-dc%])} - @item{@scheme['postscript] --- print to a PostScript file (via a - @scheme[post-script-dc%])} + @item{@racket['postscript] --- print to a PostScript file (via a + @racket[post-script-dc%])} - @item{@scheme['pdf] --- print to a PDF file (via a - @scheme[pdf-dc%])} + @item{@racket['pdf] --- print to a PDF file (via a + @racket[pdf-dc%])} ] -If @scheme[parent] is not @scheme[#f], it is used as the parent window +If @racket[parent] is not @racket[#f], it is used as the parent window for configuration dialogs (for either PostScript or platform-standard - printing). If @scheme[parent] is @scheme[#f] and if the editor is + printing). If @racket[parent] is @racket[#f] and if the editor is displayed in a single canvas, then the canvas's top-level frame is used as the parent for configuration dialogs. Otherwise, configuration dialogs will have no parent. -The @scheme[force-ps-page-bbox?] argument is used for PostScript +The @racket[force-ps-page-bbox?] argument is used for PostScript and PDF printing, and is used as the third initialization argument when - creating the @scheme[post-script-dc%] or @racket[pdf-dc%] instance. Unless it is - @scheme[#f], the bounding-box of the resulting PostScript/PDF file is set + creating the @racket[post-script-dc%] or @racket[pdf-dc%] instance. Unless it is + @racket[#f], the bounding-box of the resulting PostScript/PDF file is set to the current paper size. -The @scheme[as-eps?] argument is used for PostScript and PDF printing, and is +The @racket[as-eps?] argument is used for PostScript and PDF printing, and is used as the fourth initialization argument when creating the - @scheme[post-script-dc%] or @racket[pdf-dc%] instance. Unless it is @scheme[#f], a + @racket[post-script-dc%] or @racket[pdf-dc%] instance. Unless it is @racket[#f], a resulting PostScript file is identified as Encapsulated PostScript (EPS). The printing margins are determined by @method[ps-setup% - get-editor-margin] in the current @scheme[ps-setup%] object (as - determined by @scheme[current-ps-setup]), but they are ignored when + get-editor-margin] in the current @racket[ps-setup%] object (as + determined by @racket[current-ps-setup]), but they are ignored when @racket[as-eps?] is true. } @@ -1761,13 +1761,13 @@ The printing margins are determined by @method[ps-setup% Prints the editor into the given drawing context. See also @method[editor<%> print]. -If @scheme[page-number] is a positive integer, then just the +If @racket[page-number] is a positive integer, then just the indicated page is printed, where pages are numbered from -@scheme[1]. If @racket[page-number] is @scheme[0], then the +@racket[1]. If @racket[page-number] is @racket[0], then the entire content of the editor is printed on a single page. -When @scheme[page-number] is negative, then the editor content is +When @racket[page-number] is negative, then the editor content is split across pages as needed to fit, and the -@method[dc<%> start-page] and @method[dc<%> end-page] methods of @scheme[dc<%>] are +@method[dc<%> start-page] and @method[dc<%> end-page] methods of @racket[dc<%>] are called for each page. } @@ -1780,16 +1780,16 @@ called for each page. Called when the user must be queried for a filename to save an editor. Starting-directory and default-name paths are passed in, - but either may be @scheme[#f] to indicate that any directory is fine or + but either may be @racket[#f] to indicate that any directory is fine or there is no default name. -Note that the @scheme[directory] and @scheme[filename] arguments +Note that the @racket[directory] and @racket[filename] arguments cannot be strings; each must be a path value. } @methimpl{ -Calls the global @scheme[put-file] procedure. +Calls the global @racket[put-file] procedure. If the editor is displayed in a single canvas, then the canvas's top-level frame is used as the parent for the file dialog. Otherwise, @@ -1812,7 +1812,7 @@ See @method[editor<%> read-header-from-file]. boolean?]{ Reads new contents for the editor from a stream. The return value is - @scheme[#t] if there are no errors, @scheme[#f] otherwise. See also + @racket[#t] if there are no errors, @racket[#f] otherwise. See also @|filediscuss|. The stream provides either new mappings for names in the editor's @@ -1823,8 +1823,8 @@ The stream provides either new mappings for names in the editor's @itemize[ - @item{In the former case, if the @scheme[overwrite-styles?] argument - is @scheme[#f], then each style name in the loaded file that is already + @item{In the former case, if the @racket[overwrite-styles?] argument + is @racket[#f], then each style name in the loaded file that is already in the current style list keeps its current style. Otherwise, existing named styles are overwritten with specifications from the loaded file.} @@ -1841,8 +1841,8 @@ The stream provides either new mappings for names in the editor's boolean?]{ Called to handle a named header that is found when reading editor data - from a stream. The return value is @scheme[#t] if there are no errors, - @scheme[#f] otherwise. + from a stream. The return value is @racket[#t] if there are no errors, + @racket[#f] otherwise. Override this method only to embellish the file format with new header information. Always call the inherited method if the derived reader @@ -1880,19 +1880,19 @@ See also @method[editor<%> add-undo]. void?]{ Repaints a region of the editor, generally called by an editor - administrator. The @scheme[x], @scheme[y], @scheme[width], and - @scheme[height] arguments specify the area that needs repainting in + administrator. The @racket[x], @racket[y], @racket[width], and + @racket[height] arguments specify the area that needs repainting in editor coordinates. The @method[editor-admin% get-dc] method of the editor's administrator (as returned by @method[editor<%> get-admin]) - supplies the target @scheme[dc<%>] object and offset for drawing. + supplies the target @racket[dc<%>] object and offset for drawing. -See @|drawcaretdiscuss| for information about @scheme[draw-caret]. +See @|drawcaretdiscuss| for information about @racket[draw-caret]. -The @scheme[background] color corresponds to the background of the - @techlink{display}; if it is @scheme[#f], then the display is transparent. +The @racket[background] color corresponds to the background of the + @techlink{display}; if it is @racket[#f], then the display is transparent. An editor should use the given background color as its own - background (or not paint the background of @scheme[background] is - @scheme[#f]). + background (or not paint the background of @racket[background] is + @racket[#f]). See @secref["editorthreads"] for information about edit sequences and refresh requests. @@ -1903,12 +1903,12 @@ See @secref["editorthreads"] for information about edit sequences and @defmethod[(refresh-delayed?) boolean?]{ -Returns @scheme[#t] if updating on this editor is currently +Returns @racket[#t] if updating on this editor is currently delayed. Updating may be delayed because @method[editor<%> begin-edit-sequence] has been called for this editor, or because the editor has no administrator, or because the editor's administrator - returns @scheme[#t] from its @method[editor-admin% refresh-delayed?] - method. (The administrator might return @scheme[#t] because an + returns @racket[#t] from its @method[editor-admin% refresh-delayed?] + method. (The administrator might return @racket[#t] because an enclosing editor's refresh is delayed.) See also @method[editor<%> in-edit-sequence?]. @@ -1921,7 +1921,7 @@ See also @method[editor<%> in-edit-sequence?]. Requests that the specified snip be deleted and released from the editor. If this editor is not the snip's owner or if the snip cannot - be released, then @scheme[#f] is returned. Otherwise, @scheme[#t] is + be released, then @racket[#f] is returned. Otherwise, @racket[#t] is returned and the snip is no longer owned. See also @xmethod[snip-admin% release-snip] . @@ -1949,7 +1949,7 @@ Called (indirectly) by snips within the editor: it forces a recalculation of the display information in which the specified snip has changed its size. -If @scheme[redraw-now?] is @scheme[#f], the editor will require +If @racket[redraw-now?] is @racket[#f], the editor will require another message to repaint itself. (See also @method[editor<%> needs-update].) @@ -1962,27 +1962,27 @@ If @scheme[redraw-now?] is @scheme[#f], the editor will require [show-errors? any/c #t]) boolean?]{ -Saves the editor into a file and returns @scheme[#t]. If an error +Saves the editor into a file and returns @racket[#t]. If an error occurs, an exception is raised. -If @scheme[filename] is @scheme[#f], then the internally stored filename - will be used; if @scheme[filename] is @scheme[""] or if the internal name +If @racket[filename] is @racket[#f], then the internally stored filename + will be used; if @racket[filename] is @racket[""] or if the internal name is unset or temporary, then the user will be prompted for a name. - The possible values for @scheme[format] are described at -@method[editor<%> load-file]. + The possible values for @racket[format] are described at +@method[editor<%> load-file]. The filename and format used to save the file can be retrieved with - @method[editor<%> get-filename]. In a @scheme[text%] instance, the + @method[editor<%> get-filename]. In a @racket[text%] instance, the format can be retrieved with @method[text% get-file-format]. See also @method[editor<%> on-save-file], @method[editor<%> after-save-file], and @method[editor<%> can-save-file?]. -On Mac OS X, the file's type signature is set to @scheme["TEXT"] - for a text-format file or @scheme["WXME"] for a standard-format +On Mac OS X, the file's type signature is set to @racket["TEXT"] + for a text-format file or @racket["WXME"] for a standard-format (binary) file. -The @scheme[show-errors?] argument is no longer used. +The @racket[show-errors?] argument is no longer used. } @@ -1993,13 +1993,13 @@ The @scheme[show-errors?] argument is no longer used. [show-errors? any/c #t]) boolean?]{ -Saves the editor into a port and returns @scheme[#t]. If an error +Saves the editor into a port and returns @racket[#t]. If an error occurs, an exception is raised. -The possible values for @scheme[format] are described at +The possible values for @racket[format] are described at @method[editor<%> load-file]. -The @scheme[show-errors?] argument is no longer used. +The @racket[show-errors?] argument is no longer used. } @@ -2013,8 +2013,8 @@ The @scheme[show-errors?] argument is no longer used. boolean?]{ Causes the editor to be scrolled so that a given @techlink{location} - is visible. If the editor is scrolled, @scheme[#t] is returned, - otherwise @scheme[#f] is returned. + is visible. If the editor is scrolled, @racket[#t] is returned, + otherwise @racket[#f] is returned. This method is normally called indirectly by @method[editor<%> scroll-to] or @xmethod[text% scroll-to-position] to implement @@ -2025,7 +2025,7 @@ The default implementation forwards the request to the if any (see @method[editor<%> get-admin]). If a text editor has padding (see @method[text% set-padding]), then the padding is added to the given @techlink{location} before forwarding to the -administrator. If the editor has no administrator, @scheme[#f] is +administrator. If the editor has no administrator, @racket[#f] is returned. } @@ -2037,7 +2037,7 @@ returned. Maps a vertical scroll position to a vertical @techlink{location} within the editor. -For @scheme[text%] objects: @|FCA| @|EVD| +For @racket[text%] objects: @|FCA| @|EVD| } @@ -2054,23 +2054,23 @@ For @scheme[text%] objects: @|FCA| @|EVD| Called (indirectly) by snips within the editor: it causes the editor to be scrolled so that a given @techlink{location} range within a given snip is visible. If the editor is scrolled immediately, - @scheme[#t] is returned, otherwise @scheme[#f] is returned. + @racket[#t] is returned, otherwise @racket[#f] is returned. If refreshing is delayed (see @method[editor<%> refresh-delayed?]), then the scroll request is saved until the delay has ended. The scroll is performed (immediately or later) by calling @method[editor<%> scroll-editor-to]. -The @scheme[localx], @scheme[localy], @scheme[width], and @scheme[height] - arguments specify the area that needs to be visible in @scheme[snip]'s +The @racket[localx], @racket[localy], @racket[width], and @racket[height] + arguments specify the area that needs to be visible in @racket[snip]'s coordinate system. -When the specified region cannot fit in the visible area, @scheme[bias] - indicates which end of the region to display. When @scheme[bias] is - @scheme['start], then the top-left of the region is - displayed. When @scheme[bias] is @scheme['end], then the - bottom-right of the region is displayed. Otherwise, @scheme[bias] must - be @scheme['none]. +When the specified region cannot fit in the visible area, @racket[bias] + indicates which end of the region to display. When @racket[bias] is + @racket['start], then the top-left of the region is + displayed. When @racket[bias] is @racket['end], then the + bottom-right of the region is displayed. Otherwise, @racket[bias] must + be @racket['none]. } @@ -2110,15 +2110,15 @@ get-admin]}] [domain (or/c 'immediate 'display 'global) 'immediate]) void?]{ -Attempts to give the keyboard focus to @scheme[snip]. If @scheme[snip] is - @scheme[#f], then the caret is taken away from any snip in the editor +Attempts to give the keyboard focus to @racket[snip]. If @racket[snip] is + @racket[#f], then the caret is taken away from any snip in the editor that currently has the caret and restored to this editor. -If the keyboard focus is moved to @scheme[snip] and the editor has the +If the keyboard focus is moved to @racket[snip] and the editor has the real keyboard focus, the @method[snip% own-caret] method of the snip will be called. -If @scheme[#f] is provided as the new owner, then the local focus is +If @racket[#f] is provided as the new owner, then the local focus is moved to the editor itself. Otherwise, the local focus is moved to the specified snip. @@ -2126,14 +2126,14 @@ The domain of focus-setting is one of: @itemize[ - @item{@scheme['immediate] --- only set the focus owner within the + @item{@racket['immediate] --- only set the focus owner within the editor} - @item{@scheme['display] --- make this editor or the new focus + @item{@racket['display] --- make this editor or the new focus owner get the keyboard focus among the editors in this editor's @techlink{display} (if this is an embedded editor)} - @item{@scheme['global] --- make this editor or the new focus + @item{@racket['global] --- make this editor or the new focus owner get the keyboard focus among all elements in the editor's frame} ] @@ -2150,12 +2150,12 @@ See also @method[editor<%> get-focus-snip]. [override? any/c #t]) void?]{ -Sets the custom cursor for the editor to @scheme[cursor]. If - @scheme[override?] is a true value and @scheme[cursor] is not - @scheme[#f], then this cursor overrides cursor settings in embedded +Sets the custom cursor for the editor to @racket[cursor]. If + @racket[override?] is a true value and @racket[cursor] is not + @racket[#f], then this cursor overrides cursor settings in embedded editors. -If the custom cursor is @scheme[#f], the current cursor is removed, +If the custom cursor is @racket[#f], the current cursor is removed, and a cursor is selected automatically by the editor (depending on whether the cursor is pointing at a clickback). See @method[editor<%> adjust-cursor] for more information about the default selection. @@ -2171,8 +2171,8 @@ An embedding editor's custom cursor can override the cursor of an [temporary? any/c #f]) void?]{ -Sets the filename to @scheme[filename]. If @scheme[filename] is - @scheme[#f] or @scheme[temporary?] is a true value, then the user +Sets the filename to @racket[filename]. If @racket[filename] is + @racket[#f] or @racket[temporary?] is a true value, then the user will still be prompted for a name on future calls to @method[editor<%> save-file] and @method[editor<%> load-file]. @@ -2194,7 +2194,7 @@ Sets the threshold for painting an inactive selection. See @defmethod[(set-keymap [keymap (or/c (is-a?/c keymap%) #f) #f]) void?]{ -Sets the current keymap for the editor. A @scheme[#f] argument removes +Sets the current keymap for the editor. A @racket[#f] argument removes all key mapping. } @@ -2217,7 +2217,7 @@ See also @method[editor<%> get-load-overwrites-styles] and void?]{ Sets the maximum display height for the contents of the editor. A - value less or equal to @scheme[0] indicates that there is no maximum. + value less or equal to @racket[0] indicates that there is no maximum. Setting the height is disallowed when the editor is internally locked for reflowing (see also @|lockdiscuss|). @@ -2229,8 +2229,8 @@ Setting the height is disallowed when the editor is internally locked void?]{ Sets the maximum number of undoables that will be remembered by the - editor. The default is @scheme[0], which disables undo. The symbol - @indexed-scheme['forever] is accepted as a synonym for a very large + editor. The default is @racket[0], which disables undo. The symbol + @indexed-racket['forever] is accepted as a synonym for a very large number. } @@ -2240,7 +2240,7 @@ Sets the maximum number of undoables that will be remembered by the void?]{ Sets the maximum display width for the contents of the editor; zero or - @scheme['none] indicates that there is no maximum. In a text editor, + @racket['none] indicates that there is no maximum. In a text editor, having no maximum disables automatic line breaking, and the minimum (positive) maximum width depends on the width of the autowrap bitmap. The maximum width of a text editor includes its left and @@ -2256,7 +2256,7 @@ Setting the width is disallowed when the editor is internally locked void?]{ Sets the minimum display height for the contents of the editor; zero - or @scheme['none] indicates that there is no minimum. + or @racket['none] indicates that there is no minimum. Setting the height is disallowed when the editor is internally locked for reflowing (see also @|lockdiscuss|). @@ -2267,7 +2267,7 @@ Setting the height is disallowed when the editor is internally locked void?]{ Sets the minimum display width for the contents of the editor; zero or - @scheme['none] indicates that there is no minimum. + @racket['none] indicates that there is no minimum. Setting the width is disallowed when the editor is internally locked for reflowing (see also @|lockdiscuss|). @@ -2286,20 +2286,20 @@ Sets the modified state of the editor. Usually, the state is changed See also @method[editor<%> is-modified?] and @method[editor<%> on-snip-modified]. -When @scheme[modified?] is true, then an internal modify-counter is - set to @scheme[1]. +When @racket[modified?] is true, then an internal modify-counter is + set to @racket[1]. -When @scheme[modified?] is @scheme[#f] and the editor's undo or redo +When @racket[modified?] is @racket[#f] and the editor's undo or redo stack contains a system-created undoer that resets the modified state (because the preceding undo or redo action puts the editor back to a - state where the modification state was @scheme[#f]), the undoer is + state where the modification state was @racket[#f]), the undoer is disabled. -Regardless of the value of @scheme[modified?], the editor's +Regardless of the value of @racket[modified?], the editor's adminstrator's @method[editor-admin% modified] method is called. -Finally, if @scheme[modified?] is @scheme[#f] and the internal - modify-counter is set to @scheme[0], then the @method[snip% +Finally, if @racket[modified?] is @racket[#f] and the internal + modify-counter is set to @racket[0], then the @method[snip% set-unmodified] method is called on every snip within the editor. } @@ -2396,7 +2396,7 @@ See also @method[editor<%> add-undo] . [(use-file-text-mode [on? any/c]) void?])]{ Gets or sets whether the current platform's text mode is used for -writing files in @scheme['text] or @scheme['text-force-cr] mode, which +writing files in @racket['text] or @racket['text-force-cr] mode, which affects the way that newlines are written. The setting is consulted by @method[editor<%> save-file] after @method[editor<%> on-save-file] is called. See also @method[editor<%> load-file] for information on file @@ -2419,7 +2419,7 @@ See @method[editor<%> write-headers-to-file]. @methspec{ Called when the editor is being saved to a file. The return value is - @scheme[#t] if there are no errors, @scheme[#f] otherwise. Override + @racket[#t] if there are no errors, @racket[#f] otherwise. Override this method to add custom header data to a file, but always call the inherited method so that it can write its own extra headers. @@ -2441,7 +2441,7 @@ Does nothing. boolean?]{ Writes the current editor contents to the given stream. The return - value is @scheme[#t] if there are no errors, @scheme[#f] otherwise. See + value is @racket[#t] if there are no errors, @racket[#f] otherwise. See also @|filediscuss|. If the editor's style list has already been written to the stream, it diff --git a/collects/scribblings/gui/editor-overview.scrbl b/collects/scribblings/gui/editor-overview.scrbl index ee0622ec89..c5ceca56ae 100644 --- a/collects/scribblings/gui/editor-overview.scrbl +++ b/collects/scribblings/gui/editor-overview.scrbl @@ -28,10 +28,10 @@ Both kinds of applications need an extensible editor that can handle @itemize[ - @item{@scheme[text%] --- in a @deftech{text editor}, items are + @item{@racket[text%] --- in a @deftech{text editor}, items are automatically positioned in a paragraph flow.} - @item{@scheme[pasteboard%] --- in a @deftech{pasteboard editor}, + @item{@racket[pasteboard%] --- in a @deftech{pasteboard editor}, items are explicitly positioned and dragable.} ] @@ -47,10 +47,10 @@ This editor architecture addresses the full range of real-world and the learning investment required to use it. A brief example illustrates how editors work. To start, an editor - needs an @scheme[editor-canvas%] to display its contents. Then, we + needs an @racket[editor-canvas%] to display its contents. Then, we can create a text editor and install it into the canvas: -@schemeblock[ +@racketblock[ (define f (new frame% [label "Simple Edit"] [width 200] [height 200])) @@ -65,7 +65,7 @@ At this point, the editor is fully functional: the user can type text can support all of the standard operations on an editor via the menu bar: -@schemeblock[ +@racketblock[ (define mb (new menu-bar% [parent f])) (define m-edit (new menu% [label "Edit"] [parent mb])) (define m-font (new menu% [label "Font"] [parent mb])) @@ -89,7 +89,7 @@ The content of an editor is made up of @defterm{@tech{snips}}. An on the same line. The @method[text% find-snip] method extracts a snip from a text editor: -@schemeblock[ +@racketblock[ (send t #,(:: text% find-snip) 0 'after) ] @@ -101,7 +101,7 @@ An editor is not permanently attached to any display. We can take the text editor out of our canvas and put a pasteboard editor in the canvas, instead: -@schemeblock[ +@racketblock[ (define pb (new pasteboard%)) (send c #,(:: editor-canvas% set-editor) pb) ] @@ -118,34 +118,34 @@ We can insert the old text editor (which we recently removed from the canvas) as an embedded editor in the pasteboard by explicitly creating an editor snip: -@schemeblock[ -(define s (make-object editor-snip% t)) (code:comment @#,t{@scheme[t] is the old text editor}) +@racketblock[ +(define s (make-object editor-snip% t)) (code:comment @#,t{@racket[t] is the old text editor}) (send pb #,(:: editor<%> insert) s) ] An individual snip cannot be inserted into different editors at the same time, or inserted multiple times in the same editor: -@schemeblock[ +@racketblock[ (send pb #,(:: editor<%> insert) s) (code:comment @#,t{no effect}) ] However, we can make a deep copy of the snip and insert the copy into the pasteboard: -@schemeblock[ +@racketblock[ (send pb #,(:: editor<%> insert) (send s #,(:: snip% copy))) ] Applications that use the editor classes typically derive new versions - of the @scheme[text%] and @scheme[pasteboard%] classes. For + of the @racket[text%] and @racket[pasteboard%] classes. For example, to implement an append-only editor (which allows insertions only at the end and never allows deletions), derive a new class from - @scheme[text%] and override the + @racket[text%] and override the @method[text% can-insert?] and @method[text% can-delete?] methods: -@schemeblock[ +@racketblock[ (define append-only-text% (class text% (inherit #,(:: text% last-position)) @@ -163,23 +163,23 @@ The editor toolbox supports extensible and nestable editors by @item{The @deftech{editor} itself stores the state of the text or pasteboard and handles most events and editing operations. The - @scheme[editor<%>] interface defines the core editor functionality, - but editors are created as instances of @scheme[text%] or - @scheme[pasteboard%].} + @racket[editor<%>] interface defines the core editor functionality, + but editors are created as instances of @racket[text%] or + @racket[pasteboard%].} @item{A @deftech{snip} is a segment of information within the editor. Each snip can contain a sequence of characters, a picture, or an interactive object (such as an embedded editor). In a text editor, snips are constrained to fit on a single line and generally - contain data of a single type. The @scheme[snip%] class implements a - basic snip. Other snip classes include @scheme[string-snip%] for - managing text, @scheme[image-snip%] for managing pictures, and - @scheme[editor-snip%] for managing embedded editors.} + contain data of a single type. The @racket[snip%] class implements a + basic snip. Other snip classes include @racket[string-snip%] for + managing text, @racket[image-snip%] for managing pictures, and + @racket[editor-snip%] for managing embedded editors.} @item{A @deftech{display} presents the editor on the screen. The display lets the user scroll around an editor or change editors. Most - displays are instances of the @scheme[editor-canvas%] class, but the - @scheme[editor-snip%] class also acts as a display for embedded + displays are instances of the @racket[editor-canvas%] class, but the + @racket[editor-snip%] class also acts as a display for embedded editors.} ] @@ -226,16 +226,16 @@ When an editor is drawn into a display, each snip and position has a Two extra layers of administration manage the @techlink{display}-editor and editor-snip connections. An editor never communicates directly with a @techlink{display}; instead, it always communicates with an @deftech{editor - administrator}, an instance of the @scheme[editor-admin%] class, + administrator}, an instance of the @racket[editor-admin%] class, which relays information to the @techlink{display}. Similarly, a snip communicates with a @deftech{snip administrator}, an instance of the - @scheme[snip-admin%] class. + @racket[snip-admin%] class. The administrative layers make the editor hierarchy flexible without forcing every part of an editor assembly to contain the functionality of several parts. For example, a text editor can be a single @techlink{item} within another editor; without administrators, the - @scheme[text%] class would also have to contain all the functionality + @racket[text%] class would also have to contain all the functionality of a @techlink{display} (for the containing editor) and a snip (for the embedded editor). Using administrators, an editor class can serve as both a containing and an embedded editor without directly @@ -246,9 +246,9 @@ A snip belongs to at most one editor via a single administrator. An administrator that connects the an editor to the standard @techlink{display} (i.e., an editor canvas) can work with other such administrators. In particular, the administrator of an - @scheme[editor-canvas%] (each one has its own administrator) can work - with other @scheme[editor-canvas%] administrators, allowing an editor - to be displayed in multiple @scheme[editor-canvas%] windows at the + @racket[editor-canvas%] (each one has its own administrator) can work + with other @racket[editor-canvas%] administrators, allowing an editor + to be displayed in multiple @racket[editor-canvas%] windows at the same time. When an editor is displayed by multiple canvases, one of the canvases' @@ -261,15 +261,15 @@ When an editor is displayed by multiple canvases, one of the canvases' @subsection[#:tag "editorstyles"]{Styles} -A @deftech{style}, an instance of the @scheme[style<%>] interface, +A @deftech{style}, an instance of the @racket[style<%>] interface, parameterizes high-level display information that is common to all snip classes. This includes the font, color, and alignment for drawing the item. A single style is attached to each snip. Styles are hierarchical: each style is defined in terms of another - style. @index*['("Basic style") (list @elem{@scheme["Basic"] + style. @index*['("Basic style") (list @elem{@racket["Basic"] style})]{There} is a single @deftech{root style}, named - @scheme["Basic"], from which all other styles in an editor are + @racket["Basic"], from which all other styles in an editor are derived. The difference between a base style and each of its derived style is encoded in a @deftech{style delta} (or simply @deftech{delta}). A delta encodes changes such as @@ -288,10 +288,10 @@ Styles are hierarchical: each style is defined in terms of another Style objects are never created separately; rather, they are always created through a @deftech{style list}, an instance of the - @scheme[style-list%] class. A style list manages the styles, + @racket[style-list%] class. A style list manages the styles, servicing external requests to find a particular style, and it manages the hierarchical relationship between styles. A global style - list is available, @indexed-scheme[the-style-list], but new style + list is available, @indexed-racket[the-style-list], but new style lists can be created for managing separate style hierarchies. For example, each editor will typically have its own style list. @@ -318,11 +318,11 @@ Each new style is defined in one of two ways: ] -@index*['("Standard style") (list @elem{@scheme["Standard"] +@index*['("Standard style") (list @elem{@racket["Standard"] style})]{Usually}, when text is inserted into a text editor, it inherits the style of the preceding snip. If text is inserted into an empty editor, the text is usually assigned a style called - @scheme["Standard"]. By default, the @scheme["Standard"] style is + @racket["Standard"]. By default, the @racket["Standard"] style is unmodified from the root style. The default style name can be changed by overriding @method[editor<%> default-style-name]. @@ -347,20 +347,20 @@ To allow editor content to be saved to a file, the editor classes define the format internally. The file format is the same for text and pasteboard editors. When a pasteboard saves its content to a file, it saves the snips from front to back, and also includes extra - location information. The @schememodname[wxme] library provides + location information. The @racketmodname[wxme] library provides utilities for manipulating WXME files. -Editor data is read and written using @scheme[editor-stream-in%] and -@scheme[editor-stream-out%] objects. Editor information can only be +Editor data is read and written using @racket[editor-stream-in%] and +@racket[editor-stream-out%] objects. Editor information can only be read from or written to one stream at a time. To write one or more editors to a stream, first call the function - @scheme[write-editor-global-header] to write initialization data into + @racket[write-editor-global-header] to write initialization data into an output stream. When all editors are written to the stream, call - @scheme[write-editor-global-footer]. Similarly, reading editors from - a stream is initialized with @scheme[read-editor-global-header] and - finalized with @scheme[read-editor-global-footer]. Optionally, to + @racket[write-editor-global-footer]. Similarly, reading editors from + a stream is initialized with @racket[read-editor-global-header] and + finalized with @racket[read-editor-global-footer]. Optionally, to support streams that span versions of Racket, use - @scheme[write-editor-version] and @scheme[read-editor-version] before + @racket[write-editor-version] and @racket[read-editor-version] before the header operations. The editor file data format can be embedded within another file, and @@ -390,7 +390,7 @@ Graceful and extensible encoding of snips requires that provided for each type of snip. Furthermore, a list of such decoders must be available to the high-level decoding process. This decoding mapping is defined by associating a @deftech{snip class} object to - every snip. A snip class is an instance of the @scheme[snip-class%] + every snip. A snip class is an instance of the @racket[snip-class%] class.} @item{Some editors may require additional information to be stored @@ -402,9 +402,9 @@ Graceful and extensible encoding of snips requires that @techlink{location}s needs to be maintained, but this information should not inhibit pasting into an editor. Extra data is associated with a snip through @deftech{editor data} objects, which are - instances of the @scheme[editor-data%] class; decoding requires that + instances of the @racket[editor-data%] class; decoding requires that each editor data object has an @deftech{editor data class}, which is - an instance of the @scheme[editor-data-class%] class.} + an instance of the @racket[editor-data-class%] class.} ] @@ -422,7 +422,7 @@ Each snip can be associated to a @tech{snip class}. This ``class'' Snip class objects can be added to the eventspace-specific @deftech{snip class list}, which is returned by - @scheme[get-the-snip-class-list]. When a snip is encoded, the snip's + @racket[get-the-snip-class-list]. When a snip is encoded, the snip's class name is associated with the encoding; when the snip needs to be decoded, then the snip class list is searched by name to find the snip's class. The snip class will then provide a decoding function @@ -430,24 +430,24 @@ Snip class objects can be added to the eventspace-specific If a snip class's name is of the form @;- -@scheme["((lib ...) (lib ...))"], +@racket["((lib ...) (lib ...))"], @;- then the snip class implementation can be loaded on - demand. The name is parsed using @scheme[read]; if the result has the - form @scheme[((lib _string ...) (lib _string ...))], then the first - element used with @scheme[dynamic-require] along with - @scheme['snip-class]. If the @scheme[dynamic-require] result is a - @scheme[snip-class%] object, then it is inserted into the current + demand. The name is parsed using @racket[read]; if the result has the + form @racket[((lib _string ...) (lib _string ...))], then the first + element used with @racket[dynamic-require] along with + @racket['snip-class]. If the @racket[dynamic-require] result is a + @racket[snip-class%] object, then it is inserted into the current eventspace's snip class list, and loading or saving continues using the new class. -The second @scheme[lib] form in @scheme["((lib ...) (lib ...))"] +The second @racket[lib] form in @racket["((lib ...) (lib ...))"] supplies a reader for a text-only version of the snip. See - @schememodname[wxme] for more information. + @racketmodname[wxme] for more information. -A snip class's name can also be just @scheme["(lib ...)"], which is - used like the first part of the two-@scheme[lib] form. However, this - form provides no information for the text-only @schememodname[wxme] +A snip class's name can also be just @racket["(lib ...)"], which is + used like the first part of the two-@racket[lib] form. However, this + form provides no information for the text-only @racketmodname[wxme] reader. @subsubsection[#:tag "editordata"]{Editor Data} @@ -463,21 +463,21 @@ Just as a snip must be associated with a snip class to be decoded (see @|snipclassdiscuss|), an editor data object needs an @tech{editor data class} for decoding. Every editor data class object can be added to the eventspace-specific @deftech{editor data class list}, returned - by @scheme[get-the-editor-data-class-list]. Alternatively, like snip + by @racket[get-the-editor-data-class-list]. Alternatively, like snip classes (see @secref["editorsnipclasses"]), editor data class names - can use the form @scheme["((lib ...) (lib ...))"] to enable + can use the form @racket["((lib ...) (lib ...))"] to enable on-demand loading. The corresponding module should export an - @scheme[editor-data-class%] object named @scheme['editor-data-class]. + @racket[editor-data-class%] object named @racket['editor-data-class]. To store and load information about a snip or region in an editor: @itemize[ - @item{derive new classes from @scheme[editor-data%] and - @scheme[editor-data-class%].} + @item{derive new classes from @racket[editor-data%] and + @racket[editor-data-class%].} -@item{derive a new class from the @scheme[text%] or - @scheme[pasteboard%] class, and override the @method[editor<%> +@item{derive a new class from the @racket[text%] or + @racket[pasteboard%] class, and override the @method[editor<%> get-snip-data] and @method[editor<%> set-snip-data] methods and/or the @method[text% get-region-data] and @method[text% set-region-data] methods. @@ -487,7 +487,7 @@ To store and load information about a snip or region in an editor: not for file-saving encoding; see @|globaleditordatadiscuss| for information on extending the file format.} -] +] @subsection[#:tag "globaleditordata"]{Global Data: Headers and Footers} @@ -505,8 +505,8 @@ The editor file format provides for adding extra global data in with a unique name, the file can be safely loaded in an installation that does not support the records.} - @item{Derive a new class from the @scheme[text%] or - @scheme[pasteboard%] class, and override the @method[editor<%> + @item{Derive a new class from the @racket[text%] or + @racket[pasteboard%] class, and override the @method[editor<%> write-headers-to-file], @method[editor<%> write-footers-to-file], @method[editor<%> read-header-from-file] and/or @method[editor<%> read-footer-from-file] methods.} @@ -515,8 +515,8 @@ The editor file format provides for adding extra global data in When an editor is saved, the methods @method[editor<%> write-headers-to-file] and @method[editor<%> write-footers-to-file] - are invoked; at this time, the derived @scheme[text%] or - @scheme[pasteboard%] object has a chance to save records. To write a + are invoked; at this time, the derived @racket[text%] or + @racket[pasteboard%] object has a chance to save records. To write a header/footer record, first invoke the @method[editor<%> begin-write-header-footer-to-file] method, at which point the record name is provided. Once the record is written, call @method[editor<%> @@ -548,16 +548,16 @@ For this reason, @techlink{position}-setting and the case of a @techlink{position}-setting method, the argument specifies whether the caret should be drawn at the left or right side of the page (in the event that the @techlink{location} is doubly - defined); @scheme[#t] means that the caret should be drawn on the + defined); @racket[#t] means that the caret should be drawn on the right side. Similarly, methods which calculate a @techlink{position} from a @techlink{location} will take an extra boxed boolean; the box - is filled with @scheme[#t] if the position is ambiguous and it came - from a right-side location, or @scheme[#f] otherwise. + is filled with @racket[#t] if the position is ambiguous and it came + from a right-side location, or @racket[#f] otherwise. @section[#:tag "editorflattened"]{Flattened Text} In plain text editors, there is a simple correlation between - @techlink{position}s and characters. In an @scheme[editor<%>] object, + @techlink{position}s and characters. In an @racket[editor<%>] object, this is not true much of the time, but it is still sometimes useful to just ``get the text'' of an editor. @@ -605,14 +605,14 @@ When an editor or snip is drawn, an argument to the drawing method @itemize[ - @item{@indexed-scheme['no-caret] --- The caret should not be drawn at + @item{@indexed-racket['no-caret] --- The caret should not be drawn at all.} - @item{@indexed-scheme['show-inactive-caret] --- The caret should be drawn + @item{@indexed-racket['show-inactive-caret] --- The caret should be drawn as inactive; items may be identified as the local current selection, but the keyboard focus is elsewhere.} - @item{@indexed-scheme['show-caret] --- The caret should be drawn to show + @item{@indexed-racket['show-caret] --- The caret should be drawn to show keyboard focus ownership.} @item{@racket[(cons _start _end)] --- The caret is owned by an @@ -622,24 +622,24 @@ When an editor or snip is drawn, an argument to the drawing method ] -The @scheme['show-inactive-caret] display mode is useful for showing +The @racket['show-inactive-caret] display mode is useful for showing selection ranges in text editors that do not have the focus. This - @scheme['show-inactive-caret] mode is distinct from @scheme['no-caret] + @racket['show-inactive-caret] mode is distinct from @racket['no-caret] mode; when editors are embedded, only the locally active editor shows its selection. @section[#:tag "editorcutandpastetime"]{Cut and Paste Time Stamps} -Methods of @scheme[editor<%>] that use the clipboard --- including +Methods of @racket[editor<%>] that use the clipboard --- including @method[editor<%> copy], @method[editor<%> cut], @method[editor<%> paste], and @method[editor<%> do-edit-operation] --- consume a time stamp argument. This time stamp is generally extracted from the - @scheme[mouse-event%] or @scheme[key-event%] object that triggered + @racket[mouse-event%] or @racket[key-event%] object that triggered the clipboard action. Unix uses the time stamp to synchronize clipboard operations among the clipboard clients. -All instances of @scheme[event%] include a time stamp, which can be +All instances of @racket[event%] include a time stamp, which can be obtained using @method[event% get-time-stamp]. If the time stamp is 0, it defaults to the current time. Using 0 as the @@ -649,7 +649,7 @@ If the time stamp is 0, it defaults to the current time. Using 0 as the @section[#:tag "editorclickback"]{Clickbacks} -@deftech{Clickbacks} in a @scheme[text%] editor facilitate the +@deftech{Clickbacks} in a @racket[text%] editor facilitate the creation of simple interactive objects, such as hypertext. A clickback is defined by associating a callback function with a range of @techlink{item}s in the editor. When a user clicks on the @@ -669,7 +669,7 @@ Note that there is no attempt to save clickback information when a @section[#:tag "lockinfo"]{Internal Editor Locks} -Instances of @scheme[editor<%>] have three levels of internal +Instances of @racket[editor<%>] have three levels of internal locking: @itemize[ @@ -754,7 +754,7 @@ An editor supports certain concurrent patterns ] -Thus, disabling an @scheme[editor-canvas%] object (using +Thus, disabling an @racket[editor-canvas%] object (using @method[window<%> enable]) is sufficient to ensure that a background thread can modify an editor displayed by the canvas, as long as all modifications are in edit sequences. The background diff --git a/collects/scribblings/gui/editor-snip-class.scrbl b/collects/scribblings/gui/editor-snip-class.scrbl index da98f02987..bdcc552e24 100644 --- a/collects/scribblings/gui/editor-snip-class.scrbl +++ b/collects/scribblings/gui/editor-snip-class.scrbl @@ -3,8 +3,8 @@ @defclass/title[editor-snip% snip% ()]{ -An @scheme[editor-snip%] object is a @scheme[snip%] object that - contains and displays an @scheme[editor<%>] object. This snip class +An @racket[editor-snip%] object is a @racket[snip%] object that + contains and displays an @racket[editor<%>] object. This snip class is used to insert an editor as a single @techlink{item} within another editor. @@ -24,14 +24,14 @@ An @scheme[editor-snip%] object is a @scheme[snip%] object that [min-height (or/c (and/c real? (not/c negative?)) (one-of/c 'none)) 'none] [max-height (or/c (and/c real? (not/c negative?)) (one-of/c 'none)) 'none])]{ -If @scheme[editor] is non-@scheme[#f], then it will be used as the +If @racket[editor] is non-@racket[#f], then it will be used as the editor contained by the snip. See also @method[editor-snip% set-editor]. -If @scheme[with-border?] is not @scheme[#f], then a border will be drawn +If @racket[with-border?] is not @racket[#f], then a border will be drawn around the snip. The editor display will be inset in the snip area by - the amounts specified in the @scheme[-margin] arguments. The border - will be drawn with an inset specified by the @scheme[-inset] arguments. + the amounts specified in the @racket[-margin] arguments. The border + will be drawn with an inset specified by the @racket[-inset] arguments. See @method[editor-snip% get-inset] and @method[editor-snip% get-margin] for information about the inset and margin arguments. @@ -57,8 +57,8 @@ Gets a cursor from the embedded editor by calling its @defmethod[(border-visible?) boolean?]{ -Returns @scheme[#t] if the snip has a border draw around it, -@scheme[#f] otherwise. +Returns @racket[#t] if the snip has a border draw around it, +@racket[#f] otherwise. See also @method[editor-snip% show-border]. @@ -79,7 +79,7 @@ See also @method[editor-snip% set-align-top-line]. @defmethod[(get-editor) (or/c (or/c (is-a?/c text%) (is-a?/c pasteboard%)) false/c)]{ -Returns the editor contained by the snip, or @scheme[#f] is there is +Returns the editor contained by the snip, or @racket[#f] is there is no editor. } @@ -107,11 +107,11 @@ The top space always corresponds to the space of the editor's top the descent of the top line, plus the height rest of the editor's lines, plus the snip's bottom margin. -If the editor is a text editor, then @scheme[1] is normally subtracted +If the editor is a text editor, then @racket[1] is normally subtracted from the editor's width as returned by @method[editor<%> get-extent], because the result looks better for editing. If the snip is in tight-text-fit mode (see @method[editor-snip% set-tight-text-fit]) - then @scheme[2] is subtracted from a text editor's width, eliminating + then @racket[2] is subtracted from a text editor's width, eliminating the two pixels that the text editor reserves for the blinking caret. In addition, tight-text-fit mode subtracts an amount equal to the line spacing from the editor's height. By default, tight-text-fit @@ -158,7 +158,7 @@ snip. @defmethod[(get-max-height) (or/c (and/c real? (not/c negative?)) (one-of/c 'none))]{ -Gets the maximum display height of the snip; zero or @scheme['none] +Gets the maximum display height of the snip; zero or @racket['none] indicates that there is no maximum. } @@ -167,7 +167,7 @@ Gets the maximum display height of the snip; zero or @scheme['none] @defmethod[(get-max-width) (or/c (and/c real? (not/c negative?)) (one-of/c 'none))]{ -Gets the maximum display width of the snip; zero or @scheme['none] +Gets the maximum display width of the snip; zero or @racket['none] indicates that there is no maximum. } @@ -175,7 +175,7 @@ Gets the maximum display width of the snip; zero or @scheme['none] @defmethod[(get-min-height) (or/c (and/c real? (not/c negative?)) (one-of/c 'none))]{ -Gets the minimum display height of the snip; zero or @scheme['none] +Gets the minimum display height of the snip; zero or @racket['none] indicates that there is no minimum. } @@ -183,7 +183,7 @@ Gets the minimum display height of the snip; zero or @scheme['none] @defmethod[(get-min-width) (or/c (and/c real? (not/c negative?)) (one-of/c 'none))]{ -Gets the minimum display width of the snip; zero or @scheme['none] +Gets the minimum display width of the snip; zero or @racket['none] indicates that there is no minimum. } @@ -233,14 +233,14 @@ Sets the editor contained by the snip, releasing the old editor in the snip (if any). If the new editor already has an administrator, then the new editor is @italic{not} installed into the snip. -When an @scheme[editor-snip%] object is not inserted in an editor, it +When an @racket[editor-snip%] object is not inserted in an editor, it does not have an administrator. During this time, it does not give its contained editor an administrator, either. The administratorless contained editor can therefore ``defect'' to some other @techlink{display} with an administrator. When a contained editor defects and the snip is eventually inserted into a different editor, the snip drops the traitor contained editor, setting its contained - editor to @scheme[#f]. + editor to @racket[#f]. } @@ -273,7 +273,7 @@ Sets the current margins for the snip. The margin sets how much space @edsnipmax[(scheme height)] -Zero or @scheme['none] disables the limit. +Zero or @racket['none] disables the limit. } @@ -283,7 +283,7 @@ Zero or @scheme['none] disables the limit. @edsnipmax[(scheme width)] The contained editor's width limits are not changed by this method. -Zero or @scheme['none] disables the limit. +Zero or @racket['none] disables the limit. } @@ -292,7 +292,7 @@ Zero or @scheme['none] disables the limit. @edsnipmin[(scheme height) @elem{top}] -Zero or @scheme['none] disables the limit. +Zero or @racket['none] disables the limit. } @@ -302,7 +302,7 @@ Zero or @scheme['none] disables the limit. @edsnipmin[(scheme width) @elem{left}] The contained editor's width limits are not changed by this method. -Zero or @scheme['none] disables the limit. +Zero or @racket['none] disables the limit. } @@ -327,8 +327,8 @@ Shows or hides the snip's border. @defmethod[(style-background-used?) boolean?]{ -Returns @scheme[#t] if the snip uses its style's background and - transparency information when drawing, @scheme[#f] otherwise. +Returns @racket[#t] if the snip uses its style's background and + transparency information when drawing, @racket[#f] otherwise. See also @method[editor-snip% use-style-background]. @@ -342,7 +342,7 @@ Causes the snip to use or not used (the default) its style's background and transparency information for drawing the background within the snip's border. -If @scheme[use?] is @scheme[#f], the style background and transparency +If @racket[use?] is @racket[#f], the style background and transparency information is ignored, otherwise is it used. }} diff --git a/collects/scribblings/gui/editor-snip-editor-admin-intf.scrbl b/collects/scribblings/gui/editor-snip-editor-admin-intf.scrbl index 91c44f2f13..fae19d48aa 100644 --- a/collects/scribblings/gui/editor-snip-editor-admin-intf.scrbl +++ b/collects/scribblings/gui/editor-snip-editor-admin-intf.scrbl @@ -4,7 +4,7 @@ @definterface/title[editor-snip-editor-admin<%> ()]{ An instance of this administrator interface is created with each - @scheme[editor-snip%] object; new instances cannot be + @racket[editor-snip%] object; new instances cannot be created directly. diff --git a/collects/scribblings/gui/editor-stream-in-base-class.scrbl b/collects/scribblings/gui/editor-stream-in-base-class.scrbl index e4bf359ffe..3cf829b13d 100644 --- a/collects/scribblings/gui/editor-stream-in-base-class.scrbl +++ b/collects/scribblings/gui/editor-stream-in-base-class.scrbl @@ -3,12 +3,12 @@ @defclass/title[editor-stream-in-base% object% ()]{ -An @scheme[editor-stream-in-base%] object is used by an - @scheme[editor-stream-in%] object to perform low-level reading of +An @racket[editor-stream-in-base%] object is used by an + @racket[editor-stream-in%] object to perform low-level reading of data. -The @scheme[editor-stream-in-base%] class is never instantiated - directly, but the derived class @scheme[editor-stream-in-bytes-base%] +The @racket[editor-stream-in-base%] class is never instantiated + directly, but the derived class @racket[editor-stream-in-bytes-base%] can be instantiated. New derived classes must override all of the methods described in this section. @@ -16,8 +16,8 @@ The @scheme[editor-stream-in-base%] class is never instantiated @defmethod[(bad?) boolean?]{ -Returns @scheme[#t] if there has been an error reading from the - stream, @scheme[#f] otherwise. +Returns @racket[#t] if there has been an error reading from the + stream, @racket[#f] otherwise. } @@ -35,11 +35,11 @@ Reads bytes to fill the supplied byte string. The return value is the number of bytes read, which may be less than the number requested if the stream is emptied. If the stream is emptied, the next call to @method[editor-stream-in-base% bad?] must return - @scheme[#t].} + @racket[#t].} @defmethod[(read-byte) (or/c byte? #f)]{ -Reads a single byte and return it, or returns @scheme[#f] if no more +Reads a single byte and return it, or returns @racket[#f] if no more bytes are available. The default implementation of this method uses @method[editor-stream-in-base% read-bytes]. @@ -55,7 +55,7 @@ Moves to the specified absolute position in the stream. @defmethod[(skip [n exact-nonnegative-integer?]) void?]{ -Skips past the next @scheme[n] characters in the stream. +Skips past the next @racket[n] characters in the stream. } diff --git a/collects/scribblings/gui/editor-stream-in-bytes-base-class.scrbl b/collects/scribblings/gui/editor-stream-in-bytes-base-class.scrbl index ec14a027a4..1fe3da2040 100644 --- a/collects/scribblings/gui/editor-stream-in-bytes-base-class.scrbl +++ b/collects/scribblings/gui/editor-stream-in-bytes-base-class.scrbl @@ -3,12 +3,12 @@ @defclass/title[editor-stream-in-bytes-base% editor-stream-in-base% ()]{ -An @scheme[editor-stream-in-bytes-base%] object can be used to +An @racket[editor-stream-in-bytes-base%] object can be used to read editor data from a byte string. @defconstructor/make[([s bytes?])]{ -Creates a stream base that reads from @scheme[s]. +Creates a stream base that reads from @racket[s]. }} diff --git a/collects/scribblings/gui/editor-stream-in-class.scrbl b/collects/scribblings/gui/editor-stream-in-class.scrbl index 2ab89e5d86..7ff9d2bc38 100644 --- a/collects/scribblings/gui/editor-stream-in-class.scrbl +++ b/collects/scribblings/gui/editor-stream-in-class.scrbl @@ -3,7 +3,7 @@ @defclass/title[editor-stream-in% object% ()]{ -An @scheme[editor-stream-in%] object is used to read editor +An @racket[editor-stream-in%] object is used to read editor information from a file or other input stream (such as the clipboard). @@ -11,8 +11,8 @@ An @scheme[editor-stream-in%] object is used to read editor @defconstructor/make[([base (is-a?/c editor-stream-in-base%)])]{ -An in-stream base---possibly an @scheme[editor-stream-in-bytes-base%] - object---must be supplied in @scheme[base]. +An in-stream base---possibly an @racket[editor-stream-in-bytes-base%] + object---must be supplied in @racket[base]. } @@ -23,7 +23,7 @@ An in-stream base---possibly an @scheme[editor-stream-in-bytes-base%] (is-a?/c editor-stream-in%)])]{ Reads data from the stream, returning itself. -Reading from a bad stream always gives @scheme[0]. +Reading from a bad stream always gives @racket[0]. @boxisfill[(scheme v) @elem{the next integer or floating-point value in the stream}] @@ -64,7 +64,7 @@ Returns the next integer value in the stream. Gets a fixed-sized integer from the stream. See @method[editor-stream-out% put-fixed] for more information. -Reading from a bad stream always gives @scheme[0]. +Reading from a bad stream always gives @racket[0]. } @@ -84,7 +84,7 @@ use @method[editor-stream-out% put] with two arguments (passing along the length of the bytes) to write out the bytes to match this method. -Reading from a bad stream returns @scheme[#f] or @scheme[#""]. +Reading from a bad stream returns @racket[#f] or @racket[#""]. Note that when @method[editor-stream-out% put] is not given a byte length, it includes an extra byte for a nul terminator; use @@ -104,8 +104,8 @@ Jumps to a given position in the stream. @defmethod[(ok?) boolean?]{ -Returns @scheme[#t] if the stream is ready for reading, @scheme[#f] otherwise. -Reading from a bad stream always returns @scheme[0] or @scheme[""]. +Returns @racket[#t] if the stream is ready for reading, @racket[#f] otherwise. +Reading from a bad stream always returns @racket[0] or @racket[""]. } @@ -119,7 +119,7 @@ See @method[editor-stream-in% set-boundary]. @defmethod[(set-boundary [n exact-nonnegative-integer?]) void?]{ -Sets a file-reading boundary at @scheme[n] bytes past the current +Sets a file-reading boundary at @racket[n] bytes past the current stream location. If there is an attempt to read past this boundary, an error is signaled. The boundary is removed with a call to @method[editor-stream-in% remove-boundary]. Every call to @@ -136,7 +136,7 @@ Boundaries help keep a subroutine from reading too much data leading @defmethod[(skip [n exact-nonnegative-integer?]) void?]{ -Skips past the next @scheme[n] bytes in the stream. +Skips past the next @racket[n] bytes in the stream. } diff --git a/collects/scribblings/gui/editor-stream-out-base-class.scrbl b/collects/scribblings/gui/editor-stream-out-base-class.scrbl index 58fe7ad8e6..41193d668b 100644 --- a/collects/scribblings/gui/editor-stream-out-base-class.scrbl +++ b/collects/scribblings/gui/editor-stream-out-base-class.scrbl @@ -3,13 +3,13 @@ @defclass/title[editor-stream-out-base% object% ()]{ -An @scheme[editor-stream-out-base%] object is used by an - @scheme[editor-stream-out%] object to perform low-level writing of +An @racket[editor-stream-out-base%] object is used by an + @racket[editor-stream-out%] object to perform low-level writing of data. -The @scheme[editor-stream-out-base%] class is never instantiated +The @racket[editor-stream-out-base%] class is never instantiated directly, but the derived class - @scheme[editor-stream-out-bytes-base%] can be instantiated. New + @racket[editor-stream-out-bytes-base%] can be instantiated. New derived classes must override all of the methods described in this section. @@ -17,8 +17,8 @@ The @scheme[editor-stream-out-base%] class is never instantiated @defmethod[(bad?) boolean?]{ -Returns @scheme[#t] if there has been an error writing to the stream, - @scheme[#f] otherwise. +Returns @racket[#t] if there has been an error writing to the stream, + @racket[#f] otherwise. } diff --git a/collects/scribblings/gui/editor-stream-out-bytes-base-class.scrbl b/collects/scribblings/gui/editor-stream-out-bytes-base-class.scrbl index df5599dbf8..bcd0867dd4 100644 --- a/collects/scribblings/gui/editor-stream-out-bytes-base-class.scrbl +++ b/collects/scribblings/gui/editor-stream-out-bytes-base-class.scrbl @@ -3,7 +3,7 @@ @defclass/title[editor-stream-out-bytes-base% editor-stream-out-base% ()]{ -An @scheme[editor-stream-out-bytes-base%] object can be used to write +An @racket[editor-stream-out-bytes-base%] object can be used to write editor data into a byte string. @defconstructor[()]{ diff --git a/collects/scribblings/gui/editor-stream-out-class.scrbl b/collects/scribblings/gui/editor-stream-out-class.scrbl index dcfccb7ee6..f15cd4be37 100644 --- a/collects/scribblings/gui/editor-stream-out-class.scrbl +++ b/collects/scribblings/gui/editor-stream-out-class.scrbl @@ -3,7 +3,7 @@ @defclass/title[editor-stream-out% object% ()]{ -An @scheme[editor-stream-out%] object is used to write editor +An @racket[editor-stream-out%] object is used to write editor information to a file or other output stream (such as the clipboard). @@ -12,9 +12,8 @@ An @scheme[editor-stream-out%] object is used to write editor @defconstructor/make[([base (is-a?/c editor-stream-out-base%)])]{ An out-stream base---possibly an -@scheme[editor-stream-out-bytes-base%] object---must be supplied in -@scheme[base]. - +@racket[editor-stream-out-bytes-base%] object---must be supplied in +@racket[base]. } @@ -26,7 +25,7 @@ Jumps to a given position in the stream. @defmethod[(ok?) boolean?]{ -Returns @scheme[#t] if the stream is ready for writing, @scheme[#f] otherwise. +Returns @racket[#t] if the stream is ready for writing, @racket[#f] otherwise. Writing to a bad stream has no effect. } @@ -36,7 +35,7 @@ Writing to a bad stream has no effect. Ensures that the stream ends with a newline. This method is called by -@scheme[write-editor-global-footer]. +@racket[write-editor-global-footer]. } @@ -45,7 +44,7 @@ This method is called by void?]{ Writes a ``comment'' into the stream that identifies the file format. -This method is called by @scheme[write-editor-global-header]. +This method is called by @racket[write-editor-global-header]. } @@ -60,17 +59,17 @@ This method is called by @scheme[write-editor-global-header]. (is-a?/c editor-stream-out%)])]{ -Writes @scheme[v], or @scheme[n] bytes of @scheme[v]. +Writes @racket[v], or @racket[n] bytes of @racket[v]. -When @scheme[n] is supplied with a byte-string @scheme[v], use +When @racket[n] is supplied with a byte-string @racket[v], use @method[editor-stream-in% get-unterminated-bytes] to read the bytes later. This is the recommended way to write out bytes to be easily read in later; use @method[editor-stream-in% get-unterminated-bytes] to read the bytes back in. -If @scheme[n] is not supplied and @scheme[v] is a byte string, then +If @racket[n] is not supplied and @racket[v] is a byte string, then for historical reasons, the actual number of bytes written includes a - @scheme[#\nul] terminator, so use @method[editor-stream-in% + @racket[#\nul] terminator, so use @method[editor-stream-in% get-bytes] instead of @method[editor-stream-in% get-unterminated-bytes] to read the bytes later. @@ -83,8 +82,8 @@ If @scheme[n] is not supplied and @scheme[v] is a byte string, then Puts a fixed-sized integer into the stream. This method is needed because numbers are usually written in a way that takes varying numbers of bytes. In some cases it is useful to temporary write a - @scheme[0] to a stream, write more data, and then go back and change - the @scheme[0] to another number; such a process requires a + @racket[0] to a stream, write more data, and then go back and change + the @racket[0] to another number; such a process requires a fixed-size number. Numbers written to a stream with @method[editor-stream-out% put-fixed] @@ -95,7 +94,7 @@ Numbers written to a stream with @method[editor-stream-out% put-fixed] @defmethod[(put-unterminated [v bytes?]) (is-a?/c editor-stream-out%)]{ The same as calling @method[editor-stream-out% put] with -@scheme[(bytes-length v)] and @scheme[v].} +@racket[(bytes-length v)] and @racket[v].} @defmethod[(tell) diff --git a/collects/scribblings/gui/editor-wordbreak-map-class.scrbl b/collects/scribblings/gui/editor-wordbreak-map-class.scrbl index 6bd2b67c16..93078362ce 100644 --- a/collects/scribblings/gui/editor-wordbreak-map-class.scrbl +++ b/collects/scribblings/gui/editor-wordbreak-map-class.scrbl @@ -3,30 +3,30 @@ @defclass/title[editor-wordbreak-map% object% ()]{ -An @scheme[editor-wordbreak-map%] objects is used with a - @scheme[text%] objects to specify word-breaking criteria for the +An @racket[editor-wordbreak-map%] objects is used with a + @racket[text%] objects to specify word-breaking criteria for the default wordbreaking function. See also @method[text% set-wordbreak-map], @method[text% get-wordbreak-map], @method[text% find-wordbreak], and @method[text% set-wordbreak-func]. -A global object @scheme[the-editor-wordbreak-map] is created - automatically and used as the default map for all @scheme[text%] +A global object @racket[the-editor-wordbreak-map] is created + automatically and used as the default map for all @racket[text%] objects. A wordbreak objects implements a mapping from each character to a list of symbols. The following symbols are legal elements of the list: @itemize[ -@item{@indexed-scheme['caret]} -@item{@indexed-scheme['line]} -@item{@indexed-scheme['selection]} -@item{@indexed-scheme['user1]} -@item{@indexed-scheme['user2]} +@item{@indexed-racket['caret]} +@item{@indexed-racket['line]} +@item{@indexed-racket['selection]} +@item{@indexed-racket['user1]} +@item{@indexed-racket['user2]} ] The presence of a flag in a character's value indicates that the character does not break a word when searching for breaks using the - corresponding reason. For example, if @scheme['caret] is present, + corresponding reason. For example, if @racket['caret] is present, then the character is a non-breaking character for caret-movement words. (Each stream of non-breaking characters is a single word.) @@ -35,18 +35,18 @@ The presence of a flag in a character's value indicates that the @defconstructor[()]{ All ASCII alpha-numeric characters are initialized with - @scheme['(caret line selection)]. All other ASCII non-whitespace + @racket['(caret line selection)]. All other ASCII non-whitespace characters except @litchar{-} are initialized with - @scheme['(line)]. All ASCII whitespace characters and @litchar{-} are - initialized with @scheme[null]. + @racket['(line)]. All ASCII whitespace characters and @litchar{-} are + initialized with @racket[null]. } @defmethod[(get-map [char char?]) (listof (one-of/c 'caret 'line 'selection 'user1 'user2))]{ -Gets the mapping value for @scheme[char]. See -@scheme[editor-wordbreak-map%] for more information. +Gets the mapping value for @racket[char]. See +@racket[editor-wordbreak-map%] for more information. } @@ -55,8 +55,8 @@ Gets the mapping value for @scheme[char]. See void?]{ -Sets the mapping value for @scheme[char] to @scheme[value]. See -@scheme[editor-wordbreak-map%] for more information. +Sets the mapping value for @racket[char] to @racket[value]. See +@racket[editor-wordbreak-map%] for more information. }} diff --git a/collects/scribblings/gui/event-class.scrbl b/collects/scribblings/gui/event-class.scrbl index b21dfd727b..822c9c53cb 100644 --- a/collects/scribblings/gui/event-class.scrbl +++ b/collects/scribblings/gui/event-class.scrbl @@ -3,18 +3,18 @@ @defclass/title[event% object% ()]{ -An @scheme[event%] object contains information about a control, +An @racket[event%] object contains information about a control, keyboard, mouse, or scroll event. See also -@scheme[control-event%], -@scheme[key-event%], -@scheme[mouse-event%], and -@scheme[scroll-event%]. +@racket[control-event%], +@racket[key-event%], +@racket[mouse-event%], and +@racket[scroll-event%]. @defconstructor[([time-stamp exact-integer? 0])]{ See @method[event% get-time-stamp] for information about - @scheme[time-stamp]. + @racket[time-stamp]. } @@ -23,7 +23,7 @@ See @method[event% get-time-stamp] for information about Returns the time, in milliseconds, when the event occurred. This time is compatible with times reported by Racket's - @scheme[current-milliseconds] procedure. + @racket[current-milliseconds] procedure. } @@ -31,7 +31,7 @@ Returns the time, in milliseconds, when the event occurred. This time void?]{ Set the time, in milliseconds, when the event occurred. See also - Racket's @scheme[current-milliseconds]. + Racket's @racket[current-milliseconds]. If the supplied value is outside the platform-specific range of time values, @|MismatchExn|. diff --git a/collects/scribblings/gui/eventspace-funcs.scrbl b/collects/scribblings/gui/eventspace-funcs.scrbl index d9ec93671e..a5f04987fb 100644 --- a/collects/scribblings/gui/eventspace-funcs.scrbl +++ b/collects/scribblings/gui/eventspace-funcs.scrbl @@ -8,7 +8,7 @@ Creates and returns a new eventspace value. The new eventspace is created as a child of the current eventspace. The eventspace is used by making it the current eventspace with the - @scheme[current-eventspace] parameter. + @racket[current-eventspace] parameter. See @|eventspacediscuss| for more information about eventspaces. @@ -26,7 +26,7 @@ See @|eventspacediscuss| for more information about eventspaces. @defproc[(eventspace? [v any/c]) boolean?]{ -Returns @scheme[#t] if @scheme[v] is an eventspace value or @scheme[#f] +Returns @racket[#t] if @racket[v] is an eventspace value or @racket[#f] otherwise. See @|eventspacediscuss| for more information about eventspaces. @@ -64,8 +64,8 @@ result event is ready when @racket[(yield)] for the eventspace boolean?]{ Inspects the event queue of the current eventspace, searching for a Shift-Ctl-C (Unix, Windows) or Cmd-. (Mac OS X) key combination. Returns - @scheme[#t] if such an event was found (and the event is dequeued) or - @scheme[#f] otherwise. + @racket[#t] if such an event was found (and the event is dequeued) or + @racket[#f] otherwise. } @@ -80,7 +80,7 @@ Returns a list of visible top-level frames and dialogs in the current (or/c (is-a?/c frame%) (is-a?/c dialog%) false/c)]{ Returns the top level window in the current eventspace that has the keyboard focus (or contains the window with the keyboard focus), or - @scheme[#f] if no window in the current eventspace has the focus. + @racket[#f] if no window in the current eventspace has the focus. } @@ -88,7 +88,7 @@ Returns the top level window in the current eventspace that has the (or/c (is-a?/c frame%) (is-a?/c dialog%) false/c)]{ Returns the top level window in the current eventspace that is visible and most recently had the keyboard focus (or contains the window that - had the keyboard focus), or @scheme[#f] if there is no visible window + had the keyboard focus), or @racket[#f] if there is no visible window in the current eventspace. } @@ -104,12 +104,12 @@ Enables or disables special Control key handling (Mac OS X). When Control Control key presses must be seen by the system translation, so this mode should be turned off, but the default is on. -If @scheme[on?] is provided and @scheme[#f], Control is passed to the system +If @racket[on?] is provided and @racket[#f], Control is passed to the system translation as normal. This setting affects all windows and eventspaces. -If no argument is provided, the result is @scheme[#t] if Control is -currently treated specially, @scheme[#f] otherwise. +If no argument is provided, the result is @racket[#t] if Control is +currently treated specially, @racket[#f] otherwise. } @@ -122,12 +122,12 @@ Enables or disables special Option key handling (Mac OS X). When without Option for keyboard translations. By default, Option is not special. -If @scheme[on?] is provided @scheme[#f], Option is passed to the +If @racket[on?] is provided @racket[#f], Option is passed to the system translation as normal. This setting affects all windows and eventspaces. -If no argument is provided, the result is @scheme[#t] if Option is - currently treated specially, @scheme[#f] otherwise. +If no argument is provided, the result is @racket[#t] if Option is + currently treated specially, @racket[#f] otherwise. } @defproc[(queue-callback [callback (-> any)] @@ -152,20 +152,19 @@ Yields control to event dispatching. See @secref["eventspaceinfo"] for details. A handler procedure invoked by the system during a call to - @scheme[yield] can itself call @scheme[yield], creating + @racket[yield] can itself call @racket[yield], creating an additional level of nested (but single-threaded) event handling. -See also -@scheme[sleep/yield] . +See also @racket[sleep/yield]. -If no argument is provided, @scheme[yield] dispatches an unspecified +If no argument is provided, @racket[yield] dispatches an unspecified number of events, but only if the current thread is the current eventspace's handler thread (otherwise, there is no effect). The - result is @scheme[#t] if any events may have been handled, - @scheme[#f] otherwise. + result is @racket[#t] if any events may have been handled, + @racket[#f] otherwise. -If @scheme[v] is @indexed-scheme['wait], and @scheme[yield] is called - in the handler thread of an eventspace, then @scheme[yield] starts +If @racket[v] is @indexed-racket['wait], and @racket[yield] is called + in the handler thread of an eventspace, then @racket[yield] starts processing events in that eventspace until @itemize[ @@ -176,54 +175,54 @@ If @scheme[v] is @indexed-scheme['wait], and @scheme[yield] is called @item{no callbacks are queued in the eventspace; and} - @item{no @scheme[menu-bar%] has been created for the eventspace - with @scheme['root] (i.e., creating a @scheme['root] menu bar + @item{no @racket[menu-bar%] has been created for the eventspace + with @racket['root] (i.e., creating a @racket['root] menu bar prevents an eventspace from ever unblocking).} ] -When called in a non-handler thread, @scheme[yield] returns - immediately. In either case, the result is @scheme[#t]. +When called in a non-handler thread, @racket[yield] returns + immediately. In either case, the result is @racket[#t]. -Evaluating @scheme[(yield 'wait)] is thus similar to - @scheme[(yield (current-eventspace))], except that it is +Evaluating @racket[(yield 'wait)] is thus similar to + @racket[(yield (current-eventspace))], except that it is sensitive to whether the current thread is a handler thread, instead - of the value of the @scheme[current-eventspace] parameter. + of the value of the @racket[current-eventspace] parameter. -If @scheme[v] is an event in Racket's sense (not to be confused with - a GUI event), @scheme[yield] blocks on @scheme[v] in the same way as - @scheme[sync], except that it may start a @scheme[sync] on @scheme[v] - multiple times (but it will complete a @scheme[sync] on @scheme[v] at +If @racket[v] is an event in Racket's sense (not to be confused with + a GUI event), @racket[yield] blocks on @racket[v] in the same way as + @racket[sync], except that it may start a @racket[sync] on @racket[v] + multiple times (but it will complete a @racket[sync] on @racket[v] at most one time). If the current thread is the current eventspace's - handler thread, events are dispatched until a @scheme[v] sync + handler thread, events are dispatched until a @racket[v] sync succeeds on an event boundary. For other threads, calling - @scheme[yield] with a Racket event is equivalent to calling - @scheme[sync]. In either case, the result is the same that of - @scheme[sync]; however, if a wrapper procedure is associated with - @scheme[v] via @scheme[handle-evt], it is not called in tail position - with respect to the @scheme[yield]. + @racket[yield] with a Racket event is equivalent to calling + @racket[sync]. In either case, the result is the same that of + @racket[sync]; however, if a wrapper procedure is associated with + @racket[v] via @racket[handle-evt], it is not called in tail position + with respect to the @racket[yield]. -Always use @scheme[(yield v)] instead of a busy-wait loop. +Always use @racket[(yield v)] instead of a busy-wait loop. } @defproc[(sleep/yield [secs (and/c real? (not/c negative?))]) void?]{ Blocks for at least the specified number of seconds, handling events meanwhile if the current thread is the current eventspace's handler - thread (otherwise, @scheme[sleep/yield] is equivalent to - @scheme[sleep]). + thread (otherwise, @racket[sleep/yield] is equivalent to + @racket[sleep]). } @defproc[(eventspace-shutdown? [e eventspace?]) boolean?]{ -Returns @scheme[#t] if the given eventspace has been shut down by its - custodian, @scheme[#f] otherwise. Attempting to create a new window, +Returns @racket[#t] if the given eventspace has been shut down by its + custodian, @racket[#f] otherwise. Attempting to create a new window, timer, or explicitly queued event in a shut-down eventspace raises - the @scheme[exn:misc] exception. + the @racket[exn:misc] exception. Attempting to use certain methods of windows and timers in a shut-down - eventspace also raises the @scheme[exn:misc] exception, but the + eventspace also raises the @racket[exn:misc] exception, but the @xmethod[area<%> get-top-level-window] and @xmethod[top-level-window<%> get-eventspace] methods work even after the area's eventspace is shut down. @@ -233,11 +232,6 @@ Attempting to use certain methods of windows and timers in a shut-down (or/c thread? #f)]{ Returns the handler thread of the given eventspace. If the handler thread has terminated (e.g., because the eventspace was shut down), the - result is @scheme[#f]. - - - - - + result is @racket[#f]. } diff --git a/collects/scribblings/gui/font-funcs.scrbl b/collects/scribblings/gui/font-funcs.scrbl index cf77acb498..ee67771caf 100644 --- a/collects/scribblings/gui/font-funcs.scrbl +++ b/collects/scribblings/gui/font-funcs.scrbl @@ -5,32 +5,31 @@ @defthing[menu-control-font (is-a?/c font%)]{ -This font is the default for @scheme[popup-menu%] objects. +This font is the default for @racket[popup-menu%] objects. On Mac OS X, this font is slightly larger than - @scheme[normal-control-font]. On Windows and Unix, it is the same - size as @scheme[normal-control-font]. + @racket[normal-control-font]. On Windows and Unix, it is the same + size as @racket[normal-control-font]. } @defthing[normal-control-font (is-a?/c font%)]{ This font is the default for most controls, except - @scheme[list-box%] and @scheme[group-box-panel%] objects. - + @racket[list-box%] and @racket[group-box-panel%] objects. } @defthing[small-control-font (is-a?/c font%)]{ -This font is the default for @scheme[group-box-panel%] objects, and it is +This font is the default for @racket[group-box-panel%] objects, and it is a suitable for controls in a floating window and other contexts that need smaller controls. On Windows, this font is the same size as - @scheme[normal-control-font], since the Windows control font is + @racket[normal-control-font], since the Windows control font is already relatively small. On Unix and Mac OS X, this font is slightly - smaller than @scheme[normal-control-font]. + smaller than @racket[normal-control-font]. } @@ -38,18 +37,18 @@ On Windows, this font is the same size as @defthing[tiny-control-font (is-a?/c font%)]{ This font is for tiny controls, and it is smaller than - @scheme[small-control-font] on all platforms. + @racket[small-control-font] on all platforms. } @defthing[view-control-font (is-a?/c font%)]{ -This font is the default for @scheme[list-box%] objects (but not - list box labels, which use @scheme[normal-control-font]). +This font is the default for @racket[list-box%] objects (but not + list box labels, which use @racket[normal-control-font]). On Mac OS X, this font is slightly smaller than - @scheme[normal-control-font], and slightly larger than - @scheme[small-control-font]. On Windows and Unix, it is the same size - as @scheme[normal-control-font]. + @racket[normal-control-font], and slightly larger than + @racket[small-control-font]. On Windows and Unix, it is the same size + as @racket[normal-control-font]. } diff --git a/collects/scribblings/gui/frame-class.scrbl b/collects/scribblings/gui/frame-class.scrbl index b54b88c661..b7f14107f7 100644 --- a/collects/scribblings/gui/frame-class.scrbl +++ b/collects/scribblings/gui/frame-class.scrbl @@ -31,83 +31,83 @@ On Windows, both Multiple Document Interface (MDI) and Single [stretchable-width any/c #t] [stretchable-height any/c #t])]{ -The @scheme[label] string is displayed in the frame's title +The @racket[label] string is displayed in the frame's title bar. If the frame's label is changed (see @method[window<%> set-label]), the title bar is updated. -The @scheme[parent] argument can be @scheme[#f] or an existing -frame. On Windows, if @scheme[parent] is an existing frame, +The @racket[parent] argument can be @racket[#f] or an existing +frame. On Windows, if @racket[parent] is an existing frame, the new frame is always on top of its parent. Also, the -@scheme[parent] frame may be an MDI parent frame from a new MDI +@racket[parent] frame may be an MDI parent frame from a new MDI child frame. On Windows and Unix (for many window managers), a frame is iconized when its parent is iconized. -If @scheme[parent] is @scheme[#f], then the eventspace for the +If @racket[parent] is @racket[#f], then the eventspace for the new frame is the current eventspace, as determined by -@scheme[current-eventspace]. Otherwise, @scheme[parent]'s +@racket[current-eventspace]. Otherwise, @racket[parent]'s eventspace is the new frame's eventspace. -If the @scheme[width] or @scheme[height] argument is not -@scheme[#f], it specifies an initial size for the frame (in +If the @racket[width] or @racket[height] argument is not +@racket[#f], it specifies an initial size for the frame (in pixels) assuming that it is larger than the minimum size, otherwise the minimum size is used. -If the @scheme[x] or @scheme[y] argument is not @scheme[#f], it +If the @racket[x] or @racket[y] argument is not @racket[#f], it specifies an initial location for the frame. Otherwise, a location is selected automatically (tiling frames and dialogs as they are created). -The @scheme[style] flags adjust the appearance of the frame on +The @racket[style] flags adjust the appearance of the frame on some platforms: @itemize[ - @item{@scheme['no-resize-border] --- omits the resizeable border + @item{@racket['no-resize-border] --- omits the resizeable border around the window (Windows, Unix) or grow box in the bottom right corner (Mac OS X)} - @item{@scheme['no-caption] --- omits the title bar for the frame + @item{@racket['no-caption] --- omits the title bar for the frame (Windows, Mac OS X, Unix)} - @item{@scheme['no-system-menu] --- omits the system menu + @item{@racket['no-system-menu] --- omits the system menu (Windows)} - @item{@scheme['mdi-child] --- creates the frame as a MDI + @item{@racket['mdi-child] --- creates the frame as a MDI (multiple document interface) child frame, mutually exclusive with - @scheme['mdi-parent] (Windows)} + @racket['mdi-parent] (Windows)} - @item{@scheme['mdi-parent] --- creates the frame as a MDI + @item{@racket['mdi-parent] --- creates the frame as a MDI (multiple document interface) parent frame, mutually exclusive with - @scheme['mdi-child] (Windows)} + @racket['mdi-child] (Windows)} - @item{@scheme['toolbar-button] --- includes a toolbar button on the + @item{@racket['toolbar-button] --- includes a toolbar button on the frame's title bar (Mac OS X); a click on the toolbar button triggers a call to @method[frame% on-toolbar-button-click]} - @item{@scheme['hide-menu-bar] --- hides the menu bar and dock when + @item{@racket['hide-menu-bar] --- hides the menu bar and dock when the frame is active (Mac OS X) or asks the window manager to make the frame fullscreen (Unix)} - @item{@scheme['float] --- causes the frame to stay in front of all + @item{@racket['float] --- causes the frame to stay in front of all other non-floating windows (Windows, Mac OS X, Unix); on Mac OS X, a floating frame shares the focus with an active non-floating frame; when this style - is combined with @scheme['no-caption], then showing the frame does + is combined with @racket['no-caption], then showing the frame does not cause the keyboard focus to shift to the window, and on Unix, clicking the frame does not move the focus; on Windows, a floating frame has no taskbar button} - @item{@scheme['metal] --- ignored (formerly supported for Mac OS X)} + @item{@racket['metal] --- ignored (formerly supported for Mac OS X)} ] -If the @scheme['mdi-child] style is specified, the @scheme[parent] must be - a frame with the @scheme['mdi-parent] style, otherwise @|MismatchExn|. +If the @racket['mdi-child] style is specified, the @racket[parent] must be + a frame with the @racket['mdi-parent] style, otherwise @|MismatchExn|. Even if the frame is not shown, a few notification events may be queued for the frame on creation. Consequently, the new frame's resources (e.g., memory) cannot be reclaimed until some events are handled, or the frame's eventspace is shut down. -@WindowKWs[@scheme[enabled]] @AreaContKWs[] @AreaKWs[] +@WindowKWs[@racket[enabled]] @AreaContKWs[] @AreaKWs[] } @@ -126,7 +126,7 @@ See also @method[frame% set-status-text]. @defmethod[(get-menu-bar) (or/c (is-a?/c menu-bar%) false/c)]{ -Returns the frame's menu bar, or @scheme[#f] if none has been created +Returns the frame's menu bar, or @racket[#f] if none has been created for the frame. } @@ -134,8 +134,8 @@ Returns the frame's menu bar, or @scheme[#f] if none has been created @defmethod[(has-status-line?) boolean?]{ -Returns @scheme[#t] if the frame's status line has been created, - @scheme[#f] otherwise. See also @method[frame% create-status-line]. +Returns @racket[#t] if the frame's status line has been created, + @racket[#f] otherwise. See also @method[frame% create-status-line]. } @@ -153,7 +153,7 @@ frame has been iconized} @elem{@method[frame% is-iconized?]}] @defmethod[(is-iconized?) boolean?]{ -Returns @scheme[#t] if the frame is iconized (minimized), @scheme[#f] +Returns @racket[#t] if the frame is iconized (minimized), @racket[#f] otherwise. } @@ -161,9 +161,9 @@ otherwise. @defmethod[(is-maximized?) boolean?]{ -On Windows and Mac OS X, returns @scheme[#t] if the frame is -maximized, @scheme[#f] otherwise. On Unix, the result is always -@scheme[#f]. +On Windows and Mac OS X, returns @racket[#t] if the frame is +maximized, @racket[#f] otherwise. On Unix, the result is always +@racket[#f]. } @@ -180,7 +180,7 @@ Maximizes or restores the frame on Windows and Mac OS X; the } @methimpl{ -If @scheme[maximize?] is @scheme[#f], the window is restored, otherwise +If @racket[maximize?] is @racket[#f], the window is restored, otherwise it is maximized. @@ -203,9 +203,9 @@ Gets or sets the frame's modification state as reflected to the user. void?]{ Called on Windows when a MDI-child frame becomes the active frame - within its parent (in which case the argument is @scheme[#t]), or when + within its parent (in which case the argument is @racket[#t]), or when the child frame ceases to be the active frame (in which case the - argument is @scheme[#f]). + argument is @racket[#f]). MDI activation is different from keyboard-focus activation. If the @@ -221,8 +221,8 @@ MDI activation is different from keyboard-focus activation. If the If the frame has a menu bar with keyboard shortcuts, and if the key event includes a Control, Alt, Option, Meta, Command, Shift, or Function key, then @method[frame% on-menu-char] attempts to match the -given event to a menu item. If a match is found, @scheme[#t] is -returned, otherwise @scheme[#f] is returned. +given event to a menu item. If a match is found, @racket[#t] is +returned, otherwise @racket[#f] is returned. When the match corresponds to a complete shortcut combination, the menu item's callback is called (before @@ -233,7 +233,7 @@ If the event does not correspond to a complete shortcut combination, menu bar (i.e., an underlined letter in a menu's title, which is installed by including an ampersand in the menu's label). If a mnemonic match is found, the keyboard focus is moved to the menu bar - (selecting the menu with the mnemonic), and @scheme[#t] is returned. + (selecting the menu with the mnemonic), and @racket[#t] is returned. } @@ -244,7 +244,7 @@ If the event does not correspond to a complete shortcut combination, Returns the result of -@schemeblock[ +@racketblock[ (or (send this @#,method[frame% on-menu-char] event) (send this @#,method[top-level-window<%> on-system-menu-char] event) (send this @#,method[top-level-window<%> on-traverse-char] event)) @@ -255,7 +255,7 @@ Returns the result of void?]{ On Mac OS X, called when the user clicks the toolbar button on a - frame created with the @indexed-scheme['toolbar-button] style. + frame created with the @indexed-racket['toolbar-button] style. } diff --git a/collects/scribblings/gui/gauge-class.scrbl b/collects/scribblings/gui/gauge-class.scrbl index fd6cf36ab7..d014d489c2 100644 --- a/collects/scribblings/gui/gauge-class.scrbl +++ b/collects/scribblings/gui/gauge-class.scrbl @@ -27,19 +27,20 @@ of the gauge. [stretchable-width any/c (memq 'horizontal style)] [stretchable-height any/c (memq 'vertical style)])]{ -If @scheme[label] is a string, it is used as the gauge label; otherwise +If @racket[label] is a string, it is used as the gauge label; otherwise the gauge does not display a label. @labelsimplestripped[(scheme label) @elem{gauge}] -The @scheme[range] argument is an integer specifying the maximum value of - the gauge (inclusive). The minimum gauge value is always @scheme[0]. +The @racket[range] argument is an integer specifying the maximum value of + the gauge (inclusive). The minimum gauge value is always @racket[0]. -The @scheme[style] list must include either @scheme['horizontal], - specifying a horizontal gauge, or @scheme['vertical], specifying - a vertical gauge. @HVLabelNote[@scheme[style]]{gauge} @DeletedStyleNote[@scheme[style] @scheme[parent]]{gauge} +The @racket[style] list must include either @racket['horizontal], + specifying a horizontal gauge, or @racket['vertical], specifying a vertical + gauge. @HVLabelNote[@racket[style]]{gauge} @DeletedStyleNote[@racket[style] + @racket[parent]]{gauge} -@FontKWs[@scheme[font]] @WindowKWs[@scheme[enabled]] @SubareaKWs[] @AreaKWs[] +@FontKWs[@racket[font]] @WindowKWs[@racket[enabled]] @SubareaKWs[] @AreaKWs[] diff --git a/collects/scribblings/gui/global-draw-funcs.scrbl b/collects/scribblings/gui/global-draw-funcs.scrbl index 9234660bad..7a168613bf 100644 --- a/collects/scribblings/gui/global-draw-funcs.scrbl +++ b/collects/scribblings/gui/global-draw-funcs.scrbl @@ -24,16 +24,16 @@ Returns the depth of the main display (a value of 1 denotes a monochrome display @defproc[(get-display-left-top-inset [avoid-bars? any/c #f]) (values exact-nonnegative-integer? exact-nonnegative-integer?)]{ -When the optional argument is @scheme[#f] (the default), this function +When the optional argument is @racket[#f] (the default), this function returns the offset of the main screen's origin from the top-left of the physical screen. On Unix and Windows, the result is - always @scheme[0] and @scheme[0]; on Mac OS X, the result is - @scheme[0] and the height of the menu bar. + always @racket[0] and @racket[0]; on Mac OS X, the result is + @racket[0] and the height of the menu bar. When the optional argument is true, this function returns the amount space at the left and top of the main screen that is occupied by the task bar (Windows) or menu bar and dock (Mac OS X). On Unix, the - result is always @scheme[0] and @scheme[0]. + result is always @racket[0] and @racket[0]. } @@ -55,7 +55,7 @@ Returns the screen's width and height. @defproc[(is-color-display?) boolean?]{ -Returns @scheme[#t] if the main display has color, @scheme[#f] +Returns @racket[#t] if the main display has color, @racket[#f] otherwise. } diff --git a/collects/scribblings/gui/group-box-panel-class.scrbl b/collects/scribblings/gui/group-box-panel-class.scrbl index e8d7d2accc..19e5cfce7a 100644 --- a/collects/scribblings/gui/group-box-panel-class.scrbl +++ b/collects/scribblings/gui/group-box-panel-class.scrbl @@ -8,7 +8,7 @@ A group-box panel arranges its subwindows in a single column, but also the panel content. Unlike most panel classes, a group-box panel's horizontal and vertical - margins default to @scheme[2]. + margins default to @racket[2]. @defconstructor[([label label-string?] @@ -29,11 +29,11 @@ Unlike most panel classes, a group-box panel's horizontal and vertical [stretchable-width any/c #t] [stretchable-height any/c #t])]{ -Creates a group pane whose title is @scheme[label]. +Creates a group pane whose title is @racket[label]. -@DeletedStyleNote[@scheme[style] @scheme[parent]]{group panel} +@DeletedStyleNote[@racket[style] @racket[parent]]{group panel} -@FontKWs[@scheme[font]] @WindowKWs[@scheme[enabled]] @SubareaKWs[] @AreaKWs[] +@FontKWs[@racket[font]] @WindowKWs[@racket[enabled]] @SubareaKWs[] @AreaKWs[] }} diff --git a/collects/scribblings/gui/grow-box-spacer-pane-class.scrbl b/collects/scribblings/gui/grow-box-spacer-pane-class.scrbl index edaf6ab60c..1fd4935086 100644 --- a/collects/scribblings/gui/grow-box-spacer-pane-class.scrbl +++ b/collects/scribblings/gui/grow-box-spacer-pane-class.scrbl @@ -3,18 +3,18 @@ @defclass/title[grow-box-spacer-pane% pane% ()]{ -A @scheme[grow-box-spacer-pane%] object is intended for use as a +A @racket[grow-box-spacer-pane%] object is intended for use as a lightweight spacer in the bottom-right corner of a frame, rather than as a container. On Mac OS X, a - @scheme[grow-box-spacer-pane%] has the same width and height as the + @racket[grow-box-spacer-pane%] has the same width and height as the grow box that is inset into the bottom-right corner of a frame. On - Windows and Unix, a @scheme[grow-box-spacer-pane%] has zero width and + Windows and Unix, a @racket[grow-box-spacer-pane%] has zero width and height. Unlike all other container types, a - @scheme[grow-box-spacer-pane%] is unstretchable by default. + @racket[grow-box-spacer-pane%] is unstretchable by default. @defconstructor/auto-super[()]{ -See @scheme[pane%] for information on initialization arguments. +See @racket[pane%] for information on initialization arguments. }} diff --git a/collects/scribblings/gui/horizontal-pane-class.scrbl b/collects/scribblings/gui/horizontal-pane-class.scrbl index eabab45682..1f604dba23 100644 --- a/collects/scribblings/gui/horizontal-pane-class.scrbl +++ b/collects/scribblings/gui/horizontal-pane-class.scrbl @@ -4,8 +4,7 @@ @defclass/title[horizontal-pane% pane% ()]{ A horizontal pane arranges its subwindows in a single row. See also - @scheme[pane%]. - + @racket[pane%]. @defconstructor[([parent (or/c (is-a?/c frame%) (is-a?/c dialog%) (is-a?/c panel%) (is-a?/c pane%))] diff --git a/collects/scribblings/gui/horizontal-panel-class.scrbl b/collects/scribblings/gui/horizontal-panel-class.scrbl index 3e58f8781e..644d36b4bc 100644 --- a/collects/scribblings/gui/horizontal-panel-class.scrbl +++ b/collects/scribblings/gui/horizontal-panel-class.scrbl @@ -4,7 +4,7 @@ @defclass/title[horizontal-panel% panel% ()]{ A horizontal panel arranges its subwindows in a single row. See also - @scheme[panel%]. + @racket[panel%]. @defconstructor[([parent (or/c (is-a?/c frame%) (is-a?/c dialog%) (is-a?/c panel%) (is-a?/c pane%))] @@ -26,17 +26,17 @@ A horizontal panel arranges its subwindows in a single row. See also The @racket[style] flags are the same as for @racket[panel%]. -@WindowKWs[@scheme[enabled]] @SubareaKWs[] @AreaContKWs[] @AreaKWs[] +@WindowKWs[@racket[enabled]] @SubareaKWs[] @AreaContKWs[] @AreaKWs[] } @defmethod[(set-orientation [horizontal? boolean?]) void?]{ Sets the orientation of the panel, switching it between - the behavior of the @scheme[vertical-panel%] and that of - the @scheme[horizontal-panel%]. + the behavior of the @racket[vertical-panel%] and that of + the @racket[horizontal-panel%]. } @defmethod[(get-orientation) boolean?]{ - Initially returns @scheme[#t], but if + Initially returns @racket[#t], but if @method[horizontal-panel% set-orientation] is called, this method returns whatever the last value passed to it was. } diff --git a/collects/scribblings/gui/key-event-class.scrbl b/collects/scribblings/gui/key-event-class.scrbl index cd4f964edf..740854ba8d 100644 --- a/collects/scribblings/gui/key-event-class.scrbl +++ b/collects/scribblings/gui/key-event-class.scrbl @@ -3,14 +3,14 @@ @defclass/title[key-event% event% ()]{ -A @scheme[key-event%] object contains information about a key press +A @racket[key-event%] object contains information about a key press or release event. Key events are primarily processed by @xmethod[window<%> on-subwindow-char] and @xmethod[canvas<%> on-char]. For a key-press event, a virtual key code is provided by @method[key-event% get-key-code]. For a key-release event, -@method[key-event% get-key-code] reports @scheme['release], and a virtual key code is provided by +@method[key-event% get-key-code] reports @racket['release], and a virtual key code is provided by @method[key-event% get-key-release-code]. See also @|mousekeydiscuss|. @@ -26,19 +26,19 @@ See also @|mousekeydiscuss|. [time-stamp exact-integer? 0] [caps-down any/c #f])]{ -See the corresponding @schemeidfont{get-} and @schemeidfont{set-} - methods for information about @scheme[key-code], @scheme[shift-down], - @scheme[control-down], @scheme[meta-down], @scheme[alt-down], - @scheme[x], @scheme[y], @scheme[time-stamp], @scheme[caps-down]. +See the corresponding @racketidfont{get-} and @racketidfont{set-} + methods for information about @racket[key-code], @racket[shift-down], + @racket[control-down], @racket[meta-down], @racket[alt-down], + @racket[x], @racket[y], @racket[time-stamp], @racket[caps-down]. The release key code, as returned by @method[key-event% -get-key-release-code], is initialized to @scheme['press]. +get-key-release-code], is initialized to @racket['press]. } @defmethod[(get-alt-down) boolean?]{ -Returns @scheme[#t] if the Option (Mac OS X) key was down for +Returns @racket[#t] if the Option (Mac OS X) key was down for the event. When the Alt key is pressed in Windows, it is reported as a Meta press (see @method[key-event% get-meta-down]). @@ -47,17 +47,17 @@ Returns @scheme[#t] if the Option (Mac OS X) key was down for @defmethod[(get-caps-down) boolean?]{ -Returns @scheme[#t] if the Caps Lock key was on for the event. +Returns @racket[#t] if the Caps Lock key was on for the event. } @defmethod[(get-control-down) boolean?]{ -Returns @scheme[#t] if the Control key was down for the event. +Returns @racket[#t] if the Control key was down for the event. On Mac OS X, if a control-key press is combined with a mouse button click, the event is reported as a right-button click and -@method[key-event% get-control-down] for the event reports @scheme[#f]. +@method[key-event% get-control-down] for the event reports @racket[#f]. } @@ -68,78 +68,78 @@ Gets the virtual key code for the key event. The virtual key code is either a character or a special key symbol, one of the following: @itemize[ -@item{@indexed-scheme['start]} -@item{@indexed-scheme['cancel]} -@item{@indexed-scheme['clear]} -@item{@indexed-scheme['shift]} -@item{@indexed-scheme['control]} -@item{@indexed-scheme['menu]} -@item{@indexed-scheme['pause]} -@item{@indexed-scheme['capital]} -@item{@indexed-scheme['prior]} -@item{@indexed-scheme['next]} -@item{@indexed-scheme['end]} -@item{@indexed-scheme['home]} -@item{@indexed-scheme['left]} -@item{@indexed-scheme['up]} -@item{@indexed-scheme['right]} -@item{@indexed-scheme['down]} -@item{@indexed-scheme['escape]} -@item{@indexed-scheme['select]} -@item{@indexed-scheme['print]} -@item{@indexed-scheme['execute]} -@item{@indexed-scheme['snapshot]} -@item{@indexed-scheme['insert]} -@item{@indexed-scheme['help]} -@item{@indexed-scheme['numpad0]} -@item{@indexed-scheme['numpad1]} -@item{@indexed-scheme['numpad2]} -@item{@indexed-scheme['numpad3]} -@item{@indexed-scheme['numpad4]} -@item{@indexed-scheme['numpad5]} -@item{@indexed-scheme['numpad6]} -@item{@indexed-scheme['numpad7]} -@item{@indexed-scheme['numpad8]} -@item{@indexed-scheme['numpad9]} -@item{@indexed-scheme['numpad-enter]} -@item{@indexed-scheme['multiply]} -@item{@indexed-scheme['add]} -@item{@indexed-scheme['separator]} -@item{@indexed-scheme['subtract]} -@item{@indexed-scheme['decimal]} -@item{@indexed-scheme['divide]} -@item{@indexed-scheme['f1]} -@item{@indexed-scheme['f2]} -@item{@indexed-scheme['f3]} -@item{@indexed-scheme['f4]} -@item{@indexed-scheme['f5]} -@item{@indexed-scheme['f6]} -@item{@indexed-scheme['f7]} -@item{@indexed-scheme['f8]} -@item{@indexed-scheme['f9]} -@item{@indexed-scheme['f10]} -@item{@indexed-scheme['f11]} -@item{@indexed-scheme['f12]} -@item{@indexed-scheme['f13]} -@item{@indexed-scheme['f14]} -@item{@indexed-scheme['f15]} -@item{@indexed-scheme['f16]} -@item{@indexed-scheme['f17]} -@item{@indexed-scheme['f18]} -@item{@indexed-scheme['f19]} -@item{@indexed-scheme['f20]} -@item{@indexed-scheme['f21]} -@item{@indexed-scheme['f22]} -@item{@indexed-scheme['f23]} -@item{@indexed-scheme['f24]} -@item{@indexed-scheme['numlock]} -@item{@indexed-scheme['scroll]} -@item{@indexed-scheme['wheel-up] --- @index["wheel on mouse"]{mouse} wheel up one notch} -@item{@indexed-scheme['wheel-down] --- mouse wheel down one notch} -@item{@indexed-scheme['wheel-left] --- mouse wheel left one notch} -@item{@indexed-scheme['wheel-right] --- mouse wheel right one notch} -@item{@indexed-scheme['release] --- indicates a key-release event} -@item{@indexed-scheme['press] --- indicates a key-press event; usually only from @scheme[get-key-release-code]} +@item{@indexed-racket['start]} +@item{@indexed-racket['cancel]} +@item{@indexed-racket['clear]} +@item{@indexed-racket['shift]} +@item{@indexed-racket['control]} +@item{@indexed-racket['menu]} +@item{@indexed-racket['pause]} +@item{@indexed-racket['capital]} +@item{@indexed-racket['prior]} +@item{@indexed-racket['next]} +@item{@indexed-racket['end]} +@item{@indexed-racket['home]} +@item{@indexed-racket['left]} +@item{@indexed-racket['up]} +@item{@indexed-racket['right]} +@item{@indexed-racket['down]} +@item{@indexed-racket['escape]} +@item{@indexed-racket['select]} +@item{@indexed-racket['print]} +@item{@indexed-racket['execute]} +@item{@indexed-racket['snapshot]} +@item{@indexed-racket['insert]} +@item{@indexed-racket['help]} +@item{@indexed-racket['numpad0]} +@item{@indexed-racket['numpad1]} +@item{@indexed-racket['numpad2]} +@item{@indexed-racket['numpad3]} +@item{@indexed-racket['numpad4]} +@item{@indexed-racket['numpad5]} +@item{@indexed-racket['numpad6]} +@item{@indexed-racket['numpad7]} +@item{@indexed-racket['numpad8]} +@item{@indexed-racket['numpad9]} +@item{@indexed-racket['numpad-enter]} +@item{@indexed-racket['multiply]} +@item{@indexed-racket['add]} +@item{@indexed-racket['separator]} +@item{@indexed-racket['subtract]} +@item{@indexed-racket['decimal]} +@item{@indexed-racket['divide]} +@item{@indexed-racket['f1]} +@item{@indexed-racket['f2]} +@item{@indexed-racket['f3]} +@item{@indexed-racket['f4]} +@item{@indexed-racket['f5]} +@item{@indexed-racket['f6]} +@item{@indexed-racket['f7]} +@item{@indexed-racket['f8]} +@item{@indexed-racket['f9]} +@item{@indexed-racket['f10]} +@item{@indexed-racket['f11]} +@item{@indexed-racket['f12]} +@item{@indexed-racket['f13]} +@item{@indexed-racket['f14]} +@item{@indexed-racket['f15]} +@item{@indexed-racket['f16]} +@item{@indexed-racket['f17]} +@item{@indexed-racket['f18]} +@item{@indexed-racket['f19]} +@item{@indexed-racket['f20]} +@item{@indexed-racket['f21]} +@item{@indexed-racket['f22]} +@item{@indexed-racket['f23]} +@item{@indexed-racket['f24]} +@item{@indexed-racket['numlock]} +@item{@indexed-racket['scroll]} +@item{@indexed-racket['wheel-up] --- @index["wheel on mouse"]{mouse} wheel up one notch} +@item{@indexed-racket['wheel-down] --- mouse wheel down one notch} +@item{@indexed-racket['wheel-left] --- mouse wheel left one notch} +@item{@indexed-racket['wheel-right] --- mouse wheel right one notch} +@item{@indexed-racket['release] --- indicates a key-release event} +@item{@indexed-racket['press] --- indicates a key-press event; usually only from @racket[get-key-release-code]} ] The special key symbols attempt to capture useful keys that have no @@ -148,26 +148,26 @@ The special key symbols attempt to capture useful keys that have no @itemize[ - @item{@scheme[#\space] --- the space bar} + @item{@racket[#\space] --- the space bar} - @item{@scheme[#\return] --- the Enter or Return key (on all + @item{@racket[#\return] --- the Enter or Return key (on all platforms), but not necessarily the Enter key near the numpad - (which is reported as @scheme['numpad-enter] if the platform + (which is reported as @racket['numpad-enter] if the platform distinguishes the two Enter keys)} - @item{@scheme[#\tab] --- the tab key} + @item{@racket[#\tab] --- the tab key} - @item{@scheme[#\backspace] --- the backspace key} + @item{@racket[#\backspace] --- the backspace key} - @item{@scheme[#\rubout] --- the delete key} + @item{@racket[#\rubout] --- the delete key} ] If a suitable special key symbol or ASCII representation is not - available, @scheme[#\nul] (the NUL character) is reported. + available, @racket[#\nul] (the NUL character) is reported. -A @scheme['wheel-up], @scheme['wheel-down], @scheme['wheel-left], or - @scheme['wheel-right] event may be sent to a window other than the +A @racket['wheel-up], @racket['wheel-down], @racket['wheel-left], or + @racket['wheel-right] event may be sent to a window other than the one with the keyboard focus, because some platforms generate wheel events based on the location of the mouse pointer instead of the keyboard focus. @@ -177,7 +177,7 @@ On Windows, when the Control key is pressed without Alt, the key of the Shift key. On Mac OS X, the key code is computed without Caps Lock effects when the Control or Command key is pressed; in the case of Control, Caps Lock is used normally if special handling is - disabled for the Control key via @scheme[special-control-key]. On + disabled for the Control key via @racket[special-control-key]. On Unix, the key code is computed with Caps Lock effects when the Control key is pressed without Alt. @@ -189,7 +189,7 @@ See also @method[key-event% get-other-shift-key-code]. (or/c char? key-code-symbol?)]{ Gets the virtual key code for a key-release event; the result is - @scheme['press] for a key-press event. See @method[key-event% + @racket['press] for a key-press event. See @method[key-event% get-key-code] for the list of virtual key codes. } @@ -197,7 +197,7 @@ Gets the virtual key code for a key-release event; the result is @defmethod[(get-meta-down) boolean?]{ -Returns @scheme[#t] if the Meta (Unix), Alt (Windows), or Command (Mac OS +Returns @racket[#t] if the Meta (Unix), Alt (Windows), or Command (Mac OS X) key was down for the event. } @@ -230,7 +230,7 @@ Since keyboard mappings vary, it is sometimes useful in key mappings for a program to know the result that the keyboard would have produced for an event if the Shift key had been toggled differently. The @method[key-event% get-other-shift-key-code] - produces that other mapping, returning @scheme[#f] if the alternate + produces that other mapping, returning @racket[#f] if the alternate mapping is unavailable, otherwise returning the same kind of result as @method[key-event% get-key-code]. @@ -263,7 +263,7 @@ Alternate mappings are not available for all events. On Windows, @defmethod[(get-shift-down) boolean?]{ -Returns @scheme[#t] if the Shift key was down for the event. +Returns @racket[#t] if the Shift key was down for the event. } @@ -307,7 +307,7 @@ Sets whether the Control key was down for the event. On Mac OS X, if a control-key press is combined with a mouse button click, the event is reported as a right-button click and @method[key-event% get-control-down] for the event reports - @scheme[#f]. + @racket[#f]. } diff --git a/collects/scribblings/gui/keymap-class.scrbl b/collects/scribblings/gui/keymap-class.scrbl index 6e7ae36994..6afd311732 100644 --- a/collects/scribblings/gui/keymap-class.scrbl +++ b/collects/scribblings/gui/keymap-class.scrbl @@ -3,10 +3,10 @@ @defclass/title[keymap% object% ()]{ -A @scheme[keymap%] object is used by @scheme[editor<%>] objects to +A @racket[keymap%] object is used by @racket[editor<%>] objects to map keyboard and mouse sequences to arbitrary functions in an extensible way. Keymaps can be used without editors, as well. A - @scheme[keymap%] object contains + @racket[keymap%] object contains @itemize[ @@ -16,13 +16,13 @@ A @scheme[keymap%] object is used by @scheme[editor<%>] objects to ] -A handler procedure in a keymap is invoked with a @scheme[key-event%] - object or a @scheme[mouse-event%] object. It is also given another +A handler procedure in a keymap is invoked with a @racket[key-event%] + object or a @racket[mouse-event%] object. It is also given another value that depends on the context in which the keymap is used (or, more specifically, the arguments to @method[keymap% handle-key-event] or @method[keymap% handle-mouse-event]). For keymaps associated with - @scheme[editor<%>] objects, the extra parameter is generally the - @scheme[editor<%>] object that received the keyboard or mouse event. + @racket[editor<%>] objects, the extra parameter is generally the + @racket[editor<%>] object that received the keyboard or mouse event. @defconstructor[()]{ @@ -72,16 +72,16 @@ A break callback function can be installed with @method[keymap% boolean?]{ Calls a named event handler directly. If the function cannot be found - or the found handler did not want to handle the event, @scheme[#f] is + or the found handler did not want to handle the event, @racket[#f] is returned. Otherwise, the return value is the boolean return value of the event handler. -The @scheme[in] and @scheme[event] arguments are passed on to the keymap +The @racket[in] and @racket[event] arguments are passed on to the keymap handler procedure if one is found. -If @scheme[try-chain?] is not @scheme[#f], keymaps chained to this one +If @racket[try-chain?] is not @racket[#f], keymaps chained to this one are searched for the function name. If the function is not found and - @scheme[try-chain?] is @scheme[#f]; an exception is also raised, but + @racket[try-chain?] is @racket[#f]; an exception is also raised, but the exception handler cannot escape (see @secref["evtcontjump"]). @@ -92,9 +92,9 @@ If @scheme[try-chain?] is not @scheme[#f], keymaps chained to this one [prefix? any/c]) void?]{ -Chains @scheme[next] off @this-obj[] The @scheme[next] keymap will be +Chains @racket[next] off @this-obj[] The @racket[next] keymap will be used to handle events which are not handled by @this-obj[]. If - @scheme[prefix?] is a true value, then @scheme[next] will take + @racket[prefix?] is a true value, then @racket[next] will take precedence over other keymaps already chained to @this-obj[]. Multiple keymaps can be chained off one keymap using @method[keymap% @@ -130,9 +130,9 @@ The default interval is determined in a platform-specific way, but it [event (is-a?/c key-event%)]) boolean?]{ -Attempts to handle a keyboard event, returning @scheme[#t] if the event +Attempts to handle a keyboard event, returning @racket[#t] if the event was handled (i.e., a handler was found and it returned a true value), - @scheme[#f] otherwise. + @racket[#f] otherwise. See also @method[keymap% call-function]. @@ -143,9 +143,9 @@ See also @method[keymap% call-function]. [event (is-a?/c mouse-event%)]) boolean?]{ -Attempts to handle a mouse event, returning @scheme[#t] if the event +Attempts to handle a mouse event, returning @racket[#t] if the event was handled (i.e., a handler was found and it returned a true value), - @scheme[#f] otherwise. + @racket[#f] otherwise. See also @method[keymap% call-function]. @@ -157,7 +157,7 @@ See also @method[keymap% call-function]. void?]{ Maps an input state sequence to a function name using a string-encoded - sequence in @scheme[keyname]. The format of @scheme[keyname] is a + sequence in @racket[keyname]. The format of @racket[keyname] is a sequence of semicolon-delimited input states; each state is made up of a sequence of modifier identifiers followed by a key identifier. @@ -172,7 +172,7 @@ The modifier identifiers are: @item{@litchar{a:} --- Mac OS X: Option} @item{@litchar{m:} --- Windows: Alt; Unix: Meta; Mac OS X: Command, when - @scheme[map-command-as-meta-key] produces @scheme[#t]} + @racket[map-command-as-meta-key] produces @racket[#t]} @item{@litchar{d:} --- Mac OS X: Command} @@ -300,27 +300,27 @@ A state can match multiple state strings mapped in a keymap (or keymap Examples: @itemize[ - - @item{@scheme["space"] --- matches whenever the space bar is pressed, + + @item{@racket["space"] --- matches whenever the space bar is pressed, regardless of the state of modifiers keys.} - @item{@scheme["~c:space"] --- matches whenever the space bar is pressed + @item{@racket["~c:space"] --- matches whenever the space bar is pressed and the Control key is not pressed.} - @item{@scheme["a"] --- matches whenever @litchar{a} is typed, regardless of + @item{@racket["a"] --- matches whenever @litchar{a} is typed, regardless of the state of modifiers keys (other than Shift).} - @item{@scheme[":a"] --- matches only when @litchar{a} is typed with no + @item{@racket[":a"] --- matches only when @litchar{a} is typed with no modifier keys pressed.} - @item{@scheme["~c:a"] --- matches whenever @litchar{a} is typed and neither + @item{@racket["~c:a"] --- matches whenever @litchar{a} is typed and neither the Shift key nor the Control key is pressed.} - @item{@scheme[":esc;:c:c"] --- matches an Escape key press (no + @item{@racket[":esc;:c:c"] --- matches an Escape key press (no modifiers) followed by a Control-C press (no modifiers other than Control).} - @item{@scheme["?:d:+"] --- matches when Command is pressed with key + @item{@racket["?:d:+"] --- matches when Command is pressed with key that produces @litchar{+}, even if producing @litchar{+} normally requires pressing Shift.} @@ -343,7 +343,7 @@ A function name does not have to be mapped to a handler before input @defmethod[(remove-chained-keymap [keymap (is-a?/c keymap%)]) void?]{ -If @scheme[keymap] was previously chained from this keymap (through +If @racket[keymap] was previously chained from this keymap (through @method[keymap% chain-to-keymap]), then it is removed from the chain-to list. @@ -406,18 +406,18 @@ If a grab callback returns a true value for a matching or non-matching true value for a matching callback, then the matching keymap function is not called by the keymap. -The callback procedure @scheme[f] will be invoked as: +The callback procedure @racket[f] will be invoked as: -@schemeblock[ +@racketblock[ (f _str _keymap _editor _event) ] -The @scheme[_str] argument is the name of a function for a matching - callback, or @scheme[#f] for a non-matching callback. The - @scheme[_keymap] argument is the keymap that matched (possibly a +The @racket[_str] argument is the name of a function for a matching + callback, or @racket[#f] for a non-matching callback. The + @racket[_keymap] argument is the keymap that matched (possibly a keymap chained to the one in which the callback was installed) or the - keymap in which the callback was installed. The @scheme[_editor] and - @scheme[_event] arguments are the same as passed on to the matching + keymap in which the callback was installed. The @racket[_editor] and + @racket[_event] arguments are the same as passed on to the matching keymap function. Key grab callback functions are de-installed with @method[keymap% diff --git a/collects/scribblings/gui/labelled-menu-item-intf.scrbl b/collects/scribblings/gui/labelled-menu-item-intf.scrbl index 22e7248739..1145f0af29 100644 --- a/collects/scribblings/gui/labelled-menu-item-intf.scrbl +++ b/collects/scribblings/gui/labelled-menu-item-intf.scrbl @@ -3,12 +3,11 @@ @definterface/title[labelled-menu-item<%> (menu-item<%>)]{ -A @scheme[labelled-menu-item<%>] object is a @scheme[menu-item<%>] with +A @racket[labelled-menu-item<%>] object is a @racket[menu-item<%>] with a string label (i.e., any menu item other than a separator). More - specifically, it is an instance of either @scheme[menu-item%] (a - plain menu item), @scheme[checkable-menu-item%] (a checkable menu - item), or @scheme[menu%] (a submenu). - + specifically, it is an instance of either @racket[menu-item%] (a + plain menu item), @racket[checkable-menu-item%] (a checkable menu + item), or @racket[menu%] (a submenu). @defmethod[(enable [enabled? any/c]) @@ -16,7 +15,7 @@ A @scheme[labelled-menu-item<%>] object is a @scheme[menu-item<%>] with Enables or disables the menu item. If the item is a submenu (or menu in a menu bar), the entire menu is disabled, but each submenu item's - @method[labelled-menu-item<%> is-enabled?] method returns @scheme[#f] + @method[labelled-menu-item<%> is-enabled?] method returns @racket[#f] only if the item is specifically disabled (in addition to the submenu). @@ -25,10 +24,10 @@ Enables or disables the menu item. If the item is a submenu (or menu @defmethod[(get-help-string) (or/c label-string? false/c)]{ -Returns the help string for the menu item, or @scheme[#f] if the item +Returns the help string for the menu item, or @racket[#f] if the item has no help string. -When an item has a @scheme[help], the string may be used to +When an item has a @racket[help], the string may be used to display help information to the user. } @@ -57,7 +56,7 @@ Like @method[labelled-menu-item<%> get-label], except that @defmethod[(is-enabled?) boolean?]{ -Returns @scheme[#t] if the menu item is enabled, @scheme[#f] +Returns @racket[#t] if the menu item is enabled, @racket[#f] otherwise. See also @@ -81,7 +80,7 @@ in such a way that the container does not call the } @methimpl{ -Calls the @scheme[demand-callback] procedure that was provided when the +Calls the @racket[demand-callback] procedure that was provided when the object was created. }} @@ -89,7 +88,7 @@ Calls the @scheme[demand-callback] procedure that was provided when the @defmethod[(set-help-string [help (or/c label-string? false/c)]) void?]{ -Sets the help string for the menu item. Use @scheme[#f] to remove the +Sets the help string for the menu item. Use @racket[#f] to remove the help string for an item. } @@ -111,7 +110,7 @@ If the label contains @litchar{&} and the window is a control, the @litchar{&}. On Mac OS X, @litchar{&}s in the label are parsed in the same way as for Unix and Windows, but no mnemonic underline is displayed. - + A @litchar{&} is always preserved in the label returned by @method[labelled-menu-item<%> get-label], but never preserved in the label returned by @method[labelled-menu-item<%> get-plain-label]. diff --git a/collects/scribblings/gui/list-box-class.scrbl b/collects/scribblings/gui/list-box-class.scrbl index 8a73c5a32c..d21ff448ba 100644 --- a/collects/scribblings/gui/list-box-class.scrbl +++ b/collects/scribblings/gui/list-box-class.scrbl @@ -1,8 +1,8 @@ #lang scribble/doc @(require "common.rkt") -@(define lbnumnote @elem{List box rows are indexed from @scheme[0].}) -@(define lbcnumnote @elem{List box rows and columns are indexed from @scheme[0].}) +@(define lbnumnote @elem{List box rows are indexed from @racket[0].}) +@(define lbcnumnote @elem{List box rows and columns are indexed from @racket[0].}) @defclass/title[list-box% object% (list-control<%>)]{ @@ -26,8 +26,7 @@ A list box can have multiple columns with optional column headers. An @|lbcnumnote| -See also @scheme[choice%]. - +See also @racket[choice%]. @defconstructor[([label (or/c label-string? false/c)] @@ -56,21 +55,21 @@ See also @scheme[choice%]. '("Column")] [column-order (or/c #f (listof exact-nonnegative-integer?)) #f])]{ -If @scheme[label] is not @scheme[#f], it is used as the list box +If @racket[label] is not @racket[#f], it is used as the list box label. Otherwise, the list box will not display its label. @labelstripped[(scheme label) @elem{} @elem{move the keyboard focus to the list box}] -The @scheme[choices] list specifies the initial list of items +The @racket[choices] list specifies the initial list of items to appear in the list box. If the list box has multiple columns, @racket[choices] determines the content of the first column, and other columns are initialized to the empty string. -The @scheme[callback] procedure is called when the user changes the list +The @racket[callback] procedure is called when the user changes the list box selection, by either selecting, re-selecting, deselecting, or double-clicking an item. The type of the event provided to the - callback is @indexed-scheme['list-box-dclick] when the user double-clicks - on an item, or @indexed-scheme['list-box] otherwise. + callback is @indexed-racket['list-box-dclick] when the user double-clicks + on an item, or @indexed-racket['list-box] otherwise. The @racket[columns] list determines the number of columns in the list box. The column titles in @racket[columns] are shown only if @@ -78,45 +77,45 @@ The @racket[columns] list determines the number of columns in the list also includes @racket['clickable-headers], then a click on a header triggers a call to @racket[callback] with a @racket[column-control-event%] argument whose event type is - @indexed-scheme['list-box-column]. + @indexed-racket['list-box-column]. -The @scheme[style] specification must include exactly one of the +The @racket[style] specification must include exactly one of the following: @itemize[ - @item{@scheme['single] --- Creates a single-selection list.} + @item{@racket['single] --- Creates a single-selection list.} - @item{@scheme['multiple] --- Creates a multiple-selection list + @item{@racket['multiple] --- Creates a multiple-selection list where a single click deselects other items and selects a new item. Use this style for a list when single-selection is common, but multiple selections are allowed.} - @item{@scheme['extended] --- Creates a multiple-selection list where a + @item{@racket['extended] --- Creates a multiple-selection list where a single click extends or contracts the selection by toggling the clicked item. Use this style for a list when multiple selections are the rule rather than the exception.} ] -The @scheme['multiple] and @scheme['extended] styles determine a +The @racket['multiple] and @racket['extended] styles determine a platform-independent interpretation of unmodified mouse clicks, but dragging, shift-clicking, control-clicking, etc. have platform-standard interpretations. Whatever the platform-specific interface, the user can always select disjoint sets of items or deselect items (and leave no items selected). On some platforms, the - user can deselect the (sole) selected item in a @scheme['single] list + user can deselect the (sole) selected item in a @racket['single] list box. -@HVLabelNote[@scheme[style]]{list box} @DeletedStyleNote[@scheme[style] @scheme[parent]]{list box} +@HVLabelNote[@racket[style]]{list box} @DeletedStyleNote[@racket[style] @racket[parent]]{list box} If @racket[style] includes @racket['variable-columns], then the number of columns in the list box can be changed via @method[list-box% append-column] and @method[list-box% delete-column]. -If @scheme[selection] is an integer, it is passed to -@method[list-control<%> set-selection] to set the initial selection. The @scheme[selection] must be less than - the length of @scheme[choices]. +If @racket[selection] is an integer, it is passed to +@method[list-control<%> set-selection] to set the initial selection. The @racket[selection] must be less than + the length of @racket[choices]. -@FontLabelKWs[@scheme[font] @scheme[label-font]] @WindowKWs[@scheme[enabled]] @SubareaKWs[] @AreaKWs[] +@FontLabelKWs[@racket[font] @racket[label-font]] @WindowKWs[@racket[enabled]] @SubareaKWs[] @AreaKWs[] It the @racket[column-order] argument is not @racket[#f], it determines the order in which logical columns are initially displayed. See @@ -135,7 +134,7 @@ the columns). void?]{ Adds a new item to the list box with an associated ``data'' object. - The @scheme[data] object is not displayed in the list box; it is + The @racket[data] object is not displayed in the list box; it is provided merely as a convenience for use with @method[list-box% get-data], possibly allowing a programmer to avoid managing a separate item-to-data mapping in addition to the list box control. @@ -157,7 +156,7 @@ displayed as the last column.} @defmethod[(delete [n exact-nonnegative-integer?]) void?]{ -Deletes the item indexed by @scheme[n]. @|lbnumnote| If @scheme[n] is equal +Deletes the item indexed by @racket[n]. @|lbnumnote| If @racket[n] is equal to or larger than the number of items in the control, @|MismatchExn|. Selected items that are not deleted remain selected, and no other @@ -206,9 +205,9 @@ See also @method[list-box set-column-width].} @defmethod[(get-data [n exact-nonnegative-integer?]) any/c]{ -Returns the data for the item indexed by @scheme[n], or @scheme[#f] +Returns the data for the item indexed by @racket[n], or @racket[#f] if there is no associated data. @|lbnumnote| If - @scheme[n] is equal to or larger than the number of choices, + @racket[n] is equal to or larger than the number of choices, @|MismatchExn|. See also @method[list-box% append] and @method[list-box% set-data]. @@ -238,7 +237,7 @@ Returns the font used for the control's label, which is optionally Returns a list of indices for all currently selected items. @|lbnumnote| -For single-selection lists, the result is always either @scheme[null] or +For single-selection lists, the result is always either @racket[null] or a list containing one number. } @@ -247,8 +246,8 @@ For single-selection lists, the result is always either @scheme[null] or @defmethod[(is-selected? [n exact-nonnegative-integer?]) boolean?]{ -Returns @scheme[#t] if the items indexed by @scheme[n] is selected, - @scheme[#f] otherwise. @|lbnumnote| If @scheme[n] is equal to or +Returns @racket[#t] if the items indexed by @racket[n] is selected, + @racket[#f] otherwise. @|lbnumnote| If @racket[n] is equal to or larger than the number of choices, @|MismatchExn|. @@ -261,7 +260,7 @@ Returns @scheme[#t] if the items indexed by @scheme[n] is selected, Returns the maximum number of items in the list box that are visible to the user with the control's current size (rounding down if the - exact answer is fractional, but returning at least @scheme[1]). + exact answer is fractional, but returning at least @racket[1]). } @@ -275,8 +274,8 @@ Selects or deselects an item. For selection in a single-selection list selections are preserved, unlike @method[list-control<%> set-selection]. -If @scheme[select?] is @scheme[#f], the item indexed by @scheme[n] is - deselected; otherwise it is selected. @|lbnumnote| If @scheme[n] is +If @racket[select?] is @racket[#f], the item indexed by @racket[n] is + deselected; otherwise it is selected. @|lbnumnote| If @racket[n] is equal to or larger than the number of choices, @|MismatchExn|. @MonitorCallback[@elem{A list box's selection} @elem{the user clicking the control} @elem{selection}] @@ -341,8 +340,8 @@ See also @method[list-box% get-column-width].} [data any/c]) void?]{ -Sets the associated data for item indexed by @scheme[n]. @|lbnumnote| If - @scheme[n] is equal to or larger than the number of choices, +Sets the associated data for item indexed by @racket[n]. @|lbnumnote| If + @racket[n] is equal to or larger than the number of choices, @|MismatchExn|. See also @method[list-box% append]. @@ -353,8 +352,8 @@ See also @method[list-box% append]. @defmethod[(set-first-visible-item [n exact-nonnegative-integer?]) void?]{ -Scrolls the list box so that the item indexed by @scheme[n] is at the - top of the list box display. @|lbnumnote| If @scheme[n] is equal to +Scrolls the list box so that the item indexed by @racket[n] is at the + top of the list box display. @|lbnumnote| If @racket[n] is equal to or larger than the number of choices, @|MismatchExn|. @Unmonitored[@elem{A list box's scroll position} @elem{the user clicking the control} @elem{the scroll position @@ -368,8 +367,8 @@ Scrolls the list box so that the item indexed by @scheme[n] is at the [column exact-nonnegative-integer? 0]) void?]{ -Sets the item indexed by @scheme[n] in logical column @racket[column]. -@|lbcnumnote| If @scheme[n] is +Sets the item indexed by @racket[n] in logical column @racket[column]. +@|lbcnumnote| If @racket[n] is equal to or larger than the number of choices, or if @racket[column] is equal to or larger than the number of columns, @|MismatchExn|. diff --git a/collects/scribblings/gui/list-control-intf.scrbl b/collects/scribblings/gui/list-control-intf.scrbl index 9b602175fe..47dd3f9276 100644 --- a/collects/scribblings/gui/list-control-intf.scrbl +++ b/collects/scribblings/gui/list-control-intf.scrbl @@ -5,15 +5,15 @@ A list control gives the user a list of string items to choose from. There are two built-in classes that implement - @scheme[list-control<%>]: + @racket[list-control<%>]: @itemize[ - @item{@scheme[choice%] --- presents the list in a popup menu (so + @item{@racket[choice%] --- presents the list in a popup menu (so the user can choose only one item at a time)} - @item{@scheme[list-box%] --- presents the list in a scrolling box, + @item{@racket[list-box%] --- presents the list in a scrolling box, allowing the use to choose one item (if the style includes - @scheme['single]) or any number of items} + @racket['single]) or any number of items} ] In either case, the set of user-selectable items can be changed @@ -39,8 +39,8 @@ Removes all user-selectable items from the control. @defmethod[(find-string [s string?]) (or/c exact-nonnegative-integer? false/c)]{ Finds a user-selectable item matching the given string. If no matching - choice is found, @scheme[#f] is returned, otherwise the index of the - matching choice is returned (items are indexed from @scheme[0]). + choice is found, @racket[#f] is returned, otherwise the index of the + matching choice is returned (items are indexed from @racket[0]). } @@ -54,8 +54,8 @@ Returns the number of user-selectable items in the control (which is @defmethod[(get-selection) (or/c exact-nonnegative-integer? false/c)]{ Returns the index of the currently selected item (items are indexed - from @scheme[0]). If the choice item currently contains no choices or no - selections, @scheme[#f] is returned. If multiple selections are + from @racket[0]). If the choice item currently contains no choices or no + selections, @racket[#f] is returned. If multiple selections are allowed and multiple items are selected, the index of the first selection is returned. @@ -65,7 +65,7 @@ Returns the index of the currently selected item (items are indexed (and/c immutable? label-string?)]{ Returns the item for the given index (items are indexed from - @scheme[0]). If the provided index is larger than the greatest index in + @racket[0]). If the provided index is larger than the greatest index in the list control, @|MismatchExn|. } @@ -73,7 +73,7 @@ Returns the item for the given index (items are indexed from @defmethod[(get-string-selection) (or/c (and/c immutable? label-string?) false/c)]{ Returns the currently selected item. If the control currently - contains no choices, @scheme[#f] is returned. If multiple selections + contains no choices, @racket[#f] is returned. If multiple selections are allowed and multiple items are selected, the first selection is returned. @@ -82,7 +82,7 @@ Returns the currently selected item. If the control currently @defmethod[(set-selection [n exact-nonnegative-integer?]) void?]{ Selects the item specified by the given index (items are indexed from - @scheme[0]). If the given index larger than the greatest index in the + @racket[0]). If the given index larger than the greatest index in the list control, @|MismatchExn|. In a list box control, all other items are deselected, even if multiple diff --git a/collects/scribblings/gui/menu-bar-class.scrbl b/collects/scribblings/gui/menu-bar-class.scrbl index 0e99e0af6f..9f4d24d805 100644 --- a/collects/scribblings/gui/menu-bar-class.scrbl +++ b/collects/scribblings/gui/menu-bar-class.scrbl @@ -3,8 +3,8 @@ @defclass/title[menu-bar% object% (menu-item-container<%>)]{ -A @scheme[menu-bar%] object is created for a particular - @scheme[frame%] object. A frame can have at most one menu bar; +A @racket[menu-bar%] object is created for a particular + @racket[frame%] object. A frame can have at most one menu bar; @|MismatchExn| when a new menu bar is created for a frame that already has a menu bar. @@ -14,14 +14,14 @@ A @scheme[menu-bar%] object is created for a particular [demand-callback ((is-a?/c menu-bar%) . -> . any) (lambda (m) (void))])]{ Creates a menu bar in the specified frame. The menu bar is initially - empty. If @indexed-scheme['root] is supplied as @scheme[parent], the + empty. If @indexed-racket['root] is supplied as @racket[parent], the menu bar becomes active only when no other frames are shown. A - @scheme['root] @scheme[parent] is allowed only when - @scheme[current-eventspace-has-menu-root?] returns @scheme[#t], and + @racket['root] @racket[parent] is allowed only when + @racket[current-eventspace-has-menu-root?] returns @racket[#t], and only if no such menu bar has been created before, otherwise @|MismatchExn|. -The @scheme[demand-callback] procedure is called by the default +The @racket[demand-callback] procedure is called by the default @method[menu-item-container<%> on-demand] method with the object itself. } @@ -32,7 +32,7 @@ The @scheme[demand-callback] procedure is called by the default Enables or disables the menu bar (i.e., all of its menus). Each menu's @method[labelled-menu-item<%> is-enabled?] method returns - @scheme[#f] only if the menu is specifically disabled (in addition to + @racket[#f] only if the menu is specifically disabled (in addition to the menu bar). } @@ -49,6 +49,6 @@ Returns the menu bar's frame. @defmethod[(is-enabled?) boolean?]{ -Returns @scheme[#t] if the menu bar is enabled, @scheme[#f] otherwise. +Returns @racket[#t] if the menu bar is enabled, @racket[#f] otherwise. }} diff --git a/collects/scribblings/gui/menu-class.scrbl b/collects/scribblings/gui/menu-class.scrbl index e71e9ef782..1d8b7ce9e6 100644 --- a/collects/scribblings/gui/menu-class.scrbl +++ b/collects/scribblings/gui/menu-class.scrbl @@ -3,9 +3,9 @@ @defclass/title[menu% object% (menu-item-container<%> labelled-menu-item<%>)]{ -A @scheme[menu%] object is a submenu within a @scheme[menu%] or - @scheme[popup-menu%], or as a top-level menu in a - @scheme[menu-bar%]. +A @racket[menu%] object is a submenu within a @racket[menu%] or + @racket[popup-menu%], or as a top-level menu in a + @racket[menu-bar%]. @defconstructor[([label label-string?] @@ -16,22 +16,22 @@ A @scheme[menu%] object is a submenu within a @scheme[menu%] or Creates a new menu with the given label. -If @scheme[label] contains a @litchar{&}, it is handled specially; +If @racket[label] contains a @litchar{&}, it is handled specially; on Windows, the character following a @litchar{&} is underlined in the displayed menu title to indicate a keyboard mnemonic. Pressing and releasing the Alt key switches to menu-selection mode in the menu bar where mnemonic characters are used for navigation. An Alt combination might select a specific menu via @method[frame% - on-menu-char]. A @litchar{&&} in @scheme[label] is replaced by a + on-menu-char]. A @litchar{&&} in @racket[label] is replaced by a literal (non-navigation) @litchar{&}ampersand. On Unix and Mac OS X, @litchar{&}s in the label are parsed in the same way as for Windows, but no mnemonic underline is displayed. -If @scheme[help-string] is not @scheme[#f], the menu has a help +If @racket[help-string] is not @racket[#f], the menu has a help string. See @method[labelled-menu-item<%> get-help-string] for more information. -The @scheme[demand-callback] procedure is called by the default +The @racket[demand-callback] procedure is called by the default @method[menu-item-container<%> on-demand] method with the object itself. }} diff --git a/collects/scribblings/gui/menu-item-class.scrbl b/collects/scribblings/gui/menu-item-class.scrbl index 4f500e0b5a..05176db569 100644 --- a/collects/scribblings/gui/menu-item-class.scrbl +++ b/collects/scribblings/gui/menu-item-class.scrbl @@ -3,8 +3,8 @@ @defclass/title[menu-item% object% (selectable-menu-item<%>)]{ -A @scheme[menu-item%] is a plain string-labelled menu item. Its - parent must be a @scheme[menu%] or @scheme[popup-menu%]. When the +A @racket[menu-item%] is a plain string-labelled menu item. Its + parent must be a @racket[menu%] or @racket[popup-menu%]. When the user selects the menu item, its callback procedure is called. @@ -20,26 +20,26 @@ A @scheme[menu-item%] is a plain string-labelled menu item. Its 'shift 'option)) (get-default-shortcut-prefix)])]{ -Creates a new menu item in @scheme[parent]. The item is initially - shown, appended to the end of its parent. The @scheme[callback] - procedure is called (with the event type @indexed-scheme['menu]) when +Creates a new menu item in @racket[parent]. The item is initially + shown, appended to the end of its parent. The @racket[callback] + procedure is called (with the event type @indexed-racket['menu]) when the user selects the menu item (either via a menu bar, @xmethod[window<%> popup-menu], or @xmethod[editor-admin% popup-menu]). See @method[labelled-menu-item<%> set-label] for information about -mnemonic @litchar{&}s in @scheme[label]. +mnemonic @litchar{&}s in @racket[label]. -If @scheme[shortcut] is not @scheme[#f], the item has a shortcut. See +If @racket[shortcut] is not @racket[#f], the item has a shortcut. See @method[selectable-menu-item<%> get-shortcut] for more information. -The @scheme[shortcut-prefix] argument determines the set of modifier +The @racket[shortcut-prefix] argument determines the set of modifier keys for the shortcut; see @method[selectable-menu-item<%> get-shortcut-prefix]. -If @scheme[help] is not @scheme[#f], the item has a help string. See +If @racket[help] is not @racket[#f], the item has a help string. See @method[labelled-menu-item<%> get-help-string] for more information. -The @scheme[demand-callback] procedure is called by the default +The @racket[demand-callback] procedure is called by the default @method[menu-item-container<%> on-demand] method with the object itself. }} diff --git a/collects/scribblings/gui/menu-item-container-intf.scrbl b/collects/scribblings/gui/menu-item-container-intf.scrbl index 49b59fe206..f8284a6e90 100644 --- a/collects/scribblings/gui/menu-item-container-intf.scrbl +++ b/collects/scribblings/gui/menu-item-container-intf.scrbl @@ -3,8 +3,8 @@ @definterface/title[menu-item-container<%> ()]{ -A @scheme[menu-item-container<%>] object is a @scheme[menu%], - @scheme[popup-menu%], or @scheme[menu-bar%]. +A @racket[menu-item-container<%>] object is a @racket[menu%], + @racket[popup-menu%], or @racket[menu-bar%]. @defmethod[(get-items) @@ -37,7 +37,7 @@ If the container is not a menu bar or a popup menu, this method is } @methimpl{ -Calls the @scheme[demand-callback] procedure that was provided when +Calls the @racket[demand-callback] procedure that was provided when the object was created, then calls the @method[labelled-menu-item<%> on-demand] method of the contained items. diff --git a/collects/scribblings/gui/menu-item-intf.scrbl b/collects/scribblings/gui/menu-item-intf.scrbl index a2bc52c169..68256560ac 100644 --- a/collects/scribblings/gui/menu-item-intf.scrbl +++ b/collects/scribblings/gui/menu-item-intf.scrbl @@ -3,17 +3,17 @@ @definterface/title[menu-item<%> ()]{ -A @scheme[menu-item<%>] object is an element within a @scheme[menu%], - @scheme[popup-menu%], or @scheme[menu-bar%]. Operations that affect +A @racket[menu-item<%>] object is an element within a @racket[menu%], + @racket[popup-menu%], or @racket[menu-bar%]. Operations that affect the parent --- such as renaming the item, deleting the item, or adding a check beside the item --- are accomplished via the - @scheme[menu-item<%>] object. + @racket[menu-item<%>] object. -A menu item is either a @scheme[separator-menu-item%] object (merely - a separator), of a @scheme[labelled-menu-item<%>] object; the latter - is more specifically an instance of either @scheme[menu-item%] (a - plain menu item), @scheme[checkable-menu-item%] (a checkable menu - item), or @scheme[menu%] (a submenu). +A menu item is either a @racket[separator-menu-item%] object (merely + a separator), of a @racket[labelled-menu-item<%>] object; the latter + is more specifically an instance of either @racket[menu-item%] (a + plain menu item), @racket[checkable-menu-item%] (a checkable menu + item), or @racket[menu%] (a submenu). @defmethod[(delete) @@ -39,8 +39,8 @@ Returns the menu, popup menu, or menu bar containing the item. The @defmethod[(is-deleted?) boolean?]{ -Returns @scheme[#t] if the menu item is deleted from its parent, - @scheme[#f] otherwise. +Returns @racket[#t] if the menu item is deleted from its parent, + @racket[#f] otherwise. } diff --git a/collects/scribblings/gui/message-class.scrbl b/collects/scribblings/gui/message-class.scrbl index c1c71c9746..345ff6cef0 100644 --- a/collects/scribblings/gui/message-class.scrbl +++ b/collects/scribblings/gui/message-class.scrbl @@ -23,23 +23,23 @@ A message control is a static line of text or a static bitmap. The [stretchable-height any/c #f] [auto-resize any/c #f])]{ -Creates a string or bitmap message initially showing @scheme[label]. - @bitmaplabeluse[label] An @indexed-scheme['app], - @indexed-scheme['caution], or @indexed-scheme['stop] symbol for - @scheme[label] indicates an icon; @scheme['app] is the application +Creates a string or bitmap message initially showing @racket[label]. + @bitmaplabeluse[label] An @indexed-racket['app], + @indexed-racket['caution], or @indexed-racket['stop] symbol for + @racket[label] indicates an icon; @racket['app] is the application icon (Windows and Mac OS X) or a generic ``info'' icon (X), - @scheme['caution] is a caution-sign icon, and @scheme['stop] is a + @racket['caution] is a caution-sign icon, and @racket['stop] is a stop-sign icon. @labelsimplestripped[(scheme label) @elem{message}] -@DeletedStyleNote[@scheme[style] @scheme[parent]]{message} +@DeletedStyleNote[@racket[style] @racket[parent]]{message} -@FontKWs[@scheme[font]] @WindowKWs[@scheme[enabled]] @SubareaKWs[] @AreaKWs[] +@FontKWs[@racket[font]] @WindowKWs[@racket[enabled]] @SubareaKWs[] @AreaKWs[] -If @scheme[auto-resize] is not @scheme[#f], then automatic resizing is +If @racket[auto-resize] is not @racket[#f], then automatic resizing is initially enanbled (see @method[message% auto-resize]), and the -@scheme[message%] object's @tech{graphical minimum size} is as small as +@racket[message%] object's @tech{graphical minimum size} is as small as possible. } @@ -47,7 +47,7 @@ possible. @defmethod*[([(auto-resize) boolean?] [(auto-resize [on? any/c]) void?])]{ -Reports or sets whether the @scheme[message%]'s @method[area<%> min-width] and +Reports or sets whether the @racket[message%]'s @method[area<%> min-width] and @method[area<%> min-height] are automatically set when the label is changed via @method[message% set-label]. @@ -57,7 +57,7 @@ via @method[message% set-label]. (set-label [label (or/c label-string? (is-a?/c bitmap%))]) void?]{ -The same as @xmethod[window<%> set-label] when @scheme[label] is a +The same as @xmethod[window<%> set-label] when @racket[label] is a string. Otherwise, sets the bitmap label for a bitmap message. diff --git a/collects/scribblings/gui/miscwin-funcs.scrbl b/collects/scribblings/gui/miscwin-funcs.scrbl index 06cddb18da..38577952dd 100644 --- a/collects/scribblings/gui/miscwin-funcs.scrbl +++ b/collects/scribblings/gui/miscwin-funcs.scrbl @@ -16,14 +16,12 @@ @defproc[(begin-busy-cursor) void?]{ Changes the cursor to a watch cursor for all windows in the current eventspace. -Use -@racket[end-busy-cursor] to revert the cursor back to its previous state. Calls to -@racket[begin-busy-cursor] and -@racket[end-busy-cursor] can be nested arbitrarily. +Use @racket[end-busy-cursor] to revert the cursor back to its previous +state. Calls to @racket[begin-busy-cursor] and @racket[end-busy-cursor] can be +nested arbitrarily. -The cursor installed by -@racket[begin-busy-cursor] overrides any window-specific cursors installed with -@method[window<%> set-cursor]. +The cursor installed by @racket[begin-busy-cursor] overrides any +window-specific cursors installed with @method[window<%> set-cursor]. See also @racket[is-busy?]. } @@ -86,8 +84,6 @@ The result depends on @racket[what], and a @racket[#f] result is only ] - - } @@ -318,18 +314,18 @@ The background behind @racket[on] is unspecified, so @racket[on] that is used for drawing, and @racket[off-x] and @racket[off-y] similarly specify an offset within @racket[off]. -The blit is automatically unregistered if @scheme[canvas] becomes +The blit is automatically unregistered if @racket[canvas] becomes invisible and inaccessible. Multiple registrations can be installed - for the same @scheme[canvas]. + for the same @racket[canvas]. -See also @scheme[unregister-collecting-blit].} +See also @racket[unregister-collecting-blit].} @defproc[(unregister-collecting-blit [canvas (is-a?/c canvas%)]) void?]{ Unregisters all blit requests installed for @racket[canvas] with - @scheme[register-collecting-blit].} + @racket[register-collecting-blit].} @defproc[(send-message-to-window [x (integer-in -10000 10000)] @@ -372,7 +368,7 @@ See @racket[clipboard<%>]. @defproc[(label-string? [v any/c]) boolean?]{ Returns @racket[#t] if @racket[v] is a string whose length is less than or equal to @racket[200]. - + This predicate is typically used as the contract for strings that appear in GUI objects. In some cases, such as the label in a @racket[button%] or @racket[menu-item%] object, the character @litchar{&} is treated specially diff --git a/collects/scribblings/gui/mouse-event-class.scrbl b/collects/scribblings/gui/mouse-event-class.scrbl index c37d3b98aa..dea4779ee5 100644 --- a/collects/scribblings/gui/mouse-event-class.scrbl +++ b/collects/scribblings/gui/mouse-event-class.scrbl @@ -3,7 +3,7 @@ @defclass/title[mouse-event% event% ()]{ -A @scheme[mouse-event%] object encapsulates a mouse event. +A @racket[mouse-event%] object encapsulates a mouse event. Mouse events are primarily processed by @xmethod[window<%> on-subwindow-event] and @xmethod[canvas<%> on-event]. @@ -32,34 +32,34 @@ Creates a mouse event for a particular type of event. The event types are: @itemize[ -@item{@scheme['enter] --- mouse pointer entered the window} -@item{@scheme['leave] --- mouse pointer left the window} -@item{@scheme['left-down] --- left mouse button pressed} -@item{@scheme['left-up] --- left mouse button released} -@item{@scheme['middle-down] --- middle mouse button pressed} -@item{@scheme['middle-up] --- middle mouse button released} -@item{@scheme['right-down] --- right mouse button pressed (Mac OS X: click with control key pressed)} -@item{@scheme['right-up] --- right mouse button released (Mac OS X: release with control key pressed)} -@item{@scheme['motion] --- mouse moved, with or without button(s) pressed} +@item{@racket['enter] --- mouse pointer entered the window} +@item{@racket['leave] --- mouse pointer left the window} +@item{@racket['left-down] --- left mouse button pressed} +@item{@racket['left-up] --- left mouse button released} +@item{@racket['middle-down] --- middle mouse button pressed} +@item{@racket['middle-up] --- middle mouse button released} +@item{@racket['right-down] --- right mouse button pressed (Mac OS X: click with control key pressed)} +@item{@racket['right-up] --- right mouse button released (Mac OS X: release with control key pressed)} +@item{@racket['motion] --- mouse moved, with or without button(s) pressed} ] -See the corresponding @schemeidfont{get-} and @schemeidfont{set-} - methods for information about @scheme[left-down], - @scheme[middle-down], @scheme[right-down], @scheme[x], @scheme[y], - @scheme[shift-down], @scheme[control-down], @scheme[meta-down], - @scheme[alt-down], @scheme[time-stamp], and @scheme[caps-down]. +See the corresponding @racketidfont{get-} and @racketidfont{set-} + methods for information about @racket[left-down], + @racket[middle-down], @racket[right-down], @racket[x], @racket[y], + @racket[shift-down], @racket[control-down], @racket[meta-down], + @racket[alt-down], @racket[time-stamp], and @racket[caps-down]. } @defmethod[(button-changed? [button (or/c 'left 'middle 'right 'any) 'any]) boolean?]{ -Returns @scheme[#t] if this was a mouse button press or release event, - @scheme[#f] otherwise. See also +Returns @racket[#t] if this was a mouse button press or release event, + @racket[#f] otherwise. See also @method[mouse-event% button-up?] and @method[mouse-event% button-down?]. -If @scheme[button] is not @scheme['any], then @scheme[#t] is only returned +If @racket[button] is not @racket['any], then @racket[#t] is only returned if it is a release event for a specific button. } @@ -67,10 +67,10 @@ If @scheme[button] is not @scheme['any], then @scheme[#t] is only returned @defmethod[(button-down? [button (or/c 'left 'middle 'right 'any) 'any]) boolean?]{ -Returns @scheme[#t] if the event is for a button press, @scheme[#f] +Returns @racket[#t] if the event is for a button press, @racket[#f] otherwise. -If @scheme[button] is not @scheme['any], then @scheme[#t] is only returned +If @racket[button] is not @racket['any], then @racket[#t] is only returned if it is a press event for a specific button. } @@ -78,11 +78,11 @@ If @scheme[button] is not @scheme['any], then @scheme[#t] is only returned @defmethod[(button-up? [button (or/c 'left 'middle 'right 'any) 'any]) boolean?]{ -Returns @scheme[#t] if the event is for a button release, @scheme[#f] +Returns @racket[#t] if the event is for a button release, @racket[#f] otherwise. (As noted in @|mousekeydiscuss|, button release events are sometimes dropped.) -If @scheme[button] is not @scheme['any], then @scheme[#t] is only returned +If @racket[button] is not @racket['any], then @racket[#t] is only returned if it is a release event for a specific button. } @@ -90,16 +90,16 @@ If @scheme[button] is not @scheme['any], then @scheme[#t] is only returned @defmethod[(dragging?) boolean?]{ -Returns @scheme[#t] if this was a dragging event (motion while a button - is pressed), @scheme[#f] otherwise. +Returns @racket[#t] if this was a dragging event (motion while a button + is pressed), @racket[#f] otherwise. } @defmethod[(entering?) boolean?]{ -Returns @scheme[#t] if this event is for the mouse entering a window, - @scheme[#f] otherwise. +Returns @racket[#t] if this event is for the mouse entering a window, + @racket[#f] otherwise. When the mouse button is up, an enter/leave event notifies a window that it will start/stop receiving mouse events. When the mouse button @@ -116,7 +116,7 @@ When the mouse button is up, an enter/leave event notifies a window @defmethod[(get-alt-down) boolean?]{ -Returns @scheme[#t] if the Option (Mac OS X) key was down for the +Returns @racket[#t] if the Option (Mac OS X) key was down for the event. When the Alt key is pressed in Windows, it is reported as a Meta press (see @method[mouse-event% get-meta-down]). @@ -125,19 +125,19 @@ Returns @scheme[#t] if the Option (Mac OS X) key was down for the @defmethod[(get-caps-down) boolean?]{ -Returns @scheme[#t] if the Caps Lock key was on for the event. +Returns @racket[#t] if the Caps Lock key was on for the event. } @defmethod[(get-control-down) boolean?]{ -Returns @scheme[#t] if the Control key was down for the event. +Returns @racket[#t] if the Control key was down for the event. On Mac OS X, if a control-key press is combined with a mouse button click, the event is reported as a right-button click and @method[mouse-event% get-control-down] for the event reports - @scheme[#f]. + @racket[#f]. } @@ -146,7 +146,7 @@ On Mac OS X, if a control-key press is combined with a mouse button 'middle-down 'middle-up 'right-down 'right-up 'motion)]{ -Returns the type of the event; see @scheme[mouse-event%] for +Returns the type of the event; see @racket[mouse-event%] for information about each event type. See also @method[mouse-event% set-event-type]. @@ -154,14 +154,14 @@ set-event-type]. @defmethod[(get-left-down) boolean?]{ -Returns @scheme[#t] if the left mouse button was down (but not pressed) during the event. +Returns @racket[#t] if the left mouse button was down (but not pressed) during the event. } @defmethod[(get-meta-down) boolean?]{ -Returns @scheme[#t] if the Meta (Unix), Alt (Windows), or Command (Mac OS +Returns @racket[#t] if the Meta (Unix), Alt (Windows), or Command (Mac OS X) key was down for the event. } @@ -169,7 +169,7 @@ Returns @scheme[#t] if the Meta (Unix), Alt (Windows), or Command (Mac OS @defmethod[(get-middle-down) boolean?]{ -Returns @scheme[#t] if the middle mouse button was down (but not +Returns @racket[#t] if the middle mouse button was down (but not pressed) for the event. On Mac OS X, a middle-button click is impossible. @@ -178,7 +178,7 @@ Returns @scheme[#t] if the middle mouse button was down (but not @defmethod[(get-right-down) boolean?]{ -Returns @scheme[#t] if the right mouse button was down (but not +Returns @racket[#t] if the right mouse button was down (but not pressed) for the event. On Mac OS X, a control-click combination is treated as a right-button click. @@ -187,7 +187,7 @@ Returns @scheme[#t] if the right mouse button was down (but not @defmethod[(get-shift-down) boolean?]{ -Returns @scheme[#t] if the Shift key was down for the event. +Returns @racket[#t] if the Shift key was down for the event. } @@ -210,8 +210,8 @@ Returns the y-position of the mouse at the time of the event in the @defmethod[(leaving?) boolean?]{ -Returns @scheme[#t] if this event is for the mouse leaving a window, - @scheme[#f] otherwise. +Returns @racket[#t] if this event is for the mouse leaving a window, + @racket[#f] otherwise. See @method[mouse-event% entering?] for information about enter and leave events while the mouse button is clicked. @@ -221,8 +221,8 @@ leave events while the mouse button is clicked. @defmethod[(moving?) boolean?]{ -Returns @scheme[#t] if this was a moving event (whether a button is - pressed is not), @scheme[#f] otherwise. +Returns @racket[#t] if this was a moving event (whether a button is + pressed is not), @racket[#f] otherwise. } @@ -250,7 +250,7 @@ Sets whether the Control key was down for the event. On Mac OS X, if a control-key press is combined with a mouse button click, the event is reported as a right-button click and @method[mouse-event% get-control-down] for the event reports - @scheme[#f]. + @racket[#f]. } @@ -259,7 +259,7 @@ On Mac OS X, if a control-key press is combined with a mouse button 'right-down 'right-up 'motion)]) void?]{ -Sets the type of the event; see @scheme[mouse-event%] for information +Sets the type of the event; see @racket[mouse-event%] for information about each event type. See also @method[mouse-event% get-event-type]. } diff --git a/collects/scribblings/gui/mult-color-intf.scrbl b/collects/scribblings/gui/mult-color-intf.scrbl index a8831b9585..94a8fc3b3f 100644 --- a/collects/scribblings/gui/mult-color-intf.scrbl +++ b/collects/scribblings/gui/mult-color-intf.scrbl @@ -3,9 +3,9 @@ @definterface/title[mult-color<%> ()]{ -A @scheme[mult-color<%>] object is used to scale the RGB values of a - @scheme[color%] object. A @scheme[mult-color<%>] object exist only - within a @scheme[style-delta%] object. +A @racket[mult-color<%>] object is used to scale the RGB values of a + @racket[color%] object. A @racket[mult-color<%>] object exist only + within a @racket[style-delta%] object. See also @method[style-delta% get-foreground-mult] and @method[style-delta% get-background-mult]. diff --git a/collects/scribblings/gui/pane-class.scrbl b/collects/scribblings/gui/pane-class.scrbl index 6434c8d75e..5741bfaa9e 100644 --- a/collects/scribblings/gui/pane-class.scrbl +++ b/collects/scribblings/gui/pane-class.scrbl @@ -4,15 +4,15 @@ @defclass/title[pane% object% (area-container<%> subarea<%>)]{ A pane is a both a container and a containee area. It serves only - as a geometry management device. A @scheme[pane%] - cannot be hidden or disabled like a @scheme[panel%] object. + as a geometry management device. A @racket[pane%] + cannot be hidden or disabled like a @racket[panel%] object. -A @scheme[pane%] object has a degenerate placement strategy for +A @racket[pane%] object has a degenerate placement strategy for managing its children; it places them all in the upper left corner - and does not stretch any of them. The @scheme[horizontal-pane%] and - @scheme[vertical-pane%] classes provide useful geometry management. + and does not stretch any of them. The @racket[horizontal-pane%] and + @racket[vertical-pane%] classes provide useful geometry management. -See also @scheme[grow-box-spacer-pane%]. +See also @racket[grow-box-spacer-pane%]. @defconstructor[([parent (or/c (is-a?/c frame%) (is-a?/c dialog%) diff --git a/collects/scribblings/gui/panel-class.scrbl b/collects/scribblings/gui/panel-class.scrbl index ad817e6e7d..5c1e457caa 100644 --- a/collects/scribblings/gui/panel-class.scrbl +++ b/collects/scribblings/gui/panel-class.scrbl @@ -4,14 +4,14 @@ @defclass/title[panel% object% (area-container-window<%> subwindow<%>)]{ A panel is a both a container and a containee window. It serves mainly - as a geometry management device, but the @scheme['border] creates a - container with a border. Unlike a @scheme[pane%] object, a @scheme[panel%] + as a geometry management device, but the @racket['border] creates a + container with a border. Unlike a @racket[pane%] object, a @racket[panel%] object can be hidden or disabled. -A @scheme[panel%] object has a degenerate placement strategy for +A @racket[panel%] object has a degenerate placement strategy for managing its children; it places them all in the upper left corner - and does not stretch any of them. The @scheme[horizontal-panel%] - and @scheme[vertical-panel%] classes provide useful geometry + and does not stretch any of them. The @racket[horizontal-panel%] + and @racket[vertical-panel%] classes provide useful geometry management. @@ -33,9 +33,9 @@ A @scheme[panel%] object has a degenerate placement strategy for [stretchable-width any/c #t] [stretchable-height any/c #t])]{ -If the @scheme['border] style is specified, the window is created with +If the @racket['border] style is specified, the window is created with a thin border (in which case the client size of the panel may be - less than its total size). @DeletedStyleNote[@scheme[style] @scheme[parent]]{panel} + less than its total size). @DeletedStyleNote[@racket[style] @racket[parent]]{panel} If the @racket['hscroll] or @racket['vscroll] style is specified, then the panel includes a scrollbar in the corresponding direction, and @@ -48,7 +48,7 @@ If the @racket['hscroll] or @racket['vscroll] style is specified, then children subareas are placed using the default algorithm for a @racket[panel%], @racket[vertical-panel%], or @racket[horizontal-panel%]. -@WindowKWs[@scheme[enabled]] @SubareaKWs[] @AreaContKWs[] @AreaKWs[] +@WindowKWs[@racket[enabled]] @SubareaKWs[] @AreaContKWs[] @AreaKWs[] }} diff --git a/collects/scribblings/gui/pasteboard-class.scrbl b/collects/scribblings/gui/pasteboard-class.scrbl index 103b928f19..7921552bc1 100644 --- a/collects/scribblings/gui/pasteboard-class.scrbl +++ b/collects/scribblings/gui/pasteboard-class.scrbl @@ -3,18 +3,18 @@ @defclass/title[pasteboard% object% (editor<%>)]{ -A @scheme[pasteboard%] object is an editor for displaying snips with +A @racket[pasteboard%] object is an editor for displaying snips with arbitrary @techlink{location}s. @defconstructor[()]{ The editor will not be displayed until it is attached to an - @scheme[editor-canvas%] object or some other @techlink{display}. + @racket[editor-canvas%] object or some other @techlink{display}. -A new @scheme[keymap%] object is created for the new editor. See also +A new @racket[keymap%] object is created for the new editor. See also @method[editor<%> get-keymap] and @method[editor<%> set-keymap]. -A new @scheme[style-list%] object is created for the new editor. See +A new @racket[style-list%] object is created for the new editor. See also @method[editor<%> get-style-list] and @method[editor<%> set-style-list]. @@ -115,7 +115,7 @@ Does nothing. Called after the user stops interactively resizing a snip (the one that is currently selected; see @method[pasteboard% - find-next-selected-snip]). The @scheme[snip] argument is the snip + find-next-selected-snip]). The @racket[snip] argument is the snip that was resized. See also @method[pasteboard% can-interactive-resize?] and @@ -142,7 +142,7 @@ Called after a given snip is moved within the editor (and after the and @method[editor<%> begin-edit-sequence] to avoid extra refreshes when @method[pasteboard% after-move-to] modifies the editor). -If @scheme[dragging?] is not @scheme[#f], then this move was a temporary +If @racket[dragging?] is not @racket[#f], then this move was a temporary move for dragging. See also @@ -172,8 +172,8 @@ Called before a snip is moved in the pasteboard's front-to-back snip begin-edit-sequence] to avoid extra refreshes when @method[pasteboard% after-reorder] modifies the editor). -If @scheme[before?] is @scheme[#t], then @scheme[snip] was moved before - @scheme[to-snip], otherwise @scheme[snip] was moved after @scheme[to-snip]. +If @racket[before?] is @racket[#t], then @racket[snip] was moved before + @racket[to-snip], otherwise @racket[snip] was moved after @racket[to-snip]. See also @method[pasteboard% can-reorder?] and @method[editor<%> on-edit-sequence]. @@ -202,7 +202,7 @@ Called after a given snip is resized (and after the @techlink{display} @method[pasteboard% after-resize] modifies the editor), or after an unsuccessful resize attempt was made. -If @scheme[resized?] is not @scheme[#f], the snip was successfully +If @racket[resized?] is not @racket[#f], the snip was successfully resized. See also @method[pasteboard% can-resize?] and @method[editor<%> @@ -230,8 +230,8 @@ Called after a snip in the pasteboard is selected or deselected. See selected snip is deleted (and thus de-selected indirectly); see also @method[pasteboard% after-delete]. -If @scheme[on?] is @scheme[#t], then @scheme[snip] was just selected, - otherwise @scheme[snip] was just deselected. +If @racket[on?] is @racket[#t], then @racket[snip] was just selected, + otherwise @racket[snip] was just deselected. See also @method[pasteboard% can-select?] and @method[editor<%> on-edit-sequence]. @@ -253,7 +253,7 @@ Does nothing. @methspec{ Called before a snip is deleted from the editor. - If the return value is @scheme[#f], then the + If the return value is @racket[#f], then the delete will be aborted. See also @method[pasteboard% on-delete] and @method[pasteboard% @@ -265,7 +265,7 @@ The editor is internally locked for writing when this method is called (see } @methimpl{ -Returns @scheme[#t]. +Returns @racket[#t]. } } @@ -280,7 +280,7 @@ Returns @scheme[#t]. @methspec{ Called before a snip is inserted from the editor. If the return value - is @scheme[#f], then the insert will be aborted. + is @racket[#f], then the insert will be aborted. See also @method[pasteboard% on-insert] and @method[pasteboard% after-insert]. @@ -291,7 +291,7 @@ The editor is internally locked for writing when this method is called (see } @methimpl{ -Returns @scheme[#t]. +Returns @racket[#t]. } } @@ -306,7 +306,7 @@ Returns @scheme[#t]. Called when the user starts interactively dragging snips (the ones that are selected; see @method[pasteboard% find-next-selected-snip]). All of the selected snips will be - moved. If @scheme[#f] is returned, the interactive move is + moved. If @racket[#f] is returned, the interactive move is disallowed. The mouse event that started the move (usually a button-down event) is provided. @@ -317,7 +317,7 @@ See also @method[pasteboard% on-interactive-move], @method[pasteboard% } @methimpl{ -Returns @scheme[#t]. +Returns @racket[#t]. }} @@ -329,10 +329,10 @@ Returns @scheme[#t]. Called when the user starts interactively resizing a snip (the one that is selected; see @method[pasteboard% - find-next-selected-snip]). If @scheme[#f] is returned, the + find-next-selected-snip]). If @racket[#f] is returned, the interactive resize is disallowed. -The @scheme[snip] argument is the snip that will be resized. +The @racket[snip] argument is the snip that will be resized. See also @method[pasteboard% after-interactive-resize], @method[pasteboard% after-interactive-resize], and @@ -341,7 +341,7 @@ See also @method[pasteboard% after-interactive-resize], } @methimpl{ -Returns @scheme[#t]. +Returns @racket[#t]. }} @@ -355,9 +355,9 @@ Returns @scheme[#t]. @methspec{ Called before a snip is moved in the editor. If the return value is - @scheme[#f], then the move will be aborted. + @racket[#f], then the move will be aborted. -If @scheme[dragging?] is not @scheme[#f], then this move is a +If @racket[dragging?] is not @racket[#f], then this move is a temporary move for dragging. See also @method[pasteboard% on-move-to] and @method[pasteboard% @@ -369,7 +369,7 @@ The editor is internally locked for writing when this method is called } @methimpl{ -Returns @scheme[#t]. +Returns @racket[#t]. }} @@ -382,12 +382,12 @@ Returns @scheme[#t]. @methspec{ Called before a snip is moved in the pasteboard's front-to-back snip - order. If the return value is @scheme[#f], then the reordering will + order. If the return value is @racket[#f], then the reordering will be aborted. -If @scheme[before?] is @scheme[#t], then @scheme[snip] is to be moved before - @scheme[to-snip], otherwise @scheme[snip] is to be moved after - @scheme[to-snip]. +If @racket[before?] is @racket[#t], then @racket[snip] is to be moved before + @racket[to-snip], otherwise @racket[snip] is to be moved after + @racket[to-snip]. See also @method[pasteboard% on-reorder] and @method[pasteboard% after-reorder]. @@ -398,7 +398,7 @@ The editor is internally locked for writing when this method is called (see } @methimpl{ -Returns @scheme[#t]. +Returns @racket[#t]. }} @@ -412,7 +412,7 @@ Returns @scheme[#t]. @methspec{ Called before a snip is resized in the editor. If the return value is - @scheme[#f], then the resize will be aborted. + @racket[#f], then the resize will be aborted. See also @method[pasteboard% on-resize] and @method[pasteboard% after-resize]. @@ -423,7 +423,7 @@ The editor is internally locked for writing when this method is called (see } @methimpl{ -Returns @scheme[#t]. +Returns @racket[#t]. }} @@ -434,13 +434,13 @@ Returns @scheme[#t]. @methspec{ This method is called before a snip in the pasteboard is selected or - deselected. If @scheme[#f] is returned, the selection change is + deselected. If @racket[#f] is returned, the selection change is disallowed. This method is not called when a selected snip is to be deleted (and thus de-selected indirectly); see also @method[pasteboard% can-delete?]. -If @scheme[on?] is @scheme[#t], then @scheme[snip] will be selected, -otherwise @scheme[snip] will be deselected. +If @racket[on?] is @racket[#t], then @racket[snip] will be selected, +otherwise @racket[snip] will be deselected. See also @method[pasteboard% on-select] and @method[pasteboard% after-select]. @@ -451,7 +451,7 @@ The editor is internally locked for writing when this method is called (see } @methimpl{ -Returns @scheme[#t]. +Returns @racket[#t]. }} @@ -460,19 +460,19 @@ Returns @scheme[#t]. [snip (or/c (is-a?/c snip%) #f) #f]) void?])]{ -Changes the style of @scheme[snip] to a specific style or by applying - a style delta. If @scheme[snip] is @scheme[#f], then all currently - selected snips are changed. If @scheme[style] is @scheme[#f], then +Changes the style of @racket[snip] to a specific style or by applying + a style delta. If @racket[snip] is @racket[#f], then all currently + selected snips are changed. If @racket[style] is @racket[#f], then the default style is used, according to @method[editor<%> default-style-name]. To change a large collection of snips from one style to another style, - consider providing a @scheme[style<%>] instance rather than a - @scheme[style-delta%] instance. Otherwise, @method[pasteboard% - change-style] must convert the @scheme[style-delta%] instance to the - @scheme[style<%>] instance for every snip; this conversion consumes + consider providing a @racket[style<%>] instance rather than a + @racket[style-delta%] instance. Otherwise, @method[pasteboard% + change-style] must convert the @racket[style-delta%] instance to the + @racket[style<%>] instance for every snip; this conversion consumes both time and (temporary) memory. -When a @scheme[style] is provided: @InStyleListNote[@scheme[style]] +When a @racket[style] is provided: @InStyleListNote[@racket[style]] } @@ -483,7 +483,7 @@ When a @scheme[style] is provided: @InStyleListNote[@scheme[style]] In addition to the default @xmethod[editor<%> copy-self-to] work, the dragability, selection visibility state, and scroll step of - @this-obj[] are installed into @scheme[dest]. + @this-obj[] are installed into @racket[dest]. } @@ -493,8 +493,8 @@ In addition to the default @xmethod[editor<%> copy-self-to] work, the [(delete [snip (is-a?/c snip%)]) void?])]{ -Deletes @scheme[snip] when provided, or deletes the currently selected - snips from the editor when @scheme[snip] is not provided. +Deletes @racket[snip] when provided, or deletes the currently selected + snips from the editor when @racket[snip] is not provided. @MonitorMethod[@elem{The content of an editor} @elem{the system in response to other method @@ -514,15 +514,15 @@ Called to copy the editor's current selection into the clipboard. Do not call this method directly; instead, call @method[editor<%> copy]. -See @|timediscuss| for a discussion of the @scheme[time] argument. If - @scheme[time] is outside the platform-specific range of times, +See @|timediscuss| for a discussion of the @racket[time] argument. If + @racket[time] is outside the platform-specific range of times, @|MismatchExn|. } @methimpl{ Copies the current selection, extending the current clipboard contexts - if @scheme[extend?] is true. + if @racket[extend?] is true. }} @@ -536,8 +536,8 @@ Called to paste the current contents of the clipboard into the editor. Do not call this method directly; instead, call @method[editor<%> paste]. -See @|timediscuss| for a discussion of the @scheme[time] argument. If - @scheme[time] is outside the platform-specific range of times, +See @|timediscuss| for a discussion of the @racket[time] argument. If + @racket[time] is outside the platform-specific range of times, @|MismatchExn|. } @@ -558,8 +558,8 @@ Called to paste the current contents of the X11 selection on Unix (or not call this method directly; instead, call @method[editor<%> paste-x-selection]. -See @|timediscuss| for a discussion of the @scheme[time] argument. If - @scheme[time] is outside the platform-specific range of times, +See @|timediscuss| for a discussion of the @racket[time] argument. If + @racket[time] is outside the platform-specific range of times, @|MismatchExn|. } @@ -584,11 +584,11 @@ See also @method[pasteboard% delete]. (or/c (is-a?/c snip%) false/c)]{ Returns the next selected snip in the editor, starting the search - after @scheme[start]. (@|seesniporderdiscuss|) If @scheme[start] is @scheme[#f], + after @racket[start]. (@|seesniporderdiscuss|) If @racket[start] is @racket[#f], then the search starts with the first snip in the editor (and thus returns the first selected snip, if any are selected). If no more - selected snips are available, or if @scheme[start] is not in the - pasteboard, @scheme[#f] is returned. + selected snips are available, or if @racket[start] is not in the + pasteboard, @racket[#f] is returned. } @@ -601,11 +601,11 @@ Returns the next selected snip in the editor, starting the search Finds the frontmost snip (after a given snip) that intersects a given @techlink{location}. @|seesniporderdiscuss| -The @scheme[x] and @scheme[y] arguments are in editor coordinates. If - @scheme[after] is not supplied, the frontmost snip at @scheme[x] and - @scheme[y] is returned, otherwise the frontmost snip behind @scheme[after] - is returned. If @scheme[after] is a snip that is not in the pasteboard, - @scheme[#f] is returned. +The @racket[x] and @racket[y] arguments are in editor coordinates. If + @racket[after] is not supplied, the frontmost snip at @racket[x] and + @racket[y] is returned, otherwise the frontmost snip behind @racket[after] + is returned. If @racket[after] is a snip that is not in the pasteboard, + @racket[#f] is returned. @|OVD| @@ -626,8 +626,8 @@ the second result is the y-coordinate of the center. boolean?]{ Returns whether snips in the editor can be interactively dragged by - event handling in @method[pasteboard% on-default-event]: @scheme[#t] - if dragging is allowed, @scheme[#f] otherwise. By default, dragging + event handling in @method[pasteboard% on-default-event]: @racket[#t] + if dragging is allowed, @racket[#f] otherwise. By default, dragging is allowed. See also @method[pasteboard% set-dragable]. } @@ -667,11 +667,11 @@ Returns whether selection dots are drawn around the edge of selected [before (or/c (is-a?/c snip%) false/c)]) void?])]{ -Inserts @scheme[snip] at @techlink{location} @math{(@scheme[x], - @scheme[y])} just in front of - @scheme[before]. (@|seesniporderdiscuss|) If @scheme[before] is not - provided or is @scheme[#f], then @scheme[snip] is inserted behind all - other snips. If @scheme[x] and @scheme[y] are not provided, the snip +Inserts @racket[snip] at @techlink{location} @math{(@racket[x], + @racket[y])} just in front of + @racket[before]. (@|seesniporderdiscuss|) If @racket[before] is not + provided or is @racket[#f], then @racket[snip] is inserted behind all + other snips. If @racket[x] and @racket[y] are not provided, the snip is added at @math{(0, 0)}. } @@ -696,8 +696,8 @@ See also } @methimpl{ -A negative value for either @scheme[x] or @scheme[y] is replaced with - @scheme[0]. +A negative value for either @racket[x] or @racket[y] is replaced with + @racket[0]. }} @@ -752,8 +752,8 @@ Does nothing. @defmethod[(is-selected? [snip (is-a?/c snip%)]) boolean?]{ -Returns @scheme[#t] if a specified snip is currently selected or - @scheme[#f] otherwise. +Returns @racket[#t] if a specified snip is currently selected or + @racket[#f] otherwise. } @@ -777,8 +777,8 @@ See also @method[pasteboard% raise], @method[pasteboard% set-before], [y real?]) void?])]{ -Moves @scheme[snip] right @scheme[x] pixels and down @scheme[y] - pixels. If @scheme[snip] is not provided, then all selected snips +Moves @racket[snip] right @racket[x] pixels and down @racket[y] + pixels. If @racket[snip] is not provided, then all selected snips are moved. @|OnMoveNote| @@ -791,7 +791,7 @@ Moves @scheme[snip] right @scheme[x] pixels and down @scheme[y] [y real?]) void?]{ -Moves @scheme[snip] to a given @techlink{location} in the editor. +Moves @racket[snip] to a given @techlink{location} in the editor. @|OnMoveNote| @@ -865,7 +865,7 @@ This method is called when the user double-clicks on a snip in the } @methimpl{ -If @scheme[snip] accepts events, it is designated as the caret owner +If @racket[snip] accepts events, it is designated as the caret owner and all snips in the editor are unselected. }} @@ -926,7 +926,7 @@ Called when the user starts interactively resizing a snip (the one after-interactive-resize] method is guaranteed to be called after the resize has completed. -The @scheme[snip] argument is the snip that will be resized. +The @racket[snip] argument is the snip that will be resized. } @methimpl{ @@ -949,7 +949,7 @@ Called before a snip is moved in the editor, after @method[pasteboard% @method[pasteboard% after-move-to] method is guaranteed to be called after the move has completed. -If @scheme[dragging?] is not @scheme[#f], then this move is a +If @racket[dragging?] is not @racket[#f], then this move is a temporary move for dragging. The editor is internally locked for writing when this method is called @@ -978,9 +978,9 @@ Called before a snip is moved in the pasteboard's front-to-back snip that the reorder is allowed. The @method[pasteboard% after-reorder] method is guaranteed to be called after the reorder has completed. -If @scheme[before?] is @scheme[#t], then @scheme[snip] is to be moved - before @scheme[to-snip], otherwise @scheme[snip] is to be moved after - @scheme[to-snip]. +If @racket[before?] is @racket[#t], then @racket[snip] is to be moved + before @racket[to-snip], otherwise @racket[snip] is to be moved after + @racket[to-snip]. The editor is internally locked for writing when this method is called (see also @|lockdiscuss|). Use @method[pasteboard% after-reorder] to @@ -1035,8 +1035,8 @@ Called before a snip in the pasteboard is selected or deselected, method is not called when a selected snip is to be deleted (and thus de-selected indirectly); see also @method[pasteboard% on-delete] . -If @scheme[on?] is @scheme[#t], then @scheme[snip] will be selected, - otherwise @scheme[snip] will be deselected. +If @racket[on?] is @racket[#t], then @racket[snip] will be selected, + otherwise @racket[snip] will be deselected. The editor is internally locked for writing when this method is called (see also @|lockdiscuss|). Use @method[pasteboard% after-select] to @@ -1077,7 +1077,7 @@ See also @method[pasteboard% delete]. @defmethod[(remove-selected [snip (is-a?/c snip%)]) void?]{ -Deselects @scheme[snip] (if it is currently selected) without +Deselects @racket[snip] (if it is currently selected) without deselecting any other snips. @|OnSelectNote| @@ -1091,7 +1091,7 @@ Deselects @scheme[snip] (if it is currently selected) without boolean?]{ Attempts to resize a given snip. If the snip allows resizing, - @scheme[#t] is returned, otherwise @scheme[#f] is returned. Using + @racket[#t] is returned, otherwise @racket[#f] is returned. Using this method instead of calling the snip's @method[snip% resize] method directly will make the resize undo-able. @@ -1102,8 +1102,8 @@ Attempts to resize a given snip. If the snip allows resizing, [after (or/c (is-a?/c snip%) false/c)]) void?]{ -Changes the depth of @scheme[snip] moving it just behind - @scheme[after]. If @scheme[after] is @scheme[#f], @scheme[snip] is +Changes the depth of @racket[snip] moving it just behind + @racket[after]. If @racket[after] is @racket[#f], @racket[snip] is moved to the back. @|seesniporderdiscuss| See also @method[pasteboard% raise], @method[pasteboard% lower], and @@ -1116,8 +1116,8 @@ See also @method[pasteboard% raise], @method[pasteboard% lower], and [before (or/c (is-a?/c snip%) false/c)]) void?]{ -Changes the depth of @scheme[snip] moving it just in front of - @scheme[before]. If @scheme[before] is @scheme[#f], @scheme[snip] is +Changes the depth of @racket[snip] moving it just in front of + @racket[before]. If @racket[before] is @racket[#f], @racket[snip] is moved to the front. @|seesniporderdiscuss| See also @method[pasteboard% raise], @method[pasteboard% lower], and @@ -1131,7 +1131,7 @@ See also @method[pasteboard% raise], @method[pasteboard% lower], and Sets whether snips in the editor can be interactively dragged by event handling in @method[pasteboard% on-default-event]: a true value - allows dragging, @scheme[#f] disallows dragging. See also + allows dragging, @racket[#f] disallows dragging. See also @method[pasteboard% get-dragable]. } diff --git a/collects/scribblings/gui/popup-menu-class.scrbl b/collects/scribblings/gui/popup-menu-class.scrbl index 9c8a7c0b55..57d2329093 100644 --- a/collects/scribblings/gui/popup-menu-class.scrbl +++ b/collects/scribblings/gui/popup-menu-class.scrbl @@ -3,13 +3,13 @@ @defclass/title[popup-menu% object% (menu-item-container<%>)]{ -A @scheme[popup-menu%] object is created without a parent. Dynamically - display a @scheme[popup-menu%] with @xmethod[window<%> popup-menu] +A @racket[popup-menu%] object is created without a parent. Dynamically + display a @racket[popup-menu%] with @xmethod[window<%> popup-menu] or @xmethod[editor-admin% popup-menu]. -A popup menu is @italic{not} a control. A @scheme[choice%] control, +A popup menu is @italic{not} a control. A @racket[choice%] control, however, displays a single value that the user selects from a popup - menu. A @scheme[choice%] control's popup menu is built into the + menu. A @racket[choice%] control's popup menu is built into the control, and it is not accessible to the programmer. @@ -21,26 +21,26 @@ however, displays a single value that the user selects from a popup (lambda (p) (void))] [font (is-a?/c font%) normal-control-font])]{ -If @scheme[title] is not @scheme[#f], it is used as a displayed title +If @racket[title] is not @racket[#f], it is used as a displayed title at the top of the popup menu. -If @scheme[title] contains @litchar{&}, it is handled specially, the - same as for @scheme[menu%] titles. A popup menu mnemonic is not +If @racket[title] contains @litchar{&}, it is handled specially, the + same as for @racket[menu%] titles. A popup menu mnemonic is not useful, but it is supported for consistency with other menu labels. -The @scheme[popdown-callback] procedure is invoked when a popup menu is +The @racket[popdown-callback] procedure is invoked when a popup menu is dismissed. If the popup menu is dismissed without an item being - selected, @scheme[popdown-callback] is given a @scheme[control-event%] - object with the event type @indexed-scheme['menu-popdown-none]. If the + selected, @racket[popdown-callback] is given a @racket[control-event%] + object with the event type @indexed-racket['menu-popdown-none]. If the popup menu is dismissed via an item selection, the item's callback is - invoked first, and then @scheme[popdown-callback] is given a - @scheme[control-event%] object with the event type - @indexed-scheme['menu-popdown]. + invoked first, and then @racket[popdown-callback] is given a + @racket[control-event%] object with the event type + @indexed-racket['menu-popdown]. -The @scheme[demand-callback] procedure is called by the default +The @racket[demand-callback] procedure is called by the default @method[menu-item-container<%> on-demand] method with the object itself. -The @scheme[font] argument determines the font for the popup menu's +The @racket[font] argument determines the font for the popup menu's items. } @@ -58,7 +58,7 @@ Returns the font used for the popup menu's items, which is optionally (or/c (is-a?/c window<%>) (is-a?/c editor<%>) false/c)]{ Returns the context in which the popup menu is currently displayed, or - @scheme[#f] if it is not popped up in any window. + @racket[#f] if it is not popped up in any window. The context is set before the @method[menu-item-container<%> on-demand] method is called, and it is not removed until after the diff --git a/collects/scribblings/gui/prefs.scrbl b/collects/scribblings/gui/prefs.scrbl index dfe2ee40b0..689689ae58 100644 --- a/collects/scribblings/gui/prefs.scrbl +++ b/collects/scribblings/gui/prefs.scrbl @@ -5,9 +5,9 @@ The @racketmodname[racket/gui/base] library supports a number of preferences for global configuration. The preferences are stored in the common file reported by - @scheme[find-system-path] for @indexed-scheme['pref-file], and + @racket[find-system-path] for @indexed-racket['pref-file], and preference values can be retrieved and changed through - @scheme[get-preference] and @scheme[put-preferences]. Except for the except the + @racket[get-preference] and @racket[put-preferences]. Except for the except the @Resource{playcmd} preference, the @racketmodname[racket/gui/base] library reads each of the preferences below once at startup. @@ -24,10 +24,10 @@ The following are the preference names used by GRacket: an editor.} @item{@ResourceFirst{defaultMenuPrefix} --- sets the prefix used by - default for menu item shortcuts on Unix, one of @scheme['ctl], - @scheme['meta], or @scheme['alt]. The default is - @scheme['ctl]. When this preference is set to @scheme['meta] or - @scheme['alt], underlined mnemonics (introduced by @litchar{&} in menu + default for menu item shortcuts on Unix, one of @racket['ctl], + @racket['meta], or @racket['alt]. The default is + @racket['ctl]. When this preference is set to @racket['meta] or + @racket['alt], underlined mnemonics (introduced by @litchar{&} in menu labels) are suppressed.} @item{@ResourceFirst{emacs-undo} --- a true value makes undo in @@ -35,14 +35,14 @@ The following are the preference names used by GRacket: in the undo stack).} @item{@ResourceFirst{wheelStep} --- sets the default mouse-wheel step - size of @scheme[editor-canvas%] objects.} + size of @racket[editor-canvas%] objects.} @item{@ResourceFirst{outline-inactive-selection} --- a true value causes selections in text editors to be shown with an outline of the selected region when the editor does no have the keyboard focus.} @item{@ResourceFirst{playcmd} --- used to format a sound-playing - command; see @scheme[play-sound] for details.} + command; see @racket[play-sound] for details.} @item{@ResourceFirst{doubleClickTime} --- overrides the platform-specific default interval (in milliseconds) for double-click @@ -51,6 +51,5 @@ The following are the preference names used by GRacket: ] In each of the above cases, if no preference value is found using the -@schemeidfont{GRacket}-prefixed name, a @schemeidfont{MrEd}-prefixed +@racketidfont{GRacket}-prefixed name, a @racketidfont{MrEd}-prefixed name is tried for backward compatibility. - diff --git a/collects/scribblings/gui/printer-dc-class.scrbl b/collects/scribblings/gui/printer-dc-class.scrbl index 0a7a4fa7d0..12fd6a15d9 100644 --- a/collects/scribblings/gui/printer-dc-class.scrbl +++ b/collects/scribblings/gui/printer-dc-class.scrbl @@ -3,26 +3,26 @@ @defclass/title[printer-dc% object% (dc<%>)]{ -A @scheme[printer-dc%] object is a printer device context. A newly - created @scheme[printer-dc%] object obtains orientation (portrait +A @racket[printer-dc%] object is a printer device context. A newly + created @racket[printer-dc%] object obtains orientation (portrait versus landscape) and scaling information from the current - @scheme[ps-setup%] object, as determined by the - @scheme[current-ps-setup] parameter. This information can be + @racket[ps-setup%] object, as determined by the + @racket[current-ps-setup] parameter. This information can be configured by the user through a dialog shown by - @scheme[get-page-setup-from-user]. + @racket[get-page-setup-from-user]. @|PrintNote| -See also @scheme[post-script-dc%]. +See also @racket[post-script-dc%]. -When a @scheme[printer-dc%] object is created, the user gets +When a @racket[printer-dc%] object is created, the user gets platform-specific modal dialogs for configuring the output. If the user cancels the dialog, the @method[dc<%> ok?] method - of the object returns @scheme[#f]. + of the object returns @racket[#f]. @defconstructor[([parent (or/c (is-a?/c frame%) (is-a?/c dialog%) false/c) #f])]{ -If @scheme[parent] is not @scheme[#f], it is used as the parent window +If @racket[parent] is not @racket[#f], it is used as the parent window of the configuration dialog. diff --git a/collects/scribblings/gui/radio-box-class.scrbl b/collects/scribblings/gui/radio-box-class.scrbl index 138567d0f4..081522d8a1 100644 --- a/collects/scribblings/gui/radio-box-class.scrbl +++ b/collects/scribblings/gui/radio-box-class.scrbl @@ -4,11 +4,11 @@ @defclass/title[radio-box% object% (control<%>)]{ -A @scheme[radio-box%] control allows the user to select one of +A @racket[radio-box%] control allows the user to select one of number of mutually exclusive items. The items are displayed as a vertical column or horizontal row of labelled @defterm{radio - buttons}. Unlike a @scheme[list-control<%>], the set of items in a - @scheme[radio-box%] cannot be changed dynamically. + buttons}. Unlike a @racket[list-control<%>], the set of items in a + @racket[radio-box%] cannot be changed dynamically. Whenever the user changes the selected radio button, the radio box's callback procedure is invoked. A callback procedure is provided as an @@ -39,36 +39,36 @@ Whenever the user changes the selected radio button, the radio box's [stretchable-height any/c #f])]{ Creates a radio button set with string or bitmap labels. The - @scheme[choices] list specifies the radio button labels; the list of + @racket[choices] list specifies the radio button labels; the list of choices must be homogeneous, either all strings or all bitmaps. @labelstripped[(scheme label) @elem{} @elem{move the keyboard focus to the radio box}] -Each string in @scheme[choices] can also contain a @litchar{&}, which +Each string in @racket[choices] can also contain a @litchar{&}, which creates a mnemonic for clicking the corresponding radio button. As - for @scheme[label], a @litchar{&&} is converted to a @litchar{&}. + for @racket[label], a @litchar{&&} is converted to a @litchar{&}. @bitmaplabelusearray[choices] -If @scheme[label] is a string, it is used as the label for the radio +If @racket[label] is a string, it is used as the label for the radio box. Otherwise, the radio box does not display its label. -The @scheme[callback] procedure is called (with the event type - @indexed-scheme['radio-box]) when the user changes the radio button +The @racket[callback] procedure is called (with the event type + @indexed-racket['radio-box]) when the user changes the radio button selection. -The @scheme[style] argument must include either @scheme['vertical] for a +The @racket[style] argument must include either @racket['vertical] for a collection of radio buttons vertically arranged, or - @scheme['horizontal] for a horizontal arrangement. - @HVLabelNote[@scheme[style]]{radio box} @DeletedStyleNote[@scheme[style] @scheme[parent]]{radio box} + @racket['horizontal] for a horizontal arrangement. + @HVLabelNote[@racket[style]]{radio box} @DeletedStyleNote[@racket[style] @racket[parent]]{radio box} By default, the first radio button is initially selected. If - @scheme[selection] is positive or @scheme[#f], it is passed to + @racket[selection] is positive or @racket[#f], it is passed to @method[radio-box% set-selection] to set the initial radio button selection. -@FontKWs[@scheme[font]] @WindowKWs[@scheme[enabled]] @SubareaKWs[] @AreaKWs[] +@FontKWs[@racket[font]] @WindowKWs[@racket[enabled]] @SubareaKWs[] @AreaKWs[] } @@ -82,10 +82,10 @@ By default, the first radio button is initially selected. If If a single argument is provided, the entire radio box is enabled or disabled. -If two arguments are provided, then if @scheme[enable?] is - @scheme[#f], the @scheme[n]th radio button is disabled, otherwise it +If two arguments are provided, then if @racket[enable?] is + @racket[#f], the @racket[n]th radio button is disabled, otherwise it is enabled (assuming the entire radio box is enabled). Radio buttons - are numbered from @scheme[0]. If @scheme[n] is equal to or larger + are numbered from @racket[0]. If @racket[n] is equal to or larger than the number of radio buttons in the radio box, @|MismatchExn|. } @@ -95,7 +95,7 @@ If two arguments are provided, then if @scheme[enable?] is string?]{ Gets the label of a radio button by position. Radio buttons are - numbered from @scheme[0]. If @scheme[n] is equal to or larger than + numbered from @racket[0]. If @racket[n] is equal to or larger than the number of radio buttons in the radio box, @|MismatchExn|. } @@ -118,8 +118,8 @@ Returns the number of radio buttons in the radio box. @defmethod[(get-selection) (or/c exact-nonnegative-integer? #f)]{ -Gets the position of the selected radio button, returning @scheme[#f] -if no button is selected. Radio buttons are numbered from @scheme[0]. +Gets the position of the selected radio button, returning @racket[#f] +if no button is selected. Radio buttons are numbered from @racket[0]. } @@ -132,9 +132,9 @@ if no button is selected. Radio buttons are numbered from @scheme[0]. If no arguments are provided, the enable state of the entire radio box is reported. -Otherwise, returns @scheme[#f] if @scheme[n]th radio button is -disabled (independent of disabling the entire radio box), @scheme[#t] -otherwise. Radio buttons are numbered from @scheme[0]. If @scheme[n] +Otherwise, returns @racket[#f] if @racket[n]th radio button is +disabled (independent of disabling the entire radio box), @racket[#t] +otherwise. Radio buttons are numbered from @racket[0]. If @racket[n] is equal to or larger than the number of radio buttons in the radio box, @|MismatchExn|. @@ -144,9 +144,9 @@ box, @|MismatchExn|. void?]{ Sets the selected radio button by position, or deselects all radio - buttons if @scheme[n] is @scheme[#f]. (The control's callback + buttons if @racket[n] is @racket[#f]. (The control's callback procedure is @italic{not} invoked.) Radio buttons are numbered from - @scheme[0]. If @scheme[n] is equal to or larger than the number of + @racket[0]. If @racket[n] is equal to or larger than the number of radio buttons in the radio box, @|MismatchExn|. @MonitorCallback[@elem{A radio box's selection} @elem{the user clicking the control} @elem{selection}] diff --git a/collects/scribblings/gui/readable-snip-intf.scrbl b/collects/scribblings/gui/readable-snip-intf.scrbl index 663afcb62e..1b09b2e346 100644 --- a/collects/scribblings/gui/readable-snip-intf.scrbl +++ b/collects/scribblings/gui/readable-snip-intf.scrbl @@ -3,18 +3,18 @@ @definterface/title[readable-snip<%> ()]{ -A @scheme[readable-snip<%>] object is treated specially by the port - generated by @scheme[open-input-text-editor]: When a - @scheme[readable-snip<%>] object is encountered for the input stream, +A @racket[readable-snip<%>] object is treated specially by the port + generated by @racket[open-input-text-editor]: When a + @racket[readable-snip<%>] object is encountered for the input stream, its @method[readable-snip<%> read-special] method is called to generate the read result for the snip, which is returned from the port as a ``special'' value in the sense of - @scheme[read-char-or-special]. + @racket[read-char-or-special]. -Since @scheme[read] and @scheme[read-syntax] build on - @scheme[read-char-or-special], a snip can implement - @scheme[readable-snip<%>] so that it produces a whole S-expression or - some other kind of value when @scheme[read] is used on a stream +Since @racket[read] and @racket[read-syntax] build on + @racket[read-char-or-special], a snip can implement + @racket[readable-snip<%>] so that it produces a whole S-expression or + some other kind of value when @racket[read] is used on a stream containing the snip. @defmethod[(read-special [source any/c] @@ -24,10 +24,10 @@ Since @scheme[read] and @scheme[read-syntax] build on any/c]{ The arguments are the same as the arguments to a procedure returned by - a custom input port's @scheme[_read-in]; see @secref[#:doc '(lib + a custom input port's @racket[_read-in]; see @secref[#:doc '(lib "scribblings/reference/reference.scrbl") "customport"] for details. The result is also the same as the result from a - @scheme[_read-in]-produced procedure. + @racket[_read-in]-produced procedure. }} diff --git a/collects/scribblings/gui/scroll-event-class.scrbl b/collects/scribblings/gui/scroll-event-class.scrbl index 6ec2e282d2..f541dce73a 100644 --- a/collects/scribblings/gui/scroll-event-class.scrbl +++ b/collects/scribblings/gui/scroll-event-class.scrbl @@ -3,8 +3,8 @@ @defclass/title[scroll-event% event% ()]{ -A @scheme[scroll-event%] object contains information about a scroll - event. An instance of @scheme[scroll-event%] is always provided to +A @racket[scroll-event%] object contains information about a scroll + event. An instance of @racket[scroll-event%] is always provided to @method[canvas% on-scroll]. See @@ -20,9 +20,9 @@ See [position (integer-in 0 10000) 0] [time-stamp exact-integer? 0])]{ -See the corresponding @scheme[get-] and @scheme[set-] methods for - information about @scheme[event-type], @scheme[direction], @scheme[position], - and @scheme[time-stamp]. +See the corresponding @racket[get-] and @racket[set-] methods for + information about @racket[event-type], @racket[direction], @racket[position], + and @racket[time-stamp]. } @@ -31,7 +31,7 @@ See the corresponding @scheme[get-] and @scheme[set-] methods for Gets the identity of the scrollbar that was modified by the event, either the horizontal scrollbar or the vertical scrollbar, as - @scheme['horizontal] or @scheme['vertical], respectively. See also + @racket['horizontal] or @racket['vertical], respectively. See also @method[scroll-event% set-direction]. } @@ -42,13 +42,13 @@ Gets the identity of the scrollbar that was modified by the event, Returns the type of the event, one of the following: @itemize[ -@item{@scheme['top] --- user clicked a scroll-to-top button} -@item{@scheme['bottom] --- user clicked a scroll-to-bottom button} -@item{@scheme['line-up] --- user clicked an arrow to scroll up or left one step} -@item{@scheme['line-down] --- user clicked an arrow to scroll down or right one step} -@item{@scheme['page-up] --- user clicked an arrow to scroll up or left one page} -@item{@scheme['page-down] --- user clicked an arrow to scroll down or right one page} -@item{@scheme['thumb] --- user dragged the scroll position indicator} +@item{@racket['top] --- user clicked a scroll-to-top button} +@item{@racket['bottom] --- user clicked a scroll-to-bottom button} +@item{@racket['line-up] --- user clicked an arrow to scroll up or left one step} +@item{@racket['line-down] --- user clicked an arrow to scroll down or right one step} +@item{@racket['page-up] --- user clicked an arrow to scroll up or left one page} +@item{@racket['page-down] --- user clicked an arrow to scroll down or right one page} +@item{@racket['thumb] --- user dragged the scroll position indicator} ] } @@ -66,7 +66,7 @@ Returns the position of the scrollbar after the action triggering the Sets the identity of the scrollbar that was modified by the event, either the horizontal scrollbar or the vertical scrollbar, as - @scheme['horizontal] or @scheme['vertical], respectively. See also + @racket['horizontal] or @racket['vertical], respectively. See also @method[scroll-event% get-direction]. } diff --git a/collects/scribblings/gui/selectable-menu-item-intf.scrbl b/collects/scribblings/gui/selectable-menu-item-intf.scrbl index 057a93142e..5d41f0b1c1 100644 --- a/collects/scribblings/gui/selectable-menu-item-intf.scrbl +++ b/collects/scribblings/gui/selectable-menu-item-intf.scrbl @@ -3,8 +3,8 @@ @definterface/title[selectable-menu-item<%> (labelled-menu-item<%>)]{ -A @scheme[selectable-menu-item<%>] object is a - @scheme[labelled-menu-item<%>] that the user can select. It may also +A @racket[selectable-menu-item<%>] object is a + @racket[labelled-menu-item<%>] that the user can select. It may also have a keyboard shortcut; the shortcut is displayed in the menu, and the default @method[frame% on-subwindow-char] method in the menu's frame dispatches to the menu item when the shortcut key combination @@ -16,8 +16,8 @@ A @scheme[selectable-menu-item<%>] object is a Invokes the menu item's callback procedure, which is supplied when an instance of -@scheme[menu-item%] or -@scheme[checkable-menu-item%] is created. +@racket[menu-item%] or +@racket[checkable-menu-item%] is created. } @@ -29,16 +29,16 @@ Gets the keyboard shortcut character or virtual key for the menu which is reported by @method[selectable-menu-item<%> get-shortcut-prefix]. -If the menu item has no shortcut, @scheme[#f] is returned. +If the menu item has no shortcut, @racket[#f] is returned. The shortcut part of a menu item name is not included in the label returned by @method[labelled-menu-item<%> get-label]. For a list of allowed key symbols, see @xmethod[key-event% get-key-code], except that the following are disallowed: - @scheme['shift], @scheme['control], @scheme['numlock], - @scheme['scroll], @scheme['wheel-up], @scheme['wheel-down], - @scheme['release], and @scheme['press]. + @racket['shift], @racket['control], @racket['numlock], + @racket['scroll], @racket['wheel-up], @racket['wheel-down], + @racket['release], and @racket['press]. } @@ -49,20 +49,20 @@ Returns a list of symbols that indicates the keyboard prefix used for the menu item's keyboard shortcut. The allowed symbols for the list are the following: @itemize[ -@item{@scheme['alt] --- Meta (Windows and X only)} -@item{@scheme['cmd] --- Command (Mac OS X only)} -@item{@scheme['meta] --- Meta (Unix only)} -@item{@scheme['ctl] --- Control} -@item{@scheme['shift] --- Shift} -@item{@scheme['option] --- Option (Mac OS X only)} +@item{@racket['alt] --- Meta (Windows and X only)} +@item{@racket['cmd] --- Command (Mac OS X only)} +@item{@racket['meta] --- Meta (Unix only)} +@item{@racket['ctl] --- Control} +@item{@racket['shift] --- Shift} +@item{@racket['option] --- Option (Mac OS X only)} ] -On Unix, at most one of @scheme['alt] and @scheme['meta] can be - supplied; the only difference between @scheme['alt] and - @scheme['meta] is the key combination's display in a menu. +On Unix, at most one of @racket['alt] and @racket['meta] can be + supplied; the only difference between @racket['alt] and + @racket['meta] is the key combination's display in a menu. The default shortcut prefix is available from - @scheme[get-default-shortcut-prefix]. + @racket[get-default-shortcut-prefix]. The shortcut key, as determined by @method[selectable-menu-item<%> get-shortcut], matches a key event using either the normally reported @@ -94,7 +94,7 @@ An empty list can be used for a shortcut prefix. However, the default Sets the keyboard shortcut character for the menu item. See @method[selectable-menu-item<%> get-shortcut] for more information. -If the shortcut character is set to @scheme[#f], then menu item has no +If the shortcut character is set to @racket[#f], then menu item has no keyboard shortcut. } diff --git a/collects/scribblings/gui/separator-menu-item-class.scrbl b/collects/scribblings/gui/separator-menu-item-class.scrbl index 9f061c45ec..f85b07d73f 100644 --- a/collects/scribblings/gui/separator-menu-item-class.scrbl +++ b/collects/scribblings/gui/separator-menu-item-class.scrbl @@ -4,7 +4,7 @@ @defclass/title[separator-menu-item% object% (menu-item<%>)]{ A separator is an unselectable line in a menu. Its parent must be a - @scheme[menu%] or @scheme[popup-menu%]. + @racket[menu%] or @racket[popup-menu%]. @defconstructor[([parent (or/c (is-a?/c menu%) (is-a?/c popup-menu%))])]{ diff --git a/collects/scribblings/gui/slider-class.scrbl b/collects/scribblings/gui/slider-class.scrbl index 2ac0e3683b..0638553913 100644 --- a/collects/scribblings/gui/slider-class.scrbl +++ b/collects/scribblings/gui/slider-class.scrbl @@ -3,7 +3,7 @@ @defclass/title[slider% object% (control<%>)]{ -A @scheme[slider] object is a panel item with a handle that the user can +A @racket[slider] object is a panel item with a handle that the user can drag to change the control's value. Each slider has a fixed minimum and maximum value. @@ -34,27 +34,27 @@ Whenever the user changes the value of a slider, its callback [stretchable-width any/c (memq 'horizontal style)] [stretchable-height any/c (memq 'vertical style)])]{ -If @scheme[label] is a string, it is used as the label for the slider. +If @racket[label] is a string, it is used as the label for the slider. Otherwise, the slider does not display its label. @labelstripped[(scheme label) @elem{} @elem{move the keyboard focus to the slider}] -The @scheme[min-value] and @scheme[max-value] arguments specify the - range of the slider, inclusive. The @scheme[init-value] argument +The @racket[min-value] and @racket[max-value] arguments specify the + range of the slider, inclusive. The @racket[init-value] argument optionally specifies the slider's initial value. If the sequence - [@scheme[min-value], @scheme[initial-value], @scheme[maximum-value]] + [@racket[min-value], @racket[initial-value], @racket[maximum-value]] is not increasing, @|MismatchExn|. -The @scheme[callback] procedure is called (with the event type - @indexed-scheme['slider]) when the user changes the slider's value. +The @racket[callback] procedure is called (with the event type + @indexed-racket['slider]) when the user changes the slider's value. -The @scheme[style] argument must include either @scheme['vertical] for - a vertical slider, or @scheme['horizontal] for a horizontal - slider. If @scheme[style] includes @scheme['plain], the slider does +The @racket[style] argument must include either @racket['vertical] for + a vertical slider, or @racket['horizontal] for a horizontal + slider. If @racket[style] includes @racket['plain], the slider does not display numbers for its range and current value to the user. - @HVLabelNote[@scheme[style]]{slider} @DeletedStyleNote[@scheme[style] @scheme[parent]]{slider} + @HVLabelNote[@racket[style]]{slider} @DeletedStyleNote[@racket[style] @racket[parent]]{slider} -@FontKWs[@scheme[font]] @WindowKWs[@scheme[enabled]] @SubareaKWs[] @AreaKWs[] +@FontKWs[@racket[font]] @WindowKWs[@racket[enabled]] @SubareaKWs[] @AreaKWs[] } @@ -70,7 +70,7 @@ Gets the current slider value. void?]{ Sets the value (and displayed position) of the slider. (The control's - callback procedure is @italic{not} invoked.) If @scheme[value] is + callback procedure is @italic{not} invoked.) If @racket[value] is outside the slider's minimum and maximum range, @|MismatchExn|. @MonitorCallback[@elem{A slider's value} @elem{the user clicking the control} @elem{value}] diff --git a/collects/scribblings/gui/snip-admin-class.scrbl b/collects/scribblings/gui/snip-admin-class.scrbl index cbb65a7e77..e992e4a533 100644 --- a/collects/scribblings/gui/snip-admin-class.scrbl +++ b/collects/scribblings/gui/snip-admin-class.scrbl @@ -4,19 +4,19 @@ @defclass/title[snip-admin% object% ()]{ See @|admindiscuss| for information about the role of administrators. - The @scheme[snip-admin%] class is never instantiated directly. It + The @racket[snip-admin%] class is never instantiated directly. It is not even instantiated through derived classes by most programmers; - each @scheme[text%] or @scheme[pasteboard%] object + each @racket[text%] or @racket[pasteboard%] object creates its own administrator. However, it may be useful to derive a new instance of this class to display snips in a new context. Also, it may be useful to call the methods of an existing administrator from an owned snip. -To create a new @scheme[snip-admin%] class, all methods described here +To create a new @racket[snip-admin%] class, all methods described here must be overridden. They are all invoked by the administrator's snip. -Because a @scheme[snip-admin%] object typically owns more than one - snip, many methods require a @scheme[snip%] object as an argument. +Because a @racket[snip-admin%] object typically owns more than one + snip, many methods require a @racket[snip%] object as an argument. @@ -30,7 +30,7 @@ Creates a (useless) editor administrator. (or/c (is-a?/c dc<%>) false/c)]{ Gets a drawing context suitable for determining display size - information. If the snip is not displayed, @scheme[#f] is returned. + information. If the snip is not displayed, @racket[#f] is returned. } @@ -54,16 +54,16 @@ Gets the @techlink{location} and size of the visible region of a snip in snip coordinates. The result is undefined if the given snip is not managed by this administrator. -If @scheme[snip] is not @scheme[#f], the current visible region of the - snip is installed in the boxes @scheme[x], @scheme[y], @scheme[w], - and @scheme[h]. The @scheme[x] and @scheme[y] values are relative to - the snip's top-left corner. The @scheme[w] and @scheme[h] values may +If @racket[snip] is not @racket[#f], the current visible region of the + snip is installed in the boxes @racket[x], @racket[y], @racket[w], + and @racket[h]. The @racket[x] and @racket[y] values are relative to + the snip's top-left corner. The @racket[w] and @racket[h] values may be larger than the snip itself. -If @scheme[snip] is @scheme[#f], the total visible region of the +If @racket[snip] is @racket[#f], the total visible region of the snip's top-level @techlink{display} is returned in editor - coordinates. Using @scheme[#f] for @scheme[snip] is analogous to - using @scheme[#t] for @scheme[full?] in @xmethod[editor-admin% + coordinates. Using @racket[#f] for @racket[snip] is analogous to + using @racket[#t] for @racket[full?] in @xmethod[editor-admin% get-view]. If no snip is specified, then the @techlink{location} and size of the snip's @@ -74,7 +74,7 @@ See also @xmethod[editor-admin% get-view]. } @methimpl{ -Fills all boxes with @scheme[0.0]. +Fills all boxes with @racket[0.0]. }} @@ -92,7 +92,7 @@ If the @techlink{display} is an editor canvas, see also } @methimpl{ -Fills all boxes with @scheme[0.0]. +Fills all boxes with @racket[0.0]. } } @@ -124,7 +124,7 @@ Called by the snip to request that the snip's display needs to be updated. The administrator determines when to actually update the snip; the snip's @method[snip% draw] method is eventually called. -The @scheme[localx], @scheme[localy], @scheme[w], and @scheme[h] +The @racket[localx], @racket[localy], @racket[w], and @racket[h] arguments specify a region of the snip to be refreshed (in snip coordinates). @@ -146,10 +146,10 @@ Does nothing. @methspec{ Opens a popup menu in the @techlink{display} for this snip's editor. The result - is @scheme[#t] if the popup succeeds, @scheme[#f] otherwise (independent + is @racket[#t] if the popup succeeds, @racket[#f] otherwise (independent of whether the user selects an item in the popup menu). -The menu is placed at @scheme[x] and @scheme[y] in @scheme[snip] +The menu is placed at @racket[x] and @racket[y] in @racket[snip] coordinates. While the menu is popped up, its target is set to the top-level editor @@ -159,7 +159,7 @@ While the menu is popped up, its target is set to the top-level editor } @methimpl{ -Returns @scheme[#f]. +Returns @racket[#f]. }} @@ -173,7 +173,7 @@ Called by a snip to notify the administrator that the specified snip changing its @techlink{count}, but the snip decides whether the update should occur immediately. -If @scheme[refresh?] is not @scheme[#f], then the snip is requesting +If @racket[refresh?] is not @racket[#f], then the snip is requesting to be updated immediately. Otherwise, @method[snip-admin% needs-update] must eventually be called as well. @@ -194,18 +194,18 @@ Does nothing. Requests that the specified snip be released. If this administrator is not the snip's owner or if the snip cannot be released, then - @scheme[#f] is returned. Otherwise, @scheme[#t] is returned and the + @racket[#f] is returned. Otherwise, @racket[#t] is returned and the snip is no longer owned. See also @xmethod[editor<%> release-snip] . -The result is @scheme[#f] if the given snip is not managed by this +The result is @racket[#f] if the given snip is not managed by this administrator. } @methimpl{ -Returns @scheme[#f]. +Returns @racket[#f]. }} @@ -220,7 +220,7 @@ Called by a snip to notify the administrator that the specified snip after a resize, but the snip decides whether the update should occur immediately. -If @scheme[refresh?] is not @scheme[#f], then the snip is requesting +If @racket[refresh?] is not @racket[#f], then the snip is requesting to be updated immediately, as if calling @method[snip-admin% needs-update]. Otherwise, @method[snip-admin% needs-update] must eventually be called as well. @@ -251,34 +251,34 @@ Called by the snip to request scrolling so that the given region is visible. The snip generally needs to be updated after a scroll, but the snip decides whether the update should occur immediately. -The @scheme[localx], @scheme[localy], @scheme[w], and @scheme[h] arguments specify +The @racket[localx], @racket[localy], @racket[w], and @racket[h] arguments specify a region of the snip to be made visible by the scroll (in snip coordinates). -If @scheme[refresh?] is not @scheme[#f], then the editor is requesting to +If @racket[refresh?] is not @racket[#f], then the editor is requesting to be updated immediately. -The @scheme[bias] argument is one of: +The @racket[bias] argument is one of: @itemize[ - @item{@scheme['start] --- if the range doesn't fit in the visible area, show the top-left region} + @item{@racket['start] --- if the range doesn't fit in the visible area, show the top-left region} - @item{@scheme['none] --- no special scrolling instructions} + @item{@racket['none] --- no special scrolling instructions} - @item{@scheme['end] --- if the range doesn't fit in the visible area, show the bottom-right region} + @item{@racket['end] --- if the range doesn't fit in the visible area, show the bottom-right region} ] -The result is @scheme[#t] if the editor is scrolled, @scheme[#f] +The result is @racket[#t] if the editor is scrolled, @racket[#f] otherwise. -The method call is ignored (and the result is @scheme[#f]) if the given +The method call is ignored (and the result is @racket[#f]) if the given snip is not managed by this administrator. } @methimpl{ -Returns @scheme[#f]. +Returns @racket[#f]. }} @@ -292,7 +292,7 @@ Requests that the keyboard focus is assigned to the specified snip. snip is called. See @method[editor<%> set-caret-owner] for information about the - possible values of @scheme[domain]. + possible values of @racket[domain]. The method call is ignored if the given snip is not managed by this @@ -333,7 +333,7 @@ line. } @methimpl{ -Returns @scheme[0.0] +Returns @racket[0.0] }} @@ -342,12 +342,12 @@ Returns @scheme[0.0] @methspec{ -Returns the color that is used to draw selected text or @scheme[#f] if +Returns the color that is used to draw selected text or @racket[#f] if selected text is drawn with its usual color. } @methimpl{ -Returns @scheme[#f]. +Returns @racket[#f]. }} @@ -356,7 +356,7 @@ Returns @scheme[#f]. @methspec{ -Calls @scheme[thunk] while changing the cursor to a watch cursor for +Calls @racket[thunk] while changing the cursor to a watch cursor for all windows in the current eventspace. } @@ -378,12 +378,12 @@ Returns the current tab-position array as a list. list)}] @boxisfillnull[(scheme tab-width) @elem{the width used for tabs past the end of the tab array}] -@boxisfillnull[(scheme in-units) @elem{@scheme[#t] if the tabs are specified in -canvas units or @scheme[#f] if they are specified in space-widths}] +@boxisfillnull[(scheme in-units) @elem{@racket[#t] if the tabs are specified in +canvas units or @racket[#f] if they are specified in space-widths}] } @methimpl{ -Returns @scheme[null]. +Returns @racket[null]. } } } diff --git a/collects/scribblings/gui/snip-class-class.scrbl b/collects/scribblings/gui/snip-class-class.scrbl index 787464c439..5659e384c7 100644 --- a/collects/scribblings/gui/snip-class-class.scrbl +++ b/collects/scribblings/gui/snip-class-class.scrbl @@ -4,11 +4,11 @@ @defclass/title[snip-class% object% ()]{ Useful snip classes are defined by instantiating derived subclasses of - @scheme[snip-class%]. A class derived from @scheme[snip-class%] + @racket[snip-class%]. A class derived from @racket[snip-class%] serves as a kind of ``meta-class'' for snips; each snip is associated - with an instance of @scheme[snip-class%] as its snip class. + with an instance of @racket[snip-class%] as its snip class. -In deriving a new @scheme[snip-class%] class, override the +In deriving a new @racket[snip-class%] class, override the @method[snip-class% read] method. Then, for each instance of the derived class (where each instance corresponds to a single snip class): @@ -21,7 +21,7 @@ In deriving a new @scheme[snip-class%] class, override the @method[snip-class% set-version].} @item{Install the class into the list returned by - @scheme[get-the-snip-class-list] using the + @racket[get-the-snip-class-list] using the @method[snip-class-list<%> add] method. Note that if the same name is inserted into the same class list multiple times, all but the first insertion is ignored.} @@ -42,9 +42,9 @@ Creates a (useless) snip class. Returns the class's name, a string uniquely designating this snip class. For example, the standard text snip classname is - @scheme["wxtext"]. Names beginning with @litchar{wx} are reserved. + @racket["wxtext"]. Names beginning with @litchar{wx} are reserved. -A snip class name should usually have the form @scheme["((lib ...) +A snip class name should usually have the form @racket["((lib ...) (lib ...))"] to enable on-demand loading of the class. See @|snipclassdiscuss| for details. @@ -65,12 +65,12 @@ Returns the version of this snip class. When attempting to load a file @methspec{ Reads a snip from a given stream, returning a newly created snip as - the result or @scheme[#f] if there is an error. + the result or @racket[#f] if there is an error. } @methimpl{ -Returns @scheme[#f]. +Returns @racket[#f]. }} @@ -84,7 +84,7 @@ Called to read header information that may be useful for every snip session, and only if the stream contains header information for this class. -The return value is @scheme[#f] if a read error occurs or anything else +The return value is @racket[#f] if a read error occurs or anything else otherwise. See also @method[snip-class% write-header]. @@ -92,7 +92,7 @@ See also @method[snip-class% write-header]. } @methimpl{ -Returns @scheme[#t]. +Returns @racket[#t]. }} @@ -134,13 +134,13 @@ When reading the snips back in, @method[snip-class% read-header] will only be called if @method[snip-class% write-header] writes some data to the stream. -The return value is @scheme[#f] if a write error occurs or anything else +The return value is @racket[#f] if a write error occurs or anything else otherwise. } @methimpl{ -Returns @scheme[#t]. +Returns @racket[#t]. }} } diff --git a/collects/scribblings/gui/snip-class-list-intf.scrbl b/collects/scribblings/gui/snip-class-list-intf.scrbl index e67635720c..b56bc961a0 100644 --- a/collects/scribblings/gui/snip-class-list-intf.scrbl +++ b/collects/scribblings/gui/snip-class-list-intf.scrbl @@ -3,8 +3,8 @@ @definterface/title[snip-class-list<%> ()]{ -Each eventspace has its own instance of @scheme[snip-class-list<%>], - obtained with @scheme[(get-the-snip-class-list)]. New instances +Each eventspace has its own instance of @racket[snip-class-list<%>], + obtained with @racket[(get-the-snip-class-list)]. New instances cannot be created directly. Each instance keeps a list of snip classes. This list is needed for loading snips from a file. See also @|snipclassdiscuss|. @@ -22,7 +22,7 @@ Adds a snip class to the list. If a class with the same name already (or/c (is-a?/c snip-class%) false/c)]{ Finds a snip class from the list with the given name, returning - @scheme[#f] if none is found. + @racket[#f] if none is found. } @@ -36,8 +36,8 @@ Returns an index into the list for the specified class. @defmethod[(nth [n exact-nonnegative-integer?]) (or/c (is-a?/c snip-class%) false/c)]{ -Returns the @scheme[n]th class in the list, or @scheme[#f] if - the list has @scheme[n] classes or less. +Returns the @racket[n]th class in the list, or @racket[#f] if + the list has @racket[n] classes or less. } diff --git a/collects/scribblings/gui/string-snip-class.scrbl b/collects/scribblings/gui/string-snip-class.scrbl index 2e0d5c46ff..42c19151d9 100644 --- a/collects/scribblings/gui/string-snip-class.scrbl +++ b/collects/scribblings/gui/string-snip-class.scrbl @@ -3,7 +3,7 @@ @defclass/title[string-snip% snip% ()]{ -An instance of @scheme[string-snip%] is created automatically when +An instance of @racket[string-snip%] is created automatically when text is inserted into a text editor. See also @xmethod[text% on-new-string-snip]. @@ -11,9 +11,9 @@ An instance of @scheme[string-snip%] is created automatically when @defconstructor*/make[(([allocsize exact-nonnegative-integer? 0]) ([s string?]))]{ -Creates a string snip whose initial content is @scheme[s], if +Creates a string snip whose initial content is @racket[s], if supplied, empty otherwise. In the latter case, the optional - @scheme[allocsize] argument is a hint about how much storage space + @racket[allocsize] argument is a hint about how much storage space for text should be initially allocated by the snip. } @@ -24,8 +24,8 @@ Creates a string snip whose initial content is @scheme[s], if [pos exact-nonnegative-integer? 0]) void?]{ -Inserts @scheme[s] (with length @scheme[len]) into the snip at relative - @techlink{position} @scheme[pos] within the snip. +Inserts @racket[s] (with length @racket[len]) into the snip at relative + @techlink{position} @racket[pos] within the snip. } @@ -36,7 +36,7 @@ Inserts @scheme[s] (with length @scheme[len]) into the snip at relative Reads the snip's data from the given stream. -The @scheme[len] argument specifies the maximum length of the text to +The @racket[len] argument specifies the maximum length of the text to be read. (When a text snip is written to a file, the very first field is the length of the text contained in the snip.) This method is usually invoked by the text snip class's @method[snip-class% read] diff --git a/collects/scribblings/gui/style-delta-class.scrbl b/collects/scribblings/gui/style-delta-class.scrbl index 1e6229e03a..766a9280d6 100644 --- a/collects/scribblings/gui/style-delta-class.scrbl +++ b/collects/scribblings/gui/style-delta-class.scrbl @@ -3,7 +3,7 @@ @defclass/title[style-delta% object% ()]{ -A @scheme[style-delta%] object encapsulates a style change. The changes expressible +A @racket[style-delta%] object encapsulates a style change. The changes expressible by a delta include: @itemize[ @item{changing the font family} @@ -30,98 +30,98 @@ sets the internal delta information. To take full advantage of a style delta, it is necessary to understand the internal on/off settings that can be manipulated through methods such as @method[style-delta% set-weight-on]. For example, the font -weight change is specified through the @scheme[weight-on] and -@scheme[weight-off] internal settings. Roughly, @scheme[weight-on] +weight change is specified through the @racket[weight-on] and +@racket[weight-off] internal settings. Roughly, @racket[weight-on] turns on a weight setting when it is not present and -@scheme[weight-off] turns off a weight setting when it is +@racket[weight-off] turns off a weight setting when it is present. These two interact precisely in the following way: @itemize[ -@item{If both @scheme[weight-on] and @scheme[weight-off] are set to @scheme['base], +@item{If both @racket[weight-on] and @racket[weight-off] are set to @racket['base], then the font weight is not changed.} -@item{If @scheme[weight-on] is not @scheme['base], then the weight is set to -@scheme[weight-on].} -@item{If @scheme[weight-off] is not @scheme['base], then the weight will be set back -to @scheme['normal] when the base style has the weight @scheme[weight-off].} -@item{If both @scheme[weight-on] and @scheme[weight-off] are set to the same +@item{If @racket[weight-on] is not @racket['base], then the weight is set to +@racket[weight-on].} +@item{If @racket[weight-off] is not @racket['base], then the weight will be set back +to @racket['normal] when the base style has the weight @racket[weight-off].} +@item{If both @racket[weight-on] and @racket[weight-off] are set to the same value, then the weight is toggled with respect to that value: if -the base style has the weight @scheme[weight-on], then weight is changed to -@scheme['normal]; if the base style has a different weight, it is changed to -@scheme[weight-on].} -@item{If both @scheme[weight-on] and @scheme[weight-off] are set, but to -different values, then the weight is changed to @scheme[weight-on] -only when the base style has the weight @scheme[weight-off].} +the base style has the weight @racket[weight-on], then weight is changed to +@racket['normal]; if the base style has a different weight, it is changed to +@racket[weight-on].} +@item{If both @racket[weight-on] and @racket[weight-off] are set, but to +different values, then the weight is changed to @racket[weight-on] +only when the base style has the weight @racket[weight-off].} ] Font styles, smoothing, underlining, and alignment work in an analogous manner. -The possible values for @scheme[alignment-on] and @scheme[alignment-off] are: +The possible values for @racket[alignment-on] and @racket[alignment-off] are: @itemize[ -@item{@indexed-scheme['base]} -@item{@indexed-scheme['top]} -@item{@indexed-scheme['center]} -@item{@indexed-scheme['bottom]} +@item{@indexed-racket['base]} +@item{@indexed-racket['top]} +@item{@indexed-racket['center]} +@item{@indexed-racket['bottom]} ] -The possible values for @scheme[style-on] and @scheme[style-off] are: +The possible values for @racket[style-on] and @racket[style-off] are: @itemize[ -@item{@indexed-scheme['base]} -@item{@indexed-scheme['normal]} -@item{@indexed-scheme['italic]} -@item{@indexed-scheme['slant]} +@item{@indexed-racket['base]} +@item{@indexed-racket['normal]} +@item{@indexed-racket['italic]} +@item{@indexed-racket['slant]} ] -The possible values for @scheme[smoothing-on] and @scheme[smoothing-off] are: +The possible values for @racket[smoothing-on] and @racket[smoothing-off] are: @itemize[ -@item{@indexed-scheme['base]} -@item{@indexed-scheme['default]} -@item{@indexed-scheme['partly-smoothed]} -@item{@indexed-scheme['smoothed]} -@item{@indexed-scheme['unsmoothed]} +@item{@indexed-racket['base]} +@item{@indexed-racket['default]} +@item{@indexed-racket['partly-smoothed]} +@item{@indexed-racket['smoothed]} +@item{@indexed-racket['unsmoothed]} ] -The possible values for @scheme[underlined-on] and @scheme[underlined-off] are: +The possible values for @racket[underlined-on] and @racket[underlined-off] are: @itemize[ -@item{@scheme[#f] (acts like @scheme['base])} -@item{@scheme[#t]} +@item{@racket[#f] (acts like @racket['base])} +@item{@racket[#t]} ] -The possible values for @scheme[size-in-pixels-on] and @scheme[size-in-pixels-off] are: +The possible values for @racket[size-in-pixels-on] and @racket[size-in-pixels-off] are: @itemize[ -@item{@scheme[#f] (acts like @scheme['base])} -@item{@scheme[#t]} +@item{@racket[#f] (acts like @racket['base])} +@item{@racket[#t]} ] -The possible values for @scheme[transparent-text-backing-on] and -@scheme[transparent-text-backing-off] are: +The possible values for @racket[transparent-text-backing-on] and +@racket[transparent-text-backing-off] are: @itemize[ -@item{@scheme[#f] (acts like @scheme['base])} -@item{@scheme[#t]} +@item{@racket[#f] (acts like @racket['base])} +@item{@racket[#t]} ] -The possible values for @scheme[weight-on] and @scheme[weight-off] are: +The possible values for @racket[weight-on] and @racket[weight-off] are: @itemize[ -@item{@indexed-scheme['base]} -@item{@indexed-scheme['normal]} -@item{@indexed-scheme['bold]} -@item{@indexed-scheme['light]} +@item{@indexed-racket['base]} +@item{@indexed-racket['normal]} +@item{@indexed-racket['bold]} +@item{@indexed-racket['light]} ] The family and face settings in a style delta are interdependent: @itemize[ - @item{When a delta's face is @scheme[#f] and its family is - @scheme['base], then neither the face nor family are modified by + @item{When a delta's face is @racket[#f] and its family is + @racket['base], then neither the face nor family are modified by the delta.} @item{When a delta's face is a string and its family is - @scheme['base], then only face is modified by the delta.} + @racket['base], then only face is modified by the delta.} - @item{When a delta's family is not @scheme['base], then both the face + @item{When a delta's family is not @racket['base], then both the face and family are modified by the delta. If the delta's face is - @scheme[#f], then applying the delta sets a style's face to - @scheme[#f], so that the family setting prevails in choosing a + @racket[#f], then applying the delta sets a style's face to + @racket[#f], so that the family setting prevails in choosing a font.} ] @@ -164,8 +164,8 @@ The initialization arguments are passed on to Tries to collapse into a single delta the changes that would be made by applying this delta after a given delta. If the return value is - @scheme[#f], then it is impossible to perform the - collapse. Otherwise, the return value is @scheme[#t] and this delta + @racket[#f], then it is impossible to perform the + collapse. Otherwise, the return value is @racket[#t] and this delta will contain the collapsed change specification. } @@ -180,22 +180,22 @@ Copies the given style delta's settings into this one. @defmethod[(equal? [delta (is-a?/c style-delta%)]) boolean?]{ -Returns @scheme[#t] if the given delta is equivalent to this one in - all contexts or @scheme[#f] otherwise. +Returns @racket[#t] if the given delta is equivalent to this one in + all contexts or @racket[#f] otherwise. } @defmethod[(get-alignment-off) (or/c 'base 'top 'center 'bottom)]{ -See @scheme[style-delta%]. +See @racket[style-delta%]. } @defmethod[(get-alignment-on) (or/c 'base 'top 'center 'bottom)]{ -See @scheme[style-delta%]. +See @racket[style-delta%]. } @@ -203,7 +203,7 @@ See @scheme[style-delta%]. (is-a?/c add-color<%>)]{ Gets the object additive color shift for the background (applied after - the multiplicative factor). Call this @scheme[add-color<%>] object's + the multiplicative factor). Call this @racket[add-color<%>] object's methods to change the style delta's additive background color shift. } @@ -212,7 +212,7 @@ Gets the object additive color shift for the background (applied after (is-a?/c mult-color<%>)]{ Gets the multiplicative color shift for the background (applied before - the additive factor). Call this @scheme[mult-color<%>] object's + the additive factor). Call this @racket[mult-color<%>] object's methods to change the style delta's multiplicative background color shift. @@ -221,11 +221,11 @@ Gets the multiplicative color shift for the background (applied before @defmethod[(get-face) (or/c string? false/c)]{ -Gets the delta's font face string. If this string is @scheme[#f] and the - family is @indexed-scheme['base] when the delta is applied to a style, +Gets the delta's font face string. If this string is @racket[#f] and the + family is @indexed-racket['base] when the delta is applied to a style, the style's face and family are not changed. However, if the face - string is @scheme[#f] and the family is not @indexed-scheme['base], then - the style's face is changed to @scheme[#f]. + string is @racket[#f] and the family is not @indexed-racket['base], then + the style's face is changed to @racket[#f]. See also @method[style-delta% get-family]. @@ -237,15 +237,15 @@ See also @method[style-delta% get-family]. Returns the delta's font family. The possible values are @itemize[ -@item{@indexed-scheme['base] --- no change to family} -@item{@indexed-scheme['default]} -@item{@indexed-scheme['decorative]} -@item{@indexed-scheme['roman]} -@item{@indexed-scheme['script]} -@item{@indexed-scheme['swiss]} -@item{@indexed-scheme['modern] (fixed width)} -@item{@indexed-scheme['symbol] (Greek letters)} -@item{@indexed-scheme['system] (used to draw control labels)} +@item{@indexed-racket['base] --- no change to family} +@item{@indexed-racket['default]} +@item{@indexed-racket['decorative]} +@item{@indexed-racket['roman]} +@item{@indexed-racket['script]} +@item{@indexed-racket['swiss]} +@item{@indexed-racket['modern] (fixed width)} +@item{@indexed-racket['symbol] (Greek letters)} +@item{@indexed-racket['system] (used to draw control labels)} ] See also @@ -257,7 +257,7 @@ See also (is-a?/c add-color<%>)]{ Gets the additive color shift for the foreground (applied after the - multiplicative factor). Call this @scheme[add-color<%>] object's + multiplicative factor). Call this @racket[add-color<%>] object's methods to change the style delta's additive foreground color shift. } @@ -266,7 +266,7 @@ Gets the additive color shift for the foreground (applied after the (is-a?/c mult-color<%>)]{ Gets the multiplicative color shift for the foreground (applied before - the additive factor). Call this @scheme[mult-color<%>] object's + the additive factor). Call this @racket[mult-color<%>] object's methods to change the style delta's multiplicative foreground color shift. @@ -282,14 +282,14 @@ Gets the additive font size shift (applied after the multiplicative factor). @defmethod[(get-size-in-pixels-off) boolean?]{ -See @scheme[style-delta%]. +See @racket[style-delta%]. } @defmethod[(get-size-in-pixels-on) boolean?]{ -See @scheme[style-delta%]. +See @racket[style-delta%]. } @@ -303,63 +303,63 @@ Gets the multiplicative font size shift (applied before the additive factor). @defmethod[(get-smoothing-off) (or/c 'base 'default 'partly-smoothed 'smoothed 'unsmoothed)]{ -See @scheme[style-delta%]. +See @racket[style-delta%]. } @defmethod[(get-smoothing-on) (or/c 'base 'default 'partly-smoothed 'smoothed 'unsmoothed)]{See -@scheme[style-delta%]. +@racket[style-delta%]. } @defmethod[(get-style-off) (or/c 'base 'normal 'italic 'slant)]{See -@scheme[style-delta%]. +@racket[style-delta%]. } @defmethod[(get-style-on) (or/c 'base 'normal 'italic 'slant)]{See -@scheme[style-delta%]. +@racket[style-delta%]. } @defmethod[(get-transparent-text-backing-off) boolean?]{See -@scheme[style-delta%]. +@racket[style-delta%]. } @defmethod[(get-transparent-text-backing-on) boolean?]{See -@scheme[style-delta%]. +@racket[style-delta%]. } @defmethod[(get-underlined-off) boolean?]{See -@scheme[style-delta%]. +@racket[style-delta%]. } @defmethod[(get-underlined-on) boolean?]{See -@scheme[style-delta%]. +@racket[style-delta%]. } @defmethod[(get-weight-off) (or/c 'base 'normal 'bold 'light)]{See -@scheme[style-delta%]. +@racket[style-delta%]. } @defmethod[(get-weight-on) (or/c 'base 'normal 'bold 'light)]{See -@scheme[style-delta%]. +@racket[style-delta%]. } @defmethod[(set-alignment-off [v (or/c 'base 'top 'center 'bottom)]) void?]{See -@scheme[style-delta%]. +@racket[style-delta%]. } @defmethod[(set-alignment-on [v (or/c 'base 'top 'center 'bottom)]) void?]{See -@scheme[style-delta%]. +@racket[style-delta%]. } @defmethod*[([(set-delta [change-command (or/c 'change-nothing @@ -393,43 +393,43 @@ See @scheme[style-delta%]. Configures the delta with high-level specifications. The return value is the delta itself. -Except for @scheme['change-nothing] and - @scheme['change-normal], the command only changes part of the - delta. Thus, applying @scheme['change-bold] and then - @scheme['change-italic] sets the delta for both the style and +Except for @racket['change-nothing] and + @racket['change-normal], the command only changes part of the + delta. Thus, applying @racket['change-bold] and then + @racket['change-italic] sets the delta for both the style and weight change. -The @scheme[change-command] argument specifies how the delta is changed; +The @racket[change-command] argument specifies how the delta is changed; the possible values are: @itemize[ -@item{@scheme['change-nothing] --- reset all changes} -@item{@scheme['change-normal] --- turn off all styles and resizings} -@item{@scheme['change-toggle-underline] --- underline regions that are currently not underlined, and vice versa} -@item{@scheme['change-toggle-size-in-pixels] --- interpret sizes in pixels for regions that are currently interpreted in points, and vice versa} -@item{@scheme['change-normal-color] --- change the foreground and background to black and white, respectively} -@item{@scheme['change-italic] --- change the style of the font to @italic{italic}} -@item{@scheme['change-bold] --- change the weight of the font to @bold{bold}} -@item{@scheme['change-family] --- change the font family (@scheme[param] is a family; see -@scheme[font%]); see also -@method[style-delta% get-family]} @item{@scheme['change-style] --- change the style of the font (@scheme[param] is a style; see -@scheme[font%])} -@item{@scheme['change-toggle-style] --- toggle the style of the font (@scheme[param] is a style; see -@scheme[font%])} -@item{@scheme['change-weight] --- change the weight of the font (@scheme[param] is a weight; see -@scheme[font%])} -@item{@scheme['change-toggle-weight] --- toggle the weight of the font (@scheme[param] is a weight; see -@scheme[font%])} -@item{@scheme['change-smoothing] --- change the smoothing of the font (@scheme[param] is a smoothing; see -@scheme[font%])} -@item{@scheme['change-toggle-smoothing] --- toggle the smoothing of the font (@scheme[param] is a smoothing; see -@scheme[font%])} -@item{@scheme['change-alignment] --- change the alignment (@scheme[param] is an alignment; see -@scheme[style-delta%])} -@item{@scheme['change-size] --- change the size to an absolute value (@scheme[param] is a size)} -@item{@scheme['change-bigger] --- make the text larger (@scheme[param] is an additive amount)} -@item{@scheme['change-smaller] --- make the text smaller (@scheme[param] is an additive amount)} -@item{@scheme['change-underline] --- set the underline status to either underlined or plain} -@item{@scheme['change-size-in-pixels] --- set the size interpretation to pixels or points} +@item{@racket['change-nothing] --- reset all changes} +@item{@racket['change-normal] --- turn off all styles and resizings} +@item{@racket['change-toggle-underline] --- underline regions that are currently not underlined, and vice versa} +@item{@racket['change-toggle-size-in-pixels] --- interpret sizes in pixels for regions that are currently interpreted in points, and vice versa} +@item{@racket['change-normal-color] --- change the foreground and background to black and white, respectively} +@item{@racket['change-italic] --- change the style of the font to @italic{italic}} +@item{@racket['change-bold] --- change the weight of the font to @bold{bold}} +@item{@racket['change-family] --- change the font family (@racket[param] is a family; see +@racket[font%]); see also +@method[style-delta% get-family]} @item{@racket['change-style] --- change the style of the font (@racket[param] is a style; see +@racket[font%])} +@item{@racket['change-toggle-style] --- toggle the style of the font (@racket[param] is a style; see +@racket[font%])} +@item{@racket['change-weight] --- change the weight of the font (@racket[param] is a weight; see +@racket[font%])} +@item{@racket['change-toggle-weight] --- toggle the weight of the font (@racket[param] is a weight; see +@racket[font%])} +@item{@racket['change-smoothing] --- change the smoothing of the font (@racket[param] is a smoothing; see +@racket[font%])} +@item{@racket['change-toggle-smoothing] --- toggle the smoothing of the font (@racket[param] is a smoothing; see +@racket[font%])} +@item{@racket['change-alignment] --- change the alignment (@racket[param] is an alignment; see +@racket[style-delta%])} +@item{@racket['change-size] --- change the size to an absolute value (@racket[param] is a size)} +@item{@racket['change-bigger] --- make the text larger (@racket[param] is an additive amount)} +@item{@racket['change-smaller] --- make the text smaller (@racket[param] is an additive amount)} +@item{@racket['change-underline] --- set the underline status to either underlined or plain} +@item{@racket['change-size-in-pixels] --- set the size interpretation to pixels or points} ] } @@ -441,16 +441,16 @@ the possible values are: Makes the delta encode a background color change to match the absolute color given; that is, it sets the multiplicative factors to - @scheme[0.0] in the result of @method[style-delta% + @racket[0.0] in the result of @method[style-delta% get-background-mult], and it sets the additive values in the result of @method[style-delta% get-background-add] to the specified color's values. In addition, it also disables transparent text backing by - setting @scheme[transparent-text-backing-on] to @scheme[#f] and - @scheme[transparent-text-backing-off] to @scheme[#t]. + setting @racket[transparent-text-backing-on] to @racket[#f] and + @racket[transparent-text-backing-off] to @racket[#t]. The return value of the method is the delta itself. For the case that a string color name is supplied, see - @scheme[color-database<%>]. + @racket[color-database<%>]. } @@ -475,13 +475,13 @@ The return value is @this-obj[]. Makes the delta encode a foreground color change to match the absolute color given; that is, it sets the multiplicative factors to - @scheme[0.0] in the result of @method[style-delta% + @racket[0.0] in the result of @method[style-delta% get-foreground-mult], and it sets the additive values in the result of @method[style-delta% get-foreground-add] to the specified color's values. The return value of the method is the delta itself. For the case that a string color name is supplied, see - @scheme[color-database<%>]. + @racket[color-database<%>]. } @@ -508,12 +508,12 @@ after the multiplicative factor). @defmethod[(set-size-in-pixels-off [v any/c]) void?]{See -@scheme[style-delta%]. +@racket[style-delta%]. } @defmethod[(set-size-in-pixels-on [v any/c]) void?]{See -@scheme[style-delta%]. +@racket[style-delta%]. } @defmethod[(set-size-mult [v real?]) @@ -523,50 +523,50 @@ before the additive factor). @defmethod[(set-smoothing-off [v (or/c 'base 'default 'partly-smoothed 'smoothed 'unsmoothed)]) void?]{See -@scheme[style-delta%]. +@racket[style-delta%]. } @defmethod[(set-smoothing-on [v (or/c 'base 'default 'partly-smoothed 'smoothed 'unsmoothed)]) void?]{See -@scheme[style-delta%]. +@racket[style-delta%]. } @defmethod[(set-style-off [v (or/c 'base 'normal 'italic 'slant)]) void?]{See -@scheme[style-delta%]. +@racket[style-delta%]. } @defmethod[(set-style-on [v (or/c 'base 'normal 'italic 'slant)]) void?]{See -@scheme[style-delta%]. +@racket[style-delta%]. } @defmethod[(set-transparent-text-backing-off [v any/c]) void?]{See -@scheme[style-delta%]. +@racket[style-delta%]. } @defmethod[(set-transparent-text-backing-on [v any/c]) void?]{See -@scheme[style-delta%]. +@racket[style-delta%]. } @defmethod[(set-underlined-off [v any/c]) void?]{See -@scheme[style-delta%]. +@racket[style-delta%]. } @defmethod[(set-underlined-on [v any/c]) void?]{See -@scheme[style-delta%]. +@racket[style-delta%]. } @defmethod[(set-weight-off [v (or/c 'base 'normal 'bold 'light)]) void?]{See -@scheme[style-delta%]. +@racket[style-delta%]. } @defmethod[(set-weight-on [v (or/c 'base 'normal 'bold 'light)]) void?]{See -@scheme[style-delta%]. +@racket[style-delta%]. }} diff --git a/collects/scribblings/gui/style-intf.scrbl b/collects/scribblings/gui/style-intf.scrbl index 561b37ce3e..cada230cc4 100644 --- a/collects/scribblings/gui/style-intf.scrbl +++ b/collects/scribblings/gui/style-intf.scrbl @@ -3,10 +3,10 @@ @definterface/title[style<%> ()]{ -A @scheme[style<%>] object encapsulates drawing information (font, - color, alignment, etc.) in a hierarchical manner. A @scheme[style<%>] - object always exists within the context of a @scheme[style-list%] - object and is never created except by a @scheme[style-list%] object. +A @racket[style<%>] object encapsulates drawing information (font, + color, alignment, etc.) in a hierarchical manner. A @racket[style<%>] + object always exists within the context of a @racket[style-list%] + object and is never created except by a @racket[style-list%] object. See also @|stylediscuss|. @@ -14,8 +14,8 @@ See also @|stylediscuss|. @defmethod[(get-alignment) (one-of/c 'top 'center 'bottom)]{ -Returns the style's alignment: @scheme['top], @scheme['center], or - @scheme['bottom]. +Returns the style's alignment: @racket['top], @racket['center], or + @racket['bottom]. } @@ -32,7 +32,7 @@ Returns the style's background color. (or/c (is-a?/c style<%>) false/c)]{ Returns the style's base style. See @|stylediscuss| for more - information. The return value is @scheme[#f] only for the basic style + information. The return value is @racket[#f] only for the basic style in the list. } @@ -48,7 +48,7 @@ Mutates @racket[delta], changing it to match the style's delta, if the style is @defmethod[(get-face) (or/c string? false/c)]{ -Returns the style's face name. See @scheme[font%]. +Returns the style's face name. See @racket[font%]. } @@ -57,7 +57,7 @@ Returns the style's face name. See @scheme[font%]. (one-of/c 'default 'decorative 'roman 'script 'swiss 'modern 'symbol 'system)]{ -Returns the style's font family. See @scheme[font%]. +Returns the style's font family. See @racket[font%]. } @@ -78,8 +78,8 @@ Returns the style's foreground color. @defmethod[(get-name) (or/c string? false/c)]{ -Returns the style's name, or @scheme[#f] if it is unnamed. Style names - are only set through the style's @scheme[style-list%] object. +Returns the style's name, or @racket[#f] if it is unnamed. Style names + are only set through the style's @racket[style-list%] object. } @@ -101,22 +101,22 @@ Returns the style's font size. @defmethod[(get-size-in-pixels) boolean?]{ -Returns @scheme[#t] if the style size is in pixels, instead of points, - or @scheme[#f] otherwise. +Returns @racket[#t] if the style size is in pixels, instead of points, + or @racket[#f] otherwise. } @defmethod[(get-smoothing) (one-of/c 'default 'partly-smoothed 'smoothed 'unsmoothed)]{ -Returns the style's font smoothing. See @scheme[font%]. +Returns the style's font smoothing. See @racket[font%]. } @defmethod[(get-style) (one-of/c 'normal 'italic 'slant)]{ -Returns the style's font style. See @scheme[font%]. +Returns the style's font style. See @racket[font%]. } @@ -152,15 +152,15 @@ DC. @defmethod[(get-transparent-text-backing) boolean?]{ -Returns @scheme[#t] if text is drawn without erasing the - text background or @scheme[#f] otherwise. +Returns @racket[#t] if text is drawn without erasing the + text background or @racket[#f] otherwise. } @defmethod[(get-underlined) boolean?]{ -Returns @scheme[#t] if the style is underlined or @scheme[#f] +Returns @racket[#t] if the style is underlined or @racket[#f] otherwise. } @@ -168,14 +168,14 @@ Returns @scheme[#t] if the style is underlined or @scheme[#f] @defmethod[(get-weight) (one-of/c 'normal 'bold 'light)]{ -Returns the style's font weight. See @scheme[font%]. +Returns the style's font weight. See @racket[font%]. } @defmethod[(is-join?) boolean?]{ -Returns @scheme[#t] if the style is a join style or @scheme[#f] +Returns @racket[#t] if the style is a join style or @racket[#f] otherwise. See @|stylediscuss| for more information. } @@ -209,7 +209,7 @@ the style's font, etc. See @|stylediscuss| for more information. void?]{ Sets the font, pen color, etc. of the given drawing context. If - @scheme[oldstyle] is not @scheme[#f], only differences between the + @racket[oldstyle] is not @racket[#f], only differences between the given style and this one are applied to the drawing context. }} diff --git a/collects/scribblings/gui/style-list-class.scrbl b/collects/scribblings/gui/style-list-class.scrbl index d0f750fef5..346a04f19c 100644 --- a/collects/scribblings/gui/style-list-class.scrbl +++ b/collects/scribblings/gui/style-list-class.scrbl @@ -3,11 +3,11 @@ @defclass/title[style-list% object% ()]{ -A @scheme[style-list%] object contains a set of @scheme[style<%>] +A @racket[style-list%] object contains a set of @racket[style<%>] objects and maintains the hierarchical relationships between them. A - @scheme[style<%>] object can only be created through the methods of a - @scheme[style-list%] object. There is a global style list object, - @indexed-scheme[the-style-list], but any number of independent lists can be + @racket[style<%>] object can only be created through the methods of a + @racket[style-list%] object. There is a global style list object, + @indexed-racket[the-style-list], but any number of independent lists can be created for separate style hierarchies. Each editor creates its own private style list. @@ -17,7 +17,7 @@ See @|stylediscuss| for more information. @defconstructor[()]{ -The root style, named @scheme["Basic"], is automatically created. +The root style, named @racket["Basic"], is automatically created. } @@ -36,12 +36,12 @@ See also @|mrprefsdiscuss| for information about the @defmethod[(convert [style (is-a?/c style<%>)]) (is-a?/c style<%>)]{ -Converts @scheme[style], which can be from another style list, to a style -in this list. If @scheme[style] is already in this list, then @scheme[ style] -is returned. If @scheme[style] is named and a style by that name is +Converts @racket[style], which can be from another style list, to a style +in this list. If @racket[style] is already in this list, then @racket[ style] +is returned. If @racket[style] is named and a style by that name is already in this list, then the existing named style is returned. Otherwise, the style is converted by converting its base style -(and shift style if @scheme[style] is a join style) and then creating +(and shift style if @racket[style] is a join style) and then creating a new style in this list. } @@ -49,7 +49,7 @@ a new style in this list. @defmethod[(find-named-style [name string?]) (or/c (is-a?/c style<%>) false/c)]{ -Finds a style by name. If no such style can be found, @scheme[#f] is +Finds a style by name. If no such style can be found, @racket[#f] is returned. } @@ -62,7 +62,7 @@ Creates a new join style, or finds an appropriate existing one. The returned style is always unnamed. See @|stylediscuss| for more information. -The @scheme[base-style] argument must be a style within this style +The @racket[base-style] argument must be a style within this style list. } @@ -76,12 +76,12 @@ Creates a new derived style, or finds an appropriate existing one. The returned style is always unnamed. See @|stylediscuss| for more information. -The @scheme[base-style] argument must be a style within this style -list. If @scheme[base-style] is not a join style, if it has no name, -and if its delta can be collapsed with @scheme[delta] (see +The @racket[base-style] argument must be a style within this style +list. If @racket[base-style] is not a join style, if it has no name, +and if its delta can be collapsed with @racket[delta] (see @xmethod[style-delta% collapse]), then the collapsed delta is used in -place of @scheme[delta], and the base style of @scheme[base-style] is -used in place of @scheme[base-style]; this collapsing and substitution +place of @racket[delta], and the base style of @racket[base-style] is +used in place of @racket[base-style]; this collapsing and substitution of base styles is performed recursively.} @@ -90,7 +90,7 @@ of base styles is performed recursively.} See @method[style-list% notify-on-change]. -The @scheme[key] argument is the value returned by @method[style-list% +The @racket[key] argument is the value returned by @method[style-list% notify-on-change]. } @@ -99,7 +99,7 @@ notify-on-change]. @defmethod[(index-to-style [i exact-nonnegative-integer?]) (or/c (is-a?/c style<%>) false/c)]{ -Returns the style associated with the given index, or @scheme[#f] for +Returns the style associated with the given index, or @racket[#f] for a bad index. See also @method[style-list% style-to-index]. } @@ -111,13 +111,13 @@ Returns the style associated with the given index, or @scheme[#f] for Creates a new named style, unless the name is already being used. -If @scheme[name] is already being used, then @scheme[like-style] is +If @racket[name] is already being used, then @racket[like-style] is ignored and the old style associated to the name is - returned. Otherwise, a new style is created for @scheme[name] with + returned. Otherwise, a new style is created for @racket[name] with the same characteristics (i.e., the same base style and same style - delta or shift style) as @scheme[like-style]. + delta or shift style) as @racket[like-style]. -The @scheme[like-style] style must be in this style list, otherwise +The @racket[like-style] style must be in this style list, otherwise the named style is derived from the basic style with an empty style delta. @@ -132,7 +132,7 @@ Attaches a callback to the style list, retaining the callback only weakly (in Often, a change in one style will trigger a change in several other derived styles; to allow clients to handle all the changes in a - batch, @scheme[#f] is passed in as the changing style after a set of + batch, @racket[#f] is passed in as the changing style after a set of styles has been processed. The return value from @method[style-list% notify-on-change] is an @@ -163,11 +163,11 @@ Like @method[style-list% new-named-style], except that if the name is Returns the index for a particular style. The index for a style's base style (and shift style, if it is a join style) is guaranteed to be lower than the style's own index. (As a result, the root style's - index is always @scheme[0].) A style's index can change whenever a new + index is always @racket[0].) A style's index can change whenever a new style is added to the list, or the base style or shift style of another style is changed. -If the given style is not in this list, @scheme[#f] is returned. +If the given style is not in this list, @racket[#f] is returned. }} diff --git a/collects/scribblings/gui/subarea-intf.scrbl b/collects/scribblings/gui/subarea-intf.scrbl index a9e1b6abb5..57ca0ea72b 100644 --- a/collects/scribblings/gui/subarea-intf.scrbl +++ b/collects/scribblings/gui/subarea-intf.scrbl @@ -3,25 +3,23 @@ @definterface/title[subarea<%> (area<%>)]{ -A @scheme[subarea<%>] is a containee @scheme[area<%>]. +A @racket[subarea<%>] is a containee @racket[area<%>]. -All @scheme[subarea<%>] classes accept the following named +All @racket[subarea<%>] classes accept the following named instantiation arguments: @itemize[ - @item{@indexed-scheme[horiz-margin] --- default is @scheme[2] for - @scheme[control<%>] classes and @scheme[group-box-panel%], - @scheme[0] for others; passed to + @item{@indexed-racket[horiz-margin] --- default is @racket[2] for + @racket[control<%>] classes and @racket[group-box-panel%], + @racket[0] for others; passed to @method[subarea<%> horiz-margin]} - @item{@indexed-scheme[vert-margin] --- default is @scheme[2] for - @scheme[control<%>] classes and @scheme[group-box-panel%], - @scheme[0] for others; passed to + @item{@indexed-racket[vert-margin] --- default is @racket[2] for + @racket[control<%>] classes and @racket[group-box-panel%], + @racket[0] for others; passed to @method[subarea<%> vert-margin]} ] - - @defmethod*[([(horiz-margin) (integer-in 0 1000)] [(horiz-margin [margin (integer-in 0 1000)]) diff --git a/collects/scribblings/gui/subwindow-intf.scrbl b/collects/scribblings/gui/subwindow-intf.scrbl index 71ecd5666c..4a19c81d0f 100644 --- a/collects/scribblings/gui/subwindow-intf.scrbl +++ b/collects/scribblings/gui/subwindow-intf.scrbl @@ -3,7 +3,7 @@ @definterface/title[subwindow<%> (subarea<%> window<%>)]{ -A @scheme[subwindow<%>] is a containee window. +A @racket[subwindow<%>] is a containee window. @defmethod[(reparent [new-parent (or/c (is-a?/c frame%) (is-a?/c dialog%) (is-a?/c panel%) (is-a?/c pane%))]) diff --git a/collects/scribblings/gui/system-menu-funcs.scrbl b/collects/scribblings/gui/system-menu-funcs.scrbl index d331f14020..7f19bd9d8b 100644 --- a/collects/scribblings/gui/system-menu-funcs.scrbl +++ b/collects/scribblings/gui/system-menu-funcs.scrbl @@ -6,31 +6,31 @@ @defproc[(current-eventspace-has-standard-menus?) boolean?]{ -Returns @scheme[#t] for Mac OS X when the current eventspace is the +Returns @racket[#t] for Mac OS X when the current eventspace is the initial one, since that eventspace is the target for the standard application menus. For any other system or eventspace, the result is - @scheme[#f]. + @racket[#f]. This procedure is intended for use in deciding whether to include a @onscreen{Quit}, @onscreen{About}, and @onscreen{Preferences} menu item in a frame's menu. On Mac OS X, the application @onscreen{Quit} menu triggers a call to a frame's @method[top-level-window<%> on-exit] method, the @onscreen{About} menu item is controlled by - @scheme[application-about-handler], and the + @racket[application-about-handler], and the @onscreen{Preferences} menu item is controlled by - @scheme[application-preferences-handler]. + @racket[application-preferences-handler]. } @defproc[(current-eventspace-has-menu-root?) boolean?]{ -Returns @scheme[#t] for Mac OS X when the current eventspace is the +Returns @racket[#t] for Mac OS X when the current eventspace is the initial one, since that eventspace can supply a menu bar to be active when no frame is visible. For any other system or eventspace, the - result is @scheme[#f]. + result is @racket[#f]. This procedure is intended for use in deciding whether to create a - @scheme[menu-bar%] instance with @scheme['root] as its parent. + @racket[menu-bar%] instance with @racket['root] as its parent. } @@ -48,7 +48,7 @@ handler thread (as a callback). The default handler displays a generic Racket dialog. If the current eventspace is not the initial eventspace, this -procedure returns @scheme[void] (when called with zero arguments) +procedure returns @racket[void] (when called with zero arguments) or has no effect (when called with a handler). } @@ -61,13 +61,13 @@ When the current eventspace is the initial eventspace, this procedure retrieves or installs a thunk that is called when the user selects the application @onscreen{Preferences} menu item on Mac OS X. The thunk is always called in the initial eventspace's handler thread (as - a callback). If the handler is set to @scheme[#f], the + a callback). If the handler is set to @racket[#f], the @onscreen{Preferences} item is disabled. -The default handler is @scheme[#f]. +The default handler is @racket[#f]. If the current eventspace is not the initial eventspace, this -procedure returns @scheme[void] (when called with zero arguments) +procedure returns @racket[void] (when called with zero arguments) or has no effect (when called with a handler). } @@ -80,7 +80,7 @@ When the current eventspace is the initial eventspace, this procedure that the application quit (e.g., through the @onscreen{Quit} menu item on Mac OS X, or when shutting down the machine in Windows). The thunk is always called in the initial eventspace's handler thread (as - a callback). If the result of the thunk is @scheme[#f], then the + a callback). If the result of the thunk is @racket[#f], then the operating system is explicitly notified that the application does not intend to quit (on Windows). @@ -88,14 +88,14 @@ The default handler queues a call to the @method[top-level-window<%> can-exit?] method of the most recently active frame in the initial eventspace (and then calls the frame's @method[top-level-window<%> on-exit] method if the - result is true). The result is @scheme[#t] if the eventspace is + result is true). The result is @racket[#t] if the eventspace is left with no open frames after - @method[top-level-window<%> on-exit] returns, @scheme[#f] + @method[top-level-window<%> on-exit] returns, @racket[#f] otherwise. If the current eventspace is not the initial eventspace, this -procedure returns @scheme[void] (when called with zero arguments) +procedure returns @racket[void] (when called with zero arguments) or has no effect (when called with a handler). } @@ -112,7 +112,7 @@ When the current eventspace is the initial eventspace, this procedure The default handler queues a callback to the @method[window<%> on-drop-file] method of the most-recently activated frame in the main eventspace (see -@scheme[get-top-level-edit-target-window]), if +@racket[get-top-level-edit-target-window]), if drag-and-drop is enabled for that frame. Otherwise, it saves the filename and re-queues the handler event when the application file handler is later changed. @@ -123,6 +123,6 @@ When the application is @italic{not} running and user double-clicks an application. If the current eventspace is not the initial eventspace, this -procedure returns @scheme[void] (when called with zero arguments) +procedure returns @racket[void] (when called with zero arguments) or has no effect (when called with a handler). } diff --git a/collects/scribblings/gui/tab-panel-class.scrbl b/collects/scribblings/gui/tab-panel-class.scrbl index 538e1fbfd8..cdac282913 100644 --- a/collects/scribblings/gui/tab-panel-class.scrbl +++ b/collects/scribblings/gui/tab-panel-class.scrbl @@ -5,9 +5,9 @@ A tab panel arranges its subwindows in a single column, but also includes a horizontal row of tabs at the top of the panel. See - also @scheme[panel%]. + also @racket[panel%]. -The @scheme[tab-panel%] class does not implement the virtual +The @racket[tab-panel%] class does not implement the virtual swapping of the panel content when a new tab is selected. Instead, it merely invokes a callback procedure to indicate that a user changed the tab selection. @@ -36,20 +36,20 @@ The @scheme[tab-panel%] class does not implement the virtual [stretchable-width any/c #t] [stretchable-height any/c #t])]{ -Creates a tab pane, where the @scheme[choices] list specifies the tab +Creates a tab pane, where the @racket[choices] list specifies the tab labels. -Each string in @scheme[choices] can contain an ampersand, which (in the +Each string in @racket[choices] can contain an ampersand, which (in the future) may create a mnemonic for clicking the corresponding tab. A double ampersand is converted to a single ampersand. -The @scheme[callback] procedure is called (with the event type - @indexed-scheme['tab-panel]) when the user changes the tab selection. +The @racket[callback] procedure is called (with the event type + @indexed-racket['tab-panel]) when the user changes the tab selection. -If the @scheme[style] list includes @scheme['no-border], no border is - drawn around the panel content. @DeletedStyleNote[@scheme[style] @scheme[parent]]{tab panel} +If the @racket[style] list includes @racket['no-border], no border is + drawn around the panel content. @DeletedStyleNote[@racket[style] @racket[parent]]{tab panel} -@FontKWs[@scheme[font]] @WindowKWs[@scheme[enabled]] @SubareaKWs[] @AreaKWs[] +@FontKWs[@racket[font]] @WindowKWs[@racket[enabled]] @SubareaKWs[] @AreaKWs[] @@ -60,7 +60,7 @@ If the @scheme[style] list includes @scheme['no-border], no border is Adds a tab to the right end of panel's top row of tabs. -The label string @scheme[choice] can contain @litchar{&}, which (in +The label string @racket[choice] can contain @litchar{&}, which (in the future) may create a mnemonic for clicking the new tab. A @litchar{&&} is converted to @litchar{&}. @@ -69,7 +69,7 @@ The label string @scheme[choice] can contain @litchar{&}, which (in @defmethod[(delete [n exact-nonnegative-integer?]) void?]{ -Deletes an existing tab. If @scheme[n] is equal to or larger than the +Deletes an existing tab. If @racket[n] is equal to or larger than the number of tabs on the panel, @|MismatchExn|. } @@ -77,8 +77,8 @@ Deletes an existing tab. If @scheme[n] is equal to or larger than the @defmethod[(get-item-label [n exact-nonnegative-integer?]) string?]{ -Gets the label of a tab by position. Tabs are numbered from @scheme[0]. -If @scheme[n] is equal to or larger than the number of tabs in the panel, +Gets the label of a tab by position. Tabs are numbered from @racket[0]. +If @racket[n] is equal to or larger than the number of tabs in the panel, @|MismatchExn|. } @@ -94,7 +94,7 @@ Returns the number of tabs on the panel. (or/c exact-nonnegative-integer? false/c)]{ Returns the index (counting from 0) of the currently selected tab. If - the panel has no tabs, the result is @scheme[#f]. + the panel has no tabs, the result is @racket[#f]. } @@ -110,7 +110,7 @@ Removes all tabs from the panel and installs tabs with the given [label label-string?]) void?]{ -Set the label for tab @scheme[n] to @scheme[label]. If @scheme[n] is equal to +Set the label for tab @racket[n] to @racket[label]. If @racket[n] is equal to or larger than the number of tabs in the panel, @|MismatchExn|. } @@ -119,7 +119,7 @@ Set the label for tab @scheme[n] to @scheme[label]. If @scheme[n] is equal to void?]{ Sets the currently selected tab by index (counting from 0). -If @scheme[n] is equal to or larger than the number of tabs in the panel, +If @racket[n] is equal to or larger than the number of tabs in the panel, @|MismatchExn|. }} diff --git a/collects/scribblings/gui/tab-snip-class.scrbl b/collects/scribblings/gui/tab-snip-class.scrbl index 1fc9efd189..4eecd7236e 100644 --- a/collects/scribblings/gui/tab-snip-class.scrbl +++ b/collects/scribblings/gui/tab-snip-class.scrbl @@ -3,7 +3,7 @@ @defclass/title[tab-snip% string-snip% ()]{ -An instance of @scheme[tab-snip%] is created automatically when a +An instance of @racket[tab-snip%] is created automatically when a tab is inserted into an editor. @@ -11,7 +11,7 @@ An instance of @scheme[tab-snip%] is created automatically when a Creates a snip for a single tab, though the tab is initially empty. -Normally, a single tab is inserted into a @scheme[tab-snip%] object +Normally, a single tab is inserted into a @racket[tab-snip%] object using the @method[string-snip% insert] method. The tab's content is not drawn, through it is used when determining diff --git a/collects/scribblings/gui/text-class.scrbl b/collects/scribblings/gui/text-class.scrbl index 9e0210b472..d2319d17ec 100644 --- a/collects/scribblings/gui/text-class.scrbl +++ b/collects/scribblings/gui/text-class.scrbl @@ -3,8 +3,8 @@ @defclass/title[text% object% (editor<%>)]{ -A @scheme[text%] object is a standard text editor. A text editor is - displayed on the screen through an @scheme[editor-canvas%] object or +A @racket[text%] object is a standard text editor. A text editor is + displayed on the screen through an @racket[editor-canvas%] object or some other @techlink{display}. @@ -12,20 +12,20 @@ A @scheme[text%] object is a standard text editor. A text editor is [tab-stops (listof real?) null] [auto-wrap any/c #f])]{ -The @scheme[line-spacing] argument sets the additional amount of space +The @racket[line-spacing] argument sets the additional amount of space (in DC units) inserted between each line in the editor when the editor is displayed. This spacing is included in the reported height of each line. -See @method[text% set-tabs] for information about @scheme[tabstops]. +See @method[text% set-tabs] for information about @racket[tabstops]. -If @scheme[auto-wrap] is true, then auto-wrapping is enabled via +If @racket[auto-wrap] is true, then auto-wrapping is enabled via @method[editor<%> auto-wrap]. -A new @scheme[keymap%] object is created for the new editor. See also +A new @racket[keymap%] object is created for the new editor. See also @method[editor<%> get-keymap] and @method[editor<%> set-keymap]. -A new @scheme[style-list%] object is created for the new editor. See +A new @racket[style-list%] object is created for the new editor. See also @method[editor<%> get-style-list] and @method[editor<%> set-style-list]. @@ -66,9 +66,9 @@ Called after a given range is deleted from the editor (and after the @method[editor<%> begin-edit-sequence] to avoid extra refreshes when @method[text% after-delete] modifies the editor). -The @scheme[start] argument specifies the starting @techlink{position} - of the deleted range. The @scheme[len] argument specifies number of - deleted @techlink{item}s (so @math{@scheme[start]+@scheme[len]} is +The @racket[start] argument specifies the starting @techlink{position} + of the deleted range. The @racket[len] argument specifies number of + deleted @techlink{item}s (so @math{@racket[start]+@racket[len]} is the ending @techlink{position} of the deleted range). See also @method[text% can-delete?] and @method[editor<%> @@ -94,8 +94,8 @@ Called after @techlink{item}s are inserted into the editor (and after @method[editor<%> begin-edit-sequence] to avoid extra refreshes when @method[text% after-insert] modifies the editor). -The @scheme[start] argument specifies the @techlink{position} of the insert. The - @scheme[len] argument specifies the total length (in @techlink{position}s) of +The @racket[start] argument specifies the @techlink{position} of the insert. The + @racket[len] argument specifies the total length (in @techlink{position}s) of the inserted @techlink{item}s. See also @method[text% can-insert?] and @method[editor<%> @@ -117,10 +117,10 @@ Does nothing. Called after adjacent snips in the editor are combined into one. -The @scheme[pos] argument specifies the @techlink{position} within the editor +The @racket[pos] argument specifies the @techlink{position} within the editor where the snips were merged (i.e., one old snip was just before - @scheme[pos], one old was just after @scheme[pos], and the new snip spans - @scheme[pos]). + @racket[pos], one old was just after @racket[pos], and the new snip spans + @racket[pos]). See also @method[snip% merge-with]. @@ -185,7 +185,7 @@ Called after a snip in the editor is split into two, either through a call to @method[text% split-snip] or during some other action, such as inserting. -The @scheme[pos] argument specifies the @techlink{position} within the editor +The @racket[pos] argument specifies the @techlink{position} within the editor where a snip was split. } @@ -213,7 +213,7 @@ Simulates a user click that invokes a clickback, if the given range of @methspec{ Called before the style is changed in a given range of the editor. If - the return value is @scheme[#f], then the style change will be + the return value is @racket[#f], then the style change will be aborted. The editor is internally locked for writing during a call to this @@ -226,7 +226,7 @@ See also @method[text% on-change-style], @method[text% } @methimpl{ -Returns @scheme[#t]. +Returns @racket[#t]. } } @@ -238,12 +238,12 @@ Returns @scheme[#t]. @methspec{ Called before a range is deleted from the editor. -If the return value is @scheme[#f], then the +If the return value is @racket[#f], then the delete will be aborted. -The @scheme[start] argument specifies the starting @techlink{position} - of the range to delete. The @scheme[len] argument specifies number of - @techlink{item}s to delete (so @math{@scheme[start]+@scheme[len]} is +The @racket[start] argument specifies the starting @techlink{position} + of the range to delete. The @racket[len] argument specifies number of + @techlink{item}s to delete (so @math{@racket[start]+@racket[len]} is the ending @techlink{position} of the range to delete). The editor is internally locked for writing during a call to this method @@ -256,7 +256,7 @@ See also @method[text% on-delete], @method[text% after-delete], and } @methimpl{ -Returns @scheme[#t]. +Returns @racket[#t]. }} @@ -267,10 +267,10 @@ Returns @scheme[#t]. @methspec{ Called before @techlink{item}s are inserted into the editor. If the - return value is @scheme[#f], then the insert will be aborted. + return value is @racket[#f], then the insert will be aborted. -The @scheme[start] argument specifies the @techlink{position} of the potential - insert. The @scheme[len] argument specifies the total length (in +The @racket[start] argument specifies the @techlink{position} of the potential + insert. The @racket[len] argument specifies the total length (in @techlink{position}s) of the @techlink{item}s to be inserted. The editor is internally locked for writing during a call to this @@ -283,7 +283,7 @@ See also @method[text% on-insert], @method[text% after-insert], and } @methimpl{ -Returns @scheme[#t]. +Returns @racket[#t]. }} @@ -295,7 +295,7 @@ Returns @scheme[#t]. @methspec{ Called before the editor's maximum or minimum height or width -is changed. If the return value is @scheme[#f], then the +is changed. If the return value is @racket[#f], then the change will be aborted. (This callback method is provided because setting an editor's maximum @@ -307,7 +307,7 @@ See also @method[text% on-set-size-constraint], @method[text% } @methimpl{ -Returns @scheme[#t]. +Returns @racket[#t]. }} @@ -315,7 +315,7 @@ Returns @scheme[#t]. @defmethod[(caret-hidden?) boolean?]{ -Returns @scheme[#t] if the caret is hidden for this editor or @scheme[#f] +Returns @racket[#t] if the caret is hidden for this editor or @racket[#f] otherwise. See also @method[text% hide-caret]. @@ -335,22 +335,22 @@ See also @method[text% hide-caret]. void?])]{ Changes the style for a region in the editor by applying a style delta - or installing a specific style. If @scheme[start] is @scheme['start] - and @scheme[end] is @scheme['end], then the currently selected - @techlink{item}s are changed. Otherwise, if @scheme[end] is - @scheme['end], then the style is changed from @scheme[start] until - the end of the selection. If @scheme[counts-as-mod?] is @scheme[#f], + or installing a specific style. If @racket[start] is @racket['start] + and @racket[end] is @racket['end], then the currently selected + @techlink{item}s are changed. Otherwise, if @racket[end] is + @racket['end], then the style is changed from @racket[start] until + the end of the selection. If @racket[counts-as-mod?] is @racket[#f], then @method[editor<%> set-modified] is not called after applying the style change. To change a large collection of snips from one style to another style, - consider providing a @scheme[style<%>] instance rather than a - @scheme[style-delta%] instance. Otherwise, @method[text% - change-style] must convert the @scheme[style-delta%] instance to the - @scheme[style<%>] instance for every snip; this conversion consumes + consider providing a @racket[style<%>] instance rather than a + @racket[style-delta%] instance. Otherwise, @method[text% + change-style] must convert the @racket[style-delta%] instance to the + @racket[style<%>] instance for every snip; this conversion consumes both time and (temporary) memory. -When @scheme[style] is provided: @InStyleListNote[@scheme[style]] +When @racket[style] is provided: @InStyleListNote[@racket[style]] } @@ -362,13 +362,13 @@ When @scheme[style] is provided: @InStyleListNote[@scheme[style]] [end (or/c exact-nonnegative-integer? 'end) 'end]) void?]{ -Copies specified range of text into the clipboard. If @scheme[extend?] is - not @scheme[#f], the old clipboard contents are appended. If - @scheme[start] is @scheme['start] or @scheme[end] is @scheme['end], then the +Copies specified range of text into the clipboard. If @racket[extend?] is + not @racket[#f], the old clipboard contents are appended. If + @racket[start] is @racket['start] or @racket[end] is @racket['end], then the current selection start/end is used. -See @|timediscuss| for a discussion of the @scheme[time] argument. If - @scheme[time] is outside the platform-specific range of times, +See @|timediscuss| for a discussion of the @racket[time] argument. If + @racket[time] is outside the platform-specific range of times, @|MismatchExn|. } @@ -381,7 +381,7 @@ See @|timediscuss| for a discussion of the @scheme[time] argument. If In addition to the default @xmethod[editor<%> copy-self-to] work, this editor's file format, wordbreak function, wordbreak map, click-between-threshold, caret visibility state, overwrite mode - state, and autowrap bitmap are installed into @scheme[dest]. + state, and autowrap bitmap are installed into @racket[dest]. } @@ -393,13 +393,13 @@ In addition to the default @xmethod[editor<%> copy-self-to] work, [end (or/c exact-nonnegative-integer? 'end) 'end]) void?]{ -Copies and then deletes the specified range. If @scheme[extend?] is not - @scheme[#f], the old clipboard contents are appended. If @scheme[start] is - @scheme['start] or @scheme[end] is @scheme['end], then the current +Copies and then deletes the specified range. If @racket[extend?] is not + @racket[#f], the old clipboard contents are appended. If @racket[start] is + @racket['start] or @racket[end] is @racket['end], then the current selection start/end is used. -See @|timediscuss| for a discussion of the @scheme[time] argument. If - @scheme[time] is outside the platform-specific range of times, +See @|timediscuss| for a discussion of the @racket[time] argument. If + @racket[time] is outside the platform-specific range of times, @|MismatchExn|. } @@ -413,11 +413,11 @@ See @|timediscuss| for a discussion of the @scheme[time] argument. If void?])]{ Deletes the specified range or the currently selected text (when no - range is provided) in the editor. If @scheme[start] is - @scheme['start], then the starting selection @techlink{position} is - used; if @scheme[end] is @scheme['back], then only the character - preceding @scheme[start] is deleted. If @scheme[scroll-ok?] is not - @scheme[#f] and @scheme[start] is the same as the current caret + range is provided) in the editor. If @racket[start] is + @racket['start], then the starting selection @techlink{position} is + used; if @racket[end] is @racket['back], then only the character + preceding @racket[start] is deleted. If @racket[scroll-ok?] is not + @racket[#f] and @racket[start] is the same as the current caret @techlink{position}, then the editor's @techlink{display} may be scrolled to show the new selection @techlink{position}. @@ -439,15 +439,15 @@ Called to copy a region of the editor into the clipboard. This method is provided so that it can be overridden by subclasses. Do not call this method directly; instead, call @method[text% copy]. -See @|timediscuss| for a discussion of the @scheme[time] argument. If - @scheme[time] is outside the platform-specific range of times, +See @|timediscuss| for a discussion of the @racket[time] argument. If + @racket[time] is outside the platform-specific range of times, @|MismatchExn|. } @methimpl{ -Copy the data from @scheme[start] to @scheme[end], extending the current - clipboard contexts if @scheme[extend?] is not @scheme[#f]. +Copy the data from @racket[start] to @racket[end], extending the current + clipboard contexts if @racket[extend?] is not @racket[#f]. }} @@ -461,14 +461,14 @@ Called to paste the current contents of the clipboard into the editor. This method is provided so that it can be overridden by subclasses. Do not call this method directly; instead, call @method[text% paste]. -See @|timediscuss| for a discussion of the @scheme[time] argument. If - @scheme[time] is outside the platform-specific range of times, +See @|timediscuss| for a discussion of the @racket[time] argument. If + @racket[time] is outside the platform-specific range of times, @|MismatchExn|. } @methimpl{ -Pastes into the @techlink{position} @scheme[start]. +Pastes into the @techlink{position} @racket[start]. }} @@ -483,14 +483,14 @@ Called to paste the current contents of the X11 selection on Unix (or the provided so that it can be overridden by subclasses. Do not call this method directly; instead, call @method[text% paste-x-selection]. -See @|timediscuss| for a discussion of the @scheme[time] argument. If - @scheme[time] is outside the platform-specific range of times, +See @|timediscuss| for a discussion of the @racket[time] argument. If + @racket[time] is outside the platform-specific range of times, @|MismatchExn|. } @methimpl{ -Pastes into the @techlink{position} @scheme[start]. +Pastes into the @techlink{position} @racket[start]. }} @@ -525,10 +525,10 @@ See also @method[text% delete]. Given a @techlink{location} in the editor, returns the line at the @techlink{location}. @|LineNumbering| -@boxisfillnull[(scheme on-it?) @elem{@scheme[#t] if the line actually - touches this @techlink{position}, or @scheme[#f] otherwise}] (A large - enough @scheme[y] will always return the last line number, but will - set @scheme[on-it?] to @scheme[#f].) +@boxisfillnull[(scheme on-it?) @elem{@racket[#t] if the line actually + touches this @techlink{position}, or @racket[#f] otherwise}] (A large + enough @racket[y] will always return the last line number, but will + set @racket[on-it?] to @racket[#f].) @|OVD| @|FCA| @@ -548,10 +548,10 @@ break (possibly more efficiently than searching text).} (or/c (is-a?/c snip%) #f)]{ Given a snip, returns the next snip in the editor (after the given - one) that is not an instance of @scheme[string-snip%]. If - @scheme[#f] is given as the snip, the result is the first non-string + one) that is not an instance of @racket[string-snip%]. If + @racket[#f] is given as the snip, the result is the first non-string snip in the editor (if any). If no non-string snip is found after the - given snip, the result is @scheme[#f]. + given snip, the result is @racket[#f]. } @@ -566,9 +566,9 @@ Given a snip, returns the next snip in the editor (after the given Given a @techlink{location} in the editor, returns the @techlink{position} at the @techlink{location}. -See @|ateoldiscuss| for a discussion of the @scheme[at-eol?] argument. - @boxisfillnull[(scheme on-it?) @elem{@scheme[#t] if the line actually touches this - @techlink{position}, or @scheme[#f] otherwise}] +See @|ateoldiscuss| for a discussion of the @racket[at-eol?] argument. + @boxisfillnull[(scheme on-it?) @elem{@racket[#t] if the line actually touches this + @techlink{position}, or @racket[#f] otherwise}] @boxisfillnull[(scheme edge-close?) @elem{it will be filled in with a value indicating how close the point is to the vertical edges of the @techlink{item} @@ -593,12 +593,12 @@ See @|ateoldiscuss| for a discussion of the @scheme[at-eol?] argument. Given a @techlink{location} within a line of the editor, returns the @techlink{position} at the @techlink{location}. @|LineNumbering| -See @|ateoldiscuss| for a discussion of the @scheme[at-eol?] argument. - @boxisfillnull[(scheme on-it?) @elem{@scheme[#t] if the line actually - touches this @techlink{position}, or @scheme[#f] otherwise}] +See @|ateoldiscuss| for a discussion of the @racket[at-eol?] argument. + @boxisfillnull[(scheme on-it?) @elem{@racket[#t] if the line actually + touches this @techlink{position}, or @racket[#f] otherwise}] See @method[text% find-position] for a discussion of - @scheme[edge-close?]. + @racket[edge-close?]. @|OVD| @|FCA| @@ -610,25 +610,25 @@ See @method[text% find-position] for a discussion of [s-pos (or/c (box/c exact-nonnegative-integer?) #f) #f]) (or/c (is-a?/c snip%) #f)]{ -Returns the snip at a given @techlink{position}, or @scheme[#f] if an appropriate +Returns the snip at a given @techlink{position}, or @racket[#f] if an appropriate snip cannot be found. -If the @techlink{position} @scheme[pos] is between -two snips, @scheme[direction] specifies which snip to return; @scheme[direction] +If the @techlink{position} @racket[pos] is between +two snips, @racket[direction] specifies which snip to return; @racket[direction] can be any of the following: @itemize[ - @item{@scheme['before-or-none] --- returns the snip before the - @techlink{position}, or @scheme[#f] if @scheme[pos] is @scheme[0]} + @item{@racket['before-or-none] --- returns the snip before the + @techlink{position}, or @racket[#f] if @racket[pos] is @racket[0]} - @item{@scheme['before] --- returns the snip before the @techlink{position}, - or the first snip if @scheme[pos] is @scheme[0]} + @item{@racket['before] --- returns the snip before the @techlink{position}, + or the first snip if @racket[pos] is @racket[0]} - @item{@scheme['after] --- returns the snip after the @techlink{position}, or - the last snip if @scheme[pos] is the last @techlink{position}} + @item{@racket['after] --- returns the snip after the @techlink{position}, or + the last snip if @racket[pos] is the last @techlink{position}} - @item{@scheme['after-or-none] -- returns the snip after the - @techlink{position}, or @scheme[#f] if @scheme[pos] is the last @techlink{position} or larger} + @item{@racket['after-or-none] -- returns the snip after the + @techlink{position}, or @racket[#f] if @racket[pos] is the last @techlink{position} or larger} ] @@ -646,24 +646,24 @@ can be any of the following: (or/c exact-nonnegative-integer? #f)]{ Finds an exact-match string in the editor and returns its @techlink{position}. - If the string is not found, @scheme[#f] is returned. + If the string is not found, @racket[#f] is returned. -The @scheme[direction] argument can be @scheme['forward] or - @scheme['backward], indicating a forward search or backward +The @racket[direction] argument can be @racket['forward] or + @racket['backward], indicating a forward search or backward search respectively. In the case of a forward search, the return value is the starting @techlink{position} of the string; for a backward search, - the ending @techlink{position} is returned. However, if @scheme[get-start?] is - @scheme[#f], then the other end of the string @techlink{position} will be + the ending @techlink{position} is returned. However, if @racket[get-start?] is + @racket[#f], then the other end of the string @techlink{position} will be returned. -The @scheme[start] and @scheme[end] arguments set the starting and ending - @techlink{position}s of a forward search (use @scheme[start] > @scheme[end] for a - backward search). If @scheme[start] is @scheme['start], then the search - starts at the start of the selection. If @scheme[end] is @scheme['eof], +The @racket[start] and @racket[end] arguments set the starting and ending + @techlink{position}s of a forward search (use @racket[start] > @racket[end] for a + backward search). If @racket[start] is @racket['start], then the search + starts at the start of the selection. If @racket[end] is @racket['eof], then the search continues to the end (for a forward search) or start (for a backward search) of the editor. -If @scheme[case-sensitive?] is @scheme[#f], then an uppercase and lowercase +If @racket[case-sensitive?] is @racket[#f], then an uppercase and lowercase of each alphabetic character are treated as equivalent. } @@ -692,34 +692,34 @@ Finds all occurrences of a string using @method[text% find-string]. If Finds wordbreaks in the editor using the current wordbreak procedure. See also @method[text% set-wordbreak-func]. -The contents of the @scheme[start] argument specifies an @techlink{position} to start +The contents of the @racket[start] argument specifies an @techlink{position} to start searching backwards to the next word start; its will be filled with - the starting @techlink{position} of the word that is found. If @scheme[start] is - @scheme[#f], no backward search is performed. + the starting @techlink{position} of the word that is found. If @racket[start] is + @racket[#f], no backward search is performed. -The contents of the @scheme[end] argument specifies an @techlink{position} to start +The contents of the @racket[end] argument specifies an @techlink{position} to start searching forwards to the next word end; its will be filled with the - ending @techlink{position} of the word that is found. If @scheme[end] is - @scheme[#f], no forward search is performed. + ending @techlink{position} of the word that is found. If @racket[end] is + @racket[#f], no forward search is performed. -The @scheme[reason] argument specifies more information about what the +The @racket[reason] argument specifies more information about what the wordbreak is used for. For example, the wordbreaks used to move the caret may be different from the wordbreaks used to break lines. The - possible values of @scheme[reason] are: + possible values of @racket[reason] are: @itemize[ -@item{@scheme['caret] --- find a wordbreak suitable for moving the caret} -@item{@scheme['line] --- find a wordbreak suitable for breaking lines} -@item{@scheme['selection] --- find a wordbreak suitable for selecting the closest word} -@item{@scheme['user1] --- for other (not built-in) uses} -@item{@scheme['user2] --- for other (not built-in) uses} +@item{@racket['caret] --- find a wordbreak suitable for moving the caret} +@item{@racket['line] --- find a wordbreak suitable for breaking lines} +@item{@racket['selection] --- find a wordbreak suitable for selecting the closest word} +@item{@racket['user1] --- for other (not built-in) uses} +@item{@racket['user2] --- for other (not built-in) uses} ] -The actual handling of @scheme[reason] is controlled by the current +The actual handling of @racket[reason] is controlled by the current wordbreak procedure; see @method[text% set-wordbreak-func]for details. The default handler and default wordbreak map treats - alphanumeric characters the same for @scheme['caret], @scheme['line], - and @scheme['selection]. Non-alphanumeric, non-space, non-hyphen + alphanumeric characters the same for @racket['caret], @racket['line], + and @racket['selection]. Non-alphanumeric, non-space, non-hyphen characters do not break lines, but do break caret and selection words. For example a comma should not be counted as part of the preceding word for moving the caret past the word or double-clicking @@ -749,9 +749,9 @@ Turns off the hiliting and shows the normal selection range again; see Temporarily hilites a region in the editor without changing the current selection. -See @|ateoldiscuss| for a discussion of the @scheme[at-eol?] argument. If - @scheme[scroll?] is not @scheme[#f], the editor's @techlink{display} will be scrolled - if necessary to show the hilited region. If @scheme[timeout] is greater +See @|ateoldiscuss| for a discussion of the @racket[at-eol?] argument. If + @racket[scroll?] is not @racket[#f], the editor's @techlink{display} will be scrolled + if necessary to show the hilited region. If @racket[timeout] is greater than 0, then the hiliting will be automatically turned off after the given number of milliseconds. @@ -763,7 +763,7 @@ See also @method[text% flash-off]. @defmethod[(get-anchor) boolean?]{ -Returns @scheme[#t] if the selection is currently auto-extending. See +Returns @racket[#t] if the selection is currently auto-extending. See also @method[text% set-anchor]. } @@ -785,11 +785,11 @@ See also @method[text% set-between-threshold]. char?]{ Returns the character following the @techlink{position} - @scheme[start]. The character corresponds to getting non-flattened + @racket[start]. The character corresponds to getting non-flattened text from the editor. -If @scheme[start] is greater than or equal to the last - @techlink{position}, @scheme[#\nul] is returned. +If @racket[start] is greater than or equal to the last + @techlink{position}, @racket[#\nul] is returned. } @@ -834,7 +834,7 @@ Returns the spacing inserted by the editor between each line. This @defmethod[(get-overwrite-mode) boolean?]{ -Returns @scheme[#t] if the editor is in overwrite mode, @scheme[#f] +Returns @racket[#t] if the editor is in overwrite mode, @racket[#f] otherwise. Overwrite mode only affects the way that @method[editor<%> on-default-char] handles keyboard input for insertion characters. See also @method[text% set-overwrite-mode]. @@ -858,7 +858,7 @@ See also @method[text% set-padding].} void?]{ Returns the current selection range in @techlink{position}s. If -nothing is selected, the @scheme[start] and @scheme[end] will be +nothing is selected, the @racket[start] and @racket[end] will be the same number and that number will be where the insertion point is. See also @method[text% get-start-position] @@ -906,7 +906,7 @@ Returns an inexact number that increments every time the editor is (or/c exact-nonnegative-integer? #f)]{ Returns the starting @techlink{position} of a given snip or - @scheme[#f] if the snip is not in this editor. + @racket[#f] if the snip is not in this editor. } @@ -918,12 +918,12 @@ Returns the starting @techlink{position} of a given snip or boolean?]{ Gets a snip's @techlink{position} and top left @techlink{location} in editor - coordinates. The return value is @scheme[#t] if the snip is found, - @scheme[#f] otherwise. + coordinates. The return value is @racket[#t] if the snip is found, + @racket[#f] otherwise. -@boxisfillnull[(scheme pos) @elem{starting @techlink{position} of @scheme[snip]}] -@boxisfillnull[(scheme x) @elem{left @techlink{location} of @scheme[snip] in editor coordinates}] -@boxisfillnull[(scheme y) @elem{top @techlink{location} of @scheme[snip] in editor coordinates}] +@boxisfillnull[(scheme pos) @elem{starting @techlink{position} of @racket[snip]}] +@boxisfillnull[(scheme x) @elem{left @techlink{location} of @racket[snip] in editor coordinates}] +@boxisfillnull[(scheme y) @elem{top @techlink{location} of @racket[snip] in editor coordinates}] When @techlink{location} information is requested: @|OVD| @|FCA| @@ -972,8 +972,8 @@ Returns the current tab-position array as a list. list)}] @boxisfillnull[(scheme tab-width) @elem{the width used for tabs past the end of the tab array}] -@boxisfillnull[(scheme in-units) @elem{@scheme[#t] if the tabs are specified in -canvas units or @scheme[#f] if they are specified in space-widths}] +@boxisfillnull[(scheme in-units) @elem{@racket[#t] if the tabs are specified in +canvas units or @racket[#f] if they are specified in space-widths}] See also @method[text% set-tabs]. @@ -987,16 +987,16 @@ See also [force-cr? any/c #f]) string?]{ -Gets the text from @scheme[start] to @scheme[end]. If @scheme[end] is - @scheme['eof], then the contents are returned from @scheme[start] until the +Gets the text from @racket[start] to @racket[end]. If @racket[end] is + @racket['eof], then the contents are returned from @racket[start] until the end of the editor. -If @scheme[flattened?] is not @scheme[#f], then flattened text is returned. +If @racket[flattened?] is not @racket[#f], then flattened text is returned. See @|textdiscuss| for a discussion of flattened vs. non-flattened text. -If @scheme[force-cr?] is not @scheme[#f] and @scheme[flattened?] is not - @scheme[#f], then automatic carriage returns (from word-wrapping) are +If @racket[force-cr?] is not @racket[#f] and @racket[flattened?] is not + @racket[#f], then automatic carriage returns (from word-wrapping) are written into the return string as real carriage returns. } @@ -1027,8 +1027,8 @@ Returns the range of lines which are currently visible (or partially @boxisfillnull[(scheme start) @elem{first line visible to the user}] @boxisfillnull[(scheme end) @elem{last line visible to the user}] -If the editor is displayed by multiple canvases and @scheme[all?] is - @scheme[#t], then the computed range includes all visible lines in all +If the editor is displayed by multiple canvases and @racket[all?] is + @racket[#t], then the computed range includes all visible lines in all @techlink{display}s. Otherwise, the range includes only the visible lines in the current @techlink{display}. @@ -1048,8 +1048,8 @@ Returns the range of @techlink{position}s that are currently visible (or @boxisfillnull[(scheme start) @elem{first @techlink{position} visible to the user}] @boxisfillnull[(scheme end) @elem{last @techlink{position} visible to the user}] -If the editor is displayed by multiple canvases and @scheme[all?] is - @scheme[#t], then the computed range includes all visible @techlink{position}s in +If the editor is displayed by multiple canvases and @racket[all?] is + @racket[#t], then the computed range includes all visible @techlink{position}s in all @techlink{display}s. Otherwise, the range includes only the visible @techlink{position}s in the current @techlink{display}. @@ -1063,7 +1063,7 @@ If the editor is displayed by multiple canvases and @scheme[all?] is Returns the wordbreaking map that is used by the standard wordbreaking function. See @method[text% set-wordbreak-map] and - @scheme[editor-wordbreak-map%] for more information. + @racket[editor-wordbreak-map%] for more information. } @@ -1074,7 +1074,7 @@ Returns the wordbreaking map that is used by the standard wordbreaking Determines whether the caret is shown when the editor has the keyboard focus. -If @scheme[hide?] is not @scheme[#f], then the caret or selection hiliting +If @racket[hide?] is not @racket[#f], then the caret or selection hiliting will not be drawn for the editor. The editor can still own the keyboard focus, but no caret will be drawn to indicate the focus. @@ -1117,32 +1117,32 @@ See also @method[text% caret-hidden?] and @method[editor<%> lock]. void?])]{ Inserts text or a snip into @this-obj[] at @techlink{position} - @scheme[start]. If @scheme[n] is provided, the only the first - @scheme[n] characters of @scheme[str] are inserted. + @racket[start]. If @racket[n] is provided, the only the first + @racket[n] characters of @racket[str] are inserted. -When a @scheme[snip] is provided: The snip cannot be inserted into +When a @racket[snip] is provided: The snip cannot be inserted into multiple editors or multiple times within a single editor. As the snip is inserted, its current style is converted to one in the editor's style list; see also @method[style-list% convert]. -When a @scheme[char] is provided: @|insertcharundos| +When a @racket[char] is provided: @|insertcharundos| -When @scheme[start] is not provided, the current selection start is +When @racket[start] is not provided, the current selection start is used. If the current selection covers a range of @techlink{item}s, - then @scheme[char] replaces the selected text. The selection's start + then @racket[char] replaces the selected text. The selection's start and end @techlink{position}s are moved to the end of the inserted character. -For a case where @scheme[end] is not provided and has no default, the - current selection end is used. Otherwise, if @scheme[end] is not - @scheme['same], then the inserted value replaces the region from - @scheme[start] to @scheme[end], and the selection is left at the end +For a case where @racket[end] is not provided and has no default, the + current selection end is used. Otherwise, if @racket[end] is not + @racket['same], then the inserted value replaces the region from + @racket[start] to @racket[end], and the selection is left at the end of the inserted text. Otherwise, if the insertion @techlink{position} is before or equal to the selection's start/end @techlink{position}, then the selection's start/end @techlink{position} is incremented by - the length of @scheme[str]. + the length of @racket[str]. -If @scheme[scroll-ok?] is not @scheme[#f] and @scheme[start] is the +If @racket[scroll-ok?] is not @racket[#f] and @racket[start] is the same as the current selection's start @techlink{position}, then the editor's @techlink{display} is scrolled to show the new selection @techlink{position}. @@ -1160,13 +1160,13 @@ See also @method[text% get-styles-sticky]. [end exact-nonnegative-integer?]) void?])]{ -Cuts the text in the given region. If @scheme[start] and @scheme[end] +Cuts the text in the given region. If @racket[start] and @racket[end] are not supplied, then the selected region plus all whitespace to the end of line is cut; the newline is also cut if only whitespace exists between the selection and the end of line. -See @|timediscuss| for a discussion of the @scheme[time] argument. If - @scheme[time] is outside the platform-specific range of times, +See @|timediscuss| for a discussion of the @racket[time] argument. If + @racket[time] is outside the platform-specific range of times, @|MismatchExn|. } @@ -1176,7 +1176,7 @@ See @|timediscuss| for a discussion of the @scheme[time] argument. If exact-nonnegative-integer?]{ Returns the number of the last line in the editor. Lines are numbered - starting with @scheme[0], so this is one less than the number of lines + starting with @racket[0], so this is one less than the number of lines in the editor. @LineToPara[(scheme last-paragraph)] @@ -1189,7 +1189,7 @@ Returns the number of the last line in the editor. Lines are numbered exact-nonnegative-integer?]{ Returns the number of the last paragraph in the editor. Paragraphs are - numbered starting with @scheme[0], so this is one less than the + numbered starting with @racket[0], so this is one less than the number of paragraphs in the editor. @|FCAMW| @@ -1210,12 +1210,12 @@ Returns the last selection @techlink{position} in the editor. This is Returns the last @techlink{position} of a given line. @|LineNumbering| -If there are fewer than @math{@scheme[line]-1} lines, the end of the - last line is returned. If @scheme[line] is less than 0, then the end +If there are fewer than @math{@racket[line]-1} lines, the end of the + last line is returned. If @racket[line] is less than 0, then the end of the first line is returned. If the line ends with invisible @techlink{item}s (such as a carriage - return) and @scheme[visible?] is not @scheme[#f], the first + return) and @racket[visible?] is not @racket[#f], the first @techlink{position} before the invisible @techlink{item}s is returned. @@ -1243,7 +1243,7 @@ line. @|LineNumbering| Given a line number, returns the @techlink{location} of the line. @|LineNumbering| -If @scheme[top?] is not @scheme[#f], the @techlink{location} for the +If @racket[top?] is not @racket[#f], the @techlink{location} for the top of the line is returned; otherwise, the @techlink{location} for the bottom of the line is returned. @@ -1269,12 +1269,12 @@ Returns the paragraph number of the paragraph containing the line. Returns the first @techlink{position} of the given line. @|LineNumbering| -If there are fewer than @math{@scheme[line]-1} lines, the start of the -last line is returned. If @scheme[line] is less than 0, then +If there are fewer than @math{@racket[line]-1} lines, the start of the +last line is returned. If @racket[line] is less than 0, then the start of the first line is returned. -If the line starts with invisible @techlink{item}s and @scheme[visible?] is not - @scheme[#f], the first @techlink{position} past the invisible @techlink{item}s is +If the line starts with invisible @techlink{item}s and @racket[visible?] is not + @racket[#f], the first @techlink{position} past the invisible @techlink{item}s is returned. @LineToPara[(scheme paragraph-start-position)] @@ -1309,30 +1309,30 @@ then this method ignores the editor's maximum width and any automatic Moves the current selection. -The possible values for @scheme[code] are: +The possible values for @racket[code] are: @itemize[ -@item{@scheme['home] --- go to start of file} -@item{@scheme['end] --- go to end of file} -@item{@scheme['right] --- move right} -@item{@scheme['left] --- move left} -@item{@scheme['up] --- move up} -@item{@scheme['down] --- move down} +@item{@racket['home] --- go to start of file} +@item{@racket['end] --- go to end of file} +@item{@racket['right] --- move right} +@item{@racket['left] --- move left} +@item{@racket['up] --- move up} +@item{@racket['down] --- move down} ] -If @scheme[extend?] is not @scheme[#f], the selection range is +If @racket[extend?] is not @racket[#f], the selection range is extended instead of moved. If anchoring is on (see @method[text% - get-anchor] and @method[text% set-anchor]), then @scheme[extend?] is - effectively forced to @scheme[#t]. See also @method[text% get-extend-start-position] + get-anchor] and @method[text% set-anchor]), then @racket[extend?] is + effectively forced to @racket[#t]. See also @method[text% get-extend-start-position] and @method[text% get-extend-end-position]. -The possible values for @scheme[kind] are: +The possible values for @racket[kind] are: @itemize[ -@item{@scheme['simple] --- move one item or line} -@item{@scheme['word] --- works with @scheme['right] or @scheme['left]} -@item{@scheme['page] --- works with @scheme['up] or @scheme['down]} -@item{@scheme['line] --- works with @scheme['right] or @scheme['left]; moves to the start or end of the line} +@item{@racket['simple] --- move one item or line} +@item{@racket['word] --- works with @racket['right] or @racket['left]} +@item{@racket['page] --- works with @racket['up] or @racket['down]} +@item{@racket['line] --- works with @racket['right] or @racket['left]; moves to the start or end of the line} ] See also @method[text% set-position]. @@ -1381,13 +1381,13 @@ Handles the following: shifted versions) --- moves the selection @techlink{position} with @method[text% move-position].} - @item{Any other character in the range @scheme[(integer->char 32)] to - @scheme[(integer->char 255)] --- inserts the character into the + @item{Any other character in the range @racket[(integer->char 32)] to + @racket[(integer->char 255)] --- inserts the character into the editor.} ] -Note that an editor's @scheme[editor-canvas%] normally handles mouse +Note that an editor's @racket[editor-canvas%] normally handles mouse wheel events (see also @method[editor-canvas% on-char] ). } @@ -1429,9 +1429,9 @@ Called before a range is deleted from the editor, after @method[text% @method[text% after-delete] method is guaranteed to be called after the delete has completed. -The @scheme[start] argument specifies the starting @techlink{position} - of the range to delete. The @scheme[len] argument specifies number of - @techlink{item}s to delete (so @math{@scheme[start]+@scheme[len]} is +The @racket[start] argument specifies the starting @techlink{position} + of the range to delete. The @racket[len] argument specifies number of + @techlink{item}s to delete (so @math{@racket[start]+@racket[len]} is the ending @techlink{position} of the range to delete). The editor is internally locked for writing during a call to this @@ -1460,8 +1460,8 @@ Called before @techlink{item}s are inserted into the editor, after ok. The @method[text% after-insert] method is guaranteed to be called after the insert has completed. -The @scheme[start] argument specifies the @techlink{position} of the insert. The - @scheme[len] argument specifies the total length (in @techlink{position}s) of the +The @racket[start] argument specifies the @techlink{position} of the insert. The + @racket[len] argument specifies the total length (in @techlink{position}s) of the @techlink{item}s to be inserted. The editor is internally locked for writing during a call to this @@ -1485,13 +1485,13 @@ Does nothing. Called by @method[text% insert] when a string or character is inserted into the editor, this method creates and returns a new instance of -@scheme[string-snip%] to store inserted text. The returned string snip +@racket[string-snip%] to store inserted text. The returned string snip is empty (i.e., its @techlink{count} is zero). } @methimpl{ -Returns a @scheme[string-snip%] instance. +Returns a @racket[string-snip%] instance. }} @@ -1500,14 +1500,14 @@ Returns a @scheme[string-snip%] instance. @methspec{ -Creates and returns a new instance of @scheme[tab-snip%] to store an +Creates and returns a new instance of @racket[tab-snip%] to store an inserted tab. The returned tab snip is empty (i.e., its @techlink{count} is zero). } @methimpl{ -Returns a @scheme[tab-snip%] instance. +Returns a @racket[tab-snip%] instance. }} @@ -1565,12 +1565,12 @@ Returns the ending line of a given paragraph. @|ParagraphNumbering| @|LineNumber Returns the ending @techlink{position} of a given paragraph. @|ParagraphNumbering| -If there are fewer than @math{@scheme[paragraph]-1} paragraphs, the - end of the last paragraph is returned. If @scheme[paragraph] is less +If there are fewer than @math{@racket[paragraph]-1} paragraphs, the + end of the last paragraph is returned. If @racket[paragraph] is less than 0, then the end of the first paragraph is returned. If the paragraph ends with invisible @techlink{item}s (such as a carriage - return) and @scheme[visible?] is not @scheme[#f], the first @techlink{position} + return) and @racket[visible?] is not @racket[#f], the first @techlink{position} before the invisible @techlink{item}s is returned. } @@ -1579,7 +1579,7 @@ If the paragraph ends with invisible @techlink{item}s (such as a carriage @defmethod[(paragraph-start-line [paragraph exact-nonnegative-integer?]) exact-nonnegative-integer?]{ -Returns the starting line of a given paragraph. If @scheme[paragraph] +Returns the starting line of a given paragraph. If @racket[paragraph] is greater than the highest-numbered paragraph, then the editor's end @tech{position} is returned. @|ParagraphNumbering| @|LineNumbering| @@ -1594,11 +1594,11 @@ is greater than the highest-numbered paragraph, then the editor's end Returns the starting @techlink{position} of a given paragraph. @|ParagraphNumbering| -If there are fewer than @math{@scheme[paragraph]-1} paragraphs, the +If there are fewer than @math{@racket[paragraph]-1} paragraphs, the start of the last paragraph is returned. -If the paragraph starts with invisible @techlink{item}s and @scheme[visible?] is - not @scheme[#f], the first @techlink{position} past the invisible @techlink{item}s is +If the paragraph starts with invisible @techlink{item}s and @racket[visible?] is + not @racket[#f], the first @techlink{position} past the invisible @techlink{item}s is returned. } @@ -1610,16 +1610,16 @@ If the paragraph starts with invisible @techlink{item}s and @scheme[visible?] is [end (or/c exact-nonnegative-integer? 'same) 'same]) void?]{ -Pastes into the specified range. If @scheme[start] is @scheme['start], +Pastes into the specified range. If @racket[start] is @racket['start], then the current selection start @techlink{position} is used. If - @scheme[start] is @scheme['end], then the current selection end - @techlink{position} is used. If @scheme[end] is @scheme['same], then - @scheme[start] is used for @scheme[end], unless @scheme[start] is - @scheme['start], in which case the current selection end + @racket[start] is @racket['end], then the current selection end + @techlink{position} is used. If @racket[end] is @racket['same], then + @racket[start] is used for @racket[end], unless @racket[start] is + @racket['start], in which case the current selection end @techlink{position} is used. -See @|timediscuss| for a discussion of the @scheme[time] argument. If - @scheme[time] is outside the platform-specific range of times, +See @|timediscuss| for a discussion of the @racket[time] argument. If + @racket[time] is outside the platform-specific range of times, @|MismatchExn|. } @@ -1652,16 +1652,16 @@ If the previous operation on the editor was not a paste, calling [end (or/c exact-nonnegative-integer? 'same) 'same]) void?]{ -Pastes into the specified range. If @scheme[start] is @scheme['start], +Pastes into the specified range. If @racket[start] is @racket['start], then the current selection start @techlink{position} is used. If - @scheme[start] is @scheme['end], then the current selection end - @techlink{position} is used. If @scheme[end] is @scheme['same], then - @scheme[start] is used for @scheme[end], unless @scheme[start] is - @scheme['start], in which case the current selection end + @racket[start] is @racket['end], then the current selection end + @techlink{position} is used. If @racket[end] is @racket['same], then + @racket[start] is used for @racket[end], unless @racket[start] is + @racket['start], in which case the current selection end @techlink{position} is used. -See @|timediscuss| for a discussion of the @scheme[time] argument. If - @scheme[time] is outside the platform-specific range of times, +See @|timediscuss| for a discussion of the @racket[time] argument. If + @racket[time] is outside the platform-specific range of times, @|MismatchExn|. } @@ -1674,7 +1674,7 @@ Returns the line number of the line containing a given @techlink{position}. @|Li @LineToPara[(scheme position-paragraph)] -See @|ateoldiscuss| for a discussion of @scheme[at-eol?]. +See @|ateoldiscuss| for a discussion of @racket[at-eol?]. @|FCAMW| @|EVD| @@ -1691,21 +1691,21 @@ See @|ateoldiscuss| for a discussion of @scheme[at-eol?]. Returns the @techlink{location} of a given @techlink{position}. See also @method[text% position-locations]. -@boxisfillnull[(scheme x) @elem{the x-@techlink{location} of the @techlink{position} @scheme[start] in editor +@boxisfillnull[(scheme x) @elem{the x-@techlink{location} of the @techlink{position} @racket[start] in editor coordinates} ] @boxisfillnull[(scheme y) @elem{the y-@techlink{location} (top or bottom; see below) of the -@techlink{position} @scheme[start] in editor coordinates}] +@techlink{position} @racket[start] in editor coordinates}] -See @|ateoldiscuss| for a discussion of @scheme[at-eol?]. +See @|ateoldiscuss| for a discussion of @racket[at-eol?]. -If @scheme[top?] is not @scheme[#f], the top coordinate of the @techlink{location} +If @racket[top?] is not @racket[#f], the top coordinate of the @techlink{location} is returned, otherwise the bottom coordinate of the @techlink{location} is returned. -The top @scheme[y] @techlink{location} may be different for different @techlink{position}s +The top @racket[y] @techlink{location} may be different for different @techlink{position}s within a line when different-sized graphic objects are used. If -@scheme[whole-line?] is not @scheme[#f], the minimum top @techlink{location} or -maximum bottom @techlink{location} for the whole line is returned in @scheme[y]. +@racket[whole-line?] is not @racket[#f], the minimum top @techlink{location} or +maximum bottom @techlink{location} for the whole line is returned in @racket[y]. @|OVD| @|FCA| @@ -1732,7 +1732,7 @@ and ``bottom'' results at once. [at-eol? any/c #f]) exact-nonnegative-integer?]{ -See @|ateoldiscuss| for a discussion of @scheme[at-eol?]. +See @|ateoldiscuss| for a discussion of @racket[at-eol?]. Returns the paragraph number of the paragraph containing a given @techlink{position}. @@ -1745,8 +1745,8 @@ Returns the paragraph number of the paragraph containing a given @techlink{posit [overwrite-styles? any/c #f]) boolean?]{ -New data is inserted at the @techlink{position} indicated by @scheme[start], or at - the current @techlink{position} if @scheme[start] is @scheme['start]. +New data is inserted at the @techlink{position} indicated by @racket[start], or at + the current @techlink{position} if @racket[start] is @racket['start]. } @@ -1755,8 +1755,8 @@ New data is inserted at the @techlink{position} indicated by @scheme[start], or [end exact-nonnegative-integer?]) void?]{ -Removes all clickbacks installed for exactly the range @scheme[start] - to @scheme[end]. See also @|clickbackdiscuss|. +Removes all clickbacks installed for exactly the range @racket[start] + to @racket[end]. See also @|clickbackdiscuss|. } @@ -1769,22 +1769,22 @@ Removes all clickbacks installed for exactly the range @scheme[start] Scrolls the editor so that a given @techlink{position} is visible. -If @scheme[end] is @scheme['same] or equal to @scheme[start], then @techlink{position} - @scheme[start] is made visible. See @|ateoldiscuss| for a discussion of - @scheme[at-eol?]. +If @racket[end] is @racket['same] or equal to @racket[start], then @techlink{position} + @racket[start] is made visible. See @|ateoldiscuss| for a discussion of + @racket[at-eol?]. -If @scheme[end] is not @scheme['same] and not the same as @scheme[start], - then the range @scheme[start] to @scheme[end] is made visible and - @scheme[at-eol?] is ignored. +If @racket[end] is not @racket['same] and not the same as @racket[start], + then the range @racket[start] to @racket[end] is made visible and + @racket[at-eol?] is ignored. -When the specified range cannot fit in the visible area, @scheme[bias] - indicates which end of the range to display. When @scheme[bias] is - @scheme['start], then the start of the range is displayed. When - @scheme[bias] is @scheme['end], then the end of the range is - displayed. Otherwise, @scheme[bias] must be @scheme['none]. +When the specified range cannot fit in the visible area, @racket[bias] + indicates which end of the range to display. When @racket[bias] is + @racket['start], then the start of the range is displayed. When + @racket[bias] is @racket['end], then the end of the range is + displayed. Otherwise, @racket[bias] must be @racket['none]. If the editor is scrolled, then the editor is redrawn and the return - value is @scheme[#t]; otherwise, the return value is @scheme[#f]. If + value is @racket[#t]; otherwise, the return value is @racket[#f]. If refreshing is delayed (see @method[editor<%> refresh-delayed?]), then the scroll request is saved until the delay has ended. The scroll is performed (immediately or later) by calling @method[editor<%> @@ -1807,7 +1807,7 @@ Turns anchoring on or off. This method can be overridden to affect or detect changes in the anchor state. See also @method[text% get-anchor]. -If @scheme[on?] is not @scheme[#f], then the selection will be +If @racket[on?] is not @racket[#f], then the selection will be automatically extended when cursor keys are used (or, more generally, when @method[text% move-position] is used to move the selection or the @racket[_keep-anchor?] argument to @method[text% set-position] is a true value), @@ -1823,9 +1823,9 @@ If @scheme[on?] is not @scheme[#f], then the selection will be Sets the bitmap that is drawn at the end of a line when it is automatically line-wrapped. -If @scheme[bitmap] is @scheme[#f], no autowrap indicator is drawn +If @racket[bitmap] is @racket[#f], no autowrap indicator is drawn (this is the default). The previously used bitmap (possibly - @scheme[#f]) is returned. + @racket[#f]) is returned. Setting the bitmap is disallowed when the editor is internally locked for reflowing (see also @|lockdiscuss|). @@ -1837,7 +1837,7 @@ Setting the bitmap is disallowed when the editor is internally locked void?]{ Sets the graphical distance used to determine the meaning of a user - click. If a click falls within @scheme[threshold] of a position + click. If a click falls within @racket[threshold] of a position between two @techlink{item}s, then the click registers on the space between the @techlink{item}s rather than on either @techlink{item}. @@ -1860,18 +1860,18 @@ See also Installs a clickback for a given region. If a clickback is already installed for an overlapping region, this clickback takes precedence. -The callback procedure @scheme[f] is called when the user selects the - clickback. The arguments to @scheme[f] are this editor and the starting +The callback procedure @racket[f] is called when the user selects the + clickback. The arguments to @racket[f] are this editor and the starting and ending range of the clickback. -The @scheme[hilite-delta] style delta is applied to the clickback text +The @racket[hilite-delta] style delta is applied to the clickback text when the user has clicked and is still holding the mouse over the - clickback. If @scheme[hilite-delta] is @scheme[#f], then the clickback + clickback. If @racket[hilite-delta] is @racket[#f], then the clickback region's style is not changed when it is being selected. -If @scheme[call-on-down?] is not @scheme[#f], the clickback is called +If @racket[call-on-down?] is not @racket[#f], the clickback is called immediately when the user clicks the mouse button down, instead of - after a mouse-up event. The @scheme[hilite-delta] argument is not used + after a mouse-up event. The @racket[hilite-delta] argument is not used in this case. See also @|clickbackdiscuss|. @@ -1885,9 +1885,9 @@ Set the format of the file saved from this editor. The legal formats are: @itemize[ -@item{@scheme['standard] --- a standard editor file} -@item{@scheme['text] --- a text file} -@item{@scheme['text-force-cr] --- a text file; when writing, change automatic newlines (from word-wrapping) into real carriage returns} +@item{@racket['standard] --- a standard editor file} +@item{@racket['text] --- a text file} +@item{@racket['text-force-cr] --- a text file; when writing, change automatic newlines (from word-wrapping) into real carriage returns} ] @MonitorMethod[@elem{The file format of an editor} @elem{the @@ -1958,11 +1958,11 @@ Sets a paragraph-specific horizontal alignment. The alignment is only Sets a paragraph-specific margin. @|ParagraphNumbering| -The first line of the paragraph is indented by @scheme[first-left] points +The first line of the paragraph is indented by @racket[first-left] points within the editor. If the paragraph is line-wrapped (when the editor - has a maximum width), subsequent lines are indented by @scheme[left] + has a maximum width), subsequent lines are indented by @racket[left] points. If the editor has a maximum width, the paragraph's maximum - width for line-wrapping is @scheme[right] points smaller than the + width for line-wrapping is @racket[right] points smaller than the editor's maximum width. @italic{This method is experimental.} See @method[text% @@ -1980,25 +1980,25 @@ The first line of the paragraph is indented by @scheme[first-left] points Sets the current selection in the editor. -If @scheme[end] is @scheme['same] or less than or equal to @scheme[start], +If @racket[end] is @racket['same] or less than or equal to @racket[start], the current start and end @techlink{position}s are both set to - @scheme[start]. Otherwise the given range is selected. + @racket[start]. Otherwise the given range is selected. -See @|ateoldiscuss| for a discussion of @scheme[at-eol?]. If - @scheme[scroll?] is not @scheme[#f], then the @techlink{display} is +See @|ateoldiscuss| for a discussion of @racket[at-eol?]. If + @racket[scroll?] is not @racket[#f], then the @techlink{display} is scrolled to show the selection if necessary. -The @scheme[seltype] argument is only used when the X Window System +The @racket[seltype] argument is only used when the X Window System selection mechanism is enabled. The possible values are: @itemize[ - @item{@scheme['default] --- if this window has the keyboard focus + @item{@racket['default] --- if this window has the keyboard focus and given selection is non-empty, make it the current X selection} - @item{@scheme['x] --- if the given selection is non-empty, make + @item{@racket['x] --- if the given selection is non-empty, make it the current X selection} - @item{@scheme['local] --- do not change the + @item{@racket['local] --- do not change the current X selection} ] @@ -2009,7 +2009,7 @@ Setting the @techlink{position} is disallowed when the editor is internally The system may change the selection in an editor without calling this method (or any visible method). -See also @scheme[editor-set-x-selection-mode]. +See also @racket[editor-set-x-selection-mode]. } @@ -2023,13 +2023,13 @@ See also @scheme[editor-set-x-selection-mode]. Like @method[text% set-position], but a scrolling bias can be specified. -The possible values for @scheme[bias] are: +The possible values for @racket[bias] are: @itemize[ -@item{@scheme['start-only] --- only insure that the starting @techlink{position} is visible} -@item{@scheme['start] --- if the range doesn't fit in the visible area, show the starting @techlink{position}} -@item{@scheme['none] --- no special scrolling instructions} -@item{@scheme['end] --- if the range doesn't fit in the visible area, show the ending @techlink{position}} -@item{@scheme['end-only] --- only insure that the ending @techlink{position} is visible} +@item{@racket['start-only] --- only insure that the starting @techlink{position} is visible} +@item{@racket['start] --- if the range doesn't fit in the visible area, show the starting @techlink{position}} +@item{@racket['none] --- no special scrolling instructions} +@item{@racket['end] --- if the range doesn't fit in the visible area, show the ending @techlink{position}} +@item{@racket['end-only] --- only insure that the ending @techlink{position} is visible} ] See also @method[text% scroll-to-position]. @@ -2075,10 +2075,10 @@ See @method[text% get-styles-sticky] for information about sticky Sets the tabbing array for the editor. -The @scheme[tabs] list determines the tabbing array. The tabbing array +The @racket[tabs] list determines the tabbing array. The tabbing array specifies the x-@techlink{location}s where each tab occurs. Tabs beyond the last - specified tab are separated by a fixed amount @scheme[tab-width]. If - @scheme[in-units?] is not @scheme[#f], then tabs are specified in canvas + specified tab are separated by a fixed amount @racket[tab-width]. If + @racket[in-units?] is not @racket[#f], then tabs are specified in canvas units; otherwise, they are specified as a number of spaces. (If tabs are specified in spaces, then the graphic tab positions will change with the font used for the tab.) @@ -2100,13 +2100,13 @@ Sets the word-breaking function for the editor. For information about find-wordbreak]. The standard wordbreaking function uses the editor's - @scheme[editor-wordbreak-map%] object to determine which characters - break a word. See also @scheme[editor-wordbreak-map%] and + @racket[editor-wordbreak-map%] object to determine which characters + break a word. See also @racket[editor-wordbreak-map%] and @method[text% set-wordbreak-map]. Since the wordbreak function will be called when line breaks are being determined (in an editor that has a maximum width), there is a - constrained set of @scheme[text%] methods that the wordbreak + constrained set of @racket[text%] methods that the wordbreak function is allowed to invoke. It cannot invoke a member function that uses information about @techlink{location}s or lines (which are identified in this manual with ``@|OVD|''), but it can still invoke @@ -2119,10 +2119,10 @@ Since the wordbreak function will be called when line breaks are being void?]{ Sets the wordbreaking map that is used by the standard wordbreaking - function. See @scheme[editor-wordbreak-map%] for more information. + function. See @racket[editor-wordbreak-map%] for more information. -If @scheme[map] is @scheme[#f], then the standard map - (@scheme[the-editor-wordbreak-map]) is used. +If @racket[map] is @racket[#f], then the standard map + (@racket[the-editor-wordbreak-map]) is used. } @@ -2147,9 +2147,9 @@ Splitting a snip is disallowed when the editor is internally locked [end (or/c exact-nonnegative-integer? 'eof) 'eof]) boolean?]{ -If @scheme[start] is 0 and @scheme[end] is @scheme['eof] negative, - then the entire contents are written to the stream. If @scheme[end] - is @scheme['eof], then the contents are written from @scheme[start] +If @racket[start] is 0 and @racket[end] is @racket['eof] negative, + then the entire contents are written to the stream. If @racket[end] + is @racket['eof], then the contents are written from @racket[start] until the end of the editor. Otherwise, the contents of the given range are written. diff --git a/collects/scribblings/gui/text-field-class.scrbl b/collects/scribblings/gui/text-field-class.scrbl index 397f0fce7d..128b8ceae8 100644 --- a/collects/scribblings/gui/text-field-class.scrbl +++ b/collects/scribblings/gui/text-field-class.scrbl @@ -3,7 +3,7 @@ @defclass/title[text-field% object% (control<%>)]{ -A @scheme[text-field%] object is an editable text field with an +A @racket[text-field%] object is an editable text field with an optional label displayed in front of it. There are two text field styles: @@ -23,8 +23,8 @@ Whenever the user changes the content of a text field, its callback procedure is invoked. A callback procedure is provided as an initialization argument when each text field is created. -The text field is implemented using a @scheme[text%] editor (with an - inaccessible display). Thus, whereas @scheme[text-field%] provides +The text field is implemented using a @racket[text%] editor (with an + inaccessible display). Thus, whereas @racket[text-field%] provides only @method[text-field% get-value] and @method[text-field% set-value] to manipulate the text in a text field, the @method[text-field% get-editor] returns the field's editor, which @@ -33,7 +33,7 @@ The text field is implemented using a @scheme[text%] editor (with an The keymap for the text field's editor is initialized by calling the current keymap initializer procedure, which is determined by the - @scheme[current-text-keymap-initializer] parameter. + @racket[current-text-keymap-initializer] parameter. @defconstructor[([label (or/c label-string? false/c)] @@ -56,40 +56,40 @@ The keymap for the text field's editor is initialized by calling the [stretchable-width any/c #t] [stretchable-height any/c (memq 'multiple style)])]{ -If @scheme[label] is not @scheme[#f], it is used as the text field +If @racket[label] is not @racket[#f], it is used as the text field label. Otherwise, the text field does not display its label. @labelstripped[(scheme label) @elem{} @elem{move the keyboard focus to the text field}] -The @scheme[callback] procedure is called when the user changes the +The @racket[callback] procedure is called when the user changes the text in the text field or presses the Enter key (and Enter is not handled by the text field's frame or dialog; see @xmethod[top-level-window<%> on-traverse-char]). If the user presses Enter, the type of event passed to the callback is - @indexed-scheme['text-field-enter], otherwise it is - @indexed-scheme['text-field]. + @indexed-racket['text-field-enter], otherwise it is + @indexed-racket['text-field]. -If @scheme[init-value] is not @scheme[""], the minimum width of the - text item is made wide enough to show @scheme[init-value]. Otherwise, +If @racket[init-value] is not @racket[""], the minimum width of the + text item is made wide enough to show @racket[init-value]. Otherwise, a built-in default width is selected. For a text field in single-line mode, the minimum height is set to show one line and only the control's width is stretchable. For a multiple-line text field, the minimum height shows three lines of text and is stretchable in both directions. -The style must contain exactly one of @scheme['single] or - @scheme['multiple]; the former specifies a single-line field and the - latter specifies a multiple-line field. The @scheme['hscroll] style - applies only to multiple-line fields; when @scheme['hscroll] is +The style must contain exactly one of @racket['single] or + @racket['multiple]; the former specifies a single-line field and the + latter specifies a multiple-line field. The @racket['hscroll] style + applies only to multiple-line fields; when @racket['hscroll] is specified, the field has a horizontal scrollbar and autowrapping is disabled; otherwise, the field has no horizontal scrollbar and autowrapping is enabled. A multiple-line text field always has a - vertical scrollbar. The @scheme['password] style indicates that the + vertical scrollbar. The @racket['password] style indicates that the field should draw each character of its content using a generic - symbol instead of the actual character. @HVLabelNote[@scheme[style]]{text field} - @DeletedStyleNote[@scheme[style] @scheme[parent]]{text field}. + symbol instead of the actual character. @HVLabelNote[@racket[style]]{text field} + @DeletedStyleNote[@racket[style] @racket[parent]]{text field}. -@FontKWs[@scheme[font]] @WindowKWs[@scheme[enabled]] @SubareaKWs[] @AreaKWs[] +@FontKWs[@racket[font]] @WindowKWs[@racket[enabled]] @SubareaKWs[] @AreaKWs[] } @@ -99,18 +99,18 @@ The style must contain exactly one of @scheme['single] or Returns the editor used to implement the text field. -For a text field, the most useful methods of a @scheme[text%] object +For a text field, the most useful methods of a @racket[text%] object are the following: @itemize[ - @item{@scheme[(send a-text @#,method[text% get-text])] returns + @item{@racket[(send a-text @#,method[text% get-text])] returns the current text of the editor.} - @item{@scheme[(send a-text @#,method[text% erase])] deletes all text from + @item{@racket[(send a-text @#,method[text% erase])] deletes all text from the editor.} - @item{@scheme[(send a-text @#,method[text% insert] _str)] inserts - @scheme[_str] into the editor at the current caret position.} + @item{@racket[(send a-text @#,method[text% insert] _str)] inserts + @racket[_str] into the editor at the current caret position.} ] } diff --git a/collects/scribblings/gui/timer-class.scrbl b/collects/scribblings/gui/timer-class.scrbl index 154daef533..cf8428b980 100644 --- a/collects/scribblings/gui/timer-class.scrbl +++ b/collects/scribblings/gui/timer-class.scrbl @@ -3,18 +3,18 @@ @defclass/title[timer% object% ()]{ -A @scheme[timer%] object encapsulates an event-based alarm. To use a - timer, either instantiate it with a @scheme[timer-callback] thunk to +A @racket[timer%] object encapsulates an event-based alarm. To use a + timer, either instantiate it with a @racket[timer-callback] thunk to perform the alarm-based action, to derive a new class and override the @method[timer% notify] method to perform the alarm-based action. Start a timer with @method[timer% start] and stop it with - @method[timer% stop]. Supplying an initial @scheme[interval] (in + @method[timer% stop]. Supplying an initial @racket[interval] (in milliseconds) when creating a timer also starts the timer. Timers have a relatively high priority in the event queue. Thus, if the timer delay is set low enough, repeated notification for a timer can preempt user activities (which might be directed at stopping the - timer). For timers with relatively short delays, call @scheme[yield] + timer). For timers with relatively short delays, call @racket[yield] within the @method[timer% notify] procedure to allow guaranteed event processing. @@ -26,14 +26,14 @@ See @secref["eventspaceinfo"] for more information about event [interval (or/c (integer-in 0 1000000000) false/c) #f] [just-once? any/c #f])]{ -The @scheme[notify-callback] thunk is called by the default +The @racket[notify-callback] thunk is called by the default @method[timer% notify] method when the timer expires. -If @scheme[interval] is @scheme[#f] (the default), the timer is not +If @racket[interval] is @racket[#f] (the default), the timer is not started; in that case, @method[timer% start] must be called - explicitly. If @scheme[interval] is a number (in milliseconds), then - @method[timer% start] is called with @scheme[interval] and - @scheme[just-once?]. + explicitly. If @racket[interval] is a number (in milliseconds), then + @method[timer% start] is called with @racket[interval] and + @racket[just-once?]. } @@ -56,7 +56,7 @@ Called (on an event boundary) when the timer's alarm expires. } @methimpl{ -Calls the @scheme[notify-callback] procedure that was provided when the +Calls the @racket[notify-callback] procedure that was provided when the object was created. }} @@ -68,11 +68,11 @@ Calls the @scheme[notify-callback] procedure that was provided when the Starts (or restarts) the timer. If the timer is already running, its alarm time is not changed. -The timer's alarm expires after @scheme[msec] milliseconds, at which +The timer's alarm expires after @racket[msec] milliseconds, at which point @method[timer% notify] is called (on an event boundary). If -@scheme[just-once?] is @scheme[#f], the timer expires @italic{every} -@scheme[msec] milliseconds until the timer is explicitly -stopped. (More precisely, the timer expires @scheme[msec] +@racket[just-once?] is @racket[#f], the timer expires @italic{every} +@racket[msec] milliseconds until the timer is explicitly +stopped. (More precisely, the timer expires @racket[msec] milliseconds after @method[timer% notify] returns each time.) Otherwise, the timer expires only once. diff --git a/collects/scribblings/gui/top-level-window-intf.scrbl b/collects/scribblings/gui/top-level-window-intf.scrbl index 881c8f3c56..8825ced005 100644 --- a/collects/scribblings/gui/top-level-window-intf.scrbl +++ b/collects/scribblings/gui/top-level-window-intf.scrbl @@ -3,7 +3,7 @@ @definterface/title[top-level-window<%> (area-container-window<%>)]{ -A top-level window is either a @scheme[frame%] or @scheme[dialog%] +A top-level window is either a @racket[frame%] or @racket[dialog%] object. @defmethod[#:mode pubment @@ -11,10 +11,10 @@ A top-level window is either a @scheme[frame%] or @scheme[dialog%] boolean?]{ Called just before the window might be closed (e.g., by the window - manager). If @scheme[#f] is returned, the window is not closed, + manager). If @racket[#f] is returned, the window is not closed, otherwise @method[top-level-window<%> on-close] is called and the window is closed (i.e., the window is hidden, like calling - @method[window<%> show] with @scheme[#f]). + @method[window<%> show] with @racket[#f]). This method is @italic{not} called by @method[window<%> show]. } @@ -40,10 +40,10 @@ Calls @method[top-level-window<%> can-close?] and returns the result. Centers the window on the screen if it has no parent. If it has a parent, the window is centered with respect to its parent's location. -If @scheme[direction] is @scheme['horizontal], the window is centered - horizontally. If @scheme[direction] is @scheme['vertical], the - window is centered vertically. If @scheme[direction] is - @scheme['both], the window is centered in both directions. +If @racket[direction] is @racket['horizontal], the window is centered + horizontally. If @racket[direction] is @racket['vertical], the + window is centered vertically. If @racket[direction] is + @racket['both], the window is centered in both directions. } @@ -67,7 +67,7 @@ See also @method[top-level-window<%> get-focus-object]. most recently had the keyboard focus, either the top-level window or one of its currently-shown children. If neither the window nor any of its currently-shown children has even owned the keyboard focus, -@scheme[#f] is returned. +@racket[#f] is returned. See also @method[top-level-window<%> get-focus-window] and @method[top-level-window<%> get-edit-target-object]. @@ -98,7 +98,7 @@ See also @method[top-level-window<%> get-edit-target-object]. @index["keyboard focus"]{Returns} the window that has the keyboard focus, either the top-level window or one of its children. If neither - the window nor any of its children has the focus, @scheme[#f] is + the window nor any of its children has the focus, @racket[#f] is returned. See also @method[top-level-window<%> get-edit-target-window] and @@ -130,8 +130,8 @@ Called when a window is @defterm{activated} or words, floating frames act as an extension of the active non-frame for keyboard focus. -The method's argument is @scheme[#t] when the window is activated, - @scheme[#f] when it is deactivated. +The method's argument is @racket[#t] when the window is activated, + @racket[#f] when it is deactivated. } @@ -153,7 +153,7 @@ See also @methspec{ Called by the default application quit handler (as determined by the - @scheme[application-quit-handler] parameter) when the operating + @racket[application-quit-handler] parameter) when the operating system requests that the application shut down (e.g., when the @onscreen{Quit} menu item is selected in the main application menu on Mac OS X). In that case, this method is called for the most @@ -177,10 +177,10 @@ Calls @methspec{ @index["drag-and-drop"]{A} generic message method, usually called by -@scheme[send-message-to-window]. +@racket[send-message-to-window]. -If the method is invoked by @scheme[send-message-to-window], then it -is invoked in the thread where @scheme[send-message-to-window] was +If the method is invoked by @racket[send-message-to-window], then it +is invoked in the thread where @racket[send-message-to-window] was called (which is possibly @italic{not} the handler thread of the window's eventspace). @@ -199,94 +199,94 @@ Returns @|void-const|. @index['("keyboard focus" "navigation")]{Attempts} to handle the given keyboard event as a navigation event, such as a Tab key event that - moves the keyboard focus. If the event is handled, @scheme[#t] is - returned, otherwise @scheme[#f] is returned. + moves the keyboard focus. If the event is handled, @racket[#t] is + returned, otherwise @racket[#f] is returned. } @methimpl{ -The following rules determine, in order, whether and how @scheme[event] +The following rules determine, in order, whether and how @racket[event] is handled: @itemize[ @item{ If the window that currently owns the focus specifically handles the - event, then @scheme[#f] is returned. The following describes window + event, then @racket[#f] is returned. The following describes window types and the keyboard events they specifically handle: @itemize[ - @item{@scheme[editor-canvas%] --- tab-exit is disabled (see + @item{@racket[editor-canvas%] --- tab-exit is disabled (see @method[editor-canvas% allow-tab-exit]): all keyboard events, except alphanumeric key events when the Meta (Unix) or Alt (Windows) key is pressed; when tab-exit is enabled: all keyboard events except Tab, Enter, Escape, and alphanumeric Meta/Alt events.} - @item{@scheme[canvas%] --- when tab-focus is disabled (see + @item{@racket[canvas%] --- when tab-focus is disabled (see @method[canvas<%> accept-tab-focus]): all keyboard events, except alphanumeric key events when the Meta (Unix) or Alt (Windows) key is pressed; when tab-focus is enabled: no key events} - @item{@scheme[text-field%], @scheme['single] style --- arrow key + @item{@racket[text-field%], @racket['single] style --- arrow key events and alphanumeric key events when the Meta (Unix) or Alt (Windows) key is not pressed (and all alphanumeric events on Mac OS X)} - @item{@scheme[text-field%], @scheme['multiple] style --- all + @item{@racket[text-field%], @racket['multiple] style --- all keyboard events, except alphanumeric key events when the Meta (Unix) or Alt (Windows) key is pressed} - @item{@scheme[choice%] --- arrow key events and alphanumeric key + @item{@racket[choice%] --- arrow key events and alphanumeric key events when the Meta (Unix) or Alt (Windows) key is not pressed} - @item{@scheme[list-box%] --- arrow key events and alphanumeric key + @item{@racket[list-box%] --- arrow key events and alphanumeric key events when the Meta (Unix) or Alt (Windows) key is not pressed} ]} @item{ -If @scheme[event] is a Tab or arrow key event, the keyboard focus is - moved within the window and @scheme[#t] is returned. Across platforms, +If @racket[event] is a Tab or arrow key event, the keyboard focus is + moved within the window and @racket[#t] is returned. Across platforms, the types of windows that accept the keyboard focus via navigation - may vary, but @scheme[text-field%] windows always accept the focus, - and @scheme[message%], @scheme[gauge%], and @scheme[panel%] + may vary, but @racket[text-field%] windows always accept the focus, + and @racket[message%], @racket[gauge%], and @racket[panel%] windows never accept the focus.} @item{ -If @scheme[event] is a Space key event and the window that currently - owns the focus is a @scheme[button%], @scheme[check-box%], or - @scheme[radio-box%] object, the event is handled in the same way as - a click on the control and @scheme[#t] is returned.} +If @racket[event] is a Space key event and the window that currently + owns the focus is a @racket[button%], @racket[check-box%], or + @racket[radio-box%] object, the event is handled in the same way as + a click on the control and @racket[#t] is returned.} @item{ -If @scheme[event] is an Enter key event and the current top-level window +If @racket[event] is an Enter key event and the current top-level window contains a border button, the button's callback is invoked and - @scheme[#t] is returned. (The @scheme['border] style for a - @scheme[button%] object indicates to the user that pressing Enter + @racket[#t] is returned. (The @racket['border] style for a + @racket[button%] object indicates to the user that pressing Enter is the same as clicking the button.) If the window does not contain a - border button, @scheme[#t] is returned if the window with the current + border button, @racket[#t] is returned if the window with the current focus is not a text field or editor canvas.} @item{ -In a dialog, if @scheme[event] is an Escape key event, the event is +In a dialog, if @racket[event] is an Escape key event, the event is handled the same as a click on the dialog's close box (i.e., the dialog's @method[top-level-window<%> can-close?] and -@method[top-level-window<%> on-close] methods are called, and the dialog is hidden) and @scheme[#t] is +@method[top-level-window<%> on-close] methods are called, and the dialog is hidden) and @racket[#t] is returned.} @item{ -If @scheme[event] is an alphanumeric key event and the current top-level +If @racket[event] is an alphanumeric key event and the current top-level window contains a control with a mnemonic matching the key (which is installed via a label that contains @litchar{&}; see @method[window<%> get-label] for more information), then the keyboard focus is moved to the matching control. Furthermore, if the - matching control is a @scheme[button%], @scheme[check-box%], or - @scheme[radio-box%] button, the keyboard event is handled in the + matching control is a @racket[button%], @racket[check-box%], or + @racket[radio-box%] button, the keyboard event is handled in the same way as a click on the control.} @item{ -Otherwise, @scheme[#f] is returned.} +Otherwise, @racket[#f] is returned.} ] }} @@ -296,7 +296,7 @@ Otherwise, @scheme[#f] is returned.} Checks whether the given event pops open the system menu in the top-left corner of the window (Windows only). If the window's system - menu is opened, @scheme[#t] is returned, otherwise @scheme[#f] is + menu is opened, @racket[#t] is returned, otherwise @racket[#f] is returned. } diff --git a/collects/scribblings/gui/vertical-pane-class.scrbl b/collects/scribblings/gui/vertical-pane-class.scrbl index 54ccb1e62e..b91a535041 100644 --- a/collects/scribblings/gui/vertical-pane-class.scrbl +++ b/collects/scribblings/gui/vertical-pane-class.scrbl @@ -3,7 +3,7 @@ @defclass/title[vertical-pane% pane% ()]{ -A vertical pane arranges its subwindows in a single column. See also @scheme[pane%]. +A vertical pane arranges its subwindows in a single column. See also @racket[pane%]. diff --git a/collects/scribblings/gui/vertical-panel-class.scrbl b/collects/scribblings/gui/vertical-panel-class.scrbl index 714ccff789..ab0a2d3e2d 100644 --- a/collects/scribblings/gui/vertical-panel-class.scrbl +++ b/collects/scribblings/gui/vertical-panel-class.scrbl @@ -4,7 +4,7 @@ @defclass/title[vertical-panel% panel% ()]{ A vertical panel arranges its subwindows in a single column. See - also @scheme[panel%]. + also @racket[panel%]. @@ -29,17 +29,17 @@ A vertical panel arranges its subwindows in a single column. See The @racket[style] flags are the same as for @racket[panel%]. -@WindowKWs[@scheme[enabled]] @SubareaKWs[] @AreaContKWs[] @AreaKWs[] +@WindowKWs[@racket[enabled]] @SubareaKWs[] @AreaContKWs[] @AreaKWs[] } @defmethod[(set-orientation [horizontal? boolean?]) void?]{ Sets the orientation of the panel, switching it between - the behavior of the @scheme[vertical-panel%] and that of - the @scheme[horizontal-panel%]. + the behavior of the @racket[vertical-panel%] and that of + the @racket[horizontal-panel%]. } @defmethod[(get-orientation) boolean?]{ - Initially returns @scheme[#f], but if + Initially returns @racket[#f], but if @method[vertical-panel% set-orientation] is called, this method returns whatever the last value passed to it was. } diff --git a/collects/scribblings/gui/win-overview.scrbl b/collects/scribblings/gui/win-overview.scrbl index 52a74edb37..edcaf4e6bc 100644 --- a/collects/scribblings/gui/win-overview.scrbl +++ b/collects/scribblings/gui/win-overview.scrbl @@ -14,11 +14,11 @@ interfaces in Racket.} @section{Creating Windows} -To create a new top-level window, instantiate the @scheme[frame%] +To create a new top-level window, instantiate the @racket[frame%] class: -@schemeblock[ -(code:comment @#,t{Make a frame by instantiating the @scheme[frame%] class}) +@racketblock[ +(code:comment @#,t{Make a frame by instantiating the @racket[frame%] class}) (define frame (new frame% [label "Example"])) (code:comment @#,t{Show the frame by calling its @method[top-level-window<%> show] method}) @@ -26,14 +26,14 @@ To create a new top-level window, instantiate the @scheme[frame%] ] The built-in classes provide various mechanisms for handling GUI - events. For example, when instantiating the @scheme[button%] class, + events. For example, when instantiating the @racket[button%] class, supply an event callback procedure to be invoked when the user clicks the button. The following example program creates a frame with a text message and a button; when the user clicks the button, the message changes: -@schemeblock[ -(code:comment @#,t{Make a frame by instantiating the @scheme[frame%] class}) +@racketblock[ +(code:comment @#,t{Make a frame by instantiating the @racket[frame%] class}) (define frame (new frame% [label "Example"])) (code:comment @#,t{Make a static text message in the frame}) @@ -47,7 +47,7 @@ The built-in classes provide various mechanisms for handling GUI (callback (lambda (button event) (send msg #,(method message% set-label) "Button click")))) -(code:comment @#,t{Show the frame by calling its @scheme[show] method}) +(code:comment @#,t{Show the frame by calling its @racket[show] method}) (send frame #,(:: top-level-window<%> show) #t) ] @@ -64,14 +64,14 @@ If a window receives multiple kinds of events, the events are procedure. For example, a drawing canvas receives update events, mouse events, keyboard events, and sizing events; to handle them, derive a new class from the built-in - @scheme[canvas%] class and override the event-handling methods. The + @racket[canvas%] class and override the event-handling methods. The following expression extends the frame created above with a canvas that handles mouse and keyboard events: -@schemeblock[ +@racketblock[ (code:comment @#,t{Derive a new canvas (a drawing window) class to handle events}) (define my-canvas% - (class canvas% (code:comment @#,t{The base class is @scheme[canvas%]}) + (class canvas% (code:comment @#,t{The base class is @racket[canvas%]}) (code:comment @#,t{Define overriding method to handle mouse events}) (define/override (#,(:: canvas<%> on-event) event) (send msg #,(:: message% set-label) "Canvas mouse")) @@ -98,7 +98,7 @@ The windowing system dispatches GUI events sequentially; that is, after invoking sequential nature of events, extend the frame again, adding a @onscreen{Pause} button: -@schemeblock[ +@racketblock[ (new button% [parent frame] [label "Pause"] [callback (lambda (button event) (sleep 5))]) @@ -106,7 +106,7 @@ The windowing system dispatches GUI events sequentially; that is, after invoking After the user clicks @onscreen{Pause}, the entire frame becomes unresponsive for five seconds; the windowing system cannot dispatch more events - until the call to @scheme[sleep] returns. For more information about + until the call to @racket[sleep] returns. For more information about event dispatching, see @secref["eventspaceinfo"]. In addition to dispatching events, the GUI classes also handle the @@ -119,7 +119,7 @@ In addition to dispatching events, the GUI classes also handle the of another container; for example, to place two buttons side-by-side in our frame, create a horizontal panel for the new buttons: -@schemeblock[ +@racketblock[ (define panel (new horizontal-panel% [parent frame])) (new button% [parent panel] [label "Left"] @@ -151,7 +151,7 @@ reflected in the content of the canvas onscreen. For example, the following program creates a canvas that displays large, friendly letters: -@schemeblock[ +@racketblock[ (define frame (new frame% [label "Example"] [width 300] @@ -190,23 +190,23 @@ The fundamental graphical element in the windowing toolbox is an @itemize[ - @item{@scheme[frame%] --- a @deftech{frame} is a top-level window + @item{@racket[frame%] --- a @deftech{frame} is a top-level window that the user can move and resize.} - @item{@scheme[dialog%] --- a @deftech{dialog} is a modal top-level + @item{@racket[dialog%] --- a @deftech{dialog} is a modal top-level window; when a dialog is shown, other top-level windows are disabled until the dialog is dismissed.} - @item{@scheme[panel%] --- a @deftech{panel} is a subcontainer + @item{@racket[panel%] --- a @deftech{panel} is a subcontainer within a container. The toolbox provides three subclasses of - @scheme[panel%]: @scheme[vertical-panel%], - @scheme[horizontal-panel%], and @scheme[tab-panel%].} + @racket[panel%]: @racket[vertical-panel%], + @racket[horizontal-panel%], and @racket[tab-panel%].} - @item{@scheme[pane%] --- a @deftech{pane} is a lightweight panel. + @item{@racket[pane%] --- a @deftech{pane} is a lightweight panel. It has no graphical representation or event-handling capabilities. - The @scheme[pane%] class has three subclasses: - @scheme[vertical-pane%], @scheme[horizontal-pane%], and - @scheme[grow-box-spacer-pane%].} + The @racket[pane%] class has three subclasses: + @racket[vertical-pane%], @racket[horizontal-pane%], and + @racket[grow-box-spacer-pane%].} ]} @@ -215,56 +215,56 @@ The fundamental graphical element in the windowing toolbox is an @itemize[ - @item{@scheme[panel%] --- a panel is a containee as well as + @item{@racket[panel%] --- a panel is a containee as well as a container.} - @item{@scheme[pane%] --- a pane is a containee as well as a + @item{@racket[pane%] --- a pane is a containee as well as a container.} - @item{@scheme[canvas%] --- a @deftech{canvas} is a subwindow for + @item{@racket[canvas%] --- a @deftech{canvas} is a subwindow for drawing on the screen.} - @item{@scheme[editor-canvas%] --- an @deftech{editor canvas} is a + @item{@racket[editor-canvas%] --- an @deftech{editor canvas} is a subwindow for displaying a text editor or pasteboard editor. The - @scheme[editor-canvas%] class is documented with the editor classes + @racket[editor-canvas%] class is documented with the editor classes in @secref["editor-overview"].} @item{@deftech{Controls} --- containees that the user can manipulate: @itemize[ - @item{@scheme[message%] --- a @deftech{message} is a static + @item{@racket[message%] --- a @deftech{message} is a static text field or bitmap with no user interaction.} - @item{@scheme[button%] --- a @deftech{button} is a clickable + @item{@racket[button%] --- a @deftech{button} is a clickable control.} - @item{@scheme[check-box%] --- a @deftech{check box} is a + @item{@racket[check-box%] --- a @deftech{check box} is a clickable control; the user clicks the control to set or remove its check mark.} - @item{@scheme[radio-box%] --- a @deftech{radio box} is a + @item{@racket[radio-box%] --- a @deftech{radio box} is a collection of mutually exclusive @deftech{radio buttons}; when the user clicks a radio button, it is selected and the radio box's previously selected radio button is deselected.} - @item{@scheme[choice%] --- a @deftech{choice item} is a pop-up + @item{@racket[choice%] --- a @deftech{choice item} is a pop-up menu of text choices; the user selects one item in the control.} - @item{@scheme[list-box%] --- a @deftech{list box} is a + @item{@racket[list-box%] --- a @deftech{list box} is a scrollable lists of text choices; the user selects one or more items in the list (depending on the style of the list box).} - @item{@scheme[text-field%] --- a @deftech{text field} is a box + @item{@racket[text-field%] --- a @deftech{text field} is a box for simple text entry.} - @item{@scheme[combo-field%] --- a @deftech{combo field} combines + @item{@racket[combo-field%] --- a @deftech{combo field} combines a text field with a pop-up menu of choices.} - @item{@scheme[slider%] --- a @deftech{slider} is a dragable + @item{@racket[slider%] --- a @deftech{slider} is a dragable control that selects an integer value within a fixed range.} - @item{@scheme[gauge%] --- a @deftech{gauge} is an output-only + @item{@racket[gauge%] --- a @deftech{gauge} is an output-only control (the user cannot change the value) for reporting an integer value within a fixed range.} @@ -287,27 +287,27 @@ Most areas are @deftech{windows}, but some are @tech{non-window} does not receive mouse events, and it cannot be disabled or hidden. -Every @tech{area} is an instance of the @scheme[area<%>] +Every @tech{area} is an instance of the @racket[area<%>] interface. Each @tech{container} is also an instance of the - @scheme[area-container<%>] interface, whereas each @tech{containee} - is an instance of @scheme[subarea<%>]. @tech{Windows} are instances - of @scheme[window<%>]. The @scheme[area-container<%>], - @scheme[subarea<%>], and @scheme[window<%>] interfaces are - subinterfaces of @scheme[area<%>]. + @racket[area-container<%>] interface, whereas each @tech{containee} + is an instance of @racket[subarea<%>]. @tech{Windows} are instances + of @racket[window<%>]. The @racket[area-container<%>], + @racket[subarea<%>], and @racket[window<%>] interfaces are + subinterfaces of @racket[area<%>]. The following diagram shows more of the type hierarchy under - @scheme[area<%>]: + @racket[area<%>]: @diagram->table[short-windowing-diagram] The diagram below extends the one above to show the complete type - hierarchy under @scheme[area<%>]. (Some of the types are represented + hierarchy under @racket[area<%>]. (Some of the types are represented by interfaces, and some types are represented by classes. In principle, every area type should be represented by an interface, but whenever the windowing toolbox provides a concrete implementation, the corresponding interface is omitted from the toolbox.) To avoid intersecting lines, the hierarchy is drawn for a cylindrical surface; - lines from @scheme[subarea<%>] and @scheme[subwindow<%>] wrap from + lines from @racket[subarea<%>] and @racket[subwindow<%>] wrap from the left edge of the diagram to the right edge. @diagram->table[windowing-diagram] @@ -323,14 +323,14 @@ Menu bars, menus, and menu items are graphical elements, but not areas @itemize[ - @item{@scheme[menu-bar%] --- a @deftech{menu bar} is a top-level + @item{@racket[menu-bar%] --- a @deftech{menu bar} is a top-level collection of menus that are associated with a frame.} - @item{@scheme[menu%] --- a @deftech{menu} contains a set of menu + @item{@racket[menu%] --- a @deftech{menu} contains a set of menu items. The menu can appear in a menu bar, in a popup menu, or as a submenu in another menu.} - @item{@scheme[popup-menu%] --- a @deftech{popup menu} is a + @item{@racket[popup-menu%] --- a @deftech{popup menu} is a top-level menu that is dynamically displayed in a canvas or editor canvas.} @@ -340,18 +340,18 @@ Menu bars, menus, and menu items are graphical elements, but not areas @itemize[ - @item{@scheme[separator-menu-item%] --- a @deftech{separator} is + @item{@racket[separator-menu-item%] --- a @deftech{separator} is an unselectable line in a menu or popup menu.} - @item{@scheme[menu-item%] --- a @deftech{plain menu item} is a + @item{@racket[menu-item%] --- a @deftech{plain menu item} is a selectable text item in a menu. When the item is selected, its callback procedure is invoked.} - @item{@scheme[checkable-menu-item%] --- a @deftech{checkable menu + @item{@racket[checkable-menu-item%] --- a @deftech{checkable menu item} is a text item in a menu; the user selects a checkable menu item to toggle a check mark next to the item.} - @item{@scheme[menu%] --- a menu is a menu item as well as a menu + @item{@racket[menu%] --- a menu is a menu item as well as a menu item container.} ]} @@ -392,7 +392,7 @@ The built-in container classes include horizontal panels (and panes), with the following program: -@schemeblock[ +@racketblock[ (code:comment @#,t{Create a dialog}) (define dialog (instantiate dialog% ("Example"))) @@ -496,12 +496,12 @@ A @deftech{margin} is space surrounding a containee. Each containee's margin is independent of its minimum size, but from the container's point of view, a margin effectively increases the minimum size of the containee. For example, if a button has a vertical margin of - @scheme[2], then the container must allocate enough room to leave two + @racket[2], then the container must allocate enough room to leave two pixels of space above and below the button, in addition to the space that is allocated for the button's minimum height. A programmer can adjust a containee's margin with @method[subarea<%> horiz-margin] and - @method[subarea<%> vert-margin]. The default margin is @scheme[2] for - a control, and @scheme[0] for any other type of containee. + @method[subarea<%> vert-margin]. The default margin is @racket[2] for + a control, and @racket[0] for any other type of containee. In practice, the @tech{requested minimum size} and @tech{margin} of a control are rarely changed, although they are often changed for a @@ -588,7 +588,7 @@ A container's spacing determines the amount of space left between can be placed. A programmer can adjust a container's border and spacing dynamically via the @method[area-container<%> border] and @method[area-container<%> spacing] methods. The default border and - spacing are @scheme[0] for all container types. + spacing are @racket[0] for all container types. Because a panel or pane is a containee as well as a container, it has a containee margin in addition to its border margin. For a panel, @@ -603,7 +603,7 @@ For a top-level-window container, such as a frame or dialog, the containers (i.e., panels and panes), the container's stretchability is its stretchability as a containee in some other container. All types of containers are initially stretchable in both - directions---except instances of @scheme[grow-box-spacer-pane%], + directions---except instances of @racket[grow-box-spacer-pane%], which is intended as a lightweight spacer class rather than a useful container class---but a programmer can change the stretchability of an area at any time via the @method[area<%> stretchable-width] and @@ -613,10 +613,10 @@ The alignment specification for a container determines how it positions its children when the container has leftover space. (A container can only have leftover space in a particular direction when none of its children are stretchable in that direction.) For example, - when the container's horizontal alignment is @indexed-scheme['left], + when the container's horizontal alignment is @indexed-racket['left], the children are left-aligned in the container and leftover space is accumulated to the right. When the container's horizontal alignment - is @indexed-scheme['center], each child is horizontally centered in + is @indexed-racket['center], each child is horizontally centered in the container. A container's alignment is changed with the @method[area-container<%> set-alignment] method. @@ -625,7 +625,7 @@ The alignment specification for a container determines how it Although nested horizontal and vertical containers can express most layout patterns, a programmer can define a new type of container with an explicit layout procedure. A programmer defines a new type of - container by deriving a class from @scheme[panel%] or @scheme[pane%] + container by deriving a class from @racket[panel%] or @racket[pane%] and overriding the @method[area-container<%> container-size] and @method[area-container<%> place-children] methods. The @method[area-container<%> container-size] method takes a list of size @@ -640,7 +640,7 @@ An input size specification is a list of four values: @itemize[ @item{the child's minimum width;} @item{the child's minimum height;} - @item{the child's horizontal stretchability (@scheme[#t] means stretchable, @scheme[#f] means not stretchable); and} + @item{the child's horizontal stretchability (@racket[#t] means stretchable, @racket[#f] means not stretchable); and} @item{the child's vertical stretchability.} ] @@ -703,7 +703,7 @@ Whenever the user moves the mouse, clicks or releases a mouse button, target window. A program can use the @method[window<%> focus] method to move the focus to a subwindow or to set the initial focus. - A @indexed-scheme['wheel-up] or @indexed-scheme['wheel-down] + A @indexed-racket['wheel-up] or @indexed-racket['wheel-down] event may be sent to a window other than the one with the keyboard focus, depending on how the operating system handles wheel events. @@ -792,7 +792,7 @@ An @deftech{eventspace} is a context for processing GUI events. Each eventspace maintains its own queue of events, and events in a single eventspace are dispatched sequentially by a designated @deftech{handler thread}. An event-handling procedure running in this - handler thread can yield to the system by calling @scheme[yield], in + handler thread can yield to the system by calling @racket[yield], in which case other event-handling procedures may be called in a nested (but single-threaded) manner within the same handler thread. Events from different eventspaces are dispatched asynchronously by separate @@ -803,7 +803,7 @@ An @deftech{eventspace} is a context for processing GUI as described in @secref["currenteventspace"]. Events for a top-level window and its descendants are always dispatched in the window's eventspace. Every dialog is modal; a dialog's - @method[dialog% show] method implicitly calls @scheme[yield] to + @method[dialog% show] method implicitly calls @racket[yield] to handle events while the dialog is shown. (See also @secref["espacethreads"] for information about threads and modal dialogs.) Furthermore, when a modal dialog is shown, the system @@ -824,7 +824,7 @@ In addition to events corresponding to user and windowing actions, dispatches two kinds of internal events: @tech{timer events} and @tech{explicitly queued events}. -@deftech{Timer events} are created by instances of @scheme[timer%]. When +@deftech{Timer events} are created by instances of @racket[timer%]. When a timer is started and then expires, the timer queues an event to call the timer's @method[timer% notify] method. Like a top-level window, each timer is associated with a particular eventspace (the @@ -833,11 +833,11 @@ In addition to events corresponding to user and windowing actions, queues the event in its eventspace. @deftech{Explicitly queued events} are created with - @scheme[queue-callback], which accepts a callback procedure to handle + @racket[queue-callback], which accepts a callback procedure to handle the event. The event is enqueued in the current eventspace at the - time of the call to @scheme[queue-callback], with either a high or + time of the call to @racket[queue-callback], with either a high or low priority as specified by the (optional) second argument to - @scheme[queue-callback]. + @racket[queue-callback]. An eventspace's event queue is actually a priority queue with events sorted according to their kind, from highest-priority (dispatched @@ -846,7 +846,7 @@ An eventspace's event queue is actually a priority queue with events @itemize[ @item{The highest-priority events are high-priority events installed - with @scheme[queue-callback].} + with @racket[queue-callback].} @item{Timer events have the second-highest priority.} @@ -854,14 +854,14 @@ An eventspace's event queue is actually a priority queue with events the second-lowest priority.} @item{The lowest-priority events are low-priority events installed - with @scheme[queue-callback].} + with @racket[queue-callback].} ] Although a programmer has no direct control over the order in which events are dispatched, a programmer can control the timing of dispatches by setting the @deftech{event dispatch handler} via the - @scheme[event-dispatch-handler] parameter. This parameter and other + @racket[event-dispatch-handler] parameter. This parameter and other eventspace procedures are described in more detail in @secref["eventspace-funcs"]. @@ -877,27 +877,27 @@ When a new eventspace is created, a corresponding @tech{handler eventspace. When a handler thread shows a dialog, the dialog's @method[dialog% - show] method implicitly calls @scheme[yield] for as long as the + show] method implicitly calls @racket[yield] for as long as the dialog is shown. When a non-handler thread shows a dialog, the non-handler thread simply blocks until the dialog is - dismissed. Calling @scheme[yield] with no arguments from a - non-handler thread has no effect. Calling @scheme[yield] with a + dismissed. Calling @racket[yield] with no arguments from a + non-handler thread has no effect. Calling @racket[yield] with a semaphore from a non-handler thread is equivalent to calling - @scheme[semaphore-wait]. + @racket[semaphore-wait]. @subsection[#:tag "currenteventspace"]{Creating and Setting the Eventspace} Whenever a frame, dialog, or timer is created, it is associated with the @deftech{current eventspace} as determined by the - @scheme[current-eventspace] parameter @|SeeMzParam|. + @racket[current-eventspace] parameter @|SeeMzParam|. -The @scheme[make-eventspace] procedure creates a new +The @racket[make-eventspace] procedure creates a new eventspace. The following example creates a new eventspace and a new - frame in the eventspace (the @scheme[parameterize] syntactic form + frame in the eventspace (the @racket[parameterize] syntactic form temporary sets a parameter value): -@schemeblock[ +@racketblock[ (let ([new-es (make-eventspace)]) (parameterize ([current-eventspace new-es]) (new frame% [label "Example"]))) @@ -910,14 +910,14 @@ When an eventspace is created, it is placed under the management of can-close?] or @xmethod[top-level-window<%> on-close]), all timers in the eventspace are stopped, and all enqueued callbacks are removed. Attempting to create a new window, timer, or explicitly - queued event in a shut-down eventspace raises the @scheme[exn:misc] + queued event in a shut-down eventspace raises the @racket[exn:misc] exception. An eventspace is a @techlink[#:doc reference-doc]{synchronizable event} (not to be confused with a GUI event), so it can be used with - @scheme[sync]. As a synchronizable event, an eventspace is in a + @racket[sync]. As a synchronizable event, an eventspace is in a blocking state when a frame is visible, a timer is active, a callback - is queued, or a @scheme[menu-bar%] is created with a @scheme['root] + is queued, or a @racket[menu-bar%] is created with a @racket['root] parent. (Note that the blocking state of an eventspace is unrelated to whether an event is ready for dispatching.) diff --git a/collects/scribblings/gui/window-intf.scrbl b/collects/scribblings/gui/window-intf.scrbl index b01843a806..6ad1f6e5fe 100644 --- a/collects/scribblings/gui/window-intf.scrbl +++ b/collects/scribblings/gui/window-intf.scrbl @@ -4,15 +4,15 @@ @definterface/title[window<%> (area<%>)]{ -A @scheme[window<%>] object is an @scheme[area<%>] with a graphical +A @racket[window<%>] object is an @racket[area<%>] with a graphical representation that can respond to events. -All @scheme[window<%>] classes accept the following named instantiation +All @racket[window<%>] classes accept the following named instantiation arguments: @itemize[ - @item{@indexed-scheme[enabled] --- default is @scheme[#t]; passed to -@method[window<%> enable] if @scheme[#f]} + @item{@indexed-racket[enabled] --- default is @racket[#t]; passed to +@method[window<%> enable] if @racket[#f]} ] @@ -40,7 +40,7 @@ screen coordinates. On Mac OS X, the screen coordinates start with @math{(0, 0)} at the upper left of the menu bar. In contrast, @xmethod[top-level-window<%> move] considers @math{(0, 0)} to be below the menu bar. See also -@scheme[get-display-left-top-inset]. +@racket[get-display-left-top-inset]. } @@ -54,7 +54,7 @@ Enables or disables a window so that input events are ignored. (Input @MonitorMethod[@elem{The enable state of a window} @elem{enabling a parent window} @elem{@method[window<%> on-superwindow-enable]} @elem{enable state}] -If @scheme[enable?] is true, the window is enabled, otherwise it is +If @racket[enable?] is true, the window is enabled, otherwise it is disabled. } @@ -120,7 +120,7 @@ See also @defmethod[(get-cursor) (or/c (is-a?/c cursor%) #f)]{ -Returns the window's cursor, or @scheme[#f] if this window's cursor +Returns the window's cursor, or @racket[#f] if this window's cursor defaults to the parent's cursor. See @method[window<%> set-cursor] for more information. @@ -137,7 +137,7 @@ platform: @item{Windows: @tt{HWND}} - @item{Mac OS X: @tt{NSWindow} for a @scheme[top-level-window<%>] object, + @item{Mac OS X: @tt{NSWindow} for a @racket[top-level-window<%>] object, @tt{NSView} for other windows} @item{Unix: @tt{GtkWidget}} @@ -172,8 +172,8 @@ Gets a window's label, if any. Control windows generally display their for identification purposes. Messages, buttons, and check boxes can have bitmap labels (only when they are created with bitmap labels), but all other windows have string labels. In addition, a message - label can be an icon symbol @scheme['app], @scheme['caution], or - @scheme['stop], and a button can have both a bitmap label and a + label can be an icon symbol @racket['app], @racket['caution], or + @racket['stop], and a button can have both a bitmap label and a string label (along with a position for the bitmap). A label string may contain @litchar{&}s, which serve as @@ -186,7 +186,7 @@ A label string may contain @litchar{&}s, which serve as (with no displayed underline). See also @method[top-level-window<%> on-traverse-char]. -If the window does not have a label, @scheme[#f] is returned. +If the window does not have a label, @racket[#f] is returned. } @@ -197,7 +197,7 @@ If the window does not have a label, @scheme[#f] is returned. Like @method[window<%> get-label], except that ampersands in the label are removed. If the window has no label or the window's - label is not a string, @scheme[#f] is returned. + label is not a string, @racket[#f] is returned. } @@ -264,8 +264,8 @@ Indicates whether the window currently has the keyboard focus. See @defmethod[(is-enabled?) boolean?]{ -Returns @scheme[#t] if the window is enabled when all of its ancestors - are enabled, @scheme[#f] otherwise. +Returns @racket[#t] if the window is enabled when all of its ancestors + are enabled, @racket[#f] otherwise. } @@ -276,8 +276,8 @@ Returns @scheme[#t] if the window is enabled when all of its ancestors Indicates whether the window is currently shown or not (when all of its ancestors are also shown). -The result is @scheme[#t] if this window is shown when its ancestors are - shown, or @scheme[#f] if this window remains hidden when its ancestors +The result is @racket[#t] if this window is shown when its ancestors are + shown, or @racket[#f] if this window remains hidden when its ancestors are shown. } @@ -295,7 +295,7 @@ On Mac OS X, when the application is running and user double-clicks an application-handled file or drags a file onto the application's icon, the main thread's application file handler is called (see -@scheme[application-file-handler]). The default handler calls the +@racket[application-file-handler]). The default handler calls the @method[window<%> on-drop-file] method of the most-recently activated frame if drag-and-drop is enabled for that frame, independent of the frame's eventspace (but the method is called in the frame's eventspace's handler @@ -309,7 +309,7 @@ On Mac OS X, when the application is running and user @methspec{ @index['("keyboard focus" "notification")]{Called} when a window - receives or loses the keyboard focus. If the argument is @scheme[#t], + receives or loses the keyboard focus. If the argument is @racket[#t], the keyboard focus was received, otherwise it was lost. Note that on Unix, keyboard focus can move to the menu bar @@ -368,14 +368,14 @@ Does nothing. Called when this window or a child window receives a keyboard event. The @method[window<%> on-subwindow-char] method of the receiver's top-level window is called first (see -@method[area<%> get-top-level-window]); if the return value is @scheme[#f], then the +@method[area<%> get-top-level-window]); if the return value is @racket[#f], then the @method[window<%> on-subwindow-char] method is called for the next child in the path to the receiver, and so on. Finally, if the receiver's -@method[window<%> on-subwindow-char] method returns @scheme[#f], the event is passed on to the receiver's +@method[window<%> on-subwindow-char] method returns @racket[#f], the event is passed on to the receiver's normal key-handling mechanism. -The @scheme[event] argument is the event that was generated for the - @scheme[receiver] window. +The @racket[event] argument is the event that was generated for the + @racket[receiver] window. The atomicity limitation @method[window<%> on-subwindow-event] applies to @method[window<%> on-subwindow-char] as well. That is, an insufficiently cooperative @@ -393,7 +393,7 @@ BEWARE: The default } @methimpl{ -Returns @scheme[#f]. +Returns @racket[#f]. }} @@ -405,14 +405,14 @@ Returns @scheme[#f]. Called when this window or a child window receives a mouse event. The @method[window<%> on-subwindow-event] method of the receiver's top-level window is called first (see -@method[area<%> get-top-level-window]); if the return value is @scheme[#f], the +@method[area<%> get-top-level-window]); if the return value is @racket[#f], the @method[window<%> on-subwindow-event] method is called for the next child in the path to the receiver, and so on. Finally, if the receiver's -@method[window<%> on-subwindow-event] method returns @scheme[#f], the event is passed on to the +@method[window<%> on-subwindow-event] method returns @racket[#f], the event is passed on to the receiver's normal mouse-handling mechanism. -The @scheme[event] argument is the event that was generated for the - @scheme[receiver] window. +The @racket[event] argument is the event that was generated for the + @racket[receiver] window. If the @method[window<%> on-subwindow-event] method chain does not complete atomically (i.e., without requiring other threads to run) or does not complete @@ -424,7 +424,7 @@ If the @method[window<%> on-subwindow-event] method chain does not complete } @methimpl{ -Returns @scheme[#f]. +Returns @racket[#f]. }} @@ -478,8 +478,8 @@ This method is not called when the window is initially created; it is @popupmenuinfo["window" "window" ""] -The @scheme[menu] is popped up within the window at position - (@scheme[x], @scheme[y]). +The @racket[menu] is popped up within the window at position + (@racket[x], @racket[y]). } @@ -496,7 +496,7 @@ Enqueues an event to repaint the window. (integer-in -10000 10000))]{ @index["global coordinates"]{Converts} global coordinates to window - local coordinates. See also @scheme[client->screen] for information + local coordinates. See also @racket[client->screen] for information on screen coordinates. } @@ -505,7 +505,7 @@ Enqueues an event to repaint the window. @defmethod[(set-cursor [cursor (or/c (is-a?/c cursor%) #f)]) void?]{ -Sets the window's cursor. Providing @scheme[#f] instead of a cursor +Sets the window's cursor. Providing @racket[#f] instead of a cursor value removes the window's cursor. If a window does not have a cursor, it uses the cursor of its parent. @@ -524,7 +524,7 @@ Sets a window's label. The window's natural minimum size might be is not recomputed. If the window was not created with a label, or if the window was - created with a non-string label, @scheme[l] is ignored. + created with a non-string label, @racket[l] is ignored. See @method[window<%> get-label] for more information. @@ -538,7 +538,7 @@ Shows or hides a window. @MonitorMethod[@elem{The visibility of a window} @elem{the user clicking the window's close box, for example} @elem{@method[window<%> on-superwindow-show] or @method[top-level-window<%> on-close]} @elem{visibility}] -If @scheme[show?] is @scheme[#f], the window is hidden. Otherwise, the +If @racket[show?] is @racket[#f], the window is hidden. Otherwise, the window is shown. } diff --git a/collects/scribblings/guide/certificates.scrbl b/collects/scribblings/guide/certificates.scrbl index 8938cff7d2..8957eeadc5 100644 --- a/collects/scribblings/guide/certificates.scrbl +++ b/collects/scribblings/guide/certificates.scrbl @@ -9,14 +9,14 @@ identifier must not be extracted from the expanded expression and used in a different context, because using the identifier in a different context may break invariants of the macro's module. -For example, the following module exports a macro @scheme[go] that -expands to a use of @scheme[unchecked-go]: +For example, the following module exports a macro @racket[go] that +expands to a use of @racket[unchecked-go]: -@schemeblock[ +@racketblock[ (module m mzscheme (provide go) (define (unchecked-go n x) - (code:comment @#,t{to avoid disaster, @scheme[n] must be a number}) + (code:comment @#,t{to avoid disaster, @racket[n] must be a number}) (+ n 17)) (define-syntax (go stx) (syntax-case stx () @@ -24,10 +24,10 @@ expands to a use of @scheme[unchecked-go]: #'(unchecked-go 8 x)]))) ] -If the reference to @scheme[unchecked-go] is extracted from the -expansion of @scheme[(go 'a)], then it might be inserted into a new -expression, @scheme[(unchecked-go #f 'a)], leading to disaster. The -@scheme[datum->syntax] procedure can be used similarly to construct +If the reference to @racket[unchecked-go] is extracted from the +expansion of @racket[(go 'a)], then it might be inserted into a new +expression, @racket[(unchecked-go #f 'a)], leading to disaster. The +@racket[datum->syntax] procedure can be used similarly to construct references to an unexported identifier, even when no macro expansion includes a reference to the identifier. @@ -35,35 +35,35 @@ To prevent such abuses of unexported identifiers, the expander rejects references to unexported identifiers unless they appear in @defterm{certified} syntax objects. The macro expander always certifies a syntax object that is produced by a transformer. For -example, when @scheme[(go 'a)] is expanded to @scheme[(unchecked-go 8 -'a)], a certificate is attached to the result @scheme[(unchecked-go 8 -'a)]. Extracting just @scheme[unchecked-go] removes the identifier +example, when @racket[(go 'a)] is expanded to @racket[(unchecked-go 8 +'a)], a certificate is attached to the result @racket[(unchecked-go 8 +'a)]. Extracting just @racket[unchecked-go] removes the identifier from the certified expression, so that the reference is disallowed -when it is inserted into @scheme[(unchecked-go #f 'a)]. The -@scheme[expand] and @scheme[local-expand] (when used with an empty +when it is inserted into @racket[(unchecked-go #f 'a)]. The +@racket[expand] and @racket[local-expand] (when used with an empty stop list) functions lift all certificates to the outermost result -expression, except as indicated by @scheme['certify-mode] syntax +expression, except as indicated by @racket['certify-mode] syntax properties (see @refsecref["stxcerts"]). In addition to checking module references, the macro expander disallows references to local bindings where the binding identifier is less certified than the reference. Otherwise, the expansion of -@scheme[(go 'a)] could be wrapped with a local binding that redirects -@scheme[#%app] to @scheme[values], thus obtaining the value of -@scheme[unchecked-go]. Note that a capturing @scheme[#%app] would have -to be extracted from the expansion of @scheme[(go 'a)], since lexical -scope would prevent an arbitrary @scheme[#%app] from capturing. The -act of extracting @scheme[#%app] removes its certification, whereas -the @scheme[#%app] within the expansion is still certified; comparing +@racket[(go 'a)] could be wrapped with a local binding that redirects +@racket[#%app] to @racket[values], thus obtaining the value of +@racket[unchecked-go]. Note that a capturing @racket[#%app] would have +to be extracted from the expansion of @racket[(go 'a)], since lexical +scope would prevent an arbitrary @racket[#%app] from capturing. The +act of extracting @racket[#%app] removes its certification, whereas +the @racket[#%app] within the expansion is still certified; comparing these certifications, the macro expander rejects the local-binding -reference, and @scheme[unchecked-go] remains protected. +reference, and @racket[unchecked-go] remains protected. In much the same way that the macro expander copies properties from a syntax transformer's input to its output (see @refsecref["stxprops"]), the expander copies certificates from a transformer's input to its output. Building on the previous example, -@schemeblock[ +@racketblock[ (module n mzscheme (require m) (provide go-more) @@ -72,12 +72,12 @@ output. Building on the previous example, #'(go y))) ] -the expansion of @scheme[(go-more)] introduces a reference to the -unexported @scheme[y] in @scheme[(go y)], and a certificate allows the -reference to @scheme[y]. As @scheme[(go y)] is expanded to -@scheme[(unchecked-go 8 y)], the certificate that allows @scheme[y] is +the expansion of @racket[(go-more)] introduces a reference to the +unexported @racket[y] in @racket[(go y)], and a certificate allows the +reference to @racket[y]. As @racket[(go y)] is expanded to +@racket[(unchecked-go 8 y)], the certificate that allows @racket[y] is copied over, in addition to the certificate that allows the reference -to @scheme[unchecked-go]. +to @racket[unchecked-go]. When a protected identifier becomes inaccessible by direct reference (i.e., when the current code inspector is changed so that it does not @@ -87,10 +87,10 @@ protected identifier is treated like an unexported identifier. @;------------------------------------------------------------------------ @section[#:tag "stxinactivecerts"]{Certificate Propagation} -When the result of a macro expansion contains a @scheme[quote-syntax] +When the result of a macro expansion contains a @racket[quote-syntax] form, the macro expansion's certificate must be attached to the resulting syntax object to support macro-generating macros. In -general, when the macro expander encounters @scheme[quote-syntax], it +general, when the macro expander encounters @racket[quote-syntax], it attaches all certificates from enclosing expressions to the quoted syntax constant. However, the certificates are attached to the syntax constant as @defterm{inactive} certificates, and inactive certificates @@ -100,10 +100,10 @@ result of a macro expansion; at that time, the expander removes all inactive certificates within the expansion result and attaches active versions of the certificates to the overall expansion result. -For example, suppose that the @scheme[go] macro is implemented through +For example, suppose that the @racket[go] macro is implemented through a macro: -@schemeblock[ +@racketblock[ (module m mzscheme (provide def-go) (define (unchecked-go n x) @@ -117,35 +117,35 @@ a macro: #'(unchecked-go 8 x)]))]))) ] -When @scheme[def-go] is used inside another module, the generated +When @racket[def-go] is used inside another module, the generated macro should legally generate expressions that use -@scheme[unchecked-go], since @scheme[def-go] in @scheme[m] had +@racket[unchecked-go], since @racket[def-go] in @racket[m] had complete control over the generated macro. -@schemeblock[ +@racketblock[ (module n mzscheme (require m) (def-go go) - (go 10)) ; access to @scheme[unchecked-go] is allowed + (go 10)) ; access to @racket[unchecked-go] is allowed ] -This example works because the expansion of @scheme[(def-go go)] is -certified to access protected identifiers in @scheme[m], including -@scheme[unchecked-go]. Specifically, the certified expansion is a -definition of the macro @scheme[go], which includes a syntax-object -constant @scheme[unchecked-go]. Since the enclosing macro declaration -is certified, the @scheme[unchecked-go] syntax constant gets an +This example works because the expansion of @racket[(def-go go)] is +certified to access protected identifiers in @racket[m], including +@racket[unchecked-go]. Specifically, the certified expansion is a +definition of the macro @racket[go], which includes a syntax-object +constant @racket[unchecked-go]. Since the enclosing macro declaration +is certified, the @racket[unchecked-go] syntax constant gets an inactive certificate to access protected identifiers of -@scheme[m]. When @scheme[(go 10)] is expanded, the inactive -certificate on @scheme[unchecked-go] is activated for the macro result -@scheme[(unchecked-go 8 10)], and the access of @scheme[unchecked-go] +@racket[m]. When @racket[(go 10)] is expanded, the inactive +certificate on @racket[unchecked-go] is activated for the macro result +@racket[(unchecked-go 8 10)], and the access of @racket[unchecked-go] is allowed. -To see why @scheme[unchecked-go] as a syntax constant must be given an +To see why @racket[unchecked-go] as a syntax constant must be given an inactive certificate instead of an active one, it's helpful to write -the @scheme[def-go] macro as follows: +the @racket[def-go] macro as follows: -@schemeblock[ +@racketblock[ (define-syntax (def-go stx) (syntax-case stx () [(_ go) @@ -156,34 +156,34 @@ the @scheme[def-go] macro as follows: #'(ug 8 x))]))])) ] -In this case, @scheme[unchecked-go] is clearly quoted as an immediate -syntax object in the expansion of @scheme[(def-go go)]. If this syntax +In this case, @racket[unchecked-go] is clearly quoted as an immediate +syntax object in the expansion of @racket[(def-go go)]. If this syntax object were given an active certificate, then it would keep the -certificate---directly on the identifier @scheme[unchecked-go]---in -the result @scheme[(unchecked-go 8 10)]. Consequently, the -@scheme[unchecked-go] identifier could be extracted and used with its +certificate---directly on the identifier @racket[unchecked-go]---in +the result @racket[(unchecked-go 8 10)]. Consequently, the +@racket[unchecked-go] identifier could be extracted and used with its certificate intact. Attaching an inactive certificate to -@scheme[unchecked-go] and activating it only for the complete result -@scheme[(unchecked-go 8 10)] ensures that @scheme[unchecked-go] is -used only in the way intended by the implementor of @scheme[def-go]. +@racket[unchecked-go] and activating it only for the complete result +@racket[(unchecked-go 8 10)] ensures that @racket[unchecked-go] is +used only in the way intended by the implementor of @racket[def-go]. -The @scheme[datum->syntax] procedure allows inactive certificates to +The @racket[datum->syntax] procedure allows inactive certificates to be transferred from one syntax object to another. Such transfers are allowed because a macro transformer with access to the syntax object could already wrap it with an arbitrary context before activating the certificates. In practice, transferring inactive certificates is useful mainly to macros that implement new template forms, such as -@scheme[syntax/loc]. +@racket[syntax/loc]. @;------------------------------------------------------------------------ @section{Internal Certificates} In some cases, a macro implementor intends to allow limited destructuring of a macro result without losing the result's -certificate. For example, given the following @scheme[define-like-y] +certificate. For example, given the following @racket[define-like-y] macro, -@schemeblock[ +@racketblock[ (module q mzscheme (provide define-like-y) (define y 'hello) @@ -194,60 +194,60 @@ macro, someone may use the macro in an internal definition: -@schemeblock[ +@racketblock[ (let () (define-like-y x) x) ] -The implementor of the @scheme[q] module most likely intended to allow -such uses of @scheme[define-like-y]. To convert an internal definition -into a @scheme[letrec] binding, however, the @scheme[define] form -produced by @scheme[define-like-y] must be deconstructed, which would -normally lose the certificate that allows the reference to @scheme[y]. +The implementor of the @racket[q] module most likely intended to allow +such uses of @racket[define-like-y]. To convert an internal definition +into a @racket[letrec] binding, however, the @racket[define] form +produced by @racket[define-like-y] must be deconstructed, which would +normally lose the certificate that allows the reference to @racket[y]. -The internal use of @scheme[define-like-y] is allowed because the +The internal use of @racket[define-like-y] is allowed because the macro expander treats specially a transformer result that is a syntax -list beginning with @scheme[define-values]. In that case, instead of +list beginning with @racket[define-values]. In that case, instead of attaching the certificate to the overall expression, the certificate is instead attached to each individual element of the syntax list, pushing the certificates into the second element of the list so that they are attached to the defined identifiers. Thus, a certificate is -attached to @scheme[define-values], @scheme[x], and @scheme[y] in the -expansion result @scheme[(define-values (x) y)], and the definition -can be deconstructed for conversion to @scheme[letrec]. +attached to @racket[define-values], @racket[x], and @racket[y] in the +expansion result @racket[(define-values (x) y)], and the definition +can be deconstructed for conversion to @racket[letrec]. Just like the new certificate that is added to a transformer result, old certificates from the input are similarly moved to syntax-list -elements when the result starts with @scheme[define-values]. Thus, -@scheme[define-like-y] could have been implemented to produce -@scheme[(define id y)], using @scheme[define] instead of -@scheme[define-values]. In that case, the certificate to allow -reference to @scheme[y] would be attached initially to the expansion -result @scheme[(define x y)], but as the @scheme[define] is expanded -to @scheme[define-values], the certificate would be moved to the +elements when the result starts with @racket[define-values]. Thus, +@racket[define-like-y] could have been implemented to produce +@racket[(define id y)], using @racket[define] instead of +@racket[define-values]. In that case, the certificate to allow +reference to @racket[y] would be attached initially to the expansion +result @racket[(define x y)], but as the @racket[define] is expanded +to @racket[define-values], the certificate would be moved to the parts. The macro expander treats syntax-list results starting with -@scheme[define-syntaxes] in the same way that it treats results -starting with @scheme[define-values]. Syntax-list results starting -with @scheme[begin] are treated similarly, except that the second +@racket[define-syntaxes] in the same way that it treats results +starting with @racket[define-values]. Syntax-list results starting +with @racket[begin] are treated similarly, except that the second element of the syntax list is treated like all the other elements (i.e., the certificate is attached to the element instead of its content). Furthermore, the macro expander applies this special -handling recursively, in case a macro produces a @scheme[begin] form -that contains nested @scheme[define-values] forms. +handling recursively, in case a macro produces a @racket[begin] form +that contains nested @racket[define-values] forms. The default application of certificates can be overridden by attaching -a @scheme['certify-mode] property (see @refsecref["stxprops"]) to the +a @racket['certify-mode] property (see @refsecref["stxprops"]) to the result syntax object of a macro transformer. If the property value is -@scheme['opaque], then the certificate is attached to the syntax +@racket['opaque], then the certificate is attached to the syntax object and not its parts. If the property value is -@scheme['transparent], then the certificate is attached to the syntax +@racket['transparent], then the certificate is attached to the syntax object's parts. If the property value is -@scheme['transparent-binding], then the certificate is attached to the +@racket['transparent-binding], then the certificate is attached to the syntax object's parts and to the sub-parts of the second part (as for -@scheme[define-values] and @scheme[define-syntaxes]). The -@scheme['transparent] and @scheme['transparent-binding] modes triggers +@racket[define-values] and @racket[define-syntaxes]). The +@racket['transparent] and @racket['transparent-binding] modes triggers recursive property checking at the parts, so that the certificate can be pushed arbitrarily deep into a transformer's result. diff --git a/collects/scribblings/guide/contracts-first-extended-example.scrbl b/collects/scribblings/guide/contracts-first-extended-example.scrbl index 7fef7a9780..24c6e8971a 100644 --- a/collects/scribblings/guide/contracts-first-extended-example.scrbl +++ b/collects/scribblings/guide/contracts-first-extended-example.scrbl @@ -35,22 +35,22 @@ racket [argmax (-> (-> any/c real?) (and/c pair? list?) any/c)]) ] This contract captures two essential conditions of the informal - description of @scheme[argmax]: + description of @racket[argmax]: @itemlist[ @item{the given function must produce numbers that are comparable according -to @scheme[<]. In particular, the contract @scheme[(-> any/c number?)] -would not do, because @scheme[number?] also recognizes complex numbers in +to @racket[<]. In particular, the contract @racket[(-> any/c number?)] +would not do, because @racket[number?] also recognizes complex numbers in Racket.} @item{the given list must contain at least one item.} ] When combined with the name, the contract explains the behavior of - @scheme[argmax] at the same level as an ML function type in a + @racket[argmax] at the same level as an ML function type in a module signature (except for the non-empty list aspect). Contracts may communicate significantly more than a type signature, - however. Take a look at this second contract for @scheme[argmax]: + however. Take a look at this second contract for @racket[argmax]: @racketmod[#:file @tt{version 2} racket @@ -66,12 +66,12 @@ racket ] It is a @emph{dependent} contract that names the two arguments and uses the names to impose a predicate on the result. This predicate computes - @scheme[(f r)] -- where @racket[r] is the result of @scheme[argmax] -- and + @racket[(f r)] -- where @racket[r] is the result of @racket[argmax] -- and then validates that this value is greater than or equal to all values of @racket[f] on the items of @racket[lov]. -Is it possible that @scheme[argmax] could cheat by returning a random value - that accidentally maximizes @scheme[f] over all elements of @scheme[lov]? +Is it possible that @racket[argmax] could cheat by returning a random value + that accidentally maximizes @racket[f] over all elements of @racket[lov]? With a contract, it is possible to rule out this possibility: @racketmod[#:file @tt{version 2 rev. a} racket @@ -88,16 +88,16 @@ racket (memq r lov) (for/and ((v lov)) (>= f@r (f v)))))))]) ] - The @scheme[memq] function ensures that @scheme[r] is @emph{intensionally equal} + The @racket[memq] function ensures that @racket[r] is @emph{intensionally equal} @margin-note*{That is, "pointer equality" for those who prefer to think at - the hardware level.} to one of the members of @scheme[lov]. Of course, a + the hardware level.} to one of the members of @racket[lov]. Of course, a moment's worth of reflection shows that it is impossible to make up such a value. Functions are opaque values in Racket and without applying a function, it is impossible to determine whether some random input value produces an output value or triggers some exception. So we ignore this possibility from here on. -Version 2 formulates the overall sentiment of @scheme[argmax]'s +Version 2 formulates the overall sentiment of @racket[argmax]'s documentation, but it fails to bring across that the result is the @emph{first} element of the given list that maximizes the given function @racket[f]. Here is a version that communicates this second aspect of @@ -117,10 +117,10 @@ racket (eq? (first (memf (lambda (v) (= (f v) f@r)) lov)) r)))))]) ] - That is, the @scheme[memf] function determines the first element of + That is, the @racket[memf] function determines the first element of @racket[lov] whose value under @racket[f] is equal to @racket[r]'s value under @racket[f]. If this element is intensionally equal to @racket[r], - the result of @scheme[argmax] is correct. + the result of @racket[argmax] is correct. This second refinement step introduces two problems. First, both conditions recompute the values of @racket[f] for all elements of @racket[lov]. Second, @@ -131,11 +131,11 @@ This second refinement step introduces two problems. First, both conditions @(define dominates1 @multiarg-element['tt]{@list{ - @racket[f@r] is greater or equal to all @scheme[(f v)] for @racket[v] in @racket[lov]}}) + @racket[f@r] is greater or equal to all @racket[(f v)] for @racket[v] in @racket[lov]}}) @(define first?1 @multiarg-element['tt]{ - @list{@racket[r] is @scheme[eq?] to the first element @racket[v] of @racket[lov] + @list{@racket[r] is @racket[eq?] to the first element @racket[v] of @racket[lov] for which @racket[(pred? v)]}}) @; --------------------------------------------------------------------------------------------------- @@ -178,7 +178,7 @@ This step leaves us with the problem of the newly introduced inefficiency. @(define first?2 @multiarg-element['tt]{ @list{@racket[r] is @racket[(second x)] for the first - @racket[x] in @racket[flov+lov] s.t. @scheme[(= (first x) f@r)]}}) + @racket[x] in @racket[flov+lov] s.t. @racket[(= (first x) f@r)]}}) @racketmod[#:file @tt{version 3 rev. b} racket @@ -215,16 +215,16 @@ racket of contracts.} Version 3 may still be too eager when it comes to calling @racket[f]. While - Racket's @scheme[argmax] always calls @racket[f] no matter how many items + Racket's @racket[argmax] always calls @racket[f] no matter how many items @racket[lov] contains, let us imagine for illustrative purposes that our own implementation first checks whether the list is a singleton. If so, the first element would be the only element of @racket[lov] and in that case there would be no need to compute @racket[(f r)]. -@margin-note*{The @scheme[argmax] of Racket implicitly argues that it not - only promises the first value that maximizes @scheme[f] over @scheme[lov] - but also that @scheme[f] produces/produced a value for the result.} +@margin-note*{The @racket[argmax] of Racket implicitly argues that it not + only promises the first value that maximizes @racket[f] over @racket[lov] + but also that @racket[f] produces/produced a value for the result.} As a matter of fact, since @racket[f] may diverge or raise an exception - for some inputs, @scheme[argmax] should avoid calling @racket[f] when + for some inputs, @racket[argmax] should avoid calling @racket[f] when possible. The following contract demonstrates how a higher-order dependent contract @@ -266,8 +266,8 @@ racket The problem of diverging or exception-raising functions should alert the reader to the even more general problem of functions with side-effects. If the given function @racket[f] has visible effects -- say it logs its calls - to a file -- then the clients of @scheme[argmax] will be able to observe - two sets of logs for each call to @scheme[argmax]. To be precise, if the + to a file -- then the clients of @racket[argmax] will be able to observe + two sets of logs for each call to @racket[argmax]. To be precise, if the list of values contains more than one element, the log will contain two calls of @racket[f] per value on @racket[lov]. If @racket[f] is expensive to compute, doubling the calls imposes a high cost. diff --git a/collects/scribblings/guide/contracts-intro.scrbl b/collects/scribblings/guide/contracts-intro.scrbl index 003a444ea0..2186603f32 100644 --- a/collects/scribblings/guide/contracts-intro.scrbl +++ b/collects/scribblings/guide/contracts-intro.scrbl @@ -46,7 +46,7 @@ racket/base @ctc-section[#:tag "amount0"]{Contract Violations} -If we bind @scheme[amount] to a number that is not positive, +If we bind @racket[amount] to a number that is not positive, @racketmod[ racket diff --git a/collects/scribblings/guide/contracts-simple-function.scrbl b/collects/scribblings/guide/contracts-simple-function.scrbl index 5367844133..94f3f02be5 100644 --- a/collects/scribblings/guide/contracts-simple-function.scrbl +++ b/collects/scribblings/guide/contracts-simple-function.scrbl @@ -114,7 +114,7 @@ return value, it tells a potential client that the ``server'' module even whether it is a single value or multiple values. The @racket[any/c] contract is similar to @racket[any], in that it -makes no demands on a value. Unlike @scheme[any], @racket[any/c] +makes no demands on a value. Unlike @racket[any], @racket[any/c] indicates a single value, and it is suitable for use as an argument contract. Using @racket[any/c] as a range contract imposes a check that the function produces a single value. That is, diff --git a/collects/scribblings/guide/contracts-utils.rkt b/collects/scribblings/guide/contracts-utils.rkt index 992e01c8f6..a610852cd2 100644 --- a/collects/scribblings/guide/contracts-utils.rkt +++ b/collects/scribblings/guide/contracts-utils.rkt @@ -1,8 +1,8 @@ -#lang scheme +#lang racket (require scribble/basic - (for-syntax scheme/port) - scheme/include + (for-syntax racket/port) + racket/include (except-in scribble/manual link)) (provide ctc-section @@ -35,7 +35,7 @@ [(_ filename) (call-with-input-file (build-path "contracts-examples" (format "~a.rkt" (syntax-e #'filename))) (λ (port) - (define prefix "#reader scribble/comment-reader\n[schememod\nscheme\n") + (define prefix "#reader scribble/comment-reader\n[racketmod\nracket\n") (define suffix "]") (with-syntax ([s (parameterize ([read-accept-reader #t]) (read-syntax 'contract-examples @@ -46,13 +46,13 @@ #'s)))])) (require (for-syntax (only-in scribble/comment-reader [read-syntax comment-reader]))) -(define-for-syntax (comment-schememod-reader path port) +(define-for-syntax (comment-racketmod-reader path port) (let ([pb (peek-byte port)]) (if (eof-object? pb) pb (let ([m (regexp-match #rx"^#lang " port)]) (unless m - (raise-syntax-error 'comment-scheme-reader "expected a #lang to begin file ~s" path)) + (raise-syntax-error 'comment-racket-reader "expected a #lang to begin file ~s" path)) (let ([np (let-values ([(line col pos) (port-next-location port)]) (relocate-input-port port line 0 pos))]) (port-count-lines! np) @@ -60,7 +60,7 @@ (let ([next (comment-reader path np)]) (cond [(eof-object? next) - #`(schememod #,@(reverse objects))] + #`(racketmod #,@(reverse objects))] [else (loop (cons next objects))])))))))) @@ -68,4 +68,4 @@ (syntax-case stx () [(_ filename) #`(include/reader #,(format "contracts-examples/~a.rkt" (syntax-e #'filename)) - comment-schememod-reader)])) + comment-racketmod-reader)])) diff --git a/collects/scribblings/guide/define-struct.scrbl b/collects/scribblings/guide/define-struct.scrbl index fa01f53839..34726f5ffa 100644 --- a/collects/scribblings/guide/define-struct.scrbl +++ b/collects/scribblings/guide/define-struct.scrbl @@ -8,76 +8,76 @@ @refalso["structures"]{structure types} -New datatypes are normally created with the @scheme[struct] +New datatypes are normally created with the @racket[struct] form, which is the topic of this chapter. The class-based object system, which we defer to @secref["classes"], offers an alternate mechanism for creating new datatypes, but even classes and objects are implemented in terms of structure types. @; ------------------------------------------------------------ -@section{Simple Structure Types: @scheme[struct]} +@section{Simple Structure Types: @racket[struct]} -@refalso["define-struct"]{@scheme[struct]} +@refalso["define-struct"]{@racket[struct]} -To a first approximation, the syntax of @scheme[struct] is +To a first approximation, the syntax of @racket[struct] is @specform[ (struct struct-id (field-id ...)) ]{} -@as-examples[@schemeblock+eval[ +@as-examples[@racketblock+eval[ #:eval posn-eval (struct posn (x y)) ]] -The @scheme[struct] form binds @scheme[_struct-id] and a number of -identifiers that are built from @scheme[_struct-id] and the -@scheme[_field-id]s: +The @racket[struct] form binds @racket[_struct-id] and a number of +identifiers that are built from @racket[_struct-id] and the +@racket[_field-id]s: @itemize[ - @item{@scheme[_struct-id] : a @deftech{constructor} function that - takes as many arguments as the number of @scheme[_field-id]s, + @item{@racket[_struct-id] : a @deftech{constructor} function that + takes as many arguments as the number of @racket[_field-id]s, and returns an instance of the structure type. @examples[#:eval posn-eval (posn 1 2)]} - @item{@scheme[_struct-id]@schemeidfont{?} : a @deftech{predicate} - function that takes a single argument and returns @scheme[#t] - if it is an instance of the structure type, @scheme[#f] + @item{@racket[_struct-id]@racketidfont{?} : a @deftech{predicate} + function that takes a single argument and returns @racket[#t] + if it is an instance of the structure type, @racket[#f] otherwise. @examples[#:eval posn-eval (posn? 3) (posn? (posn 1 2))]} - @item{@scheme[_struct-id]@schemeidfont{-}@scheme[_field-id] : for - each @scheme[_field-id], an @deftech{accessor} that extracts + @item{@racket[_struct-id]@racketidfont{-}@racket[_field-id] : for + each @racket[_field-id], an @deftech{accessor} that extracts the value of the corresponding field from an instance of the structure type. @examples[#:eval posn-eval (posn-x (posn 1 2)) (posn-y (posn 1 2))]} - @item{@schemeidfont{struct:}@scheme[_struct-id] : a + @item{@racketidfont{struct:}@racket[_struct-id] : a @deftech{structure type descriptor}, which is a value that represents the structure type as a first-class value (with - @scheme[#:super], as discussed later in + @racket[#:super], as discussed later in @secref["struct-options"]).} ] -A @scheme[struct] form places no constraints on the kinds of +A @racket[struct] form places no constraints on the kinds of values that can appear for fields in an instance of the structure -type. For example, @scheme[(posn "apple" #f)] produces an -instance of @scheme[posn], even though @scheme["apple"] and -@scheme[#f] are not valid coordinates for the obvious uses of -@scheme[posn] instances. Enforcing constraints on field values, such +type. For example, @racket[(posn "apple" #f)] produces an +instance of @racket[posn], even though @racket["apple"] and +@racket[#f] are not valid coordinates for the obvious uses of +@racket[posn] instances. Enforcing constraints on field values, such as requiring them to be numbers, is normally the job of a contract, as discussed later in @secref["contracts"]. @; ------------------------------------------------------------ @section[#:tag "struct-copy"]{Copying and Update} -The @scheme[struct-copy] form clones a structure and optionally +The @racket[struct-copy] form clones a structure and optionally updates specified fields in the clone. This process is sometimes called a @deftech{functional update}, because the result is a structure with updated field values. but the original structure is not @@ -87,13 +87,13 @@ modified. (struct-copy struct-id struct-expr [field-id expr] ...) ] -The @scheme[_struct-id] that appears after @scheme[struct-copy] must -be a structure type name bound by @scheme[struct] (i.e., the +The @racket[_struct-id] that appears after @racket[struct-copy] must +be a structure type name bound by @racket[struct] (i.e., the name that cannot be used directly as an expression). The -@scheme[_struct-expr] must produce an instance of the structure type. +@racket[_struct-expr] must produce an instance of the structure type. The result is a new instance of the structure type that is like the old -one, except that the field indicated by each @scheme[_field-id] gets -the value of the corresponding @scheme[_expr]. +one, except that the field indicated by each @racket[_field-id] gets +the value of the corresponding @racket[_expr]. @examples[ #:eval posn-eval @@ -107,7 +107,7 @@ the value of the corresponding @scheme[_expr]. @; ------------------------------------------------------------ @section[#:tag "struct-subtypes"]{Structure Subtypes} -An extended form of @scheme[struct] can be used to define a +An extended form of @racket[struct] can be used to define a @defterm{structure subtype}, which is a structure type that extends an existing structure type: @@ -115,11 +115,11 @@ existing structure type: (struct struct-id super-id (field-id ...)) ] -The @scheme[_super-id] must be a structure type name bound by -@scheme[struct] (i.e., the name that cannot be used directly as +The @racket[_super-id] must be a structure type name bound by +@racket[struct] (i.e., the name that cannot be used directly as an expression). -@as-examples[@schemeblock+eval[ +@as-examples[@racketblock+eval[ #:eval posn-eval (struct posn (x y)) (struct 3d-posn posn (z)) @@ -145,7 +145,7 @@ p With a structure type definition like -@schemeblock[ +@racketblock[ (struct posn (x y)) ] @@ -156,7 +156,7 @@ structure type are kept private to a module, then no other module can rely on the representation of the type's instances. To make a structure type @deftech{transparent}, use the -@scheme[#:transparent] keyword after the field-name sequence: +@racket[#:transparent] keyword after the field-name sequence: @def+int[ #:eval posn-eval @@ -168,7 +168,7 @@ To make a structure type @deftech{transparent}, use the An instance of a transparent structure type prints like a call to the constructor, so that it shows the structures field values. A transparent structure type also allows reflective operations, such as -@scheme[struct?] and @scheme[struct-info], to be used on its instances +@racket[struct?] and @racket[struct-info], to be used on its instances (see @secref["reflection"]). Structure types are opaque by default, because opaque structure @@ -180,8 +180,8 @@ by the library. @; ------------------------------------------------------------ @section[#:tag "struct-equal"]{Structure Comparisons} -A generic @scheme[equal?] comparison automatically recurs on the -fields of a transparent structure type, but @scheme[equal?] defaults +A generic @racket[equal?] comparison automatically recurs on the +fields of a transparent structure type, but @racket[equal?] defaults to mere instance identity for opaque structure types: @def+int[ @@ -197,9 +197,9 @@ to mere instance identity for opaque structure types: (equal? slab (lead 1 2)) ] -To support instances comparisons via @scheme[equal?] without making -the structure type transparent, you can use the @scheme[#:property] -keyword, @scheme[prop:equal+hash], and then a list of three functions: +To support instances comparisons via @racket[equal?] without making +the structure type transparent, you can use the @racket[#:property] +keyword, @racket[prop:equal+hash], and then a list of three functions: @def+int[ #:eval posn-eval @@ -207,23 +207,23 @@ keyword, @scheme[prop:equal+hash], and then a list of three functions: #:property prop:equal+hash (list (lambda (a b equal?-recur) - (code:comment @#,t{compare @scheme[a] and @scheme[b]}) + (code:comment @#,t{compare @racket[a] and @racket[b]}) (and (equal?-recur (lead-width a) (lead-width b)) (equal?-recur (lead-height a) (lead-height b)))) (lambda (a hash-recur) - (code:comment @#,t{compute primary hash code of @scheme[a]}) + (code:comment @#,t{compute primary hash code of @racket[a]}) (+ (hash-recur (lead-width a)) (* 3 (hash-recur (lead-height a))))) (lambda (a hash2-recur) - (code:comment @#,t{compute secondary hash code of @scheme[a]}) + (code:comment @#,t{compute secondary hash code of @racket[a]}) (+ (hash2-recur (lead-width a)) (hash2-recur (lead-height a)))))) (equal? (lead 1 2) (lead 1 2)) ] -The first function in the list implements the @scheme[equal?] test on -two @scheme[lead]s; the third argument to the function is used instead -of @scheme[equal?] for recursive equality testing, so that data cycles +The first function in the list implements the @racket[equal?] test on +two @racket[lead]s; the third argument to the function is used instead +of @racket[equal?] for recursive equality testing, so that data cycles can be handled correctly. The other two functions compute primary and secondary hash codes for use with @tech{hash tables}: @@ -235,7 +235,7 @@ secondary hash codes for use with @tech{hash tables}: (hash-ref h (lead 2 1)) ] -The first function provided with @scheme[prop:equal+hash] is not +The first function provided with @racket[prop:equal+hash] is not required to recursively compare the fields of the structure. For example, a structure type representing a set might implement equality by checking that the members of the set are the same, independent of @@ -246,14 +246,14 @@ types that are supposed to be equivalent. @; ------------------------------------------------------------ @section{Structure Type Generativity} -Each time that a @scheme[struct] form is evaluated, it +Each time that a @racket[struct] form is evaluated, it generates a structure type that is distinct from all existing structure types, even if some other structure type has the same name and fields. This generativity is useful for enforcing abstractions and implementing programs such as interpreters, but beware of placing a -@scheme[struct] form in positions that are evaluated multiple +@racket[struct] form in positions that are evaluated multiple times. @defexamples[ @@ -293,10 +293,10 @@ of a prefab structure is similar to a vector, but it starts @litchar{#s} instead of just @litchar{#}, and the first element in the printed form is the prefab structure type's name. -The following examples show instances of the @schemeidfont{sprout} +The following examples show instances of the @racketidfont{sprout} prefab structure type that has one field. The first instance has a -field value @scheme['bean], and the second has field value -@scheme['alfalfa]: +field value @racket['bean], and the second has field value +@racket['alfalfa]: @interaction[ '#s(sprout bean) @@ -310,8 +310,8 @@ the quotes above are optional: #s(sprout bean) ] -When you use the @scheme[#:prefab] keyword with -@scheme[struct], instead of generating a new structure type, +When you use the @racket[#:prefab] keyword with +@racket[struct], instead of generating a new structure type, you obtain bindings that work with the existing prefab structure type: @interaction[ @@ -323,10 +323,10 @@ you obtain bindings that work with the existing prefab structure type: (sprout 'garlic) ] -The field name @schemeidfont{kind} above does not matter for finding -the prefab structure type; only the name @schemeidfont{sprout} and the +The field name @racketidfont{kind} above does not matter for finding +the prefab structure type; only the name @racketidfont{sprout} and the number of fields matters. At the same time, the prefab structure type -@schemeidfont{sprout} with three fields is a different structure type +@racketidfont{sprout} with three fields is a different structure type than the one with a single field: @interaction[ @@ -389,13 +389,13 @@ Since the expression reader can generate @tech{prefab} instances, they are useful when convenient @tech{serialization} is more important than abstraction. @tech{Opaque} and @tech{transparent} structures also can be serialized, however, if they are defined with -@scheme[define-serializable-struct] as described in +@racket[define-serializable-struct] as described in @secref["serialization"]. @; ------------------------------------------------------------ @section[#:tag "struct-options"]{More Structure Type Options} -The full syntax of @scheme[struct] supports many options, both +The full syntax of @racket[struct] supports many options, both at the structure-type level and at the level of individual fields: @specform/subs[(struct struct-id maybe-super (field ...) @@ -405,13 +405,13 @@ at the structure-type level and at the level of individual fields: [field field-id [field-id field-option ...]])] -A @scheme[_struct-option] always starts with a keyword: +A @racket[_struct-option] always starts with a keyword: @specspecsubform[#:mutable]{ Causes all fields of the structure to be mutable, and introduces - for each @scheme[_field-id] a @deftech{mutator} - @schemeidfont{set-}@scheme[_struct-id]@schemeidfont{-}@scheme[_field-id]@schemeidfont{!} + for each @racket[_field-id] a @deftech{mutator} + @racketidfont{set-}@racket[_struct-id]@racketidfont{-}@racket[_field-id]@racketidfont{!} that sets the value of the corresponding field in an instance of the structure type. @@ -421,8 +421,8 @@ A @scheme[_struct-option] always starts with a keyword: (set-dot-x! d 10) (dot-x d)] - The @scheme[#:mutable] option can also be used as a - @scheme[_field-option], in which case it makes an individual field + The @racket[#:mutable] option can also be used as a + @racket[_field-option], in which case it makes an individual field mutable. @defexamples[ @@ -436,7 +436,7 @@ A @scheme[_struct-option] always starts with a keyword: in a previous section, @secref["trans-struct"].} @specspecsubform[(code:line #:inspector inspector-expr)]{ - Generalizes @scheme[#:transparent] to support more controlled access + Generalizes @racket[#:transparent] to support more controlled access to reflective operations.} @specspecsubform[(code:line #:prefab)]{ @@ -447,10 +447,10 @@ A @scheme[_struct-option] always starts with a keyword: Specifies a value to be used for all automatic fields in the structure type, where an automatic field is indicated by the - @scheme[#:auto] field option. The constructor procedure does not + @racket[#:auto] field option. The constructor procedure does not accept arguments for automatic fields. Automatic fields are implicitly mutable (via reflective operations), but mutator - functions are bound only if @scheme[#:mutator] is also specified. + functions are bound only if @racket[#:mutator] is also specified. @defexamples[ (struct posn (x y [z #:auto]) @@ -508,7 +508,7 @@ A @scheme[_struct-option] always starts with a keyword: @specspecsubform[(code:line #:property prop-expr val-expr)]{ Associates a @deftech{property} and value with the structure type. - For example, the @scheme[prop:procedure] property allows a + For example, the @racket[prop:procedure] property allows a structure instance to be used as a function; the property value determines how a call is implemented when using the structure as a function. @@ -527,11 +527,11 @@ A @scheme[_struct-option] always starts with a keyword: @specspecsubform[(code:line #:super super-expr)]{ - An alternative to supplying a @scheme[super-id] next to - @scheme[struct-id]. Instead of the name of a structure type (which is - not an expression), @scheme[super-expr] should produce a + An alternative to supplying a @racket[super-id] next to + @racket[struct-id]. Instead of the name of a structure type (which is + not an expression), @racket[super-expr] should produce a @tech{structure type descriptor} value. An advantage of - @scheme[#:super] is that structure type descriptors are values, so + @racket[#:super] is that structure type descriptors are values, so they can be passed to procedures. @defexamples[ diff --git a/collects/scribblings/guide/dialects.scrbl b/collects/scribblings/guide/dialects.scrbl index bd9efb03d9..4e8543d469 100644 --- a/collects/scribblings/guide/dialects.scrbl +++ b/collects/scribblings/guide/dialects.scrbl @@ -93,19 +93,19 @@ Racket tools in their default modes do not conform to @|r5rs|, mainly because Racket tools generally expect modules, and @|r5rs| does not define a module system. Typical single-file @|r5rs| programs can be converted to Racket programs by prefixing them with -@scheme[@#,hash-lang[] @#,schememodname[r5rs]], but other Scheme -systems do not recognize @scheme[@#,hash-lang[] -@#,schememodname[r5rs]]. The @exec{plt-r5rs} executable (see +@racket[@#,hash-lang[] @#,racketmodname[r5rs]], but other Scheme +systems do not recognize @racket[@#,hash-lang[] +@#,racketmodname[r5rs]]. The @exec{plt-r5rs} executable (see @secref[#:doc '(lib "r5rs/r5rs.scrbl") "plt-r5rs"]) more directly conforms to the @|r5rs| standard. Aside from the module system, the syntactic forms and functions of @|r5rs| and Racket differ. Only simple @|r5rs| become Racket -programs when prefixed with @scheme[@#,hash-lang[] racket], and +programs when prefixed with @racket[@#,hash-lang[] racket], and relatively few Racket programs become @|r5rs| programs when a @hash-lang[] line is removed. Also, when mixing ``@|r5rs| modules'' with Racket modules, beware that @|r5rs| pairs correspond to -Racket mutable pairs (as constructed with @scheme[mcons]). +Racket mutable pairs (as constructed with @racket[mcons]). See @other-manual['(lib "r5rs/r5rs.scrbl")] for more information about running @|r5rs| programs with Racket. @@ -118,12 +118,12 @@ which extends @|r5rs| with a module system that is similar to the Racket module system. When an @|r6rs| library or top-level program is prefixed with -@schememetafont{#!}@schememodname[r6rs] (which is valid @|r6rs| +@racketmetafont{#!}@racketmodname[r6rs] (which is valid @|r6rs| syntax), then it can also be used as a Racket program. This works -because @schememetafont{#!} in Racket is treated as a shorthand +because @racketmetafont{#!} in Racket is treated as a shorthand for @hash-lang[] followed by a space, so -@schememetafont{#!}@schememodname[r6rs] selects the -@schememodname[r6rs] module language. As with @|r5rs|, however, beware +@racketmetafont{#!}@racketmodname[r6rs] selects the +@racketmodname[r6rs] module language. As with @|r5rs|, however, beware that the syntactic forms and functions of @|r6rs| differ from Racket, and @|r6rs| pairs are mutable pairs. diff --git a/collects/scribblings/guide/hash-languages.scrbl b/collects/scribblings/guide/hash-languages.scrbl index 39c0e88867..2b27b58b0c 100644 --- a/collects/scribblings/guide/hash-languages.scrbl +++ b/collects/scribblings/guide/hash-languages.scrbl @@ -63,7 +63,7 @@ syntax. Meanwhile, @racketmodname[s-exp] takes care of the @tech{reader}-level responsibilities of a @hash-lang[] language. Unlike @racketmodname[racket], @racketmodname[s-exp] cannot be used as a -module path with @scheme[require]. Although the syntax of +module path with @racket[require]. Although the syntax of @racket[_language] for @hash-lang[] overlaps with the syntax of module paths, a @racket[_language] is not used directly as a module path. Instead, a @racket[_language] is suffixed with @@ -97,7 +97,7 @@ a module path, and the specified module must provide two functions: @racketidfont{read} and @racketidfont{read-syntax}. The protocol is the same as for a @racketmetafont{#reader} implementation, but for @hash-lang[], the @racketidfont{read} and @racketidfont{read-syntax} -functions must produce a @scheme[module] form that is based on the +functions must produce a @racket[module] form that is based on the rest of the input file for the module. The following @filepath{literal.rkt} module implements a language that @@ -259,7 +259,7 @@ information about @|PLaneT| packages.} A better approach may be to distribute your language as a @|PLaneT| package. A drawback of using a @|PLaneT| package is that users must -type @racket[@#,hash-lang[] @#,schememodname[planet]] followed by a +type @racket[@#,hash-lang[] @#,racketmodname[planet]] followed by a @|PLaneT| path to access the language. The great advantages are that the @|PLaneT| package can be installed automatically, it can be versioned, and it co-exists more easily with other packages. @@ -376,7 +376,7 @@ Suppose that the file @filepath{death-list-5.rkt} contains @racketmodfile["death-list-5.rkt"] -If you @scheme[require] @filepath{death-list-5.rkt} directly, then it +If you @racket[require] @filepath{death-list-5.rkt} directly, then it prints the list in the usual Racket result format: @interaction[ @@ -595,7 +595,7 @@ racket With all of the pieces for @racket[literal] in place, try running the following variant of @filepath{tuvalu.rkt} directly and through a -@scheme[require] from another module: +@racket[require] from another module: @racketmod[ #:file "tuvalu.rkt" diff --git a/collects/scribblings/guide/hash-tables.scrbl b/collects/scribblings/guide/hash-tables.scrbl index 5160f4851e..759a4471ca 100644 --- a/collects/scribblings/guide/hash-tables.scrbl +++ b/collects/scribblings/guide/hash-tables.scrbl @@ -6,9 +6,9 @@ A @deftech{hash table} implements a mapping from keys to values, where both keys and values can be arbitrary Scheme values, and access and update to the table are normally constant-time operations. Keys are -compared using @scheme[equal?], @scheme[eqv?], or @scheme[eq?], depending on whether -the hash table is created with @scheme[make-hash], -@scheme[make-hasheqv], or @scheme[make-hasheq]. +compared using @racket[equal?], @racket[eqv?], or @racket[eq?], depending on whether +the hash table is created with @racket[make-hash], +@racket[make-hasheqv], or @racket[make-hasheq]. @examples[ (define ht (make-hash)) @@ -22,7 +22,7 @@ the hash table is created with @scheme[make-hash], The @racket[hash], @racket[hasheqv], and @racket[hasheq] functions create immutable hash tables from an initial set of keys and values, which each value is provided as an argument after its key. Immutable -hash tables can be extended with @scheme[hash-set], which produces a +hash tables can be extended with @racket[hash-set], which produces a new immutable hash table in constant time. @examples[ @@ -34,13 +34,13 @@ new immutable hash table in constant time. ] A literal immutable hash table can be written as an expression by using -@litchar{#hash} (for an @scheme[equal?]-based table), -@litchar{#hasheqv} (for an @scheme[eqv?]-based table), or -@litchar{#hasheq} (for an @scheme[eq?]-based table). A parenthesized +@litchar{#hash} (for an @racket[equal?]-based table), +@litchar{#hasheqv} (for an @racket[eqv?]-based table), or +@litchar{#hasheq} (for an @racket[eq?]-based table). A parenthesized sequence must immediately follow @litchar{#hash}, @litchar{#hasheq}, or @litchar{#hasheqv}, where each element is a dotted key--value pair. The @litchar{#hash}, etc. forms implicitly -@scheme[quote] their key and value sub-forms. +@racket[quote] their key and value sub-forms. @examples[ (define ht #hash(("apple" . red) @@ -53,7 +53,7 @@ key--value pair. The @litchar{#hash}, etc. forms implicitly Both mutable and immutable hash tables print like immutable hash tables, using a quoted @litchar{#hash}, @litchar{#hasheqv}, or @litchar{#hasheq} form if all keys and values can be expressed with -@scheme[quote] or using @racketresult[hash], @racketresult[hasheq], or +@racket[quote] or using @racketresult[hash], @racketresult[hasheq], or @racketresult[hasheqv] otherwise: @examples[ diff --git a/collects/scribblings/guide/io.scrbl b/collects/scribblings/guide/io.scrbl index af0db52d06..765b020113 100644 --- a/collects/scribblings/guide/io.scrbl +++ b/collects/scribblings/guide/io.scrbl @@ -277,7 +277,7 @@ text. In the format string supplied to @racket[printf], @litchar{~a} After using @racket[write], as opposed to @racket[display] or @racket[print], many forms of data can be read back in using @racket[read]. The same values @racket[print]ed can also be parsed by -@scheme[read], but the result may have extra quote forms, since a +@racket[read], but the result may have extra quote forms, since a @racket[print]ed form is meant to be read like an expression. @examples[ diff --git a/collects/scribblings/guide/match.scrbl b/collects/scribblings/guide/match.scrbl index d2c206e894..128755e6d5 100644 --- a/collects/scribblings/guide/match.scrbl +++ b/collects/scribblings/guide/match.scrbl @@ -59,7 +59,7 @@ can be used to create patterns that match pairs, lists, and vectors: [(vector 1 2) 'vector]) ] -A constructor bound with @scheme[struct] also can be used as a pattern +A constructor bound with @racket[struct] also can be used as a pattern constructor: @interaction[ diff --git a/collects/scribblings/guide/module-languages.scrbl b/collects/scribblings/guide/module-languages.scrbl index ec1d875b5c..a4201901c5 100644 --- a/collects/scribblings/guide/module-languages.scrbl +++ b/collects/scribblings/guide/module-languages.scrbl @@ -4,11 +4,11 @@ @title[#:tag "module-languages"]{Module Languages} -When using the longhand @scheme[module] form for writing modules, the +When using the longhand @racket[module] form for writing modules, the module path that is specified after the new module's name provides the initial imports for the module. Since the initial-import module determines even the most basic bindings that are available in a -module's body, such as @scheme[require], the initial import can be +module's body, such as @racket[require], the initial import can be called a @deftech{module language}. The most common @tech{module languages} are @racketmodname[racket] or @@ -67,7 +67,7 @@ The other implicit forms provided by @racket[racket/base] are @interaction[ (module just-lambda racket (provide lambda #%module-begin - (code:comment @#,t{@schemeidfont{ten} needs these, too:}) + (code:comment @#,t{@racketidfont{ten} needs these, too:}) #%app #%datum)) (module ten 'just-lambda ((lambda (x) x) 10)) diff --git a/collects/scribblings/guide/named-let.scrbl b/collects/scribblings/guide/named-let.scrbl index 35a0725d88..d5184b6fbd 100644 --- a/collects/scribblings/guide/named-let.scrbl +++ b/collects/scribblings/guide/named-let.scrbl @@ -1,11 +1,11 @@ #lang scribble/doc @(require scribble/manual scribble/eval "guide-utils.rkt") -@title{Named @scheme[let]} +@title{Named @racket[let]} -A named @scheme[let] is an iteration and recursion form. It uses the -same syntactic keyword @scheme[let] as for local binding, but an -identifier after the @scheme[let] (instead of an immediate open +A named @racket[let] is an iteration and recursion form. It uses the +same syntactic keyword @racket[let] as for local binding, but an +identifier after the @racket[let] (instead of an immediate open parenthesis) triggers a different parsing. @specform[ @@ -13,15 +13,15 @@ parenthesis) triggers a different parsing. _body ...+) ] -A named @scheme[let] form is equivalent to +A named @racket[let] form is equivalent to -@schemeblock[ +@racketblock[ (letrec ([_proc-id (lambda (_arg-id ...) _body ...+)]) (_proc-id _init-expr ...)) ] -That is, a named @scheme[let] binds a function identifier that is +That is, a named @racket[let] binds a function identifier that is visible only in the function's body, and it implicitly calls the function with the values of some initial expressions. diff --git a/collects/scribblings/guide/pairs.scrbl b/collects/scribblings/guide/pairs.scrbl index 974bd90545..48fd6e309c 100644 --- a/collects/scribblings/guide/pairs.scrbl +++ b/collects/scribblings/guide/pairs.scrbl @@ -3,10 +3,10 @@ @title[#:tag "pairs"]{Pairs and Lists} -A @deftech{pair} joins two arbitrary values. The @scheme[cons] -procedure constructs pairs, and the @scheme[car] and @scheme[cdr] +A @deftech{pair} joins two arbitrary values. The @racket[cons] +procedure constructs pairs, and the @racket[car] and @racket[cdr] procedures extract the first and second elements of the pair, -respectively. The @scheme[pair?] predicate recognizes pairs. +respectively. The @racket[pair?] predicate recognizes pairs. Some pairs print by wrapping parentheses around the printed forms of the two pair elements, putting a @litchar{'} at the beginning and a @@ -21,10 +21,10 @@ the two pair elements, putting a @litchar{'} at the beginning and a ] A @deftech{list} is a combination of pairs that creates a linked -list. More precisely, a list is either the empty list @scheme[null], +list. More precisely, a list is either the empty list @racket[null], or it is a pair whose first element is a list element and whose second -element is a list. The @scheme[list?] predicate recognizes lists. The -@scheme[null?] predicate recognizes the empty list. +element is a list. The @racket[list?] predicate recognizes lists. The +@racket[null?] predicate recognizes the empty list. A list normally prints as a @litchar{'} followed by a pair of parentheses wrapped around the list elements. @@ -37,10 +37,10 @@ null (list? (cons 1 2)) ] -A list or pair prints using @schemeresult[list] or @schemeresult[cons] -when one of its elements cannot be written as a @scheme[quote]d +A list or pair prints using @racketresult[list] or @racketresult[cons] +when one of its elements cannot be written as a @racket[quote]d value. For example, a value constructed with @racket[srcloc] cannot be -written using @scheme[quote], and it prints using @racketresult[srcloc]: +written using @racket[quote], and it prints using @racketresult[srcloc]: @interaction[ (srcloc "file.rkt" 1 0 1 (+ 4 4)) @@ -51,14 +51,14 @@ written using @scheme[quote], and it prints using @racketresult[srcloc]: @margin-note{See also @racket[list*].} -As shown in the last example, @schemeresult[list*] is used to -abbreviate a series of @schemeresult[cons]es that cannot be +As shown in the last example, @racketresult[list*] is used to +abbreviate a series of @racketresult[cons]es that cannot be abbreviated using @racketresult[list]. -The @scheme[write] and @scheme[display] functions print a pair or list -without a leading @litchar{'}, @schemeresult[cons], -@schemeresult[list], or @schemeresult[list*]. There is no difference -between @scheme[write] and @racket[display] for a pair or list, except +The @racket[write] and @racket[display] functions print a pair or list +without a leading @litchar{'}, @racketresult[cons], +@racketresult[list], or @racketresult[list*]. There is no difference +between @racket[write] and @racket[display] for a pair or list, except as they apply to elements of the list: @examples[ @@ -95,12 +95,12 @@ iterate through the list's elements: @refdetails["pairs"]{pairs and lists} -Pairs are immutable (contrary to Lisp tradition), and @scheme[pair?] -and @scheme[list?] recognize immutable pairs and lists, only. The -@scheme[mcons] procedure creates a @deftech{mutable pair}, which works -with @scheme[set-mcar!] and @scheme[set-mcdr!], as well as -@scheme[mcar] and @scheme[mcdr]. A mutable pair prints using -@schemeresult[mcons], while @scheme[write] and @scheme[display] print +Pairs are immutable (contrary to Lisp tradition), and @racket[pair?] +and @racket[list?] recognize immutable pairs and lists, only. The +@racket[mcons] procedure creates a @deftech{mutable pair}, which works +with @racket[set-mcar!] and @racket[set-mcdr!], as well as +@racket[mcar] and @racket[mcdr]. A mutable pair prints using +@racketresult[mcons], while @racket[write] and @racket[display] print mutable pairs with @litchar["{"] and @litchar["}"]: @examples[ diff --git a/collects/scribblings/guide/parameterize.scrbl b/collects/scribblings/guide/parameterize.scrbl index d7133bb33c..c3e92c4392 100644 --- a/collects/scribblings/guide/parameterize.scrbl +++ b/collects/scribblings/guide/parameterize.scrbl @@ -39,10 +39,10 @@ parameter as a function returns its current value: (location) ] -In a @scheme[parameterize] form, each @racket[_parameter-expr] must -produce a parameter. During the evaluation of the @scheme[body]s, each +In a @racket[parameterize] form, each @racket[_parameter-expr] must +produce a parameter. During the evaluation of the @racket[body]s, each specified parameter is given the result of the corresponding -@scheme[_value-expr]. When control leaves the @racket[parameterize] +@racket[_value-expr]. When control leaves the @racket[parameterize] form---either through a normal return, an exception, or some other escape---the parameter reverts to its earlier value: @@ -61,11 +61,11 @@ escape---the parameter reverts to its earlier value: (location) ] -The @scheme[parameterize] form is not a binding form like -@scheme[let]; each use of @racket[location] above refers directly to -the original definition. A @scheme[parameterize] form adjusts the +The @racket[parameterize] form is not a binding form like +@racket[let]; each use of @racket[location] above refers directly to +the original definition. A @racket[parameterize] form adjusts the value of a parameter during the whole time that the -@scheme[parameterize] body is evaluated, even for uses of the +@racket[parameterize] body is evaluated, even for uses of the parameter that are textually outside of the @racket[parameterize] body: @@ -113,8 +113,8 @@ associated with the active @racket[parameterize]: Using @racket[parameterize] is generally preferable to updating a parameter value imperatively---for much the same reasons that binding -a fresh variable with @scheme[let] is preferable to using -@scheme[set!] (see @secref["set!"]). +a fresh variable with @racket[let] is preferable to using +@racket[set!] (see @secref["set!"]). It may seem that variables and @racket[set!] can solve many of the same problems that parameters solve. For example, @racket[lokation] @@ -134,14 +134,14 @@ to adjust its value: ] Parameters, however, offer several crucial advantages over -@scheme[set!]: +@racket[set!]: @itemlist[ @item{The @racket[parameterize] form helps automatically reset the value of a parameter when control escapes due to an exception. Adding exception handlers and other forms to rewind a - @scheme[set!] is relatively tedious.} + @racket[set!] is relatively tedious.} @item{Parameters work nicely with tail calls (see @secref["tail-recursion"]). The last @racket[_body] in a @@ -149,7 +149,7 @@ Parameters, however, offer several crucial advantages over respect to the @racket[parameterize] form.} @item{Parameters work properly with threads (see - @refsecref["threads"]). The @scheme[parameterize] form adjusts + @refsecref["threads"]). The @racket[parameterize] form adjusts the value of a parameter only for evaluation in the current thread, which avoids race conditions with other threads.} diff --git a/collects/scribblings/guide/paths.scrbl b/collects/scribblings/guide/paths.scrbl index b23713018c..c9b87eef7d 100644 --- a/collects/scribblings/guide/paths.scrbl +++ b/collects/scribblings/guide/paths.scrbl @@ -16,7 +16,7 @@ Despite the occasional encoding problems, most paths can be converted to and from strings. Thus, procedures that accept a path argument always accept a string, and the printed form of a path uses the string decoding of the path inside @litchar{#}. The -@scheme[display] form of a path is the same as the @scheme[display] +@racket[display] form of a path is the same as the @racket[display] form of its string encodings. @examples[ @@ -41,11 +41,11 @@ meanings. @refdetails/gory["windows-path"]{Windows filesystem paths} -Use procedures like @scheme[split-path] and @scheme[build-path] to +Use procedures like @racket[split-path] and @racket[build-path] to deconstruct and construct paths. When you must manipulate the name of a specific path element (i.e., a file or directory component in a -path), use procedures like @scheme[path-element->bytes] and -@scheme[bytes->path-element]. +path), use procedures like @racket[path-element->bytes] and +@racket[bytes->path-element]. @examples[ (build-path "easy" "file.rkt") diff --git a/collects/scribblings/guide/ports.scrbl b/collects/scribblings/guide/ports.scrbl index 15a4525208..aba2f39f5c 100644 --- a/collects/scribblings/guide/ports.scrbl +++ b/collects/scribblings/guide/ports.scrbl @@ -11,7 +11,7 @@ For many procedures that accept a port argument, the argument is optional, and it defaults to either the @defterm{current input port} or @defterm{current output port}. For @exec{mzscheme}, the current ports are initialized to the process's stdin and stdout. The -@scheme[current-input-port] and @scheme[current-output-port] +@racket[current-input-port] and @racket[current-output-port] procedures, when called with no arguments, return the current output and input port, respectively. @@ -21,9 +21,9 @@ and input port, respectively. ] Ports are created by various procedures that specific to the different -kinds of streams. For example, @scheme[open-input-file] creates an +kinds of streams. For example, @racket[open-input-file] creates an input port for reading from a file. Procedures like -@scheme[with-input-from-file] both create a port and install it as the +@racket[with-input-from-file] both create a port and install it as the current port while calling a given body procedure. See @secref["io"] for information about using ports. diff --git a/collects/scribblings/guide/vectors.scrbl b/collects/scribblings/guide/vectors.scrbl index 68faae2715..1d71aa8acc 100644 --- a/collects/scribblings/guide/vectors.scrbl +++ b/collects/scribblings/guide/vectors.scrbl @@ -9,7 +9,7 @@ update of its elements. A vector prints similar to a list---as a parenthesized sequence of its elements---but a vector is prefixed with @litchar{#} after -@litchar{'}, or it uses @schemeresult[vector] if one of its elements +@litchar{'}, or it uses @racketresult[vector] if one of its elements cannot be expressed with @racket[quote]. For a vector as an expression, an optional length can be diff --git a/collects/scribblings/honu/honu.scrbl b/collects/scribblings/honu/honu.scrbl index 330f6917dd..974f2a3792 100644 --- a/collects/scribblings/honu/honu.scrbl +++ b/collects/scribblings/honu/honu.scrbl @@ -25,11 +25,11 @@ independent of the Honu language, however, so it is documented here. The Racket reader incorporates an H-expression reader, and Racket's printer also supports printing values in Honu syntax. The reader can be put into H-expression mode either by including @litchar{#hx} in the -input stream, or by calling @scheme[read-honu] or -@scheme[read-honu-syntax] instead of @scheme[read] or -@scheme[read-syntax]. Similarly, @scheme[print] (or, more precisely, +input stream, or by calling @racket[read-honu] or +@racket[read-honu-syntax] instead of @racket[read] or +@racket[read-syntax]. Similarly, @racket[print] (or, more precisely, the default print handler) produces Honu output when the -@scheme[print-honu] parameter is set to @scheme[#t]. +@racket[print-honu] parameter is set to @racket[#t]. When the reader encounters @litchar{#hx}, it reads a single H-expression, and it produces an S-expression that encodes the @@ -75,7 +75,7 @@ Within a sequence of H-expressions, a sub-sequence between angle brackets is represented specially (see @secref["honu:parens"]). Whitespace for H-expressions is as in Racket: any character for which -@scheme[char-whitespace?] returns true counts as a whitespace. +@racket[char-whitespace?] returns true counts as a whitespace. @; ---------------------------------------------------------------------- @@ -105,8 +105,8 @@ Racket symbol. Input is parsed to form maximally long identifiers. For example, the input @litchar{int->int;} is parsed as four H-expressions represented -by symbols: @scheme['int], @scheme['->], @scheme['int], and -@scheme['|;|]. +by symbols: @racket['int], @racket['->], @racket['int], and +@racket['|;|]. @; ---------------------------------------------------------------------- @@ -132,9 +132,9 @@ obvious Racket character. A H-expression between @litchar{(} and @litchar{)}, @litchar{[} and @litchar{]}, or @litchar["{"] and @litchar["}"] is represented by a -Racket list. The first element of the list is @scheme['#%parens] for a -@litchar{(}...@litchar{)} sequence, @scheme['#%brackets] for a -@litchar{[}...@litchar{]} sequence, or @scheme['#%braces] for a +Racket list. The first element of the list is @racket['#%parens] for a +@litchar{(}...@litchar{)} sequence, @racket['#%brackets] for a +@litchar{[}...@litchar{]} sequence, or @racket['#%braces] for a @litchar["{"]...@litchar["}"] sequence. The remaining elements are the Racket representations for the grouped H-expressions in order. @@ -142,7 +142,7 @@ In an H-expression sequence, when a @litchar{<} is followed by a @litchar{>}, and when nothing between the @litchar{<} and @litchar{>} is an immediate symbol containing a @litchar{=}, @litchar{&}, or @litchar{|}, then the sub-sequence is represented by a Racket list -that starts with @scheme['#%angles] and continues with the elements of +that starts with @racket['#%angles] and continues with the elements of the sub-sequence between the @litchar{<} and @litchar{>} (exclusive). This representation is applied recursively, so that angle brackets can be nested. @@ -177,11 +177,11 @@ is followed by an H-expression to be treated as whitespace. Note that Some Racket values have a standard H-expression representation. For values with no H-expression representation but with a -@scheme[read]able S-expression form, the Racket printer produces an +@racket[read]able S-expression form, the Racket printer produces an S-expression prefixed with @litchar{#sx}. For values with neither an -H-expression form nor a @scheme[read]able S-expression form, then +H-expression form nor a @racket[read]able S-expression form, then printer produces output of the form @litchar{#<}...@litchar{>}, as in -Racket mode. The @scheme[print-honu] parameter controls whether +Racket mode. The @racket[print-honu] parameter controls whether Racket's printer produces Racket or Honu output. The values with H-expression forms are as follows: @@ -191,7 +191,7 @@ The values with H-expression forms are as follows: @item{Every real number has an H-expression form, although the representation for an exact, non-integer rational number is actually three H-expressions, where the middle H-expression is - @scheme[/].} + @racket[/].} @item{Every character string is represented the same in H-expression form as its S-expression form.} @@ -214,11 +214,11 @@ The values with H-expression forms are as follows: the pair elements.} @item{A vector's representation depends on the value of the - @scheme[print-vector-length] parameter. If it is @scheme[#f], + @racket[print-vector-length] parameter. If it is @racket[#f], the vector is represented with the H-expression sequence @litchar{vectorN(}@nonterm{v}@|lcomma|...@litchar{)}, where each @nonterm{v} is the representation of each element of the - vector. If @scheme[print-vector-length] is set to @scheme[#t], + vector. If @racket[print-vector-length] is set to @racket[#t], the vector is represented with the H-expression sequence @litchar{vectorN(}@nonterm{n}@|lcomma|@nonterm{v}@|lcomma|...@litchar{)}, where @nonterm{n} is the length of the vector and each diff --git a/collects/scribblings/htdp-langs/advanced.scrbl b/collects/scribblings/htdp-langs/advanced.scrbl index 911e222812..fa5d90551a 100644 --- a/collects/scribblings/htdp-langs/advanced.scrbl +++ b/collects/scribblings/htdp-langs/advanced.scrbl @@ -39,7 +39,7 @@ @declare-exporting[lang/htdp-advanced] -@schemegrammar*+qq[ +@racketgrammar*+qq[ #:literals (define define-struct define-datatype lambda λ cond else if and or empty true false require lib planet local let let* letrec time begin begin0 set! delay shared recur when case match unless ; match @@ -85,8 +85,8 @@ empty (code:line id (code:comment @#,seclink["intermediate-id"]{identifier})) (code:line prim-op (code:comment @#,seclink["advanced-prim-ops"]{primitive operation})) - (code:line @#,elem{@schemevalfont{'}@scheme[_quoted]} (code:comment @#,seclink["beginner-abbr-quote"]{quoted value})) - (code:line @#,elem{@schemevalfont{`}@scheme[_quasiquoted]} (code:comment @#,seclink["beginner-abbr-quasiquote"]{quasiquote})) + (code:line @#,elem{@racketvalfont{'}@racket[_quoted]} (code:comment @#,seclink["beginner-abbr-quote"]{quoted value})) + (code:line @#,elem{@racketvalfont{`}@racket[_quasiquoted]} (code:comment @#,seclink["beginner-abbr-quasiquote"]{quasiquote})) number true @@ -103,8 +103,8 @@ false string character - @#,elem{@schemevalfont{'}@scheme[_quoted]} - @#,elem{@schemevalfont{`}@scheme[_quasiquoted-pattern]} + @#,elem{@racketvalfont{'}@racket[_quoted]} + @#,elem{@racketvalfont{`}@racket[_quasiquoted-pattern]} (cons pattern pattern) (list pattern ...) (list* pattern ...) @@ -116,10 +116,10 @@ string character (quasiquoted-pattern ...) - @#,elem{@schemevalfont{'}@scheme[_quasiquoted-pattern]} - @#,elem{@schemevalfont{`}@scheme[_quasiquoted-pattern]} - @#,elem{@schemefont[","]@scheme[_pattern]} - @#,elem{@schemefont[",@"]@scheme[_pattern]}] + @#,elem{@racketvalfont{'}@racket[_quasiquoted-pattern]} + @#,elem{@racketvalfont{`}@racket[_quasiquoted-pattern]} + @#,elem{@racketfont[","]@racket[_pattern]} + @#,elem{@racketfont[",@"]@racket[_pattern]}] ] @|prim-nonterms| @@ -128,7 +128,7 @@ @; ---------------------------------------------------------------------- -@section[#:tag "advanced-define"]{@scheme[define]} +@section[#:tag "advanced-define"]{@racket[define]} @deftogether[( @defform[(define (id id ...) expr)] @@ -141,7 +141,7 @@ function is allowed to accept zero arguments.} @; ---------------------------------------------------------------------- -@section[#:tag "advanced-define-struct"]{@scheme[define-struct]} +@section[#:tag "advanced-define-struct"]{@racket[define-struct]} @defform[(define-struct structid (fieldid ...))]{ @@ -150,7 +150,7 @@ additional set of operations: @itemize[ - @item{@schemeidfont{set-}@scheme[structid]@schemeidfont{-}@scheme[fieldid]@schemeidfont{!} + @item{@racketidfont{set-}@racket[structid]@racketidfont{-}@racket[fieldid]@racketidfont{!} : takes an instance of the structure and a value, and changes the instance's field to the given value.} @@ -158,27 +158,27 @@ additional set of operations: @; ---------------------------------------------------------------------- -@section[#:tag "advanced-define-datatype"]{@scheme[define-datatype]} +@section[#:tag "advanced-define-datatype"]{@racket[define-datatype]} @defform[(define-datatype datatypeid [variantid fieldid ...] ...)]{ - -A short-hand for defining a group of related structures. A @scheme[define-datatype] form -@schemeblock[ + +A short-hand for defining a group of related structures. A @racket[define-datatype] form +@racketblock[ (define-datatype datatypeid - [variantid fieldid (unsyntax @schemeidfont{...})] - (unsyntax @schemeidfont{...})) + [variantid fieldid (unsyntax @racketidfont{...})] + (unsyntax @racketidfont{...})) ] is equivalent to -@schemeblock[ - (define ((unsyntax @scheme[datatypeid])? x) - (or ((unsyntax @scheme[variantid])? x) (unsyntax @schemeidfont{...}))) - (define-struct variantid (fieldid (unsyntax @schemeidfont{...}))) - (unsyntax @schemeidfont{...}) +@racketblock[ + (define ((unsyntax @racket[datatypeid])? x) + (or ((unsyntax @racket[variantid])? x) (unsyntax @racketidfont{...}))) + (define-struct variantid (fieldid (unsyntax @racketidfont{...}))) + (unsyntax @racketidfont{...}) ]} @; ---------------------------------------------------------------------- -@section[#:tag "advanced-lambda"]{@scheme[lambda]} +@section[#:tag "advanced-lambda"]{@racket[lambda]} @deftogether[( @defform[(lambda (id ...) expr)] @@ -200,161 +200,163 @@ arguments are allowed.} @defform[(#%app expr expr ...)]{ -A function call can be written with @scheme[#%app], though it's +A function call can be written with @racket[#%app], though it's practically never written that way.} @; ---------------------------------------------------------------------- -@section{@scheme[begin]} +@section{@racket[begin]} @defform[(begin expr expr ...)]{ -Evaluates the @scheme[expr]s in order from left to right. The value of -the @scheme[begin] expression is the value of the last @scheme[expr].} +Evaluates the @racket[expr]s in order from left to right. The value of +the @racket[begin] expression is the value of the last @racket[expr].} @; ---------------------------------------------------------------------- -@section{@scheme[begin0]} +@section{@racket[begin0]} @defform[(begin0 expr expr ...)]{ -Evaluates the @scheme[expr]s in order from left to right. The value of -the @scheme[begin] expression is the value of the first @scheme[expr].} +Evaluates the @racket[expr]s in order from left to right. The value of +the @racket[begin] expression is the value of the first @racket[expr].} @; ---------------------------------------------------------------------- -@section{@scheme[set!]} +@section{@racket[set!]} @defform[(set! id expr)]{ -Evaluates @scheme[expr], and then changes the definition @scheme[id] -to have @scheme[expr]'s value. The @scheme[id] must be defined or -bound by @scheme[letrec], @scheme[let], or @scheme[let*].} +Evaluates @racket[expr], and then changes the definition @racket[id] +to have @racket[expr]'s value. The @racket[id] must be defined or +bound by @racket[letrec], @racket[let], or @racket[let*].} @; ---------------------------------------------------------------------- -@section{@scheme[delay]} +@section{@racket[delay]} @defform[(delay expr)]{ -Produces a ``promise'' to evaluate @scheme[expr]. The @scheme[expr] is -not evaluated until the promise is forced through the @scheme[force] +Produces a ``promise'' to evaluate @racket[expr]. The @racket[expr] is +not evaluated until the promise is forced through the @racket[force] operator; when the promise is forced, the result is recorded, so that -any further @scheme[force] of the promise always produces the +any further @racket[force] of the promise always produces the remembered value.} @; ---------------------------------------------------------------------- -@section{@scheme[shared]} +@section{@racket[shared]} @defform[(shared ([id expr] ...) expr)]{ -Like @scheme[letrec], but when an @scheme[expr] next to an @scheme[id] -is a @scheme[cons], @scheme[list], @scheme[vector], quasiquoted -expression, or @schemeidfont{make-}@scheme[_structid] from a -@scheme[define-struct], the @scheme[expr] can refer directly to any -@scheme[id], not just @scheme[id]s defined earlier. Thus, -@scheme[shared] can be used to create cyclic data structures.} +Like @racket[letrec], but when an @racket[expr] next to an @racket[id] +is a @racket[cons], @racket[list], @racket[vector], quasiquoted +expression, or @racketidfont{make-}@racket[_structid] from a +@racket[define-struct], the @racket[expr] can refer directly to any +@racket[id], not just @racket[id]s defined earlier. Thus, +@racket[shared] can be used to create cyclic data structures.} @; ---------------------------------------------------------------------- -@section[#:tag "advanced-let"]{@scheme[let]} +@section[#:tag "advanced-let"]{@racket[let]} @defform*[[(let ([id expr] ...) expr) (let id ([id expr] ...) expr)]]{ -The first form of @scheme[let] is the same as Intermediate's +The first form of @racket[let] is the same as Intermediate's @|intm-let|. -The second form is equivalent to a @scheme[recur] form.} +The second form is equivalent to a @racket[recur] form.} @; ---------------------------------------------------------------------- -@section{@scheme[recur]} +@section{@racket[recur]} @defform[(recur id ([id expr] ...) expr)]{ -A short-hand recursion construct. The first @scheme[id] corresponds to -the name of the recursive function. The parenthesized @scheme[id]s are -the function's arguments, and each corresponding @scheme[expr] is a +A short-hand recursion construct. The first @racket[id] corresponds to +the name of the recursive function. The parenthesized @racket[id]s are +the function's arguments, and each corresponding @racket[expr] is a value supplied for that argument in an initial starting call of the -function. The last @scheme[expr] is the body of the function. +function. The last @racket[expr] is the body of the function. -More precisely, a @scheme[recur] form +More precisely, a @racket[recur] form -@schemeblock[ -(recur func-id ([arg-id arg-expr] (unsyntax @schemeidfont{...})) +@racketblock[ +(recur func-id ([arg-id arg-expr] (unsyntax @racketidfont{...})) body-expr) ] is equivalent to -@schemeblock[ -((local [(define (func-id arg-id (unsyntax @schemeidfont{...})) +@racketblock[ +((local [(define (func-id arg-id (unsyntax @racketidfont{...})) body-expr)] func-id) - arg-expr (unsyntax @schemeidfont{...})) + arg-expr (unsyntax @racketidfont{...})) ]} @; ---------------------------------------------------------------------- -@section{@scheme[case]} +@section{@racket[case]} @defform[(case expr [(choice ...) expr] ... [(choice ...) expr])]{ -A @scheme[case] form contains one or more ``lines'' that are +A @racket[case] form contains one or more ``lines'' that are surrounded by parentheses or square brackets. Each line contains a sequence of choices---numbers and names for symbols---and an answer -@scheme[expr]. The initial @scheme[expr] is evaluated, and the +@racket[expr]. The initial @racket[expr] is evaluated, and the resulting value is compared to the choices in each line, where the lines are considered in order. The first line that contains a matching -choice provides an answer @scheme[expr] whose value is the result of -the whole @scheme[case] expression. If none of the lines contains a +choice provides an answer @racket[expr] whose value is the result of +the whole @racket[case] expression. If none of the lines contains a matching choice, it is an error.} @defform/none[#:literals (case else) (case expr [(choice ...) expr] ... [else expr])]{ -This form of @scheme[case] is similar to the prior one, except that -the final @scheme[else] clause is always taken if no prior line -contains a choice matching the value of the initial @scheme[expr]. In +This form of @racket[case] is similar to the prior one, except that +the final @racket[else] clause is always taken if no prior line +contains a choice matching the value of the initial @racket[expr]. In other words, so there is no possibility to ``fall off the end'' of -the @scheme[case] form.}@; ---------------------------------------------------------------------- +the @racket[case] form.} -@section{@scheme[match]} +@; ---------------------------------------------------------------------- + +@section{@racket[match]} @defform[(match expr [pattern expr] ...)]{ - -A @scheme[match] form contains one or more ``lines'' that are + +A @racket[match] form contains one or more ``lines'' that are surrounded by parentheses or square brackets. Each line contains a -pattern---a description of a value---and an answer @scheme[expr]. -The initial @scheme[expr] is evaluated, and the resulting value +pattern---a description of a value---and an answer @racket[expr]. +The initial @racket[expr] is evaluated, and the resulting value is matched against the pattern in each line, where the lines are considered in order. The first line that contains a matching pattern -provides an answer @scheme[expr] whose value is the result of the -whole @scheme[match] expression. This @scheme[expr] may reference +provides an answer @racket[expr] whose value is the result of the +whole @racket[match] expression. This @racket[expr] may reference identifiers bound in the matching pattern. If none of the lines contains a matching pattern, it is an error.} @; ---------------------------------------------------------------------- -@section{@scheme[when] and @scheme[unless]} +@section{@racket[when] and @racket[unless]} @defform[(when expr expr)]{ -The first @scheme[expr] (known as the ``test'' expression) is -evaluated. If it evaluates to @scheme[true], the result of the -@scheme[when] expression is the result of evaluating the second -@scheme[expr], otherwise the result is @scheme[(void)] and the second -@scheme[expr] is not evaluated. If the result of evaluating the test -@scheme[expr] is neither @scheme[true] nor @scheme[false], it is an +The first @racket[expr] (known as the ``test'' expression) is +evaluated. If it evaluates to @racket[true], the result of the +@racket[when] expression is the result of evaluating the second +@racket[expr], otherwise the result is @racket[(void)] and the second +@racket[expr] is not evaluated. If the result of evaluating the test +@racket[expr] is neither @racket[true] nor @racket[false], it is an error.} @defform[(unless expr expr)]{ -Like @scheme[when], but the second @scheme[expr] is evaluated when the -first @scheme[expr] produces @scheme[false] instead of @scheme[true].} +Like @racket[when], but the second @racket[expr] is evaluated when the +first @racket[expr] produces @racket[false] instead of @racket[true].} @; ---------------------------------------- @@ -381,8 +383,8 @@ The same as Intermediate's @|intm-local|, @|intm-letrec|, and @defidform[else] )]{ -The same as Beginning's @|beg-cond|, except that @scheme[else] can be -used with @scheme[case].} +The same as Beginning's @|beg-cond|, except that @racket[else] can be +used with @racket[case].} diff --git a/collects/scribblings/htdp-langs/beginner-abbr.scrbl b/collects/scribblings/htdp-langs/beginner-abbr.scrbl index 651d7f85da..aacbb9ad5b 100644 --- a/collects/scribblings/htdp-langs/beginner-abbr.scrbl +++ b/collects/scribblings/htdp-langs/beginner-abbr.scrbl @@ -20,7 +20,7 @@ @declare-exporting[lang/htdp-beginner-abbr] -@schemegrammar*+qq[ +@racketgrammar*+qq[ #:literals (define define-struct lambda cond else if and or empty true false require lib planet check-expect check-within check-error) (check-expect check-within check-error require) @@ -42,8 +42,8 @@ (or expr expr expr ...) empty id - (code:line @#,elem{@schemevalfont{'}@scheme[_quoted]} (code:comment @#,seclink["beginner-abbr-quote"]{quoted value})) - (code:line @#,elem{@schemevalfont{`}@scheme[_quasiquoted]} (code:comment @#,seclink["beginner-abbr-quasiquote"]{quasiquote})) + (code:line @#,elem{@racketvalfont{'}@racket[_quoted]} (code:comment @#,seclink["beginner-abbr-quote"]{quoted value})) + (code:line @#,elem{@racketvalfont{`}@racket[_quasiquoted]} (code:comment @#,seclink["beginner-abbr-quasiquote"]{quasiquote})) number true false @@ -60,22 +60,22 @@ @section[#:tag "beginner-abbr-quote"]{Quote} @deftogether[( -@defform/none[(unsyntax @elem{@schemevalfont{'}@scheme[quoted]})] +@defform/none[(unsyntax @elem{@racketvalfont{'}@racket[quoted]})] @defform[(quote quoted)] )]{ Creates symbols and abbreviates nested lists. Normally, this form is written with a @litchar{'}, like -@scheme['(apple banana)], but it can also be written with @scheme[quote], like -@scheme[(@#,scheme[quote] (apple banana))].} +@racket['(apple banana)], but it can also be written with @racket[quote], like +@racket[(@#,racket[quote] (apple banana))].} @; ---------------------------------------- @section[#:tag "beginner-abbr-quasiquote"]{Quasiquote} @deftogether[( -@defform/none[(unsyntax @elem{@schemevalfont{`}@scheme[quasiquoted]})] +@defform/none[(unsyntax @elem{@racketvalfont{`}@racket[quasiquoted]})] @defform[(quasiquote quasiquoted)] )]{ @@ -83,34 +83,34 @@ Creates symbols and abbreviates nested lists, but also allows escaping to expression ``unquotes.'' Normally, this form is written with a backquote, @litchar{`}, like -@scheme[`(apple ,(+ 1 2))], but it can also be written with -@scheme[quasiquote], like -@scheme[(@#,scheme[quasiquote] (apple ,(+ 1 2)))].} +@racket[`(apple ,(+ 1 2))], but it can also be written with +@racket[quasiquote], like +@racket[(@#,racket[quasiquote] (apple ,(+ 1 2)))].} @deftogether[( -@defform/none[(unsyntax @elem{@schemevalfont{,}@scheme[quasiquoted]})] +@defform/none[(unsyntax @elem{@racketvalfont{,}@racket[quasiquoted]})] @defform[(unquote expr)] )]{ -Under a single quasiquote, @schemefont{,}@scheme[expr] escapes from +Under a single quasiquote, @racketfont{,}@racket[expr] escapes from the quote to include an evaluated expression whose result is inserted into the abbreviated list. -Under multiple quasiquotes, @schemefont{,}@scheme[expr] is really -@schemefont{,}@scheme[quasiquoted], decrementing the quasiquote count -by one for @scheme[quasiquoted]. +Under multiple quasiquotes, @racketfont{,}@racket[expr] is really +@racketfont{,}@racket[quasiquoted], decrementing the quasiquote count +by one for @racket[quasiquoted]. Normally, an unquote is written with @litchar{,}, but it can also be -written with @scheme[unquote].} +written with @racket[unquote].} @deftogether[( -@defform/none[(unsyntax @elem{@schemevalfont[",@"]@scheme[quasiquoted]})] +@defform/none[(unsyntax @elem{@racketvalfont[",@"]@racket[quasiquoted]})] @defform[(unquote-splicing expr)] )]{ -Under a single quasiquote, @schemefont[",@"]@scheme[expr] escapes from +Under a single quasiquote, @racketfont[",@"]@racket[expr] escapes from the quote to include an evaluated expression whose result is a list to splice into the abbreviated list. @@ -118,7 +118,7 @@ Under multiple quasiquotes, a splicing unquote is like an unquote; that is, it decrements the quasiquote count by one. Normally, a splicing unquote is written with @litchar{,}, but it can -also be written with @scheme[unquote-splicing].} +also be written with @racket[unquote-splicing].} @; ---------------------------------------- diff --git a/collects/scribblings/htdp-langs/beginner.scrbl b/collects/scribblings/htdp-langs/beginner.scrbl index 35626566c5..683dafdeec 100644 --- a/collects/scribblings/htdp-langs/beginner.scrbl +++ b/collects/scribblings/htdp-langs/beginner.scrbl @@ -7,7 +7,7 @@ @declare-exporting[lang/htdp-beginner #:use-sources (lang/htdp-beginner lang/private/teachprims)] -@schemegrammar*+library[ +@racketgrammar*+library[ #:literals (define define-struct lambda cond else if and or empty true false require lib planet check-expect check-within check-error) (check-expect check-within check-error require) @@ -30,7 +30,7 @@ empty id (code:line id (code:comment @#,seclink["beginner-id"]{identifier})) - (code:line @#,elem{@schemevalfont{'}@scheme[id]} (code:comment @#,seclink["beginner-quote"]{symbol})) + (code:line @#,elem{@racketvalfont{'}@racket[id]} (code:comment @#,seclink["beginner-quote"]{symbol})) number true false @@ -44,64 +44,64 @@ @; ---------------------------------------------------------------------- -@section{@scheme[define]} +@section{@racket[define]} @defform[(define (id id id ...) expr)]{ -Defines a function. The first @scheme[id] inside the parentheses is -the name of the function. All remaining @scheme[id]s are the names of -the function's arguments. The @scheme[expr] is the body of the +Defines a function. The first @racket[id] inside the parentheses is +the name of the function. All remaining @racket[id]s are the names of +the function's arguments. The @racket[expr] is the body of the function, evaluated whenever the function is called. The name of the function cannot be that of a primitive or another definition.} @defform/none[#:literals (define) (define id expr)]{ -Defines a constant @scheme[id] as a synonym for the value produced by -@scheme[expr]. The defined name cannot be that of a primitive or -another definition, and @scheme[id] itself must not appear in -@scheme[expr].} +Defines a constant @racket[id] as a synonym for the value produced by +@racket[expr]. The defined name cannot be that of a primitive or +another definition, and @racket[id] itself must not appear in +@racket[expr].} @defform/none[#:literals (define lambda) (define id (lambda (id id ...) expr))]{ -An alternate form for defining functions. The first @scheme[id] is the -name of the function. The @scheme[id]s in parentheses are the names of -the function's arguments, and the @scheme[expr] is the body of the +An alternate form for defining functions. The first @racket[id] is the +name of the function. The @racket[id]s in parentheses are the names of +the function's arguments, and the @racket[expr] is the body of the function, which evaluated whenever the function is called. The name of the function cannot be that of a primitive or another definition.} @defidform[lambda]{ -The @scheme[lambda] keyword can only be used with @scheme[define] in +The @racket[lambda] keyword can only be used with @racket[define] in the alternative function-definition syntax.} @; ---------------------------------------------------------------------- -@section{@scheme[define-struct]} +@section{@racket[define-struct]} @defform[(define-struct structid (fieldid ...))]{ Define a new type of structure. The structure's fields are named by -the @scheme[fieldid]s in parentheses. After evaluation of a +the @racket[fieldid]s in parentheses. After evaluation of a define-struct form, a set of new primitives is available for creation, extraction, and type-like queries: @itemize[ - @item{@schemeidfont{make-}@scheme[structid] : takes a number of + @item{@racketidfont{make-}@racket[structid] : takes a number of arguments equal to the number of fields in the structure type, and creates a new instance of the structure type.} - @item{@scheme[structid]@schemeidfont{-}@scheme[fieldid] : takes an + @item{@racket[structid]@racketidfont{-}@racket[fieldid] : takes an instance of the structure and returns the field named by - @scheme[structid].} + @racket[structid].} - @item{@scheme[structid]@schemeidfont{?} : takes any value, and returns - @scheme[true] if the value is an instance of the structure type.} + @item{@racket[structid]@racketidfont{?} : takes any value, and returns + @racket[true] if the value is an instance of the structure type.} - @item{@scheme[structid] : an identifier representing the structure + @item{@racket[structid] : an identifier representing the structure type, but never used directly.} ] @@ -110,20 +110,20 @@ The created names must not be the same as a primitive or another defined name.} @; ---------------------------------------------------------------------- @;{ ------- COMMENTED OUT FOR NOW --------- -@section{@scheme[define-wish]} +@section{@racket[define-wish]} + +@defform[(define-wish id)]{ -@defform[(define-wish id)]{ - Defines a function named @racket[id] that we wish exists but have not implemented yet. The name of the function cannot be that of a primitive or another definition. -The wished-for function can be called with one argument: @scheme[(id _expr)]. +The wished-for function can be called with one argument: @racket[(id _expr)]. Wished-for functions are reported in the test report for the current program.} @defform/none[#:literals (define-wish) (define-wish id expr)]{ Similar to the above form, defines a wished-for function named @racket[id]. If the -wished-for function is called with one value, the result of @scheme[expr] is +wished-for function is called with one value, the result of @racket[expr] is returned as the default value. } } @; ---------------------------------------------------------------------- @@ -132,17 +132,17 @@ returned as the default value. } @defform/none[(id expr expr ...)]{ -Calls a function. The @scheme[id] must refer to a defined function, -and the @scheme[expr]s are evaluated from left to right to produce the +Calls a function. The @racket[id] must refer to a defined function, +and the @racket[expr]s are evaluated from left to right to produce the values that are passed as arguments to the function. The result of the function call is the result of evaluating the function's body with every instance of an argument name replaced by the value passed for -that argument. The number of argument @scheme[expr]s must be the same +that argument. The number of argument @racket[expr]s must be the same as the number of arguments expected by the function.} @defform[(#%app id expr expr ...)]{ -A function call can be written with @scheme[#%app], though it's +A function call can be written with @racket[#%app], though it's practically never written that way.} @; ---------------------------------------------------------------------- @@ -152,89 +152,89 @@ practically never written that way.} @defform/none[(prim-op expr ...)]{ Like a @seclink["beginner-call"]{function call}, but for a primitive -operation. The @scheme[expr]s are evaluated from left to right, and +operation. The @racket[expr]s are evaluated from left to right, and passed as arguments to the primitive operation named by -@scheme[prim-op]. A @scheme[define-struct] form creates new +@racket[prim-op]. A @racket[define-struct] form creates new primitives.} @; ---------------------------------------------------------------------- -@section{@scheme[cond]} +@section{@racket[cond]} @defform[(cond [expr expr] ... [expr expr])]{ -A @scheme[cond] form contains one or more ``lines'' that are +A @racket[cond] form contains one or more ``lines'' that are surrounded by parentheses or square brackets. Each line contains two -@scheme[expr]s: a question @scheme[expr] and an answer -@scheme[expr]. +@racket[expr]s: a question @racket[expr] and an answer +@racket[expr]. The lines are considered in order. To evaluate a line, first evaluate -the question @scheme[expr]. If the result is @scheme[true], then the -result of the whole @scheme[cond] expression is the result of -evaluating the answer @scheme[expr] of the same line. If the result of -evaluating the question @scheme[expr] is @scheme[false], the line is +the question @racket[expr]. If the result is @racket[true], then the +result of the whole @racket[cond] expression is the result of +evaluating the answer @racket[expr] of the same line. If the result of +evaluating the question @racket[expr] is @racket[false], the line is discarded and evaluation proceeds with the next line. -If the result of a question @scheme[expr] is neither @scheme[true] nor -@scheme[false], it is an error. If none of the question @scheme[expr]s -evaluates to @scheme[true], it is also an error.} +If the result of a question @racket[expr] is neither @racket[true] nor +@racket[false], it is an error. If none of the question @racket[expr]s +evaluates to @racket[true], it is also an error.} @defform/none[#:literals (cond else) (cond [expr expr] ... [else expr])]{ -This form of @scheme[cond] is similar to the prior one, except that -the final @scheme[else] clause is always taken if no prior line's test -expression evaluates to @scheme[true]. In other words, @scheme[else] -acts like @scheme[true], so there is no possibility to ``fall off the -end'' of the @scheme[cond] form.} +This form of @racket[cond] is similar to the prior one, except that +the final @racket[else] clause is always taken if no prior line's test +expression evaluates to @racket[true]. In other words, @racket[else] +acts like @racket[true], so there is no possibility to ``fall off the +end'' of the @racket[cond] form.} @defidform[else]{ -The @scheme[else] keyword can be used only with @scheme[cond].} +The @racket[else] keyword can be used only with @racket[cond].} @; ---------------------------------------------------------------------- -@section{@scheme[if]} +@section{@racket[if]} @defform[(if expr expr expr)]{ -The first @scheme[expr] (known as the ``test'' @scheme[expr]) is -evaluated. If it evaluates to @scheme[true], the result of the -@scheme[if] expression is the result of evaluating the second -@scheme[expr] (often called the ``then'' @scheme[expr]). If the text -@scheme[expr] evaluates to @scheme[false], the result of the -@scheme[if] expression is the result of evaluating the third -@scheme[expr] (known as the ``else'' @scheme[expr]). If the -result of evaluating the test @scheme[expr] is neither @scheme[true] -nor @scheme[false], it is an error.} +The first @racket[expr] (known as the ``test'' @racket[expr]) is +evaluated. If it evaluates to @racket[true], the result of the +@racket[if] expression is the result of evaluating the second +@racket[expr] (often called the ``then'' @racket[expr]). If the text +@racket[expr] evaluates to @racket[false], the result of the +@racket[if] expression is the result of evaluating the third +@racket[expr] (known as the ``else'' @racket[expr]). If the +result of evaluating the test @racket[expr] is neither @racket[true] +nor @racket[false], it is an error.} @; ---------------------------------------------------------------------- -@section{@scheme[and]} +@section{@racket[and]} @defform[(and expr expr expr ...)]{ -The @scheme[expr]s are evaluated from left to right. If the first -@scheme[expr] evaluates to @scheme[false], the @scheme[and] expression -immediately evaluates to @scheme[false]. If the first @scheme[expr] -evaluates to @scheme[true], the next expression is considered. If all -@scheme[expr]s evaluate to @scheme[true], the @scheme[and] expression -evaluates to @scheme[true]. If any of the expressions evaluate to a -value other than @scheme[true] or @scheme[false], it is an error.} +The @racket[expr]s are evaluated from left to right. If the first +@racket[expr] evaluates to @racket[false], the @racket[and] expression +immediately evaluates to @racket[false]. If the first @racket[expr] +evaluates to @racket[true], the next expression is considered. If all +@racket[expr]s evaluate to @racket[true], the @racket[and] expression +evaluates to @racket[true]. If any of the expressions evaluate to a +value other than @racket[true] or @racket[false], it is an error.} @; ---------------------------------------------------------------------- -@section{@scheme[or]} +@section{@racket[or]} @defform[(or expr expr expr ...)]{ -The @scheme[expr]s are evaluated from left to right. If the first -@scheme[expr] evaluates to @scheme[true], the @scheme[or] expression -immediately evaluates to @scheme[true]. If the first @scheme[expr] -evaluates to @scheme[false], the next expression is considered. If all -@scheme[expr]s evaluate to @scheme[false], the @scheme[or] expression -evaluates to @scheme[false]. If any of the expressions evaluate to a -value other than @scheme[true] or @scheme[false], it is an error.} +The @racket[expr]s are evaluated from left to right. If the first +@racket[expr] evaluates to @racket[true], the @racket[or] expression +immediately evaluates to @racket[true]. If the first @racket[expr] +evaluates to @racket[false], the next expression is considered. If all +@racket[expr]s evaluate to @racket[false], the @racket[or] expression +evaluates to @racket[false]. If any of the expressions evaluate to a +value other than @racket[true] or @racket[false], it is an error.} @; ---------------------------------------------------------------------- @@ -242,39 +242,38 @@ value other than @scheme[true] or @scheme[false], it is an error.} @defform[(check-expect expr expr)]{ -A test case to check that the first @scheme[expr] produces the same -value as the second @scheme[expr], where the latter is normally an +A test case to check that the first @racket[expr] produces the same +value as the second @racket[expr], where the latter is normally an immediate value.} @defform[(check-within expr expr expr)]{ -Like @scheme[check-expect], but with an extra expression that produces -a number @scheme[_delta]. The test case checks that each number in the -result of the first @scheme[expr] is within @scheme[_delta] of each -corresponding number from the second @scheme[expr].} +Like @racket[check-expect], but with an extra expression that produces +a number @racket[_delta]. The test case checks that each number in the +result of the first @racket[expr] is within @racket[_delta] of each +corresponding number from the second @racket[expr].} @defform*[[(check-error expr expr) (check-error expr)]]{ -A test case to check that the first @scheme[expr] signals an error, +A test case to check that the first @racket[expr] signals an error, where the error messages matches the string produced by the second -@scheme[expr], if it is present.} +@racket[expr], if it is present.} @defform[(check-member-of expr expr expr ...)]{ -A test case to check that the first @scheme[expr] produces an element -that is equivalent to one of the following @scheme[expr]s.} +A test case to check that the first @racket[expr] produces an element +that is equivalent to one of the following @racket[expr]s.} @defform[(check-range expr expr expr)]{ -A test case to check that the first @scheme[expr] produces a number -inbetween the numbers produced by the second and third @scheme[expr]s, +A test case to check that the first @racket[expr] produces a number +inbetween the numbers produced by the second and third @racket[expr]s, inclusive.} - @; ---------------------------------------------------------------------- -@section{@scheme[empty]} +@section{@racket[empty]} @defthing[empty empty?]{ @@ -286,9 +285,9 @@ The empty list.} @defform/none[id]{ -An @scheme[id] refers to a defined constant or argument within a -function body. If no definition or argument matches the @scheme[id] -name, an error is reported. Similarly, if @scheme[id] matches the name +An @racket[id] refers to a defined constant or argument within a +function body. If no definition or argument matches the @racket[id] +name, an error is reported. Similarly, if @racket[id] matches the name of a defined function or primitive operation, an error is reported.} @; ---------------------------------------------------------------------- @@ -296,18 +295,18 @@ of a defined function or primitive operation, an error is reported.} @section[#:tag "beginner-quote"]{Symbols} @deftogether[( -@defform/none[(unsyntax @elem{@schemevalfont{'}@scheme[id]})] +@defform/none[(unsyntax @elem{@racketvalfont{'}@racket[id]})] @defform[(quote id)] )]{ -A quoted @scheme[id] is a symbol. A symbol is a constant, like -@scheme[0] and @scheme[empty]. +A quoted @racket[id] is a symbol. A symbol is a constant, like +@racket[0] and @racket[empty]. Normally, a symbol is written with a @litchar{'}, like -@scheme['apple], but it can also be written with @scheme[quote], like -@scheme[(@#,scheme[quote] apple)]. +@racket['apple], but it can also be written with @racket[quote], like +@racket[(@#,racket[quote] apple)]. -The @scheme[id] for a symbol is a sequence of characters not including +The @racket[id] for a symbol is a sequence of characters not including a space or one of the following:} @t{@hspace[2] @litchar{"} @litchar{,} @litchar{'} @litchar{`} @@ -318,7 +317,7 @@ a space or one of the following:} @; ---------------------------------------------------------------------- -@section{@scheme[true] and @scheme[false]} +@section{@racket[true] and @racket[false]} @defthing[true boolean?]{ @@ -330,15 +329,15 @@ The false value.} @; ---------------------------------------------------------------------- -@section{@scheme[require]} +@section{@racket[require]} @defform[(require string)]{ -Makes the definitions of the module specified by @scheme[string] -available in the current module (i.e., current file), where @scheme[string] +Makes the definitions of the module specified by @racket[string] +available in the current module (i.e., current file), where @racket[string] refers to a file relative to the enclosing file. -The @scheme[string] is constrained in several ways to avoid problems +The @racket[string] is constrained in several ways to avoid problems with different path conventions on different platforms: a @litchar{/} is a directory separator, @litchar{.} always means the current directory, @litchar{..} always means the parent directory, path @@ -360,10 +359,10 @@ with the additional constraint that it must not contain a Accesses a file in an installed library, making its definitions available in the current module (i.e., current file). The first -@scheme[string] names the library file, and the remaining -@scheme[string]s name the collection (and sub-collection, and so on) +@racket[string] names the library file, and the remaining +@racket[string]s name the collection (and sub-collection, and so on) where the file is installed. Each string is constrained in the same -way as for the @scheme[(require string)] form.} +way as for the @racket[(require string)] form.} @defform/none[#:literals (require planet) diff --git a/collects/scribblings/htdp-langs/htdp-langs.scrbl b/collects/scribblings/htdp-langs/htdp-langs.scrbl index c041c90a0b..599452ccb4 100644 --- a/collects/scribblings/htdp-langs/htdp-langs.scrbl +++ b/collects/scribblings/htdp-langs/htdp-langs.scrbl @@ -11,7 +11,7 @@ When programs in these languages are run in DrRacket, any part of the program that was not run is highlighted in orange and black. These colors are intended to give the programmer feedback about the parts of the program that have not been tested. To avoid seeing these colors, -use @scheme[check-expect] to test your program. Of course, just +use @racket[check-expect] to test your program. Of course, just because you see no colors, does not mean that your program has been fully tested; it simply means that each part of the program has been run (at least once). diff --git a/collects/scribblings/htdp-langs/intermediate-lambda.scrbl b/collects/scribblings/htdp-langs/intermediate-lambda.scrbl index b5277355ef..3bc4100671 100644 --- a/collects/scribblings/htdp-langs/intermediate-lambda.scrbl +++ b/collects/scribblings/htdp-langs/intermediate-lambda.scrbl @@ -32,7 +32,7 @@ @declare-exporting[lang/htdp-intermediate-lambda] -@schemegrammar*+qq[ +@racketgrammar*+qq[ #:literals (define define-struct lambda λ cond else if and or empty true false require lib planet local let let* letrec time check-expect check-within check-error) (check-expect check-within check-error require) @@ -60,8 +60,8 @@ empty (code:line id (code:comment @#,seclink["intermediate-id"]{identifier})) (code:line prim-op (code:comment @#,seclink["intermediate-lambda-prim-op"]{primitive operation})) - (code:line @#,elem{@schemevalfont{'}@scheme[_quoted]} (code:comment @#,seclink["beginner-abbr-quote"]{quoted value})) - (code:line @#,elem{@schemevalfont{`}@scheme[_quasiquoted]} (code:comment @#,seclink["beginner-abbr-quasiquote"]{quasiquote})) + (code:line @#,elem{@racketvalfont{'}@racket[_quoted]} (code:comment @#,seclink["beginner-abbr-quote"]{quoted value})) + (code:line @#,elem{@racketvalfont{`}@racket[_quasiquoted]} (code:comment @#,seclink["beginner-abbr-quasiquote"]{quasiquote})) number true false @@ -75,7 +75,7 @@ @; ---------------------------------------------------------------------- -@section[#:tag "intermediate-lambda-define"]{@scheme[define]} +@section[#:tag "intermediate-lambda-define"]{@racket[define]} @deftogether[( @defform[(define (id id id ...) expr)] @@ -84,20 +84,20 @@ )]{ The same as Intermediate's @|intm-define|. No special case is needed -for @scheme[lambda], since a @scheme[lambda] form is an expression.} +for @racket[lambda], since a @racket[lambda] form is an expression.} @; ---------------------------------------------------------------------- -@section[#:tag "intermediate-lambda"]{@scheme[lambda]} +@section[#:tag "intermediate-lambda"]{@racket[lambda]} @defform[(lambda (id id ...) expr)]{ -Creates a function that takes as many arguments as given @scheme[id]s, -and whose body is @scheme[expr].} +Creates a function that takes as many arguments as given @racket[id]s, +and whose body is @racket[expr].} @defform[(λ (id id ...) expr)]{ -The Greek letter @scheme[λ] is a synonym for @scheme[lambda].} +The Greek letter @racket[λ] is a synonym for @racket[lambda].} @; ---------------------------------------------------------------------- @@ -107,11 +107,11 @@ The Greek letter @scheme[λ] is a synonym for @scheme[lambda].} Like a Beginning @seclink["beginner-call"]{function call}, except that the function position can be an arbitrary expression---perhaps a -@scheme[lambda] expression or a @scheme[_prim-op].} +@racket[lambda] expression or a @racket[_prim-op].} @defform[(#%app expr expr expr ...)]{ -A function call can be written with @scheme[#%app], though it's +A function call can be written with @racket[#%app], though it's practically never written that way.} @; ---------------------------------------------------------------------- diff --git a/collects/scribblings/htdp-langs/intermediate.scrbl b/collects/scribblings/htdp-langs/intermediate.scrbl index 385854e128..b7a4687536 100644 --- a/collects/scribblings/htdp-langs/intermediate.scrbl +++ b/collects/scribblings/htdp-langs/intermediate.scrbl @@ -5,21 +5,21 @@ @(define-syntax-rule (bd beg-define beg-define-struct beg-cond beg-if beg-and beg-or beg-check-expect beg-require) (begin (require (for-label lang/htdp-beginner)) - (define beg-define (scheme define)) - (define beg-define-struct (scheme define-struct)) - (define beg-cond (scheme cond)) - (define beg-if (scheme if)) - (define beg-and (scheme and)) - (define beg-or (scheme or)) - (define beg-check-expect (scheme check-expect)) - (define beg-require (scheme require)))) + (define beg-define (racket define)) + (define beg-define-struct (racket define-struct)) + (define beg-cond (racket cond)) + (define beg-if (racket if)) + (define beg-and (racket and)) + (define beg-or (racket or)) + (define beg-check-expect (racket check-expect)) + (define beg-require (racket require)))) @(bd beg-define beg-define-struct beg-cond beg-if beg-and beg-or beg-check-expect beg-require) @title[#:style 'toc #:tag "intermediate"]{Intermediate Student} @declare-exporting[lang/htdp-intermediate] -@schemegrammar*+qq[ +@racketgrammar*+qq[ #:literals (define define-struct lambda cond else if and or empty true false require lib planet local let let* letrec time check-expect check-within check-error) (check-expect check-within check-error require) @@ -47,8 +47,8 @@ empty (code:line id (code:comment @#,seclink["intermediate-id"]{identifier})) (code:line prim-op (code:comment @#,seclink["intermediate-prim-op"]{primitive operation})) - (code:line @#,elem{@schemevalfont{'}@scheme[_quoted]} (code:comment @#,seclink["beginner-abbr-quote"]{quoted value})) - (code:line @#,elem{@schemevalfont{`}@scheme[_quasiquoted]} (code:comment @#,seclink["beginner-abbr-quasiquote"]{quasiquote})) + (code:line @#,elem{@racketvalfont{'}@racket[_quoted]} (code:comment @#,seclink["beginner-abbr-quote"]{quoted value})) + (code:line @#,elem{@racketvalfont{`}@racket[_quasiquoted]} (code:comment @#,seclink["beginner-abbr-quasiquote"]{quasiquote})) number true false @@ -64,7 +64,7 @@ @; ---------------------------------------------------------------------- -@section[#:tag "intermediate-define"]{@scheme[define]} +@section[#:tag "intermediate-define"]{@racket[define]} @deftogether[( @defform[(define (id id id ...) expr)] @@ -73,40 +73,40 @@ @defform/none[#:literals (define lambda) (define id (lambda (id id ...) expr))] )]{ -Besides working in @scheme[local], definition forms are +Besides working in @racket[local], definition forms are the same as Beginning's @|beg-define|.} @defidform[lambda]{ -As in Beginning, @scheme[lambda] keyword can only be used with -@scheme[define] in the alternative function-definition syntax.} +As in Beginning, @racket[lambda] keyword can only be used with +@racket[define] in the alternative function-definition syntax.} @; ---------------------------------------------------------------------- -@section[#:tag "intermediate-define-struct"]{@scheme[define-struct]} +@section[#:tag "intermediate-define-struct"]{@racket[define-struct]} @defform[(define-struct structid (fieldid ...))]{ -Besides working in @scheme[local], this form is the same as Beginning's +Besides working in @racket[local], this form is the same as Beginning's @|beg-define-struct|.} @; ---------------------------------------------------------------------- -@section{@scheme[local]} +@section{@racket[local]} @defform[(local [definition ...] expr)]{ -Groups related definitions for use in @scheme[expr]. Each -@scheme[definition] is evaluated in order, and finally the body -@scheme[expr] is evaluated. Only the expressions within the -@scheme[local] form (including the right-hand-sides of the -@scheme[definition]s and the @scheme[expr]) may refer to the names -defined by the @scheme[definition]s. If a name defined in the -@scheme[local] form is the same as a top-level binding, the inner one -``shadows'' the outer one. That is, inside the @scheme[local] form, +Groups related definitions for use in @racket[expr]. Each +@racket[definition] is evaluated in order, and finally the body +@racket[expr] is evaluated. Only the expressions within the +@racket[local] form (including the right-hand-sides of the +@racket[definition]s and the @racket[expr]) may refer to the names +defined by the @racket[definition]s. If a name defined in the +@racket[local] form is the same as a top-level binding, the inner one +``shadows'' the outer one. That is, inside the @racket[local] form, any references to that name refer to the inner one. -Since @scheme[local] is an expression and may occur anywhere an +Since @racket[local] is an expression and may occur anywhere an expression may occur, it introduces the notion of lexical scope. Expressions within the local may ``escape'' the scope of the local, but these expressions may still refer to the bindings @@ -114,26 +114,26 @@ established by the local.} @; ---------------------------------------------------------------------- -@section{@scheme[letrec], @scheme[let], and @scheme[let*]} +@section{@racket[letrec], @racket[let], and @racket[let*]} @defform[(letrec ([id expr-for-let] ...) expr)]{ -Similar to @scheme[local], but essentially omitting the -@scheme[define] for each definition. +Similar to @racket[local], but essentially omitting the +@racket[define] for each definition. -A @scheme[expr-for-let] can be either an expression for a constant -definition or a @scheme[lambda] form for a function definition.} +A @racket[expr-for-let] can be either an expression for a constant +definition or a @racket[lambda] form for a function definition.} @defform[(let ([id expr-for-let] ...) expr)]{ -Like @scheme[letrec], but the defined @scheme[id]s can be used only in -the last @scheme[expr], not the @scheme[expr-for-let]s next to the -@scheme[id]s.} +Like @racket[letrec], but the defined @racket[id]s can be used only in +the last @racket[expr], not the @racket[expr-for-let]s next to the +@racket[id]s.} @defform[(let* ([id expr-for-let] ...) expr)]{ -Like @scheme[let], but each @scheme[id] can be used in any subsequent -@scheme[expr-for-let], in addition to @scheme[expr].} +Like @racket[let], but each @racket[id] can be used in any subsequent +@racket[expr-for-let], in addition to @racket[expr].} @; ---------------------------------------------------------------------- @@ -143,23 +143,23 @@ Like @scheme[let], but each @scheme[id] can be used in any subsequent A function call in Intermediate is the same as a Beginning @seclink["beginner-call"]{function call}, except that it can also call -@scheme[local]ly defined functions or functions passed as -arguments. That is, @scheme[id] can be a function defined in -@scheme[local] or an argument name while in a function.} +@racket[local]ly defined functions or functions passed as +arguments. That is, @racket[id] can be a function defined in +@racket[local] or an argument name while in a function.} @defform[(#%app id expr expr ...)]{ -A function call can be written with @scheme[#%app], though it's +A function call can be written with @racket[#%app], though it's practically never written that way.} @; ---------------------------------------------------------------------- -@section{@scheme[time]} +@section{@racket[time]} @defform[(time expr)]{ This form is used to measure the time taken to evaluate -@scheme[expr]. After evaluating @scheme[expr], Scheme prints out the +@racket[expr]. After evaluating @racket[expr], Racket prints out the time taken by the evaluation (including real time, time taken by the cpu, and the time spent collecting free memory) and returns the result of the expression. @@ -177,9 +177,9 @@ numbers depends on the platform.) @defform/none[id]{ -An @scheme[id] refers to a defined constant (possibly local), defined +An @racket[id] refers to a defined constant (possibly local), defined function (possibly local), or argument within a function body. If no -definition or argument matches the @scheme[id] name, an error is +definition or argument matches the @racket[id] name, an error is reported.} @; ---------------------------------------------------------------------- diff --git a/collects/scribblings/htdp-langs/std-grammar.rkt b/collects/scribblings/htdp-langs/std-grammar.rkt index b28f402af3..0af4033b55 100644 --- a/collects/scribblings/htdp-langs/std-grammar.rkt +++ b/collects/scribblings/htdp-langs/std-grammar.rkt @@ -5,36 +5,36 @@ (for-label lang/htdp-beginner-abbr)) (provide prim-nonterms - schemegrammar*+library - schemegrammar*+qq) + racketgrammar*+library + racketgrammar*+qq) (define ex-str "This is a string with \" inside") -(define-syntax-rule (schemegrammar*+library +(define-syntax-rule (racketgrammar*+library #:literals lits (check-expect check-within check-error require) form ...) - (schemegrammar* + (racketgrammar* #:literals lits form ... - [test-case @#,scheme[(check-expect expr expr)] - @#,scheme[(check-within expr expr expr)] - @#,scheme[(check-member-of expr expr (... ...))] - @#,scheme[(check-range expr expr expr)] - @#,scheme[(check-error expr expr)] - @#,scheme[(check-error expr)]] + [test-case @#,racket[(check-expect expr expr)] + @#,racket[(check-within expr expr expr)] + @#,racket[(check-member-of expr expr (... ...))] + @#,racket[(check-range expr expr expr)] + @#,racket[(check-error expr expr)] + @#,racket[(check-error expr)]] (... - [library-require @#,scheme[(require string)] - @#,scheme[(require (lib string string ...))] - @#,scheme[(require (planet string package))]]) + [library-require @#,racket[(require string)] + @#,racket[(require (lib string string ...))] + @#,racket[(require (planet string package))]]) (... - [package @#,scheme[(string string number number)]]))) + [package @#,racket[(string string number number)]]))) -(define-syntax-rule (schemegrammar*+qq +(define-syntax-rule (racketgrammar*+qq #:literals lits (check-expect check-within check-error require) form ...) - (schemegrammar*+library + (racketgrammar*+library #:literals lits (check-expect check-within check-error require) form ... @@ -43,27 +43,27 @@ number string character - @#,scheme[(quoted ...)] - @#,elem{@schemevalfont{'}@scheme[quoted]} - @#,elem{@schemevalfont{`}@scheme[quoted]} - @#,elem{@schemefont{,}@scheme[quoted]} - @#,elem{@schemefont[",@"]@scheme[quoted]}]) + @#,racket[(quoted ...)] + @#,elem{@racketvalfont{'}@racket[quoted]} + @#,elem{@racketvalfont{`}@racket[quoted]} + @#,elem{@racketfont{,}@racket[quoted]} + @#,elem{@racketfont[",@"]@racket[quoted]}]) (... [quasiquoted id number string character - @#,scheme[(quasiquoted ...)] - @#,elem{@schemevalfont{'}@scheme[quasiquoted]} - @#,elem{@schemevalfont{`}@scheme[quasiquoted]} - @#,elem{@schemefont{,}@scheme[expr]} - @#,elem{@schemefont[",@"]@scheme[expr]}]))) + @#,racket[(quasiquoted ...)] + @#,elem{@racketvalfont{'}@racket[quasiquoted]} + @#,elem{@racketvalfont{`}@racket[quasiquoted]} + @#,elem{@racketfont{,}@racket[expr]} + @#,elem{@racketfont[",@"]@racket[expr]}]))) (define prim-nonterms (make-splice (list -@t{An @scheme[_id] is a sequence of characters not including a +@t{An @racket[_id] is a sequence of characters not including a space or one of the following:} @t{@hspace[2] @litchar{"} @litchar{,} @litchar{'} @litchar{`} @@ -71,16 +71,16 @@ space or one of the following:} @litchar["{"] @litchar["}"] @litchar{|} @litchar{;} @litchar{#}} -@t{A @scheme[_number] is a number such as @scheme[123], @scheme[3/2], or -@scheme[5.5].} +@t{A @racket[_number] is a number such as @racket[123], @racket[3/2], or +@racket[5.5].} -@t{A @scheme[_string] is enclosed by a pair of @litchar{"}. Unlike +@t{A @racket[_string] is enclosed by a pair of @litchar{"}. Unlike symbols, strings may be split into characters and manipulated by a -variety of primitive functions. For example, @scheme["abcdef"], -@scheme["This is a string"], and @scheme[#,ex-str] are all strings.} +variety of primitive functions. For example, @racket["abcdef"], +@racket["This is a string"], and @racket[#,ex-str] are all strings.} -@t{A @scheme[_character] begins with @litchar{#\} and has the -name of the character. For example, @scheme[#\a], @scheme[#\b], -and @scheme[#\space] are characters.} +@t{A @racket[_character] begins with @litchar{#\} and has the +name of the character. For example, @racket[#\a], @racket[#\b], +and @racket[#\space] are characters.} ))) diff --git a/collects/scribblings/inside/eval.scrbl b/collects/scribblings/inside/eval.scrbl index dff50cf7b4..6b152a34da 100644 --- a/collects/scribblings/inside/eval.scrbl +++ b/collects/scribblings/inside/eval.scrbl @@ -13,7 +13,7 @@ array of @cpp{Scheme_Object *} arguments. The return value is the result of the application. There is also a function @cppi{scheme_apply_to_list}, which takes a procedure and a list (constructed with @cppi{scheme_make_pair}) and performs the Racket -@scheme[apply] operation. +@racket[apply] operation. The @cppi{scheme_eval} function actually calls @cppi{scheme_compile} followed by @cppi{scheme_eval_compiled}. @@ -54,8 +54,8 @@ postpones the procedure application until control returns to the Racket evaluation loop. For example, consider the following implementation of a -@scheme[thunk-or] primitive, which takes any number of thunks and -performs @scheme[or] on the results of the thunks, evaluating only as +@racket[thunk-or] primitive, which takes any number of thunks and +performs @racket[or] on the results of the thunks, evaluating only as many thunks as necessary. @verbatim{ @@ -76,8 +76,8 @@ thunk_or (int argc, Scheme_Object **argv) } } -This @scheme[thunk-or] properly implements tail-recursion: if the -final thunk is applied, then the result of @scheme[thunk-or] is the +This @racket[thunk-or] properly implements tail-recursion: if the +final thunk is applied, then the result of @racket[thunk-or] is the result of that application, so @cppi{scheme_tail_apply} is used for the final application. @@ -281,7 +281,7 @@ Applies the procedure as a tail-call.} Compiles the S-expression @var{form} in the given namespace. The returned value can be used with @cpp{scheme_eval_compiled} et al. Provide a non-zero value for @var{writable} if the resulting compiled -object will be marshalled via @scheme[write] instead of evaluated.} +object will be marshalled via @racket[write] instead of evaluated.} @function[(Scheme_Object* scheme_expand [Scheme_Object* form] diff --git a/collects/scribblings/inside/exns.scrbl b/collects/scribblings/inside/exns.scrbl index a34cf6f391..adc871eab5 100644 --- a/collects/scribblings/inside/exns.scrbl +++ b/collects/scribblings/inside/exns.scrbl @@ -108,7 +108,7 @@ calls top-level evaluation functions (@cpp{scheme_eval}, @cpp{scheme_apply}, etc., as opposed to @cpp{_scheme_apply}, @cpp{_scheme_eval_compiled}, etc.). Otherwise, use @cppi{scheme_dynamic_wind} to protect your code against full -continuation jumps in the same way that @scheme[dynamic-wind] is used +continuation jumps in the same way that @racket[dynamic-wind] is used in Racket. The above solution simply traps the escape; it doesn't report the @@ -217,10 +217,10 @@ that occur during while evaluating source code from a string. When embedding Racket, asynchronous break exceptions are disabled by default. Call @cpp{scheme_set_can_break} (which is the same as calling -the Racket function @scheme[break-enabled]) to enable or disable +the Racket function @racket[break-enabled]) to enable or disable breaks. To enable or disable breaks during the dynamic extent of another evaluation (where you would use -@scheme[with-break-parameterization] in Racket), use +@racket[with-break-parameterization] in Racket), use @cppi{scheme_push_break_enable} before and @cppi{scheme_pop_break_enable} after, instead. @@ -297,7 +297,7 @@ garbage collection.)} Raises a specific primitive exception. The @var{exnid} argument specifies the exception to be raised. If an instance of that exception has @math{n} fields, then the next @math{n-2} arguments are values for -those fields (skipping the @scheme[message] and @scheme[debug-info] +those fields (skipping the @racket[message] and @racket[debug-info] fields). The remaining arguments start with an error string and proceed roughly as for @cpp{printf}; see @cpp{scheme_signal_error} above for more details. @@ -447,7 +447,7 @@ the first example in @secref["imz:tempcatch"]).} [int on])]{ Enables or disables breaks in the same way as -calling @scheme[break-enabled].} +calling @racket[break-enabled].} @function[(void scheme_push_break_enable [Scheme_Cont_Frame_Data* cframe] @@ -456,7 +456,7 @@ calling @scheme[break-enabled].} Use this function with @cpp{scheme_pop_break_enable} to enable or disable breaks in the same way as -@scheme[with-break-parameterization]; this function writes to +@racket[with-break-parameterization]; this function writes to @var{cframe} to initialize it, and @cpp{scheme_pop_break_enable} reads from @var{cframe}. If @var{pre_check} is non-zero and breaks are currently enabled, any pending break exception is raised.} @@ -472,7 +472,7 @@ the previous state, then any pending break exception is raised.} @function[(Scheme_Object* scheme_current_continuation_marks [Scheme_Object* prompt_tag])]{ -Like @scheme[current-continuation-marks]. Passing @cpp{NULL} as +Like @racket[current-continuation-marks]. Passing @cpp{NULL} as @var{prompt_tag} is the same as providing the default continuation prompt tag.} diff --git a/collects/scribblings/inside/hooks.scrbl b/collects/scribblings/inside/hooks.scrbl index 36ef44a277..73a86931fd 100644 --- a/collects/scribblings/inside/hooks.scrbl +++ b/collects/scribblings/inside/hooks.scrbl @@ -41,7 +41,7 @@ embedded: set. The default is zero.} @item{@cppdef{scheme_allow_set_undefined} --- This flag determines - the initial value of @scheme[compile-allow-set!-undefined]. The default + the initial value of @racket[compile-allow-set!-undefined]. The default is zero.} @item{@cppdef{scheme_console_printf} --- This function pointer was @@ -53,14 +53,14 @@ embedded: @function[(void scheme_set_collects_path [Scheme_Object* path])]{ -Sets the path to be returned by @scheme[(find-system-path +Sets the path to be returned by @racket[(find-system-path 'collects-dir)].} @function[(void scheme_set_addon_path [Scheme_Object* path])]{ -Sets the path to be returned by @scheme[(find-system-path +Sets the path to be returned by @racket[(find-system-path 'addon-dir)].} @@ -69,10 +69,10 @@ Sets the path to be returned by @scheme[(find-system-path [Scheme_Object* pre_extra_paths] [Scheme_Object* post_extra_paths])]{ -Initializes the @scheme[current-library-collection-paths] parameter -using @scheme[find-library-collection-paths]. The +Initializes the @racket[current-library-collection-paths] parameter +using @racket[find-library-collection-paths]. The @var{pre_extra_paths} and @var{post_extra-paths} arguments are -propagated to @scheme[find-library-collection-paths]. +propagated to @racket[find-library-collection-paths]. The function calls @cpp{scheme_seal_parameters} automatically.} @@ -80,7 +80,7 @@ The function calls @cpp{scheme_seal_parameters} automatically.} [Scheme_Env* env] [Scheme_Object* pre_extra_paths])]{ -Like @cpp{scheme_init_collection_paths_post}, but with @scheme[null] +Like @cpp{scheme_init_collection_paths_post}, but with @racket[null] as the last argument.} diff --git a/collects/scribblings/inside/memory.scrbl b/collects/scribblings/inside/memory.scrbl index cfbcbc663c..22f7d157cb 100644 --- a/collects/scribblings/inside/memory.scrbl +++ b/collects/scribblings/inside/memory.scrbl @@ -697,7 +697,7 @@ Copies the null-terminated string @var{str}; the copy will never be freed.} [size_t size])]{ Attempts to allocate @var{size} bytes using @var{mallocf}. If the -allocation fails, the @scheme[exn:misc:out-of-memory] exception is +allocation fails, the @racket[exn:misc:out-of-memory] exception is raised.} @function[(void** scheme_malloc_immobile_box @@ -939,7 +939,7 @@ To remove an added finalizer, use @cpp{scheme_subtract_finalizer}.} [fnl_proc f] [void* data])]{ -Installs a ``will''-like finalizer, similar to @scheme[will-register]. +Installs a ``will''-like finalizer, similar to @racket[will-register]. Will-like finalizers are called one at a time, requiring the collector to prove that a value has become inaccessible again before calling the next will-like finalizer. Finalizers registered with @@ -981,7 +981,7 @@ Removes a finalizer that was installed with [void* p])]{ Removes all finalization (``will''-like or not) for @var{p}, including - wills added in Scheme with @scheme[will-register] and finalizers used + wills added in Scheme with @racket[will-register] and finalizers used by custodians.} @function[(void scheme_dont_gc_ptr diff --git a/collects/scribblings/inside/misc.scrbl b/collects/scribblings/inside/misc.scrbl index b88ce58a08..5b1fdb48f3 100644 --- a/collects/scribblings/inside/misc.scrbl +++ b/collects/scribblings/inside/misc.scrbl @@ -12,19 +12,19 @@ minor version numbers, respectively. [Scheme_Object* obj1] [Scheme_Object* obj2])]{ -Returns 1 if the Scheme values are @scheme[eq?].} +Returns 1 if the Scheme values are @racket[eq?].} @function[(int scheme_eqv [Scheme_Object* obj1] [Scheme_Object* obj2])]{ -Returns 1 if the Scheme values are @scheme[eqv?].} +Returns 1 if the Scheme values are @racket[eqv?].} @function[(int scheme_equal [Scheme_Object* obj1] [Scheme_Object* obj2])]{ -Returns 1 if the Scheme values are @scheme[equal?].} +Returns 1 if the Scheme values are @racket[equal?].} @function[(int scheme_recur_equal [Scheme_Object* obj1] @@ -35,17 +35,17 @@ Like @cpp{scheme_equal}, but accepts an extra value for cycle tracking. This procedure is meant to be called by a procedure installed with @cpp{scheme_set_type_equality}.} -Returns 1 if the Racket values are @scheme[equal?].} +Returns 1 if the Racket values are @racket[equal?].} @function[(intptr_t scheme_equal_hash_key [Scheme_Object* obj])]{ -Returns the primary @scheme[equal?]-hash key for @var{obj}.} +Returns the primary @racket[equal?]-hash key for @var{obj}.} @function[(intptr_t scheme_equal_hash_key2 [Scheme_Object* obj])]{ -Returns the secondary @scheme[equal?]-hash key for @var{obj}.} +Returns the secondary @racket[equal?]-hash key for @var{obj}.} @function[(intptr_t scheme_recur_equal_hash_key [Scheme_Object* obj] @@ -55,7 +55,7 @@ Like @cpp{scheme_equal_hash_key}, but accepts an extra value for cycle tracking. This procedure is meant to be called by a hashing procedure installed with @cpp{scheme_set_type_equality}.} -Returns the primary @scheme[equal?]-hash key for @var{obj}.} +Returns the primary @racket[equal?]-hash key for @var{obj}.} @function[(intptr_t scheme_recur_equal_hash_key2 [Scheme_Object* obj] @@ -76,36 +76,36 @@ Creates and returns a list of length @var{c} with the elements [Scheme_Object* list])]{ Returns the length of the list. If @var{list} is not a proper list, -then the last @scheme[cdr] counts as an item. If there is a cycle in -@var{list} (involving only @scheme[cdr]s), this procedure will not +then the last @racket[cdr] counts as an item. If there is a cycle in +@var{list} (involving only @racket[cdr]s), this procedure will not terminate.} @function[(int scheme_proper_list_length [Scheme_Object* list])]{ Returns the length of the list, or -1 if it is not a proper list. If -there is a cycle in @var{list} (involving only @scheme[cdr]s), this +there is a cycle in @var{list} (involving only @racket[cdr]s), this procedure returns -1.} @function[(Scheme_Object* scheme_car [Scheme_Object* pair])]{ -Returns the @scheme[car] of the pair.} +Returns the @racket[car] of the pair.} @function[(Scheme_Object* scheme_cdr [Scheme_Object* pair])]{ -Returns the @scheme[cdr] of the pair.} +Returns the @racket[cdr] of the pair.} @function[(Scheme_Object* scheme_cadr [Scheme_Object* pair])]{ -Returns the @scheme[cadr] of the pair.} +Returns the @racket[cadr] of the pair.} @function[(Scheme_Object* scheme_caddr [Scheme_Object* pair])]{ -Returns the @scheme[caddr] of the pair.} +Returns the @racket[caddr] of the pair.} @function[(Scheme_Object* scheme_vector_to_list [Scheme_Object* vec])]{ @@ -138,13 +138,13 @@ Sets the contents of the given box.} [int argc] [Scheme_Object** argv])]{ -The same as @scheme[dynamic-require]. The @var{argc} argument must be -@scheme[2], and @var{argv} contains the arguments.} +The same as @racket[dynamic-require]. The @var{argc} argument must be +@racket[2], and @var{argv} contains the arguments.} @function[(Scheme_Object* scheme_namespace_require [Scheme_Object* prim_req_spec])]{ -The same as @scheme[namespace-require].} +The same as @racket[namespace-require].} @function[(Scheme_Object* scheme_load @@ -212,8 +212,8 @@ that will be encountered.} @function[(Scheme_Hash_Table* scheme_make_hash_table_equal)]{ Like @cpp{scheme_make_hash_table}, except that keys are treated as -Racket values and hashed based on @scheme[equal?] instead of -@scheme[eq?].} +Racket values and hashed based on @racket[equal?] instead of +@racket[eq?].} @function[(void scheme_hash_set [Scheme_Hash_Table* table] @@ -325,12 +325,12 @@ reported; @var{name} is used for error-reporting.} @function[(intptr_t scheme_get_milliseconds)]{ Returns the current ``time'' in milliseconds, just like -@scheme[current-milliseconds].} +@racket[current-milliseconds].} @function[(intptr_t scheme_get_process_milliseconds)]{ Returns the current process ``time'' in milliseconds, just like -@scheme[current-process-milliseconds].} +@racket[current-process-milliseconds].} @function[(char* scheme_banner)]{ diff --git a/collects/scribblings/inside/namespaces.scrbl b/collects/scribblings/inside/namespaces.scrbl index 63038aa43f..88527b9323 100644 --- a/collects/scribblings/inside/namespaces.scrbl +++ b/collects/scribblings/inside/namespaces.scrbl @@ -29,7 +29,7 @@ A @as-index{module}'s set of top-level bindings is implemented using the same machinery as a namespace. Use @cppi{scheme_primitive_module} to create a new @cpp{Scheme_Env*} that represents a primitive module. The name provided to @cppi{scheme_primitive_module} is subject -to change through the @scheme[current-module-declare-name] parameter +to change through the @racket[current-module-declare-name] parameter (which is normally set by the module name resolver when auto-loading module files). After installing variables into the module with @cppi{scheme_add_global}, etc., call @@ -37,9 +37,9 @@ module files). After installing variables into the module with to make the module declaration available. All defined variables are exported from the primitive module. -The Racket @indexed-scheme[#%variable-reference] form produces a value +The Racket @indexed-racket[#%variable-reference] form produces a value that is opaque to Racket code. Use @cpp{SCHEME_PTR_VAL} on the result -of @scheme[#%variable-reference] to obtain the same kind of value as +of @racket[#%variable-reference] to obtain the same kind of value as returned by @cpp{scheme_global_bucket} (i.e., a bucket containing the variable's value, or @cpp{NULL} if the variable is not yet defined). @@ -95,7 +95,7 @@ The @cppi{Scheme_Bucket} structure is defined as: Like @cpp{scheme_global_bucket}, but finds a variable in a module. The @var{mod} and @var{symbol} arguments are as for - @scheme[dynamic-require] in Racket. The @var{pos} argument should be + @racket[dynamic-require] in Racket. The @var{pos} argument should be @cpp{-1} always. The @var{env} argument represents the namespace in which the module is declared.} @@ -109,7 +109,7 @@ Changes the value of a global variable. The @var{procname} argument is used to report errors (in case the global variable is constant, not yet bound, or bound as syntax). If @var{set_undef} is not 1, then the global variable must already have a binding. (For example, -@scheme[set!] cannot set unbound variables, while @scheme[define] +@racket[set!] cannot set unbound variables, while @racket[define] can.)} @function[(Scheme_Object* scheme_builtin_value @@ -130,7 +130,7 @@ available as @cppi{scheme_config}.} [Scheme_Env* for_env])]{ Prepares a new primitive module whose name is the symbol @var{name} (or an - alternative that is active via @scheme[current-module-declare-name]). The + alternative that is active via @racket[current-module-declare-name]). The module will be declared within the namespace @var{for_env}. The result is a @cpp{Scheme_Env *} value that can be used with @cpp{scheme_add_global}, etc., but it represents a module instead diff --git a/collects/scribblings/inside/numbers.scrbl b/collects/scribblings/inside/numbers.scrbl index a6672bc7b8..c5bc42ca1c 100644 --- a/collects/scribblings/inside/numbers.scrbl +++ b/collects/scribblings/inside/numbers.scrbl @@ -27,13 +27,13 @@ whether a complex number should be treated as a real number. @function[(int scheme_is_exact [Scheme_Object* n])]{ -Returns @cpp{1} if @var{n} is an exact number, @scheme[0] otherwise +Returns @cpp{1} if @var{n} is an exact number, @racket[0] otherwise (@var{n} need not be a number).} @function[(int scheme_is_inexact [Scheme_Object* n])]{ -Returns @cpp{1} if @var{n} is an inexact number, @scheme[0] otherwise +Returns @cpp{1} if @var{n} is an inexact number, @racket[0] otherwise (@var{n} need not be a number).} @function[(Scheme_Object* scheme_make_bignum diff --git a/collects/scribblings/inside/params.scrbl b/collects/scribblings/inside/params.scrbl index 25172f177f..9158c95c57 100644 --- a/collects/scribblings/inside/params.scrbl +++ b/collects/scribblings/inside/params.scrbl @@ -23,52 +23,52 @@ Parameter values for built-in parameters are obtained and modified through the following indices: @itemize[ -@item{@cppdef{MZCONFIG_ENV} --- @scheme[current-namespace] (use @cpp{scheme_get_env})} -@item{@cppdef{MZCONFIG_INPUT_PORT} --- @scheme[current-input-port]} -@item{@cppdef{MZCONFIG_OUTPUT_PORT} --- @scheme[current-output-port]} -@item{@cppdef{MZCONFIG_ERROR_PORT} --- @scheme[current-error-port]} +@item{@cppdef{MZCONFIG_ENV} --- @racket[current-namespace] (use @cpp{scheme_get_env})} +@item{@cppdef{MZCONFIG_INPUT_PORT} --- @racket[current-input-port]} +@item{@cppdef{MZCONFIG_OUTPUT_PORT} --- @racket[current-output-port]} +@item{@cppdef{MZCONFIG_ERROR_PORT} --- @racket[current-error-port]} -@item{@cppdef{MZCONFIG_ERROR_DISPLAY_HANDLER} --- @scheme[error-display-handler]} -@item{@cppdef{MZCONFIG_ERROR_PRINT_VALUE_HANDLER} --- @scheme[error-value->string-handler]} +@item{@cppdef{MZCONFIG_ERROR_DISPLAY_HANDLER} --- @racket[error-display-handler]} +@item{@cppdef{MZCONFIG_ERROR_PRINT_VALUE_HANDLER} --- @racket[error-value->string-handler]} -@item{@cppdef{MZCONFIG_EXIT_HANDLER} --- @scheme[exit-handler]} +@item{@cppdef{MZCONFIG_EXIT_HANDLER} --- @racket[exit-handler]} -@item{@cppdef{MZCONFIG_INIT_EXN_HANDLER} --- @scheme[uncaught-exception-handler]} +@item{@cppdef{MZCONFIG_INIT_EXN_HANDLER} --- @racket[uncaught-exception-handler]} -@item{@cppdef{MZCONFIG_EVAL_HANDLER} --- @scheme[current-eval]} -@item{@cppdef{MZCONFIG_LOAD_HANDLER} --- @scheme[current-load]} +@item{@cppdef{MZCONFIG_EVAL_HANDLER} --- @racket[current-eval]} +@item{@cppdef{MZCONFIG_LOAD_HANDLER} --- @racket[current-load]} -@item{@cppdef{MZCONFIG_PRINT_HANDLER} --- @scheme[current-print]} -@item{@cppdef{MZCONFIG_PROMPT_READ_HANDLER} --- @scheme[current-prompt-read]} +@item{@cppdef{MZCONFIG_PRINT_HANDLER} --- @racket[current-print]} +@item{@cppdef{MZCONFIG_PROMPT_READ_HANDLER} --- @racket[current-prompt-read]} -@item{@cppdef{MZCONFIG_CAN_READ_GRAPH} --- @scheme[read-accept-graph]} -@item{@cppdef{MZCONFIG_CAN_READ_COMPILED} --- @scheme[read-accept-compiled]} -@item{@cppdef{MZCONFIG_CAN_READ_BOX} --- @scheme[read-accept-box]} -@item{@cppdef{MZCONFIG_CAN_READ_PIPE_QUOTE} --- @scheme[read-accept-bar-quote]} +@item{@cppdef{MZCONFIG_CAN_READ_GRAPH} --- @racket[read-accept-graph]} +@item{@cppdef{MZCONFIG_CAN_READ_COMPILED} --- @racket[read-accept-compiled]} +@item{@cppdef{MZCONFIG_CAN_READ_BOX} --- @racket[read-accept-box]} +@item{@cppdef{MZCONFIG_CAN_READ_PIPE_QUOTE} --- @racket[read-accept-bar-quote]} -@item{@cppdef{MZCONFIG_PRINT_GRAPH} --- @scheme[print-graph]} -@item{@cppdef{MZCONFIG_PRINT_STRUCT} --- @scheme[print-struct]} -@item{@cppdef{MZCONFIG_PRINT_BOX} --- @scheme[print-box]} +@item{@cppdef{MZCONFIG_PRINT_GRAPH} --- @racket[print-graph]} +@item{@cppdef{MZCONFIG_PRINT_STRUCT} --- @racket[print-struct]} +@item{@cppdef{MZCONFIG_PRINT_BOX} --- @racket[print-box]} -@item{@cppdef{MZCONFIG_CASE_SENS} --- @scheme[read-case-sensitive]} -@item{@cppdef{MZCONFIG_SQUARE_BRACKETS_ARE_PARENS} --- @scheme[read-square-brackets-as-parens]} -@item{@cppdef{MZCONFIG_CURLY_BRACES_ARE_PARENS} --- @scheme[read-curly-braces-as-parens]} +@item{@cppdef{MZCONFIG_CASE_SENS} --- @racket[read-case-sensitive]} +@item{@cppdef{MZCONFIG_SQUARE_BRACKETS_ARE_PARENS} --- @racket[read-square-brackets-as-parens]} +@item{@cppdef{MZCONFIG_CURLY_BRACES_ARE_PARENS} --- @racket[read-curly-braces-as-parens]} -@item{@cppdef{MZCONFIG_ERROR_PRINT_WIDTH} --- @scheme[error-print-width]} +@item{@cppdef{MZCONFIG_ERROR_PRINT_WIDTH} --- @racket[error-print-width]} -@item{@cppdef{MZCONFIG_ALLOW_SET_UNDEFINED} --- @scheme[allow-compile-set!-undefined]} +@item{@cppdef{MZCONFIG_ALLOW_SET_UNDEFINED} --- @racket[allow-compile-set!-undefined]} -@item{@cppdef{MZCONFIG_CUSTODIAN} --- @scheme[current-custodian]} +@item{@cppdef{MZCONFIG_CUSTODIAN} --- @racket[current-custodian]} -@item{@cppdef{MZCONFIG_USE_COMPILED_KIND} --- @scheme[use-compiled-file-paths]} +@item{@cppdef{MZCONFIG_USE_COMPILED_KIND} --- @racket[use-compiled-file-paths]} -@item{@cppdef{MZCONFIG_LOAD_DIRECTORY} --- @scheme[current-load-relative-directory]} +@item{@cppdef{MZCONFIG_LOAD_DIRECTORY} --- @racket[current-load-relative-directory]} -@item{@cppdef{MZCONFIG_COLLECTION_PATHS} --- @scheme[current-library-collection-paths]} +@item{@cppdef{MZCONFIG_COLLECTION_PATHS} --- @racket[current-library-collection-paths]} -@item{@cppdef{MZCONFIG_PORT_PRINT_HANDLER} --- @scheme[global-port-print-handler]} +@item{@cppdef{MZCONFIG_PORT_PRINT_HANDLER} --- @racket[global-port-print-handler]} -@item{@cppdef{MZCONFIG_LOAD_EXTENSION_HANDLER} --- @scheme[current-load-extension]} +@item{@cppdef{MZCONFIG_LOAD_EXTENSION_HANDLER} --- @racket[current-load-extension]} ] @@ -82,7 +82,7 @@ When installing a new parameter with @cpp{scheme_set_param}, no check is performed on the supplied value to ensure that it is a legal value for the parameter; this is the responsibility of the caller of @cpp{scheme_set_param}. Note that Boolean parameters should only be -set to the values @scheme[#t] and @scheme[#f]. +set to the values @racket[#t] and @racket[#f]. New primitive parameter indices are created with @cppi{scheme_new_param} and implemented with diff --git a/collects/scribblings/inside/ports.scrbl b/collects/scribblings/inside/ports.scrbl index 7d5d55c5e3..346a516bfa 100644 --- a/collects/scribblings/inside/ports.scrbl +++ b/collects/scribblings/inside/ports.scrbl @@ -30,13 +30,13 @@ resolve relative paths. @function[(Scheme_Object* scheme_read [Scheme_Object* port])]{ -@scheme[read]s the next S-expression from the given input port.} +@racket[read]s the next S-expression from the given input port.} @function[(void scheme_write [Scheme_Object* obj] [Scheme_Object* port])]{ -@scheme[write]s the Scheme value @var{obj} to the given output port.} +@racket[write]s the Scheme value @var{obj} to the given output port.} @function[(void scheme_write_w_max [Scheme_Object* obj] @@ -50,7 +50,7 @@ Like @cpp{scheme_write}, but the printing is truncated to @var{n} bytes. [Scheme_Object* obj] [Scheme_Object* port])]{ -@scheme[display]s the Racket value @var{obj} to the given output +@racket[display]s the Racket value @var{obj} to the given output port.} @function[(void scheme_display_w_max @@ -119,7 +119,7 @@ without the non-blocking option.} [Scheme_Object* obj] [intptr_t* len])]{ -Prints the Racket value @var{obj} using @scheme[write] to a newly +Prints the Racket value @var{obj} using @racket[write] to a newly allocated string. If @var{len} is not @cpp{NULL}, @cpp{*@var{len}} is set to the length of the bytes string.} @@ -136,7 +136,7 @@ Like @cpp{scheme_write_to_string}, but the string is truncated to [Scheme_Object* obj] [intptr_t* len])]{ -Prints the Racket value @var{obj} using @scheme[display] to a newly +Prints the Racket value @var{obj} using @racket[display] to a newly allocated string. If @var{len} is not @cpp{NULL}, @cpp{*@var{len}} is set to the length of the string.} @@ -154,7 +154,7 @@ Like @cpp{scheme_display_to_string}, but the string is truncated to @function[(void scheme_debug_print [Scheme_Object* obj])]{ -Prints the Racket value @var{obj} using @scheme[write] to the main +Prints the Racket value @var{obj} using @racket[write] to the main thread's output port.} @function[(void scheme_flush_output @@ -377,8 +377,8 @@ Creates a new input port with arbitrary control functions. The The pointer @var{data} will be installed as the port's user data, which can be extracted/set with the @cppi{SCHEME_INPORT_VAL} macro. The @var{name} object is used as the port's name (for -@scheme[object-name] and as the default source name for -@scheme[read-syntax]). +@racket[object-name] and as the default source name for +@racket[read-syntax]). If @var{must_close} is non-zero, the new port will be registered with the current custodian, and @var{close_fun} is guaranteed to be called @@ -461,7 +461,7 @@ The functions are as follows. [Scheme_Input_Port* port])]{ Called to obtain a progress event for the port, such as for - @scheme[port-progress-evt]. This function can be @cpp{NULL} if the + @racket[port-progress-evt]. This function can be @cpp{NULL} if the port does not support progress events. Use @cpp{scheme_progress_evt_via_get} to obtain a default implementation, in which case @var{peeked_read_fun} should be @@ -476,7 +476,7 @@ The functions are as follows. [Scheme_Object* target_ch])]{ Called to commit previously peeked bytes, just like the sixth - argument to @scheme[make-input-port]. Use + argument to @racket[make-input-port]. Use @cpp{scheme_peeked_read_via_get} for the default implementation of commits when @var{progress_evt_fun} is @cpp{scheme_progress_evt_via_get}. @@ -634,10 +634,10 @@ The functions are as follows. [int non_block])]{ Called to write the special value @var{v} for - @scheme[write-special] (when @var{non_block} is @cpp{0}) or - @scheme[write-special-avail*] (when @var{non_block} is + @racket[write-special] (when @var{non_block} is @cpp{0}) or + @racket[write-special-avail*] (when @var{non_block} is @cpp{1}). If @cpp{NULL} is supplied instead of a function pointer, - then @scheme[write-special] and @scheme[write-special-avail*] + then @racket[write-special] and @racket[write-special-avail*] produce an error for this port.} } @@ -714,7 +714,7 @@ Creates a Racket input file port from an ANSI C file pointer. The file [const-char* filename] [const-char* who])]{ -Opens @var{filename} for writing in @scheme['truncate/replace] mode. If +Opens @var{filename} for writing in @racket['truncate/replace] mode. If an exception is raised, the exception message uses @var{who} as the name of procedure that raised the exception.} @@ -792,7 +792,7 @@ Creates Racket input and output ports for a TCP socket @var{s}. The [char* str])]{ Creates a Racket input port from a byte string; successive - @scheme[read-char]s on the port return successive bytes in the + @racket[read-char]s on the port return successive bytes in the string.} @function[(Scheme_Object* scheme_make_byte_string_output_port)]{ @@ -839,14 +839,14 @@ Like @cpp{scheme_pipe} if @var{limit} is @cpp{0}. If @var{limit} is Returns the input-port record for @var{port}, which may be either a raw-port object with type @cpp{scheme_input_port_type} or a structure -with the @scheme[prop:input-port] property.} +with the @racket[prop:input-port] property.} @function[(Scheme_Output_Port* scheme_output_port_record [Scheme_Object* port])]{ Returns the output-port record for @var{port}, which may be either a raw-port object with type @cpp{scheme_output_port_type} or a structure -with the @scheme[prop:output-port] property.} +with the @racket[prop:output-port] property.} @function[(int scheme_file_exists [char* name])]{ @@ -868,7 +868,7 @@ Returns 1 if a directory by the given name exists, 0 otherwise. The [int* expanded] [int checks])]{ -Cleanses the pathname @var{name} (see @scheme[cleanse-path]) and +Cleanses the pathname @var{name} (see @racket[cleanse-path]) and resolves relative paths with respect to the current directory parameter. The @var{len} argument is the length of the input string; if it is -1, the string is assumed to be null-terminated. The @@ -989,7 +989,7 @@ fails.} [Scheme_Object** argv] [intptr_t* rlen])]{ -Creates a string like Racket's @scheme[format] procedure, using the +Creates a string like Racket's @racket[format] procedure, using the format string @var{format} (of length @var{flen}) and the extra arguments specified in @var{argc} and @var{argv}. If @var{rlen} is not @cpp{NULL}, @cpp{*@var{rlen}} is filled with the length of the @@ -1001,7 +1001,7 @@ resulting string.} [int argc] [Scheme_Object** argv])]{ -Writes to the current output port like Racket's @scheme[printf] +Writes to the current output port like Racket's @racket[printf] procedure, using the format string @var{format} (of length @var{flen}) and the extra arguments specified in @var{argc} and @var{argv}.} diff --git a/collects/scribblings/inside/procedures.scrbl b/collects/scribblings/inside/procedures.scrbl index eaf1535dd3..689440126a 100644 --- a/collects/scribblings/inside/procedures.scrbl +++ b/collects/scribblings/inside/procedures.scrbl @@ -16,7 +16,7 @@ procedure, and an array of @cpp{Scheme_Object*} arguments. The number of arguments passed to the function will be checked using the arity information. (The arity information provided to @cpp{scheme_make_prim_w_arity} is also used for the Racket -@scheme[arity] procedure.) The procedure implementation is not allowed +@racket[arity] procedure.) The procedure implementation is not allowed to mutate the input array of arguments; as an exception, the procedure can mutate the array if it is the same a the result of @cpp{scheme_current_argument_stack}. The procedure may mutate the @@ -60,7 +60,7 @@ maximum number of arguments that can be supplied to the procedure, or -1 if the procedure can take arbitrarily many arguments. The @var{mina} and @var{maxa} values are used for automatically checking the argument count before the primitive is invoked, and also for the -Racket @indexed-scheme[arity] procedure. The @var{name} argument is +Racket @indexed-racket[arity] procedure. The @var{name} argument is used to report application arity errors at run-time.} @function[(Scheme_Object* scheme_make_folding_prim @@ -72,9 +72,9 @@ used to report application arity errors at run-time.} Like @cpp{scheme_make_prim_w_arity}, but if @var{folding} is non-zero, the compiler assumes that an application of the procedure to constant -values can be folded to a constant. For example, @scheme[+], -@scheme[zero?], and @scheme[string-length] are folding primitives, but -@scheme[display] and @scheme[cons] are not.} +values can be folded to a constant. For example, @racket[+], +@racket[zero?], and @racket[string-length] are folding primitives, but +@racket[display] and @racket[cons] are not.} @function[(Scheme_Object* scheme_make_prim [Scheme_Prim* prim])]{ diff --git a/collects/scribblings/inside/security.scrbl b/collects/scribblings/inside/security.scrbl index f13d13894f..6bcdddc4d6 100644 --- a/collects/scribblings/inside/security.scrbl +++ b/collects/scribblings/inside/security.scrbl @@ -40,7 +40,7 @@ bitwise combination of the following: ] The @var{filename} argument can be @cpp{NULL} (in which case -@scheme[#f] is sent to the security manager's procedure), and +@racket[#f] is sent to the security manager's procedure), and @var{guards} should be @cppi{SCHEME_GUARD_FILE_EXISTS} in that case. If access is denied, an exception is raised.} diff --git a/collects/scribblings/inside/structures.scrbl b/collects/scribblings/inside/structures.scrbl index 09f523e5af..4b5175e5fd 100644 --- a/collects/scribblings/inside/structures.scrbl +++ b/collects/scribblings/inside/structures.scrbl @@ -43,7 +43,7 @@ be restricted by passing any combination of these flags: mutator procedure value/name is returned.} @item{@cppi{SCHEME_STRUCT_NO_MAKE_PREFIX} --- the constructor name - omits a @schemeidfont{make-} prefix, like @racket[struct] instead of + omits a @racketidfont{make-} prefix, like @racket[struct] instead of @racket[define-struct].} ] diff --git a/collects/scribblings/inside/threads.scrbl b/collects/scribblings/inside/threads.scrbl index e6d83cb7ce..08d506a06c 100644 --- a/collects/scribblings/inside/threads.scrbl +++ b/collects/scribblings/inside/threads.scrbl @@ -81,7 +81,7 @@ thread scheduling is based on timer interrupts, the argument is ignored. On some platforms, however, the integer represents the amount of ``fuel'' that has been consumed since the last call to @cpp{SCHEME_USE_FUEL}. For example, the implementation of -@scheme[vector->list] consumes a unit of fuel for each created cons +@racket[vector->list] consumes a unit of fuel for each created cons cell: @verbatim[#:indent 2]{ @@ -126,8 +126,8 @@ exception handler, however, in reaction to a break (if breaks are enabled). When a blocking operation is associated with an object, then the -object might make sense as an argument to @indexed-scheme[sync]. To -extend the set of objects accepted by @scheme[sync], either register +object might make sense as an argument to @indexed-racket[sync]. To +extend the set of objects accepted by @racket[sync], either register polling and sleeping functions with @cppi{scheme_add_evt}, or register a semaphore accessor with @cppi{scheme_add_evt_through_sema}. @@ -381,7 +381,7 @@ The following function @cpp{mzsleep} is an appropriate @function[(Scheme_Object* scheme_thread [Scheme_Object* thunk])]{ -Creates a new thread, just like @scheme[thread].} +Creates a new thread, just like @racket[thread].} @function[(Scheme_Object* scheme_thread_w_details [Scheme_Object* thunk] @@ -395,8 +395,8 @@ Like @cpp{scheme_thread}, except that the created thread belongs to @var{config} for its initial configuration, it uses @var{cells} for its thread-cell table, and if @var{suspend_to_kill} is non-zero, then the thread is merely suspended when it would otherwise be killed -(through either @scheme[kill-thread] or -@scheme[custodian-shutdown-all]). +(through either @racket[kill-thread] or +@racket[custodian-shutdown-all]). The @var{config} argument is typically obtained through @cpp{scheme_current_config} or @cpp{scheme_extend_config}. A @@ -459,7 +459,7 @@ Sends a break signal to the given thread.} @function[(int scheme_break_waiting [Scheme_Thread* thread])]{ -Returns @cpp{1} if a break from @scheme[break-thread] or @cpp{scheme_break_thread} +Returns @cpp{1} if a break from @racket[break-thread] or @cpp{scheme_break_thread} has occurred in the specified thread but has not yet been handled.} @function[(int scheme_block_until @@ -629,7 +629,7 @@ The argument types are defined as follows: typedef int (*Scheme_Wait_Filter_Fun)(Scheme_Object *data); } -Extends the set of waitable objects for @scheme[sync] +Extends the set of waitable objects for @racket[sync] to those with the type tag @var{type}. If @var{filter} is non-@cpp{NULL}, it constrains the new waitable set to those objects for which @var{filter} returns a non-zero value. @@ -696,9 +696,9 @@ Calls @var{prim} with the given @var{argc} and @var{argv} with breaks interrupted by a break. The @var{prim} function should not block, yield, or check for breaks after it succeeds, where ``succeeds'' depends on the operation. For example, - @scheme[tcp-accept/enable-break] is implemented by wrapping this - function around the implementation of @scheme[tcp-accept]; the - @scheme[tcp-accept] implementation does not block or yield after it + @racket[tcp-accept/enable-break] is implemented by wrapping this + function around the implementation of @racket[tcp-accept]; the + @racket[tcp-accept] implementation does not block or yield after it accepts a connection.} @function[(Scheme_Object* scheme_make_thread_cell diff --git a/collects/scribblings/inside/values.scrbl b/collects/scribblings/inside/values.scrbl index da1d160304..da89258224 100644 --- a/collects/scribblings/inside/values.scrbl +++ b/collects/scribblings/inside/values.scrbl @@ -13,7 +13,7 @@ that has the C type @cppi{Scheme_Type}. The rest of the structure, following the @cppi{Scheme_Object} header, is type-dependent. Racket's C interface gives Racket values the type @cpp{Scheme_Object*}. (The ``object'' here does not refer to objects -in the sense of the @schememodname[racket/class] library.) +in the sense of the @racketmodname[racket/class] library.) Examples of @cpp{Scheme_Type} values include @cpp{scheme_pair_type} and @cpp{scheme_symbol_type}. Some of these are implemented as @@ -25,7 +25,7 @@ types. For most Racket types, a constructor is provided for creating values of the type. For example, @cpp{scheme_make_pair} takes two -@cpp{Scheme_Object*} values and returns the @scheme[cons] of the +@cpp{Scheme_Object*} values and returns the @racket[cons] of the values. The macro @cppdef{SCHEME_TYPE} takes a @cpp{Scheme_Object *} and returns @@ -149,12 +149,12 @@ types: @cppdef{SCHEME_BOXP}} @item{@cppdef{scheme_pair_type} --- @cppdef{SCHEME_CAR} extracts/sets - the @scheme[car] and @cppdef{SCHEME_CDR} extracts/sets the - @scheme[cdr]; test for this type with @cppdef{SCHEME_PAIRP}} + the @racket[car] and @cppdef{SCHEME_CDR} extracts/sets the + @racket[cdr]; test for this type with @cppdef{SCHEME_PAIRP}} @item{@cppdef{scheme_mutable_pair_type} --- @cppdef{SCHEME_MCAR} extracts/sets - the @scheme[mcar] and @cppdef{SCHEME_MCDR} extracts/sets the - @scheme[mcdr]; test for this type with @cppdef{SCHEME_MPAIRP}} + the @racket[mcar] and @cppdef{SCHEME_MCDR} extracts/sets the + @racket[mcdr]; test for this type with @cppdef{SCHEME_MPAIRP}} @item{@cppdef{scheme_vector_type} --- @cppdef{SCHEME_VEC_SIZE} extracts the length and @cppdef{SCHEME_VEC_ELS} extracts the array of @@ -175,13 +175,13 @@ types: extracts/sets the user data pointer; test for just this type with @cppdef{SCHEME_INPORTP}, but use @cppdef{SCHEME_INPUT_PORTP} to recognize all input ports (including structures with the - @scheme[prop:input-port] property)} + @racket[prop:input-port] property)} @item{@cppdef{scheme_output_port_type} --- @cppdef{SCHEME_OUTPORT_VAL} extracts/sets the user data pointer; test for just this type with @cppdef{SCHEME_OUTPORTP}, but use @cppdef{SCHEME_OUTPUT_PORTP} to recognize all output ports (including structures with the - @scheme[prop:output-port] property)} + @racket[prop:output-port] property)} @item{@cppdef{scheme_thread_type} --- thread descriptors; test for this type with @cppdef{SCHEME_THREADP}} @@ -229,7 +229,7 @@ The following are the procedure types: @item{@cppdef{scheme_escaping_cont_type} --- an escape continuation} - @item{@cppdef{scheme_case_closure_type} --- a @scheme[case-lambda] + @item{@cppdef{scheme_case_closure_type} --- a @racket[case-lambda] procedure} @item{@cppdef{scheme_native_closure_type} --- a procedure with @@ -435,7 +435,7 @@ value.} [Scheme_Object* carv] [Scheme_Object* cdrv])]{ -Makes a @scheme[cons] pair.} +Makes a @racket[cons] pair.} @function[(Scheme_Object* scheme_make_byte_string [char* bytes])]{ @@ -725,7 +725,7 @@ Such a printer must print a representation of the value using @cppi{scheme_print_bytes} and @cppi{scheme_print_string}. The first argument to the printer, @var{v}, is the value to be printed. The second argument indicates whether @var{v} is printed via - @scheme[write] or @scheme[display]. The last argument is to be passed + @racket[write] or @racket[display]. The last argument is to be passed on to @cppi{scheme_print_bytes} or @cppi{scheme_print_string} to identify the printing context.} @@ -776,7 +776,7 @@ follows: } The two hash functions are use to generate primary and secondary keys -for double hashing in an @scheme[equal?]-based hash table. The result +for double hashing in an @racket[equal?]-based hash table. The result of the primary-key function should depend on both @var{obj} and @var{base}. diff --git a/collects/scribblings/raco/api.scrbl b/collects/scribblings/raco/api.scrbl index f4ff5cc836..b1700de424 100644 --- a/collects/scribblings/raco/api.scrbl +++ b/collects/scribblings/raco/api.scrbl @@ -19,7 +19,7 @@ @defmodule[compiler/compiler]{ -The @schememodname[compiler/compiler] library provides the +The @racketmodname[compiler/compiler] library provides the functionality of @exec{mzc} for compilation to bytecode and via C, but through a Racket API.} @@ -32,40 +32,40 @@ through a Racket API.} [dest-dir (or/c path-string? false/c (one-of/c 'auto))]) void?]{ -Supplying just @scheme[expr] returns a compiler that is initialized -with the expression @scheme[expr], as described below. +Supplying just @racket[expr] returns a compiler that is initialized +with the expression @racket[expr], as described below. The compiler takes a list of Racket files and compiles each of them to bytecode, placing the resulting bytecode in a @filepath{.zo} file -within the directory specified by @scheme[dest-dir]. If -@scheme[dest-dir] is @scheme[#f], each bytecode result is placed in -the same directory as its source file. If @scheme[dest-dir] is -@scheme['auto], each bytecode file is placed in a @filepath{compiled} +within the directory specified by @racket[dest-dir]. If +@racket[dest-dir] is @racket[#f], each bytecode result is placed in +the same directory as its source file. If @racket[dest-dir] is +@racket['auto], each bytecode file is placed in a @filepath{compiled} subdirectory relative to the source; the directory is created if necessary. -If @scheme[expr] is anything other than @scheme[#f], then a namespace +If @racket[expr] is anything other than @racket[#f], then a namespace is created for compiling the files that are supplied later, and -@scheme[expr] is evaluated to initialize the created namespace. For -example, @scheme[expr] might load a set of macros. In addition, the +@racket[expr] is evaluated to initialize the created namespace. For +example, @racket[expr] might load a set of macros. In addition, the expansion-time part of each expression later compiled is evaluated in the namespace before being compiled, so that the effects are visible when compiling later expressions. -If @scheme[expr] is @scheme[#f], then no compilation namespace is +If @racket[expr] is @racket[#f], then no compilation namespace is created (the current namespace is used), and expressions in the files are assumed to compile independently (so there's no need to evaluate the expansion-time part of an expression to compile). -Typically, @scheme[expr] is @scheme[#f] for compiling @scheme[module] -files, and it is @scheme[(void)] for compiling files with top-level +Typically, @racket[expr] is @racket[#f] for compiling @racket[module] +files, and it is @racket[(void)] for compiling files with top-level definitions and expressions. -If @scheme[module?] is @scheme[#t], then the given files are read and +If @racket[module?] is @racket[#t], then the given files are read and compiled as modules (so there is no dependency on the current namespace's top-level environment). -If @scheme[verbose?] is @scheme[#t], the output file for each given +If @racket[verbose?] is @racket[#t], the output file for each given file is reported through the current output port.} @@ -85,10 +85,10 @@ The @filepath{.zo} files are placed into the collection's By default, all files with the extension @filepath{.rkt}, @filepath{.ss}, or @filepath{.scm} in a collection are compiled, as are all such files within subdirectories, execept that -any file or directory whose path starts with @scheme[skip-path] is -skipped. (``Starts with'' means that the simplified path @scheme[_p]'s -byte-string form after @scheme[(simplify-path _p #f)]starts with the -byte-string form of @scheme[(simplify-path skip-path #f)].) +any file or directory whose path starts with @racket[skip-path] is +skipped. (``Starts with'' means that the simplified path @racket[_p]'s +byte-string form after @racket[(simplify-path _p #f)]starts with the +byte-string form of @racket[(simplify-path skip-path #f)].) The collection compiler reads the collection's @filepath{info.rkt} file (see @secref["info.rkt"]) to obtain further instructions for compiling the @@ -96,12 +96,12 @@ collection. The following fields are used: @itemize[ - @item{@indexed-scheme[name] : The name of the collection as a string, used + @item{@indexed-racket[name] : The name of the collection as a string, used only for status and error reporting.} - @item{@indexed-scheme[compile-omit-paths] : A list of immediate file + @item{@indexed-racket[compile-omit-paths] : A list of immediate file and directory paths that should not be compiled. Alternatively, - this field's value @scheme['all], which is equivalent to + this field's value @racket['all], which is equivalent to specifying all files and directories in the collection (to effectively ignore the collection for compilation). Automatically omitted files and directories are @@ -111,18 +111,18 @@ collection. The following fields are used: Files that are required by other files, however, are always compiled in the process of compiling the requiring file---even when the required file is listed with this field or when the - field's value is @scheme['all].} + field's value is @racket['all].} - @item{@indexed-scheme[compile-omit-files] : A list of filenames (without + @item{@indexed-racket[compile-omit-files] : A list of filenames (without directory paths); that are not compiled, in addition to the - contents of @scheme[compile-omit-paths]. Do not use this + contents of @racket[compile-omit-paths]. Do not use this field; it is for backward compatibility.} - @item{@indexed-scheme[scribblings] : A list of pairs, each of which + @item{@indexed-racket[scribblings] : A list of pairs, each of which starts with a path for documentation source. The sources (and the files that they require) are compiled in the same way as @filepath{.rkt}, @filepath{.ss}, and @filepath{.scm} files, - unless the provided @scheme[skip-docs?] argument is a true + unless the provided @racket[skip-docs?] argument is a true value.} ]} @@ -138,9 +138,9 @@ collection. The following fields are used: (make-caching-managed-compile-zo)]) void?]{ -Like @scheme[compile-collection-zos], but compiles the given directory -rather than a collection. The @scheme[info] function behaves like the -result of @scheme[get-info] to supply @filepath{info.rkt} fields, +Like @racket[compile-collection-zos], but compiles the given directory +rather than a collection. The @racket[info] function behaves like the +result of @racket[get-info] to supply @filepath{info.rkt} fields, instead of using an @filepath{info.rkt} file (if any) in the directory.} @; ---------------------------------------------------------------------- @@ -152,11 +152,11 @@ instead of using an @filepath{info.rkt} file (if any) in the directory.} [dest-dir (or/c path-string? false/c (one-of/c 'auto))]) void?]{ -Like @scheme[compile-zos], but the @scheme[racket-files] are compiled -to native-code extensions via C. If @scheme[dest-dir] is -@scheme['auto], each extension file (@filepath{.dll}, @filepath{.so}, +Like @racket[compile-zos], but the @racket[racket-files] are compiled +to native-code extensions via C. If @racket[dest-dir] is +@racket['auto], each extension file (@filepath{.dll}, @filepath{.so}, or @filepath{.dylib}) is placed in a subdirectory relative to the -source produced by @scheme[(build-path "compiled" "native" +source produced by @racket[(build-path "compiled" "native" (system-library-subpath))]; the directory is created if necessary.} @@ -165,7 +165,7 @@ source produced by @scheme[(build-path "compiled" "native" [dest-dir (or/c path-string? false/c (one-of/c 'auto))]) void?]{ -Like @scheme[compile-extensions], but only @filepath{.c} files are +Like @racket[compile-extensions], but only @filepath{.c} files are produced, not extensions.} @@ -175,19 +175,19 @@ produced, not extensions.} void?]{ Compiles each @filepath{.c} file (usually produced with -@scheme[compile-extensions-to-c]) in @scheme[c-files] to an -extension. The @scheme[dest-dir] argument is handled as in -@scheme[compile-extensions]. } +@racket[compile-extensions-to-c]) in @racket[c-files] to an +extension. The @racket[dest-dir] argument is handled as in +@racket[compile-extensions]. } @; ---------------------------------------------------------------------- @section[#:tag "api:loading"]{Loading compiler support} -The compiler unit loads certain tools on demand via @scheme[dynamic-require] -and @scheme[get-info]. If the namespace used during compilation is different +The compiler unit loads certain tools on demand via @racket[dynamic-require] +and @racket[get-info]. If the namespace used during compilation is different from the namespace used to load the compiler, or if other load-related parameters are set, then the following parameter can be used to -restore settings for @scheme[dynamic-require]. +restore settings for @racket[dynamic-require]. @defparam[current-compiler-dynamic-require-wrapper proc @@ -195,8 +195,8 @@ restore settings for @scheme[dynamic-require]. A parameter whose value is a procedure that takes a thunk to apply. The default wrapper sets the current namespace (via -@scheme[parameterize]) before calling the thunk, using the namespace -in which the @scheme[compiler/compiler] library was originally +@racket[parameterize]) before calling the thunk, using the namespace +in which the @racket[compiler/compiler] library was originally instantiated.} @; ---------------------------------------------------------------------- @@ -205,22 +205,22 @@ instantiated.} @defmodule[compiler/option]{ -The @schememodname[compiler/option] module provides options (in the +The @racketmodname[compiler/option] module provides options (in the form of parameters) that control the compiler's behaviors.} -More options are defined by the @schememodname[dynext/compile] and -@schememodname[dynext/link] libraries, which control the actual C +More options are defined by the @racketmodname[dynext/compile] and +@racketmodname[dynext/link] libraries, which control the actual C compiler and linker that are used for compilation via C. @defboolparam[somewhat-verbose on?]{ -A @scheme[#t] value for the parameter causes the compiler to print -the files that it compiles and produces. The default is @scheme[#f].} +A @racket[#t] value for the parameter causes the compiler to print +the files that it compiles and produces. The default is @racket[#f].} @defboolparam[verbose on?]{ -A @scheme[#t] value for the parameter causes the compiler to print -verbose messages about its operations. The default is @scheme[#f].} +A @racket[#t] value for the parameter causes the compiler to print +verbose messages about its operations. The default is @racket[#f].} @defparam[setup-prefix str string?]{ @@ -228,47 +228,47 @@ A parameter that specifies a string to embed in public function names when compiling via C. This is used mainly for compiling extensions with the collection name so that cross-extension conflicts are less likely in architectures that expose the public names of loaded -extensions. The default is @scheme[""].} +extensions. The default is @racket[""].} @defboolparam[clean-intermediate-files clean?]{ -A @scheme[#f] value for the parameter keeps intermediate @filepath{.c} +A @racket[#f] value for the parameter keeps intermediate @filepath{.c} and @filepath{.o} files generated during compilation via C. The -default is @scheme[#t].} +default is @racket[#t].} @defparam[compile-subcollections cols (one-of/c #t #f)]{ A parameter that specifies whether sub-collections are compiled by -@scheme[compile-collection-zos]. The default is @scheme[#t].} +@racket[compile-collection-zos]. The default is @racket[#t].} @defboolparam[compile-for-embedded embed?]{ -A @scheme[#t] values for this parameter creates @filepath{.c} files +A @racket[#t] values for this parameter creates @filepath{.c} files and object files to be linked directly with an embedded Racket run-time system, instead of @filepath{.c} files and object files to be dynamically loaded into Racket as an extension. The default is -@scheme[#f].} +@racket[#f].} @defboolparam[propagate-constants prop?]{ A parameter to control the compiler's constant propagating when -compiling via C. The default is @scheme[#t].} +compiling via C. The default is @racket[#t].} @defboolparam[assume-primitives assume?]{ -A @scheme[#t] parameter value effectively adds @scheme[(require +A @racket[#t] parameter value effectively adds @racket[(require mzscheme)] to the beginning of the program. This parameter is useful -only when compiling non-@scheme[module] code. The default is -@scheme[#f].} +only when compiling non-@racket[module] code. The default is +@racket[#f].} @defboolparam[stupid allow?]{ A parameter that allow obvious non-syntactic errors, such as -@scheme[((lambda () 0) 1 2 3)], when compiling via C. The default is -@scheme[#f].} +@racket[((lambda () 0) 1 2 3)], when compiling via C. The default is +@racket[#f].} @defparam[vehicles mode symbol?]{ @@ -277,44 +277,44 @@ possible values are: @itemize[ - @item{@scheme['vehicles:automatic] : automatic grouping} + @item{@racket['vehicles:automatic] : automatic grouping} - @item{@scheme['vehicles:functions] : groups within a procedure} + @item{@racket['vehicles:functions] : groups within a procedure} - @item{@scheme['vehicles:monolithic] : groups randomly} + @item{@racket['vehicles:monolithic] : groups randomly} ]} @defparam[vehicles:monoliths count exact-nonnegative-integer?]{ A parameter that determines the number of random -groups for @scheme['vehicles:monolithic] mode.} +groups for @racket['vehicles:monolithic] mode.} @defparam[seed val exact-nonnegative-integer?]{ -Sets the randomizer seed for @scheme['vehicles:monolithic] mode.} +Sets the randomizer seed for @racket['vehicles:monolithic] mode.} @defparam[max-exprs-per-top-level-set n exact-nonnegative-integer?]{ A parameter that determines the number of top-level Racket expressions crammed into one C function when compiling via C. The default is -@scheme[25].} +@racket[25].} @defboolparam[unpack-environments unpack?]{ -Setting this parameter to @scheme[#f] might help compilation via C -for register-poor architectures. The default is @scheme[#t].} +Setting this parameter to @racket[#f] might help compilation via C +for register-poor architectures. The default is @racket[#t].} @defboolparam[debug on?]{ -A @scheme[#t] creates a @filepath{debug.txt} debugging file when -compiling via C. The default is @scheme[#f].} +A @racket[#t] creates a @filepath{debug.txt} debugging file when +compiling via C. The default is @racket[#f].} @defboolparam[test on?]{ -A @scheme[#t] value for this parameter causes compilation via C to +A @racket[#t] value for this parameter causes compilation via C to ignore top-level expressions with syntax errors. The default is -@scheme[#f].} +@racket[#f].} @; ---------------------------------------------------------------------- @@ -329,24 +329,24 @@ ignore top-level expressions with syntax errors. The default is @defsignature/splice[compiler^ ()]{ Includes all of the names exported by -@schememodname[compiler/compiler].} +@racketmodname[compiler/compiler].} @defsignature/splice[compiler:option^ ()]{ Includes all of the names exported by -@schememodname[compiler/option].} +@racketmodname[compiler/option].} @defsignature[compiler:inner^ ()]{ -@signature-desc{The high-level @schememodname[compiler/compiler] +@signature-desc{The high-level @racketmodname[compiler/compiler] interface relies on a low-level implementation of the extension -compiler, which is available from @schememodname[compiler/comp-unit] -as implementing the @scheme[compiler:inner^] signature.} +compiler, which is available from @racketmodname[compiler/comp-unit] +as implementing the @racket[compiler:inner^] signature.} @defproc[(eval-compile-prefix [expr any/c]) void?]{ -Evaluates @scheme[expr]. Future calls to @sigelem[compiler:inner^ +Evaluates @racket[expr]. Future calls to @sigelem[compiler:inner^ compile-extension] or @sigelem[compiler:inner^ compile-extension-to-c] see the effects of the evaluation.} @@ -378,12 +378,12 @@ Compiles a single @filepath{.c} file to an extension.} @defthing[compiler@ unit?]{ -Provides the exports of @schememodname[compiler/compiler] in unit +Provides the exports of @racketmodname[compiler/compiler] in unit form, where C-compiler operations are imports to the unit. -The unit imports @scheme[compiler:option^], @scheme[dynext:compile^], -@scheme[dynext:link^], and @scheme[dynext:file^]. It exports -@scheme[compiler^].} +The unit imports @racket[compiler:option^], @racket[dynext:compile^], +@racket[dynext:link^], and @racket[dynext:file^]. It exports +@racket[compiler^].} @; ---------------------------------------- @@ -393,9 +393,9 @@ The unit imports @scheme[compiler:option^], @scheme[dynext:compile^], @defthing[compiler:option@ unit?]{ -Provides the exports of @schememodname[compiler/option] in unit +Provides the exports of @racketmodname[compiler/option] in unit form. It imports no signatures, and exports -@scheme[compiler:option^].} +@racket[compiler:option^].} @; ---------------------------------------- @@ -405,7 +405,7 @@ form. It imports no signatures, and exports @defthing[comp@ unit?]{ -The unit imports @scheme[compiler:option^], @scheme[dynext:compile^], -@scheme[dynext:link^], and @scheme[dynext:file^]. It exports -@scheme[compiler:inner^].} +The unit imports @racket[compiler:option^], @racket[dynext:compile^], +@racket[dynext:link^], and @racket[dynext:file^]. It exports +@racket[compiler:inner^].} diff --git a/collects/scribblings/raco/command.scrbl b/collects/scribblings/raco/command.scrbl index 79f3c686b0..a2e210167f 100644 --- a/collects/scribblings/raco/command.scrbl +++ b/collects/scribblings/raco/command.scrbl @@ -12,7 +12,7 @@ library of a collection or package (see @secref["info.rkt"]). The value bound to @racket[raco-commands] must be a list of command specifications, where each specification is a list of four values: -@schemeblock[ +@racketblock[ (list _command-string _implementationmodule-path _description-string @@ -24,7 +24,7 @@ prefix of a command name can be supplied to @exec{raco} to invoke the command. The @racket[_module-path] names the implementation though a module -path (in the sense of @scheme[module-path?]). The module is loaded and +path (in the sense of @racket[module-path?]). The module is loaded and invoked through @racket[dynamic-require] to run the command. The module can access command-line arguments through the @racket[current-command-line-arguments] parameter, which is adjusted @@ -39,7 +39,7 @@ command in response to @exec{raco help}. The description should not be capitalized or end with a period. The @racket[_prominence] value should be a read number or -@scheme[#f]. A @racket[#f] value means that the command should not be +@racket[#f]. A @racket[#f] value means that the command should not be included in the short list of ``frequently used commands.'' A number indicates the relative prominence of the command; the @exec{help} command has a value of @racket[110], and probably no command should be @@ -50,7 +50,7 @@ least-prominent of the frequently used commands, has a value of As an example, the @filepath{info.rkt} of the "compiler" collection might contain the -@schemeblock[ +@racketblock[ (define raco-commands '(("make" compiler/commands/make "compile source to bytecode" 100) ("decompile" compiler/commands/decompile "decompile bytecode" #f))) @@ -87,7 +87,7 @@ The result of this function is suitable for use with @racket[command-line]. For example, the @exec{decompile} tool parses command-line arguments with -@schemeblock[ +@racketblock[ (define source-files (command-line #:program (short-program+command-name) diff --git a/collects/scribblings/raco/info.scrbl b/collects/scribblings/raco/info.scrbl index 066ef0b4d3..0940bebca3 100644 --- a/collects/scribblings/raco/info.scrbl +++ b/collects/scribblings/raco/info.scrbl @@ -16,9 +16,9 @@ DrRacket or commands for @exec{raco} that the collection provides. Although an @filepath{info.rkt} file contains a module declaration, the declaration has a highly constrained form. It must match the following -grammar of @scheme[_info-module]: +grammar of @racket[_info-module]: -@schemegrammar*[ +@racketgrammar*[ #:literals (info lib setup/infotab quote quasiquote cons car cdr list list* reverse append string-append path->string build-path @@ -50,10 +50,10 @@ grammar of @scheme[_info-module]: For example, the following declaration could be the @filepath{info.rkt} library of the @filepath{games} collection. It contains definitions for -three info tags, @scheme[name], @scheme[racket-launcher-libraries], and -@scheme[racket-launcher-names]. +three info tags, @racket[name], @racket[racket-launcher-libraries], and +@racket[racket-launcher-names]. -@schememod[ +@racketmod[ setup/infotab (define name "Games") (define gracket-launcher-libraries '("main.rkt")) @@ -61,7 +61,7 @@ setup/infotab ] As illustrated in this example, an @filepath{info.rkt} file can use -@hash-lang[] notation, but only with the @schememodname[setup/infotab] +@hash-lang[] notation, but only with the @racketmodname[setup/infotab] language. -See also @scheme[get-info] from @schememodname[setup/getinfo]. +See also @racket[get-info] from @racketmodname[setup/getinfo]. diff --git a/collects/scribblings/raco/make.scrbl b/collects/scribblings/raco/make.scrbl index b9b164f6ad..9da11b746f 100644 --- a/collects/scribblings/raco/make.scrbl +++ b/collects/scribblings/raco/make.scrbl @@ -360,7 +360,7 @@ parallel builder should continue without compiling @racket[zo-path]. @defmodule[setup/parallel-build]{ -The @schememodname[setup/parallel-build] library provides the parallel compilation to bytecode +The @racketmodname[setup/parallel-build] library provides the parallel compilation to bytecode functionality of @exec{rack setup} and @exec{raco make}.} @; ---------------------------------------------------------------------- diff --git a/collects/scribblings/raco/setup.scrbl b/collects/scribblings/raco/setup.scrbl index e3f083bf43..328eba88f1 100644 --- a/collects/scribblings/raco/setup.scrbl +++ b/collects/scribblings/raco/setup.scrbl @@ -76,8 +76,8 @@ The @exec{raco setup} command performs two main services: @elemref["clean"]{@racket[clean]} for more information. The @DFlag{workers} (or @Flag{j}) flag to @exec{raco setup} takes - an argument @scheme[_n] to make compilation use up to @scheme[_n] - parallel processes. The default value of @scheme[_n] is + an argument @racket[_n] to make compilation use up to @racket[_n] + parallel processes. The default value of @racket[_n] is @racket[(processor-count)], which typically uses all the machine's processing cores. @@ -266,72 +266,72 @@ Optional @filepath{info.rkt} fields trigger additional actions by separated by space if @racket[(truncate (/ _n 10))]and @racket[(truncate (/ _m 10))] are different.} - @item{@scheme[racket-launcher-names] : @scheme[(listof string?)] + @item{@racket[racket-launcher-names] : @racket[(listof string?)] --- @elemtag["racket-launcher-names"] A list of executable names to be generated in the installation's executable directory to run Racket-based programs implemented by the collection. A parallel list of library names must be provided by - @scheme[racket-launcher-libraries] or - @scheme[racket-launcher-flags]. + @racket[racket-launcher-libraries] or + @racket[racket-launcher-flags]. For each name, a launching executable is set up using - @scheme[make-racket-launcher]. The arguments are @Flag{l-} and + @racket[make-racket-launcher]. The arguments are @Flag{l-} and @tt{@nonterm{colls}/.../@nonterm{file}}, where @nonterm{file} is - the file named by @scheme[racket-launcher-libraries] and + the file named by @racket[racket-launcher-libraries] and @tt{@nonterm{colls}/...} are the collections (and subcollections) of the @filepath{info.rkt} file. In addition, - @schemeblock[ + @racketblock[ (build-aux-from-path (build-path (collection-path #,(nonterm "colls") _...) #,(nonterm "suffixless-file"))) ] - is provided for the optional @scheme[_aux] argument (for icons, - etc.) to @scheme[make-racket-launcher], where where + is provided for the optional @racket[_aux] argument (for icons, + etc.) to @racket[make-racket-launcher], where where @nonterm{suffixless-file} is @nonterm{file} without its suffix. - If @scheme[racket-launcher-flags] is provided, it is used as a + If @racket[racket-launcher-flags] is provided, it is used as a list of command-line arguments passed to @exec{racket} instead of the above default, allowing arbitrary command-line arguments. If - @scheme[racket-launcher-flags] is specified together with - @scheme[racket-launcher-libraries], then the flags will override + @racket[racket-launcher-flags] is specified together with + @racket[racket-launcher-libraries], then the flags will override the libraries, but the libraries can still be used to specify a - name for @scheme[build-aux-from-path] (to find related information + name for @racket[build-aux-from-path] (to find related information like icon files etc).} - @item{@scheme[racket-launcher-libraries] : @scheme[(listof + @item{@racket[racket-launcher-libraries] : @racket[(listof path-string?)] --- A list of library names in parallel to - @elemref["racket-launcher-names"]{@scheme[racket-launcher-names]}.} + @elemref["racket-launcher-names"]{@racket[racket-launcher-names]}.} - @item{@scheme[racket-launcher-flags] : @scheme[(listof string?)] + @item{@racket[racket-launcher-flags] : @racket[(listof string?)] --- A list of command-line flag lists, in parallel to - @elemref["racket-launcher-names"]{@scheme[racket-launcher-names]}.} + @elemref["racket-launcher-names"]{@racket[racket-launcher-names]}.} - @item{@scheme[mzscheme-launcher-names], - @scheme[mzscheme-launcher-libraries], and - @scheme[mzscheme-launcher-flags] --- Backward-compatible variant of + @item{@racket[mzscheme-launcher-names], + @racket[mzscheme-launcher-libraries], and + @racket[mzscheme-launcher-flags] --- Backward-compatible variant of @racket[racket-launcher-names], etc.} - @item{@scheme[gracket-launcher-names] : @scheme[(listof string?)] --- + @item{@racket[gracket-launcher-names] : @racket[(listof string?)] --- @elemtag["gracket-launcher-names"] Like - @elemref["racket-launcher-names"]{@scheme[racket-launcher-names]}, + @elemref["racket-launcher-names"]{@racket[racket-launcher-names]}, but for GRacket-based executables. The launcher-name list is treated - in parallel to @scheme[gracket-launcher-libraries] and - @scheme[gracket-launcher-flags].} + in parallel to @racket[gracket-launcher-libraries] and + @racket[gracket-launcher-flags].} - @item{@scheme[gracket-launcher-libraries] : @scheme[(listof path-string?)] + @item{@racket[gracket-launcher-libraries] : @racket[(listof path-string?)] --- A list of library names in parallel to - @elemref["gracket-launcher-names"]{@scheme[gracket-launcher-names]}.} + @elemref["gracket-launcher-names"]{@racket[gracket-launcher-names]}.} - @item{@scheme[gracket-launcher-flags] : @scheme[(listof string?)] --- A + @item{@racket[gracket-launcher-flags] : @racket[(listof string?)] --- A list of command-line flag lists, in parallel to - @elemref["gracket-launcher-names"]{@scheme[gracket-launcher-names]}.} + @elemref["gracket-launcher-names"]{@racket[gracket-launcher-names]}.} - @item{@scheme[mred-launcher-names], - @scheme[mred-launcher-libraries], and - @scheme[mred-launcher-flags] --- Backward-compatible variant of + @item{@racket[mred-launcher-names], + @racket[mred-launcher-libraries], and + @racket[mred-launcher-flags] --- Backward-compatible variant of @racket[gracket-launcher-names], etc.} @item{@racket[install-collection] : @racket[path-string?] --- A @@ -1047,7 +1047,7 @@ An @deftech{unpackable} is one of the following: false/c)]{ Accepts a list of strings naming a collection or sub-collection, and calls @racket[get-info/full] with the full path corresponding to the - named collection and the @scheme[namespace] argument.} + named collection and the @racket[namespace] argument.} @defproc[(get-info/full [path path?] [#:namespace namespace (or/c namespace? #f) #f]) @@ -1080,7 +1080,7 @@ An @deftech{unpackable} is one of the following: or returning the @racket[get-info] function from the @filepath{info.rkt} file. The @filepath{info.rkt} (or @filepath{info.ss}) module is loaded - into @scheme[namespace] if it is not @scheme[#f], or a private, + into @racket[namespace] if it is not @racket[#f], or a private, weakly-held namespace otherwise.} @defproc[(find-relevant-directories diff --git a/collects/scribblings/reference/async-channels.scrbl b/collects/scribblings/reference/async-channels.scrbl index dbf76017ee..39649bc6e1 100644 --- a/collects/scribblings/reference/async-channels.scrbl +++ b/collects/scribblings/reference/async-channels.scrbl @@ -15,41 +15,41 @@ @defproc[(async-channel? [v any/c]) boolean?]{ -Returns @scheme[#t] if @scheme[v] is an asynchronous channel, -@scheme[#f] otherwise.} +Returns @racket[#t] if @racket[v] is an asynchronous channel, +@racket[#f] otherwise.} @defproc[(make-async-channel [limit (or/c exact-positive-integer? #f) #f]) async-channel?]{ -Returns an asynchronous channel with a buffer limit of @scheme[limit] +Returns an asynchronous channel with a buffer limit of @racket[limit] items. A get operation blocks when the channel is empty, and a put -operation blocks when the channel has @scheme[limit] items already. -If @scheme[limit] is @scheme[#f], the channel buffer has no limit (so +operation blocks when the channel has @racket[limit] items already. +If @racket[limit] is @racket[#f], the channel buffer has no limit (so a put never blocks). The asynchronous channel value can be used directly with -@scheme[sync]. The channel blocks until @scheme[async-channel-get] +@racket[sync]. The channel blocks until @racket[async-channel-get] would return a value, and the unblock result is the received value.} @defproc[(async-channel-get [ach async-channel?]) any/c]{ -Blocks until at least one value is available in @scheme[ach], and then +Blocks until at least one value is available in @racket[ach], and then returns the first of the values that were put into -@scheme[async-channel].} +@racket[async-channel].} @defproc[(async-channel-try-get [ach async-channel?]) any/c]{ -If at least one value is immediately available in @scheme[ach], -returns the first of the values that were put into @scheme[ach]. If -@scheme[async-channel] is empty, the result is @scheme[#f].} +If at least one value is immediately available in @racket[ach], +returns the first of the values that were put into @racket[ach]. If +@racket[async-channel] is empty, the result is @racket[#f].} @defproc[(async-channel-put [ach async-channel?] [v any/c]) void?]{ -Puts @scheme[v] into @scheme[ach], blocking if @scheme[ach]'s buffer +Puts @racket[v] into @racket[ach], blocking if @racket[ach]'s buffer is full until space is available.} @@ -57,8 +57,8 @@ is full until space is available.} evt?]{ Returns a @tech{synchronizable event} that is blocked while -@scheme[(async-channel-put ach v)] would block. The unblock result is -the event itself. See also @scheme[sync].} +@racket[(async-channel-put ach v)] would block. The unblock result is +the event itself. See also @racket[sync].} @defexamples[#:eval (async-eval) (define (server input-channel output-channel) diff --git a/collects/scribblings/reference/block.scrbl b/collects/scribblings/reference/block.scrbl index 6409347d97..7dacbf16a2 100644 --- a/collects/scribblings/reference/block.scrbl +++ b/collects/scribblings/reference/block.scrbl @@ -11,15 +11,15 @@ @defform[(block defn-or-expr ...)]{ Supports a mixture of expressions and mutually recursive definitions, -as in a @scheme[module] body. Unlike an @tech{internal-definition +as in a @racket[module] body. Unlike an @tech{internal-definition context}, the last @racket[defn-or-expr] need not be an expression. -The result of the @scheme[block] form is the result -of the last @scheme[defn-or-expr] if it is an expression, -@|void-const| otherwise. If no @scheme[defn-or-expr] is provided -(after flattening @scheme[begin] forms), the result is @|void-const|. +The result of the @racket[block] form is the result +of the last @racket[defn-or-expr] if it is an expression, +@|void-const| otherwise. If no @racket[defn-or-expr] is provided +(after flattening @racket[begin] forms), the result is @|void-const|. -The final @scheme[defn-or-expr] is executed in tail position, if it is +The final @racket[defn-or-expr] is executed in tail position, if it is an expression. diff --git a/collects/scribblings/reference/booleans.scrbl b/collects/scribblings/reference/booleans.scrbl index facc0d1360..5eb0dfdbd4 100644 --- a/collects/scribblings/reference/booleans.scrbl +++ b/collects/scribblings/reference/booleans.scrbl @@ -4,17 +4,17 @@ @title[#:tag "booleans"]{Booleans and Equality} True and false @deftech{booleans} are represented by the values -@scheme[#t] and @scheme[#f], respectively, though operations that -depend on a boolean value typically treat anything other than @scheme[#f] +@racket[#t] and @racket[#f], respectively, though operations that +depend on a boolean value typically treat anything other than @racket[#f] as true. -See also: @scheme[and], @scheme[or], @scheme[andmap], @scheme[ormap]. +See also: @racket[and], @racket[or], @racket[andmap], @racket[ormap]. @defproc[(boolean? [v any/c]) boolean?]{ -Returns @scheme[#t] if @scheme[v] is @scheme[#t] or @scheme[#f], -@scheme[#f] otherwise. +Returns @racket[#t] if @racket[v] is @racket[#t] or @racket[#f], +@racket[#f] otherwise. @examples[ (boolean? #f) @@ -25,7 +25,7 @@ Returns @scheme[#t] if @scheme[v] is @scheme[#t] or @scheme[#f], @defproc[(not [v any/c]) boolean?]{ -Returns @scheme[#t] if @scheme[v] is @scheme[#f], @scheme[#f] otherwise. +Returns @racket[#t] if @racket[v] is @racket[#f], @racket[#f] otherwise. @examples[ (not #f) @@ -36,15 +36,15 @@ Returns @scheme[#t] if @scheme[v] is @scheme[#f], @scheme[#f] otherwise. @defproc[(equal? [v1 any/c] [v2 any/c]) boolean?]{ -Two values are @scheme[equal?] if and only if they are @scheme[eqv?], +Two values are @racket[equal?] if and only if they are @racket[eqv?], unless otherwise specified for a particular datatype. -Datatypes with further specification of @scheme[equal?] include +Datatypes with further specification of @racket[equal?] include strings, byte strings, numbers, pairs, mutable pairs, vectors, boxes, hash tables, and inspectable structures. In the last five cases, equality -is recursively defined; if both @scheme[v1] and @scheme[v2] contain +is recursively defined; if both @racket[v1] and @racket[v2] contain reference cycles, they are equal when the infinite unfoldings of the -values would be equal. See also @scheme[prop:equal+hash] and @racket[prop:impersonator-of]. +values would be equal. See also @racket[prop:equal+hash] and @racket[prop:impersonator-of]. @examples[ (equal? 'yes 'yes) @@ -57,11 +57,11 @@ values would be equal. See also @scheme[prop:equal+hash] and @racket[prop:impers @defproc[(eqv? [v1 any/c] [v2 any/c]) boolean?]{ -Two values are @scheme[eqv?] if and only if they are @scheme[eq?], +Two values are @racket[eqv?] if and only if they are @racket[eq?], unless otherwise specified for a particular datatype. The @tech{number} and @tech{character} datatypes are the only ones for which -@scheme[eqv?] differs from @scheme[eq?]. +@racket[eqv?] differs from @racket[eq?]. @examples[ (eqv? 'yes 'yes) @@ -75,8 +75,8 @@ The @tech{number} and @tech{character} datatypes are the only ones for which @defproc[(eq? [v1 any/c] [v2 any/c]) boolean?]{ -Return @scheme[#t] if @scheme[v1] and @scheme[v2] refer to the same -object, @scheme[#f] otherwise. See also @secref["model-eq"]. +Return @racket[#t] if @racket[v1] and @racket[v2] refer to the same +object, @racket[#f] otherwise. See also @secref["model-eq"]. @examples[ (eq? 'yes 'yes) @@ -89,11 +89,11 @@ object, @scheme[#f] otherwise. See also @secref["model-eq"]. @defproc[(equal?/recur [v1 any/c] [v2 any/c] [recur-proc (any/c any/c -> any/c)]) boolean?]{ -Like @scheme[equal?], but using @scheme[recur-proc] for recursive +Like @racket[equal?], but using @racket[recur-proc] for recursive comparisons (which means that reference cycles are not handled -automatically). Non-@scheme[#f] results from @scheme[recur-proc] are -converted to @scheme[#t] before being returned by -@scheme[equal?/recur]. +automatically). Non-@racket[#f] results from @racket[recur-proc] are +converted to @racket[#t] before being returned by +@racket[equal?/recur]. @examples[ (equal?/recur 1 1 (lambda (a b) #f)) @@ -105,9 +105,9 @@ converted to @scheme[#t] before being returned by @defproc[(immutable? [v any/c]) boolean?]{ -Returns @scheme[#t] if @scheme[v] is an immutable @tech{string}, +Returns @racket[#t] if @racket[v] is an immutable @tech{string}, @tech{byte string}, @tech{vector}, @tech{hash table}, or box, -@scheme[#f] otherwise. +@racket[#f] otherwise. @examples[ (immutable? 'hello) @@ -126,64 +126,64 @@ type. The property value must be a list of three procedures: @itemize[ - @item{@scheme[_equal-proc : (any/c any/c (any/c any/c . -> + @item{@racket[_equal-proc : (any/c any/c (any/c any/c . -> . boolean?) . -> . any/c)] --- tests whether the first two arguments are equal, where both values are instances of the structure type to which the property is associated (or a subtype of the structure type). - The third argument is an @scheme[equal?] predicate to use for + The third argument is an @racket[equal?] predicate to use for recursive equality checks; use the given predicate instead of - @scheme[equal?] to ensure that data cycles are handled - properly and to work with @scheme[equal?/recur] (but beware + @racket[equal?] to ensure that data cycles are handled + properly and to work with @racket[equal?/recur] (but beware that an arbitrary function can be provided to - @scheme[equal?/recur] for recursive checks, which means that + @racket[equal?/recur] for recursive checks, which means that arguments provided to the predicate might be exposed to arbitrary code). - The @scheme[_equal-proc] is called for a pair of structures - only when they are not @scheme[eq?], and only when they both - have a @scheme[prop:equal+hash] value inherited from the same + The @racket[_equal-proc] is called for a pair of structures + only when they are not @racket[eq?], and only when they both + have a @racket[prop:equal+hash] value inherited from the same structure type. With this strategy, the order in which - @scheme[equal?] receives two structures does not matter. It + @racket[equal?] receives two structures does not matter. It also means that, by default, a structure sub-type inherits the equality predicate of its parent, if any.} - @item{@scheme[_hash-proc : (any/c (any/c . -> . exact-integer?) . -> + @item{@racket[_hash-proc : (any/c (any/c . -> . exact-integer?) . -> . exact-integer?)] --- computes a hash code for the given - structure, like @scheme[equal-hash-code]. The first argument is + structure, like @racket[equal-hash-code]. The first argument is an instance of the structure type (or one of its subtypes) to which the property is associated. - The second argument is an @scheme[equal-hash-code]-like + The second argument is an @racket[equal-hash-code]-like procedure to use for recursive hash-code computation; use the - given procedure instead of @scheme[equal-hash-code] to ensure + given procedure instead of @racket[equal-hash-code] to ensure that data cycles are handled properly.} - @item{@scheme[_hash2-proc : (any/c (any/c . -> . exact-integer?) . -> + @item{@racket[_hash2-proc : (any/c (any/c . -> . exact-integer?) . -> . exact-integer?)] --- computes a secondary hash code for the - given structure. This procedure is like @scheme[_hash-proc], - but analogous to @scheme[equal-secondary-hash-code].} + given structure. This procedure is like @racket[_hash-proc], + but analogous to @racket[equal-secondary-hash-code].} ] -Take care to ensure that @scheme[_hash-proc] and @scheme[_hash2-proc] -are consistent with @scheme[_equal-proc]. Specifically, -@scheme[_hash-proc] and @scheme[_hash2-proc] should produce the same -value for any two structures for which @scheme[_equal-proc] produces a +Take care to ensure that @racket[_hash-proc] and @racket[_hash2-proc] +are consistent with @racket[_equal-proc]. Specifically, +@racket[_hash-proc] and @racket[_hash2-proc] should produce the same +value for any two structures for which @racket[_equal-proc] produces a true value. -When a structure type has no @scheme[prop:equal+hash] property, then +When a structure type has no @racket[prop:equal+hash] property, then transparent structures (i.e., structures with an @tech{inspector} that -is controlled by the current @tech{inspector}) are @scheme[equal?] +is controlled by the current @tech{inspector}) are @racket[equal?] when they are instances of the same structure type (not counting -sub-types), and when they have @scheme[equal?] field values. For -transparent structures, @scheme[equal-hash-code] and -@scheme[equal-secondary-hash-code] derive hash code using the field -values. For opaque structure types, @scheme[equal?] is the same as -@scheme[eq?], and @scheme[equal-hash-code] and -@scheme[equal-secondary-hash-code] results are based only on -@scheme[eq-hash-code]. If a structure has a @racket[prop:impersonator-of] +sub-types), and when they have @racket[equal?] field values. For +transparent structures, @racket[equal-hash-code] and +@racket[equal-secondary-hash-code] derive hash code using the field +values. For opaque structure types, @racket[equal?] is the same as +@racket[eq?], and @racket[equal-hash-code] and +@racket[equal-secondary-hash-code] results are based only on +@racket[eq-hash-code]. If a structure has a @racket[prop:impersonator-of] property, then the @racket[prop:impersonator-of] property takes precedence over @racket[prop:equal+hash] if the property value's procedure returns a non-@racket[#f] value when applied to the structure. @@ -223,18 +223,18 @@ non-@racket[#f] value when applied to the structure. @note-lib[racket/bool] -@defthing[true boolean?]{An alias for @scheme[#t].} +@defthing[true boolean?]{An alias for @racket[#t].} -@defthing[false boolean?]{An alias for @scheme[#f].} +@defthing[false boolean?]{An alias for @racket[#f].} @defproc[(symbol=? [a symbol?] [b symbol?]) boolean?]{ -Returns @scheme[(equal? a b)].} +Returns @racket[(equal? a b)].} @defproc[(boolean=? [a boolean?] [b boolean?]) boolean?]{ -Returns @scheme[(equal? a b)].} +Returns @racket[(equal? a b)].} @defproc[(false? [v any/c]) boolean?]{ -Returns @scheme[(not v)].} +Returns @racket[(not v)].} diff --git a/collects/scribblings/reference/bytes.scrbl b/collects/scribblings/reference/bytes.scrbl index ec42e53ccd..4d60963347 100644 --- a/collects/scribblings/reference/bytes.scrbl +++ b/collects/scribblings/reference/bytes.scrbl @@ -6,43 +6,43 @@ @guideintro["bytestrings"]{byte strings} A @deftech{byte string} is a fixed-length array of bytes. A - @pidefterm{byte} is an exact integer between @scheme[0] and - @scheme[255] inclusive. + @pidefterm{byte} is an exact integer between @racket[0] and + @racket[255] inclusive. @index['("byte strings" "immutable")]{A} byte string can be @defterm{mutable} or @defterm{immutable}. When an immutable byte -string is provided to a procedure like @scheme[bytes-set!], the +string is provided to a procedure like @racket[bytes-set!], the @exnraise[exn:fail:contract]. Byte-string constants generated by the default reader (see @secref["parse-string"]) are immutable. -Two byte strings are @scheme[equal?] when they have the same length +Two byte strings are @racket[equal?] when they have the same length and contain the same sequence of bytes. 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 @scheme[in-bytes]. +of the sequence. See also @racket[in-bytes]. -See also: @scheme[immutable?]. +See also: @racket[immutable?]. @; ---------------------------------------- @section{Byte String Constructors, Selectors, and Mutators} -@defproc[(bytes? [v any/c]) boolean?]{ Returns @scheme[#t] if @scheme[v] - is a byte string, @scheme[#f] otherwise. +@defproc[(bytes? [v any/c]) boolean?]{ Returns @racket[#t] if @racket[v] + is a byte string, @racket[#f] otherwise. @mz-examples[(bytes? #"Apple") (bytes? "Apple")]} @defproc[(make-bytes [k exact-nonnegative-integer?] [b byte? 0]) -bytes?]{ Returns a new mutable byte string of length @scheme[k] where each -position in the byte string is initialized with the byte @scheme[b]. +bytes?]{ Returns a new mutable byte string of length @racket[k] where each +position in the byte string is initialized with the byte @racket[b]. @mz-examples[(make-bytes 5 65)]} @defproc[(bytes [b byte?] ...) bytes?]{ Returns a new mutable byte -string whose length is the number of provided @scheme[b]s, and whose -positions are initialized with the given @scheme[b]s. +string whose length is the number of provided @racket[b]s, and whose +positions are initialized with the given @racket[b]s. @mz-examples[(bytes 65 112 112 108 101)]} @@ -50,7 +50,7 @@ positions are initialized with the given @scheme[b]s. @defproc[(bytes->immutable-bytes [bstr bytes?]) (and/c bytes? immutable?)]{ Returns an immutable byte string with the same content - as @scheme[bstr], returning @scheme[bstr] itself if @scheme[bstr] is + as @racket[bstr], returning @racket[bstr] itself if @racket[bstr] is immutable. @examples[ @@ -60,23 +60,23 @@ positions are initialized with the given @scheme[b]s. (eq? (bytes->immutable-bytes b) b) ]} -@defproc[(byte? [v any/c]) boolean?]{ Returns @scheme[#t] if @scheme[v] is - a byte (i.e., an exact integer between @scheme[0] and @scheme[255] - inclusive), @scheme[#f] otherwise. +@defproc[(byte? [v any/c]) boolean?]{ Returns @racket[#t] if @racket[v] is + a byte (i.e., an exact integer between @racket[0] and @racket[255] + inclusive), @racket[#f] otherwise. @mz-examples[(byte? 65) (byte? 0) (byte? 256) (byte? -1)]} @defproc[(bytes-length [bstr bytes?]) exact-nonnegative-integer?]{ - Returns the length of @scheme[bstr]. + Returns the length of @racket[bstr]. @mz-examples[(bytes-length #"Apple")]} @defproc[(bytes-ref [bstr bytes?] [k exact-nonnegative-integer?]) - byte?]{ Returns the character at position @scheme[k] in @scheme[bstr]. - The first position in the bytes cooresponds to @scheme[0], so the - position @scheme[k] must be less than the length of the bytes, + byte?]{ Returns the character at position @racket[k] in @racket[bstr]. + The first position in the bytes cooresponds to @racket[0], so the + position @racket[k] must be less than the length of the bytes, otherwise the @exnraise[exn:fail:contract]. @mz-examples[(bytes-ref #"Apple" 0)]} @@ -84,9 +84,9 @@ positions are initialized with the given @scheme[b]s. @defproc[(bytes-set! [bstr (and/c bytes? (not/c immutable?))] [k exact-nonnegative-integer?] [b byte?]) void?]{ Changes the - character position @scheme[k] in @scheme[bstr] to @scheme[b]. The first - position in the byte string cooresponds to @scheme[0], so the position - @scheme[k] must be less than the length of the bytes, otherwise the + character position @racket[k] in @racket[bstr] to @racket[b]. The first + position in the byte string cooresponds to @racket[0], so the position + @racket[k] must be less than the length of the bytes, otherwise the @exnraise[exn:fail:contract]. @mz-examples[(define s (bytes 65 112 112 108 101)) @@ -96,19 +96,19 @@ positions are initialized with the given @scheme[b]s. @defproc[(subbytes [bstr bytes?] [start exact-nonnegative-integer?] [end exact-nonnegative-integer? (bytes-length str)]) bytes?]{ Returns - a new mutable byte string that is @scheme[(- end start)] bytes long, - and that contains the same bytes as @scheme[bstr] from @scheme[start] - inclusive to @scheme[end] exclusive. The @scheme[start] and - @scheme[end] arguments must be less than or equal to the length of - @scheme[bstr], and @scheme[end] must be greater than or equal to - @scheme[start], otherwise the @exnraise[exn:fail:contract]. + a new mutable byte string that is @racket[(- end start)] bytes long, + and that contains the same bytes as @racket[bstr] from @racket[start] + inclusive to @racket[end] exclusive. The @racket[start] and + @racket[end] arguments must be less than or equal to the length of + @racket[bstr], and @racket[end] must be greater than or equal to + @racket[start], otherwise the @exnraise[exn:fail:contract]. @mz-examples[(subbytes #"Apple" 1 3) (subbytes #"Apple" 1)]} @defproc[(bytes-copy [bstr bytes?]) bytes?]{ Returns - @scheme[(subbytes str 0)].} + @racket[(subbytes str 0)].} @defproc[(bytes-copy! [dest (and/c bytes? (not/c immutable?))] @@ -118,14 +118,14 @@ positions are initialized with the given @scheme[b]s. [src-end exact-nonnegative-integer? (bytes-length src)]) void?]{ - Changes the bytes of @scheme[dest] starting at position - @scheme[dest-start] to match the bytes in @scheme[src] from - @scheme[src-start] (inclusive) to @scheme[src-end] (exclusive). The - bytes strings @scheme[dest] and @scheme[src] can be the same byte + Changes the bytes of @racket[dest] starting at position + @racket[dest-start] to match the bytes in @racket[src] from + @racket[src-start] (inclusive) to @racket[src-end] (exclusive). The + bytes strings @racket[dest] and @racket[src] can be the same byte string, and in that case the destination region can overlap with the source region; the destination bytes after the copy match the source - bytes from before the copy. If any of @scheme[dest-start], - @scheme[src-start], or @scheme[src-end] are out of range (taking into + bytes from before the copy. If any of @racket[dest-start], + @racket[src-start], or @racket[src-end] are out of range (taking into account the sizes of the bytes strings and the source and destination regions), the @exnraise[exn:fail:contract]. @@ -135,8 +135,8 @@ positions are initialized with the given @scheme[b]s. s]} @defproc[(bytes-fill! [dest (and/c bytes? (not/c immutable?))] [b - byte?]) void?]{ Changes @scheme[dest] so that every position in the - bytes is filled with @scheme[b]. + byte?]) void?]{ Changes @racket[dest] so that every position in the + bytes is filled with @racket[b]. @mz-examples[(define s (bytes 65 112 112 108 101)) (bytes-fill! s 113) @@ -146,34 +146,34 @@ positions are initialized with the given @scheme[b]s. @defproc[(bytes-append [bstr bytes?] ...) bytes?]{ @index['("byte strings" "concatenate")]{Returns} a new mutable byte string -that is as long as the sum of the given @scheme[bstr]s' lengths, and -that contains the concatenated bytes of the given @scheme[bstr]s. If -no @scheme[bstr]s are provided, the result is a zero-length byte +that is as long as the sum of the given @racket[bstr]s' lengths, and +that contains the concatenated bytes of the given @racket[bstr]s. If +no @racket[bstr]s are provided, the result is a zero-length byte string. @mz-examples[(bytes-append #"Apple" #"Banana")]} @defproc[(bytes->list [bstr bytes?]) (listof byte?)]{ Returns a new - list of bytes corresponding to the content of @scheme[bstr]. That is, - the length of the list is @scheme[(bytes-length bstr)], and the - sequence of bytes in @scheme[bstr] is the same sequence in the + list of bytes corresponding to the content of @racket[bstr]. That is, + the length of the list is @racket[(bytes-length bstr)], and the + sequence of bytes in @racket[bstr] is the same sequence in the result list. @mz-examples[(bytes->list #"Apple")]} @defproc[(list->bytes [lst (listof byte?)]) bytes?]{ Returns a new - mutable byte string whose content is the list of bytes in @scheme[lst]. - That is, the length of the byte string is @scheme[(length lst)], and - the sequence of bytes in @scheme[lst] is the same sequence in + mutable byte string whose content is the list of bytes in @racket[lst]. + That is, the length of the byte string is @racket[(length lst)], and + the sequence of bytes in @racket[lst] is the same sequence in the result byte string. @mz-examples[(list->bytes (list 65 112 112 108 101))]} @defproc[(make-shared-bytes [k exact-nonnegative-integer?] [b byte? 0]) -bytes?]{ Returns a new mutable byte string of length @scheme[k] where each -position in the byte string is initialized with the byte @scheme[b]. +bytes?]{ Returns a new mutable byte string of length @racket[k] where each +position in the byte string is initialized with the byte @racket[b]. When @secref["places"] are enabled, the new byte string is allocated in the @tech{shared memory space}. @@ -181,8 +181,8 @@ When @secref["places"] are enabled, the new byte string is allocated in the @defproc[(shared-bytes [b byte?] ...) bytes?]{ Returns a new mutable byte -string whose length is the number of provided @scheme[b]s, and whose -positions are initialized with the given @scheme[b]s. +string whose length is the number of provided @racket[b]s, and whose +positions are initialized with the given @racket[b]s. When @secref["places"] are enabled, the new byte string is allocated in the @tech{shared memory space}. @@ -193,18 +193,18 @@ When @secref["places"] are enabled, the new byte string is allocated in the @section{Byte String Comparisons} @defproc[(bytes=? [bstr1 bytes?] [bstr2 bytes?] ...+) boolean?]{ Returns - @scheme[#t] if all of the arguments are @scheme[eqv?].} + @racket[#t] if all of the arguments are @racket[eqv?].} @mz-examples[(bytes=? #"Apple" #"apple") (bytes=? #"a" #"as" #"a")] @(define (bytes-sort direction) - @elem{Like @scheme[bytesstring/latin-1 [bstr bytes?] @@ -257,11 +257,11 @@ When @secref["places"] are enabled, the new byte string is allocated in the [start exact-nonnegative-integer? 0] [end exact-nonnegative-integer? (bytes-length bstr)]) string?]{ - Produces a string by decoding the @scheme[start] to @scheme[end] substring - of @scheme[bstr] as a Latin-1 encoding of Unicode code points; i.e., + Produces a string by decoding the @racket[start] to @racket[end] substring + of @racket[bstr] as a Latin-1 encoding of Unicode code points; i.e., each byte is translated directly to a character using - @scheme[integer->char], so the decoding always succeeds. - The @scheme[err-char] + @racket[integer->char], so the decoding always succeeds. + The @racket[err-char] argument is ignored, but present for consistency with the other operations. @@ -274,9 +274,9 @@ When @secref["places"] are enabled, the new byte string is allocated in the [start exact-nonnegative-integer? 0] [end exact-nonnegative-integer? (string-length str)]) bytes?]{ - Produces a byte string by encoding the @scheme[start] to @scheme[end] - substring of @scheme[str] via UTF-8 (always succeeding). The - @scheme[err-byte] argument is ignored, but included for consistency with + Produces a byte string by encoding the @racket[start] to @racket[end] + substring of @racket[str] via UTF-8 (always succeeding). The + @racket[err-byte] argument is ignored, but included for consistency with the other operations. @examples[ (define b @@ -291,12 +291,12 @@ When @secref["places"] are enabled, the new byte string is allocated in the [start exact-nonnegative-integer? 0] [end exact-nonnegative-integer? (string-length str)]) bytes?]{ - Produces a string by encoding the @scheme[start] to @scheme[end] substring - of @scheme[str] using the current locale's encoding (see also - @secref["encodings"]). If @scheme[err-byte] is not @scheme[#f], it is used - for each character in @scheme[str] that cannot be encoded for the - current locale; if @scheme[err-byte] is @scheme[#f], and if the - @scheme[start] to @scheme[end] substring of @scheme[str] cannot be encoded, + Produces a string by encoding the @racket[start] to @racket[end] substring + of @racket[str] using the current locale's encoding (see also + @secref["encodings"]). If @racket[err-byte] is not @racket[#f], it is used + for each character in @racket[str] that cannot be encoded for the + current locale; if @racket[err-byte] is @racket[#f], and if the + @racket[start] to @racket[end] substring of @racket[str] cannot be encoded, then the @exnraise[exn:fail:contract].} @defproc[(string->bytes/latin-1 [str string?] @@ -304,14 +304,14 @@ When @secref["places"] are enabled, the new byte string is allocated in the [start exact-nonnegative-integer? 0] [end exact-nonnegative-integer? (string-length str)]) bytes?]{ - Produces a string by encoding the @scheme[start] to @scheme[end] substring - of @scheme[str] using Latin-1; i.e., each character is translated - directly to a byte using @scheme[char->integer]. If @scheme[err-byte] is - not @scheme[#f], it is used for each character in @scheme[str] whose - value is greater than @scheme[255]. - If @scheme[err-byte] is @scheme[#f], and if the - @scheme[start] to @scheme[end] substring of @scheme[str] has a character - with a value greater than @scheme[255], then the + Produces a string by encoding the @racket[start] to @racket[end] substring + of @racket[str] using Latin-1; i.e., each character is translated + directly to a byte using @racket[char->integer]. If @racket[err-byte] is + not @racket[#f], it is used for each character in @racket[str] whose + value is greater than @racket[255]. + If @racket[err-byte] is @racket[#f], and if the + @racket[start] to @racket[end] substring of @racket[str] has a character + with a value greater than @racket[255], then the @exnraise[exn:fail:contract]. @examples[ @@ -326,8 +326,8 @@ When @secref["places"] are enabled, the new byte string is allocated in the [start exact-nonnegative-integer? 0] [end exact-nonnegative-integer? (string-lenght str)]) exact-nonnegative-integer?]{ - Returns the length in bytes of the UTF-8 encoding of @scheme[str]'s - substring from @scheme[start] to @scheme[end], but without actually + Returns the length in bytes of the UTF-8 encoding of @racket[str]'s + substring from @racket[start] to @racket[end], but without actually generating the encoded bytes. @examples[ @@ -342,11 +342,11 @@ When @secref["places"] are enabled, the new byte string is allocated in the [end exact-nonnegative-integer? (bytes-length bstr)]) exact-nonnegative-integer?]{ Returns the length in characters of the UTF-8 decoding of - @scheme[bstr]'s substring from @scheme[start] to @scheme[end], but without - actually generating the decoded characters. If @scheme[err-char] is - @scheme[#f] and the substring is not a UTF-8 encoding overall, the - result is @scheme[#f]. Otherwise, @scheme[err-char] is used to resolve - decoding errors as in @scheme[bytes->string/utf-8]. + @racket[bstr]'s substring from @racket[start] to @racket[end], but without + actually generating the decoded characters. If @racket[err-char] is + @racket[#f] and the substring is not a UTF-8 encoding overall, the + result is @racket[#f]. Otherwise, @racket[err-char] is used to resolve + decoding errors as in @racket[bytes->string/utf-8]. @examples[ (bytes-utf-8-length (bytes #xc3 #xa7 #xc3 #xb0 #xc3 #xb6 #xc2 #xa3)) @@ -359,14 +359,14 @@ When @secref["places"] are enabled, the new byte string is allocated in the [start exact-nonnegative-integer? 0] [end exact-nonnegative-integer? (bytes-length bstr)]) char?]{ - Returns the @scheme[skip]th character in the UTF-8 decoding of - @scheme[bstr]'s substring from @scheme[start] to @scheme[end], but without + Returns the @racket[skip]th character in the UTF-8 decoding of + @racket[bstr]'s substring from @racket[start] to @racket[end], but without actually generating the other decoded characters. If the substring is - not a UTF-8 encoding up to the @scheme[skip]th character (when - @scheme[err-char] is @scheme[#f]), or if the substring decoding produces - fewer than @scheme[skip] characters, the result is @scheme[#f]. If - @scheme[err-char] is not @scheme[#f], it is used to resolve decoding - errors as in @scheme[bytes->string/utf-8]. + not a UTF-8 encoding up to the @racket[skip]th character (when + @racket[err-char] is @racket[#f]), or if the substring decoding produces + fewer than @racket[skip] characters, the result is @racket[#f]. If + @racket[err-char] is not @racket[#f], it is used to resolve decoding + errors as in @racket[bytes->string/utf-8]. @examples[ (bytes-utf-8-ref (bytes #xc3 #xa7 #xc3 #xb0 #xc3 #xb6 #xc2 #xa3) 0) @@ -383,16 +383,16 @@ When @secref["places"] are enabled, the new byte string is allocated in the [start exact-nonnegative-integer? 0] [end exact-nonnegative-integer? (bytes-length bstr)]) exact-nonnegative-integer?]{ - Returns the offset in bytes into @scheme[bstr] at which the @scheme[skip]th - character's encoding starts in the UTF-8 decoding of @scheme[bstr]'s - substring from @scheme[start] to @scheme[end] (but without actually + Returns the offset in bytes into @racket[bstr] at which the @racket[skip]th + character's encoding starts in the UTF-8 decoding of @racket[bstr]'s + substring from @racket[start] to @racket[end] (but without actually generating the other decoded characters). The result is relative to - the start of @scheme[bstr], not to @scheme[start]. If the substring is not - a UTF-8 encoding up to the @scheme[skip]th character (when - @scheme[err-char] is @scheme[#f]), or if the substring decoding produces - fewer than @scheme[skip] characters, the result is @scheme[#f]. If - @scheme[err-char] is not @scheme[#f], it is used to resolve decoding - errors as in @scheme[bytes->string/utf-8]. + the start of @racket[bstr], not to @racket[start]. If the substring is not + a UTF-8 encoding up to the @racket[skip]th character (when + @racket[err-char] is @racket[#f]), or if the substring decoding produces + fewer than @racket[skip] characters, the result is @racket[#f]. If + @racket[err-char] is not @racket[#f], it is used to resolve decoding + errors as in @racket[bytes->string/utf-8]. @examples[ (bytes-utf-8-index (bytes #xc3 #xa7 #xc3 #xb0 #xc3 #xb6 #xc2 #xa3) 0) @@ -410,35 +410,35 @@ When @secref["places"] are enabled, the new byte string is allocated in the bytes-converter?]{ Produces a @deftech{byte converter} to go from the encoding named by -@scheme[from-name] to the encoding named by @scheme[to-name]. If the -requested conversion pair is not available, @scheme[#f] is returned +@racket[from-name] to the encoding named by @racket[to-name]. If the +requested conversion pair is not available, @racket[#f] is returned instead of a converter. Certain encoding combinations are always available: @itemize[ - @item{@scheme[(bytes-open-converter "UTF-8" "UTF-8")] --- the + @item{@racket[(bytes-open-converter "UTF-8" "UTF-8")] --- the identity conversion, except that encoding errors in the input lead to a decoding failure.} - @item{@scheme[(bytes-open-converter "UTF-8-permissive" "UTF-8")] --- + @item{@racket[(bytes-open-converter "UTF-8-permissive" "UTF-8")] --- @index['("UTF-8-permissive")]{the} identity conversion, except that any input byte that is not part of a valid encoding sequence is effectively replaced by the UTF-8 encoding sequence for - @schemevalfont{#\uFFFD}. (This handling of invalid sequences is + @racketvalfont{#\uFFFD}. (This handling of invalid sequences is consistent with the interpretation of port bytes streams into characters; see @secref["ports"].)} - @item{@scheme[(bytes-open-converter "" "UTF-8")] --- converts from + @item{@racket[(bytes-open-converter "" "UTF-8")] --- converts from the current locale's default encoding (see @secref["encodings"]) to UTF-8.} - @item{@scheme[(bytes-open-converter "UTF-8" "")] --- converts from + @item{@racket[(bytes-open-converter "UTF-8" "")] --- converts from UTF-8 to the current locale's default encoding (see @secref["encodings"]).} - @item{@scheme[(bytes-open-converter "platform-UTF-8" "platform-UTF-16")] + @item{@racket[(bytes-open-converter "platform-UTF-8" "platform-UTF-16")] --- converts UTF-8 to UTF-16 on @|AllUnix|, where each UTF-16 code unit is a sequence of two bytes ordered by the current platform's endianness. On Windows, the input can include @@ -447,22 +447,22 @@ Certain encoding combinations are always available: output is a sequence of UTF-16 code units (as little-endian byte pairs), potentially including unpaired surrogates.} - @item{@scheme[(bytes-open-converter "platform-UTF-8-permissive" "platform-UTF-16")] - --- like @scheme[(bytes-open-converter "platform-UTF-8" "platform-UTF-16")], + @item{@racket[(bytes-open-converter "platform-UTF-8-permissive" "platform-UTF-16")] + --- like @racket[(bytes-open-converter "platform-UTF-8" "platform-UTF-16")], but an input byte that is not part of a valid UTF-8 encoding sequence (or valid for the unpaired-surrogate extension on - Windows) is effectively replaced with @scheme[(char->integer #\?)].} + Windows) is effectively replaced with @racket[(char->integer #\?)].} - @item{@scheme[(bytes-open-converter "platform-UTF-16" "platform-UTF-8")] + @item{@racket[(bytes-open-converter "platform-UTF-16" "platform-UTF-8")] --- converts UTF-16 (bytes orderd by the current platform's endianness) to UTF-8 on @|AllUnix|. On Windows, the input can include UTF-16 code units that are unpaired surrogates, and the corresponding output includes an encoding of each surrogate in a natural extension of UTF-8. On @|AllUnix|, surrogates are - assumed to be paired: a pair of bytes with the bits @scheme[#xD800] - starts a surrogate pair, and the @scheme[#x03FF] bits are used from + assumed to be paired: a pair of bytes with the bits @racket[#xD800] + starts a surrogate pair, and the @racket[#x03FF] bits are used from the pair and following pair (independent of the value of the - @scheme[#xDC00] bits). On all platforms, performance may be poor + @racket[#xDC00] bits). On all platforms, performance may be poor when decoding from an odd offset within an input byte string.} ] @@ -471,8 +471,8 @@ A newly opened byte converter is registered with the current custodian (see @secref["custodians"]), so that the converter is closed when the custodian is shut down. A converter is not registered with a custodian (and does not need to be closed) if it is one of the -guaranteed combinations not involving @scheme[""] on Unix, or if it -is any of the guaranteed combinations (including @scheme[""]) on +guaranteed combinations not involving @racket[""] on Unix, or if it +is any of the guaranteed combinations (including @racket[""]) on Windows and Mac OS X. @margin-note{In the Racket software distributions for Windows, a suitable @@ -480,7 +480,7 @@ Windows and Mac OS X. The set of available encodings and combinations varies by platform, depending on the @exec{iconv} library that is installed; the -@scheme[from-name] and @scheme[to-name] arguments are passed on to +@racket[from-name] and @racket[to-name] arguments are passed on to @tt{iconv_open}. On Windows, @filepath{iconv.dll} or @filepath{libiconv.dll} must be in the same directory as @filepath{libmzsch@italic{VERS}.dll} (where @italic{VERS} is a version @@ -489,13 +489,13 @@ current executable's directory at run time, and the DLL must either supply @tt{_errno} or link to @filepath{msvcrt.dll} for @tt{_errno}; otherwise, only the guaranteed combinations are available. -Use @scheme[bytes-convert] with the result to convert byte strings.} +Use @racket[bytes-convert] with the result to convert byte strings.} @defproc[(bytes-close-converter [converter bytes-converter?]) void]{ Closes the given converter, so that it can no longer be used with -@scheme[bytes-convert] or @scheme[bytes-convert-end].} +@racket[bytes-convert] or @racket[bytes-convert-end].} @defproc[(bytes-convert [converter bytes-converter?] @@ -511,55 +511,55 @@ Closes the given converter, so that it can no longer be used with exact-nonnegative-integer? (or/c 'complete 'continues 'aborts 'error))]{ -Converts the bytes from @scheme[src-start-pos] to @scheme[src-end-pos] -in @scheme[src-bstr]. +Converts the bytes from @racket[src-start-pos] to @racket[src-end-pos] +in @racket[src-bstr]. -If @scheme[dest-bstr] is not @scheme[#f], the converted bytes are -written into @scheme[dest-bstr] from @scheme[dest-start-pos] to -@scheme[dest-end-pos]. If @scheme[dest-bstr] is @scheme[#f], then a +If @racket[dest-bstr] is not @racket[#f], the converted bytes are +written into @racket[dest-bstr] from @racket[dest-start-pos] to +@racket[dest-end-pos]. If @racket[dest-bstr] is @racket[#f], then a newly allocated byte string holds the conversion results, and if -@scheme[dest-end-pos] is not @scheme[#f], the size of the result byte -string is no more than @scheme[(- dest-end-pos dest-start-pos)]. +@racket[dest-end-pos] is not @racket[#f], the size of the result byte +string is no more than @racket[(- dest-end-pos dest-start-pos)]. -The result of @scheme[bytes-convert] is three values: +The result of @racket[bytes-convert] is three values: @itemize[ - @item{@scheme[_result-bstr] or @scheme[_dest-wrote-amt] --- a byte - string if @scheme[dest-bstr] is @scheme[#f] or not provided, or the - number of bytes written into @scheme[dest-bstr] otherwise.} + @item{@racket[_result-bstr] or @racket[_dest-wrote-amt] --- a byte + string if @racket[dest-bstr] is @racket[#f] or not provided, or the + number of bytes written into @racket[dest-bstr] otherwise.} - @item{@scheme[_src-read-amt] --- the number of bytes successfully converted - from @scheme[src-bstr].} + @item{@racket[_src-read-amt] --- the number of bytes successfully converted + from @racket[src-bstr].} - @item{@indexed-scheme['complete], @indexed-scheme['continues], - @indexed-scheme['aborts], or @indexed-scheme['error] --- indicates + @item{@indexed-racket['complete], @indexed-racket['continues], + @indexed-racket['aborts], or @indexed-racket['error] --- indicates how conversion terminated: @itemize[ - @item{@scheme['complete]: The entire input was processed, and - @scheme[_src-read-amt] will be equal to @scheme[(- src-end-pos + @item{@racket['complete]: The entire input was processed, and + @racket[_src-read-amt] will be equal to @racket[(- src-end-pos src-start-pos)].} - @item{@scheme['continues]: Conversion stopped due to the limit on - the result size or the space in @scheme[dest-bstr]; in this case, - fewer than @scheme[(- dest-end-pos dest-start-pos)] bytes may be + @item{@racket['continues]: Conversion stopped due to the limit on + the result size or the space in @racket[dest-bstr]; in this case, + fewer than @racket[(- dest-end-pos dest-start-pos)] bytes may be returned if more space is needed to process the next complete - encoding sequence in @scheme[src-bstr].} + encoding sequence in @racket[src-bstr].} - @item{@scheme['aborts]: The input stopped part-way through an + @item{@racket['aborts]: The input stopped part-way through an encoding sequence, and more input bytes are necessary to continue. - For example, if the last byte of input is @scheme[#o303] for a - @scheme["UTF-8-permissive"] decoding, the result is - @scheme['aborts], because another byte is needed to determine how to - use the @scheme[#o303] byte.} + For example, if the last byte of input is @racket[#o303] for a + @racket["UTF-8-permissive"] decoding, the result is + @racket['aborts], because another byte is needed to determine how to + use the @racket[#o303] byte.} - @item{@scheme['error]: The bytes starting at @scheme[(+ - src-start-pos _src-read-amt)] bytes in @scheme[src-bstr] do not form + @item{@racket['error]: The bytes starting at @racket[(+ + src-start-pos _src-read-amt)] bytes in @racket[src-bstr] do not form a legal encoding sequence. This result is never produced for some encodings, where all byte sequences are valid encodings. For - example, since @scheme["UTF-8-permissive"] handles an invalid UTF-8 + example, since @racket["UTF-8-permissive"] handles an invalid UTF-8 sequence by dropping characters or generating ``?,'' every byte sequence is effectively valid.} @@ -567,11 +567,11 @@ The result of @scheme[bytes-convert] is three values: ] Applying a converter accumulates state in the converter (even when the -third result of @scheme[bytes-convert] is @scheme['complete]). This +third result of @racket[bytes-convert] is @racket['complete]). This state can affect both further processing of input and further generation of output, but only for conversions that involve ``shift sequences'' to change modes within a stream. To terminate an input -sequence and reset the converter, use @scheme[bytes-convert-end]. +sequence and reset the converter, use @racket[bytes-convert-end]. @examples[ (define convert (bytes-open-converter "UTF-8" "UTF-16")) @@ -591,27 +591,27 @@ sequence and reset the converter, use @scheme[bytes-convert-end]. (values (or/c bytes? exact-nonnegative-integer?) (or/c 'complete 'continues))]{ -Like @scheme[bytes-convert], but instead of converting bytes, this +Like @racket[bytes-convert], but instead of converting bytes, this procedure generates an ending sequence for the conversion (sometimes called a ``shift sequence''), if any. Few encodings use shift sequences, so this function will succeed with no output for most encodings. In any case, successful output of a (possibly empty) shift sequence resets the converter to its initial state. -The result of @scheme[bytes-convert-end] is two values: +The result of @racket[bytes-convert-end] is two values: @itemize[ - @item{@scheme[_result-bstr] or @scheme[_dest-wrote-amt] --- a byte string if - @scheme[dest-bstr] is @scheme[#f] or not provided, or the number of - bytes written into @scheme[dest-bstr] otherwise.} + @item{@racket[_result-bstr] or @racket[_dest-wrote-amt] --- a byte string if + @racket[dest-bstr] is @racket[#f] or not provided, or the number of + bytes written into @racket[dest-bstr] otherwise.} - @item{@indexed-scheme['complete] or @indexed-scheme['continues] --- - indicates whether conversion completed. If @scheme['complete], then - an entire ending sequence was produced. If @scheme['continues], then + @item{@indexed-racket['complete] or @indexed-racket['continues] --- + indicates whether conversion completed. If @racket['complete], then + an entire ending sequence was produced. If @racket['continues], then the conversion could not complete due to the limit on the result - size or the space in @scheme[dest-bstr], and the first result is - either an empty byte string or @scheme[0].} + size or the space in @racket[dest-bstr], and the first result is + either an empty byte string or @racket[0].} ] } @@ -619,8 +619,8 @@ The result of @scheme[bytes-convert-end] is two values: @defproc[(bytes-converter? [v any/c]) boolean?]{ -Returns @scheme[#t] if @scheme[v] is a @tech{byte converter} produced -by @scheme[bytes-open-converter], @scheme[#f] otherwise. +Returns @racket[#t] if @racket[v] is a @tech{byte converter} produced +by @racket[bytes-open-converter], @racket[#f] otherwise. @examples[ (bytes-converter? (bytes-open-converter "UTF-8" "UTF-16")) @@ -633,8 +633,8 @@ by @scheme[bytes-open-converter], @scheme[#f] otherwise. @defproc[(locale-string-encoding) any]{ Returns a string for the current locale's encoding (i.e., the encoding -normally identified by @scheme[""]). See also -@scheme[system-language+country].} +normally identified by @racket[""]). See also +@racket[system-language+country].} @section{Additional Byte String Functions} @note-lib[racket/bytes] @@ -645,11 +645,11 @@ normally identified by @scheme[""]). See also @; Note: this is exactly the same description as the one for append* Like @racket[bytes-append], but the last argument is used as a list -of arguments for @scheme[bytes-append], so @scheme[(bytes-append* -str ... strs)] is the same as @scheme[(apply bytes-append str +of arguments for @racket[bytes-append], so @racket[(bytes-append* +str ... strs)] is the same as @racket[(apply bytes-append str ... strs)]. In other words, the relationship between -@scheme[bytes-append] and @scheme[bytes-append*] is similar to the -one between @scheme[list] and @scheme[list*]. +@racket[bytes-append] and @racket[bytes-append*] is similar to the +one between @racket[list] and @racket[list*]. @mz-examples[#:eval string-eval (bytes-append* #"a" #"b" '(#"c" #"d")) @@ -659,8 +659,8 @@ one between @scheme[list] and @scheme[list*]. @defproc[(bytes-join [strs (listof bytes?)] [sep bytes?]) bytes?]{ -Appends the byte strings in @scheme[strs], inserting @scheme[sep] between -each pair of bytes in @scheme[strs]. +Appends the byte strings in @racket[strs], inserting @racket[sep] between +each pair of bytes in @racket[strs]. @mz-examples[#:eval string-eval (bytes-join '(#"one" #"two" #"three" #"four") #" potato ") diff --git a/collects/scribblings/reference/channels.scrbl b/collects/scribblings/reference/channels.scrbl index b7efec8843..6c4b2c5e2b 100644 --- a/collects/scribblings/reference/channels.scrbl +++ b/collects/scribblings/reference/channels.scrbl @@ -17,37 +17,37 @@ For buffered asynchronous channels, see @secref["async-channel"]. @defproc[(channel? [v any/c]) boolean?]{ -Returns @scheme[#t] if @scheme[v] is a @tech{channel}, -@scheme[#f] otherwise.} +Returns @racket[#t] if @racket[v] is a @tech{channel}, +@racket[#f] otherwise.} @defproc[(make-channel) channel?]{ Creates and returns a new channel. The channel can be used with -@scheme[channel-get], with @scheme[channel-try-get], or as a +@racket[channel-get], with @racket[channel-try-get], or as a @tech{synchronizable event} (see @secref["sync"]) to receive a value -through the channel. The channel can be used with @scheme[channel-put] -or through the result of @scheme[channel-put-evt] to send a value +through the channel. The channel can be used with @racket[channel-put] +or through the result of @racket[channel-put-evt] to send a value through the channel.} @defproc[(channel-get [ch channel?]) any]{ Blocks until a sender is ready to provide a value through -@scheme[ch]. The result is the sent value.} +@racket[ch]. The result is the sent value.} @defproc[(channel-try-get [ch channel?]) any]{ -Receives and returns a value from @scheme[ch] if a sender is -immediately ready, otherwise returns @scheme[#f].} +Receives and returns a value from @racket[ch] if a sender is +immediately ready, otherwise returns @racket[#f].} @defproc[(channel-put [ch channel?] [v any/c]) void?]{ -Blocks until a receiver is ready to accept the value @scheme[v] -through @scheme[ch].} +Blocks until a receiver is ready to accept the value @racket[v] +through @racket[ch].} @defproc[(channel-put-evt [ch channel?] [v any/c]) evt?]{ Returns a fresh @tech{synchronizable event} for use with -@scheme[sync]. The event is ready when @scheme[(channel-put ch v)] +@racket[sync]. The event is ready when @racket[(channel-put ch v)] would not block, and the event's synchronization result is the event itself.} diff --git a/collects/scribblings/reference/chaperones.scrbl b/collects/scribblings/reference/chaperones.scrbl index 885fb89f8b..41269cd949 100644 --- a/collects/scribblings/reference/chaperones.scrbl +++ b/collects/scribblings/reference/chaperones.scrbl @@ -4,7 +4,7 @@ @(define-syntax op (syntax-rules () [(_ (x ...)) (x ...)] - [(_ id) @scheme[id]])) + [(_ id) @racket[id]])) @(define-syntax-rule (operations i ...) (itemlist #:style 'compact @item{@op[i]} ...)) @@ -14,17 +14,17 @@ An @deftech{impersonator} is a wrapper for a value where the wrapper redirects certain of the value's operations. Impersonators apply only to procedures, @tech{structures} for which an accessor or mutator is available, @tech{structure types}, @tech{hash tables}, @tech{vectors}, -and @tech{box}es. An impersonator is @scheme[equal?] to the original -value, but not @scheme[eq?] to the original value. +and @tech{box}es. An impersonator is @racket[equal?] to the original +value, but not @racket[eq?] to the original value. A @deftech{chaperone} is a kind of impersonator whose refinement of a value's operation is restricted to side effects (including, in particular, raising an exception) or chaperoning values supplied to or produced by the operation. For example, a vector chaperone can redirect -@scheme[vector-ref] to raise an exception if the accessed vector slot -contains a string, or it can cause the result of @scheme[vector-ref] +@racket[vector-ref] to raise an exception if the accessed vector slot +contains a string, or it can cause the result of @racket[vector-ref] to be a chaperoned variant of the value that is in the accessed vector -slot, but it cannot redirect @scheme[vector-ref] to produce a value +slot, but it cannot redirect @racket[vector-ref] to produce a value that is arbitrarily different from the value in the vector slot. A non-@tech{chaperone} @tech{impersonator}, in contrast, can refine an operation to swap one @@ -48,8 +48,8 @@ the impersonator: Derived operations, such as printing a value, can be redirected through impersonators due to their use of accessor functions. The -@scheme[equal?], @scheme[equal-hash-code], and -@scheme[equal-secondary-hash-code] operations, in contrast, may bypass +@racket[equal?], @racket[equal-hash-code], and +@racket[equal-secondary-hash-code] operations, in contrast, may bypass impersonators (but they are not obliged to). In addition to redirecting operations that work on a value, a @@ -61,52 +61,52 @@ types and their instances. @defproc[(impersonator? [v any/c]) boolean?]{ -Returns @scheme[#t] if @scheme[v] is an @tech{impersonator}, @scheme[#f] otherwise. +Returns @racket[#t] if @racket[v] is an @tech{impersonator}, @racket[#f] otherwise. -Programs and libraries generally should avoid @scheme[impersonator?] and +Programs and libraries generally should avoid @racket[impersonator?] and treat impersonators the same as non-impersonator values. In rare cases, -@scheme[impersonator?] may be needed to guard against redirection by an +@racket[impersonator?] may be needed to guard against redirection by an impersonator of an operation to an arbitrary procedure.} @defproc[(chaperone? [v any/c]) boolean?]{ -Returns @scheme[#t] if @scheme[v] is a @tech{chaperone}, @scheme[#f] otherwise. +Returns @racket[#t] if @racket[v] is a @tech{chaperone}, @racket[#f] otherwise. -Programs and libraries generally should avoid @scheme[chaperone?] for +Programs and libraries generally should avoid @racket[chaperone?] for the same reason that they should avoid @racket[impersonator?].} @defproc[(impersonator-of? [v1 any/c] [v2 any/c]) boolean?]{ -Indicates whether @scheme[v1] can be considered equivalent modulo -impersonators to @scheme[v2]. +Indicates whether @racket[v1] can be considered equivalent modulo +impersonators to @racket[v2]. -For values that include no impersonators, @scheme[v1] and @scheme[v2] can -be considered impersonators of each other if they are @scheme[equal?]. +For values that include no impersonators, @racket[v1] and @racket[v2] can +be considered impersonators of each other if they are @racket[equal?]. -Otherwise, all impersonators of @scheme[v2] must be intact in @scheme[v1], -in the sense that parts of @scheme[v2] must be derived from -@scheme[v1] through one of the impersonator constructors (e.g., -@scheme[impersonate-procedure] or @racket[chaperone-procedure]). +Otherwise, all impersonators of @racket[v2] must be intact in @racket[v1], +in the sense that parts of @racket[v2] must be derived from +@racket[v1] through one of the impersonator constructors (e.g., +@racket[impersonate-procedure] or @racket[chaperone-procedure]). See also @racket[prop:impersonator-of].} @defproc[(chaperone-of? [v1 any/c] [v2 any/c]) boolean?]{ -Indicates whether @scheme[v1] can be considered equivalent modulo -chaperones to @scheme[v2]. +Indicates whether @racket[v1] can be considered equivalent modulo +chaperones to @racket[v2]. -For values that include no chaperones, @scheme[v1] and @scheme[v2] can -be considered chaperones of each other if they are @scheme[equal?], -except that the mutability of vectors and boxes with @scheme[v1] and -@scheme[v2] must be the same. +For values that include no chaperones, @racket[v1] and @racket[v2] can +be considered chaperones of each other if they are @racket[equal?], +except that the mutability of vectors and boxes with @racket[v1] and +@racket[v2] must be the same. -Otherwise, all chaperones of @scheme[v2] must be intact in -@scheme[v1], in the sense that parts of @scheme[v2] must be derived -from @scheme[v1] through one of the chaperone constructors (e.g., -@scheme[chaperone-procedure]).} +Otherwise, all chaperones of @racket[v2] must be intact in +@racket[v1], in the sense that parts of @racket[v2] must be derived +from @racket[v1] through one of the chaperone constructors (e.g., +@racket[chaperone-procedure]).} @; ------------------------------------------------------------ @section{Impersonator Constructors} @@ -118,29 +118,29 @@ from @scheme[v1] through one of the chaperone constructors (e.g., (and/c procedure? impersonator?)]{ Returns an impersonator procedure that has the same arity, name, and -other attributes as @scheme[proc]. When the impersonator procedure is -applied, the arguments are first passed to @scheme[wrapper-proc], and -then the results from @scheme[wrapper-proc] are passed to -@scheme[proc]. The @scheme[wrapper-proc] can also supply a procedure -that processes the results of @scheme[proc]. +other attributes as @racket[proc]. When the impersonator procedure is +applied, the arguments are first passed to @racket[wrapper-proc], and +then the results from @racket[wrapper-proc] are passed to +@racket[proc]. The @racket[wrapper-proc] can also supply a procedure +that processes the results of @racket[proc]. -The arity of @scheme[wrapper-proc] must include the arity of -@scheme[proc]. The allowed keyword arguments of @scheme[wrapper-proc] -must be a superset of the allowed keywords of @scheme[proc]. The -required keyword arguments of @scheme[wrapper-proc] must be a subset -of the required keywords of @scheme[proc]. +The arity of @racket[wrapper-proc] must include the arity of +@racket[proc]. The allowed keyword arguments of @racket[wrapper-proc] +must be a superset of the allowed keywords of @racket[proc]. The +required keyword arguments of @racket[wrapper-proc] must be a subset +of the required keywords of @racket[proc]. -For applications without keywords, the result of @scheme[wrapper-proc] +For applications without keywords, the result of @racket[wrapper-proc] must be either the same number of values as supplied to it or one more than the number of supplied values, where an extra result is supplied before the others. The additional result, if any, must be a procedure -that accepts as many results as produced by @scheme[proc]; it must -return the same number of results. If @scheme[wrapper-proc] returns +that accepts as many results as produced by @racket[proc]; it must +return the same number of results. If @racket[wrapper-proc] returns the same number of values as it is given (i.e., it does not return a -procedure to impersonator @scheme[proc]'s result), then @scheme[proc] is +procedure to impersonator @racket[proc]'s result), then @racket[proc] is called in @tech{tail position} with respect to the call to the impersonator. -For applications that include keyword arguments, @scheme[wrapper-proc] +For applications that include keyword arguments, @racket[wrapper-proc] must return an additional value before any other values but after the result-impersonating procedure (if any). The additional value must be a list of replacements for the keyword arguments that were supplied to the @@ -148,11 +148,11 @@ impersonator (i.e., not counting optional arguments that were not supplied). The arguments must be ordered according to the sorted order of the supplied arguments' keywords. -Pairs of @scheme[prop] and @scheme[prop-val] (the number of arguments -to @scheme[procedure-impersonator] must be even) add impersonator properties -or override impersonator-property values of @scheme[proc]. +Pairs of @racket[prop] and @racket[prop-val] (the number of arguments +to @racket[procedure-impersonator] must be even) add impersonator properties +or override impersonator-property values of @racket[proc]. -If any @scheme[prop] is @racket[impersonator-prop:application-mark] and if the +If any @racket[prop] is @racket[impersonator-prop:application-mark] and if the associated @racket[prop-val] is a pair, then the call to @racket[proc] is wrapped with @racket[with-continuation-mark] using @racket[(car prop-val)] as the mark key and @racket[(cdr prop-val)] as the mark @@ -174,28 +174,28 @@ of impersonators with respect to wrapping impersonators to be detected within [prop-val any] ... ...) any/c]{ -Returns an impersonator of @scheme[v], with redirect certain -operations on the impersonated value. The @scheme[orig-proc]s +Returns an impersonator of @racket[v], with redirect certain +operations on the impersonated value. The @racket[orig-proc]s indicate the operations to redirect, and the corresponding -@scheme[redirect-proc]s supply the redirections. +@racket[redirect-proc]s supply the redirections. -The protocol for a @scheme[redirect-proc] depends on the corresponding -@scheme[orig-proc]: +The protocol for a @racket[redirect-proc] depends on the corresponding +@racket[orig-proc]: @itemlist[ - @item{A structure-field accessor: @scheme[redirect-proc] - must accept two arguments, @scheme[v] and the value - @scheme[_field-v] that @scheme[orig-proc] produces for - @scheme[v]; it must return a replacement for - @scheme[_field-v]. The corresponding field must not be + @item{A structure-field accessor: @racket[redirect-proc] + must accept two arguments, @racket[v] and the value + @racket[_field-v] that @racket[orig-proc] produces for + @racket[v]; it must return a replacement for + @racket[_field-v]. The corresponding field must not be immutable.} - @item{A structure-field mutator: @scheme[redirect-proc] must accept - two arguments, @scheme[v] and the value @scheme[_field-v] + @item{A structure-field mutator: @racket[redirect-proc] must accept + two arguments, @racket[v] and the value @racket[_field-v] supplied to the mutator; it must return a replacement for - @scheme[_field-v] to be propagated to @scheme[orig-proc] and - @scheme[v].} + @racket[_field-v] to be propagated to @racket[orig-proc] and + @racket[v].} @item{A property accessor: @racket[redirect-proc] uses the same protocol as for a structure-field accessor. The accessor's @@ -204,9 +204,9 @@ The protocol for a @scheme[redirect-proc] depends on the corresponding ] -Pairs of @scheme[prop] and @scheme[prop-val] (the number of arguments -to @scheme[impersonate-struct] must be odd) add impersonator properties -or override impersonator-property values of @scheme[v].} +Pairs of @racket[prop] and @racket[prop-val] (the number of arguments +to @racket[impersonate-struct] must be odd) add impersonator properties +or override impersonator-property values of @racket[v].} @defproc[(impersonate-vector [vec (and/c vector? (not/c immutable?))] [ref-proc (vector? exact-nonnegative-integer? any/c . -> . any/c)] @@ -215,24 +215,24 @@ or override impersonator-property values of @scheme[v].} [prop-val any] ... ...) (and/c vector? impersonator?)]{ -Returns an impersonator of @scheme[vec], which redirects the -@scheme[vector-ref] and @scheme[vector-set!] operations. +Returns an impersonator of @racket[vec], which redirects the +@racket[vector-ref] and @racket[vector-set!] operations. -The @scheme[ref-proc] must accept @scheme[vec], an index passed to -@scheme[vector-ref], and the value that @scheme[vector-ref] on -@scheme[vec] produces for the given index; it must produce a -replacement for the value, which is the result of @scheme[vector-ref] +The @racket[ref-proc] must accept @racket[vec], an index passed to +@racket[vector-ref], and the value that @racket[vector-ref] on +@racket[vec] produces for the given index; it must produce a +replacement for the value, which is the result of @racket[vector-ref] on the impersonator. -The @scheme[set-proc] must accept @scheme[vec], an index passed to -@scheme[vector-set!], and the value passed to @scheme[vector-set!]; it +The @racket[set-proc] must accept @racket[vec], an index passed to +@racket[vector-set!], and the value passed to @racket[vector-set!]; it must produce a replacement for the value, which is used -with @scheme[vector-set!] on the original @scheme[vec] to install the +with @racket[vector-set!] on the original @racket[vec] to install the value. -Pairs of @scheme[prop] and @scheme[prop-val] (the number of arguments -to @scheme[impersonate-vector] must be odd) add impersonator properties -or override impersonator-property values of @scheme[vec].} +Pairs of @racket[prop] and @racket[prop-val] (the number of arguments +to @racket[impersonate-vector] must be odd) add impersonator properties +or override impersonator-property values of @racket[vec].} @defproc[(impersonate-box [box (and/c box? (not/c immutable?))] [unbox-proc (box? any/c . -> . any/c)] @@ -241,22 +241,22 @@ or override impersonator-property values of @scheme[vec].} [prop-val any] ... ...) (and/c box? impersonator?)]{ -Returns an impersonator of @scheme[bx], which redirects the -@scheme[unbox] and @scheme[set-box!] operations. +Returns an impersonator of @racket[bx], which redirects the +@racket[unbox] and @racket[set-box!] operations. -The @scheme[unbox-proc] must accept @scheme[bx] and the value that -@scheme[unbox] on @scheme[bx] produces index; it must produce a replacement +The @racket[unbox-proc] must accept @racket[bx] and the value that +@racket[unbox] on @racket[bx] produces index; it must produce a replacement value, which is the result of -@scheme[unbox] on the impersonator. +@racket[unbox] on the impersonator. -The @scheme[set-proc] must accept @scheme[bx] and the value passed to -@scheme[set-box!]; it must produce a replacement -value, which is used with @scheme[set-box!] on the original -@scheme[bx] to install the value. +The @racket[set-proc] must accept @racket[bx] and the value passed to +@racket[set-box!]; it must produce a replacement +value, which is used with @racket[set-box!] on the original +@racket[bx] to install the value. -Pairs of @scheme[prop] and @scheme[prop-val] (the number of arguments -to @scheme[impersonate-box] must be odd) add impersonator properties -or override impersonator-property values of @scheme[bx].} +Pairs of @racket[prop] and @racket[prop-val] (the number of arguments +to @racket[impersonate-box] must be odd) add impersonator properties +or override impersonator-property values of @racket[bx].} @defproc[(impersonate-hash [hash (and/c hash? (not/c immutable?))] @@ -270,55 +270,55 @@ or override impersonator-property values of @scheme[bx].} [prop-val any] ... ...) (and/c hash? impersonator?)]{ -Returns an impersonator of @scheme[hash], which redirects the -@scheme[hash-ref], @scheme[hash-set!] or @scheme[hash-set] (as -applicable), and @scheme[hash-remove] or @scheme[hash-remove!] (as +Returns an impersonator of @racket[hash], which redirects the +@racket[hash-ref], @racket[hash-set!] or @racket[hash-set] (as +applicable), and @racket[hash-remove] or @racket[hash-remove!] (as application) operations. When -@scheme[hash-set] or @scheme[hash-remove] is used on an impersonator of a hash +@racket[hash-set] or @racket[hash-remove] is used on an impersonator of a hash table, the result is an impersonator with the same redirecting procedures. In addition, operations like -@scheme[hash-iterate-key] or @scheme[hash-map], which extract -keys from the table, use @scheme[key-proc] to filter keys extracted -from the table. Operations like @scheme[hash-iterate-value] or -@scheme[hash-iterate-map] implicitly use @scheme[hash-ref] and -therefore redirect through @scheme[ref-proc]. +@racket[hash-iterate-key] or @racket[hash-map], which extract +keys from the table, use @racket[key-proc] to filter keys extracted +from the table. Operations like @racket[hash-iterate-value] or +@racket[hash-iterate-map] implicitly use @racket[hash-ref] and +therefore redirect through @racket[ref-proc]. -The @scheme[ref-proc] must accept @scheme[hash] and a key passed -@scheme[hash-ref]. It must return a replacement key +The @racket[ref-proc] must accept @racket[hash] and a key passed +@racket[hash-ref]. It must return a replacement key as well as a procedure. The returned procedure is called only if the -returned key is found in @scheme[hash] via @scheme[hash-ref], in which -case the procedure is called with @scheme[hash], the previously +returned key is found in @racket[hash] via @racket[hash-ref], in which +case the procedure is called with @racket[hash], the previously returned key, and the found value. The returned procedure must itself return a replacement for the found value. -The @scheme[set-proc] must accept @scheme[hash], a key passed to -@scheme[hash-set!] or @scheme[hash-set], and the value passed to -@scheme[hash-set!] or @scheme[hash-set]; it must produce two values: a +The @racket[set-proc] must accept @racket[hash], a key passed to +@racket[hash-set!] or @racket[hash-set], and the value passed to +@racket[hash-set!] or @racket[hash-set]; it must produce two values: a replacement for the key and a replacement for the value. The returned -key and value are used with @scheme[hash-set!] or @scheme[hash-set] on -the original @scheme[hash] to install the value. +key and value are used with @racket[hash-set!] or @racket[hash-set] on +the original @racket[hash] to install the value. -The @scheme[remove-proc] must accept @scheme[hash] and a key passed to -@scheme[hash-remove!] or @scheme[hash-remove]; it must produce the a -replacement for the key, which is used with @scheme[hash-remove!] or -@scheme[hash-remove] on the original @scheme[hash] to remove any +The @racket[remove-proc] must accept @racket[hash] and a key passed to +@racket[hash-remove!] or @racket[hash-remove]; it must produce the a +replacement for the key, which is used with @racket[hash-remove!] or +@racket[hash-remove] on the original @racket[hash] to remove any mapping using the (impersonator-replaced) key. -The @scheme[key-proc] must accept @scheme[hash] and a key that has -been extracted from @scheme[hash] (by @scheme[hash-iterate-key] or -other operations that use @scheme[hash-iterate-key] internally); it +The @racket[key-proc] must accept @racket[hash] and a key that has +been extracted from @racket[hash] (by @racket[hash-iterate-key] or +other operations that use @racket[hash-iterate-key] internally); it must produce a replacement for the key, which is then reported as a key extracted from the table. The @racket[hash-iterate-value], @racket[hash-map], or @racket[hash-for-each] functions use a combination of @racket[hash-iterate-key] and @racket[hash-ref]. If a key -produced by @scheme[key-proc] does not yield a value through +produced by @racket[key-proc] does not yield a value through @racket[hash-ref], then the @exnraise[exn:fail:contract]. -Pairs of @scheme[prop] and @scheme[prop-val] (the number of arguments -to @scheme[impersonate-hash] must be odd) add impersonator properties -or override impersonator-property values of @scheme[hash].} +Pairs of @racket[prop] and @racket[prop-val] (the number of arguments +to @racket[impersonate-hash] must be odd) add impersonator properties +or override impersonator-property values of @racket[hash].} @defthing[prop:impersonator-of struct-type-property?]{ @@ -330,7 +330,7 @@ as well as @racket[equal?]. The property value must be a procedure of one argument, which is a structure whose structure type has the property. The result can be -@scheme[#f] to indicate the structure does not represent an impersonator, +@racket[#f] to indicate the structure does not represent an impersonator, otherwise the result is a value for which the original structure is an impersonator (so the original structure is an @racket[impersonator-of?] and @racket[equal?] to the result value). The result value must have the @@ -349,14 +349,14 @@ between @racket[impersonator-of?] and @racket[equal?]).} (and/c procedure? chaperone?)]{ Like @racket[impersonate-procedure], but for each value supplied to -@scheme[wrapper-proc], the corresponding result must be the same or a -chaperone of (in the sense of @scheme[chaperone-of?]) the supplied +@racket[wrapper-proc], the corresponding result must be the same or a +chaperone of (in the sense of @racket[chaperone-of?]) the supplied value. The additional result, if any, that precedes the chaperoned values must be a procedure that accepts as many results as produced by -@scheme[proc]; it must return the same number of results, each of +@racket[proc]; it must return the same number of results, each of which is the same or a chaperone of the corresponding original result. -For applications that include keyword arguments, @scheme[wrapper-proc] +For applications that include keyword arguments, @racket[wrapper-proc] must return an additional value before any other values but after the result-chaperoning procedure (if any). The additional value must be a list of chaperones of the keyword arguments that were supplied to the @@ -379,16 +379,16 @@ Like @racket[impersonate-struct], but with the following refinements: @itemlist[ @item{With a structure-field accessor as @racket[orig-proc], - @scheme[redirect-proc] must accept two arguments, @scheme[v] and - the value @scheme[_field-v] that @scheme[orig-proc] produces for - @scheme[v]; it must return a chaperone of @scheme[_field-v]. The + @racket[redirect-proc] must accept two arguments, @racket[v] and + the value @racket[_field-v] that @racket[orig-proc] produces for + @racket[v]; it must return a chaperone of @racket[_field-v]. The corresponding field may be immutable.} @item{With structure-field mutator as @racket[orig-proc], - @scheme[redirect-proc] must accept two arguments, @scheme[v] and - the value @scheme[_field-v] supplied to the mutator; it must - return a chaperone of @scheme[_field-v] to be propagated to - @scheme[orig-proc] and @scheme[v].} + @racket[redirect-proc] must accept two arguments, @racket[v] and + the value @racket[_field-v] supplied to the mutator; it must + return a chaperone of @racket[_field-v] to be propagated to + @racket[orig-proc] and @racket[v].} @item{A property accessor can be supplied as @racket[orig-proc], and the property need not have been created with @@ -396,19 +396,19 @@ Like @racket[impersonate-struct], but with the following refinements: @racket[redirect-proc] uses the same protocol as for a structure-field accessor.} - @item{With @scheme[struct-info] as @racket[orig-proc], the - corresponding @scheme[redirect-proc] must accept two values, - which are the results of @scheme[struct-info] on @scheme[v]; it + @item{With @racket[struct-info] as @racket[orig-proc], the + corresponding @racket[redirect-proc] must accept two values, + which are the results of @racket[struct-info] on @racket[v]; it must return each values or a chaperone of each value. The - @scheme[redirect-proc] is not called if @scheme[struct-info] would - return @scheme[#f] as its first argument.} + @racket[redirect-proc] is not called if @racket[struct-info] would + return @racket[#f] as its first argument.} ] -An @scheme[orig-proc] can be @scheme[struct-info] only if some other -@scheme[orig-proc] is supplied, and each @scheme[orig-proc] must -indicate a distinct operation. If no @scheme[orig-proc]s are supplied, -then no @scheme[prop]s must be supplied, and @scheme[v] is returned +An @racket[orig-proc] can be @racket[struct-info] only if some other +@racket[orig-proc] is supplied, and each @racket[orig-proc] must +indicate a distinct operation. If no @racket[orig-proc]s are supplied, +then no @racket[prop]s must be supplied, and @racket[v] is returned unchaperoned.} @defproc[(chaperone-vector [vec vector?] @@ -419,10 +419,10 @@ unchaperoned.} (and/c vector? chaperone?)]{ Like @racket[impersonate-vector], but with support for immutable vectors. The -@scheme[ref-proc] procedure must produce the same value or a chaperone -of the original value, and @scheme[set-proc] must produce the value -that is given or a chaperone of the value. The @scheme[set-proc] will -not be used if @scheme[vec] is immutable.} +@racket[ref-proc] procedure must produce the same value or a chaperone +of the original value, and @racket[set-proc] must produce the value +that is given or a chaperone of the value. The @racket[set-proc] will +not be used if @racket[vec] is immutable.} @defproc[(chaperone-box [bx box?] [unbox-proc (box? any/c . -> . any/c)] @@ -432,10 +432,10 @@ not be used if @scheme[vec] is immutable.} (and/c box? chaperone?)]{ Like @racket[prox-box], but with support for immutable boxes. The -@scheme[unbox-proc] procedure must produce the same value or a -chaperone of the original value, and @scheme[set-proc] must produce +@racket[unbox-proc] procedure must produce the same value or a +chaperone of the original value, and @racket[set-proc] must produce the same value or a chaperone of the value that it is given. The -@scheme[set-proc] will not be used if @scheme[bx] is immutable.} +@racket[set-proc] will not be used if @racket[bx] is immutable.} @defproc[(chaperone-hash [hash hash?] @@ -450,11 +450,11 @@ the same value or a chaperone of the value that it is given. The (and/c hash? chaperone?)]{ Like @racket[impersonate-hash], but with constraints on the given functions -and support for immutable hashes. The @scheme[ref-proc] procedure must +and support for immutable hashes. The @racket[ref-proc] procedure must return a found value or a chaperone of the value. The -@scheme[set-proc] procedure must produce two values: the key that it +@racket[set-proc] procedure must produce two values: the key that it is given or a chaperone of the key and the value that it is given or a -chaperone of the value. The @scheme[remove-proc] and @scheme[key-proc] +chaperone of the value. The @racket[remove-proc] and @racket[key-proc] procedures must produce the given key or a chaperone of the key.} @defproc[(chaperone-struct-type [struct-type struct-type?] @@ -465,35 +465,35 @@ procedures must produce the given key or a chaperone of the key.} [prop-val any] ... ...) (and/c struct-type? chaperone?)]{ -Returns a chaperoned value like @scheme[struct-type], but with -@scheme[struct-type-info] and @scheme[struct-type-make-constructor] +Returns a chaperoned value like @racket[struct-type], but with +@racket[struct-type-info] and @racket[struct-type-make-constructor] operations on the chaperoned structure type redirected. In addition, when a new structure type is created as a subtype of the chaperoned -structure type, @scheme[guard-proc] is interposed as an extra guard on +structure type, @racket[guard-proc] is interposed as an extra guard on creation of instances of the subtype. -The @scheme[struct-info-proc] must accept 8 arguments---the result of -@scheme[struct-type-info] on @scheme[struct-type]. It must return 8 +The @racket[struct-info-proc] must accept 8 arguments---the result of +@racket[struct-type-info] on @racket[struct-type]. It must return 8 values, where each is the same or a chaperone of the corresponding argument. The 8 values are used as the results of -@scheme[struct-type-info] for the chaperoned structure type. +@racket[struct-type-info] for the chaperoned structure type. -The @scheme[make-constructor-proc] must accept a single procedure +The @racket[make-constructor-proc] must accept a single procedure argument, which is a constructor produced by -@scheme[struct-type-make-constructor] on @scheme[struct-type]. It must +@racket[struct-type-make-constructor] on @racket[struct-type]. It must return the same or a chaperone of the procedure, which is used as the -result of @scheme[struct-type-make-constructor] on the chaperoned +result of @racket[struct-type-make-constructor] on the chaperoned structure type. -The @scheme[guard-proc] must accept as many argument as a constructor -for @scheme[struct-type]; it must return the same number of arguments, +The @racket[guard-proc] must accept as many argument as a constructor +for @racket[struct-type]; it must return the same number of arguments, each the same or a chaperone of the corresponding argument. The -@scheme[guard-proc] is added as a constructor guard when a subtype is +@racket[guard-proc] is added as a constructor guard when a subtype is created of the chaperoned structure type. -Pairs of @scheme[prop] and @scheme[prop-val] (the number of arguments -to @scheme[chaperone-struct-type] must be even) add impersonator properties -or override impersonator-property values of @scheme[struct-type].} +Pairs of @racket[prop] and @racket[prop-val] (the number of arguments +to @racket[chaperone-struct-type] must be even) add impersonator properties +or override impersonator-property values of @racket[struct-type].} @defproc[(chaperone-evt [evt evt?] [proc (evt? . -> . (values evt? (any/c . -> . any/c)))] @@ -501,21 +501,21 @@ or override impersonator-property values of @scheme[struct-type].} [prop-val any] ... ...) (and/c evt? chaperone?)]{ -Returns a chaperoned value like @scheme[evt], but with @scheme[proc] +Returns a chaperoned value like @racket[evt], but with @racket[proc] as an event generator when the result is synchronized with functions like @racket[sync]. The @racket[proc] generator is called on synchronization, much like the procedure passed to @racket[guard-evt], except that @racket[proc] -is given @scheme[evt]. The @racket[proc] must return two values: a +is given @racket[evt]. The @racket[proc] must return two values: a @tech{synchronizable event} that is a chaperone of @racket[evt], and a procedure that is used to check the event's result if it is chosen in a selection. The latter procedure accepts the result of @racket[evt], and it must return a chaperone of that value. -Pairs of @scheme[prop] and @scheme[prop-val] (the number of arguments -to @scheme[chaperone-evt] must be even) add impersonator properties -or override impersonator-property values of @scheme[evt].} +Pairs of @racket[prop] and @racket[prop-val] (the number of arguments +to @racket[chaperone-evt] must be even) add impersonator properties +or override impersonator-property values of @racket[evt].} @; ------------------------------------------------------------ @section{Impersonator Properties} @@ -530,12 +530,12 @@ Creates a new @tech{impersonator property} and returns three values: @itemize[ @item{an @deftech{impersonator property descriptor}, for use with - @scheme[impersonate-procedure], @scheme[chaperone-procedure], + @racket[impersonate-procedure], @racket[chaperone-procedure], and other impersonator constructors;} @item{an @deftech{impersonator property predicate} procedure, which takes - an arbitrary value and returns @scheme[#t] if the value is an - impersonator with a value for the property, @scheme[#f] + an arbitrary value and returns @racket[#t] if the value is an + impersonator with a value for the property, @racket[#f] otherwise;} @item{an @deftech{impersonator property accessor} procedure, which @@ -548,13 +548,13 @@ Creates a new @tech{impersonator property} and returns three values: @defproc[(impersonator-property? [v any/c]) boolean?]{ -Returns @scheme[#t] if @scheme[v] is a @tech{impersonator property -descriptor} value, @scheme[#f] otherwise.} +Returns @racket[#t] if @racket[v] is a @tech{impersonator property +descriptor} value, @racket[#f] otherwise.} @defproc[(impersonator-property-accessor-procedure? [v any/c]) boolean?]{ -Returns @scheme[#t] if @scheme[v] is an accessor procedure produced -by @scheme[make-impersonator-property], @scheme[#f] otherwise.} +Returns @racket[#t] if @racket[v] is an accessor procedure produced +by @racket[make-impersonator-property], @racket[#f] otherwise.} @defthing[impersonator-prop:application-mark impersonator-property?]{ diff --git a/collects/scribblings/reference/chars.scrbl b/collects/scribblings/reference/chars.scrbl index acd9df199d..e4c8f211ef 100644 --- a/collects/scribblings/reference/chars.scrbl +++ b/collects/scribblings/reference/chars.scrbl @@ -9,21 +9,21 @@ @deftech{Characters} range over Unicode @index['("scalar value")]{scalar values}, which includes -characters whose values range from @schemevalfont{#x0} to -@schemevalfont{#x10FFFF}, but not including @schemevalfont{#xD800} to -@schemevalfont{#xDFFF}. The scalar values are a subset of the Unicode +characters whose values range from @racketvalfont{#x0} to +@racketvalfont{#x10FFFF}, but not including @racketvalfont{#xD800} to +@racketvalfont{#xDFFF}. The scalar values are a subset of the Unicode @index['("code point")]{code points}. -Two characters are @scheme[eqv?] if they correspond to the same scalar +Two characters are @racket[eqv?] if they correspond to the same scalar value. For each scalar value less than 256, character values that are -@scheme[eqv?] are also @scheme[eq?]. +@racket[eqv?] are also @racket[eq?]. @; ---------------------------------------- @section{Characters and Scalar Values} @defproc[(char? [v any/c]) boolean?]{ -Return @scheme[#t] if @scheme[v] is a character, @scheme[#f] +Return @racket[#t] if @racket[v] is a character, @racket[#f] otherwise.} @@ -39,16 +39,16 @@ Returns a character's code-point number. (integer-in #xE000 #x10FFFF)))]) char?]{ -Return the character whose code-point number is @scheme[k]. For -@scheme[k] less than @scheme[256], the result is the same object for -the same @scheme[k]. +Return the character whose code-point number is @racket[k]. For +@racket[k] less than @racket[256], the result is the same object for +the same @racket[k]. @mz-examples[(integer->char 65)]} @defproc[(char-utf-8-length [char char?]) (integer-in 1 6)]{ -Produces the same result as @scheme[(bytes-length (string->bytes/utf-8 +Produces the same result as @racket[(bytes-length (string->bytes/utf-8 (string char)))].} @@ -57,20 +57,20 @@ Produces the same result as @scheme[(bytes-length (string->bytes/utf-8 @defproc[(char=? [char1 char?] [char2 char?] ...+) boolean?]{ -Returns @scheme[#t] if all of the arguments are @scheme[eqv?]. +Returns @racket[#t] if all of the arguments are @racket[eqv?]. @mz-examples[(char=? #\a #\a) (char=? #\a #\A #\a)]} @(define (char-sort direction folded?) (if folded? - @elem{Like @scheme[char-ciinterface object%)], and is transparent -(i.e,. its inspector is @scheme[#f], so all immediate instances are -@scheme[equal?]). All other classes are derived from @scheme[object%].} +interface @racket[(class->interface object%)], and is transparent +(i.e,. its inspector is @racket[#f], so all immediate instances are +@racket[equal?]). All other classes are derived from @racket[object%].} @defform/subs[ @@ -303,72 +303,72 @@ interface @scheme[(class->interface object%)], and is transparent Produces a class value. -The @scheme[superclass-expr] expression is evaluated when the -@scheme[class*] expression is evaluated. The result must be a class -value (possibly @scheme[object%]), otherwise the +The @racket[superclass-expr] expression is evaluated when the +@racket[class*] expression is evaluated. The result must be a class +value (possibly @racket[object%]), otherwise the @exnraise[exn:fail:object]. The result of the -@scheme[superclass-expr] expression is the new class's superclass. +@racket[superclass-expr] expression is the new class's superclass. -The @scheme[interface-expr] expressions are also evaluated when the -@scheme[class*] expression is evaluated, after -@scheme[superclass-expr] is evaluated. The result of each -@scheme[interface-expr] must be an interface value, otherwise the +The @racket[interface-expr] expressions are also evaluated when the +@racket[class*] expression is evaluated, after +@racket[superclass-expr] is evaluated. The result of each +@racket[interface-expr] must be an interface value, otherwise the @exnraise[exn:fail:object]. The interfaces returned by the -@scheme[interface-expr]s are all implemented by the class. For each +@racket[interface-expr]s are all implemented by the class. For each identifier in each interface, the class (or one of its ancestors) must declare a public method with the same name, otherwise the @exnraise[exn:fail:object]. The class's superclass must satisfy the implementation requirement of each interface, otherwise the @exnraise[exn:fail:object]. -An @scheme[inspect] @scheme[class-clause] selects an inspector (see +An @racket[inspect] @racket[class-clause] selects an inspector (see @secref["inspectors"]) for the class extension. The -@scheme[inspector-expr] must evaluate to an inspector or @scheme[#f] -when the @scheme[class*] form is evaluated. Just as for structure +@racket[inspector-expr] must evaluate to an inspector or @racket[#f] +when the @racket[class*] form is evaluated. Just as for structure types, an inspector controls access to the class's fields, including -private fields, and also affects comparisons using @scheme[equal?]. If -no @scheme[inspect] clause is provided, access to the class is +private fields, and also affects comparisons using @racket[equal?]. If +no @racket[inspect] clause is provided, access to the class is controlled by the parent of the current inspector (see @secref["inspectors"]). A syntax error is reported if more than one -@scheme[inspect] clause is specified. +@racket[inspect] clause is specified. -The other @scheme[class-clause]s define initialization arguments, +The other @racket[class-clause]s define initialization arguments, public and private fields, and public and private methods. For each -@scheme[id] or @scheme[maybe-renamed] in a @scheme[public], -@scheme[override], @scheme[augment], @scheme[pubment], -@scheme[overment], @scheme[augride], @scheme[public-final], -@scheme[override-final], @scheme[augment-final], or @scheme[private] -clause, there must be one @scheme[method-definition]. All other -definition @scheme[class-clause]s create private fields. All remaining -@scheme[expr]s are initialization expressions to be evaluated when the +@racket[id] or @racket[maybe-renamed] in a @racket[public], +@racket[override], @racket[augment], @racket[pubment], +@racket[overment], @racket[augride], @racket[public-final], +@racket[override-final], @racket[augment-final], or @racket[private] +clause, there must be one @racket[method-definition]. All other +definition @racket[class-clause]s create private fields. All remaining +@racket[expr]s are initialization expressions to be evaluated when the class is instantiated (see @secref["objcreation"]). -The result of a @scheme[class*] expression is a new class, derived +The result of a @racket[class*] expression is a new class, derived from the specified superclass and implementing the specified interfaces. Instances of the class are created with the -@scheme[instantiate] form or @scheme[make-object] procedure, as +@racket[instantiate] form or @racket[make-object] procedure, as described in @secref["objcreation"]. -Each @scheme[class-clause] is (partially) macro-expanded to reveal its -shapes. If a @scheme[class-clause] is a @scheme[begin] expression, its -sub-expressions are lifted out of the @scheme[begin] and treated as -@scheme[class-clause]s, in the same way that @scheme[begin] is +Each @racket[class-clause] is (partially) macro-expanded to reveal its +shapes. If a @racket[class-clause] is a @racket[begin] expression, its +sub-expressions are lifted out of the @racket[begin] and treated as +@racket[class-clause]s, in the same way that @racket[begin] is flattened for top-level and embedded definitions. -Within a @scheme[class*] form for instances of the new class, -@scheme[this] is bound to the object itself; -@scheme[this%] is bound to the class of the object; -@scheme[super-instantiate], @scheme[super-make-object], and -@scheme[super-new] are bound to forms to initialize fields in the -superclass (see @secref["objcreation"]); @scheme[super] is +Within a @racket[class*] form for instances of the new class, +@racket[this] is bound to the object itself; +@racket[this%] is bound to the class of the object; +@racket[super-instantiate], @racket[super-make-object], and +@racket[super-new] are bound to forms to initialize fields in the +superclass (see @secref["objcreation"]); @racket[super] is available for calling superclass methods (see -@secref["clmethoddefs"]); and @scheme[inner] is available for +@secref["clmethoddefs"]); and @racket[inner] is available for calling subclass augmentations of methods (see @secref["clmethoddefs"]).} @defform[(class superclass-expr class-clause ...)]{ -Like @scheme[class*], but omits the @scheme[_interface-expr]s, for the case that none are needed. +Like @racket[class*], but omits the @racket[_interface-expr]s, for the case that none are needed. @defexamples[ #:eval class-eval @@ -382,9 +382,9 @@ Like @scheme[class*], but omits the @scheme[_interface-expr]s, for the case that @defidform[this]{ -@index['("self")]{Within} a @scheme[class*] form, @scheme[this] refers +@index['("self")]{Within} a @racket[class*] form, @racket[this] refers to the current object (i.e., the object being initialized or whose -method was called). Use outside the body of a @scheme[class*] form is +method was called). Use outside the body of a @racket[class*] form is a syntax error. @defexamples[ @@ -401,9 +401,9 @@ a syntax error. @defidform[this%]{ -Within a @scheme[class*] form, @scheme[this%] refers to the class +Within a @racket[class*] form, @racket[this%] refers to the class of the current object (i.e., the object being initialized or whose -method was called). Use outside the body of a @scheme[class*] form is +method was called). Use outside the body of a @racket[class*] form is a syntax error. @defexamples[ @@ -478,42 +478,42 @@ a syntax error. ...) ]{ -Like @scheme[class*], but includes a sub-expression to be used as the +Like @racket[class*], but includes a sub-expression to be used as the source for all syntax errors within the class definition. For example, -@scheme[define-serializable-class] expands to @scheme[class/derived] +@racket[define-serializable-class] expands to @racket[class/derived] so that errors in the body of the class are reported in terms of -@scheme[define-serializable-class] instead of @scheme[class]. +@racket[define-serializable-class] instead of @racket[class]. -The @scheme[original-datum] is the original expression to use for +The @racket[original-datum] is the original expression to use for reporting errors. -The @scheme[name-id] is used to name the resulting class; if it -is @scheme[#f], the class name is inferred. +The @racket[name-id] is used to name the resulting class; if it +is @racket[#f], the class name is inferred. -The @scheme[super-expr], @scheme[interface-expr]s, and -@scheme[class-clause]s are as for @scheme[class*]. +The @racket[super-expr], @racket[interface-expr]s, and +@racket[class-clause]s are as for @racket[class*]. -If the @scheme[deserialize-id-expr] is not literally @scheme[#f], then +If the @racket[deserialize-id-expr] is not literally @racket[#f], then a serializable class is generated, and the result is two values instead of one: the class and a deserialize-info structure produced by -@scheme[make-deserialize-info]. The @scheme[deserialize-id-expr] +@racket[make-deserialize-info]. The @racket[deserialize-id-expr] should produce a value suitable as the second argument to -@scheme[make-serialize-info], and it should refer to an export whose +@racket[make-serialize-info], and it should refer to an export whose value is the deserialize-info structure. Future optional forms may be added to the sequence that currently ends -with @scheme[deserialize-id-expr].} +with @racket[deserialize-id-expr].} @; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @subsection[#:tag "clinitvars"]{Initialization Variables} -A class's initialization variables, declared with @scheme[init], -@scheme[init-field], and @scheme[init-rest], are instantiated +A class's initialization variables, declared with @racket[init], +@racket[init-field], and @racket[init-rest], are instantiated for each object of a class. Initialization variables can be used in the initial value expressions of fields, default value expressions for initialization arguments, and in initialization expressions. Only -initialization variables declared with @scheme[init-field] can be +initialization variables declared with @racket[init-field] can be accessed from methods; accessing any other initialization variable from a method is a syntax error. @@ -521,8 +521,8 @@ The values bound to initialization variables are @itemize[ - @item{the arguments provided with @scheme[instantiate] or passed to - @scheme[make-object], if the object is created as a direct instance + @item{the arguments provided with @racket[instantiate] or passed to + @racket[make-object], if the object is created as a direct instance of the class; or,} @item{the arguments passed to the superclass initialization form or @@ -532,44 +532,44 @@ The values bound to initialization variables are ] If an initialization argument is not provided for an initialization -variable that has an associated @scheme[_default-value-expr], then the -@scheme[_default-value-expr] expression is evaluated to obtain a value -for the variable. A @scheme[_default-value-expr] is only evaluated when +variable that has an associated @racket[_default-value-expr], then the +@racket[_default-value-expr] expression is evaluated to obtain a value +for the variable. A @racket[_default-value-expr] is only evaluated when an argument is not provided for its variable. The environment of -@scheme[_default-value-expr] includes all of the initialization +@racket[_default-value-expr] includes all of the initialization variables, all of the fields, and all of the methods of the class. If -multiple @scheme[_default-value-expr]s are evaluated, they are +multiple @racket[_default-value-expr]s are evaluated, they are evaluated from left to right. Object creation and field initialization are described in detail in @secref["objcreation"]. -If an initialization variable has no @scheme[_default-value-expr], then +If an initialization variable has no @racket[_default-value-expr], then the object creation or superclass initialization call must supply an argument for the variable, otherwise the @exnraise[exn:fail:object]. Initialization arguments can be provided by name or by position. The external name of an initialization variable can be used with -@scheme[instantiate] or with the superclass initialization form. Those -forms also accept by-position arguments. The @scheme[make-object] +@racket[instantiate] or with the superclass initialization form. Those +forms also accept by-position arguments. The @racket[make-object] procedure and the superclass initialization procedure accept only by-position arguments. Arguments provided by position are converted into by-name arguments -using the order of @scheme[init] and @scheme[init-field] clauses and -the order of variables within each clause. When an @scheme[instantiate] +using the order of @racket[init] and @racket[init-field] clauses and +the order of variables within each clause. When an @racket[instantiate] form provides both by-position and by-name arguments, the converted arguments are placed before by-name arguments. (The order can be significant; see also @secref["objcreation"].) -Unless a class contains an @scheme[init-rest] clause, when the number +Unless a class contains an @racket[init-rest] clause, when the number of by-position arguments exceeds the number of declared initialization variables, the order of variables in the superclass (and so on, up the superclass chain) determines the by-name conversion. -If a class expression contains an @scheme[init-rest] clause, there +If a class expression contains an @racket[init-rest] clause, there must be only one, and it must be last. If it declares a variable, then the variable receives extra by-position initialization arguments as a list (similar to a dotted ``rest argument'' in a procedure). An -@scheme[init-rest] variable can receive by-position initialization +@racket[init-rest] variable can receive by-position initialization arguments that are left over from a by-name conversion for a derived class. When a derived class's superclass initialization provides even more by-position arguments, they are prefixed onto the by-position @@ -578,7 +578,7 @@ arguments accumulated so far. If too few or too many by-position initialization arguments are provided to an object creation or superclass initialization, then the @exnraise[exn:fail:object]. Similarly, if extra by-position arguments -are provided to a class with an @scheme[init-rest] clause, the +are provided to a class with an @racket[init-rest] clause, the @exnraise[exn:fail:object]. Unused (by-name) arguments are to be propagated to the superclass, as @@ -595,27 +595,27 @@ external names. @subsection[#:tag "clfields"]{Fields} -Each @scheme[field], @scheme[init-field], and non-method -@scheme[define-values] clause in a class declares one or more new -fields for the class. Fields declared with @scheme[field] or -@scheme[init-field] are public. Public fields can be accessed and -mutated by subclasses using @scheme[inherit-field]. Public fields are -also accessible outside the class via @scheme[class-field-accessor] -and mutable via @scheme[class-field-mutator] (see -@secref["ivaraccess"]). Fields declared with @scheme[define-values] +Each @racket[field], @racket[init-field], and non-method +@racket[define-values] clause in a class declares one or more new +fields for the class. Fields declared with @racket[field] or +@racket[init-field] are public. Public fields can be accessed and +mutated by subclasses using @racket[inherit-field]. Public fields are +also accessible outside the class via @racket[class-field-accessor] +and mutable via @racket[class-field-mutator] (see +@secref["ivaraccess"]). Fields declared with @racket[define-values] are accessible only within the class. -A field declared with @scheme[init-field] is both a public field and +A field declared with @racket[init-field] is both a public field and an initialization variable. See @secref["clinitvars"] for information about initialization variables. -An @scheme[inherit-field] declaration makes a public field defined by +An @racket[inherit-field] declaration makes a public field defined by a superclass directly accessible in the class expression. If the indicated field is not defined in the superclass, the @exnraise[exn:fail:object] when the class expression is evaluated. Every field in a superclass is present in a derived class, even if it -is not declared with @scheme[inherit-field] in the derived class. The -@scheme[inherit-field] clause does not control inheritance, but merely +is not declared with @racket[inherit-field] in the derived class. The +@racket[inherit-field] clause does not control inheritance, but merely controls lexical scope within a class expression. When an object is first created, all of its fields have the @@ -633,191 +633,191 @@ external names. @subsubsection[#:tag "clmethoddefs"]{Method Definitions} -Each @scheme[public], @scheme[override], @scheme[augment], -@scheme[pubment], @scheme[overment], @scheme[augride], -@scheme[public-final], @scheme[override-final], -@scheme[augment-final], and @scheme[private] clause in a class +Each @racket[public], @racket[override], @racket[augment], +@racket[pubment], @racket[overment], @racket[augride], +@racket[public-final], @racket[override-final], +@racket[augment-final], and @racket[private] clause in a class declares one or more method names. Each method name must have a -corresponding @scheme[_method-definition]. The order of -@scheme[public], @|etc|, clauses and their corresponding definitions +corresponding @racket[_method-definition]. The order of +@racket[public], @|etc|, clauses and their corresponding definitions (among themselves, and with respect to other clauses in the class) does not matter. -As shown in the grammar for @scheme[class*], a method definition is +As shown in the grammar for @racket[class*], a method definition is syntactically restricted to certain procedure forms, as defined by the -grammar for @scheme[_method-procedure]; in the last two forms of -@scheme[_method-procedure], the body @scheme[id] must be one of the -@scheme[id]s bound by @scheme[let-values] or @scheme[letrec-values]. A -@scheme[_method-procedure] expression is not evaluated +grammar for @racket[_method-procedure]; in the last two forms of +@racket[_method-procedure], the body @racket[id] must be one of the +@racket[id]s bound by @racket[let-values] or @racket[letrec-values]. A +@racket[_method-procedure] expression is not evaluated directly. Instead, for each method, a class-specific method procedure is created; it takes an initial object argument, in addition to the -arguments the procedure would accept if the @scheme[_method-procedure] +arguments the procedure would accept if the @racket[_method-procedure] expression were evaluated directly. The body of the procedure is transformed to access methods and fields through the object argument. -A method declared with @scheme[public], @scheme[pubment], or -@scheme[public-final] introduces a new method into a class. The method +A method declared with @racket[public], @racket[pubment], or +@racket[public-final] introduces a new method into a class. The method must not be present already in the superclass, otherwise the @exnraise[exn:fail:object] when the class expression is evaluated. A -method declared with @scheme[public] can be overridden in a subclass -that uses @scheme[override], @scheme[overment], or -@scheme[override-final]. A method declared with @scheme[pubment] can -be augmented in a subclass that uses @scheme[augment], -@scheme[augride], or @scheme[augment-final]. A method declared with -@scheme[public-final] cannot be overridden or augmented in a subclass. +method declared with @racket[public] can be overridden in a subclass +that uses @racket[override], @racket[overment], or +@racket[override-final]. A method declared with @racket[pubment] can +be augmented in a subclass that uses @racket[augment], +@racket[augride], or @racket[augment-final]. A method declared with +@racket[public-final] cannot be overridden or augmented in a subclass. -A method declared with @scheme[override], @scheme[overment], or -@scheme[override-final] overrides a definition already present in the +A method declared with @racket[override], @racket[overment], or +@racket[override-final] overrides a definition already present in the superclass. If the method is not already present, the @exnraise[exn:fail:object] when the class expression is evaluated. A -method declared with @scheme[override] can be overridden again in a -subclass that uses @scheme[override], @scheme[overment], or -@scheme[override-final]. A method declared with @scheme[overment] can -be augmented in a subclass that uses @scheme[augment], -@scheme[augride], or @scheme[augment-final]. A method declared with -@scheme[override-final] cannot be overridden further or augmented in a +method declared with @racket[override] can be overridden again in a +subclass that uses @racket[override], @racket[overment], or +@racket[override-final]. A method declared with @racket[overment] can +be augmented in a subclass that uses @racket[augment], +@racket[augride], or @racket[augment-final]. A method declared with +@racket[override-final] cannot be overridden further or augmented in a subclass. -A method declared with @scheme[augment], @scheme[augride], or -@scheme[augment-final] augments a definition already present in the +A method declared with @racket[augment], @racket[augride], or +@racket[augment-final] augments a definition already present in the superclass. If the method is not already present, the @exnraise[exn:fail:object] when the class expression is evaluated. A -method declared with @scheme[augment] can be augmented further in a -subclass that uses @scheme[augment], @scheme[augride], or -@scheme[augment-final]. A method declared with @scheme[augride] can be -overridden in a subclass that uses @scheme[override], -@scheme[overment], or @scheme[override-final]. (Such an override +method declared with @racket[augment] can be augmented further in a +subclass that uses @racket[augment], @racket[augride], or +@racket[augment-final]. A method declared with @racket[augride] can be +overridden in a subclass that uses @racket[override], +@racket[overment], or @racket[override-final]. (Such an override merely replaces the augmentation, not the method that is augmented.) -A method declared with @scheme[augment-final] cannot be overridden or +A method declared with @racket[augment-final] cannot be overridden or augmented further in a subclass. -A method declared with @scheme[private] is not accessible outside the +A method declared with @racket[private] is not accessible outside the class expression, cannot be overridden, and never overrides a method in the superclass. -When a method is declared with @scheme[override], @scheme[overment], -or @scheme[override-final], then the superclass implementation of the -method can be called using @scheme[super] form. +When a method is declared with @racket[override], @racket[overment], +or @racket[override-final], then the superclass implementation of the +method can be called using @racket[super] form. -When a method is declared with @scheme[pubment], @scheme[augment], or -@scheme[overment], then a subclass augmenting method can be called -using the @scheme[inner] form. The only difference between -@scheme[public-final] and @scheme[pubment] without a corresponding -@scheme[inner] is that @scheme[public-final] prevents the declaration +When a method is declared with @racket[pubment], @racket[augment], or +@racket[overment], then a subclass augmenting method can be called +using the @racket[inner] form. The only difference between +@racket[public-final] and @racket[pubment] without a corresponding +@racket[inner] is that @racket[public-final] prevents the declaration of augmenting methods that would be ignored. @defform*[[(super id arg ...) (super id arg ... . arg-list-expr)]]{ Always accesses the superclass method, independent of whether the -method is overridden again in subclasses. Using the @scheme[super] -form outside of @scheme[class*] is a syntax error. Each @scheme[arg] -is as for @scheme[#%app]: either @scheme[_arg-expr] or -@scheme[_keyword _arg-expr]. +method is overridden again in subclasses. Using the @racket[super] +form outside of @racket[class*] is a syntax error. Each @racket[arg] +is as for @racket[#%app]: either @racket[_arg-expr] or +@racket[_keyword _arg-expr]. -The second form is analogous to using @scheme[apply] with a procedure; -the @scheme[arg-list-expr] must not be a parenthesized expression.} +The second form is analogous to using @racket[apply] with a procedure; +the @racket[arg-list-expr] must not be a parenthesized expression.} @defform*[[(inner default-expr id arg ...) (inner default-expr id arg ... . arg-list-expr)]]{ If the object's class does not supply an augmenting method, then -@scheme[default-expr] is evaluated, and the @scheme[arg] expressions +@racket[default-expr] is evaluated, and the @racket[arg] expressions are not evaluated. Otherwise, the augmenting method is called with the -@scheme[arg] results as arguments, and @scheme[default-expr] is not -evaluated. If no @scheme[inner] call is evaluated for a particular +@racket[arg] results as arguments, and @racket[default-expr] is not +evaluated. If no @racket[inner] call is evaluated for a particular method, then augmenting methods supplied by subclasses are never -used. Using the @scheme[inner] form outside of @scheme[class*] is an +used. Using the @racket[inner] form outside of @racket[class*] is an syntax error. -The second form is analogous to using @scheme[apply] with a procedure; -the @scheme[arg-list-expr] must not be a parenthesized expression.} +The second form is analogous to using @racket[apply] with a procedure; +the @racket[arg-list-expr] must not be a parenthesized expression.} @; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @subsubsection[#:tag "classinherit"]{Inherited and Superclass Methods} -Each @scheme[inherit], @scheme[inherit/super], @scheme[inherit/inner], -@scheme[rename-super], and @scheme[rename-inner] clause declares one +Each @racket[inherit], @racket[inherit/super], @racket[inherit/inner], +@racket[rename-super], and @racket[rename-inner] clause declares one or more methods that are defined in the class, but must be present in -the superclass. The @scheme[rename-super] and @scheme[rename-inner] -declarations are rarely used, since @scheme[inherit/super] and -@scheme[inherit/inner] provide the same access. Also, superclass and -augmenting methods are typically accessed through @scheme[super] and -@scheme[inner] in a class that also declares the methods, instead of -through @scheme[inherit/super], @scheme[inherit/inner], -@scheme[rename-super], or @scheme[rename-inner]. +the superclass. The @racket[rename-super] and @racket[rename-inner] +declarations are rarely used, since @racket[inherit/super] and +@racket[inherit/inner] provide the same access. Also, superclass and +augmenting methods are typically accessed through @racket[super] and +@racket[inner] in a class that also declares the methods, instead of +through @racket[inherit/super], @racket[inherit/inner], +@racket[rename-super], or @racket[rename-inner]. -Method names declared with @scheme[inherit], @scheme[inherit/super], -or @scheme[inherit/inner] access overriding declarations, if any, at -run time. Method names declared with @scheme[inherit/super] can also -be used with the @scheme[super] form to access the superclass -implementation, and method names declared with @scheme[inherit/inner] -can also be used with the @scheme[inner] form to access an augmenting +Method names declared with @racket[inherit], @racket[inherit/super], +or @racket[inherit/inner] access overriding declarations, if any, at +run time. Method names declared with @racket[inherit/super] can also +be used with the @racket[super] form to access the superclass +implementation, and method names declared with @racket[inherit/inner] +can also be used with the @racket[inner] form to access an augmenting method, if any. -Method names declared with @scheme[rename-super] always access the +Method names declared with @racket[rename-super] always access the superclass's implementation at run-time. Methods declared with -@scheme[rename-inner] access a subclass's augmenting method, if any, +@racket[rename-inner] access a subclass's augmenting method, if any, and must be called with the form -@schemeblock[ +@racketblock[ (_id (lambda () _default-expr) _arg ...) ] -so that a @scheme[default-expr] is available to evaluate when no -augmenting method is available. In such a form, @scheme[lambda] is a -literal identifier to separate the @scheme[default-expr] from the -@scheme[arg]. When an augmenting method is available, it receives the -results of the @scheme[arg] expressions as arguments. +so that a @racket[default-expr] is available to evaluate when no +augmenting method is available. In such a form, @racket[lambda] is a +literal identifier to separate the @racket[default-expr] from the +@racket[arg]. When an augmenting method is available, it receives the +results of the @racket[arg] expressions as arguments. Methods that are present in the superclass but not declared with -@scheme[inherit], @scheme[inherit/super], or @scheme[inherit/inner] or -@scheme[rename-super] are not directly accessible in the class -(though they can be called with @scheme[send]). Every public method +@racket[inherit], @racket[inherit/super], or @racket[inherit/inner] or +@racket[rename-super] are not directly accessible in the class +(though they can be called with @racket[send]). Every public method in a superclass is present in a derived class, even if it is not -declared with @scheme[inherit] in the derived class; the -@scheme[inherit] clause does not control inheritance, but merely +declared with @racket[inherit] in the derived class; the +@racket[inherit] clause does not control inheritance, but merely controls lexical scope within a class expression. -If a method declared with @scheme[inherit], @scheme[inherit/super], -@scheme[inherit/inner], @scheme[rename-super], or -@scheme[rename-inner] is not present in the superclass, the +If a method declared with @racket[inherit], @racket[inherit/super], +@racket[inherit/inner], @racket[rename-super], or +@racket[rename-inner] is not present in the superclass, the @exnraise[exn:fail:object] when the class expression is evaluated. @; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @subsubsection[#:tag "extnames"]{Internal and External Names} -Each method declared with @scheme[public], @scheme[override], -@scheme[augment], @scheme[pubment], @scheme[overment], -@scheme[augride], @scheme[public-final], @scheme[override-final], -@scheme[augment-final], @scheme[inherit], @scheme[inherit/super], -@scheme[inherit/inner], @scheme[rename-super], and -@scheme[rename-inner] can have separate internal and external names -when @scheme[(internal-id external-id)] is used for declaring the +Each method declared with @racket[public], @racket[override], +@racket[augment], @racket[pubment], @racket[overment], +@racket[augride], @racket[public-final], @racket[override-final], +@racket[augment-final], @racket[inherit], @racket[inherit/super], +@racket[inherit/inner], @racket[rename-super], and +@racket[rename-inner] can have separate internal and external names +when @racket[(internal-id external-id)] is used for declaring the method. The internal name is used to access the method directly within -the class expression (including within @scheme[super] or -@scheme[inner] forms), while the external name is used with -@scheme[send] and @scheme[generic] (see @secref["ivaraccess"]). If -a single @scheme[id] is provided for a method declaration, the +the class expression (including within @racket[super] or +@racket[inner] forms), while the external name is used with +@racket[send] and @racket[generic] (see @secref["ivaraccess"]). If +a single @racket[id] is provided for a method declaration, the identifier is used for both the internal and external names. Method inheritance, overriding, and augmentation are based on external names only. Separate internal and external names are required for -@scheme[rename-super] and @scheme[rename-inner] (for historical +@racket[rename-super] and @racket[rename-inner] (for historical reasons, mainly). -Each @scheme[init], @scheme[init-field], @scheme[field], or -@scheme[inherit-field] variable similarly has an internal and an +Each @racket[init], @racket[init-field], @racket[field], or +@racket[inherit-field] variable similarly has an internal and an external name. The internal name is used within the class to access the variable, while the external name is used outside the class when -providing initialization arguments (e.g., to @scheme[instantiate]), +providing initialization arguments (e.g., to @racket[instantiate]), inheriting a field, or accessing a field externally (e.g., with -@scheme[class-field-accessor]). As for methods, when inheriting a -field with @scheme[inherit-field], the external name is matched to an +@racket[class-field-accessor]). As for methods, when inheriting a +field with @racket[inherit-field], the external name is matched to an external field name in the superclass, while the internal name is -bound in the @scheme[class] expression. +bound in the @racket[class] expression. A single identifier can be used as an internal identifier and an external identifier, and it is possible to use the same identifier as @@ -832,39 +832,39 @@ be distinct from all other initialization argument names. By default, external names have no lexical scope, which means, for example, that an external method name matches the same syntactic -symbol in all uses of @scheme[send]. The -@scheme[define-local-member-name] and @scheme[define-member-name] forms +symbol in all uses of @racket[send]. The +@racket[define-local-member-name] and @racket[define-member-name] forms introduce scoped external names. -When a @scheme[class] expression is compiled, identifiers used in +When a @racket[class] expression is compiled, identifiers used in place of external names must be symbolically distinct (when the corresponding external names are required to be distinct), otherwise a syntax error is reported. When no external name is bound by -@scheme[define-member-name], then the actual external names are -guaranteed to be distinct when @scheme[class] expression is evaluated. -When any external name is bound by @scheme[define-member-name], the -@exnraise[exn:fail:object] by @scheme[class] if the actual external +@racket[define-member-name], then the actual external names are +guaranteed to be distinct when @racket[class] expression is evaluated. +When any external name is bound by @racket[define-member-name], the +@exnraise[exn:fail:object] by @racket[class] if the actual external names are not distinct. @defform[(define-local-member-name id ...)]{ -Unless it appears as the top-level definition, binds each @scheme[id] +Unless it appears as the top-level definition, binds each @racket[id] so that, within the scope of the definition, each use of each -@scheme[id] as an external name is resolved to a hidden name generated -by the @scheme[define-local-member-name] declaration. Thus, methods, +@racket[id] as an external name is resolved to a hidden name generated +by the @racket[define-local-member-name] declaration. Thus, methods, fields, and initialization arguments declared with such external-name -@scheme[id]s are accessible only in the scope of the -@scheme[define-local-member-name] declaration. As a top-level -definition, @scheme[define-local-member-name] binds @scheme[id] to its +@racket[id]s are accessible only in the scope of the +@racket[define-local-member-name] declaration. As a top-level +definition, @racket[define-local-member-name] binds @racket[id] to its symbolic form. -The binding introduced by @scheme[define-local-member-name] is a +The binding introduced by @racket[define-local-member-name] is a syntax binding that can be exported and imported with -@scheme[module]s. Each evaluation of a -@scheme[define-local-member-name] declaration generates a distinct +@racket[module]s. Each evaluation of a +@racket[define-local-member-name] declaration generates a distinct hidden name (except as a top-level definition). The -@scheme[interface->method-names] procedure does not expose hidden +@racket[interface->method-names] procedure does not expose hidden names. @defexamples[ @@ -888,38 +888,38 @@ r @defform[(define-member-name id key-expr)]{ Maps a single external name to an external name that is determined by -an expression. The value of @scheme[key-expr] must be the result of either a -@scheme[member-name-key] expression or a @scheme[generate-member-key] call.} +an expression. The value of @racket[key-expr] must be the result of either a +@racket[member-name-key] expression or a @racket[generate-member-key] call.} @defform[(member-name-key identifier)]{ -Produces a representation of the external name for @scheme[id] in the -environment of the @scheme[member-name-key] expression.} +Produces a representation of the external name for @racket[id] in the +environment of the @racket[member-name-key] expression.} @defproc[(generate-member-key) member-name-key?]{ Produces a hidden name, just like the binding for -@scheme[define-local-member-name].} +@racket[define-local-member-name].} @defproc[(member-name-key? [v any/c]) boolean?]{ -Returns @scheme[#t] for values produced by @scheme[member-name-key] -and @scheme[generate-member-key], @scheme[#f] +Returns @racket[#t] for values produced by @racket[member-name-key] +and @racket[generate-member-key], @racket[#f] otherwise.} @defproc[(member-name-key=? [a-key member-name-key?] [b-key member-name-key?]) boolean?]{ -Produces @scheme[#t] if member-name keys @scheme[a-key] and -@scheme[b-key] represent the same external name, @scheme[#f] +Produces @racket[#t] if member-name keys @racket[a-key] and +@racket[b-key] represent the same external name, @racket[#f] otherwise.} @defproc[(member-name-key-hash-code [a-key member-name-key?]) integer?]{ Produces an integer hash code consistent with -@scheme[member-name-key=?] comparisons, analogous to -@scheme[equal-hash-code].} +@racket[member-name-key=?] comparisons, analogous to +@racket[equal-hash-code].} @defexamples[ #:eval class-eval @@ -953,10 +953,10 @@ Produces an integer hash code consistent with @section[#:tag "objcreation"]{Creating Objects} -The @scheme[make-object] procedure creates a new object with -by-position initialization arguments, the @scheme[new] form +The @racket[make-object] procedure creates a new object with +by-position initialization arguments, the @racket[new] form creates a new object with by-name initialization arguments, and -the @scheme[instantiate] form creates a new object with both +the @racket[instantiate] form creates a new object with both by-position and by-name initialization arguments. @@ -965,28 +965,28 @@ special @|undefined-const| value (see @secref["void"]). Initialization variables with default value expressions (and no provided value) are also initialized to @|undefined-const|. After argument values are assigned to -initialization variables, expressions in @scheme[field] clauses, -@scheme[init-field] clauses with no provided argument, -@scheme[init] clauses with no provided argument, private field +initialization variables, expressions in @racket[field] clauses, +@racket[init-field] clauses with no provided argument, +@racket[init] clauses with no provided argument, private field definitions, and other expressions are evaluated. Those expressions are evaluated as they appear in the class expression, from left to right. Sometime during the evaluation of the expressions, superclass-declared initializations must be evaluated once by -using the @scheme[super-make-object] procedure, -@scheme[super-new] form, or @scheme[super-instantiate] form. +using the @racket[super-make-object] procedure, +@racket[super-new] form, or @racket[super-instantiate] form. By-name initialization arguments to a class that have no matching initialization variable are implicitly added as by-name arguments -to a @scheme[super-make-object], @scheme[super-new], or -@scheme[super-instantiate] invocation, after the explicit +to a @racket[super-make-object], @racket[super-new], or +@racket[super-instantiate] invocation, after the explicit arguments. If multiple initialization arguments are provided for the same name, the first (if any) is used, and the unused arguments are propagated to the superclass. (Note that converted by-position arguments are always placed before explicit by-name arguments.) The initialization procedure for the -@scheme[object%] class accepts zero initialization arguments; if +@racket[object%] class accepts zero initialization arguments; if it receives any by-name initialization arguments, then @exnraise[exn:fail:object]. @@ -1005,26 +1005,26 @@ initialization (unlike objects in C++). @defproc[(make-object [class class?] [init-v any/c] ...) object?]{ -Creates an instance of @scheme[class]. The @scheme[init-v]s are +Creates an instance of @racket[class]. The @racket[init-v]s are passed as initialization arguments, bound to the initialization -variables of @scheme[class] for the newly created object as -described in @secref["clinitvars"]. If @scheme[class] is not a +variables of @racket[class] for the newly created object as +described in @secref["clinitvars"]. If @racket[class] is not a class, the @exnraise[exn:fail:contract].} @defform[(new class-expr (id by-name-expr) ...)]{ -Creates an instance of the value of @scheme[class-expr] (which -must be a class), and the value of each @scheme[by-name-expr] is +Creates an instance of the value of @racket[class-expr] (which +must be a class), and the value of each @racket[by-name-expr] is provided as a by-name argument for the corresponding -@scheme[id].} +@racket[id].} @defform[(instantiate class-expr (by-pos-expr ...) (id by-name-expr) ...)]{ -Creates an instance of the value of @scheme[class-expr] (which -must be a class), and the values of the @scheme[by-pos-expr]s are +Creates an instance of the value of @racket[class-expr] (which +must be a class), and the values of the @racket[by-pos-expr]s are provided as by-position initialization arguments. In addition, -the value of each @scheme[by-name-expr] is provided as a by-name -argument for the corresponding @scheme[id].} +the value of each @racket[by-name-expr] is provided as a by-name +argument for the corresponding @racket[id].} @defidform[super-make-object]{ @@ -1056,7 +1056,7 @@ environment. Within a method body, only the fields and other methods of the class can be referenced; a reference to any other class-introduced identifier is a syntax error. Elsewhere within the class, all class-introduced identifiers are available, and fields and -initialization variables can be mutated with @scheme[set!]. +initialization variables can be mutated with @racket[set!]. @; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1072,30 +1072,30 @@ application can have the following form: (method-id arg ... . arg-list-expr) ] -This form calls the method in a way analogous to @scheme[(apply -_method-id _arg ... _arg-list-expr)]. The @scheme[arg-list-expr] +This form calls the method in a way analogous to @racket[(apply +_method-id _arg ... _arg-list-expr)]. The @racket[arg-list-expr] must not be a parenthesized expression. -Methods are called from outside a class with the @scheme[send] and -@scheme[send/apply] forms. +Methods are called from outside a class with the @racket[send] and +@racket[send/apply] forms. @defform*[[(send obj-expr method-id arg ...) (send obj-expr method-id arg ... . arg-list-expr)]]{ -Evaluates @scheme[obj-expr] to obtain an object, and calls the method -with (external) name @scheme[method-id] on the object, providing the -@scheme[arg] results as arguments. Each @scheme[arg] is as for -@scheme[#%app]: either @scheme[_arg-expr] or @scheme[_keyword -_arg-expr]. In the second form, @scheme[arg-list-expr] cannot be a +Evaluates @racket[obj-expr] to obtain an object, and calls the method +with (external) name @racket[method-id] on the object, providing the +@racket[arg] results as arguments. Each @racket[arg] is as for +@racket[#%app]: either @racket[_arg-expr] or @racket[_keyword +_arg-expr]. In the second form, @racket[arg-list-expr] cannot be a parenthesized expression. -If @scheme[obj-expr] does not produce an object, the +If @racket[obj-expr] does not produce an object, the @exnraise[exn:fail:contract]. If the object has no public method named -@scheme[method-id], the @exnraise[exn:fail:object].} +@racket[method-id], the @exnraise[exn:fail:object].} @defform[(send/apply obj-expr method-id arg ... arg-list-expr)]{ -Like the dotted form of @scheme[send], but @scheme[arg-list-expr] can +Like the dotted form of @racket[send], but @racket[arg-list-expr] can be any expression.} @@ -1104,11 +1104,11 @@ be any expression.} (method-id arg ... . arg-list-expr)])]{ Calls multiple methods (in order) of the same object. Each -@scheme[msg] corresponds to a use of @scheme[send]. +@racket[msg] corresponds to a use of @racket[send]. For example, -@schemeblock[ +@racketblock[ (send* edit (begin-edit-sequence) (insert "Hello") (insert #\newline) @@ -1117,7 +1117,7 @@ For example, is the same as -@schemeblock[ +@racketblock[ (let ([o edit]) (send o begin-edit-sequence) (send o insert "Hello") @@ -1130,14 +1130,14 @@ is the same as Extracts methods from an object and binds a local name that can be applied directly (in the same way as declared methods within a class) -for each method. Each @scheme[obj-expr] must produce an object, +for each method. Each @racket[obj-expr] must produce an object, which must have a public method named by the corresponding -@scheme[method-id]. The corresponding @scheme[id] is bound so that it +@racket[method-id]. The corresponding @racket[id] is bound so that it can be applied directly (see @secref["methodcalls"]). Example: -@schemeblock[ +@racketblock[ (let ([s (new stack%)]) (with-method ([push (s push!)] [pop (s pop!)]) @@ -1148,7 +1148,7 @@ Example: is the same as -@schemeblock[ +@racketblock[ (let ([s (new stack%)]) (send s push! 10) (send s push! 9) @@ -1161,49 +1161,49 @@ is the same as @defform[(get-field id obj-expr)]{ -Extracts the field with (external) name @scheme[id] from the value of -@scheme[obj-expr]. +Extracts the field with (external) name @racket[id] from the value of +@racket[obj-expr]. -If @scheme[obj-expr] does not produce an object, the -@exnraise[exn:fail:contract]. If the object has no @scheme[id] method, +If @racket[obj-expr] does not produce an object, the +@exnraise[exn:fail:contract]. If the object has no @racket[id] method, the @exnraise[exn:fail:object].} @defform[(set-field! id obj-expr expr)]{ -Sets the field with (external) name @scheme[id] from the value of -@scheme[obj-expr] to the value of @scheme[expr]. +Sets the field with (external) name @racket[id] from the value of +@racket[obj-expr] to the value of @racket[expr]. -If @scheme[obj-expr] does not produce an object, the -@exnraise[exn:fail:contract]. If the object has no @scheme[id] method, +If @racket[obj-expr] does not produce an object, the +@exnraise[exn:fail:contract]. If the object has no @racket[id] method, the @exnraise[exn:fail:object].} @defform[(field-bound? id obj-expr)]{ -Produces @scheme[#t] if the object result of @scheme[obj-expr] has a -field with (external) name @scheme[id], @scheme[#f] otherwise. +Produces @racket[#t] if the object result of @racket[obj-expr] has a +field with (external) name @racket[id], @racket[#f] otherwise. -If @scheme[obj-expr] does not produce an object, the +If @racket[obj-expr] does not produce an object, the @exnraise[exn:fail:contract].} @defform[(class-field-accessor class-expr field-id)]{ Returns an accessor procedure that takes an instance of the class -produced by @scheme[class-expr] and returns the value of the object's -field with (external) name @scheme[field-id]. +produced by @racket[class-expr] and returns the value of the object's +field with (external) name @racket[field-id]. -If @scheme[class-expr] does not produce a class, the -@exnraise[exn:fail:contract]. If the class has no @scheme[field-id] +If @racket[class-expr] does not produce a class, the +@exnraise[exn:fail:contract]. If the class has no @racket[field-id] field, the @exnraise[exn:fail:object].} @defform[(class-field-mutator class-expr field-id)]{ Returns a mutator procedure that takes an instance of the class -produced by @scheme[class-expr] and a value, and sets the value of the -object's field with (external) name @scheme[field-id] to the given +produced by @racket[class-expr] and a value, and sets the value of the +object's field with (external) name @racket[field-id] to the given value. The result is @|void-const|. -If @scheme[class-expr] does not produce a class, the -@exnraise[exn:fail:contract]. If the class has no @scheme[field-id] +If @racket[class-expr] does not produce a class, the +@exnraise[exn:fail:contract]. If the class has no @racket[field-id] field, the @exnraise[exn:fail:object].} @; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1216,36 +1216,36 @@ cost of relocating a method by name within a class. @defform[(generic class-or-interface-expr id)]{ Produces a generic that works on instances of the class or interface -produced by @scheme[class-or-interface-expr] (or an instance of a -class/interface derived from @scheme[class-or-interface]) to call the -method with (external) name @scheme[id]. +produced by @racket[class-or-interface-expr] (or an instance of a +class/interface derived from @racket[class-or-interface]) to call the +method with (external) name @racket[id]. -If @scheme[class-or-interface-expr] does not produce a class or +If @racket[class-or-interface-expr] does not produce a class or interface, the @exnraise[exn:fail:contract]. If the resulting class or -interface does not contain a method named @scheme[id], the +interface does not contain a method named @racket[id], the @exnraise[exn:fail:object].} @defform*[[(send-generic obj-expr generic-expr arg ...) (send-generic obj-expr generic-expr arg ... . arg-list-expr)]]{ -Calls a method of the object produced by @scheme[obj-expr] as -indicated by the generic produced by @scheme[generic-expr]. Each -@scheme[arg] is as for @scheme[#%app]: either @scheme[_arg-expr] or -@scheme[_keyword _arg-expr]. The second form is analogous to calling a -procedure with @scheme[apply], where @scheme[arg-list-expr] is not a +Calls a method of the object produced by @racket[obj-expr] as +indicated by the generic produced by @racket[generic-expr]. Each +@racket[arg] is as for @racket[#%app]: either @racket[_arg-expr] or +@racket[_keyword _arg-expr]. The second form is analogous to calling a +procedure with @racket[apply], where @racket[arg-list-expr] is not a parenthesized expression. -If @scheme[obj-expr] does not produce a object, or if -@scheme[generic-expr] does not produce a generic, the -@exnraise[exn:fail:contract]. If the result of @scheme[obj-expr] is +If @racket[obj-expr] does not produce a object, or if +@racket[generic-expr] does not produce a generic, the +@exnraise[exn:fail:contract]. If the result of @racket[obj-expr] is not an instance of the class or interface encapsulated by the result -of @scheme[generic-expr], the @exnraise[exn:fail:object].} +of @racket[generic-expr], the @exnraise[exn:fail:object].} @defproc[(make-generic [type (or/c class? interface?)] [method-name symbol?]) generic?]{ -Like the @scheme[generic] form, but as a procedure that accepts a +Like the @racket[generic] form, but as a procedure that accepts a symbolic method name.} @; ------------------------------------------------------------------------ @@ -1261,15 +1261,15 @@ mixin is applied to a specific superclass, it produces a new derived class using the encapsulated extension. The given class must implement interfaces produced by the first set of -@scheme[interface-expr]s. The result of the procedure is a subclass +@racket[interface-expr]s. The result of the procedure is a subclass of the given class that implements the interfaces produced by the -second set of @scheme[interface-expr]s. The @scheme[class-clause]s are -as for @scheme[class*], to define the class extension encapsulated by +second set of @racket[interface-expr]s. The @racket[class-clause]s are +as for @racket[class*], to define the class extension encapsulated by the mixin. -Evaluation of a @scheme[mixin] form checks that the -@scheme[class-clause]s are consistent with both sets of -@scheme[interface-expr]s.} +Evaluation of a @racket[mixin] form checks that the +@racket[class-clause]s are consistent with both sets of +@racket[interface-expr]s.} @; ------------------------------------------------------------------------ @@ -1303,36 +1303,36 @@ renamed, and multiple traits can be merged to form a new trait. (field field-declaration ...) (inherit-field maybe-renamed ...)])]{ -Creates a @tech{trait}. The body of a @scheme[trait] form is similar to the -body of a @scheme[class*] form, but restricted to non-private method +Creates a @tech{trait}. The body of a @racket[trait] form is similar to the +body of a @racket[class*] form, but restricted to non-private method definitions. In particular, the grammar of -@scheme[maybe-renamed], @scheme[method-definition], and -@scheme[field-declaration] are the same as for @scheme[class*], and -every @scheme[method-definition] must have a corresponding declaration -(one of @scheme[public], @scheme[override], etc.). As in -@scheme[class], uses of method names in direct calls, @scheme[super] -calls, and @scheme[inner] calls depend on bringing method names into -scope via @scheme[inherit], @scheme[inherit/super], -@scheme[inherit/inner], and other method declarations in the same -trait; an exception, compared to @scheme[class] is that -@scheme[overment] binds a method name only in the corresponding +@racket[maybe-renamed], @racket[method-definition], and +@racket[field-declaration] are the same as for @racket[class*], and +every @racket[method-definition] must have a corresponding declaration +(one of @racket[public], @racket[override], etc.). As in +@racket[class], uses of method names in direct calls, @racket[super] +calls, and @racket[inner] calls depend on bringing method names into +scope via @racket[inherit], @racket[inherit/super], +@racket[inherit/inner], and other method declarations in the same +trait; an exception, compared to @racket[class] is that +@racket[overment] binds a method name only in the corresponding method, and not in other methods of the same trait. Finally, macros -such as @scheme[public*] and @scheme[define/public] work in -@scheme[trait] as in @scheme[class]. +such as @racket[public*] and @racket[define/public] work in +@racket[trait] as in @racket[class]. -External identifiers in @scheme[trait], @scheme[trait-exclude], -@scheme[trait-exclude-field], @scheme[trait-alias], -@scheme[trait-rename], and @scheme[trait-rename-field] forms are -subject to binding via @scheme[define-member-name] and -@scheme[define-local-member-name]. Although @scheme[private] methods -or fields are not allowed in a @scheme[trait] form, they can be -simulated by using a @scheme[public] or @scheme[field] declaration and -a name whose scope is limited to the @scheme[trait] form.} +External identifiers in @racket[trait], @racket[trait-exclude], +@racket[trait-exclude-field], @racket[trait-alias], +@racket[trait-rename], and @racket[trait-rename-field] forms are +subject to binding via @racket[define-member-name] and +@racket[define-local-member-name]. Although @racket[private] methods +or fields are not allowed in a @racket[trait] form, they can be +simulated by using a @racket[public] or @racket[field] declaration and +a name whose scope is limited to the @racket[trait] form.} @defproc[(trait? [v any/c]) boolean?]{ -Returns @scheme[#t] if @scheme[v] is a trait, @scheme[#f] otherwise.} +Returns @racket[#t] if @racket[v] is a trait, @racket[#f] otherwise.} @defproc[(trait->mixin [tr trait?]) (class? . -> . class?)]{ @@ -1340,7 +1340,7 @@ Returns @scheme[#t] if @scheme[v] is a trait, @scheme[#f] otherwise.} Converts a @tech{trait} to a @tech{mixin}, which can be applied to a @tech{class} to produce a new @tech{class}. An expression of the form -@schemeblock[ +@racketblock[ (trait->mixin (trait _trait-clause ...)) @@ -1348,7 +1348,7 @@ Converts a @tech{trait} to a @tech{mixin}, which can be applied to a is equivalent to -@schemeblock[ +@racketblock[ (lambda (%) (class % _trait-clause ... @@ -1362,9 +1362,9 @@ other traits before converting to a mixin.} @defproc[(trait-sum [tr trait?] ...+) trait?]{ Produces a @tech{trait} that combines all of the methods of the given -@scheme[tr]s. For example, +@racket[tr]s. For example, -@schemeblock[ +@racketblock[ (define t1 (trait (define/public (m1) 1))) @@ -1374,101 +1374,101 @@ Produces a @tech{trait} that combines all of the methods of the given (define t3 (trait-sum t1 t2)) ] -creates a trait @scheme[t3] that is equivalent to +creates a trait @racket[t3] that is equivalent to -@schemeblock[ +@racketblock[ (trait (define/public (m1) 1) (define/public (m2) 2)) ] -but @scheme[t1] and @scheme[t2] can still be used individually or +but @racket[t1] and @racket[t2] can still be used individually or combined with other traits. -When traits are combined with @scheme[trait-sum], the combination -drops @scheme[inherit], @scheme[inherit/super], -@scheme[inherit/inner], and @scheme[inherit-field] declarations when a +When traits are combined with @racket[trait-sum], the combination +drops @racket[inherit], @racket[inherit/super], +@racket[inherit/inner], and @racket[inherit-field] declarations when a definition is supplied for the same method or field name by another -trait. The @scheme[trait-sum] operation fails (the +trait. The @racket[trait-sum] operation fails (the @exnraise[exn:fail:contract]) if any of the traits to combine define a -method or field with the same name, or if an @scheme[inherit/super] or -@scheme[inherit/inner] declaration to be dropped is inconsistent with +method or field with the same name, or if an @racket[inherit/super] or +@racket[inherit/inner] declaration to be dropped is inconsistent with the supplied definition. In other words, declaring a method with -@scheme[inherit], @scheme[inherit/super], or @scheme[inherit/inner], +@racket[inherit], @racket[inherit/super], or @racket[inherit/inner], does not count as defining the method; at the same time, for example, -a trait that contains an @scheme[inherit/super] declaration for a -method @scheme[m] cannot be combined with a trait that defines -@scheme[m] as @scheme[augment], since no class could satisfy the -requirements of both @scheme[augment] and @scheme[inherit/super] when +a trait that contains an @racket[inherit/super] declaration for a +method @racket[m] cannot be combined with a trait that defines +@racket[m] as @racket[augment], since no class could satisfy the +requirements of both @racket[augment] and @racket[inherit/super] when the trait is later converted to a mixin and applied to a class.} @defform[(trait-exclude trait-expr id)]{ Produces a new @tech{trait} that is like the @tech{trait} result of -@scheme[trait-expr], but with the definition of a method named by -@scheme[id] removed; as the method definition is removed, either an -@scheme[inherit], @scheme[inherit/super], or @scheme[inherit/inner] +@racket[trait-expr], but with the definition of a method named by +@racket[id] removed; as the method definition is removed, either an +@racket[inherit], @racket[inherit/super], or @racket[inherit/inner] declaration is added: @itemize[ - @item{A method declared with @scheme[public], @scheme[pubment], or - @scheme[public-final] is replaced with an @scheme[inherit] + @item{A method declared with @racket[public], @racket[pubment], or + @racket[public-final] is replaced with an @racket[inherit] declaration.} - @item{A method declared with @scheme[override] or @scheme[override-final] - is replaced with an @scheme[inherit/super] declaration.} + @item{A method declared with @racket[override] or @racket[override-final] + is replaced with an @racket[inherit/super] declaration.} - @item{A method declared with @scheme[augment], @scheme[augride], or - @scheme[augment-final] is replaced with an @scheme[inherit/inner] declaration.} + @item{A method declared with @racket[augment], @racket[augride], or + @racket[augment-final] is replaced with an @racket[inherit/inner] declaration.} - @item{A method declared with @scheme[overment] is not replaced - with any @scheme[inherit] declaration.} + @item{A method declared with @racket[overment] is not replaced + with any @racket[inherit] declaration.} ] -If the trait produced by @scheme[trait-expr] has no method definition for -@scheme[id], the @exnraise[exn:fail:contract].} +If the trait produced by @racket[trait-expr] has no method definition for +@racket[id], the @exnraise[exn:fail:contract].} @defform[(trait-exclude-field trait-expr id)]{ Produces a new @tech{trait} that is like the @tech{trait} result of -@scheme[trait-expr], but with the definition of a field named by -@scheme[id] removed; as the field definition is removed, an -@scheme[inherit-field] declaration is added.} +@racket[trait-expr], but with the definition of a field named by +@racket[id] removed; as the field definition is removed, an +@racket[inherit-field] declaration is added.} @defform[(trait-alias trait-expr id new-id)]{ Produces a new @tech{trait} that is like the @tech{trait} result of -@scheme[trait-expr], but the definition and declaration of the method -named by @scheme[id] is duplicated with the name @scheme[new-id]. The +@racket[trait-expr], but the definition and declaration of the method +named by @racket[id] is duplicated with the name @racket[new-id]. The consistency requirements for the resulting trait are the same as for -@scheme[trait-sum], otherwise the @exnraise[exn:fail:contract]. This -operation does not rename any other use of @scheme[id], such as in -method calls (even method calls to @scheme[identifier] in the cloned -definition for @scheme[new-id]).} +@racket[trait-sum], otherwise the @exnraise[exn:fail:contract]. This +operation does not rename any other use of @racket[id], such as in +method calls (even method calls to @racket[identifier] in the cloned +definition for @racket[new-id]).} @defform[(trait-rename trait-expr id new-id)]{ Produces a new @tech{trait} that is like the @tech{trait} result of -@scheme[trait-expr], but all definitions and references to methods -named @scheme[id] are replaced by definitions and references to -methods named by @scheme[new-id]. The consistency requirements for the -resulting trait are the same as for @scheme[trait-sum], otherwise the +@racket[trait-expr], but all definitions and references to methods +named @racket[id] are replaced by definitions and references to +methods named by @racket[new-id]. The consistency requirements for the +resulting trait are the same as for @racket[trait-sum], otherwise the @exnraise[exn:fail:contract].} @defform[(trait-rename-field trait-expr id new-id)]{ Produces a new @tech{trait} that is like the @tech{trait} result of -@scheme[trait-expr], but all definitions and references to fields -named @scheme[id] are replaced by definitions and references to fields -named by @scheme[new-id]. The consistency requirements for the -resulting trait are the same as for @scheme[trait-sum], otherwise the +@racket[trait-expr], but all definitions and references to fields +named @racket[id] are replaced by definitions and references to fields +named by @racket[new-id]. The consistency requirements for the +resulting trait are the same as for @racket[trait-sum], otherwise the @exnraise[exn:fail:contract].} @; ------------------------------------------------------------------------ @@ -1505,7 +1505,7 @@ resulting trait are the same as for @scheme[trait-sum], otherwise the (field field-id ...)])]{ Produces a contract for a class. -There are two major categories of contracts listed in a @scheme[class/c] +There are two major categories of contracts listed in a @racket[class/c] form: external and internal contracts. External contracts govern behavior when an object is instantiated from a class or when methods or fields are accessed via an object of that class. Internal contracts govern behavior @@ -1514,101 +1514,116 @@ separation allows for stronger contracts for class clients and weaker contracts for subclasses. Method contracts must contain an additional initial argument which corresponds -to the implicit @scheme[this] parameter of the method. This allows for +to the implicit @racket[this] parameter of the method. This allows for contracts which discuss the state of the object when the method is called (or, for dependent contracts, in other parts of the contract). Alternative -contract forms, such as @scheme[->m], are provided as a shorthand +contract forms, such as @racket[->m], are provided as a shorthand for writing method contracts. -Methods and fields listed in an @scheme[absent] clause must @emph{not} be present in the class. +Methods and fields listed in an @racket[absent] clause must @emph{not} be present in the class. The external contracts are as follows: @itemize[ @item{A method contract without a tag describes the behavior - of the implementation of @scheme[method-id] on method sends to an object of the - contracted class. This contract will continue to be checked in subclasses until - the contracted class's implementation is no longer the entry point for dynamic - dispatch.} - @item{A field contract, tagged with @scheme[field], describes the behavior of the - value contained in that field when accessed via an object of that class. Since - fields may be mutated, these contracts are checked on any external access and/or - mutation of the field.} - @item{An initialization argument contract, tagged with @scheme[init], describes the - expected behavior of the value paired with that name during class instantiation. - The same name can be provided more than once, in which case the first such contract - in the @scheme[class/c] form is applied to the first value tagged with that name in - the list of initialization arguments, and so on.} - @item{The contracts listed in an @scheme[init-field] section are treated as if each - contract appeared in an @scheme[init] section and a @scheme[field] section.} + of the implementation of @racket[method-id] on method sends to an + object of the contracted class. This contract will continue to be + checked in subclasses until the contracted class's implementation is + no longer the entry point for dynamic dispatch.} + @item{A field contract, tagged with @racket[field], describes the + behavior of the value contained in that field when accessed via an + object of that class. Since fields may be mutated, these contracts + are checked on any external access and/or mutation of the field.} + @item{An initialization argument contract, tagged with @racket[init], + describes the expected behavior of the value paired with that name + during class instantiation. The same name can be provided more than + once, in which case the first such contract in the @racket[class/c] + form is applied to the first value tagged with that name in the list + of initialization arguments, and so on.} + @item{The contracts listed in an @racket[init-field] section are + treated as if each contract appeared in an @racket[init] section and + a @racket[field] section.} ] The internal contracts are as follows: @itemize[ - @item{A method contract, tagged with @scheme[inherit], describes the behavior of the - method when invoked directly (i.e., via @scheme[inherit]) in any subclass of the - contracted class. This contract, like external method contracts, applies until - the contracted class's method implementation is no longer the entry point for dynamic - dispatch.} - @item{A field contract, tagged with @scheme[inherit-field], describes the behavior of the - value contained in that field when accessed directly (i.e., via @scheme[inherit-field]) - in any subclass of the contracted class. Since fields may be mutated, these contracts are - checked on any access and/or mutation of the field that occurs in such subclasses.} - @item{A method contract, tagged with @scheme[super], describes the behavior of - @scheme[method-id] when called by the @scheme[super] form in a subclass. This contract - only affects @scheme[super] calls in subclasses which call the contract class's - implementation of @scheme[method-id].} - @item{A method contract, tagged with @scheme[inner], describes the behavior the class - expects of an augmenting method in a subclass. This contract affects any implementations - of @scheme[method-id] in subclasses which can be called via @scheme[inner] from the - contracted class. This means a subclass which implements @scheme[method-id] via - @scheme[augment] or @scheme[overment] stop future subclasses from being affected by - the contract, since further extension cannot be reached via the contracted class.} - @item{A method contract, tagged with @scheme[override], describes the behavior expected by - the contracted class for @scheme[method-id] when called directly (i.e. by the application - @scheme[(method-id ...)]). This form can only be used if overriding the method in subclasses - will change the entry point to the dynamic dispatch chain (i.e., the method has never been - augmentable).} - @item{A method contract, tagged with either @scheme[augment] or @scheme[augride], describes the - behavior provided by the contracted class for @scheme[method-id] when called directly from - subclasses. These forms can only be used if the method has previously been augmentable, which - means that no augmenting or overriding implementation will change the entry point to the - dynamic dispatch chain. @scheme[augment] is used when subclasses can augment the method, and - @scheme[augride] is used when subclasses can override the current augmentation.} + @item{A method contract, tagged with @racket[inherit], describes the + behavior of the method when invoked directly (i.e., via + @racket[inherit]) in any subclass of the contracted class. This + contract, like external method contracts, applies until the + contracted class's method implementation is no longer the entry point + for dynamic dispatch.} + @item{A field contract, tagged with @racket[inherit-field], describes + the behavior of the value contained in that field when accessed + directly (i.e., via @racket[inherit-field]) in any subclass of the + contracted class. Since fields may be mutated, these contracts are + checked on any access and/or mutation of the field that occurs in + such subclasses.} + @item{A method contract, tagged with @racket[super], describes the behavior of + @racket[method-id] when called by the @racket[super] form in a + subclass. This contract only affects @racket[super] calls in + subclasses which call the contract class's implementation of + @racket[method-id].} + @item{A method contract, tagged with @racket[inner], describes the + behavior the class expects of an augmenting method in a subclass. + This contract affects any implementations of @racket[method-id] in + subclasses which can be called via @racket[inner] from the contracted + class. This means a subclass which implements @racket[method-id] via + @racket[augment] or @racket[overment] stop future subclasses from + being affected by the contract, since further extension cannot be + reached via the contracted class.} + @item{A method contract, tagged with @racket[override], describes the + behavior expected by the contracted class for @racket[method-id] when + called directly (i.e. by the application @racket[(method-id ...)]). + This form can only be used if overriding the method in subclasses + will change the entry point to the dynamic dispatch chain (i.e., the + method has never been augmentable).} + @item{A method contract, tagged with either @racket[augment] or + @racket[augride], describes the behavior provided by the contracted + class for @racket[method-id] when called directly from subclasses. + These forms can only be used if the method has previously been + augmentable, which means that no augmenting or overriding + implementation will change the entry point to the dynamic dispatch + chain. @racket[augment] is used when subclasses can augment the + method, and @racket[augride] is used when subclasses can override the + current augmentation.} ]} @defform[(absent method-id ...)]{ -See @scheme[class/c]; use outside of a @scheme[class/c] form is a syntax error. +See @racket[class/c]; use outside of a @racket[class/c] form is a syntax error. } @defform[(->m dom ... range)]{ -Similar to @scheme[->], except that the domain of the resulting contract contains one more element -than the stated domain, where the first (implicit) argument is contracted with @scheme[any/c]. -This contract is useful for writing simpler method contracts when no properties of @scheme[this] -need to be checked.} - +Similar to @racket[->], except that the domain of the resulting contract +contains one more element than the stated domain, where the first +(implicit) argument is contracted with @racket[any/c]. This contract is +useful for writing simpler method contracts when no properties of +@racket[this] need to be checked.} + @defform[(->*m (mandatory-dom ...) (optional-dom ...) rest range)]{ -Similar to @scheme[->*], except that the mandatory domain of the resulting contract contains one -more element than the stated domain, where the first (implicit) argument is contracted with -@scheme[any/c]. This contract is useful for writing simpler method contracts when no properties -of @scheme[this] need to be checked.} +Similar to @racket[->*], except that the mandatory domain of the +resulting contract contains one more element than the stated domain, +where the first (implicit) argument is contracted with +@racket[any/c]. This contract is useful for writing simpler method +contracts when no properties of @racket[this] need to be checked.} @defform[(case->m (-> dom ... rest range) ...)]{ -Similar to @scheme[case->], except that the mandatory domain of each case of the resulting contract -contains one more element than the stated domain, where the first (implicit) argument is contracted -with @scheme[any/c]. This contract is useful for writing simpler method contracts when no properties -of @scheme[this] need to be checked.} +Similar to @racket[case->], except that the mandatory domain of each +case of the resulting contract contains one more element than the stated +domain, where the first (implicit) argument is contracted with +@racket[any/c]. This contract is useful for writing simpler method +contracts when no properties of @racket[this] need to be checked.} @defform[(->dm (mandatory-dependent-dom ...) (optional-dependent-dom ...) dependent-rest pre-cond dep-range)]{ -Similar to @scheme[->d], except that the mandatory domain of the resulting contract +Similar to @racket[->d], except that the mandatory domain of the resulting contract contains one more element than the stated domain, where the first (implicit) argument is contracted -with @scheme[any/c]. In addition, @scheme[this] is appropriately bound in the body of the contract. +with @racket[any/c]. In addition, @racket[this] is appropriately bound in the body of the contract. This contract is useful for writing simpler method contracts when no properties -of @scheme[this] need to be checked.} +of @racket[this] need to be checked.} @defform/subs[ #:literals (field) @@ -1627,17 +1642,17 @@ of @scheme[this] need to be checked.} (field-id contract-expr)])]{ Produces a contract for an object. -Unlike the older form @scheme[object-contract], but like -@scheme[class/c], arbitrary contract expressions are allowed. -Also, method contracts for @scheme[object/c] follow those for -@scheme[class/c]. An object wrapped with @scheme[object/c] +Unlike the older form @racket[object-contract], but like +@racket[class/c], arbitrary contract expressions are allowed. +Also, method contracts for @racket[object/c] follow those for +@racket[class/c]. An object wrapped with @racket[object/c] behaves as if its class had been wrapped with the equivalent -@scheme[class/c] contract. +@racket[class/c] contract. } @defproc[(instanceof/c [class-contract contract?]) contract?]{ Produces a contract for an object, where the object is an -instance of a class that conforms to @scheme[class-contract]. +instance of a class that conforms to @racket[class-contract]. } @defform/subs[ @@ -1684,10 +1699,10 @@ method contract must be written directly in the body of the object-contract---much like the way that methods in class definitions use the same syntax as regular function definitions, but cannot be arbitrary procedures. Unlike the -method contracts for @scheme[class/c], the implicit @scheme[this] +method contracts for @racket[class/c], the implicit @racket[this] argument is not part of the contract. To allow for the use of -@scheme[this] in dependent contracts, @scheme[->d] contracts -implicitly bind @scheme[this] to the object itself.} +@racket[this] in dependent contracts, @racket[->d] contracts +implicitly bind @racket[this] to the object itself.} @defthing[mixin-contract contract?]{ @@ -1699,7 +1714,7 @@ a subclass of the input.} @defproc[(make-mixin-contract [type (or/c class? interface?)] ...) contract?]{ Produces a @tech{function contract} that guarantees the input to the -function is a class that implements/subclasses each @scheme[type], and +function is a class that implements/subclasses each @racket[type], and that the result of the function is a subclass of the input.} @defproc[(is-a?/c [type (or/c class? interface?)]) flat-contract?]{ @@ -1711,13 +1726,13 @@ recognizes objects that instantiate the class/interface.} @defproc[(implementation?/c [interface interface?]) flat-contract?]{ Returns a flat contract that recognizes classes that implement -@scheme[interface].} +@racket[interface].} @defproc[(subclass?/c [class class?]) flat-contract?]{ Returns a flat contract that recognizes classes that -are subclasses of @scheme[class].} +are subclasses of @racket[class].} @; ------------------------------------------------------------------------ @@ -1725,54 +1740,54 @@ are subclasses of @scheme[class].} @section[#:tag "objectequality"]{Object Equality and Hashing} By default, objects that are instances of different classes or that -are instances of a non-transparent class are @scheme[equal?] only if -they are @scheme[eq?]. Like transparent structures, two objects that +are instances of a non-transparent class are @racket[equal?] only if +they are @racket[eq?]. Like transparent structures, two objects that are instances of the same transparent class (i.e., every superclass of -the class has @scheme[#f] as its inspector) are @scheme[equal?] when -their field values are @scheme[equal?]. +the class has @racket[#f] as its inspector) are @racket[equal?] when +their field values are @racket[equal?]. To customize the way that a class instance is compared to other -instances by @scheme[equal?], implement the @scheme[equal<%>] +instances by @racket[equal?], implement the @racket[equal<%>] interface. @definterface[equal<%> ()]{ -The @scheme[equal<%>] interface includes three methods, which are +The @racket[equal<%>] interface includes three methods, which are analogous to the functions provided for a structure type with -@scheme[prop:equal+hash]: +@racket[prop:equal+hash]: @itemize[ - @item{@scheme[equal-to?] --- Takes two arguments. The first argument + @item{@racket[equal-to?] --- Takes two arguments. The first argument is an object that is an instance of the same class (or a subclass - that does not re-declare its implementation of @scheme[equal<%>]) + that does not re-declare its implementation of @racket[equal<%>]) and that is being compared to the target object. The second argument - is an @scheme[equal?]-like procedure of two arguments that should be + is an @racket[equal?]-like procedure of two arguments that should be used for recursive equality testing. The result should be a true value if the object and the first argument of the method are equal, - @scheme[#f] otherwise.} + @racket[#f] otherwise.} - @item{@scheme[equal-hash-code-of] --- Takes one argument, which is a + @item{@racket[equal-hash-code-of] --- Takes one argument, which is a procedure of one argument that should be used for recursive hash-code computation. The result should be an exact integer representing the target object's hash code.} - @item{@scheme[equal-secondary-hash-code-of] --- Takes one argument, + @item{@racket[equal-secondary-hash-code-of] --- Takes one argument, which is a procedure of one argument that should be used for recursive hash-code computation. The result should be an exact integer representing the target object's secondary hash code.} ] -The @scheme[equal<%>] interface is unusual in that declaring the +The @racket[equal<%>] interface is unusual in that declaring the implementation of the interface is different from inheriting the interface. Two objects can be equal only if they are instances of classes whose most specific ancestor to explicitly implement -@scheme[equal<%>] is the same ancestor. +@racket[equal<%>] is the same ancestor. -See @scheme[prop:equal+hash] for more information on equality -comparisons and hash codes. The @scheme[equal<%>] interface is -implemented with @scheme[interface*] and @scheme[prop:equal+hash].} +See @racket[prop:equal+hash] for more information on equality +comparisons and hash codes. The @racket[equal<%>] interface is +implemented with @racket[interface*] and @racket[prop:equal+hash].} @; ------------------------------------------------------------------------ @@ -1784,13 +1799,13 @@ implemented with @scheme[interface*] and @scheme[prop:equal+hash].} class-clause ...) ]{ -Binds @scheme[class-id] to a class, where @scheme[superclass-expr], -the @scheme[interface-expr]s, and the @scheme[class-clause]s are as in -@scheme[class*]. +Binds @racket[class-id] to a class, where @racket[superclass-expr], +the @racket[interface-expr]s, and the @racket[class-clause]s are as in +@racket[class*]. This form can only be used at the top level, either within a module -or outside. The @scheme[class-id] identifier is bound to the new -class, and @schemeidfont{deserialize-info:}@scheme[class-id] is also +or outside. The @racket[class-id] identifier is bound to the new +class, and @racketidfont{deserialize-info:}@racket[class-id] is also defined; if the definition is within a module, then the latter is provided from the module. @@ -1799,13 +1814,13 @@ Serialization for the class works in one of two ways: @itemize[ @item{If the class implements the built-in interface - @scheme[externalizable<%>], then an object is serialized by - calling its @scheme[externalize] method; the result can be + @racket[externalizable<%>], then an object is serialized by + calling its @racket[externalize] method; the result can be anything that is serializable (but, obviously, should not be the object itself). Deserialization creates an instance of the class with no initialization arguments, and then calls the - object's @scheme[internalize] method with the result of - @scheme[externalize] (or, more precisely, a deserialized + object's @racket[internalize] method with the result of + @racket[externalize] (or, more precisely, a deserialized version of the serialized result of a previous call). To support this form of serialization, the class must be @@ -1813,9 +1828,9 @@ Serialization for the class works in one of two ways: cycles involving only instances of the class (and other such classes) cannot be serialized.} - @item{If the class does not implement @scheme[externalizable<%>], + @item{If the class does not implement @racket[externalizable<%>], then every superclass of the class must be either serializable - or transparent (i.e,. have @scheme[#f] as its + or transparent (i.e,. have @racket[#f] as its inspector). Serialization and deserialization are fully automatic, and may involve cycles of instances. @@ -1828,17 +1843,17 @@ Serialization for the class works in one of two ways: ] In the second case, a serializable subclass can implement -@scheme[externalizable<%>], in which case the @scheme[externalize] +@racket[externalizable<%>], in which case the @racket[externalize] method is responsible for all serialization (i.e., automatic serialization is lost for instances of the subclass). In the first case, all serializable subclasses implement -@scheme[externalizable<%>], since a subclass implements all of the +@racket[externalizable<%>], since a subclass implements all of the interfaces of its parent class. In either case, if an object is an immediate instance of a subclass (that is not itself serializable), the object is serialized as if it was an immediate instance of the serializable class. In particular, -overriding declarations of the @scheme[externalize] method are ignored +overriding declarations of the @racket[externalize] method are ignored for instances of non-serializable subclasses.} @@ -1847,50 +1862,50 @@ for instances of non-serializable subclasses.} class-clause ...) ]{ -Like @scheme[define-serializable-class*], but without interface -expressions (analogous to @scheme[class]).} +Like @racket[define-serializable-class*], but without interface +expressions (analogous to @racket[class]).} @definterface[externalizable<%> ()]{ -The @scheme[externalizable<%>] interface includes only the -@scheme[externalize] and @scheme[internalize] methods. See -@scheme[define-serializable-class*] for more information.} +The @racket[externalizable<%>] interface includes only the +@racket[externalize] and @racket[internalize] methods. See +@racket[define-serializable-class*] for more information.} @; ------------------------------------------------------------------------ @section[#:tag "objectprinting"]{Object Printing} To customize the way that a class instance is printed by -@racket[print], @scheme[write] and @scheme[display], implement the -@scheme[printable<%>] interface. +@racket[print], @racket[write] and @racket[display], implement the +@racket[printable<%>] interface. @defthing[printable<%> interface?]{ -The @scheme[printable<%>] interface includes only the -@scheme[custom-print], @scheme[custom-write], and -@scheme[custom-display] methods. The @scheme[custom-print] method +The @racket[printable<%>] interface includes only the +@racket[custom-print], @racket[custom-write], and +@racket[custom-display] methods. The @racket[custom-print] method accepts two arguments: the destination port and the current -@scheme[quasiquote] depth as an exact nonnegative integer. The -@scheme[custom-write] and @scheme[custom-display] methods each accepts -a single argument, which is the destination port to @scheme[write] or -@scheme[display] the object. +@racket[quasiquote] depth as an exact nonnegative integer. The +@racket[custom-write] and @racket[custom-display] methods each accepts +a single argument, which is the destination port to @racket[write] or +@racket[display] the object. -Calls to the @racket[custom-print], @scheme[custom-write], or -@scheme[custom-display] methods are like calls to a procedure attached -to a structure type through the @scheme[prop:custom-write] +Calls to the @racket[custom-print], @racket[custom-write], or +@racket[custom-display] methods are like calls to a procedure attached +to a structure type through the @racket[prop:custom-write] property. In particular, recursive printing can trigger an escape from the call. -See @scheme[prop:custom-write] for more information. The -@scheme[printable<%>] interface is implemented with -@scheme[interface*] and @scheme[prop:custom-write].} +See @racket[prop:custom-write] for more information. The +@racket[printable<%>] interface is implemented with +@racket[interface*] and @racket[prop:custom-write].} @defthing[writable<%> interface?]{ -Like @scheme[printable<%>], but includes only the -@scheme[custom-write] and @scheme[custom-display] methods. -A @racket[print] request is directed to @scheme[custom-write].} +Like @racket[printable<%>], but includes only the +@racket[custom-write] and @racket[custom-display] methods. +A @racket[print] request is directed to @racket[custom-write].} @; ------------------------------------------------------------------------ @@ -1898,114 +1913,114 @@ A @racket[print] request is directed to @scheme[custom-write].} @defproc[(object? [v any/c]) boolean?]{ -Returns @scheme[#t] if @scheme[v] is an object, @scheme[#f] otherwise.} +Returns @racket[#t] if @racket[v] is an object, @racket[#f] otherwise.} @defproc[(class? [v any/c]) boolean?]{ -Returns @scheme[#t] if @scheme[v] is a class, @scheme[#f] otherwise.} +Returns @racket[#t] if @racket[v] is a class, @racket[#f] otherwise.} @defproc[(interface? [v any/c]) boolean?]{ -Returns @scheme[#t] if @scheme[v] is an interface, @scheme[#f] otherwise.} +Returns @racket[#t] if @racket[v] is an interface, @racket[#f] otherwise.} @defproc[(generic? [v any/c]) boolean?]{ -Returns @scheme[#t] if @scheme[v] is a @tech{generic}, @scheme[#f] otherwise.} +Returns @racket[#t] if @racket[v] is a @tech{generic}, @racket[#f] otherwise.} @defproc[(object=? [a object?] [b object?]) boolean?]{ Determines if two objects are the same object, or not; this procedure uses -@scheme[eq?], but also works properly with contracts.} +@racket[eq?], but also works properly with contracts.} @defproc[(object->vector [object object?] [opaque-v any/c #f]) vector?]{ -Returns a vector representing @scheme[object] that shows its -inspectable fields, analogous to @scheme[struct->vector].} +Returns a vector representing @racket[object] that shows its +inspectable fields, analogous to @racket[struct->vector].} @defproc[(class->interface [class class?]) interface?]{ -Returns the interface implicitly defined by @scheme[class].} +Returns the interface implicitly defined by @racket[class].} @defproc[(object-interface [object object?]) interface?]{ Returns the interface implicitly defined by the class of -@scheme[object].} +@racket[object].} @defproc[(is-a? [v any/c] [type (or/c interface? class?)]) boolean?]{ -Returns @scheme[#t] if @scheme[v] is an instance of a class -@scheme[type] or a class that implements an interface @scheme[type], -@scheme[#f] otherwise.} +Returns @racket[#t] if @racket[v] is an instance of a class +@racket[type] or a class that implements an interface @racket[type], +@racket[#f] otherwise.} @defproc[(subclass? [v any/c] [class class?]) boolean?]{ -Returns @scheme[#t] if @scheme[v] is a class derived from (or equal -to) @scheme[class], @scheme[#f] otherwise.} +Returns @racket[#t] if @racket[v] is a class derived from (or equal +to) @racket[class], @racket[#f] otherwise.} @defproc[(implementation? [v any/c] [interface interface?]) boolean?]{ -Returns @scheme[#t] if @scheme[v] is a class that implements -@scheme[interface], @scheme[#f] otherwise.} +Returns @racket[#t] if @racket[v] is a class that implements +@racket[interface], @racket[#f] otherwise.} @defproc[(interface-extension? [v any/c] [interface interface?]) boolean?]{ -Returns @scheme[#t] if @scheme[v] is an interface that extends -@scheme[interface], @scheme[#f] otherwise.} +Returns @racket[#t] if @racket[v] is an interface that extends +@racket[interface], @racket[#f] otherwise.} @defproc[(method-in-interface? [sym symbol?] [interface interface?]) boolean?]{ -Returns @scheme[#t] if @scheme[interface] (or any of its ancestor -interfaces) includes a member with the name @scheme[sym], @scheme[#f] +Returns @racket[#t] if @racket[interface] (or any of its ancestor +interfaces) includes a member with the name @racket[sym], @racket[#f] otherwise.} @defproc[(interface->method-names [interface interface?]) (listof symbol?)]{ -Returns a list of symbols for the method names in @scheme[interface], +Returns a list of symbols for the method names in @racket[interface], including methods inherited from superinterfaces, but not including methods whose names are local (i.e., declared with -@scheme[define-local-member-names]).} +@racket[define-local-member-names]).} @defproc[(object-method-arity-includes? [object object?] [sym symbol?] [cnt exact-nonnegative-integer?]) boolean?]{ -Returns @scheme[#t] if @scheme[object] has a method named @scheme[sym] -that accepts @scheme[cnt] arguments, @scheme[#f] otherwise.} +Returns @racket[#t] if @racket[object] has a method named @racket[sym] +that accepts @racket[cnt] arguments, @racket[#f] otherwise.} @defproc[(field-names [object object?]) (listof symbol?)]{ Returns a list of all of the names of the fields bound in -@scheme[object], including fields inherited from superinterfaces, but +@racket[object], including fields inherited from superinterfaces, but not including fields whose names are local (i.e., declared with -@scheme[define-local-member-names]).} +@racket[define-local-member-names]).} @defproc[(object-info [object any/c]) (values (or/c class? #f) boolean?)]{ Returns two values, analogous to the return -values of @scheme[struct-info]: +values of @racket[struct-info]: @itemize[ - @item{@scheme[_class]: a class or @scheme[#f]; the result is - @scheme[#f] if the current inspector does not control any class for - which the @scheme[object] is an instance.} + @item{@racket[_class]: a class or @racket[#f]; the result is + @racket[#f] if the current inspector does not control any class for + which the @racket[object] is an instance.} - @item{@scheme[_skipped?]: @scheme[#f] if the first result corresponds - to the most specific class of @scheme[object], @scheme[#t] + @item{@racket[_skipped?]: @racket[#f] if the first result corresponds + to the most specific class of @racket[object], @racket[#t] otherwise.} ]} @@ -2021,42 +2036,42 @@ values of @scheme[struct-info]: boolean?)]{ Returns seven values, analogous to the return -values of @scheme[struct-type-info]: +values of @racket[struct-type-info]: @itemize[ - @item{@scheme[_name]: the class's name as a symbol;} + @item{@racket[_name]: the class's name as a symbol;} - @item{@scheme[_field-cnt]: the number of fields (public and private) + @item{@racket[_field-cnt]: the number of fields (public and private) defined by the class;} - @item{@scheme[_field-name-list]: a list of symbols corresponding to the - class's public fields; this list can be larger than @scheme[_field-cnt] + @item{@racket[_field-name-list]: a list of symbols corresponding to the + class's public fields; this list can be larger than @racket[_field-cnt] because it includes inherited fields;} - @item{@scheme[_field-accessor]: an accessor procedure for obtaining + @item{@racket[_field-accessor]: an accessor procedure for obtaining field values in instances of the class; the accessor takes an - instance and a field index between @scheme[0] (inclusive) - and @scheme[_field-cnt] (exclusive);} + instance and a field index between @racket[0] (inclusive) + and @racket[_field-cnt] (exclusive);} - @item{@scheme[_field-mutator]: a mutator procedure for modifying + @item{@racket[_field-mutator]: a mutator procedure for modifying field values in instances of the class; the mutator takes an - instance, a field index between @scheme[0] (inclusive) - and @scheme[_field-cnt] (exclusive), and a new field value;} + instance, a field index between @racket[0] (inclusive) + and @racket[_field-cnt] (exclusive), and a new field value;} - @item{@scheme[_super-class]: a class for the most specific ancestor of + @item{@racket[_super-class]: a class for the most specific ancestor of the given class that is controlled by the current inspector, - or @scheme[#f] if no ancestor is controlled by the current + or @racket[#f] if no ancestor is controlled by the current inspector;} - @item{@scheme[_skipped?]: @scheme[#f] if the sixth result is the most - specific ancestor class, @scheme[#t] otherwise.} + @item{@racket[_skipped?]: @racket[#f] if the sixth result is the most + specific ancestor class, @racket[#t] otherwise.} ]} @defstruct[(exn:fail:object exn:fail) ()]{ -Raised for @scheme[class]-related failures, such as attempting to call +Raised for @racket[class]-related failures, such as attempting to call a method that is not supplied by an object. } diff --git a/collects/scribblings/reference/cmdline.scrbl b/collects/scribblings/reference/cmdline.scrbl index 7f54e8dd95..2723188508 100644 --- a/collects/scribblings/reference/cmdline.scrbl +++ b/collects/scribblings/reference/cmdline.scrbl @@ -39,17 +39,17 @@ unknown-expr)])]{ Parses a command line according to the specification in the -@scheme[flag-clause]s. +@racket[flag-clause]s. -The @scheme[name-expr], if provided, should produce a path or string +The @racket[name-expr], if provided, should produce a path or string to be used as the program name for reporting errors when the -command-line is ill-formed. It defaults to @scheme[(find-system-path +command-line is ill-formed. It defaults to @racket[(find-system-path 'run-file)]. When a path is provided, only the last element of the path is used to report an error. -The @scheme[argv-expr], if provided, must evaluate to a list or a +The @racket[argv-expr], if provided, must evaluate to a list or a vector of strings. It defaults to -@scheme[(current-command-line-arguments)]. +@racket[(current-command-line-arguments)]. The command-line is disassembled into flags, each possibly with flag-specific arguments, followed by (non-flag) @@ -63,32 +63,32 @@ argument is parsed as a flag. The built-in @Flag{-} flag signals the end of command-line flags; any command-line string past the @Flag{-} flag is parsed as a non-flag argument. -A @scheme[#:multi], @scheme[#:once-each], @scheme[#:once-any], or -@scheme[#:final] clause introduces a set of command-line flag +A @racket[#:multi], @racket[#:once-each], @racket[#:once-any], or +@racket[#:final] clause introduces a set of command-line flag specifications. The clause tag indicates how many times the flag can appear on the command line: @itemize[ - @item{@scheme[#:multi] --- Each flag specified in the set can be + @item{@racket[#:multi] --- Each flag specified in the set can be represented any number of times on the command line; i.e., the flags in the set are independent and each flag can be used multiple times.} - @item{@scheme[#:once-each] --- Each flag specified in the set can be + @item{@racket[#:once-each] --- Each flag specified in the set can be represented once on the command line; i.e., the flags in the set are independent, but each flag should be specified at most once. If a flag specification is represented in the command line more than once, the @exnraise[exn:fail].} - @item{@scheme[#:once-any] --- Only one flag specified in the set can + @item{@racket[#:once-any] --- Only one flag specified in the set can be represented on the command line; i.e., the flags in the set are mutually exclusive. If the set is represented in the command line more than once, the @exnraise[exn:fail].} - @item{@scheme[#:final] --- Like @scheme[#:multi], except that no + @item{@racket[#:final] --- Like @racket[#:multi], except that no argument after the flag is treated as a flag. Note that multiple - @scheme[#:final] flags can be specified if they have short names; for - example, if @Flag{a} is a @scheme[#:final] flag, then @Flag{aa} combines + @racket[#:final] flags can be specified if they have short names; for + example, if @Flag{a} is a @racket[#:final] flag, then @Flag{aa} combines two instances of @Flag{a} in a single command-line argument.} ] @@ -97,50 +97,50 @@ A normal flag specification has four parts: @itemize[ - @item{@scheme[flags] --- a flag string, or a set of flag strings. If + @item{@racket[flags] --- a flag string, or a set of flag strings. If a set of flags is provided, all of the flags are equivalent. Each flag string must be of the form - @schemevalfont{"-}@schemevarfont{x}@schemevalfont{"} or - @schemevalfont{"+}@schemevarfont{x}@schemevalfont{"} for some - character @schemevarfont{x}, or - @schemevalfont{"--}@schemevarfont{x}@schemevalfont{"} or - @schemevalfont{"++}@schemevarfont{x}@schemevalfont{"} for some - sequence of characters @schemevarfont{x}. An @schemevarfont{x} cannot + @racketvalfont{"-}@racketvarfont{x}@racketvalfont{"} or + @racketvalfont{"+}@racketvarfont{x}@racketvalfont{"} for some + character @racketvarfont{x}, or + @racketvalfont{"--}@racketvarfont{x}@racketvalfont{"} or + @racketvalfont{"++}@racketvarfont{x}@racketvalfont{"} for some + sequence of characters @racketvarfont{x}. An @racketvarfont{x} cannot contain only digits or digits plus a single decimal point, since simple (signed) numbers are not treated as flags. In addition, the - flags @scheme["--"], @scheme["-h"], and @scheme["--help"] are + flags @racket["--"], @racket["-h"], and @racket["--help"] are predefined and cannot be changed.} - @item{@scheme[id]s --- identifier that are bound to the flag's + @item{@racket[id]s --- identifier that are bound to the flag's arguments. The number of identifiers determines how many arguments can be provided on the command line with the flag, and the names of these identifiers will appear in the help message describing the - flag. The @scheme[id]s are bound to string values in the - @scheme[body]s for handling the flag.} + flag. The @racket[id]s are bound to string values in the + @racket[body]s for handling the flag.} - @item{@scheme[help-spec] --- a string or sequence of strings that + @item{@racket[help-spec] --- a string or sequence of strings that describes the flag. This string is used in the help message generated by the handler for the built-in @Flag{h} (or @DFlag{help}) flag. A single literal string can be provided, or any number of expressions that produce strings; in the latter case, strings after the first one are displayed on subsequent lines.} - @item{@scheme[body]s --- expressions that are evaluated when one of - the @scheme[flags] appears on the command line. The flags are parsed - left-to-right, and each sequence of @scheme[body]s is evaluated as - the corresponding flag is encountered. When the @scheme[body]s are - evaluated, the preceding @scheme[id]s are bound to the arguments + @item{@racket[body]s --- expressions that are evaluated when one of + the @racket[flags] appears on the command line. The flags are parsed + left-to-right, and each sequence of @racket[body]s is evaluated as + the corresponding flag is encountered. When the @racket[body]s are + evaluated, the preceding @racket[id]s are bound to the arguments provided for the flag on the command line.} ] -A flag specification using @scheme[=>] escapes to a more general +A flag specification using @racket[=>] escapes to a more general method of specifying the handler and help strings. In this case, the handler procedure and help string list returned by -@scheme[handler-expr] and @scheme[help-expr] are used as in the -@scheme[_table] argument of @scheme[parse-command-line]. +@racket[handler-expr] and @racket[help-expr] are used as in the +@racket[_table] argument of @racket[parse-command-line]. -A @scheme[#:help-labels] clause inserts text lines into the help table +A @racket[#:help-labels] clause inserts text lines into the help table of command-line flags. Each string in the clause provides a separate line of text. @@ -150,33 +150,33 @@ that are not parsed as flags: @itemize[ @item{Supplying no finish clause is the same as suppling - @scheme[#:args () (void)].} + @racket[#:args () (void)].} - @item{For an @scheme[#:args] finish clause, identifiers in - @scheme[arg-formals] are bound to the leftover command-line strings - in the same way that identifiers are bound for a @scheme[lambda] - expression. Thus, specifying a single @scheme[id] (without + @item{For an @racket[#:args] finish clause, identifiers in + @racket[arg-formals] are bound to the leftover command-line strings + in the same way that identifiers are bound for a @racket[lambda] + expression. Thus, specifying a single @racket[id] (without parentheses) collects all of the leftover arguments into a list. The - effective arity of the @scheme[arg-formals] specification determines + effective arity of the @racket[arg-formals] specification determines the number of extra command-line arguments that the user can provide, - and the names of the identifiers in @scheme[arg-formals] are used in + and the names of the identifiers in @racket[arg-formals] are used in the help string. When the command-line is parsed, if the number of provided arguments cannot be matched to identifiers in - @scheme[arg-formals], the @exnraise[exn:fail]. Otherwise, - @scheme[args] clause's @scheme[body]s are evaluated to handle the - leftover arguments, and the result of the last @scheme[body] is the - result of the @scheme[command-line] expression.} + @racket[arg-formals], the @exnraise[exn:fail]. Otherwise, + @racket[args] clause's @racket[body]s are evaluated to handle the + leftover arguments, and the result of the last @racket[body] is the + result of the @racket[command-line] expression.} - @item{A @scheme[#:handlers] finish clause escapes to a more general + @item{A @racket[#:handlers] finish clause escapes to a more general method of handling the leftover arguments. In this case, the values of the expressions are used like the last two to four arguments - @scheme[parse-command-line].} + @racket[parse-command-line].} ] Example: -@schemeblock[ +@racketblock[ (define verbose-mode (make-parameter #f)) (define profiling-on (make-parameter #f)) (define optimize-level (make-parameter 0)) @@ -217,53 +217,53 @@ Example: [unknown-proc (string? . -> . any) (lambda (str) ...)]) any]{ -Parses a command-line using the specification in @scheme[table]. For -an overview of command-line parsing, see the @scheme[command-line] +Parses a command-line using the specification in @racket[table]. For +an overview of command-line parsing, see the @racket[command-line] form, which provides a more convenient notation for most purposes. -The @scheme[table] argument to this procedural form encodes the -information in @scheme[command-line]'s clauses, except for the -@scheme[args] clause. Instead, arguments are handled by the -@scheme[finish-proc] procedure, and help information about non-flag -arguments is provided in @scheme[arg-help-strs]. In addition, the -@scheme[finish-proc] procedure receives information accumulated while -parsing flags. The @scheme[help-proc] and @scheme[unknown-proc] +The @racket[table] argument to this procedural form encodes the +information in @racket[command-line]'s clauses, except for the +@racket[args] clause. Instead, arguments are handled by the +@racket[finish-proc] procedure, and help information about non-flag +arguments is provided in @racket[arg-help-strs]. In addition, the +@racket[finish-proc] procedure receives information accumulated while +parsing flags. The @racket[help-proc] and @racket[unknown-proc] arguments allow customization that is not possible with -@scheme[command-line]. +@racket[command-line]. -When there are no more flags, @scheme[finish-proc] is called with a +When there are no more flags, @racket[finish-proc] is called with a list of information accumulated for command-line flags (see below) and the remaining non-flag arguments from the command-line. The arity of -@scheme[finish-proc] determines the number of non-flag arguments +@racket[finish-proc] determines the number of non-flag arguments accepted and required from the command-line. For example, if -@scheme[finish-proc] accepts either two or three arguments, then +@racket[finish-proc] accepts either two or three arguments, then either one or two non-flag arguments must be provided on the -command-line. The @scheme[finish-proc] procedure can have any arity -(see @scheme[procedure-arity]) except @scheme[0] or a list of -@scheme[0]s (i.e., the procedure must at least accept one or more +command-line. The @racket[finish-proc] procedure can have any arity +(see @racket[procedure-arity]) except @racket[0] or a list of +@racket[0]s (i.e., the procedure must at least accept one or more arguments). -The @scheme[arg-help-strs] argument is a list of strings identifying +The @racket[arg-help-strs] argument is a list of strings identifying the expected (non-flag) command-line arguments, one for each argument. If an arbitrary number of arguments are allowed, the last -string in @scheme[arg-help-strs] represents all of them. +string in @racket[arg-help-strs] represents all of them. -The @scheme[help-proc] procedure is called with a help string if the +The @racket[help-proc] procedure is called with a help string if the @Flag{h} or @DFlag{help} flag is included on the command line. If an -unknown flag is encountered, the @scheme[unknown-proc] procedure is +unknown flag is encountered, the @racket[unknown-proc] procedure is called just like a flag-handling procedure (as described below); it must at least accept one argument (the unknown flag), but it may also -accept more arguments. The default @scheme[help-proc] displays the -string and exits and the default @scheme[unknown-proc] raises the -@scheme[exn:fail] exception. +accept more arguments. The default @racket[help-proc] displays the +string and exits and the default @racket[unknown-proc] raises the +@racket[exn:fail] exception. -A @scheme[table] is a list of flag specification sets. Each set is +A @racket[table] is a list of flag specification sets. Each set is represented as a pair of two items: a mode symbol and a list of either help strings or flag specifications. A mode symbol is one of -@scheme['once-each], @scheme['once-any], @scheme['multi], -@scheme['final], or @scheme['help-labels], with the same meanings as -the corresponding clause tags in @scheme[command-line]. For the -@scheme['help-labels] mode, a list of help string is provided. For the +@racket['once-each], @racket['once-any], @racket['multi], +@racket['final], or @racket['help-labels], with the same meanings as +the corresponding clause tags in @racket[command-line]. For the +@racket['help-labels] mode, a list of help string is provided. For the other modes, a list of flag specifications is provided, where each specification maps a number of flags to a single handler procedure. A specification is a list of three items: @@ -271,7 +271,7 @@ specification is a list of three items: @itemize[ @item{A list of strings for the flags defined by the spec. See - @scheme[command-line] for information about the format of flag + @racket[command-line] for information about the format of flag strings.} @item{A procedure to handle the flag and its arguments when one of @@ -283,10 +283,10 @@ specification is a list of three items: receive the flag. If the handler accepts arbitrarily many arguments, all of the remaining arguments are passed to the handler. A handler procedure's arity must either be a number or an - @scheme[arity-at-least] value. + @racket[arity-at-least] value. The return value from the handler is added to a list that is - eventually passed to @scheme[finish-proc]. If the handler returns + eventually passed to @racket[finish-proc]. If the handler returns @|void-const|, no value is added onto this list. For all non-@|void-const| values returned by handlers, the order of the values in the list is the same as the order of the arguments on the @@ -303,9 +303,9 @@ specification is a list of three items: ] The following example is the same as the core example for -@scheme[command-line], translated to the procedural form: +@racket[command-line], translated to the procedural form: -@schemeblock[ +@racketblock[ (parse-command-line "compile" (current-command-line-arguments) `((once-each [("-v" "--verbose") diff --git a/collects/scribblings/reference/code-inspectors.scrbl b/collects/scribblings/reference/code-inspectors.scrbl index d6cdfc22a5..a4b0a30613 100644 --- a/collects/scribblings/reference/code-inspectors.scrbl +++ b/collects/scribblings/reference/code-inspectors.scrbl @@ -6,13 +6,13 @@ In the same way that inspectors control access to structure fields (see @secref["inspectors"]), inspectors also control access to @tech{module bindings}. The default inspector for @tech{module -bindings} is determined by the @scheme[current-code-inspector] -parameter, instead of the @scheme[current-inspector] parameter. +bindings} is determined by the @racket[current-code-inspector] +parameter, instead of the @racket[current-inspector] parameter. -When a @scheme[module] declaration is evaluated, the value of the -@scheme[current-code-inspector] parameter is associated with the -module declaration. When the module is invoked via @scheme[require] or -@scheme[dynamic-require], a sub-inspector of the module's +When a @racket[module] declaration is evaluated, the value of the +@racket[current-code-inspector] parameter is associated with the +module declaration. When the module is invoked via @racket[require] or +@racket[dynamic-require], a sub-inspector of the module's declaration-time inspector is created, and this sub-inspector is associated with the module invocation. Any inspector that controls the sub-inspector (i.e., the declaration-time inspector and its superior) @@ -22,26 +22,26 @@ Control over a module invocation enables @itemize[ - @item{the use of @scheme[module->namespace] on the module;} + @item{the use of @racket[module->namespace] on the module;} @item{access to the module's protected identifiers, i.e. those - identifiers exported from the module with @scheme[protect]; and} + identifiers exported from the module with @racket[protect]; and} @item{access to the module's protected and unexported variables - within compiled code from @scheme[read] (see @scheme[current-compile]).} + within compiled code from @racket[read] (see @racket[current-compile]).} ] -If the value of @scheme[current-code-inspector] never changes, then no +If the value of @racket[current-code-inspector] never changes, then no control is lost for any module invocation, since the module's invocation is associated with a sub-inspector of -@scheme[current-code-inspector]. +@racket[current-code-inspector]. The inspector for a module invocation is specific to a particular module registry, in case a module is attached to a new registry via -@scheme[namespace-attach-module]. The invocation inspector in a +@racket[namespace-attach-module]. The invocation inspector in a particular registry can be changed via -@scheme[namespace-unprotect-module] (but changing the inspector +@racket[namespace-unprotect-module] (but changing the inspector requires control over the old one). Control over a module declaration (as opposed to a mere invocation) diff --git a/collects/scribblings/reference/concurrency.scrbl b/collects/scribblings/reference/concurrency.scrbl index 10ee675714..cb8fa93d5b 100644 --- a/collects/scribblings/reference/concurrency.scrbl +++ b/collects/scribblings/reference/concurrency.scrbl @@ -6,7 +6,7 @@ Racket supports multiple threads of control within a program, thread-local storage, some primitive synchronization mechanisms, and a framework for composing synchronization abstractions. In addition, the -@scheme[racket/future] and @racket[racket/place] libraries provide +@racket[racket/future] and @racket[racket/place] libraries provide support for parallelism to improve performance. @local-table-of-contents[] diff --git a/collects/scribblings/reference/contracts.scrbl b/collects/scribblings/reference/contracts.scrbl index 74e50c3131..06c3183706 100644 --- a/collects/scribblings/reference/contracts.scrbl +++ b/collects/scribblings/reference/contracts.scrbl @@ -612,16 +612,16 @@ Consider this sample contract: [y (x) (>=/c x)]) [result (x y) (and/c number? (>=/c (+ x y)))])] It specifies a function of two arguments, both numbers. The contract on the -second argument (@scheme[y]) demands that it is greater than the first +second argument (@racket[y]) demands that it is greater than the first argument. The result contract promises a number that is greater than the -sum of the two arguments. While the dependency specification for @scheme[y] +sum of the two arguments. While the dependency specification for @racket[y] signals that the argument contract depends on the value of the first -argument, the dependency sequence for @scheme[result] indicates that the +argument, the dependency sequence for @racket[result] indicates that the contract depends on both argument values. @margin-note*{In general, an empty sequence is (nearly) equivalent to not adding a sequence at all except that the former is more expensive than the latter.} Since the contract for @racket[x] does not depend on anything else, it does -not come with any dependency sequence, not even @scheme[()]. +not come with any dependency sequence, not even @racket[()]. The contract expressions are not always evaluated in order. First, if there is no dependency for a given contract expression, @@ -676,7 +676,7 @@ called @racket[the-unsupplied-arg] value. )]{ This contract is here for backwards compatibility; any new code should -use @scheme[->i] instead. +use @racket[->i] instead. This contract is similar to @racket[->i], but is ``lax'', meaning that it does not enforce contracts internally. For example, using @@ -686,7 +686,7 @@ this contract (zero? (f #f)) any)] will allow @racket[f] to be called with @racket[#f], trigger whatever bad -behavior the author of @scheme[f] was trying to prohibit by insisting that +behavior the author of @racket[f] was trying to prohibit by insisting that @racket[f]'s contract accept only integers. The @racket[#:pre-cond] and @racket[#:post-cond] keywords are aliases for @@ -989,10 +989,10 @@ contracts. The variables are bound in the remainder of the @racket[provide/contr expression to new contracts that hide the values they accept and ensure that the exported functions are treated parametrically. -The implementation of @scheme[provide/contract] attaches uses -@scheme[syntax-property] to attach properties to the code it generates +The implementation of @racket[provide/contract] attaches uses +@racket[syntax-property] to attach properties to the code it generates that records the syntax of the contracts in the fully expanded program. -Specifically, the symbol @scheme['provide/contract-original-contract] +Specifically, the symbol @racket['provide/contract-original-contract] is bound to vectors of two elements, the exported identifier and a syntax object for the expression that produces the contract controlling the export. diff --git a/collects/scribblings/reference/control-lib.scrbl b/collects/scribblings/reference/control-lib.scrbl index eb56c12b98..6d1dced475 100644 --- a/collects/scribblings/reference/control-lib.scrbl +++ b/collects/scribblings/reference/control-lib.scrbl @@ -10,24 +10,24 @@ (the-eval '(require racket/control)) the-eval)) -The @scheme[racket/control] library provides various control operators +The @racket[racket/control] library provides various control operators from the research literature on higher-order control operators, plus a few extra convenience forms. These control operators are implemented -in terms of @scheme[call-with-continuation-prompt], -@scheme[call-with-composable-continuations], @|etc|, and they generally +in terms of @racket[call-with-continuation-prompt], +@racket[call-with-composable-continuations], @|etc|, and they generally work sensibly together. Many are redundant; for example, -@scheme[reset] and @scheme[prompt] are aliases. +@racket[reset] and @racket[prompt] are aliases. @; ---------------------------------------------------------------------- @defproc[(abort [v any/c] ...) any]{ -Returns the @scheme[v]s to a prompt using the default continuation +Returns the @racket[v]s to a prompt using the default continuation prompt tag and the default abort handler. -That is, @scheme[(abort v ...)] is equivalent to +That is, @racket[(abort v ...)] is equivalent to -@schemeblock[ +@racketblock[ (abort-current-continuation (default-continuation-prompt-tag) (lambda () (values v ...))) @@ -52,14 +52,14 @@ Sitaram's operators @cite["Sitaram93"]. The essential reduction rules are: -@schemeblock[ +@racketblock[ (% _val proc) => _val (% _E[(fcontrol _val)] _proc) => (_proc _val (lambda (_x) _E[_x])) - (code:comment @#,t{where @scheme[_E] has no @scheme[%]}) + (code:comment @#,t{where @racket[_E] has no @racket[%]}) ] -When @scheme[handler-expr] is omitted, @scheme[%] is the same as -@scheme[prompt]. +When @racket[handler-expr] is omitted, @racket[%] is the same as +@racket[prompt]. @examples[#:eval control-eval (% (+ 2 (fcontrol 5)) @@ -81,11 +81,11 @@ Among the earliest operators for higher-order control @cite["Felleisen88a" "Felleisen88" "Sitaram90"]. The essential reduction rules are: -@schemeblock[ +@racketblock[ (prompt _val) => _val (prompt _E[(control _k _expr)]) => (prompt ((lambda (_k) _expr) (lambda (_v) _E[_v]))) - (code:comment @#,t{where @scheme[_E] has no @scheme[prompt]}) + (code:comment @#,t{where @racket[_E] has no @racket[prompt]}) ] @examples[#:eval control-eval @@ -108,15 +108,15 @@ The essential reduction rules are: @defform[(control-at prompt-tag-expr id expr ...+)] )]{ -Like @scheme[prompt] and @scheme[control], but using specific prompt +Like @racket[prompt] and @racket[control], but using specific prompt tags: -@schemeblock[ +@racketblock[ (prompt-at _tag _val) => _val (prompt-at _tag _E[(control-at _tag _k _expr)]) => (prompt-at _tag ((lambda (_k) _expr) (lambda (_v) _E[_v]))) - (code:comment @#,t{where @scheme[_E] has no @scheme[prompt-at] for @scheme[_tag]}) + (code:comment @#,t{where @racket[_E] has no @racket[prompt-at] for @racket[_tag]}) ]} @; ---------------------------------------------------------------------- @@ -130,14 +130,14 @@ Danvy and Filinski's operators @cite["Danvy90"]. The essential reduction rules are: -@schemeblock[ +@racketblock[ (reset _val) => _val (reset _E[(shift _k _expr)]) => (reset ((lambda (_k) _expr) (lambda (_v) (reset _E[_v])))) - (code:comment @#,t{where @scheme[_E] has no @scheme[reset]}) + (code:comment @#,t{where @racket[_E] has no @racket[reset]}) ] -The @scheme[reset] and @scheme[prompt] forms are interchangeable.} +The @racket[reset] and @racket[prompt] forms are interchangeable.} @; ---------------------------------------------------------------------- @@ -147,7 +147,7 @@ The @scheme[reset] and @scheme[prompt] forms are interchangeable.} @defform[(shift-at prompt-tag-expr identifer expr ...+)] )]{ -Like @scheme[reset] and @scheme[shift], but using the specified prompt +Like @racket[reset] and @racket[shift], but using the specified prompt tags.} @; ---------------------------------------------------------------------- @@ -159,11 +159,11 @@ tags.} @defform[(shift0 id expr ...+)] )]{ -Generalizations of @scheme[prompt], @|etc| @cite["Shan04"]. +Generalizations of @racket[prompt], @|etc| @cite["Shan04"]. The essential reduction rules are: -@schemeblock[ +@racketblock[ (prompt0 _val) => _val (prompt0 _E[(control0 _k _expr)]) => ((lambda (_k) _expr) (lambda (_v) _E[_v])) @@ -172,10 +172,10 @@ The essential reduction rules are: (lambda (_v) (reset0 _E[_v]))) ] -The @scheme[reset0] and @scheme[prompt0] forms are interchangeable. +The @racket[reset0] and @racket[prompt0] forms are interchangeable. Furthermore, the following reductions apply: -@schemeblock[ +@racketblock[ (prompt _E[(control0 _k _expr)]) => (prompt ((lambda (_k) _expr) (lambda (_v) _E[_v]))) (reset _E[(shift0 _k _expr)]) => (reset ((lambda (_k) _expr) @@ -186,9 +186,9 @@ Furthermore, the following reductions apply: (lambda (_v) (reset _E[_v])))) ] -That is, both the @scheme[prompt]/@scheme[reset] and -@scheme[control]/@scheme[shift] sites must agree for @scheme[0]-like -behavior, otherwise the non-@scheme[0] behavior applies.} +That is, both the @racket[prompt]/@racket[reset] and +@racket[control]/@racket[shift] sites must agree for @racket[0]-like +behavior, otherwise the non-@racket[0] behavior applies.} @; ---------------------------------------------------------------------- @@ -199,7 +199,7 @@ behavior, otherwise the non-@scheme[0] behavior applies.} @defform[(shift0-at prompt-tag-expr id expr ...+)] )]{ -Variants of @scheme[prompt0], @|etc|, that accept a prompt tag.} +Variants of @racket[prompt0], @|etc|, that accept a prompt tag.} @; ---------------------------------------------------------------------- @@ -209,12 +209,12 @@ The operators of Hieb and Dybvig @cite["Hieb90"]. The essential reduction rules are: -@schemeblock[ +@racketblock[ (prompt-at _tag _obj) => _obj (spawn _proc) => (prompt _tag (_proc (lambda (_x) (abort _tag _x)))) (prompt-at _tag _E[(abort _tag _proc)]) => (_proc (lambda (_x) (prompt-at _tag _E[_x]))) - (code:comment @#,t{where @scheme[_E] has no @scheme[prompt-at] for @scheme[_tag]}) + (code:comment @#,t{where @racket[_E] has no @racket[prompt-at] for @racket[_tag]}) ]} @; ---------------------------------------------------------------------- @@ -227,17 +227,17 @@ The essential reduction rules are: The operator of Queinnec and Serpette @cite["Queinnec91"]. The essential reduction rules are: -@schemeblock[ +@racketblock[ (splitter _proc) => (prompt-at _tag (_proc (lambda (_thunk) (abort _tag _thunk)) (lambda (_proc) (control0-at _tag _k (_proc _k))))) (prompt-at _tag _E[(abort _tag _thunk)]) => (_thunk) - (code:comment @#,t{where @scheme[_E] has no @scheme[prompt-at] for @scheme[_tag]}) + (code:comment @#,t{where @racket[_E] has no @racket[prompt-at] for @racket[_tag]}) (prompt-at _tag _E[(control0-at _tag _k _expr)]) => ((lambda (_k) _expr) (lambda (_x) _E[_x])) - (code:comment @#,t{where @scheme[_E] has no @scheme[prompt-at] for @scheme[_tag]}) + (code:comment @#,t{where @racket[_E] has no @racket[prompt-at] for @racket[_tag]}) ]} @; ---------------------------------------------------------------------- @@ -250,9 +250,9 @@ The essential reduction rules are: The operators of Gunter et al. @cite["Gunter95"]. -In this library, @scheme[new-prompt] is an alias for -@scheme[make-continuation-prompt-tag], @scheme[set] is an alias for -@scheme[prompt0-at], and @scheme[cupto] is an alias for @scheme[control0-at]. +In this library, @racket[new-prompt] is an alias for +@racket[make-continuation-prompt-tag], @racket[set] is an alias for +@racket[prompt0-at], and @racket[cupto] is an alias for @racket[control0-at]. } diff --git a/collects/scribblings/reference/custom-ports.scrbl b/collects/scribblings/reference/custom-ports.scrbl index a98727df63..a28b36d7a0 100644 --- a/collects/scribblings/reference/custom-ports.scrbl +++ b/collects/scribblings/reference/custom-ports.scrbl @@ -3,7 +3,7 @@ @title[#:tag "customport"]{Custom Ports} -The @scheme[make-input-port] and @scheme[make-output-port] procedures +The @racket[make-input-port] and @racket[make-output-port] procedures create custom ports with arbitrary control procedures (much like implementing a device driver). Custom ports are mainly useful to obtain fine control over the action of committing bytes as read or @@ -43,61 +43,61 @@ written. input-port?]{ Creates an input port, which is immediately open for reading. If -@scheme[close] procedure has no side effects, then the port need not -be explicitly closed. See also @scheme[make-input-port/peek-to-read]. +@racket[close] procedure has no side effects, then the port need not +be explicitly closed. See also @racket[make-input-port/peek-to-read]. The arguments implement the port as follows: @itemize[ - @item{@scheme[name] --- the name for the input port.} + @item{@racket[name] --- the name for the input port.} - @item{@scheme[read-in] --- a procedure that takes a single argument: + @item{@racket[read-in] --- a procedure that takes a single argument: a mutable byte string to receive read bytes. The procedure's result is one of the following: @itemize[ @item{the number of bytes read, as an exact, non-negative integer;} - @item{@scheme[eof];} + @item{@racket[eof];} @item{a procedure of arity four (representing a ``special'' result, as discussed @elemref["special"]{further below}) and optionally of arity zero, but a procedure result is allowed only - when @scheme[peek] is not @scheme[#f];} + when @racket[peek] is not @racket[#f];} @item{a @techlink{pipe} input port that supplies bytes to be used as long as the pipe has content (see - @scheme[pipe-content-length]) or until @scheme[read-in] or - @scheme[peek] is called again; or} + @racket[pipe-content-length]) or until @racket[read-in] or + @racket[peek] is called again; or} @item{a @tech{synchronizable event} (see @secref["sync"]) other than a pipe input port or procedure of arity four; the event becomes ready when the read is complete (roughly): the event's value can be one of the above three results or another event like itself; in the last case, a reading process loops with - @scheme[sync] until it gets a non-event result.} + @racket[sync] until it gets a non-event result.} ] - The @scheme[read-in] procedure must not block indefinitely. If no - bytes are immediately available for reading, the @scheme[read-in] - must return @scheme[0] or an event, and preferably an event (to - avoid busy waits). The @scheme[read-in] should not return - @scheme[0] (or an event whose value is @scheme[0]) when data is + The @racket[read-in] procedure must not block indefinitely. If no + bytes are immediately available for reading, the @racket[read-in] + must return @racket[0] or an event, and preferably an event (to + avoid busy waits). The @racket[read-in] should not return + @racket[0] (or an event whose value is @racket[0]) when data is available in the port, otherwise polling the port will behave incorrectly. An event result from an event can also break polling. - If the result of a @scheme[read-in] call is not one of the above + If the result of a @racket[read-in] call is not one of the above values, the @exnraise[exn:fail:contract]. If a returned integer is larger than the supplied byte string's length, the - @exnraise[exn:fail:contract]. If @scheme[peek] is @scheme[#f] and + @exnraise[exn:fail:contract]. If @racket[peek] is @racket[#f] and a procedure for a @elemref["special"]{special} result is returned, the @exnraise[exn:fail:contract]. - The @scheme[read-in] procedure can report an error by raising an + The @racket[read-in] procedure can report an error by raising an exception, but only if no bytes are read. Similarly, no bytes - should be read if @scheme[eof], an event, or a procedure is + should be read if @racket[eof], an event, or a procedure is returned. In other words, no bytes should be lost due to spurious exceptions or non-byte data. @@ -109,23 +109,23 @@ The arguments implement the port as follows: procedure to block indefinitely. If the result is a pipe input port, then previous - @scheme[get-progress-evt] calls whose event is not yet ready must + @racket[get-progress-evt] calls whose event is not yet ready must have been the pipe input port itself. Furthermore, - @scheme[get-progress-evt] must continue to return the pipe as long - as it contains data, or until the @scheme[read-in] or - @scheme[peek-in] procedure is called again (instead of using the - pipe, for whatever reason). If @scheme[read-in] or - @scheme[peek-in] is called, any previously associated pipe (as + @racket[get-progress-evt] must continue to return the pipe as long + as it contains data, or until the @racket[read-in] or + @racket[peek-in] procedure is called again (instead of using the + pipe, for whatever reason). If @racket[read-in] or + @racket[peek-in] is called, any previously associated pipe (as returned by a previous call) is disassociated from the port and is not in use by any other thread as a result of the previous association. - If @scheme[peek], @scheme[get-progress-evt], and - @scheme[commit] are all provided and - non-@scheme[#f], then the following is an acceptable implementation - of @scheme[read-in]: + If @racket[peek], @racket[get-progress-evt], and + @racket[commit] are all provided and + non-@racket[#f], then the following is an acceptable implementation + of @racket[read-in]: -@schemeblock[ +@racketblock[ (code:line (lambda (bstr) (let* ([progress-evt (get-progress-evt)] @@ -142,14 +142,14 @@ The arguments implement the port as follows: 0)]))) (code:comment #,(t "try again")) )] - An implementor may choose not to implement the @scheme[peek], - @scheme[get-progress-evt], and @scheme[commit] + An implementor may choose not to implement the @racket[peek], + @racket[get-progress-evt], and @racket[commit] procedures, however, and even an implementor who does supply - them may provide a different @scheme[read-in] + them may provide a different @racket[read-in] that uses a fast path for non-blocking reads.} - @item{@scheme[peek] --- either @scheme[#f] or a procedure + @item{@racket[peek] --- either @racket[#f] or a procedure that takes three arguments: @itemize[ @@ -159,28 +159,28 @@ The arguments implement the port as follows: @item{a non-negative number of bytes (or @elemref["special"]{specials}) to skip before peeking; and} - @item{either @scheme[#f] or a progress event produced by - @scheme[get-progress-evt].} + @item{either @racket[#f] or a progress event produced by + @racket[get-progress-evt].} ] - The results and conventions for @scheme[peek] are - mostly the same as for @scheme[read-in]. The main difference is in - the handling of the progress event, if it is not @scheme[#f]. If + The results and conventions for @racket[peek] are + mostly the same as for @racket[read-in]. The main difference is in + the handling of the progress event, if it is not @racket[#f]. If the given progress event becomes ready, the - @scheme[peek] must abort any skip attempts and not peek - any values. In particular, @scheme[peek] must not peek + @racket[peek] must abort any skip attempts and not peek + any values. In particular, @racket[peek] must not peek any values if the progress event is initially ready. - Unlike @scheme[read-in], @scheme[peek] should produce - @scheme[#f] (or an event whose value is @scheme[#f]) if no bytes + Unlike @racket[read-in], @racket[peek] should produce + @racket[#f] (or an event whose value is @racket[#f]) if no bytes were peeked because the progress event became ready. Like - @scheme[read-in], a @scheme[0] result indicates that another - attempt is likely to succeed, so @scheme[0] is inappropriate when - the progress event is ready. Also like @scheme[read-in], - @scheme[peek] must not block indefinitely. + @racket[read-in], a @racket[0] result indicates that another + attempt is likely to succeed, so @racket[0] is inappropriate when + the progress event is ready. Also like @racket[read-in], + @racket[peek] must not block indefinitely. - The skip count provided to @scheme[peek] is a number of bytes (or + The skip count provided to @racket[peek] is a number of bytes (or @elemref["special"]{specials}) that must remain present in the port---in addition to the peek results---when the peek results are reported. If a progress event is supplied, then the peek is @@ -192,21 +192,21 @@ The arguments implement the port as follows: The system does not check that multiple peeks return consistent results, or that peeking and reading produce consistent results. - If @scheme[peek] is @scheme[#f], then peeking for the port is + If @racket[peek] is @racket[#f], then peeking for the port is implemented automatically in terms of reads, but with several limitations. First, the automatic implementation is not thread-safe. Second, the automatic implementation cannot handle @elemref["special"]{special} results (non-byte and non-eof), so - @scheme[read-in] cannot return a procedure for a - @elemref["special"]{special} when @scheme[peek] is - @scheme[#f]. Finally, the automatic peek implementation is - incompatible with progress events, so if @scheme[peek] is - @scheme[#f], then @scheme[progress-evt] and @scheme[commit] must - be @scheme[#f]. See also @scheme[make-input-port/peek-to-read], - which implements peeking in terms of @scheme[read-in] without + @racket[read-in] cannot return a procedure for a + @elemref["special"]{special} when @racket[peek] is + @racket[#f]. Finally, the automatic peek implementation is + incompatible with progress events, so if @racket[peek] is + @racket[#f], then @racket[progress-evt] and @racket[commit] must + be @racket[#f]. See also @racket[make-input-port/peek-to-read], + which implements peeking in terms of @racket[read-in] without these constraints.} - @item{@scheme[close] --- a procedure of zero arguments that is + @item{@racket[close] --- a procedure of zero arguments that is called to close the port. The port is not considered closed until the closing procedure returns. The port's procedures will never be used again via the port after it is closed. However, the closing @@ -216,31 +216,31 @@ The arguments implement the port as follows: latter case, any outstanding reads and peeks should be terminated with an error.} - @item{@scheme[get-progress-evt] --- either @scheme[#f] (the + @item{@racket[get-progress-evt] --- either @racket[#f] (the default), or a procedure that takes no arguments and returns an event. The event must become ready only after data is next read from the port or the port is closed. After the event becomes - ready, it must remain so. See the description of @scheme[read-in] + ready, it must remain so. See the description of @racket[read-in] for information about the allowed results of this function when - @scheme[read-in] returns a pipe input port. See also - @scheme[semaphore-peek-evt], which is sometimes useful for - implementing @scheme[get-progress-evt]. + @racket[read-in] returns a pipe input port. See also + @racket[semaphore-peek-evt], which is sometimes useful for + implementing @racket[get-progress-evt]. - If @scheme[get-progress-evt] is @scheme[#f], then - @scheme[port-provides-progress-evts?] applied to the port will - produce @scheme[#f], and the port will not be a valid argument to - @scheme[port-progress-evt].} + If @racket[get-progress-evt] is @racket[#f], then + @racket[port-provides-progress-evts?] applied to the port will + produce @racket[#f], and the port will not be a valid argument to + @racket[port-progress-evt].} - @item{@scheme[commit] --- either @scheme[#f] (the + @item{@racket[commit] --- either @racket[#f] (the default), or a procedure that takes three arguments: @itemize[ @item{an exact, positive integer @math{k_r};} - @item{a progress event produced by @scheme[get-progress-evt];} + @item{a progress event produced by @racket[get-progress-evt];} - @item{an event, @scheme[_done], that is either a channel-put + @item{an event, @racket[_done], that is either a channel-put event, channel, semaphore, semaphore-peek event, always event, or never event.} @@ -251,8 +251,8 @@ The arguments implement the port as follows: data first. (The removed data does not need to be reported, because it has been peeked already.) More precisely, assuming that @math{k_p} bytes, @elemref["special"]{specials}, and - mid-stream @scheme[eof]s have been previously peeked or skipped - at the start of the port's stream, @scheme[commit] must satisfy + mid-stream @racket[eof]s have been previously peeked or skipped + at the start of the port's stream, @racket[commit] must satisfy the following constraints: @itemize[ @@ -266,14 +266,14 @@ The arguments implement the port as follows: or @math{k_p} items, whichever is smaller, and only if @math{k_p} is positive.} - @item{It must never choose @scheme[_done] in a synchronization - after the given progress event is ready, or after @scheme[_done] + @item{It must never choose @racket[_done] in a synchronization + after the given progress event is ready, or after @racket[_done] has been synchronized once.} @item{It must not treat any data as read from the port unless - @scheme[_done] is chosen in a synchronization.} + @racket[_done] is chosen in a synchronization.} - @item{It must not block indefinitely if @scheme[_done] is ready; + @item{It must not block indefinitely if @racket[_done] is ready; it must return soon after the read completes or soon after the given progress event is ready, whichever is first.} @@ -282,7 +282,7 @@ The arguments implement the port as follows: an exception, including a break exception.} @item{It must return a true value if data has been committed, - @scheme[#f] otherwise. When it returns a value, the given + @racket[#f] otherwise. When it returns a value, the given progress event must be ready (perhaps because data has just been committed).} @@ -296,75 +296,75 @@ The arguments implement the port as follows: character.} @item{It must raise an exception if no data (including - @scheme[eof]) has been peeked from the beginning of the port's + @racket[eof]) has been peeked from the beginning of the port's stream, or if it would have to block indefinitely to wait for the given progress event to become ready.} ] - A call to @scheme[commit] is @scheme[parameterize-break]ed to + A call to @racket[commit] is @racket[parameterize-break]ed to disable breaks.} - @item{@scheme[get-location] --- either @scheme[#f] (the + @item{@racket[get-location] --- either @racket[#f] (the default), or a procedure that takes no arguments and returns three values: the line number for the next item in the port's stream (a - positive number or @scheme[#f]), the column number for the next - item in the port's stream (a non-negative number or @scheme[#f]), + positive number or @racket[#f]), the column number for the next + item in the port's stream (a non-negative number or @racket[#f]), and the position for the next item in the port's stream (a - positive number or @scheme[#f]). See also @secref["linecol"]. + positive number or @racket[#f]). See also @secref["linecol"]. - This procedure is called to implement @scheme[port-next-location], + This procedure is called to implement @racket[port-next-location], but only if line counting is enabled for the port via - @scheme[port-count-lines!] (in which case @scheme[count-lines!] is - called). The @scheme[read], @scheme[read-syntax], - @scheme[read-honu], and @scheme[read-honu-syntax] procedures + @racket[port-count-lines!] (in which case @racket[count-lines!] is + called). The @racket[read], @racket[read-syntax], + @racket[read-honu], and @racket[read-honu-syntax] procedures assume that reading a non-whitespace character increments the column and position by one.} - @item{@scheme[count-lines!] --- a procedure of no arguments + @item{@racket[count-lines!] --- a procedure of no arguments that is called if and when line counting is enabled for the port. - The default procedure is @scheme[void].} + The default procedure is @racket[void].} - @item{@scheme[init-position] --- an exact, positive integer that + @item{@racket[init-position] --- an exact, positive integer that determines the position of the port's first item, used when line counting is @italic{not} enabled for the port. The default is - @scheme[1].} + @racket[1].} - @item{@scheme[buffer-mode] --- either @scheme[#f] (the default) or a + @item{@racket[buffer-mode] --- either @racket[#f] (the default) or a procedure that accepts zero or one arguments. If - @scheme[buffer-mode] is @scheme[#f], then the resulting port does + @racket[buffer-mode] is @racket[#f], then the resulting port does not support a buffer-mode setting. Otherwise, the procedure is - called with one symbol argument (@scheme['block] or - @scheme['none]) to set the buffer mode, and it is called with zero + called with one symbol argument (@racket['block] or + @racket['none]) to set the buffer mode, and it is called with zero arguments to get the current buffer mode. In the latter case, the - result must be @scheme['block], @scheme['none], or @scheme[#f] + result must be @racket['block], @racket['none], or @racket[#f] (unknown). See @secref["port-buffers"] for more information on buffer modes.} ] @elemtag["special"]{@bold{``Special'' results:}} When - @scheme[read-in] or @scheme[peek] (or an event produced by one of + @racket[read-in] or @racket[peek] (or an event produced by one of these) returns a procedure, the procedure is used to obtain a non-byte result. (This non-byte result is @italic{not} intended to - return a character or @scheme[eof]; in particular, @scheme[read-char] + return a character or @racket[eof]; in particular, @racket[read-char] raises an exception if it encounters a special-result procedure, even if the procedure produces a byte.) A special-result procedure must accept four arguments, and it can optionally accept zero arguments: @itemize[ - @item{When the special read is triggered by @scheme[read-syntax], - @scheme[read-honu-syntax], or @scheme[read-syntax/recursive], the + @item{When the special read is triggered by @racket[read-syntax], + @racket[read-honu-syntax], or @racket[read-syntax/recursive], the procedure is passed four arguments that represent a source location.} - @item{When the special read is triggered by @scheme[read], - @scheme[read-honu], @scheme[read-byte-or-special], - @scheme[read-char-or-special], @scheme[peek-byte-or-special], or - @scheme[peek-char-or-special], the procedure is passed no arguments + @item{When the special read is triggered by @racket[read], + @racket[read-honu], @racket[read-byte-or-special], + @racket[read-char-or-special], @racket[peek-byte-or-special], or + @racket[peek-char-or-special], the procedure is passed no arguments if it accepts zero arguments, otherwise it is passed four arguments - that are all @scheme[#f].} + that are all @racket[#f].} ] @@ -373,18 +373,18 @@ The arguments implement the port as follows: reads or peeks from the port). See @secref["reader-procs"] for more details on the procedure's result. - If @scheme[read-in] or @scheme[peek] returns a special + If @racket[read-in] or @racket[peek] returns a special procedure when called by any reading procedure other than - @scheme[read], @scheme[read-syntax], @scheme[read-honu], - @scheme[read-honu-syntax], @scheme[read-char-or-special], - @scheme[peek-char-or-special], @scheme[read-byte-or-special], or - @scheme[peek-byte-or-special], then the @exnraise[exn:fail:contract].} + @racket[read], @racket[read-syntax], @racket[read-honu], + @racket[read-honu-syntax], @racket[read-char-or-special], + @racket[peek-char-or-special], @racket[read-byte-or-special], or + @racket[peek-byte-or-special], then the @exnraise[exn:fail:contract].} @(begin #reader scribble/comment-reader [examples ;; A port with no input... -;; Easy: @scheme[(open-input-bytes #"")] +;; Easy: @racket[(open-input-bytes #"")] ;; Hard: (define /dev/null-in (make-input-port 'null @@ -442,7 +442,7 @@ The arguments implement the port as follows: (read-char-or-special infinite-voids) ;; This port produces 0, 1, 2, 0, 1, 2, etc., but it is not -;; thread-safe, because multiple threads might read and change @scheme[n]. +;; thread-safe, because multiple threads might read and change @racket[n]. (define mod3-cycle/one-thread (let* ([n 2] [mod! (lambda (s delta) @@ -545,7 +545,7 @@ The arguments implement the port as follows: [done-evt (caddr r)] [ch (cadddr r)] [nack (cddddr r)]) - ;; Note: we don't check that k is @scheme[<=] the sum of + ;; Note: we don't check that k is @racket[<=] the sum of ;; previous peeks, because the entire stream is actually ;; known, but we could send an exception in that case. (choice-evt @@ -574,7 +574,7 @@ The arguments implement the port as follows: (serve commit-reqs (remq evt response-evts))))) ;; Close handling: post the progress sema, if any, and set - ;; the @scheme[closed?] flag + ;; the @racket[closed?] flag (define ((handle-close commit-reqs response-evts) r) (let ([ch (car r)] [nack (cdr r)]) @@ -709,28 +709,28 @@ s output-port?]{ Creates an output port, which is immediately open for -writing. If @scheme[close] procedure has no side effects, then +writing. If @racket[close] procedure has no side effects, then the port need not be explicitly closed. The port can buffer data -within its @scheme[write-out] and @scheme[write-out-special] +within its @racket[write-out] and @racket[write-out-special] procedures. @itemize[ - @item{@scheme[name] --- the name for the output port.} + @item{@racket[name] --- the name for the output port.} - @item{@scheme[evt] --- a synchronization event (see @secref["sync"]; + @item{@racket[evt] --- a synchronization event (see @secref["sync"]; e.g., a semaphore or another port). The event is used in place of the output port when the port is supplied to synchronization - procedures like @scheme[sync]. Thus, the event should be + procedures like @racket[sync]. Thus, the event should be unblocked when the port is ready for writing at least one byte without blocking, or ready to make progress in flushing an internal buffer without blocking. The event must not unblock unless the port is ready for writing; otherwise, the guarantees of - @scheme[sync] will be broken for the output port. Use - @scheme[always-evt] if writes to the port always succeed without + @racket[sync] will be broken for the output port. Use + @racket[always-evt] if writes to the port always succeed without blocking.} - @item{@scheme[write-out] --- a procedure of five arguments: + @item{@racket[write-out] --- a procedure of five arguments: @itemize[ @@ -742,17 +742,17 @@ procedures. @item{a non-negative exact integer for an ending offset (exclusive) into the byte string;} - @item{a boolean; @scheme[#f] indicates that the port is allowed + @item{a boolean; @racket[#f] indicates that the port is allowed to keep the written bytes in a buffer, and that it is - allowed to block indefinitely; @scheme[#t] indicates that the + allowed to block indefinitely; @racket[#t] indicates that the write should not block, and that the port should attempt to flush its buffer and completely write new bytes instead of buffering them;} - @item{a boolean; @scheme[#t] indicates that if the port blocks + @item{a boolean; @racket[#t] indicates that if the port blocks for a write, then it should enable breaks while blocking (e.g., - using @scheme[sync/enable-break]); this argument is always - @scheme[#f] if the fourth argument is @scheme[#t].} + using @racket[sync/enable-break]); this argument is always + @racket[#f] if the fourth argument is @racket[#t].} ] @@ -763,63 +763,63 @@ procedures. @item{a non-negative exact integer representing the number of bytes written or buffered;} - @item{@scheme[#f] if no bytes could be written, perhaps because + @item{@racket[#f] if no bytes could be written, perhaps because the internal buffer could not be completely flushed;} @item{a @techlink{pipe} output port (when buffering is allowed and not when flushing) for buffering bytes as long as the pipe is - not full and until @scheme[write-out] or - @scheme[write-out-special] is called; or} + not full and until @racket[write-out] or + @racket[write-out-special] is called; or} @item{a synchronizable event (see @secref["sync"]) other than a pipe output port that acts like the result of - @scheme[write-bytes-avail-evt] to complete the write.} + @racket[write-bytes-avail-evt] to complete the write.} ] - Since @scheme[write-out] can produce an event, an acceptable - implementation of @scheme[write-out] is to pass its first three - arguments to the port's @scheme[get-write-evt]. Some port + Since @racket[write-out] can produce an event, an acceptable + implementation of @racket[write-out] is to pass its first three + arguments to the port's @racket[get-write-evt]. Some port implementors, however, may choose not to provide - @scheme[get-write-evt] (perhaps because writes cannot be - made atomic), or may implement @scheme[write-proc] to + @racket[get-write-evt] (perhaps because writes cannot be + made atomic), or may implement @racket[write-proc] to enable a fast path for non-blocking writes or to enable buffering. From a user's perspective, the difference between buffered and completely written data is (1) buffered data can be lost in the - future due to a failed write, and (2) @scheme[flush-output] forces + future due to a failed write, and (2) @racket[flush-output] forces all buffered data to be completely written. Under no circumstances is buffering required. If the start and end indices are the same, then the fourth - argument to @scheme[write-out] will be @scheme[#f], and the write + argument to @racket[write-out] will be @racket[#f], and the write request is actually a flush request for the port's buffer (if - any), and the result should be @scheme[0] for a successful flush + any), and the result should be @racket[0] for a successful flush (or if there is no buffer). - The result should never be @scheme[0] if the start and end indices + The result should never be @racket[0] if the start and end indices are different, otherwise the @exnraise[exn:fail:contract]. - Similarly, the @exnraise[exn:fail:contract] if @scheme[write-out] + Similarly, the @exnraise[exn:fail:contract] if @racket[write-out] returns a pipe output port when buffering is disallowed or when it is called for flushing. If a returned integer is larger than the supplied byte-string range, the @exnraise[exn:fail:contract]. - The @scheme[#f] result should be avoided, unless the next write + The @racket[#f] result should be avoided, unless the next write attempt is likely to work. Otherwise, if data cannot be written, return an event instead. - An event returned by @scheme[write-out] can return @scheme[#f] or + An event returned by @racket[write-out] can return @racket[#f] or another event like itself, in contrast to events produced by - @scheme[write-bytes-avail-evt] or @scheme[get-write-evt]. - A writing process loops with @scheme[sync] until it obtains a + @racket[write-bytes-avail-evt] or @racket[get-write-evt]. + A writing process loops with @racket[sync] until it obtains a non-event result. - The @scheme[write-out] procedure is always called with breaks + The @racket[write-out] procedure is always called with breaks disabled, independent of whether breaks were enabled when the write was requested by a client of the port. If breaks were enabled for - a blocking operation, then the fifth argument to @scheme[write-out] - will be @scheme[#t], which indicates that @scheme[write-out] should + a blocking operation, then the fifth argument to @racket[write-out] + will be @racket[#t], which indicates that @racket[write-out] should re-enable breaks while blocking. If the writing procedure raises an exception, due to write @@ -833,7 +833,7 @@ procedures. synchronization mechanisms might cause a non-blocking write procedure to block.} - @item{@scheme[close] --- a procedure of zero arguments that is + @item{@racket[close] --- a procedure of zero arguments that is called to close the port. The port is not considered closed until the closing procedure returns. The port's procedures will never be used again via the port after it is closed. However, the closing @@ -843,16 +843,16 @@ procedures. latter case, any outstanding writes or flushes should be terminated immediately with an error.} - @item{@scheme[write-out-special] --- either @scheme[#f] (the - default), or a procedure to handle @scheme[write-special] calls - for the port. If @scheme[#f], then the port does not support - special output, and @scheme[port-writes-special?] will return - @scheme[#f] when applied to the port. + @item{@racket[write-out-special] --- either @racket[#f] (the + default), or a procedure to handle @racket[write-special] calls + for the port. If @racket[#f], then the port does not support + special output, and @racket[port-writes-special?] will return + @racket[#f] when applied to the port. If a procedure is supplied, it takes three arguments: the special - value to write, a boolean that is @scheme[#f] if the procedure can + value to write, a boolean that is @racket[#f] if the procedure can buffer the special value and block indefinitely, and a boolean - that is @scheme[#t] if the procedure should enable breaks while + that is @racket[#t] if the procedure should enable breaks while blocking. The result is one of the following: @itemize[ @@ -860,28 +860,28 @@ procedures. @item{a non-event true value, which indicates that the special is written;} - @item{@scheme[#f] if the special could not be written, perhaps + @item{@racket[#f] if the special could not be written, perhaps because an internal buffer could not be completely flushed;} @item{a synchronizable event (see @secref["sync"]) that acts like - the result of @scheme[get-write-special-evt] to complete the write.} + the result of @racket[get-write-special-evt] to complete the write.} ] - Since @scheme[write-out-special] can return an event, + Since @racket[write-out-special] can return an event, passing the first argument to an implementation of - @scheme[get-write-special-evt] is acceptable as a - @scheme[write-out-special]. + @racket[get-write-special-evt] is acceptable as a + @racket[write-out-special]. - As for @scheme[write-out], the @scheme[#f] result is discouraged, - since it can lead to busy waiting. Also as for @scheme[write-out], - an event produced by @scheme[write-out-special] is allowed - to produce @scheme[#f] or another event like itself. The - @scheme[write-out-special] procedure is always called with + As for @racket[write-out], the @racket[#f] result is discouraged, + since it can lead to busy waiting. Also as for @racket[write-out], + an event produced by @racket[write-out-special] is allowed + to produce @racket[#f] or another event like itself. The + @racket[write-out-special] procedure is always called with breaks disabled, independent of whether breaks were enabled when the write was requested by a client of the port.} - @item{@scheme[get-write-evt] --- either @scheme[#f] (the + @item{@racket[get-write-evt] --- either @racket[#f] (the default) or a procedure of three arguments: @itemize[ @@ -897,16 +897,16 @@ procedures. ] The result is a synchronizable event (see @secref["sync"]) to act as - the result of @scheme[write-bytes-avail-evt] for the port (i.e., + the result of @racket[write-bytes-avail-evt] for the port (i.e., to complete a write or flush), which becomes available only as data is committed to the port's underlying device, and whose result is the number of bytes written. - If @scheme[get-write-evt] is @scheme[#f], then - @scheme[port-writes-atomic?] will produce @scheme[#f] when applied + If @racket[get-write-evt] is @racket[#f], then + @racket[port-writes-atomic?] will produce @racket[#f] when applied to the port, and the port will not be a valid argument to - procedures such as @scheme[write-bytes-avail-evt]. - Otherwise, an event returned by @scheme[get-write-evt] must + procedures such as @racket[write-bytes-avail-evt]. + Otherwise, an event returned by @racket[get-write-evt] must not cause data to be written to the port unless the event is chosen in a synchronization, and it must write to the port if the event is chosen (i.e., the write must appear atomic with respect @@ -915,7 +915,7 @@ procedures. If the event's result integer is larger than the supplied byte-string range, the @exnraise[exn:fail:contract] by a wrapper on the event. If the start and end indices are the same (i.e., no - bytes are to be written), then the event should produce @scheme[0] + bytes are to be written), then the event should produce @racket[0] when the buffer is completely flushed. (If the port has no buffer, then it is effectively always flushed.) @@ -928,16 +928,16 @@ procedures. threads). The port is responsible for its own internal synchronization.} - @item{@scheme[get-write-special-evt] --- either @scheme[#f] - (the default), or a procedure to handle @scheme[write-special-evt] - calls for the port. This argument must be @scheme[#f] if either - @scheme[write-out-special] or @scheme[get-write-evt] - is @scheme[#f], and it must be a procedure if both of those + @item{@racket[get-write-special-evt] --- either @racket[#f] + (the default), or a procedure to handle @racket[write-special-evt] + calls for the port. This argument must be @racket[#f] if either + @racket[write-out-special] or @racket[get-write-evt] + is @racket[#f], and it must be a procedure if both of those arguments are procedures. If it is a procedure, it takes one argument: the special value to write. The resulting event (with its constraints) is analogous to - the result of @scheme[get-write-evt]. + the result of @racket[get-write-evt]. If the event raises an exception, due to write or commit operations, it must not have committed the special value (though @@ -945,38 +945,38 @@ procedures. - @item{@scheme[get-location] --- either @scheme[#f] (the + @item{@racket[get-location] --- either @racket[#f] (the default), or a procedure that takes no arguments and returns three values: the line number for the next item written to the port's - stream (a positive number or @scheme[#f]), the column number for + stream (a positive number or @racket[#f]), the column number for the next item written to port's stream (a non-negative number or - @scheme[#f]), and the position for the next item written to port's - stream (a positive number or @scheme[#f]). See also + @racket[#f]), and the position for the next item written to port's + stream (a positive number or @racket[#f]). See also @secref["linecol"]. - This procedure is called to implement @scheme[port-next-location] + This procedure is called to implement @racket[port-next-location] for the port, but only if line counting is enabled for the port - via @scheme[port-count-lines!] (in which case - @scheme[count-lines!] is called).} + via @racket[port-count-lines!] (in which case + @racket[count-lines!] is called).} - @item{@scheme[count-lines!] --- a procedure of no arguments + @item{@racket[count-lines!] --- a procedure of no arguments that is called if and when line counting is enabled for the port. - The default procedure is @scheme[void].} + The default procedure is @racket[void].} - @item{@scheme[init-position] --- an exact, positive integer that + @item{@racket[init-position] --- an exact, positive integer that determines the position of the port's first output item, used when line counting is @italic{not} enabled for the port. The default is - @scheme[1].} + @racket[1].} - @item{@scheme[buffer-mode] --- either @scheme[#f] (the + @item{@racket[buffer-mode] --- either @racket[#f] (the default) or a procedure that accepts zero or one arguments. If - @scheme[buffer-mode] is @scheme[#f], then the resulting + @racket[buffer-mode] is @racket[#f], then the resulting port does not support a buffer-mode setting. Otherwise, the - procedure is called with one symbol argument (@scheme['block], - @scheme['line], or @scheme['none]) to set the buffer mode, and it is + procedure is called with one symbol argument (@racket['block], + @racket['line], or @racket['none]) to set the buffer mode, and it is called with zero arguments to get the current buffer mode. In the - latter case, the result must be @scheme['block], @scheme['line], - @scheme['none], or @scheme[#f] (unknown). See @secref["port-buffers"] + latter case, the result must be @racket['block], @racket['line], + @racket['none], or @racket[#f] (unknown). See @secref["port-buffers"] for more information on buffer modes.} ] diff --git a/collects/scribblings/reference/custom-write.scrbl b/collects/scribblings/reference/custom-write.scrbl index 70746d69cd..78fee2529f 100644 --- a/collects/scribblings/reference/custom-write.scrbl +++ b/collects/scribblings/reference/custom-write.scrbl @@ -6,29 +6,29 @@ @defthing[prop:custom-write struct-type-property?]{ Associates a procedure to a structure type used by the default -printer to @scheme[display], @scheme[write], or @scheme[print] +printer to @racket[display], @racket[write], or @racket[print] instances of the structure type. @moreref["structprops"]{structure type properties} -The procedure for a @scheme[prop:custom-write] value takes three +The procedure for a @racket[prop:custom-write] value takes three arguments: the structure to be printed, the target port, and an -argument that is @scheme[#t] for @scheme[write] mode, @scheme[#f] for -@scheme[display] mode, or @scheme[0] or @scheme[1] indicating -the current @tech{quoting depth} for @scheme[print] mode. The +argument that is @racket[#t] for @racket[write] mode, @racket[#f] for +@racket[display] mode, or @racket[0] or @racket[1] indicating +the current @tech{quoting depth} for @racket[print] mode. The procedure should print the value to the given port using -@scheme[write], @scheme[display], @scheme[print], @scheme[fprintf], -@scheme[write-special], etc. +@racket[write], @racket[display], @racket[print], @racket[fprintf], +@racket[write-special], etc. The @tech{port write handler}, @tech{port display handler}, and @tech{print handler} are specially configured for a port given to a custom-write procedure. Printing to -the port through @scheme[display], @scheme[write], or @scheme[print] +the port through @racket[display], @racket[write], or @racket[print] prints a value recursively with sharing annotations. To avoid a recursive print (i.e., to print without regard to sharing with a value currently being printed), print instead to a string or pipe and -transfer the result to the target port using @scheme[write-string] or -@scheme[write-special]. To print recursively to a port other than +transfer the result to the target port using @racket[write-string] or +@racket[write-special]. To print recursively to a port other than the one given to the custom-write procedure, copy the given port's write handler, display handler, and print handler to the other port. @@ -42,10 +42,10 @@ custom-write procedure (e.g., for pretty-printing where a tentative print attempt overflows the line, or for printing error output of a limited width). -The following example definition of a @scheme[tuple] type includes +The following example definition of a @racket[tuple] type includes custom-write procedures that print the tuple's list content using -angle brackets in @scheme[write] and @scheme[print] mode and no brackets in -@scheme[display] mode. Elements of the tuple are printed recursively, +angle brackets in @racket[write] and @racket[print] mode and no brackets in +@racket[display] mode. Elements of the tuple are printed recursively, so that graph and cycle structure can be represented. @defexamples[ @@ -80,14 +80,14 @@ so that graph and cycle structure can be represented. @defproc[(custom-write? [v any/c]) boolean?]{ -Returns @scheme[#t] if @scheme[v] has the @scheme[prop:custom-write] -property, @scheme[#f] otherwise.} +Returns @racket[#t] if @racket[v] has the @racket[prop:custom-write] +property, @racket[#f] otherwise.} @defproc[(custom-write-accessor [v custom-write?]) (custom-write? output-port? boolean? . -> . any)]{ -Returns the custom-write procedure associated with @scheme[v].} +Returns the custom-write procedure associated with @racket[v].} @deftogether[( @defthing[prop:custom-print-quotable struct-type-property?] @@ -96,11 +96,11 @@ Returns the custom-write procedure associated with @scheme[v].} )]{ A property and associated predicate and accessor. The property value -is one of @scheme['self], @scheme['never], @scheme['maybe], or -@scheme['always]. When a structure has this property in addition to a -@scheme[prop:custom-write] property value, then the property value -affects printing in @scheme[print] mode; see @secref["printing"]. When -a value does not have the @scheme[prop:custom-print-quotable], it is -equivalent to having the @scheme['self] property value, which is +is one of @racket['self], @racket['never], @racket['maybe], or +@racket['always]. When a structure has this property in addition to a +@racket[prop:custom-write] property value, then the property value +affects printing in @racket[print] mode; see @secref["printing"]. When +a value does not have the @racket[prop:custom-print-quotable], it is +equivalent to having the @racket['self] property value, which is suitable both for self-quoting forms and printed forms that are unreadable.} diff --git a/collects/scribblings/reference/data.scrbl b/collects/scribblings/reference/data.scrbl index 8bb8f9393a..a962dbe73f 100644 --- a/collects/scribblings/reference/data.scrbl +++ b/collects/scribblings/reference/data.scrbl @@ -33,47 +33,47 @@ manipulating instances of the datatype. A @deftech{symbol} is like an immutable string, but symbols are normally @deftech{interned}, so that two symbols with the same -character content are normally @scheme[eq?]. All symbols produced by +character content are normally @racket[eq?]. All symbols produced by the default reader (see @secref["parse-symbol"]) are interned. -The two procedures @scheme[string->uninterned-symbol] and -@scheme[gensym] generate @deftech{uninterned} symbols, i.e., symbols -that are not @scheme[eq?], @scheme[eqv?], or @scheme[equal?] to any +The two procedures @racket[string->uninterned-symbol] and +@racket[gensym] generate @deftech{uninterned} symbols, i.e., symbols +that are not @racket[eq?], @racket[eqv?], or @racket[equal?] to any other symbol, although they may print the same as other symbols. -The procedure @scheme[string->unreadable-symbol] returns an +The procedure @racket[string->unreadable-symbol] returns an @deftech{unreadable symbol} that is partially interned. The default reader (see @secref["parse-symbol"]) never produces a unreadable -symbol, but two calls to @scheme[string->unreadable-symbol] with -@scheme[equal?] strings produce @scheme[eq?] results. An unreadable +symbol, but two calls to @racket[string->unreadable-symbol] with +@racket[equal?] strings produce @racket[eq?] results. An unreadable symbol can print the same as an interned or uninterned symbol. Unreadable symbols are useful in expansion and compilation to avoid collisions with symbols that appear in the source; they are usually not generated directly, but they can appear -in the result of functions like @scheme[identifier-binding]. +in the result of functions like @racket[identifier-binding]. Interned and unreadable symbols are only weakly held by the internal symbol table. This weakness can never affect the result of an -@scheme[eq?], @scheme[eqv?], or @scheme[equal?] test, but a symbol may +@racket[eq?], @racket[eqv?], or @racket[equal?] test, but a symbol may 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"]). -@defproc[(symbol? [v any/c]) boolean?]{Returns @scheme[#t] if @scheme[v] is - a symbol, @scheme[#f] otherwise. +@defproc[(symbol? [v any/c]) boolean?]{Returns @racket[#t] if @racket[v] is + a symbol, @racket[#f] otherwise. @examples[(symbol? 'Apple) (symbol? 10)]} -@defproc[(symbol-interned? [sym symbol?]) boolean?]{Returns @scheme[#t] if @scheme[sym] is - @tech{interned}, @scheme[#f] otherwise. +@defproc[(symbol-interned? [sym symbol?]) boolean?]{Returns @racket[#t] if @racket[sym] is + @tech{interned}, @racket[#f] otherwise. @examples[(symbol-interned? 'Apple) (symbol-interned? (gensym)) (symbol-interned? (string->unreadable-symbol "Apple"))]} -@defproc[(symbol-unreadable? [sym symbol?]) boolean?]{Returns @scheme[#t] if @scheme[sym] is - an @tech{unreadable symbol}, @scheme[#f] otherwise. +@defproc[(symbol-unreadable? [sym symbol?]) boolean?]{Returns @racket[#t] if @racket[sym] is + an @tech{unreadable symbol}, @racket[#f] otherwise. @examples[(symbol-unreadable? 'Apple) (symbol-unreadable? (gensym)) @@ -81,22 +81,22 @@ used as an ephemeron key (see @secref["ephemerons"]). @defproc[(symbol->string [sym symbol?]) string?]{Returns a freshly allocated mutable string whose characters are the same as in - @scheme[sym]. + @racket[sym]. @examples[(symbol->string 'Apple)]} @defproc[(string->symbol [str string?]) symbol?]{Returns an @tech{interned} symbol whose characters are the same as in - @scheme[str]. + @racket[str]. @examples[(string->symbol "Apple") (string->symbol "1")]} @defproc[(string->uninterned-symbol [str string?]) symbol?]{Like - @scheme[(string->symbol str)], but the resulting symbol is a new - @tech{uninterned} symbol. Calling @scheme[string->uninterned-symbol] - twice with the same @scheme[str] returns two distinct symbols. + @racket[(string->symbol str)], but the resulting symbol is a new + @tech{uninterned} symbol. Calling @racket[string->uninterned-symbol] + twice with the same @racket[str] returns two distinct symbols. @examples[(string->uninterned-symbol "Apple") (eq? 'a (string->uninterned-symbol "a")) @@ -105,10 +105,10 @@ used as an ephemeron key (see @secref["ephemerons"]). @defproc[(string->unreadable-symbol [str string?]) symbol?]{Like - @scheme[(string->symbol str)], but the resulting symbol is a new - @tech{unreadable symbol}. Calling @scheme[string->unreadable-symbol] - twice with equivalent @scheme[str]s returns the same symbol, but - @scheme[read] never produces the symbol. + @racket[(string->symbol str)], but the resulting symbol is a new + @tech{unreadable symbol}. Calling @racket[string->unreadable-symbol] + twice with equivalent @racket[str]s returns the same symbol, but + @racket[read] never produces the symbol. @examples[(string->unreadable-symbol "Apple") (eq? 'a (string->unreadable-symbol "a")) @@ -118,7 +118,7 @@ used as an ephemeron key (see @secref["ephemerons"]). @defproc[(gensym [base (or/c string? symbol?) "g"]) symbol?]{Returns a new @tech{uninterned} symbol with an automatically-generated name. The - optional @scheme[base] argument is a prefix symbol or string.} + optional @racket[base] argument is a prefix symbol or string.} @examples[(gensym "apple")] @@ -133,33 +133,33 @@ used as an ephemeron key (see @secref["ephemerons"]). A @deftech{keyword} is like an @tech{interned} symbol, but its printed form starts with @litchar{#:}, and a keyword cannot be used as an identifier. Furthermore, a keyword by itself is not a valid -expression, though a keyword can be @scheme[quote]d to form an +expression, though a keyword can be @racket[quote]d to form an expression that produces the symbol. -Two keywords are @scheme[eq?] if and only if they print the same. +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. @defproc[(keyword? [v any/c]) boolean?]{ -Returns @scheme[#t] if @scheme[v] is a keyword, @scheme[#f] otherwise.} +Returns @racket[#t] if @racket[v] is a keyword, @racket[#f] otherwise.} @defproc[(keyword->string [keyword keyword?]) string?]{ -Returns a string for the @scheme[display]ed form of @scheme[keyword], +Returns a string for the @racket[display]ed form of @racket[keyword], not including the leading @litchar{#:}.} @defproc[(string->keyword [str string?]) keyword?]{ -Returns a keyword whose @scheme[display]ed form is the same as that of -@scheme[str], but with a leading @litchar{#:}.} +Returns a keyword whose @racket[display]ed form is the same as that of +@racket[str], but with a leading @litchar{#:}.} @defproc[(keywordstring] and @scheme[stringstring] and @racket[string . any/c)] [failure-result any/c (lambda () (raise (make-exn:fail ....)))]) void?]{ -Composes @scheme[dict-ref] and @scheme[dict-set!] to update an -existing mapping in @scheme[dict], where the optional @racket[failure-result] +Composes @racket[dict-ref] and @racket[dict-set!] to update an +existing mapping in @racket[dict], where the optional @racket[failure-result] argument is used as in @racket[dict-ref] when no mapping exists for @racket[key] already. @@ -280,8 +280,8 @@ v [failure-result any/c (lambda () (raise (make-exn:fail ....)))]) (and/c dict? immutable?)]{ -Composes @scheme[dict-ref] and @scheme[dict-set] to functionally -update an existing mapping in @scheme[dict], where the optional @racket[failure-result] +Composes @racket[dict-ref] and @racket[dict-set] to functionally +update an existing mapping in @racket[dict], where the optional @racket[failure-result] argument is used as in @racket[dict-ref] when no mapping exists for @racket[key] already. @@ -297,8 +297,8 @@ argument is used as in @racket[dict-ref] when no mapping exists for [key any/c]) void?]{ -Removes any existing mapping for @scheme[key] in @scheme[dict]. The -update can fail if @scheme[dict] is not mutable or does not support +Removes any existing mapping for @racket[key] in @racket[dict]. The +update can fail if @racket[dict] is not mutable or does not support removing keys (as is the case for @tech{vectors}, for example). @examples[ @@ -314,9 +314,9 @@ h]} [key any/c]) (and/c dict? immutable?)]{ -Functionally removes any existing mapping for @scheme[key] in -@scheme[dict], returning the fresh dictionary. The update can fail -if @scheme[dict] does not support functional update or does not +Functionally removes any existing mapping for @racket[key] in +@racket[dict], returning the fresh dictionary. The update can fail +if @racket[dict] does not support functional update or does not support removing keys. @examples[ @@ -335,9 +335,9 @@ h [proc (any/c any/c . -> . any/c)]) (listof any/c)]{ -Applies the procedure @scheme[proc] to each element in -@scheme[dict] in an unspecified order, accumulating the results -into a list. The procedure @scheme[proc] is called each time with a +Applies the procedure @racket[proc] to each element in +@racket[dict] in an unspecified order, accumulating the results +into a list. The procedure @racket[proc] is called each time with a key and its value. @examples[ @@ -350,9 +350,9 @@ key and its value. [proc (any/c any/c . -> . any)]) void?]{ -Applies @scheme[proc] to each element in @scheme[dict] (for the -side-effects of @scheme[proc]) in an unspecified order. The procedure -@scheme[proc] is called each time with a key and its value. +Applies @racket[proc] to each element in @racket[dict] (for the +side-effects of @racket[proc]) in an unspecified order. The procedure +@racket[proc] is called each time with a key and its value. @examples[ #:eval dict-eval @@ -365,7 +365,7 @@ side-effects of @scheme[proc]) in an unspecified order. The procedure @defproc[(dict-count [dict dict?]) exact-nonnegative-integer?]{ -Returns the number of keys mapped by @scheme[dict], usually in +Returns the number of keys mapped by @racket[dict], usually in constant time. @examples[ @@ -377,12 +377,12 @@ constant time. @defproc[(dict-iterate-first [dict dict?]) any/c]{ -Returns @scheme[#f] if @scheme[dict] contains no elements, otherwise -it returns a non-@scheme[#f] value that is an index to the first +Returns @racket[#f] if @racket[dict] contains no elements, otherwise +it returns a non-@racket[#f] value that is an index to the first element in the dict table; ``first'' refers to an unspecified ordering -of the dictionary elements. For a mutable @scheme[dict], this index is +of the dictionary elements. For a mutable @racket[dict], this index is guaranteed to refer to the first item only as long as no mappings are -added to or removed from @scheme[dict]. +added to or removed from @racket[dict]. @examples[ #:eval dict-eval @@ -397,13 +397,13 @@ added to or removed from @scheme[dict]. [pos any/c]) any/c]{ -Returns either a non-@scheme[#f] that is an index to the element in -@scheme[dict] after the element indexed by @scheme[pos] or @scheme[#f] -if @scheme[pos] refers to the last element in @scheme[dict]. If -@scheme[pos] is not a valid index, then the -@exnraise[exn:fail:contract]. For a mutable @scheme[dict], the result +Returns either a non-@racket[#f] that is an index to the element in +@racket[dict] after the element indexed by @racket[pos] or @racket[#f] +if @racket[pos] refers to the last element in @racket[dict]. If +@racket[pos] is not a valid index, then the +@exnraise[exn:fail:contract]. For a mutable @racket[dict], the result index is guaranteed to refer to its item only as long as no items are -added to or removed from @scheme[dict]. The @scheme[dict-iterate-next] +added to or removed from @racket[dict]. The @racket[dict-iterate-next] operation should take constant time. @examples[ @@ -420,9 +420,9 @@ i [pos any/c]) any]{ -Returns the key for the element in @scheme[dict] at index -@scheme[pos]. If @scheme[pos] is not a valid index for @scheme[dict], -the @exnraise[exn:fail:contract]. The @scheme[dict-iterate-key] +Returns the key for the element in @racket[dict] at index +@racket[pos]. If @racket[pos] is not a valid index for @racket[dict], +the @exnraise[exn:fail:contract]. The @racket[dict-iterate-key] operation should take constant time. @examples[ @@ -439,9 +439,9 @@ operation should take constant time. [pos any/c]) any]{ -Returns the value for the element in @scheme[dict] at index -@scheme[pos]. If @scheme[pos] is not a valid index for @scheme[dict], -the @exnraise[exn:fail:contract]. The @scheme[dict-iterate-key] +Returns the value for the element in @racket[dict] at index +@racket[pos]. If @racket[pos] is not a valid index for @racket[dict], +the @exnraise[exn:fail:contract]. The @racket[dict-iterate-key] operation should take constant time. @examples[ @@ -455,7 +455,7 @@ operation should take constant time. @defproc[(in-dict [dict dict?]) sequence?]{ Returns a @tech{sequence} whose each element is two values: a key and corresponding value from -@scheme[dict]. +@racket[dict]. @examples[ #:eval dict-eval @@ -466,7 +466,7 @@ whose each element is two values: a key and corresponding value from @defproc[(in-dict-keys [dict dict?]) sequence?]{ -Returns a sequence whose elements are the keys of @scheme[dict]. +Returns a sequence whose elements are the keys of @racket[dict]. @examples[ #:eval dict-eval @@ -476,7 +476,7 @@ Returns a sequence whose elements are the keys of @scheme[dict]. ]} @defproc[(in-dict-values [dict dict?]) sequence?]{ -Returns a sequence whose elements are the values of @scheme[dict]. +Returns a sequence whose elements are the values of @racket[dict]. @examples[ #:eval dict-eval @@ -487,7 +487,7 @@ Returns a sequence whose elements are the values of @scheme[dict]. @defproc[(in-dict-pairs [dict dict?]) sequence?]{ Returns a sequence whose elements are pairs, each containing a key and its value from -@scheme[dict] (as opposed to using @scheme[in-dict], which gets the +@racket[dict] (as opposed to using @racket[in-dict], which gets the key and value as separate values for each element). @examples[ @@ -499,7 +499,7 @@ key and value as separate values for each element). @defproc[(dict-keys [dict dict?]) list?]{ Returns a list of the keys from -@scheme[dict] in an unspecified order. +@racket[dict] in an unspecified order. @examples[ #:eval dict-eval @@ -509,7 +509,7 @@ Returns a list of the keys from @defproc[(dict-values [dict dict?]) list?]{ Returns a list of the values from -@scheme[dict] in an unspecified order. +@racket[dict] in an unspecified order. @examples[ #:eval dict-eval @@ -519,7 +519,7 @@ Returns a list of the values from @defproc[(dict->list [dict dict?]) list?]{ Returns a list of the associations from -@scheme[dict] in an unspecified order. +@racket[dict] in an unspecified order. @examples[ #:eval dict-eval @@ -537,43 +537,43 @@ that has the property: @itemize[ - @item{@scheme[_ref] : a procedure like @scheme[dict-ref] that accepts + @item{@racket[_ref] : a procedure like @racket[dict-ref] that accepts either two or three arguments} - @item{@scheme[_set!] : a procedure like @scheme[dict-set!] that accepts - three arguments, or @scheme[#f] if mutation is not supported} + @item{@racket[_set!] : a procedure like @racket[dict-set!] that accepts + three arguments, or @racket[#f] if mutation is not supported} - @item{@scheme[_set] : a procedure like @scheme[dict-set] that accepts + @item{@racket[_set] : a procedure like @racket[dict-set] that accepts three arguments and returns an updated dictionary, or - @scheme[#f] if functional update is not supported} + @racket[#f] if functional update is not supported} - @item{@scheme[_remove!] : a procedure like @scheme[dict-remove!] that - accepts two arguments, or @scheme[#f] if mutation is not + @item{@racket[_remove!] : a procedure like @racket[dict-remove!] that + accepts two arguments, or @racket[#f] if mutation is not supported or if key removal is not supported} - @item{@scheme[_remove] : a procedure like @scheme[dict-remove] that + @item{@racket[_remove] : a procedure like @racket[dict-remove] that accepts two arguments and returns an updated dictionary, or - @scheme[#f] if functional update or key removal is not + @racket[#f] if functional update or key removal is not supported} - @item{@scheme[_count] : a procedure like @scheme[dict-count] that accepts + @item{@racket[_count] : a procedure like @racket[dict-count] that accepts one argument} - @item{@scheme[_iterate-first] : a procedure like - @scheme[dict-iterate-first] that accepts one argument} + @item{@racket[_iterate-first] : a procedure like + @racket[dict-iterate-first] that accepts one argument} - @item{@scheme[_iterate-next] : a procedure like - @scheme[dict-iterate-next] that accepts two arguments; the + @item{@racket[_iterate-next] : a procedure like + @racket[dict-iterate-next] that accepts two arguments; the procedure is responsible for checking that the second argument is a valid position for the first argument} - @item{@scheme[_iterate-key] : a procedure like - @scheme[dict-iterate-key] that accepts two arguments; the + @item{@racket[_iterate-key] : a procedure like + @racket[dict-iterate-key] that accepts two arguments; the procedure is responsible for checking that the second argument is a valid position for the first argument} - @item{@scheme[_iterate-value] : a procedure like - @scheme[dict-iterate-value] that accepts two arguments; the + @item{@racket[_iterate-value] : a procedure like + @racket[dict-iterate-value] that accepts two arguments; the procedure is responsible for checking that the second argument is a valid position for the first argument} @@ -631,23 +631,23 @@ iterators, respectively, if @racket[d] implements the )]{ Creates a dictionary that is implemented in terms of a hash table -where keys are compared with @scheme[eql?] and hashed with -@scheme[hash-proc] and @scheme[hash2-proc]. See -@scheme[prop:equal+hash] for information on suitable equality and +where keys are compared with @racket[eql?] and hashed with +@racket[hash-proc] and @racket[hash2-proc]. See +@racket[prop:equal+hash] for information on suitable equality and hashing functions. -The @scheme[make-custom-hash] and @scheme[make-weak-custom-hash] +The @racket[make-custom-hash] and @racket[make-weak-custom-hash] functions create a mutable dictionary that does not support functional -update, while @scheme[make-immutable-custom-hash] creates an immutable +update, while @racket[make-immutable-custom-hash] creates an immutable dictionary that supports functional update. The dictionary created by -@scheme[make-weak-custom-hash] retains its keys weakly, like the result -of @scheme[make-weak-hash]. +@racket[make-weak-custom-hash] retains its keys weakly, like the result +of @racket[make-weak-hash]. -Dictionaries created by @scheme[make-custom-hash] and company are -@scheme[equal?] when they have the same mutability and key strength, -the associated procedures are @scheme[equal?], and the key--value +Dictionaries created by @racket[make-custom-hash] and company are +@racket[equal?] when they have the same mutability and key strength, +the associated procedures are @racket[equal?], and the key--value mappings are the same when keys and values are compared with -@scheme[equal?]. +@racket[equal?]. @examples[ #:eval dict-eval diff --git a/collects/scribblings/reference/filesystem.scrbl b/collects/scribblings/reference/filesystem.scrbl index dcc3ef2188..a21b0141f4 100644 --- a/collects/scribblings/reference/filesystem.scrbl +++ b/collects/scribblings/reference/filesystem.scrbl @@ -421,7 +421,7 @@ directory is not deleted successfully, the @defproc[(directory-list [path path-string? (current-directory)]) (listof path?)]{ -@margin-note{See also the @scheme[in-directory] sequence constructor.} +@margin-note{See also the @racket[in-directory] sequence constructor.} Returns a list of all files and directories in the directory specified by @racket[path]. On Windows, an element of the list may start with @@ -1105,15 +1105,15 @@ to the file portion of the path. (make-lock-file-name "/home/george/project/important-file")]} @deftogether[( -@defthing[user-read-bit @#,schemevalfont{#o400}] -@defthing[user-write-bit @#,schemevalfont{#o200}] -@defthing[user-execute-bit @#,schemevalfont{#o100}] -@defthing[group-read-bit @#,schemevalfont{#o040}] -@defthing[group-write-bit @#,schemevalfont{#o020}] -@defthing[group-execute-bit @#,schemevalfont{#o010}] -@defthing[other-read-bit @#,schemevalfont{#o004}] -@defthing[other-write-bit @#,schemevalfont{#o002}] -@defthing[other-execute-bit @#,schemevalfont{#o001}] +@defthing[user-read-bit @#,racketvalfont{#o400}] +@defthing[user-write-bit @#,racketvalfont{#o200}] +@defthing[user-execute-bit @#,racketvalfont{#o100}] +@defthing[group-read-bit @#,racketvalfont{#o040}] +@defthing[group-write-bit @#,racketvalfont{#o020}] +@defthing[group-execute-bit @#,racketvalfont{#o010}] +@defthing[other-read-bit @#,racketvalfont{#o004}] +@defthing[other-write-bit @#,racketvalfont{#o002}] +@defthing[other-execute-bit @#,racketvalfont{#o001}] )]{ Constants that are useful with @racket[file-or-directory-permissions] diff --git a/collects/scribblings/reference/fixnums.scrbl b/collects/scribblings/reference/fixnums.scrbl index 2017884995..30e8bc8873 100644 --- a/collects/scribblings/reference/fixnums.scrbl +++ b/collects/scribblings/reference/fixnums.scrbl @@ -174,7 +174,7 @@ elements of @racket[vec] from @racket[start] (inclusive) to @defform*[((for*/fxvector (for-clause ...) body ...) (for*/fxvector #:length length-expr (for-clause ...) body ...))])]{ -Like @scheme[for/vector] or @scheme[for*/vector], but for +Like @racket[for/vector] or @racket[for*/vector], but for @tech{fxvector}s.} @defproc[(shared-fxvector [x fixnum?] ...) fxvector?]{ diff --git a/collects/scribblings/reference/flonums.scrbl b/collects/scribblings/reference/flonums.scrbl index 5f2e8916de..5f75bf75b6 100644 --- a/collects/scribblings/reference/flonums.scrbl +++ b/collects/scribblings/reference/flonums.scrbl @@ -192,7 +192,7 @@ elements of @racket[vec] from @racket[start] (inclusive) to @defform*[((for*/flvector (for-clause ...) body ...) (for*/flvector #:length length-expr (for-clause ...) body ...))])]{ -Like @scheme[for/vector] or @scheme[for*/vector], but for +Like @racket[for/vector] or @racket[for*/vector], but for @tech{flvector}s.} @defproc[(shared-flvector [x flonum?] ...) flvector?]{ diff --git a/collects/scribblings/reference/for.scrbl b/collects/scribblings/reference/for.scrbl index 2749a870ac..95328bf748 100644 --- a/collects/scribblings/reference/for.scrbl +++ b/collects/scribblings/reference/for.scrbl @@ -1,11 +1,11 @@ #lang scribble/doc @(require "mz.rkt") -@title[#:tag "for"]{Iterations and Comprehensions: @scheme[for], @scheme[for/list], ...} +@title[#:tag "for"]{Iterations and Comprehensions: @racket[for], @racket[for/list], ...} @guideintro["for"]{iterations and comprehensions} -The @scheme[for] iteration forms are based on SRFI-42 +The @racket[for] iteration forms are based on SRFI-42 @cite["SRFI-42"]. @@ -18,45 +18,45 @@ The @scheme[for] iteration forms are based on SRFI-42 (code:line #:unless guard-expr)]) #:contracts ([seq-expr sequence?])]{ -Iteratively evaluates @scheme[body]. The @scheme[for-clause]s -introduce bindings whose scope includes @scheme[body] and that -determine the number of times that @scheme[body] is evaluated. +Iteratively evaluates @racket[body]. The @racket[for-clause]s +introduce bindings whose scope includes @racket[body] and that +determine the number of times that @racket[body] is evaluated. -In the simple case, each @scheme[for-clause] has one of its first two -forms, where @scheme[[id seq-expr]] is a shorthand for @scheme[[(id) -seq-expr]]. In this simple case, the @scheme[seq-expr]s are evaluated +In the simple case, each @racket[for-clause] has one of its first two +forms, where @racket[[id seq-expr]] is a shorthand for @racket[[(id) +seq-expr]]. In this simple case, the @racket[seq-expr]s are evaluated left-to-right, and each must produce a sequence value (see @secref["sequences"]). -The @scheme[for] form iterates by drawing an element from each +The @racket[for] form iterates by drawing an element from each sequence; if any sequence is empty, then the iteration stops, and -@|void-const| is the result of the @scheme[for] expression. Otherwise -a location is created for each @scheme[id] to hold the values of each -element; the sequence produced by a @scheme[seq-expr] must return as -many values for each iteration as corresponding @scheme[id]s. +@|void-const| is the result of the @racket[for] expression. Otherwise +a location is created for each @racket[id] to hold the values of each +element; the sequence produced by a @racket[seq-expr] must return as +many values for each iteration as corresponding @racket[id]s. -The @scheme[id]s are then bound in the @scheme[body], which is +The @racket[id]s are then bound in the @racket[body], which is evaluated, and whose results are ignored. Iteration continues with the next element in each sequence and with fresh locations for each -@scheme[id]. +@racket[id]. -A @scheme[for] form with zero @scheme[for-clause]s is equivalent to a -single @scheme[for-clause] that binds an unreferenced @scheme[id] to -a sequence containing a single element. All of the @scheme[id]s must -be distinct according to @scheme[bound-identifier=?]. +A @racket[for] form with zero @racket[for-clause]s is equivalent to a +single @racket[for-clause] that binds an unreferenced @racket[id] to +a sequence containing a single element. All of the @racket[id]s must +be distinct according to @racket[bound-identifier=?]. -If any @scheme[for-clause] has the form @scheme[#:when guard-expr], -then only the preceding clauses (containing no @scheme[#:when] or @scheme[#:unless]) -determine iteration as above, and the @scheme[body] is effectively +If any @racket[for-clause] has the form @racket[#:when guard-expr], +then only the preceding clauses (containing no @racket[#:when] or @racket[#:unless]) +determine iteration as above, and the @racket[body] is effectively wrapped as -@schemeblock[ +@racketblock[ (when guard-expr (for (for-clause ...) body ...+)) ] -using the remaining @scheme[for-clauses]. A @scheme[for-clause] of -the form @scheme[#:unless guard-expr] corresponds to the same transformation +using the remaining @racket[for-clauses]. A @racket[for-clause] of +the form @racket[#:unless guard-expr] corresponds to the same transformation with @racket[unless] in place of @racket[when]. @examples[ @@ -74,10 +74,10 @@ with @racket[unless] in place of @racket[when]. ]} @defform[(for/list (for-clause ...) body ...+)]{ Iterates like -@scheme[for], but that the last expression in the @scheme[body]s must -produce a single value, and the result of the @scheme[for/list] +@racket[for], but that the last expression in the @racket[body]s must +produce a single value, and the result of the @racket[for/list] expression is a list of the results in order. -When evaluation of a @scheme[body] is skipped due to a @racket[#:when] +When evaluation of a @racket[body] is skipped due to a @racket[#:when] or @racket[#:unless] clause, the result list includes no corresponding element. @@ -95,17 +95,17 @@ element. @defform*[((for/vector (for-clause ...) body ...+) (for/vector #:length length-expr (for-clause ...) body ...+))]{ -Iterates like @scheme[for/list], but the result are accumulated into -a vector instead of a list. If the optional @scheme[#:length] -form is used, then @scheme[length-expr] must evaluate to an -@scheme[exact-nonnegative-integer?], and the result vector is +Iterates like @racket[for/list], but the result are accumulated into +a vector instead of a list. If the optional @racket[#:length] +form is used, then @racket[length-expr] must evaluate to an +@racket[exact-nonnegative-integer?], and the result vector is constructed with this length. In this case, the iteration can be performed more efficiently, and terminates when the vector is full or the requested number of iterations have been performed, whichever -comes first. If the provided @scheme[length-expr] evaluates to a +comes first. If the provided @racket[length-expr] evaluates to a length longer than the number of iterations then the remaining slots of the vector are intialized to the default argument of -@scheme[make-vector].} +@racket[make-vector].} @deftogether[( @defform[(for/hash (for-clause ...) body ...+)] @@ -113,11 +113,11 @@ of the vector are intialized to the default argument of @defform[(for/hasheqv (for-clause ...) body ...+)] )]{ -Like @scheme[for/list], but the result is an immutable @tech{hash -table}; @scheme[for/hash] creates a table using @scheme[equal?] to -distinguish keys, @scheme[for/hasheq] produces a table using -@scheme[eq?], and @scheme[for/hasheqv] produces a table using -@scheme[eqv?]. The last expression in the @scheme[body]s must return +Like @racket[for/list], but the result is an immutable @tech{hash +table}; @racket[for/hash] creates a table using @racket[equal?] to +distinguish keys, @racket[for/hasheq] produces a table using +@racket[eq?], and @racket[for/hasheqv] produces a table using +@racket[eqv?]. The last expression in the @racket[body]s must return two values: a key and a value to extend the hash table accumulated by the iteration. @@ -128,12 +128,12 @@ the iteration. @defform[(for/and (for-clause ...) body ...+)]{ Iterates like -@scheme[for], but when last expression of @scheme[body] produces -@scheme[#f], then iteration terminates, and the result of the -@scheme[for/and] expression is @scheme[#f]. If the @scheme[body] -is never evaluated, then the result of the @scheme[for/and] -expression is @scheme[#t]. Otherwise, the result is the (single) -result from the last evaluation of @scheme[body]. +@racket[for], but when last expression of @racket[body] produces +@racket[#f], then iteration terminates, and the result of the +@racket[for/and] expression is @racket[#f]. If the @racket[body] +is never evaluated, then the result of the @racket[for/and] +expression is @racket[#t]. Otherwise, the result is the (single) +result from the last evaluation of @racket[body]. @examples[ (for/and ([i '(1 2 3 "x")]) @@ -145,12 +145,12 @@ result from the last evaluation of @scheme[body]. ]} @defform[(for/or (for-clause ...) body ...+)]{ Iterates like -@scheme[for], but when last expression of @scheme[body] produces -a value other than @scheme[#f], then iteration terminates, and -the result of the @scheme[for/or] expression is the same -(single) value. If the @scheme[body] is never evaluated, then the -result of the @scheme[for/or] expression is -@scheme[#f]. Otherwise, the result is @scheme[#f]. +@racket[for], but when last expression of @racket[body] produces +a value other than @racket[#f], then iteration terminates, and +the result of the @racket[for/or] expression is the same +(single) value. If the @racket[body] is never evaluated, then the +result of the @racket[for/or] expression is +@racket[#f]. Otherwise, the result is @racket[#f]. @examples[ (for/or ([i '(1 2 3 "x")]) @@ -164,19 +164,19 @@ result of the @scheme[for/or] expression is @defform[(for/lists (id ...) (for-clause ...) body ...+)]{ -Similar to @scheme[for/list], but the last @scheme[body] expression -should produce as many values as given @scheme[id]s, and the result is -as many lists as supplied @scheme[id]s. The @scheme[id]s are bound to -the lists accumulated so far in the @scheme[for-clause]s and -@scheme[body]s.} +Similar to @racket[for/list], but the last @racket[body] expression +should produce as many values as given @racket[id]s, and the result is +as many lists as supplied @racket[id]s. The @racket[id]s are bound to +the lists accumulated so far in the @racket[for-clause]s and +@racket[body]s.} @defform[(for/first (for-clause ...) body ...+)]{ Iterates like -@scheme[for], but after @scheme[body] is evaluated the first -time, then the iteration terminates, and the @scheme[for/first] -result is the (single) result of @scheme[body]. If the -@scheme[body] is never evaluated, then the result of the -@scheme[for/first] expression is @scheme[#f]. +@racket[for], but after @racket[body] is evaluated the first +time, then the iteration terminates, and the @racket[for/first] +result is the (single) result of @racket[body]. If the +@racket[body] is never evaluated, then the result of the +@racket[for/first] expression is @racket[#f]. @examples[ (for/first ([i '(1 2 3 "x")] @@ -187,10 +187,10 @@ result is the (single) result of @scheme[body]. If the ]} @defform[(for/last (for-clause ...) body ...+)]{ Iterates like -@scheme[for], but the @scheme[for/last] result is the (single) -result of the last evaluation of @scheme[body]. If the -@scheme[body] is never evaluated, then the result of the -@scheme[for/last] expression is @scheme[#f]. +@racket[for], but the @racket[for/last] result is the (single) +result of the last evaluation of @racket[body]. If the +@racket[body] is never evaluated, then the result of the +@racket[for/last] expression is @racket[#f]. @examples[ (for/last ([i '(1 2 3 4 5)] @@ -202,14 +202,14 @@ result of the last evaluation of @scheme[body]. If the @defform[(for/fold ([accum-id init-expr] ...) (for-clause ...) . body)]{ -Iterates like @scheme[for]. Before iteration starts, the -@scheme[init-expr]s are evaluated to produce initial accumulator +Iterates like @racket[for]. Before iteration starts, the +@racket[init-expr]s are evaluated to produce initial accumulator values. At the start of each iteration, a location is generated -for each @scheme[accum-id], and the corresponding current accumulator +for each @racket[accum-id], and the corresponding current accumulator value is placed into the location. The last expression in -@scheme[body] must produce as many values as @scheme[accum-id]s, and +@racket[body] must produce as many values as @racket[accum-id]s, and those values become the current accumulator values. When iteration -terminates, the results of the @scheme[fold/for] expression are the +terminates, the results of the @racket[fold/for] expression are the accumulator values. @examples[ @@ -220,8 +220,8 @@ accumulator values. ]} @defform[(for* (for-clause ...) body ...+)]{ -Like @scheme[for], but with an implicit @scheme[#:when #t] between -each pair of @scheme[for-clauses], so that all sequence iterations are +Like @racket[for], but with an implicit @racket[#:when #t] between +each pair of @racket[for-clauses], so that all sequence iterations are nested. @examples[ @@ -245,8 +245,8 @@ nested. @defform[(for*/fold ([accum-id init-expr] ...) (for-clause ...) body ...+)] )]{ -Like @scheme[for/list], etc., but with the implicit nesting of -@scheme[for*]. +Like @racket[for/list], etc., but with the implicit nesting of +@racket[for*]. @examples[ (for*/list ([i '(1 2)] @@ -259,7 +259,7 @@ Like @scheme[for/list], etc., but with the implicit nesting of @defform[(for/fold/derived orig-datum ([accum-id init-expr] ...) (for-clause ...) body ...+)]{ -Like @scheme[for/fold], but the extra @scheme[orig-datum] is used as the source for all syntax errors. +Like @racket[for/fold], but the extra @racket[orig-datum] is used as the source for all syntax errors. @mz-examples[ (define-syntax (for/digits stx) @@ -287,7 +287,7 @@ Like @scheme[for/fold], but the extra @scheme[orig-datum] is used as the source @defform[(for*/fold/derived orig-datum ([accum-id init-expr] ...) (for-clause ...) body ...+)]{ -Like @scheme[for*/fold], but the extra @scheme[orig-datum] is used as the source for all syntax errors. +Like @racket[for*/fold], but the extra @racket[orig-datum] is used as the source for all syntax errors. @mz-examples[ (define-syntax (for*/digits stx) @@ -322,29 +322,29 @@ Like @scheme[for*/fold], but the extra @scheme[orig-datum] is used as the source (syntax? . -> . syntax?))] [clause-transform-expr (syntax? . -> . syntax?)])]{ -Defines @scheme[id] as syntax. An @scheme[(id . _rest)] form is +Defines @racket[id] as syntax. An @racket[(id . _rest)] form is treated specially when used to generate a sequence in a -@scheme[_clause] of @scheme[for] (or one of its variants). In that -case, the procedure result of @scheme[clause-transform-expr] is called +@racket[_clause] of @racket[for] (or one of its variants). In that +case, the procedure result of @racket[clause-transform-expr] is called to transform the clause. -When @scheme[id] is used in any other expression position, the result -of @scheme[expr-transform-expr] is used. If it is a procedure of zero -arguments, then the result must be an identifier @scheme[_other-id], -and any use of @scheme[id] is converted to a use of -@scheme[_other-id]. Otherwise,@scheme[expr-transform-expr] must +When @racket[id] is used in any other expression position, the result +of @racket[expr-transform-expr] is used. If it is a procedure of zero +arguments, then the result must be an identifier @racket[_other-id], +and any use of @racket[id] is converted to a use of +@racket[_other-id]. Otherwise,@racket[expr-transform-expr] must produce a procedure (of one argument) that is used as a macro transformer. -When the @scheme[clause-transform-expr] transformer is used, it is -given a @scheme[_clause] as an argument, where the clause's form is +When the @racket[clause-transform-expr] transformer is used, it is +given a @racket[_clause] as an argument, where the clause's form is normalized so that the left-hand side is a parenthesized sequence of -identifiers. The right-hand side is of the form @scheme[(id . _rest)]. -The result can be either @scheme[#f], to indicate that the forms +identifiers. The right-hand side is of the form @racket[(id . _rest)]. +The result can be either @racket[#f], to indicate that the forms should not be treated specially (perhaps because the number of bound -identifiers is inconsistent with the @scheme[(id . _rest)] form), or a -new @scheme[_clause] to replace the given one. The new clause might -use @scheme[:do-in].} +identifiers is inconsistent with the @racket[(id . _rest)] form), or a +new @racket[_clause] to replace the given one. The new clause might +use @racket[:do-in].} @mz-examples[ (define-sequence-syntax in-digits @@ -381,13 +381,13 @@ use @scheme[:do-in].} post-guard (loop-arg ...))]{ -A form that can only be used as a @scheme[_seq-expr] in a -@scheme[_clause] of @scheme[for] (or one of its variants). +A form that can only be used as a @racket[_seq-expr] in a +@racket[_clause] of @racket[for] (or one of its variants). -Within a @scheme[for], the pieces of the @scheme[:do-in] form are +Within a @racket[for], the pieces of the @racket[:do-in] form are spliced into the iteration essentially as follows: -@schemeblock[ +@racketblock[ (let-values ([(outer-id ...) outer-expr] ...) outer-check (let loop ([loop-id loop-expr] ...) @@ -402,13 +402,13 @@ spliced into the iteration essentially as follows: _done-expr))) ] -where @scheme[_body-bindings] and @scheme[_done-expr] are from the -context of the @scheme[:do-in] use. The identifiers bound by the -@scheme[for] clause are typically part of the @scheme[([(inner-id ...) +where @racket[_body-bindings] and @racket[_done-expr] are from the +context of the @racket[:do-in] use. The identifiers bound by the +@racket[for] clause are typically part of the @racket[([(inner-id ...) inner-expr] ...)] section. -The actual @scheme[loop] binding and call has additional loop -arguments to support iterations in parallel with the @scheme[:do-in] +The actual @racket[loop] binding and call has additional loop +arguments to support iterations in parallel with the @racket[:do-in] form, and the other pieces are similarly accompanied by pieces from parallel iterations.} @@ -422,25 +422,25 @@ For an example of @racket[:do-in], see @racket[define-sequence-syntax] above. ([step-expr-maybe code:blank step-expr])]{ -Iteratively evaluates the @scheme[expr]s for as long as -@scheme[stop?-expr] returns @scheme[#f]. +Iteratively evaluates the @racket[expr]s for as long as +@racket[stop?-expr] returns @racket[#f]. -To initialize the loop, the @scheme[init-expr]s are evaluated in order -and bound to the corresponding @scheme[id]s. The @scheme[id]s are +To initialize the loop, the @racket[init-expr]s are evaluated in order +and bound to the corresponding @racket[id]s. The @racket[id]s are bound in all expressions within the form other than the -@scheme[init-expr]s. +@racket[init-expr]s. -After the @scheme[id]s have been bound, the @scheme[stop?-expr] is -evaluated. If it produces @scheme[#f], each @scheme[expr] is evaluated -for its side-effect. The @scheme[id]s are then effectively updated -with the values of the @scheme[step-expr]s, where the default -@scheme[step-expr] for @scheme[id] is just @scheme[id]; more +After the @racket[id]s have been bound, the @racket[stop?-expr] is +evaluated. If it produces @racket[#f], each @racket[expr] is evaluated +for its side-effect. The @racket[id]s are then effectively updated +with the values of the @racket[step-expr]s, where the default +@racket[step-expr] for @racket[id] is just @racket[id]; more precisely, iteration continues with fresh locations for the -@scheme[id]s that are initialized with the values of the corresponding -@scheme[step-expr]s. +@racket[id]s that are initialized with the values of the corresponding +@racket[step-expr]s. -When @scheme[stop?-expr] produces a true value, then the -@scheme[finish-expr]s are evaluated in order, and the last one is +When @racket[stop?-expr] produces a true value, then the +@racket[finish-expr]s are evaluated in order, and the last one is evaluated in tail position to produce the overall value for the -@scheme[do] form. If no @scheme[finish-expr] is provided, the value of -the @scheme[do] form is @|void-const|.} +@racket[do] form. If no @racket[finish-expr] is provided, the value of +the @racket[do] form is @|void-const|.} diff --git a/collects/scribblings/reference/hashes.scrbl b/collects/scribblings/reference/hashes.scrbl index f1e45ebbbd..9266a1d623 100644 --- a/collects/scribblings/reference/hashes.scrbl +++ b/collects/scribblings/reference/hashes.scrbl @@ -19,7 +19,7 @@ A @deftech{hash table} (or simply @deftech{hash}) maps each of its keys to a single value. For a given hash table, keys are equivalent -via @scheme[equal?], @scheme[eqv?], or @scheme[eq?], and keys are +via @racket[equal?], @racket[eqv?], or @racket[eq?], and keys are retained either strongly or weakly (see @secref["weakbox"]). A hash table is also either mutable or immutable. Immutable hash tables support effectively constant-time access and update, just like mutable @@ -37,75 +37,75 @@ A hash table can be used as a two-valued @tech{sequence} (see elements of the sequence (i.e., each element is a key and its associated value). If a mapping is added to or removed from the hash table during iteration, then an iteration step may fail with -@scheme[exn:fail:contract], or the iteration may skip or duplicate -keys and values. See also @scheme[in-hash], @scheme[in-hash-keys], -@scheme[in-hash-values], and @scheme[in-hash-pairs]. +@racket[exn:fail:contract], or the iteration may skip or duplicate +keys and values. See also @racket[in-hash], @racket[in-hash-keys], +@racket[in-hash-values], and @racket[in-hash-pairs]. -Two hash tables cannot be @scheme[equal?] unless they use the same -key-comparison procedure (@scheme[equal?], @scheme[eqv?], or -@scheme[eq?]), both hold keys strongly or weakly, and have the same +Two hash tables cannot be @racket[equal?] unless they use the same +key-comparison procedure (@racket[equal?], @racket[eqv?], or +@racket[eq?]), both hold keys strongly or weakly, and have the same mutability. @elemtag['(caveat "concurrency")]{@bold{Caveats concerning concurrent modification:}} A mutable hash table can be manipulated with -@scheme[hash-ref], @scheme[hash-set!], and @scheme[hash-remove!] +@racket[hash-ref], @racket[hash-set!], and @racket[hash-remove!] concurrently by multiple threads, and the operations are protected by a table-specific semaphore as needed. Three caveats apply, however: @itemize[ - @item{If a thread is terminated while applying @scheme[hash-ref], - @scheme[hash-set!], @scheme[hash-remove!], @scheme[hash-ref!], - or @scheme[hash-update!] to a hash table that - uses @scheme[equal?] or @scheme[eqv?] key comparisons, all current + @item{If a thread is terminated while applying @racket[hash-ref], + @racket[hash-set!], @racket[hash-remove!], @racket[hash-ref!], + or @racket[hash-update!] to a hash table that + uses @racket[equal?] or @racket[eqv?] key comparisons, all current and future operations on the hash table may block indefinitely.} - @item{The @scheme[hash-map] and @scheme[hash-for-each] procedures do + @item{The @racket[hash-map] and @racket[hash-for-each] procedures do not use the table's semaphore to guard the traversal as a whole. Changes by one thread to a hash table can affect the keys and values seen by another thread part-way through its traversal of the same hash table.} - @item{The @scheme[hash-update!] and @scheme[hash-ref!] functions + @item{The @racket[hash-update!] and @racket[hash-ref!] functions use a table's semaphore - independently for the @scheme[hash-ref] and @scheme[hash-set!] parts + independently for the @racket[hash-ref] and @racket[hash-set!] parts of their functionality, which means that the update as a whole is not ``atomic.''} ] @elemtag['(caveat "mutable-keys")]{@bold{Caveat concerning mutable -keys:}} If a key in an @scheme[equal?]-based hash table is mutated -(e.g., a key string is modified with @scheme[string-set!]), then the +keys:}} If a key in an @racket[equal?]-based hash table is mutated +(e.g., a key string is modified with @racket[string-set!]), then the hash table's behavior for insertion and lookup operations becomes unpredictable. @defproc[(hash? [v any/c]) boolean?]{ -Returns @scheme[#t] if @scheme[v] is a @tech{hash table}, @scheme[#f] +Returns @racket[#t] if @racket[v] is a @tech{hash table}, @racket[#f] otherwise.} @defproc[(hash-equal? [hash hash?]) boolean?]{ -Returns @scheme[#t] if @scheme[hash] compares keys with @scheme[equal?], -@scheme[#f] if it compares with @scheme[eq?] or @scheme[eqv?].} +Returns @racket[#t] if @racket[hash] compares keys with @racket[equal?], +@racket[#f] if it compares with @racket[eq?] or @racket[eqv?].} @defproc[(hash-eqv? [hash hash?]) boolean?]{ -Returns @scheme[#t] if @scheme[hash] compares keys with @scheme[eqv?], -@scheme[#f] if it compares with @scheme[equal?] or @scheme[eq?].} +Returns @racket[#t] if @racket[hash] compares keys with @racket[eqv?], +@racket[#f] if it compares with @racket[equal?] or @racket[eq?].} @defproc[(hash-eq? [hash hash?]) boolean?]{ -Returns @scheme[#t] if @scheme[hash] compares keys with @scheme[eq?], -@scheme[#f] if it compares with @scheme[equal?] or @scheme[eqv?].} +Returns @racket[#t] if @racket[hash] compares keys with @racket[eq?], +@racket[#f] if it compares with @racket[equal?] or @racket[eqv?].} @defproc[(hash-weak? [hash hash?]) boolean?]{ -Returns @scheme[#t] if @scheme[hash] retains its keys weakly, -@scheme[#f] if it retains keys strongly.} +Returns @racket[#t] if @racket[hash] retains its keys weakly, +@racket[#f] if it retains keys strongly.} @deftogether[( @defproc[(hash [key any/c] [val any/c] ... ...) (and/c hash? hash-equal? immutable?)] @@ -113,18 +113,18 @@ Returns @scheme[#t] if @scheme[hash] retains its keys weakly, @defproc[(hasheqv [key any/c] [val any/c] ... ...) (and/c hash? hash-eqv? immutable?)] )]{ -Creates an immutable hash table with each given @scheme[key] mapped to -the following @scheme[val]; each @scheme[key] must have a @scheme[val], -so the total number of arguments to @scheme[hash] must be even. +Creates an immutable hash table with each given @racket[key] mapped to +the following @racket[val]; each @racket[key] must have a @racket[val], +so the total number of arguments to @racket[hash] must be even. -The @scheme[hash] procedure creates a table where keys are compared -with @scheme[equal?], @scheme[hasheq] procedure creates a table where -keys are compared with @scheme[eq?], and @scheme[hasheqv] procedure -creates a table where keys are compared with @scheme[eqv?]. +The @racket[hash] procedure creates a table where keys are compared +with @racket[equal?], @racket[hasheq] procedure creates a table where +keys are compared with @racket[eq?], and @racket[hasheqv] procedure +creates a table where keys are compared with @racket[eqv?]. -The @scheme[key] to @scheme[val] mappings are added to the table in +The @racket[key] to @racket[val] mappings are added to the table in the order that they appear in the argument list, so later mappings can -hide earlier mappings if the @scheme[key]s are equal.} +hide earlier mappings if the @racket[key]s are equal.} @deftogether[( @defproc[(make-hash [assocs (listof pair?) null]) (and/c hash? hash-equal?)] @@ -134,19 +134,19 @@ hide earlier mappings if the @scheme[key]s are equal.} Creates a mutable hash table that holds keys strongly. -The @scheme[make-hash] procedure creates a table where keys are -compared with @scheme[equal?], @scheme[make-hasheq] procedure creates -a table where keys are compared with @scheme[eq?], and -@scheme[make-hasheqv] procedure creates a table where keys are -compared with @scheme[eqv?]. +The @racket[make-hash] procedure creates a table where keys are +compared with @racket[equal?], @racket[make-hasheq] procedure creates +a table where keys are compared with @racket[eq?], and +@racket[make-hasheqv] procedure creates a table where keys are +compared with @racket[eqv?]. -The table is initialized with the content of @scheme[assocs]. In each -element of @scheme[assocs], the @scheme[car] is a key, and the -@scheme[cdr] is the corresponding value. The mappings are added to the -table in the order that they appear in @scheme[assocs], so later +The table is initialized with the content of @racket[assocs]. In each +element of @racket[assocs], the @racket[car] is a key, and the +@racket[cdr] is the corresponding value. The mappings are added to the +table in the order that they appear in @racket[assocs], so later mappings can hide earlier mappings. -See also @scheme[make-custom-hash].} +See also @racket[make-custom-hash].} @deftogether[( @defproc[(make-weak-hash [assocs (listof pair?) null]) (and/c hash? hash-equal? hash-weak?)] @@ -154,8 +154,8 @@ See also @scheme[make-custom-hash].} @defproc[(make-weak-hasheq [assocs (listof pair?) null]) (and/c hash? hash-eq? hash-weak?)] )]{ -Like @scheme[make-hash], @scheme[make-hasheq], and -@scheme[make-hasheqv], but creates a mutable hash table that holds +Like @racket[make-hash], @racket[make-hasheq], and +@racket[make-hasheqv], but creates a mutable hash table that holds keys weakly.} @deftogether[( @@ -167,17 +167,17 @@ keys weakly.} (and/c hash? hash-eq? immutable?)] )]{ -Like @scheme[hash], @scheme[hasheq], and @scheme[hasheqv], but accepts +Like @racket[hash], @racket[hasheq], and @racket[hasheqv], but accepts the key--value mapping in association-list form like -@scheme[make-hash], @scheme[make-hasheq], and @scheme[make-hasheqv].} +@racket[make-hash], @racket[make-hasheq], and @racket[make-hasheqv].} @defproc[(hash-set! [hash (and/c hash? (not/c immutable?))] [key any/c] [v any/c]) void?]{ -Maps @scheme[key] to @scheme[v] in @scheme[hash], overwriting -any existing mapping for @scheme[key]. +Maps @racket[key] to @racket[v] in @racket[hash], overwriting +any existing mapping for @racket[key]. @see-also-caveats[]} @@ -187,8 +187,8 @@ any existing mapping for @scheme[key]. ... ...) void?]{ -Maps each @scheme[key] to each @scheme[v] in @scheme[hash], overwriting -any existing mapping for each @scheme[key]. Mappings are added from the left, so +Maps each @racket[key] to each @racket[v] in @racket[hash], overwriting +any existing mapping for each @racket[key]. Mappings are added from the left, so later mappings overwrite earlier mappings. @see-also-caveats[]} @@ -199,8 +199,8 @@ later mappings overwrite earlier mappings. [v any/c]) (and/c hash? immutable?)]{ -Functionally extends @scheme[hash] by mapping @scheme[key] to -@scheme[v], overwriting any existing mapping for @scheme[key], and +Functionally extends @racket[hash] by mapping @racket[key] to +@racket[v], overwriting any existing mapping for @racket[key], and returning the extended hash table. @see-also-mutable-key-caveat[]} @@ -212,8 +212,8 @@ returning the extended hash table. ...) (and/c hash? immutable?)]{ -Functionally extends @scheme[hash] by mapping each @scheme[key] to -@scheme[v], overwriting any existing mapping for each @scheme[key], and +Functionally extends @racket[hash] by mapping each @racket[key] to +@racket[v], overwriting any existing mapping for each @racket[key], and returning the extended hash table. Mappings are added from the left, so later mappings overwrite earlier mappings. @@ -225,16 +225,16 @@ later mappings overwrite earlier mappings. (raise (make-exn:fail:contract ....)))]) any]{ -Returns the value for @scheme[key] in @scheme[hash]. If no value -is found for @scheme[key], then @scheme[failure-result] determines the +Returns the value for @racket[key] in @racket[hash]. If no value +is found for @racket[key], then @racket[failure-result] determines the result: @itemize[ - @item{If @scheme[failure-result] is a procedure, it is called + @item{If @racket[failure-result] is a procedure, it is called (through a tail call) with no arguments to produce the result.} - @item{Otherwise, @scheme[failure-result] is returned as the result.} + @item{Otherwise, @racket[failure-result] is returned as the result.} ] @@ -243,11 +243,11 @@ result: @defproc[(hash-ref! [hash hash?] [key any/c] [to-set any/c]) any]{ -Returns the value for @scheme[key] in @scheme[hash]. If no value is -found for @scheme[key], then @scheme[to-set] determines the result as -in @scheme[hash-ref] (i.e., it is either a thunk that computes a value -or a plain value), and this result is stored in @scheme[hash] for the -@scheme[key]. (Note that if @scheme[to-set] is a thunk, it is not +Returns the value for @racket[key] in @racket[hash]. If no value is +found for @racket[key], then @racket[to-set] determines the result as +in @racket[hash-ref] (i.e., it is either a thunk that computes a value +or a plain value), and this result is stored in @racket[hash] for the +@racket[key]. (Note that if @racket[to-set] is a thunk, it is not invoked in tail position.) @see-also-caveats[]} @@ -256,8 +256,8 @@ invoked in tail position.) @defproc[(hash-has-key? [hash hash?] [key any/c]) boolean?]{ -Returns @scheme[#t] if @scheme[hash] contains a value for the given -@scheme[key], @scheme[#f] otherwise.} +Returns @racket[#t] if @racket[hash] contains a value for the given +@racket[key], @racket[#f] otherwise.} @defproc[(hash-update! [hash (and/c hash? (not/c immutable?))] @@ -267,10 +267,10 @@ Returns @scheme[#t] if @scheme[hash] contains a value for the given (raise (make-exn:fail:contract ....)))]) void?]{ -Composes @scheme[hash-ref] and @scheme[hash-set!] to update an -existing mapping in @scheme[hash], where the optional -@scheme[failure-result] argument is used as in @scheme[hash-ref] when -no mapping exists for @scheme[key] already. See the caveat above about +Composes @racket[hash-ref] and @racket[hash-set!] to update an +existing mapping in @racket[hash], where the optional +@racket[failure-result] argument is used as in @racket[hash-ref] when +no mapping exists for @racket[key] already. See the caveat above about concurrent updates. @see-also-caveats[]} @@ -283,10 +283,10 @@ concurrent updates. (raise (make-exn:fail:contract ....)))]) (and/c hash? immutable?)]{ -Composes @scheme[hash-ref] and @scheme[hash-set] to functionally -update an existing mapping in @scheme[hash], where the optional -@scheme[failure-result] argument is used as in @scheme[hash-ref] when -no mapping exists for @scheme[key] already. +Composes @racket[hash-ref] and @racket[hash-set] to functionally +update an existing mapping in @racket[hash], where the optional +@racket[failure-result] argument is used as in @racket[hash-ref] when +no mapping exists for @racket[key] already. @see-also-mutable-key-caveat[]} @@ -295,7 +295,7 @@ no mapping exists for @scheme[key] already. [key any/c]) void?]{ -Removes any existing mapping for @scheme[key] in @scheme[hash]. +Removes any existing mapping for @racket[key] in @racket[hash]. @see-also-caveats[]} @@ -304,8 +304,8 @@ Removes any existing mapping for @scheme[key] in @scheme[hash]. [key any/c]) (and/c hash? immutable?)]{ -Functionally removes any existing mapping for @scheme[key] in -@scheme[hash], returning the fresh hash table. +Functionally removes any existing mapping for @racket[key] in +@racket[hash], returning the fresh hash table. @see-also-mutable-key-caveat[]} @@ -314,14 +314,14 @@ Functionally removes any existing mapping for @scheme[key] in [proc (any/c any/c . -> . any/c)]) (listof any/c)]{ -Applies the procedure @scheme[proc] to each element in -@scheme[hash] in an unspecified order, accumulating the results -into a list. The procedure @scheme[proc] is called each time with a +Applies the procedure @racket[proc] to each element in +@racket[hash] in an unspecified order, accumulating the results +into a list. The procedure @racket[proc] is called each time with a key and its value. If a hash table is extended with new keys (either through -@scheme[proc] or by another thread) while a @scheme[hash-map] or -@scheme[hash-for-each] traversal is in process, arbitrary key--value +@racket[proc] or by another thread) while a @racket[hash-map] or +@racket[hash-for-each] traversal is in process, arbitrary key--value pairs can be dropped or duplicated in the traversal. Key mappings can be deleted or remapped (by any thread) with no adverse affects; the change does not affect a traversal if the key has been seen already, @@ -332,98 +332,98 @@ new value. @defproc[(hash-keys [hash hash?]) (listof any/c)]{ -Returns a list of the keys of @scheme[hash] in an unspecified order. +Returns a list of the keys of @racket[hash] in an unspecified order. -See @scheme[hash-map] for information about modifying @scheme[hash] -during @scheme[hash-keys]. @see-also-concurrency-caveat[]} +See @racket[hash-map] for information about modifying @racket[hash] +during @racket[hash-keys]. @see-also-concurrency-caveat[]} @defproc[(hash-values [hash hash?]) (listof any/c)]{ -Returns a list of the values of @scheme[hash] in an unspecified order. +Returns a list of the values of @racket[hash] in an unspecified order. -See @scheme[hash-map] for information about modifying @scheme[hash] -during @scheme[hash-values]. @see-also-concurrency-caveat[]} +See @racket[hash-map] for information about modifying @racket[hash] +during @racket[hash-values]. @see-also-concurrency-caveat[]} @defproc[(hash->list [hash hash?]) (listof (cons/c any/c any/c))]{ -Returns a list of the key--value pairs of @scheme[hash] in an unspecified order. +Returns a list of the key--value pairs of @racket[hash] in an unspecified order. -See @scheme[hash-map] for information about modifying @scheme[hash] -during @scheme[hash->list]. @see-also-concurrency-caveat[]} +See @racket[hash-map] for information about modifying @racket[hash] +during @racket[hash->list]. @see-also-concurrency-caveat[]} @defproc[(hash-for-each [hash hash?] [proc (any/c any/c . -> . any)]) void?]{ -Applies @scheme[proc] to each element in @scheme[hash] (for the -side-effects of @scheme[proc]) in an unspecified order. The procedure -@scheme[proc] is called each time with a key and its value. +Applies @racket[proc] to each element in @racket[hash] (for the +side-effects of @racket[proc]) in an unspecified order. The procedure +@racket[proc] is called each time with a key and its value. -See @scheme[hash-map] for information about modifying @scheme[hash] -within @scheme[proc]. @see-also-concurrency-caveat[]} +See @racket[hash-map] for information about modifying @racket[hash] +within @racket[proc]. @see-also-concurrency-caveat[]} @defproc[(hash-count [hash hash?]) exact-nonnegative-integer?]{ -Returns the number of keys mapped by @scheme[hash]. Unless @scheme[hash] +Returns the number of keys mapped by @racket[hash]. Unless @racket[hash] retains keys weakly, the result is computed in -constant time and atomically. If @scheme[hash] retains it keys weakly, a +constant time and atomically. If @racket[hash] retains it keys weakly, a traversal is required to count the keys.} @defproc[(hash-iterate-first [hash hash?]) (or/c #f exact-nonnegative-integer?)]{ -Returns @scheme[#f] if @scheme[hash] contains no elements, otherwise +Returns @racket[#f] if @racket[hash] contains no elements, otherwise it returns an integer that is an index to the first element in the hash table; ``first'' refers to an unspecified ordering of the table elements, and the index values are not necessarily consecutive -integers. For a mutable @scheme[hash], this index is guaranteed to +integers. For a mutable @racket[hash], this index is guaranteed to refer to the first item only as long as no items are added to or -removed from @scheme[hash].} +removed from @racket[hash].} @defproc[(hash-iterate-next [hash hash?] [pos exact-nonnegative-integer?]) (or/c #f exact-nonnegative-integer?)]{ Returns either an integer that is an index to the element in -@scheme[hash] after the element indexed by @scheme[pos] (which is not -necessarily one more than @scheme[pos]) or @scheme[#f] if @scheme[pos] -refers to the last element in @scheme[hash]. If @scheme[pos] is not a +@racket[hash] after the element indexed by @racket[pos] (which is not +necessarily one more than @racket[pos]) or @racket[#f] if @racket[pos] +refers to the last element in @racket[hash]. If @racket[pos] is not a valid index, then the @exnraise[exn:fail:contract]. For a mutable -@scheme[hash], the result index is guaranteed to refer to its item -only as long as no items are added to or removed from @scheme[hash].} +@racket[hash], the result index is guaranteed to refer to its item +only as long as no items are added to or removed from @racket[hash].} @defproc[(hash-iterate-key [hash hash?] [pos exact-nonnegative-integer?]) any]{ -Returns the key for the element in @scheme[hash] at index -@scheme[pos]. If @scheme[pos] is not a valid index for -@scheme[hash], the @exnraise[exn:fail:contract].} +Returns the key for the element in @racket[hash] at index +@racket[pos]. If @racket[pos] is not a valid index for +@racket[hash], the @exnraise[exn:fail:contract].} @defproc[(hash-iterate-value [hash hash?] [pos exact-nonnegative-integer?]) any]{ -Returns the value for the element in @scheme[hash] at index -@scheme[pos]. If @scheme[pos] is not a valid index for -@scheme[hash], the @exnraise[exn:fail:contract].} +Returns the value for the element in @racket[hash] at index +@racket[pos]. If @racket[pos] is not a valid index for +@racket[hash], the @exnraise[exn:fail:contract].} @defproc[(hash-copy [hash hash?]) (and/c hash? (not/c immutable?))]{ Returns a mutable hash table with the same mappings, same -key-comparison mode, and same key-holding strength as @scheme[hash].} +key-comparison mode, and same key-holding strength as @racket[hash].} @defproc[(eq-hash-code [v any/c]) fixnum?]{ -Returns a @tech{fixnum}; for any two calls with @scheme[eq?] values, +Returns a @tech{fixnum}; for any two calls with @racket[eq?] values, the returned number is the same. @margin-note{Equal @tech{fixnums} are always @racket[eq?].}} @@ -431,19 +431,19 @@ the returned number is the same. @defproc[(eqv-hash-code [v any/c]) fixnum?]{ -Returns a @tech{fixnum}; for any two calls with @scheme[eqv?] values, +Returns a @tech{fixnum}; for any two calls with @racket[eqv?] values, the returned number is the same.} @defproc[(equal-hash-code [v any/c]) fixnum?]{ -Returns a @tech{fixnum}; for any two calls with @scheme[equal?] values, +Returns a @tech{fixnum}; for any two calls with @racket[equal?] values, the returned number is the same. A hash code is computed even when -@scheme[v] contains a cycle through pairs, vectors, boxes, and/or -inspectable structure fields. See also @scheme[prop:equal+hash].} +@racket[v] contains a cycle through pairs, vectors, boxes, and/or +inspectable structure fields. See also @racket[prop:equal+hash].} @defproc[(equal-secondary-hash-code [v any/c]) fixnum?]{ -Like @scheme[equal-hash-code], but computes a secondary value suitable +Like @racket[equal-hash-code], but computes a secondary value suitable for use in double hashing.} diff --git a/collects/scribblings/reference/help.scrbl b/collects/scribblings/reference/help.scrbl index eb3d8e1569..b6389c5c25 100644 --- a/collects/scribblings/reference/help.scrbl +++ b/collects/scribblings/reference/help.scrbl @@ -26,69 +26,69 @@ @emph{For general help, see the @|main-doc-page|.} -The @scheme[help] form searches the documentation and opens a web +The @racket[help] form searches the documentation and opens a web browser (using the user's selected browser) to display the results. -@margin-note{See @schememodname[net/sendurl] for information on how +@margin-note{See @racketmodname[net/sendurl] for information on how the user's browser is launched to display help information.} -A simple @scheme[help] or @scheme[(help)] form opens the main +A simple @racket[help] or @racket[(help)] form opens the main documentation page. -The @scheme[(help string ...)] form---using literal strings, as +The @racket[(help string ...)] form---using literal strings, as opposed to expressions that produce strings---performs a string-matching search. For example, -@schemeblock[ +@racketblock[ (help "web browser" "firefox") ] searches the documentation index for references that include the phrase ``web browser'' or ``firefox.'' -A @scheme[(help id)] form looks for documentation specific to the -current binding of @scheme[id]. For example, +A @racket[(help id)] form looks for documentation specific to the +current binding of @racket[id]. For example, -@schemeblock[ +@racketblock[ (require net/url) (help url->string) ] -opens a web browser to show the documentation for @scheme[url->string] -from the @schememodname[net/url] library. +opens a web browser to show the documentation for @racket[url->string] +from the @racketmodname[net/url] library. -For the purposes of @scheme[help], a @scheme[for-label] require +For the purposes of @racket[help], a @racket[for-label] require introduces a binding without actually executing the -@schememodname[net/url] library---for cases when you want to check +@racketmodname[net/url] library---for cases when you want to check documentation, but cannot or do not want to run the providing module. -@schemeblock[ +@racketblock[ (require racket/gui) (code:comment @#,t{does not work in @exec{racket}}) (require (for-label racket/gui)) (code:comment @#,t{ok in @exec{racket}}) (help frame%) ] -If @scheme[id] has no for-label and normal binding, then @scheme[help] +If @racket[id] has no for-label and normal binding, then @racket[help] lists all libraries that are known to export a binding for -@scheme[id]. +@racket[id]. -The @scheme[(help id #:from module-path)] variant is similar to -@scheme[(help id)], but using only the exports of -@scheme[module-path]. (The @scheme[module-path] module is required -@scheme[for-label] in a temporary namespace.) +The @racket[(help id #:from module-path)] variant is similar to +@racket[(help id)], but using only the exports of +@racket[module-path]. (The @racket[module-path] module is required +@racket[for-label] in a temporary namespace.) -@schemeblock[ +@racketblock[ (help frame% #:from racket/gui) (code:comment @#,t{equivalent to the above}) ] -The @scheme[(help #:search datum ...)] form is similar to -@scheme[(help string ...)], where any non-string form of -@scheme[datum] is converted to a string using @scheme[display]. No -@scheme[datum] is evaluated as an expression. +The @racket[(help #:search datum ...)] form is similar to +@racket[(help string ...)], where any non-string form of +@racket[datum] is converted to a string using @racket[display]. No +@racket[datum] is evaluated as an expression. For example, -@schemeblock[ +@racketblock[ (help #:search "web browser" firefox) ] diff --git a/collects/scribblings/reference/include.scrbl b/collects/scribblings/reference/include.scrbl index 550ba1b50a..d7e5ae1689 100644 --- a/collects/scribblings/reference/include.scrbl +++ b/collects/scribblings/reference/include.scrbl @@ -11,49 +11,49 @@ (file string) (lib string ...+)])]{ -Inlines the syntax in the file designated by @scheme[path-spec] in -place of the @scheme[include] expression. +Inlines the syntax in the file designated by @racket[path-spec] in +place of the @racket[include] expression. -A @scheme[path-spec] resembles a subset of the @scheme[_mod-path] -forms for @scheme[require], but it specifies a file whose content need -not be a module. That is, @scheme[string] refers to a file using a -platform-independent relative path, @scheme[(file string)] refers to a -file using platform-specific notation, and @scheme[(lib string ...)] +A @racket[path-spec] resembles a subset of the @racket[_mod-path] +forms for @racket[require], but it specifies a file whose content need +not be a module. That is, @racket[string] refers to a file using a +platform-independent relative path, @racket[(file string)] refers to a +file using platform-specific notation, and @racket[(lib string ...)] refers to a file within a collection. -If @scheme[path-spec] specifies a relative path, the path is resolved -relative to the source for the @scheme[include] expression, if that +If @racket[path-spec] specifies a relative path, the path is resolved +relative to the source for the @racket[include] expression, if that source is a complete path string. If the source is not a complete path -string, then @scheme[path-spec] is resolved relative to -@scheme[(current-load-relative-directory)] if it is not @scheme[#f], -or relative to @scheme[(current-directory)] otherwise. +string, then @racket[path-spec] is resolved relative to +@racket[(current-load-relative-directory)] if it is not @racket[#f], +or relative to @racket[(current-directory)] otherwise. The included syntax is given the lexical context of the -@scheme[include] expression, while the included syntax's source +@racket[include] expression, while the included syntax's source location refers to its actual source.} @defform[(include-at/relative-to context source path-spec)]{ -Like @scheme[include], except that the lexical context of -@scheme[context] is used for the included syntax, and a relative -@scheme[path-spec] is resolved with respect to the source of -@scheme[source]. The @scheme[context] and @scheme[source] elements are +Like @racket[include], except that the lexical context of +@racket[context] is used for the included syntax, and a relative +@racket[path-spec] is resolved with respect to the source of +@racket[source]. The @racket[context] and @racket[source] elements are otherwise discarded by expansion.} @defform[(include/reader path-spec reader-expr)]{ -Like @scheme[include], except that the procedure produced by the -expression @scheme[reader-expr] is used to read the included file, -instead of @scheme[read-syntax]. +Like @racket[include], except that the procedure produced by the +expression @racket[reader-expr] is used to read the included file, +instead of @racket[read-syntax]. -The @scheme[reader-expr] is evaluated at expansion time in the +The @racket[reader-expr] is evaluated at expansion time in the @tech{transformer environment}. Since it serves as a replacement for -@scheme[read-syntax], the expression's value should be a procedure +@racket[read-syntax], the expression's value should be a procedure that consumes two inputs---a string representing the source and an -input port---and produces a syntax object or @scheme[eof]. The -procedure will be called repeatedly until it produces @scheme[eof]. +input port---and produces a syntax object or @racket[eof]. The +procedure will be called repeatedly until it produces @racket[eof]. The syntax objects returned by the procedure should have source location information, but usually no lexical context; any lexical @@ -62,4 +62,4 @@ context in the syntax objects will be ignored.} @defform[(include-at/relative-to/reader context source path-spec reader-expr)]{ -Combines @scheme[include-at/relative-to] and @scheme[include/reader].} +Combines @racket[include-at/relative-to] and @racket[include/reader].} diff --git a/collects/scribblings/reference/init.scrbl b/collects/scribblings/reference/init.scrbl index 2b4971f692..34beaa172f 100644 --- a/collects/scribblings/reference/init.scrbl +++ b/collects/scribblings/reference/init.scrbl @@ -17,26 +17,26 @@ library for GRacket. It re-exports the @racketmodname[racket/init] and @defmodule*/no-declare[(racket/language-info)]{The @racketmodname[racket/language-info] library provides a -@schemeidfont{get-info} function that takes any value and returns +@racketidfont{get-info} function that takes any value and returns another function; the returned function takes a key value and a -default value, and it returns @scheme['(#(racket/runtime-config -configure #f))] if the key is @scheme['configure-runtime] or the +default value, and it returns @racket['(#(racket/runtime-config +configure #f))] if the key is @racket['configure-runtime] or the default value otherwise.} @guidealso["module-runtime-config"] -The vector @scheme['#(racket/language-info get-info #f)] is suitable +The vector @racket['#(racket/language-info get-info #f)] is suitable for attaching to a module as its language info to get the same -language information as the @scheme[racket/base] language. +language information as the @racket[racket/base] language. @defmodule*/no-declare[(racket/runtime-config)]{The @racketmodname[racket/runtime-config] library provides a @racketidfont{configure} function that returns another function; the returned function takes an value ans set @racket[print-as-expression] -to @scheme[#t].} +to @racket[#t].} -The vector @scheme[#(racket/runtime-config configure #f)] is suitable +The vector @racket[#(racket/runtime-config configure #f)] is suitable as a member of a list of runtime-configuration specification (as returned by a module's language-information function for the key @racket['configure-runtime]) to obtain the same runtime configuration as -for the @schememodname[racket/base] language. +for the @racketmodname[racket/base] language. diff --git a/collects/scribblings/reference/match-parse.rkt b/collects/scribblings/reference/match-parse.rkt index c8a93868a7..f88b1b6af2 100644 --- a/collects/scribblings/reference/match-parse.rkt +++ b/collects/scribblings/reference/match-parse.rkt @@ -16,7 +16,7 @@ (list (fixup-meaning (substring s 0 (caar m))) middle (fixup-meaning (substring s (cdar m))))))) - + (define (fixup-meaning s) (cond [(regexp-match-positions #rx"pattern" s) @@ -36,11 +36,11 @@ [(regexp-match-positions #rx"expr" s) => (fixup s (fixup-sexp 'expr))] [(regexp-match-positions #rx"[*][*][*]" s) - => (fixup s (schemeidfont "..."))] + => (fixup s (racketidfont "..."))] [(regexp-match-positions #rx"[(]" s) - => (fixup s (schemeparenfont "("))] + => (fixup s (racketparenfont "("))] [(regexp-match-positions #rx"[)]" s) - => (fixup s (schemeparenfont ")"))] + => (fixup s (racketparenfont ")"))] [(regexp-match-positions #rx"K" s) => (fixup s (match-nonterm "k"))] [else s])) diff --git a/collects/scribblings/reference/match.scrbl b/collects/scribblings/reference/match.scrbl index 59b12c1841..a295a8bd93 100644 --- a/collects/scribblings/reference/match.scrbl +++ b/collects/scribblings/reference/match.scrbl @@ -213,7 +213,7 @@ In more detail, patterns match as follows: @racket[(#,(racketidfont "struct") _struct-id (_pat ...))] --- matches an instance of a structure type named @racket[_struct-id], where each field in the instance matches - the corresponding @racket[_pat]. See also @scheme[struct*]. + the corresponding @racket[_pat]. See also @racket[struct*]. Usually, @racket[_struct-id] is defined with @racket[struct]. More generally, @racket[_struct-id] @@ -477,7 +477,7 @@ instead of @racket[match].} @section{Library Extensions} @defform[(struct* struct-id ([field pat] ...))]{ - A @scheme[match] pattern form that matches an instance of a structure + A @racket[match] pattern form that matches an instance of a structure type named @racket[struct-id], where the field @racket[field] in the instance matches the corresponding @racket[pat]. diff --git a/collects/scribblings/reference/mpairs.scrbl b/collects/scribblings/reference/mpairs.scrbl index 02311fdfeb..74d034298e 100644 --- a/collects/scribblings/reference/mpairs.scrbl +++ b/collects/scribblings/reference/mpairs.scrbl @@ -20,7 +20,7 @@ always better choices. A @tech{mutable list} can be used as a single-valued sequence (see @secref["sequences"]). The elements of the @tech{mutable list} serve as elements -of the sequence. See also @scheme[in-mlist]. +of the sequence. See also @racket[in-mlist]. @; ---------------------------------------- @section{Mutable Pair Constructors and Selectors} diff --git a/collects/scribblings/reference/mz.rkt b/collects/scribblings/reference/mz.rkt index 9d33dcd32c..8004cf42e6 100644 --- a/collects/scribblings/reference/mz.rkt +++ b/collects/scribblings/reference/mz.rkt @@ -35,12 +35,12 @@ (t (make-collect-element #f null (lambda (ci) - (collect-put! ci `(scheme-extra-lib ,'lib) (schememodname lib)))) + (collect-put! ci `(racket-extra-lib ,'lib) (racketmodname lib)))) "The bindings documented in this section are provided by the " - (schememodname lib) + (racketmodname lib) " and " - (schememodname racket) - " libraries, but not " (schememodname racket/base) + (racketmodname racket) + " libraries, but not " (racketmodname racket/base) "." . more)))] [(_ lib . more) @@ -54,13 +54,13 @@ (declare-exporting lib racket/init #:use-sources (src ...)) (defmodule*/no-declare (lib) (t "The bindings documented in this section are provided by the " - (schememodname lib) + (racketmodname lib) " and " - (schememodname racket/init) + (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 " (schememodname racket/base) - " or " (schememodname racket) "." + " They are not provided by " (racketmodname racket/base) + " or " (racketmodname racket) "." . more)))] [(_ lib . more) (note-init-lib lib #:use-sources () . more)])) @@ -71,14 +71,14 @@ [(_ lib #:use-sources (src ...) . more) (defmodule lib #:use-sources (src ...) (t "The bindings documented in this section are provided by the " - (schememodname lib) - " library, not " (schememodname racket/base) - " or " (schememodname racket) + (racketmodname lib) + " library, not " (racketmodname racket/base) + " or " (racketmodname racket) "." . more))] [(_ lib . more) (note-lib-only lib #:use-sources () . more)])) - + (define (*exnraise s) (make-element #f (list s " exception is raised"))) (define-syntax exnraise diff --git a/collects/scribblings/reference/namespaces.scrbl b/collects/scribblings/reference/namespaces.scrbl index 27ae3966fb..400bd57d7e 100644 --- a/collects/scribblings/reference/namespaces.scrbl +++ b/collects/scribblings/reference/namespaces.scrbl @@ -7,15 +7,15 @@ See @secref["namespace-model"] for basic information on the @tech{namespace} model. A new @tech{namespace} is created with procedures like -@scheme[make-empty-namespace], and @scheme[make-base-namespace], which +@racket[make-empty-namespace], and @racket[make-base-namespace], which return a first-class namespace value. A namespace is used by setting -the @scheme[current-namespace] parameter value, or by providing the -namespace to procedures such as @scheme[eval] and -@scheme[eval-syntax]. +the @racket[current-namespace] parameter value, or by providing the +namespace to procedures such as @racket[eval] and +@racket[eval-syntax]. @defproc[(namespace? [v any/c]) boolean?]{ -Returns @scheme[#t] if @scheme[v] is a namespace value, @scheme[#f] +Returns @racket[#t] if @racket[v] is a namespace value, @racket[#f] otherwise.} @@ -25,30 +25,30 @@ Creates a new namespace that is empty, and whose @tech{module registry} contains no mappings. The namespace's @tech{base phase} is the same as the @tech{base phase} of the @tech{current namespace}. Attach modules from an existing namespace to the new one -with @scheme[namespace-attach-module].} +with @racket[namespace-attach-module].} @defproc[(make-base-empty-namespace) namespace?]{ -Creates a new empty namespace, but with @schememodname[racket/base] +Creates a new empty namespace, but with @racketmodname[racket/base] attached. The namespace's @tech{base phase} is the same as the -@tech{phase} in which the @scheme[make-base-empty-namespace] +@tech{phase} in which the @racket[make-base-empty-namespace] function was created.} @defproc[(make-base-namespace) namespace?]{ -Creates a new namespace with @schememodname[racket/base] attached and -@scheme[require]d into the top-level environment. The namespace's +Creates a new namespace with @racketmodname[racket/base] attached and +@racket[require]d into the top-level environment. The namespace's @tech{base phase} is the same as the @tech{phase} in which the -@scheme[make-base-namespace] function was created.} +@racket[make-base-namespace] function was created.} @defform[(define-namespace-anchor id)]{ -Binds @scheme[id] to a namespace anchor that can be used with -@scheme[namespace-anchor->empty-namespace] and -@scheme[namespace-anchor->namespace]. +Binds @racket[id] to a namespace anchor that can be used with +@racket[namespace-anchor->empty-namespace] and +@racket[namespace-anchor->namespace]. This form can be used only in a @tech{top-level context} or in a @tech{module-context}.} @@ -56,8 +56,8 @@ This form can be used only in a @tech{top-level context} or in a @defproc[(namespace-anchor? [v any/c]) boolean?]{ -Returns @scheme[#t] if @scheme[v] is a namespace-anchor value, -@scheme[#f] otherwise.} +Returns @racket[#t] if @racket[v] is a namespace-anchor value, +@racket[#f] otherwise.} @defproc[(namespace-anchor->empty-namespace [a namespace-anchor?]) namespace?]{ @@ -66,10 +66,10 @@ Returns an empty namespace that shares a @tech{module registry} with the source of the anchor, and whose @tech{base phase} the @tech{phase} in which the anchor was created. -If the anchor is from a @scheme[define-namespace-anchor] form in a +If the anchor is from a @racket[define-namespace-anchor] form in a module context, then the source is the namespace in which the containing module is instantiated. If the anchor is from a -@scheme[define-namespace-anchor] form in a top-level content, then the +@racket[define-namespace-anchor] form in a top-level content, then the source is the namespace in which the anchor definition was evaluated.} @@ -77,12 +77,12 @@ source is the namespace in which the anchor definition was evaluated.} Returns a namespace corresponding to the source of the anchor. -If the anchor is from a @scheme[define-namespace-anchor] form in a +If the anchor is from a @racket[define-namespace-anchor] form in a module context, then the result is a namespace for the module's body in the anchor's phase. The result is the same as a namespace obtained -via @scheme[module->namespace]. +via @racket[module->namespace]. -If the anchor is from a @scheme[define-namespace-anchor] form in a +If the anchor is from a @racket[define-namespace-anchor] form in a top-level content, then the result is the namespace in which the anchor definition was evaluated.} @@ -94,7 +94,7 @@ A parameter that determines the @techlink{current namespace}.} @defproc[(namespace-symbol->identifier [sym symbol?]) identifier?]{ -Similar to @scheme[datum->syntax] restricted to symbols. The +Similar to @racket[datum->syntax] restricted to symbols. The @tech{lexical information} of the resulting identifier corresponds to the top-level environment of the current namespace; the identifier has no source location or properties.} @@ -102,21 +102,21 @@ no source location or properties.} @defproc[(namespace-base-phase [namespace namespace? (current-namespace)]) exact-integer?]{ -Returns the @tech{base phase} of @scheme[namespace].} +Returns the @tech{base phase} of @racket[namespace].} @defproc[(namespace-module-identifier [where (or/c namespace? exact-integer? #f) (current-namespace)]) identifier?]{ -Returns an identifier whose binding is @scheme[module] in the -@tech{base phase} of @scheme[where] if it is a namespace, or in the -@scheme[where] @tech{phase level} otherwise. +Returns an identifier whose binding is @racket[module] in the +@tech{base phase} of @racket[where] if it is a namespace, or in the +@racket[where] @tech{phase level} otherwise. The @tech{lexical information} of the identifier includes bindings (in the same @tech{phase level}) for all syntactic forms that appear in fully expanded code (see @secref["fully-expanded"]), but using the -name reported by the second element of @scheme[identifier-binding] for +name reported by the second element of @racket[identifier-binding] for the binding; the @tech{lexical information} may also include other bindings.} @@ -127,34 +127,34 @@ bindings.} [namespace namespace? (current-namespace)]) any]{ -Returns a value for @scheme[sym] in @scheme[namespace], using -@scheme[namespace]'s @tech{base phase}. The returned value depends on -@scheme[use-mapping?]: +Returns a value for @racket[sym] in @racket[namespace], using +@racket[namespace]'s @tech{base phase}. The returned value depends on +@racket[use-mapping?]: @itemize[ - @item{If @scheme[use-mapping?] is true (the default), and if - @scheme[sym] maps to a top-level variable or an imported variable + @item{If @racket[use-mapping?] is true (the default), and if + @racket[sym] maps to a top-level variable or an imported variable (see @secref["namespace-model"]), then the result is the same as - evaluating @scheme[sym] as an expression. If @scheme[sym] maps to - syntax or imported syntax, then @scheme[failure-thunk] is called or - the @exnraise[exn:fail:syntax]. If @scheme[sym] is mapped to an + evaluating @racket[sym] as an expression. If @racket[sym] maps to + syntax or imported syntax, then @racket[failure-thunk] is called or + the @exnraise[exn:fail:syntax]. If @racket[sym] is mapped to an undefined variable or an uninitialized module variable, then - @scheme[failure-thunk] is called of the + @racket[failure-thunk] is called of the @exnraise[exn:fail:contract:variable].} - @item{If @scheme[use-mapping?] is @scheme[#f], the namespace's + @item{If @racket[use-mapping?] is @racket[#f], the namespace's syntax and import mappings are ignored. Instead, the value of the - top-level variable named @scheme[sym] in namespace is returned. If - the variable is undefined, then @scheme[failure-thunk] is called or + top-level variable named @racket[sym] in namespace is returned. If + the variable is undefined, then @racket[failure-thunk] is called or the @exnraise[exn:fail:contract:variable].} ] -If @scheme[failure-thunk] is not @scheme[#f], -@scheme[namespace-variable-value] calls @scheme[failure-thunk] to +If @racket[failure-thunk] is not @racket[#f], +@racket[namespace-variable-value] calls @racket[failure-thunk] to produce the return value in place of raising an -@scheme[exn:fail:contract:variable] or @scheme[exn:fail:syntax] +@racket[exn:fail:contract:variable] or @racket[exn:fail:syntax] exception.} @@ -164,22 +164,22 @@ exception.} [namespace namespace? (current-namespace)]) void?]{ -Sets the value of @scheme[sym] in the top-level environment of -@scheme[namespace] in the @tech{base phase}, defining @scheme[sym] if +Sets the value of @racket[sym] in the top-level environment of +@racket[namespace] in the @tech{base phase}, defining @racket[sym] if it is not already defined. -If @scheme[map?] is supplied as true, then the namespace's +If @racket[map?] is supplied as true, then the namespace's @tech{identifier} mapping is also adjusted (see @secref["namespace-model"]) in the @tech{phase level} corresponding to -the @tech{base phase}, so that @scheme[sym] maps to the variable.} +the @tech{base phase}, so that @racket[sym] maps to the variable.} @defproc[(namespace-undefine-variable! [sym symbol?] [namespace namespace? (current-namespace)]) void?]{ -Removes the @scheme[sym] variable, if any, in the top-level -environment of @scheme[namespace] in its @tech{base phase}. The +Removes the @racket[sym] variable, if any, in the top-level +environment of @racket[namespace] in its @tech{base phase}. The namespace's @tech{identifier} mapping (see @secref["namespace-model"]) is unaffected.} @@ -188,7 +188,7 @@ is unaffected.} (listof symbol?)]{ Returns a list of all symbols that are mapped to variables, syntax, -and imports in @scheme[namespace] for the @tech{phase level} +and imports in @racket[namespace] for the @tech{phase level} corresponding to the @tech{namespace}'s @tech{base phase}.} @@ -196,23 +196,23 @@ corresponding to the @tech{namespace}'s @tech{base phase}.} @defproc[(namespace-require [quoted-raw-require-spec any/c]) void?]{ -Performs the import corresponding to @scheme[quoted-raw-require-spec] +Performs the import corresponding to @racket[quoted-raw-require-spec] in the top-level environment of the current namespace, like a -top-level @scheme[#%require]. The @scheme[quoted-raw-require-spec] +top-level @racket[#%require]. The @racket[quoted-raw-require-spec] argument must be a datum that corresponds to a quoted -@scheme[_raw-require-spec] for @scheme[#%require], which includes +@racket[_raw-require-spec] for @racket[#%require], which includes module paths. -Module paths in @scheme[quoted-raw-require-spec] are resolved with respect -to @scheme[current-load-relative-directory] or -@scheme[current-directory] (if the former is @scheme[#f]), even if the +Module paths in @racket[quoted-raw-require-spec] are resolved with respect +to @racket[current-load-relative-directory] or +@racket[current-directory] (if the former is @racket[#f]), even if the current namespace corresponds to a module body.} @defproc[(namespace-require/copy [quoted-raw-require-spec any/c]) void?]{ -Like @scheme[namespace-require] for syntax exported from the module, +Like @racket[namespace-require] for syntax exported from the module, but exported variables at the namespace's @tech{base phase} are treated differently: the export's current value is copied to a top-level variable in the current namespace.} @@ -221,7 +221,7 @@ top-level variable in the current namespace.} @defproc[(namespace-require/constant [quoted-raw-require-spec any/c]) void?]{ -Like @scheme[namespace-require], but for each exported variable at the +Like @racket[namespace-require], but for each exported variable at the @tech{namespace}'s @tech{base phase}, the export's value is copied to a corresponding top-level variable that is made immutable. Despite setting the top-level variable, the corresponding identifier is bound @@ -231,7 +231,7 @@ as imported.} @defproc[(namespace-require/expansion-time [quoted-raw-require-spec any/c]) void?]{ -Like @scheme[namespace-require], but only the transformer part of the +Like @racket[namespace-require], but only the transformer part of the module is executed relative to the @tech{namespace}'s @tech{base phase}; that is, the module is merely @tech{visit}ed, and not @tech{instantiate}d (see @secref["mod-parse"]). If the required module @@ -244,27 +244,27 @@ undefined.} [dest-namespace namespace? (current-namespace)]) void?]{ -Attaches the instantiated module named by @scheme[modname] in -@scheme[src-namespace] (at its @tech{base phase}) to the @tech{module -registry} of @scheme[dest-namespace]. If @scheme[modname] is not a +Attaches the instantiated module named by @racket[modname] in +@racket[src-namespace] (at its @tech{base phase}) to the @tech{module +registry} of @racket[dest-namespace]. If @racket[modname] is not a symbol, the current module name resolver is called to resolve the -path, but no module is loaded; the resolved form of @scheme[modname] -is used as the module name in @scheme[dest-namespace]. In addition to -@scheme[modname], every module that it imports (directly or +path, but no module is loaded; the resolved form of @racket[modname] +is used as the module name in @racket[dest-namespace]. In addition to +@racket[modname], every module that it imports (directly or indirectly) is also recorded in the current namespace's @tech{module registry}, and instances at the same @tech{phase} or lower are also -attached to @scheme[dest-namespace] (while @tech{visits} at the +attached to @racket[dest-namespace] (while @tech{visits} at the module's phase and instances at higher phases are not attached, nor even made @tech{available} for on-demand @tech{visits}). The inspector -of the module invocation in @scheme[dest-namespace] is the same as -inspector of the invocation in @scheme[src-namespace]. +of the module invocation in @racket[dest-namespace] is the same as +inspector of the invocation in @racket[src-namespace]. -If @scheme[modname] does not refer to an @tech{instantiate}d module in -@scheme[src-namespace], or if the name of any module to be attached +If @racket[modname] does not refer to an @tech{instantiate}d module in +@racket[src-namespace], or if the name of any module to be attached already has a different declaration or same-@tech{phase} instance in -@scheme[dest-namespace], then the @exnraise[exn:fail:contract]. +@racket[dest-namespace], then the @exnraise[exn:fail:contract]. -If @scheme[src-namespace] and @scheme[dest-namespace] do not have the +If @racket[src-namespace] and @racket[dest-namespace] do not have the same @tech{base phase}, then the @exnraise[exn:fail:contract].} @@ -285,10 +285,10 @@ module is merely declared in @racket[dest-namespace].} void?]{ Changes the inspector for the instance of the module referenced by -@scheme[modname] in @scheme[namespace]'s @tech{module registry} so +@racket[modname] in @racket[namespace]'s @tech{module registry} so that it is controlled by the current code inspector. The given -@scheme[inspector] must currently control the invocation of the module -in @scheme[namespace]'s @tech{module registry}, otherwise the +@racket[inspector] must currently control the invocation of the module +in @racket[namespace]'s @tech{module registry}, otherwise the @exnraise[exn:fail:contract]. See also @secref["modprotect"].} @@ -296,7 +296,7 @@ in @scheme[namespace]'s @tech{module registry}, otherwise the any]{ Returns the @tech{module registry} of the given namespace. This value -is useful only for identification via @scheme[eq?].} +is useful only for identification via @racket[eq?].} @defproc[(module->namespace [modname module-path?]) namespace?]{ @@ -310,8 +310,8 @@ registry} as the current namespace. Modifying a binding in the namespace changes the binding seen in modules that require the namespace's module. -Module paths in a top-level @scheme[require] expression are resolved -with respect to the namespace's module. New @scheme[provide] +Module paths in a top-level @racket[require] expression are resolved +with respect to the namespace's module. New @racket[provide] declarations are not allowed. If the current code inspector does not control the invocation of the @@ -319,14 +319,14 @@ module in the current namespace's @tech{module registry}, the @exnraise[exn:fail:contract]; see also @secref["modprotect"]. Bindings in the namespace cannot be modified if the -@scheme[compile-enforce-module-constants] parameter was true when the +@racket[compile-enforce-module-constants] parameter was true when the module was declared, unless the module declaration itself included -assignments to the binding via @scheme[set!].} +assignments to the binding via @racket[set!].} @defproc[(namespace-syntax-introduce [stx syntax-object?]) syntax-object?]{ -Returns a syntax object like @scheme[stx], except that the current +Returns a syntax object like @racket[stx], except that the current namespace's bindings are included in the @tech{syntax object}'s @tech{lexical information} (see @secref["stxobj-model"]). The additional context is overridden by any existing @tech{top-level @@ -339,66 +339,66 @@ information}.} [sym symbol?]) boolean?]{ -Returns @scheme[#f] if the module declaration for -@scheme[module-path-index] defines @scheme[sym] and exports it -unprotected, @scheme[#t] otherwise (which may mean that the symbol +Returns @racket[#f] if the module declaration for +@racket[module-path-index] defines @racket[sym] and exports it +unprotected, @racket[#t] otherwise (which may mean that the symbol corresponds to an unexported definition, a protected export, or an identifier that is not defined at all within the module). -The @scheme[module-path-index] argument can be a symbol; see +The @racket[module-path-index] argument can be a symbol; see @secref["modpathidx"] for more information on module path indices. -Typically, the arguments to @scheme[module-provide-protected?] +Typically, the arguments to @racket[module-provide-protected?] correspond to the first two elements of a list produced by -@scheme[identifier-binding].} +@racket[identifier-binding].} @defproc[(variable-reference? [v any/c]) boolean?]{ -Return @scheme[#t] if @scheme[v] is a @tech{variable reference} -produced by @scheme[#%variable-reference], @scheme[#f] otherwise.} +Return @racket[#t] if @racket[v] is a @tech{variable reference} +produced by @racket[#%variable-reference], @racket[#f] otherwise.} @defproc[(variable-reference->empty-namespace [varref variable-reference?]) namespace?]{ Returns an empty namespace that shares module declarations and -instances with the namespace in which @scheme[varref] is instantiated, -and with the same phase as @scheme[varref].} +instances with the namespace in which @racket[varref] is instantiated, +and with the same phase as @racket[varref].} @defproc[(variable-reference->namespace [varref variable-reference?]) namespace?]{ -If @scheme[varref] refers to a @tech{module-level variable}, then the +If @racket[varref] refers to a @tech{module-level variable}, then the result is a namespace for the module's body in the referenced variable's @tech{phase}; the result is the same as a namespace -obtained via @scheme[module->namespace]. +obtained via @racket[module->namespace]. -If @scheme[varref] refers to a @tech{top-level variable}, then the +If @racket[varref] refers to a @tech{top-level variable}, then the result is the namespace in which the referenced variable is defined.} @defproc[(variable-reference->resolved-module-path [varref variable-reference?]) (or/c resolved-module-path? #f)]{ -If @scheme[varref] refers to a @tech{module-level variable}, the +If @racket[varref] refers to a @tech{module-level variable}, the result is a @tech{resolved module path} naming the module. -If @scheme[varref] refers to a @tech{top-level variable}, then the -result is @scheme[#f].} +If @racket[varref] refers to a @tech{top-level variable}, then the +result is @racket[#f].} @defproc[(variable-reference->module-source [varref variable-reference?]) (or/c symbol? (and/c path? complete-path?) #f)]{ -If @scheme[varref] refers to a @tech{module-level variable}, the +If @racket[varref] refers to a @tech{module-level variable}, the result is a path or symbol naming the module's source (which is typically, but not always, the same as in the resolved module path). -If @scheme[varref] refers to a @tech{top-level variable}, then the -result is @scheme[#f].} +If @racket[varref] refers to a @tech{top-level variable}, then the +result is @racket[#f].} @defproc[(variable-reference->phase [varref variable-reference?]) exact-nonnegative-integer?]{ -Returns the @tech{phase} of the variable referenced by @scheme[varref].} +Returns the @tech{phase} of the variable referenced by @racket[varref].} diff --git a/collects/scribblings/reference/numbers.scrbl b/collects/scribblings/reference/numbers.scrbl index ea6b54301f..df4c48cf88 100644 --- a/collects/scribblings/reference/numbers.scrbl +++ b/collects/scribblings/reference/numbers.scrbl @@ -549,7 +549,7 @@ Returns the natural logarithm of @racket[z]. The result is normally Returns the sine of @racket[z], where @racket[z] is in radians. The result is normally inexact, but it is exact @racket[0] if @racket[z] - is exact @scheme[0]. + is exact @racket[0]. @mz-examples[(sin 3.14159) (sin 1+05.i)]} @@ -565,7 +565,7 @@ Returns the cosine of @racket[z], where @racket[z] is in radians. Returns the tangent of @racket[z], where @racket[z] is in radians. The result is normally inexact, but it is exact @racket[0] if @racket[z] - is exact @scheme[0]. + is exact @racket[0]. @mz-examples[(tan 0.7854) (tan 1+05.i)]} @@ -573,7 +573,7 @@ Returns the tangent of @racket[z], where @racket[z] is in radians. The @defproc[(asin [z number?]) number?]{ Returns the arcsine in radians of @racket[z]. The result is normally - inexact, but it is exact @racket[0] if @racket[z] is exact @scheme[0]. + inexact, but it is exact @racket[0] if @racket[z] is exact @racket[0]. @mz-examples[(asin 0.25) (asin 1+05.i)]} diff --git a/collects/scribblings/reference/pairs.scrbl b/collects/scribblings/reference/pairs.scrbl index 45468f14b4..63800c7323 100644 --- a/collects/scribblings/reference/pairs.scrbl +++ b/collects/scribblings/reference/pairs.scrbl @@ -81,27 +81,27 @@ @guideintro["pairs"]{pairs and lists} A @deftech{pair} combines exactly two values. The first value is -accessed with the @scheme[car] procedure, and the second value is -accessed with the @scheme[cdr] procedure. Pairs are not mutable (but +accessed with the @racket[car] procedure, and the second value is +accessed with the @racket[cdr] procedure. Pairs are not mutable (but see @secref["mpairs"]). A @deftech{list} is recursively defined: it is either the constant -@scheme[null], or it is a pair whose second value is a list. +@racket[null], or it is a pair whose second value is a list. A list can be used as a single-valued sequence (see @secref["sequences"]). The elements of the list serve as elements -of the sequence. See also @scheme[in-list]. +of the sequence. See also @racket[in-list]. Cyclic data structures can be created using only immutable pairs via -@scheme[read] or @scheme[make-reader-graph]. If starting with a pair -and using some number of @scheme[cdr]s returns to the starting pair, +@racket[read] or @racket[make-reader-graph]. If starting with a pair +and using some number of @racket[cdr]s returns to the starting pair, then the pair is not a list. @; ---------------------------------------- @section{Pair Constructors and Selectors} -@defproc[(pair? [v any/c]) boolean?]{Returns @scheme[#t] if @scheme[v] is -a pair, @scheme[#f] otherwise. +@defproc[(pair? [v any/c]) boolean?]{Returns @racket[#t] if @racket[v] is +a pair, @racket[#f] otherwise. @mz-examples[ (pair? 1) (pair? (cons 1 2)) @@ -110,8 +110,8 @@ a pair, @scheme[#f] otherwise. (pair? '()) ]} -@defproc[(null? [v any/c]) boolean?]{Returns @scheme[#t] if @scheme[v] is -the empty list, @scheme[#f] otherwise. +@defproc[(null? [v any/c]) boolean?]{Returns @racket[#t] if @racket[v] is +the empty list, @racket[#f] otherwise. @mz-examples[ (null? 1) (null? '(1 2)) @@ -120,21 +120,21 @@ the empty list, @scheme[#f] otherwise. ]} @defproc[(cons [a any/c] [d any/c]) pair?]{Returns a newly allocated pair whose first -element is @scheme[a] and second element is @scheme[d]. +element is @racket[a] and second element is @racket[d]. @mz-examples[ (cons 1 2) (cons 1 '()) ]} @defproc[(car [p pair?]) any/c]{Returns the first element of the -pair @scheme[p]. +pair @racket[p]. @mz-examples[ (car '(1 2)) (car (cons 2 3)) ]} @defproc[(cdr [p pair?]) any/c]{Returns the second element of the -pair @scheme[p]. +pair @racket[p]. @mz-examples[ (cdr '(1 2)) (cdr '(1)) @@ -148,7 +148,7 @@ null ]} -@defproc[(list? [v any/c]) boolean?]{Returns @scheme[#t] if @scheme[v] +@defproc[(list? [v any/c]) boolean?]{Returns @racket[#t] if @racket[v] is a list: either the empty list, or a pair whose second element is a list. This procedure effectively takes constant time due to internal caching (so that any necessary traversals of pairs can in principle count as an @@ -161,7 +161,7 @@ null ]} @defproc[(list [v any/c] ...) list?]{Returns a newly allocated list -containing the @scheme[v]s as its elements. +containing the @racket[v]s as its elements. @mz-examples[ (list 1 2 3 4) (list (list 1 2) (list 3 4)) @@ -169,7 +169,7 @@ containing the @scheme[v]s as its elements. @defproc[(list* [v any/c] ... [tail any/c]) any/c]{ -Like @scheme[list], but the last argument is used as the tail of +Like @racket[list], but the last argument is used as the tail of the result, instead of the final element. The result is a list only if the last argument is a list. @mz-examples[ @@ -181,10 +181,10 @@ only if the last argument is a list. [proc (exact-nonnegative-integer? . -> . any)]) list?]{ -Creates a list of @scheme[n] elements by applying @scheme[proc] to the -integers from @scheme[0] to @scheme[(sub1 n)] in order. If -@scheme[_lst] is the resulting list, then @scheme[(list-ref _lst _i)] -is the value produced by @scheme[(proc _i)]. +Creates a list of @racket[n] elements by applying @racket[proc] to the +integers from @racket[0] to @racket[(sub1 n)] in order. If +@racket[_lst] is the resulting list, then @racket[(list-ref _lst _i)] +is the value produced by @racket[(proc _i)]. @mz-examples[ (build-list 10 values) @@ -197,7 +197,7 @@ is the value produced by @scheme[(proc _i)]. @defproc[(length [lst list?]) exact-nonnegative-integer?]{ -Returns the number of elements in @scheme[lst]. +Returns the number of elements in @racket[lst]. @mz-examples[ (length (list 1 2 3 4)) (length '()) @@ -207,13 +207,13 @@ Returns the number of elements in @scheme[lst]. @defproc[(list-ref [lst any/c] [pos exact-nonnegative-integer?]) any/c]{ -Returns the element of @scheme[lst] at position @scheme[pos], where -the list's first element is position @scheme[0]. If the list has -@scheme[pos] or fewer elements, then the +Returns the element of @racket[lst] at position @racket[pos], where +the list's first element is position @racket[0]. If the list has +@racket[pos] or fewer elements, then the @exnraise[exn:fail:contract]. -The @scheme[lst] argument need not actually be a list; @scheme[lst] -must merely start with a chain of at least @scheme[pos] pairs. +The @racket[lst] argument need not actually be a list; @racket[lst] +must merely start with a chain of at least @racket[pos] pairs. @mz-examples[ (list-ref (list 'a 'b 'c) 0) (list-ref (list 'a 'b 'c) 1) @@ -224,12 +224,12 @@ must merely start with a chain of at least @scheme[pos] pairs. @defproc[(list-tail [lst any/c] [pos exact-nonnegative-integer?]) any/c]{ -Returns the list after the first @scheme[pos] elements of -@scheme[lst]. If the list has fewer than @scheme[pos] elements, then +Returns the list after the first @racket[pos] elements of +@racket[lst]. If the list has fewer than @racket[pos] elements, then the @exnraise[exn:fail:contract]. -The @scheme[lst] argument need not actually be a list; @scheme[lst] -must merely start with a chain of at least @scheme[pos] pairs. +The @racket[lst] argument need not actually be a list; @racket[lst] +must merely start with a chain of at least @racket[pos] pairs. @mz-examples[ (list-tail (list 1 2 3 4) 2) ]} @@ -252,7 +252,7 @@ The last argument need not be a list, in which case the result is an @defproc[(reverse [lst list?]) list?]{ -Returns a list that has the same elements as @scheme[lst], but in +Returns a list that has the same elements as @racket[lst], but in reverse order. @mz-examples[ @@ -266,11 +266,11 @@ reverse order. @defproc[(map [proc procedure?] [lst list?] ...+) list?]{ -Applies @scheme[proc] to the elements of the @scheme[lst]s from the - first elements to the last. The @scheme[proc] argument must accept - the same number of arguments as the number of supplied @scheme[lst]s, - and all @scheme[lst]s must have the same number of elements. The - result is a list containing each result of @scheme[proc] in order. +Applies @racket[proc] to the elements of the @racket[lst]s from the + first elements to the last. The @racket[proc] argument must accept + the same number of arguments as the number of supplied @racket[lst]s, + and all @racket[lst]s must have the same number of elements. The + result is a list containing each result of @racket[proc] in order. @mz-examples[ (map (lambda (number) @@ -285,22 +285,22 @@ Applies @scheme[proc] to the elements of the @scheme[lst]s from the @defproc[(andmap [proc procedure?] [lst list?] ...+) any]{ -Similar to @scheme[map], except that +Similar to @racket[map], except that @itemize[ - @item{the result is @scheme[#f] if any application of @scheme[proc] produces - @scheme[#f], in which case @scheme[proc] is not applied to later - elements of the @scheme[lst]s; and} + @item{the result is @racket[#f] if any application of @racket[proc] produces + @racket[#f], in which case @racket[proc] is not applied to later + elements of the @racket[lst]s; and} - @item{the result is that of @scheme[proc] applied to the last elements - of the @scheme[lst]s; more specifically, the application of - @scheme[proc] to the last elements in the @scheme[lst]s is in tail - position with respect to the @scheme[andmap] call.} + @item{the result is that of @racket[proc] applied to the last elements + of the @racket[lst]s; more specifically, the application of + @racket[proc] to the last elements in the @racket[lst]s is in tail + position with respect to the @racket[andmap] call.} ] -If the @scheme[lst]s are empty, then @scheme[#t] is returned.} +If the @racket[lst]s are empty, then @racket[#t] is returned.} @mz-examples[ (andmap positive? '(1 2 3)) @@ -313,23 +313,23 @@ If the @scheme[lst]s are empty, then @scheme[#t] is returned.} @defproc[(ormap [proc procedure?] [lst list?] ...+) any]{ -Similar to @scheme[map], except that +Similar to @racket[map], except that @itemize[ - @item{the result is @scheme[#f] if every application of @scheme[proc] produces - @scheme[#f]; and} + @item{the result is @racket[#f] if every application of @racket[proc] produces + @racket[#f]; and} - @item{the result is that of the first application of @scheme[proc] producing a - value other than @scheme[#f], in which case @scheme[proc] is not - applied to later elements of the @scheme[lst]s; - the application of @scheme[proc] to the last elements of the - @scheme[lst]s is in tail position with respect to the - @scheme[ormap] call.} + @item{the result is that of the first application of @racket[proc] producing a + value other than @racket[#f], in which case @racket[proc] is not + applied to later elements of the @racket[lst]s; + the application of @racket[proc] to the last elements of the + @racket[lst]s is in tail position with respect to the + @racket[ormap] call.} ] -If the @scheme[lst]s are empty, then @scheme[#f] is returned.} +If the @racket[lst]s are empty, then @racket[#f] is returned.} @mz-examples[ (ormap eq? '(a b c) '(a b c)) @@ -341,7 +341,7 @@ If the @scheme[lst]s are empty, then @scheme[#f] is returned.} @defproc[(for-each [proc procedure?] [lst list?] ...+) void?]{ -Similar to @scheme[map], but @scheme[proc] is called only for its +Similar to @racket[map], but @racket[proc] is called only for its effect, and its result (which can be any number of values) is ignored. @@ -356,24 +356,24 @@ Similar to @scheme[map], but @scheme[proc] is called only for its @defproc[(foldl [proc procedure?] [init any/c] [lst list?] ...+) any/c]{ -Like @scheme[map], @scheme[foldl] applies a procedure to the - elements of one or more lists. Whereas @scheme[map] combines the return - values into a list, @scheme[foldl] combines the return values in an - arbitrary way that is determined by @scheme[proc]. +Like @racket[map], @racket[foldl] applies a procedure to the + elements of one or more lists. Whereas @racket[map] combines the return + values into a list, @racket[foldl] combines the return values in an + arbitrary way that is determined by @racket[proc]. -If @scheme[foldl] is called with @math{n} lists, then @scheme[proc] +If @racket[foldl] is called with @math{n} lists, then @racket[proc] must take @math{n+1} arguments. The extra argument is the combined - return values so far. The @scheme[proc] is initially invoked with the - first item of each list, and the final argument is @scheme[init]. In - subsequent invocations of @scheme[proc], the last argument is the - return value from the previous invocation of @scheme[proc]. The input - @scheme[lst]s are traversed from left to right, and the result of the - whole @scheme[foldl] application is the result of the last - application of @scheme[proc]. If the @scheme[lst]s are empty, the - result is @scheme[init]. + return values so far. The @racket[proc] is initially invoked with the + first item of each list, and the final argument is @racket[init]. In + subsequent invocations of @racket[proc], the last argument is the + return value from the previous invocation of @racket[proc]. The input + @racket[lst]s are traversed from left to right, and the result of the + whole @racket[foldl] application is the result of the last + application of @racket[proc]. If the @racket[lst]s are empty, the + result is @racket[init]. -Unlike @scheme[foldr], @scheme[foldl] processes the @scheme[lst]s in - constant space (plus the space for each call to @scheme[proc]). +Unlike @racket[foldr], @racket[foldl] processes the @racket[lst]s in + constant space (plus the space for each call to @racket[proc]). @mz-examples[ (foldl cons '() '(1 2 3 4)) @@ -388,10 +388,10 @@ Unlike @scheme[foldr], @scheme[foldl] processes the @scheme[lst]s in @defproc[(foldr [proc procedure?] [init any/c] [lst list?] ...+) any/c]{ -Like @scheme[foldl], but the lists are traversed from right to left. - Unlike @scheme[foldl], @scheme[foldr] processes the @scheme[lst]s in - space proportional to the length of @scheme[lst]s (plus the space for - each call to @scheme[proc]). +Like @racket[foldl], but the lists are traversed from right to left. + Unlike @racket[foldl], @racket[foldr] processes the @racket[lst]s in + space proportional to the length of @racket[lst]s (plus the space for + each call to @racket[proc]). @mz-examples[ (foldr cons '() '(1 2 3 4)) @@ -404,8 +404,8 @@ Like @scheme[foldl], but the lists are traversed from right to left. @defproc[(filter [pred procedure?] [lst list?]) list?]{ -Returns a list with the elements of @scheme[lst] for which - @scheme[pred] produces a true value. The @scheme[pred] procedure is +Returns a list with the elements of @racket[lst] for which + @racket[pred] produces a true value. The @racket[pred] procedure is applied to each element from first to last. @mz-examples[ @@ -416,9 +416,9 @@ Returns a list with the elements of @scheme[lst] for which @defproc[(remove [v any/c] [lst list?] [proc procedure? equal?]) list?]{ -Returns a list that is like @scheme[lst], omitting the first element - of @scheme[lst] that is equal to @scheme[v] using the comparison - procedure @scheme[proc] (which must accept two arguments). +Returns a list that is like @racket[lst], omitting the first element + of @racket[lst] that is equal to @racket[v] using the comparison + procedure @racket[proc] (which must accept two arguments). @mz-examples[ (remove 2 (list 1 2 3 2 4)) @@ -432,7 +432,7 @@ Returns a list that is like @scheme[lst], omitting the first element @defproc[(remq [v any/c] [lst list?]) list?]{ -Returns @scheme[(remove v lst eq?)]. +Returns @racket[(remove v lst eq?)]. @mz-examples[ (remq 2 (list 1 2 3 4 5)) (remq '(2) (list '(1) '(2) '(3))) @@ -444,7 +444,7 @@ Returns @scheme[(remove v lst eq?)]. @defproc[(remv [v any/c] [lst list?]) list?]{ -Returns @scheme[(remove v lst eqv?)]. +Returns @racket[(remove v lst eqv?)]. @mz-examples[ (remv 2 (list 1 2 3 4 5)) (remv '(2) (list '(1) '(2) '(3))) @@ -456,8 +456,8 @@ Returns @scheme[(remove v lst eqv?)]. @defproc[(remove* [v-lst list?] [lst list?] [proc procedure? equal?]) list?]{ -Like @scheme[remove], but removes from @scheme[lst] every instance of -every element of @scheme[v-lst]. +Like @racket[remove], but removes from @racket[lst] every instance of +every element of @racket[v-lst]. @mz-examples[ (remove* (list 1 2) (list 1 2 3 2 4 5 2)) ]} @@ -466,7 +466,7 @@ every element of @scheme[v-lst]. @defproc[(remq* [v-lst list?] [lst list?]) list?]{ -Returns @scheme[(remove* v-lst lst eq?)]. +Returns @racket[(remove* v-lst lst eq?)]. @mz-examples[ (remq* (list 1 2) (list 1 2 3 2 4 5 2)) @@ -476,7 +476,7 @@ Returns @scheme[(remove* v-lst lst eq?)]. @defproc[(remv* [v-lst list?] [lst list?]) list?]{ -Returns @scheme[(remove* v-lst lst eqv?)]. +Returns @racket[(remove* v-lst lst eqv?)]. @mz-examples[ (remv* (list 1 2) (list 1 2 3 2 4 5 2)) ]} @@ -487,40 +487,40 @@ Returns @scheme[(remove* v-lst lst eqv?)]. [#:cache-keys? cache-keys? boolean? #f]) list?]{ -Returns a list sorted according to the @scheme[less-than?] procedure, - which takes two elements of @scheme[lst] and returns a true value if +Returns a list sorted according to the @racket[less-than?] procedure, + which takes two elements of @racket[lst] and returns a true value if the first is less (i.e., should be sorted earlier) than the second. -The sort is stable; if two elements of @scheme[lst] are ``equal'' - (i.e., @scheme[proc] does not return a true value when given the pair +The sort is stable; if two elements of @racket[lst] are ``equal'' + (i.e., @racket[proc] does not return a true value when given the pair in either order), then the elements preserve their relative order - from @scheme[lst] in the output list. To preserve this guarantee, - use @scheme[sort] with a strict comparison functions (e.g., - @scheme[<] or @scheme[string arg 9)) @@ -597,10 +597,10 @@ Like @scheme[memf], but returns the element or @scheme[#f] [is-equal? (any/c any/c -> any/c) equal?]) (or/c pair? #f)]{ -Locates the first element of @scheme[lst] whose @scheme[car] is - equal to @scheme[v] according to @scheme[is-equal?]. If such an element exists, the pair - (i.e., an element of @scheme[lst]) is returned. Otherwise, the result - is @scheme[#f]. +Locates the first element of @racket[lst] whose @racket[car] is + equal to @racket[v] according to @racket[is-equal?]. If such an element exists, the pair + (i.e., an element of @racket[lst]) is returned. Otherwise, the result + is @racket[#f]. @mz-examples[ (assoc 3 (list (list 1 2) (list 3 4) (list 5 6))) (assoc 9 (list (list 1 2) (list 3 4) (list 5 6))) @@ -613,7 +613,7 @@ Locates the first element of @scheme[lst] whose @scheme[car] is @defproc[(assv [v any/c] [lst (listof pair?)]) (or/c pair? #f)]{ -Like @scheme[assoc], but finds an element using @scheme[eqv?]. +Like @racket[assoc], but finds an element using @racket[eqv?]. @mz-examples[ (assv 3 (list (list 1 2) (list 3 4) (list 5 6))) ]} @@ -622,7 +622,7 @@ Like @scheme[assoc], but finds an element using @scheme[eqv?]. @defproc[(assq [v any/c] [lst (listof pair?)]) (or/c pair? #f)]{ -Like @scheme[assoc], but finds an element using @scheme[eq?]. +Like @racket[assoc], but finds an element using @racket[eq?]. @mz-examples[ (assq 3 (list (list 1 2) (list 3 4) (list 5 6))) ]} @@ -631,9 +631,9 @@ Like @scheme[assoc], but finds an element using @scheme[eq?]. @defproc[(assf [proc procedure?] [lst list?]) (or/c list? #f)]{ -Like @scheme[assoc], but finds an element using the predicate - @scheme[proc]; an element is found when @scheme[proc] applied to the - @scheme[car] of an @scheme[lst] element returns a true value. +Like @racket[assoc], but finds an element using the predicate + @racket[proc]; an element is found when @racket[proc] applied to the + @racket[car] of an @racket[lst] element returns a true value. @mz-examples[ (assf (lambda (arg) (> arg 2)) @@ -690,26 +690,26 @@ empty ]} @defproc[(cons? [v any/c]) boolean?]{ -The same as @scheme[(pair? v)]. +The same as @racket[(pair? v)]. @mz-examples[#:eval list-eval (cons? '(1 2)) ]} @defproc[(empty? [v any/c]) boolean?]{ -The same as @scheme[(null? v)]. +The same as @racket[(null? v)]. @mz-examples[#:eval list-eval (empty? '(1 2)) (empty? '()) ]} @defproc[(first [lst list?]) any/c]{ -The same as @scheme[(car lst)], but only for lists (that are not empty). +The same as @racket[(car lst)], but only for lists (that are not empty). @mz-examples[#:eval list-eval (first '(1 2 3 4 5 6 7 8 9 10)) ]} @defproc[(rest [lst list?]) list?]{ -The same as @scheme[(cdr lst)], but only for lists (that are not empty). +The same as @racket[(cdr lst)], but only for lists (that are not empty). @mz-examples[#:eval list-eval (rest '(1 2 3 4 5 6 7 8 9 10)) @@ -772,19 +772,19 @@ Returns the last pair of a (possibly improper) list. ]} @defproc[(make-list [k exact-nonnegative-integer?] [v any?]) list?]{ -Returns a newly constructed list of length @scheme[k], holding -@scheme[v] in all positions. +Returns a newly constructed list of length @racket[k], holding +@racket[v] in all positions. @mz-examples[#:eval list-eval (make-list 7 'foo)]} @defproc[(take [lst any/c] [pos exact-nonnegative-integer?]) list?]{ -Returns a fresh list whose elements are the first @scheme[pos] elements of -@scheme[lst]. If @scheme[lst] has fewer than -@scheme[pos] elements, the @exnraise[exn:fail:contract]. +Returns a fresh list whose elements are the first @racket[pos] elements of +@racket[lst]. If @racket[lst] has fewer than +@racket[pos] elements, the @exnraise[exn:fail:contract]. -The @scheme[lst] argument need not actually be a list; @scheme[lst] -must merely start with a chain of at least @scheme[pos] pairs. +The @racket[lst] argument need not actually be a list; @racket[lst] +must merely start with a chain of at least @racket[pos] pairs. @mz-examples[#:eval list-eval (take '(1 2 3 4) 2) @@ -792,23 +792,23 @@ must merely start with a chain of at least @scheme[pos] pairs. ]} @defproc[(drop [lst any/c] [pos exact-nonnegative-integer?]) any/c]{ -Just like @scheme[list-tail].} +Just like @racket[list-tail].} @defproc[(split-at [lst any/c] [pos exact-nonnegative-integer?]) (values list? any/c)]{ Returns the same result as -@schemeblock[(values (take lst pos) (drop lst pos))] +@racketblock[(values (take lst pos) (drop lst pos))] except that it can be faster.} @defproc[(take-right [lst any/c] [pos exact-nonnegative-integer?]) any/c]{ -Returns the @scheme[list]'s @scheme[pos]-length tail. If @scheme[lst] -has fewer than @scheme[pos] elements, then the +Returns the @racket[list]'s @racket[pos]-length tail. If @racket[lst] +has fewer than @racket[pos] elements, then the @exnraise[exn:fail:contract]. -The @scheme[lst] argument need not actually be a list; @scheme[lst] -must merely end with a chain of at least @scheme[pos] pairs. +The @racket[lst] argument need not actually be a list; @racket[lst] +must merely end with a chain of at least @racket[pos] pairs. @mz-examples[#:eval list-eval (take-right '(1 2 3 4) 2) @@ -816,12 +816,12 @@ must merely end with a chain of at least @scheme[pos] pairs. ]} @defproc[(drop-right [lst any/c] [pos exact-nonnegative-integer?]) list?]{ -Returns a fresh list whose elements are the prefix of @scheme[lst], -dropping its @scheme[pos]-length tail. If @scheme[lst] has fewer than -@scheme[pos] elements, then the @exnraise[exn:fail:contract]. +Returns a fresh list whose elements are the prefix of @racket[lst], +dropping its @racket[pos]-length tail. If @racket[lst] has fewer than +@racket[pos] elements, then the @exnraise[exn:fail:contract]. -The @scheme[lst] argument need not actually be a list; @scheme[lst] -must merely end with a chain of at least @scheme[pos] pairs. +The @racket[lst] argument need not actually be a list; @racket[lst] +must merely end with a chain of at least @racket[pos] pairs. @mz-examples[#:eval list-eval (drop-right '(1 2 3 4) 2) @@ -832,7 +832,7 @@ must merely end with a chain of at least @scheme[pos] pairs. (values list? any/c)]{ Returns the same result as -@schemeblock[(values (drop-right lst pos) (take-right lst pos))] +@racketblock[(values (drop-right lst pos) (take-right lst pos))] except that it can be faster. @@ -843,8 +843,8 @@ except that it can be faster. @defproc[(add-between [lst list?] [v any/c]) list?]{ -Returns a list with the same elements as @scheme[lst], but with -@scheme[v] between each pair of items in @scheme[lst]. +Returns a list with the same elements as @racket[lst], but with +@racket[v] between each pair of items in @racket[lst]. @mz-examples[#:eval list-eval (add-between '(x y z) 'or) @@ -855,11 +855,11 @@ Returns a list with the same elements as @scheme[lst], but with [(append* [lst list?] ... [lsts list?]) any/c])]{ @; Note: this is exactly the same description as the one for string-append* -Like @scheme[append], but the last argument is used as a list of -arguments for @scheme[append], so @scheme[(append* lst ... lsts)] is the -same as @scheme[(apply append lst ... lsts)]. In other words, the -relationship between @scheme[append] and @scheme[append*] is similar -to the one between @scheme[list] and @scheme[list*]. +Like @racket[append], but the last argument is used as a list of +arguments for @racket[append], so @racket[(append* lst ... lsts)] is the +same as @racket[(apply append lst ... lsts)]. In other words, the +relationship between @racket[append] and @racket[append*] is similar +to the one between @racket[list] and @racket[list*]. @mz-examples[#:eval list-eval (append* '(a) '(b) '((c) (d))) @@ -871,9 +871,9 @@ to the one between @scheme[list] and @scheme[list*]. list?]{ Flattens an arbitrary S-expression structure of pairs into a -list. More precisely, @scheme[v] is treated as a binary tree where +list. More precisely, @racket[v] is treated as a binary tree where pairs are interior nodes, and the resulting list contains all of the -non-@scheme[null] leaves of the tree in the same order as an inorder +non-@racket[null] leaves of the tree in the same order as an inorder traversal. @mz-examples[#:eval list-eval @@ -887,15 +887,15 @@ traversal. (lambda (x) x)]) list?]{ -Returns a list that has all items in @scheme[lst], but without -duplicate items, where @scheme[same?] determines whether two elements +Returns a list that has all items in @racket[lst], but without +duplicate items, where @racket[same?] determines whether two elements of the list are equivalent. The resulting list is in the same order -as @scheme[lst], and for any item that occurs multiple times, the +as @racket[lst], and for any item that occurs multiple times, the first one is kept. -The @scheme[#:key] argument @scheme[extract-key] is used to extract a +The @racket[#:key] argument @racket[extract-key] is used to extract a key value from each list element, so two items are considered equal if - @scheme[(same? (extract-key x) (extract-key y))] is true. + @racket[(same? (extract-key x) (extract-key y))] is true. @mz-examples[#:eval list-eval (remove-duplicates '(a b b a)) @@ -906,7 +906,7 @@ The @scheme[#:key] argument @scheme[extract-key] is used to extract a @defproc[(filter-map [proc procedure?] [lst list?] ...+) list?]{ -Returns @scheme[(filter (lambda (x) x) (map proc lst ...))], but +Returns @racket[(filter (lambda (x) x) (map proc lst ...))], but without building the intermediate list. @mz-examples[#:eval list-eval @@ -916,7 +916,7 @@ without building the intermediate list. @defproc[(count [proc procedure?] [lst list?] ...+) exact-nonnegative-integer?]{ -Returns @scheme[(length (filter proc lst ...))], but without building +Returns @racket[(length (filter proc lst ...))], but without building the intermediate list. @mz-examples[#:eval list-eval @@ -927,15 +927,15 @@ the intermediate list. @defproc[(partition [pred procedure?] [lst list?]) (values list? list?)]{ -Similar to @scheme[filter], except that two values are returned: the -items for which @scheme[pred] returns a true value, and the items for -which @scheme[pred] returns @scheme[#f]. +Similar to @racket[filter], except that two values are returned: the +items for which @racket[pred] returns a true value, and the items for +which @racket[pred] returns @racket[#f]. The result is the same as -@schemeblock[(values (filter pred lst) (filter (negate pred) lst))] +@racketblock[(values (filter pred lst) (filter (negate pred) lst))] -but @scheme[pred] is applied to each item in @scheme[lst] only once. +but @racket[pred] is applied to each item in @racket[lst] only once. @mz-examples[#:eval list-eval (partition even? '(1 2 3 4 5 6)) @@ -945,7 +945,7 @@ but @scheme[pred] is applied to each item in @scheme[lst] only once. @defproc[(append-map [proc procedure?] [lst list?] ...+) list?]{ -Returns @scheme[(append* (map proc lst ...))]. +Returns @racket[(append* (map proc lst ...))]. @mz-examples[#:eval list-eval (append-map vector->list '(#(1) #(2 3) #(4))) @@ -955,9 +955,9 @@ Returns @scheme[(append* (map proc lst ...))]. @defproc[(filter-not [pred (any/c . -> . any/c)] [lst list?]) list?]{ -Like @scheme[filter], but the meaning of the @scheme[pred] predicate -is reversed: the result is a list of all items for which @scheme[pred] -returns @scheme[#f]. +Like @racket[filter], but the meaning of the @racket[pred] predicate +is reversed: the result is a list of all items for which @racket[pred] +returns @racket[#f]. @mz-examples[#:eval list-eval (filter-not even? '(1 2 3 4 5 6)) @@ -975,8 +975,8 @@ Returns a list with all elements from @racket[lst], randomly shuffled. @defproc[(argmin [proc (-> any/c real?)] [lst (and/c pair? list?)]) any/c]{ -Returns the first element in the list @scheme[lst] that minimizes -the result of @scheme[proc]. Signals an error on an empty list. +Returns the first element in the list @racket[lst] that minimizes +the result of @racket[proc]. Signals an error on an empty list. @mz-examples[#:eval list-eval (argmin car '((3 pears) (1 banana) (2 apples))) @@ -985,8 +985,8 @@ the result of @scheme[proc]. Signals an error on an empty list. @defproc[(argmax [proc (-> any/c real?)] [lst (and/c pair? list?)]) any/c]{ -Returns the first element in the list @scheme[lst] that maximizes -the result of @scheme[proc]. Signals an error on an empty list. +Returns the first element in the list @racket[lst] that maximizes +the result of @racket[proc]. Signals an error on an empty list. @mz-examples[#:eval list-eval (argmax car '((3 pears) (1 banana) (2 apples))) @@ -1000,16 +1000,16 @@ the result of @scheme[proc]. Signals an error on an empty list. @defproc[(make-reader-graph [v any/c]) any/c]{ -Returns a value like @scheme[v], with placeholders created by -@scheme[make-placeholder] replaced with the values that they contain, -and with placeholders created by @scheme[make-hash-placeholder] -with an immutable hash table. No part of @scheme[v] is mutated; -instead, parts of @scheme[v] are copied as necessary to construct +Returns a value like @racket[v], with placeholders created by +@racket[make-placeholder] replaced with the values that they contain, +and with placeholders created by @racket[make-hash-placeholder] +with an immutable hash table. No part of @racket[v] is mutated; +instead, parts of @racket[v] are copied as necessary to construct the resulting graph, where at most one copy is created for any given value. Since the copied values can be immutable, and since the copy is also -immutable, @scheme[make-reader-graph] can create cycles involving only +immutable, @racket[make-reader-graph] can create cycles involving only immutable pairs, vectors, boxes, and hash tables. Only the following kinds of values are copied and traversed to detect @@ -1027,13 +1027,13 @@ placeholders: @item{instances of a @techlink{prefab} structure type} - @item{placeholders created by @scheme[make-placeholder] and - @scheme[make-hash-placeholder]} + @item{placeholders created by @racket[make-placeholder] and + @racket[make-hash-placeholder]} ] -Due to these restrictions, @scheme[make-reader-graph] creates exactly -the same sort of cyclic values as @scheme[read]. +Due to these restrictions, @racket[make-reader-graph] creates exactly +the same sort of cyclic values as @racket[read]. @mz-examples[ (let* ([ph (make-placeholder #f)] @@ -1044,45 +1044,45 @@ the same sort of cyclic values as @scheme[read]. @defproc[(placeholder? [v any/c]) boolean?]{ -Returns @scheme[#t] if @scheme[v] is a placeholder created by -@scheme[make-placeholder], @scheme[#f] otherwise.} +Returns @racket[#t] if @racket[v] is a placeholder created by +@racket[make-placeholder], @racket[#f] otherwise.} @defproc[(make-placeholder [v any/c]) placeholder?]{ -Returns a placeholder for use with @scheme[placeholder-set!] and -@scheme[make-reader-graph]. The @scheme[v] argument supplies the +Returns a placeholder for use with @racket[placeholder-set!] and +@racket[make-reader-graph]. The @racket[v] argument supplies the initial value for the placeholder.} @defproc[(placeholder-set! [ph placeholder?] [datum any/c]) void?]{ -Changes the value of @scheme[ph] to @scheme[v].} +Changes the value of @racket[ph] to @racket[v].} @defproc[(placeholder-get [ph placeholder?]) any/c]{ -Returns the value of @scheme[ph].} +Returns the value of @racket[ph].} @defproc[(hash-placeholder? [v any/c]) boolean?]{ -Returns @scheme[#t] if @scheme[v] is a placeholder created by -@scheme[make-hash-placeholder], @scheme[#f] otherwise.} +Returns @racket[#t] if @racket[v] is a placeholder created by +@racket[make-hash-placeholder], @racket[#f] otherwise.} @defproc[(make-hash-placeholder [assocs (listof pair?)]) hash-placeholder?]{ -Like @scheme[make-immutable-hash], but produces a table placeholder -for use with @scheme[make-reader-graph].} +Like @racket[make-immutable-hash], but produces a table placeholder +for use with @racket[make-reader-graph].} @defproc[(make-hasheq-placeholder [assocs (listof pair?)]) hash-placeholder?]{ -Like @scheme[make-immutable-hasheq], but produces a table placeholder -for use with @scheme[make-reader-graph].} +Like @racket[make-immutable-hasheq], but produces a table placeholder +for use with @racket[make-reader-graph].} @defproc[(make-hasheqv-placeholder [assocs (listof pair?)]) hash-placeholder?]{ -Like @scheme[make-immutable-hasheqv], but produces a table placeholder -for use with @scheme[make-reader-graph].} +Like @racket[make-immutable-hasheqv], but produces a table placeholder +for use with @racket[make-reader-graph].} diff --git a/collects/scribblings/reference/parameters.scrbl b/collects/scribblings/reference/parameters.scrbl index 15d1329152..f504c9e17d 100644 --- a/collects/scribblings/reference/parameters.scrbl +++ b/collects/scribblings/reference/parameters.scrbl @@ -10,7 +10,7 @@ parameter model. Parameters correspond to @defterm{preserved thread fluids} in Scsh @cite["Gasbichler02"]. To parameterize code in a thread- and continuation-friendly manner, -use @scheme[parameterize]. The @scheme[parameterize] form introduces a +use @racket[parameterize]. The @racket[parameterize] form introduces a fresh @tech{thread cell} for the dynamic extent of its body expressions. @@ -19,7 +19,7 @@ thread's initial continuation is the @tech{parameterization} of the creator thread. Since each parameter's @tech{thread cell} is @tech{preserved}, the new thread ``inherits'' the parameter values of its creating thread. When a continuation is moved from one thread to -another, settings introduced with @scheme[parameterize] effectively +another, settings introduced with @racket[parameterize] effectively move with the continuation. In contrast, direct assignment to a parameter (by calling the @@ -27,7 +27,7 @@ parameter procedure with a value) changes the value in a thread cell, and therefore changes the setting only for the current thread. Consequently, as far as the memory manager is concerned, the value originally associated with a parameter through -@scheme[parameterize] remains reachable as long the continuation is +@racket[parameterize] remains reachable as long the continuation is reachable, even if the parameter is mutated. @defproc[(make-parameter [v any/c] @@ -35,40 +35,40 @@ reachable, even if the parameter is mutated. parameter?]{ Returns a new parameter procedure. The value of the parameter is -initialized to @scheme[v] in all threads. If @scheme[guard] is +initialized to @racket[v] in all threads. If @racket[guard] is supplied, it is used as the parameter's guard procedure. A guard procedure takes one argument. Whenever the parameter procedure is applied to an argument, the argument is passed on to the guard procedure. The result returned by the guard procedure is used as the new parameter value. A guard procedure can raise an exception to -reject a change to the parameter's value. The @scheme[guard] is not -applied to the initial @scheme[v].} +reject a change to the parameter's value. The @racket[guard] is not +applied to the initial @racket[v].} @defform[(parameterize ((parameter-expr value-expr) ...) body ...+) #:contracts ([parameter-expr parameter?])]{ -@guideintro["parameterize"]{@scheme[parameterize]} +@guideintro["parameterize"]{@racket[parameterize]} -The result of a @scheme[parameterize] expression is the result of the -last @scheme[body]. The @scheme[parameter-expr]s determine the -parameters to set, and the @scheme[value-expr]s determine the +The result of a @racket[parameterize] expression is the result of the +last @racket[body]. The @racket[parameter-expr]s determine the +parameters to set, and the @racket[value-expr]s determine the corresponding values to install while evaluating the -@scheme[body-expr]s. All of the @scheme[parameter-expr]s are evaluated -first (and checked with @scheme[parameter?]), then all -@scheme[value-expr]s are evaluated, and then the parameters are bound +@racket[body-expr]s. All of the @racket[parameter-expr]s are evaluated +first (and checked with @racket[parameter?]), then all +@racket[value-expr]s are evaluated, and then the parameters are bound in the continuation to preserved thread cells that contain the values -of the @scheme[value-expr]s. The last @scheme[body-expr] is in tail -position with respect to the entire @scheme[parameterize] form. +of the @racket[value-expr]s. The last @racket[body-expr] is in tail +position with respect to the entire @racket[parameterize] form. -Outside the dynamic extent of a @scheme[parameterize] expression, +Outside the dynamic extent of a @racket[parameterize] expression, parameters remain bound to other thread cells. Effectively, therefore, old parameters settings are restored as control exits the -@scheme[parameterize] expression. +@racket[parameterize] expression. If a continuation is captured during the evaluation of -@scheme[parameterize], invoking the continuation effectively +@racket[parameterize], invoking the continuation effectively re-introduces the @tech{parameterization}, since a parameterization is associated to a continuation via a continuation mark (see @secref["contmarks"]) using a private key.} @@ -121,8 +121,8 @@ associated to a continuation via a continuation mark (see @defform[(parameterize* ((parameter-expr value-expr) ...) body ...+)]{ -Analogous to @scheme[let*] compared to @scheme[let], @scheme[parameterize*] -is the same as a nested series of single-parameter @scheme[parameterize] +Analogous to @racket[let*] compared to @racket[let], @racket[parameterize*] +is the same as a nested series of single-parameter @racket[parameterize] forms.} @@ -132,32 +132,32 @@ forms.} parameter?]{ Returns a parameter procedure that sets or retrieves the same value as -@scheme[parameter], but with: +@racket[parameter], but with: @itemize[ - @item{@scheme[guard] applied when setting the parameter (before any - guard associated with @scheme[parameter]), and} + @item{@racket[guard] applied when setting the parameter (before any + guard associated with @racket[parameter]), and} - @item{@scheme[wrap] applied when obtaining the parameter's value.} + @item{@racket[wrap] applied when obtaining the parameter's value.} ] -See also @scheme[chaperone-procedure], which can also be used to guard +See also @racket[chaperone-procedure], which can also be used to guard parameter procedures.} @defproc[(parameter? [v any/c]) boolean?]{ -Returns @scheme[#t] if @scheme[v] is a parameter procedure, -@scheme[#f] otherwise.} +Returns @racket[#t] if @racket[v] is a parameter procedure, +@racket[#f] otherwise.} @defproc[(parameter-procedure=? [a parameter?] [b parameter?]) boolean?]{ -Returns @scheme[#t] if the parameter procedures @scheme[a] and -@scheme[b] always modify the same parameter with the same guards -(although possibly with different @tech{chaperones}), @scheme[#f] +Returns @racket[#t] if the parameter procedures @racket[a] and +@racket[b] always modify the same parameter with the same guards +(although possibly with different @tech{chaperones}), @racket[#f] otherwise.} @@ -167,9 +167,9 @@ current continuation's @tech{parameterization}.} @defproc[(call-with-parameterization [parameterization parameterization?] [thunk (-> any)]) any]{ -Calls @scheme[thunk] (via a tail call) with @scheme[parameterization] +Calls @racket[thunk] (via a tail call) with @racket[parameterization] as the current @tech{parameterization}.} @defproc[(parameterization? [v any/c]) boolean?]{ -Returns @scheme[#t] if @scheme[v] is a @tech{parameterization} -returned by @scheme[current-parameterization], @scheme[#f] otherwise.} +Returns @racket[#t] if @racket[v] is a @tech{parameterization} +returned by @racket[current-parameterization], @racket[#f] otherwise.} diff --git a/collects/scribblings/reference/port-buffers.scrbl b/collects/scribblings/reference/port-buffers.scrbl index 073648d90c..9813500fe9 100644 --- a/collects/scribblings/reference/port-buffers.scrbl +++ b/collects/scribblings/reference/port-buffers.scrbl @@ -13,7 +13,7 @@ internally buffered: immediately-available bytes to speed up future reads. Thus, if a file is modified between a pair of reads to the file, the second read can produce stale data. Calling - @scheme[file-position] to set an input port's file position + @racket[file-position] to set an input port's file position flushes its buffer.} @item{An output port is typically block-buffered by default, though @@ -22,92 +22,92 @@ internally buffered: sequence of written bytes to be committed as a group, either when the buffer is full (in block mode), when a newline is written (in line mode), when the port is closed via - @scheme[close-output-port], or when a flush is explicitly - requested via a procedure like @scheme[flush-output].} + @racket[close-output-port], or when a flush is explicitly + requested via a procedure like @racket[flush-output].} ] If a port supports buffering, its buffer mode can be changed via -@scheme[file-stream-buffer-mode] (even if the port is not a +@racket[file-stream-buffer-mode] (even if the port is not a @tech{file-stream port}). For an input port, peeking always places peeked bytes into the port's -buffer, even when the port's buffer mode is @scheme['none]; +buffer, even when the port's buffer mode is @racket['none]; furthermore, on some platforms, testing the port for input (via -@scheme[char-ready?] or @scheme[sync]) may be implemented with a -peek. If an input port's buffer mode is @scheme['none], then at most -one byte is read for @scheme[read-bytes-avail!*], -@scheme[read-bytes-avail!], @scheme[peek-bytes-avail!*], or -@scheme[peek-bytes-avail!]; if any bytes are buffered in the port +@racket[char-ready?] or @racket[sync]) may be implemented with a +peek. If an input port's buffer mode is @racket['none], then at most +one byte is read for @racket[read-bytes-avail!*], +@racket[read-bytes-avail!], @racket[peek-bytes-avail!*], or +@racket[peek-bytes-avail!]; if any bytes are buffered in the port (e.g., to satisfy a previous peek), the procedures may access multiple buffered bytes, but no further bytes are read. In addition, the initial current output and error ports are -automatically flushed when @scheme[read], @scheme[read-line], -@scheme[read-bytes], @scheme[read-string], etc., are performed on the +automatically flushed when @racket[read], @racket[read-line], +@racket[read-bytes], @racket[read-string], etc., are performed on the initial standard input port; more precisely, flushing is performed by -the default port read handler (see @scheme[port-read-handler]). +the default port read handler (see @racket[port-read-handler]). @defproc[(flush-output [out output-port? (current-output-port)]) void?]{ @index['("ports" "flushing")]{Forces} all buffered data in the given output port to be physically written. Only @tech{file-stream ports}, TCP ports, and custom ports (see @secref["customport"]) use -buffers; when called on a port without a buffer, @scheme[flush-output] +buffers; when called on a port without a buffer, @racket[flush-output] has no effect.} @defproc*[([(file-stream-buffer-mode [port port?]) (or/c 'none 'line 'block #f)] [(file-stream-buffer-mode [port port?] [mode (or/c 'none 'line 'block)]) void?])]{ -Gets or sets the buffer mode for @scheme[port], if +Gets or sets the buffer mode for @racket[port], if possible. @tech{File-stream ports} support setting the buffer mode, TCP ports (see @secref["networking"]) support setting and getting the buffer mode, and custom ports (see @secref["customport"]) may support getting and setting buffer modes. -If @scheme[mode] is provided, it must be one of -@indexed-scheme['none], @indexed-scheme['line] (output only), or -@indexed-scheme['block], and the port's buffering is set +If @racket[mode] is provided, it must be one of +@indexed-racket['none], @indexed-racket['line] (output only), or +@indexed-racket['block], and the port's buffering is set accordingly. If the port does not support setting the mode, the @exnraise[exn:fail]. -If @scheme[mode] is not provided, the current mode is returned, or -@scheme[#f] is returned if the mode cannot be determined. If -@scheme[file-stream-port] is an input port and @scheme[mode] is -@scheme['line], the @exnraise[exn:fail:contract].} +If @racket[mode] is not provided, the current mode is returned, or +@racket[#f] is returned if the mode cannot be determined. If +@racket[file-stream-port] is an input port and @racket[mode] is +@racket['line], the @exnraise[exn:fail:contract].} @defproc*[([(file-position [port port?]) exact-nonnegative-integer?] [(file-position [port port?] [pos (or/c exact-nonnegative-integer? eof-object?)]) void?])]{ -Returns or sets the current read/write position of @scheme[port]. +Returns or sets the current read/write position of @racket[port]. -Calling @scheme[file-position] without a position on a +Calling @racket[file-position] without a position on a non-file/non-string input port returns the number of bytes that have been read from that port if the position is known (see @secref["linecol"]), otherwise the @exnraise[exn:fail:filesystem]. For @tech{file-stream ports} and string ports, the position-setting -variant sets the read/write position to @scheme[pos] relative to the -beginning of the file/string if @scheme[pos] is a number, or to the -current end of the file/string if @scheme[pos] is @scheme[eof]. In -position-setting mode, @scheme[file-position] raises the -@scheme[exn:fail:contract] exception for port kinds other than +variant sets the read/write position to @racket[pos] relative to the +beginning of the file/string if @racket[pos] is a number, or to the +current end of the file/string if @racket[pos] is @racket[eof]. In +position-setting mode, @racket[file-position] raises the +@racket[exn:fail:contract] exception for port kinds other than file-stream and string ports. Furthermore, not all @tech{file-stream -ports} support setting the position; if @scheme[file-position] is +ports} support setting the position; if @racket[file-position] is called with a position argument on such a @tech{file-stream port}, the @exnraise[exn:fail:filesystem]. -When @scheme[file-position] sets the position @scheme[pos] beyond the +When @racket[file-position] sets the position @racket[pos] beyond the current size of an output file or string, the file/string is enlarged -to size @scheme[pos] and the new region is filled with @scheme[0] -bytes. If @scheme[pos] is beyond the end of an input file or string, -then reading thereafter returns @scheme[eof] without changing the +to size @racket[pos] and the new region is filled with @racket[0] +bytes. If @racket[pos] is beyond the end of an input file or string, +then reading thereafter returns @racket[eof] without changing the port's position. When changing the file position for an output port, the port is first flushed if its buffer is not empty. Similarly, setting the position for an input port clears the port's buffer (even if the new position is the same as the old position). However, although input and output -ports produced by @scheme[open-input-output-file] share the file +ports produced by @racket[open-input-output-file] share the file position, setting the position via one port does not flush the other port's buffer.} diff --git a/collects/scribblings/reference/port-procs.scrbl b/collects/scribblings/reference/port-procs.scrbl index 2fdee87e71..3e182e8473 100644 --- a/collects/scribblings/reference/port-procs.scrbl +++ b/collects/scribblings/reference/port-procs.scrbl @@ -4,38 +4,38 @@ @title[#:tag "port-ops"]{Managing Ports} @defproc[(input-port? [v any/c]) boolean?]{ -Returns @scheme[#t] if @scheme[v] is an input port, @scheme[#f] otherwise.} +Returns @racket[#t] if @racket[v] is an input port, @racket[#f] otherwise.} @defproc[(output-port? [v any/c]) boolean?]{ -Returns @scheme[#t] if @scheme[v] is an output port, @scheme[#f] otherwise.} +Returns @racket[#t] if @racket[v] is an output port, @racket[#f] otherwise.} @defproc[(port? [v any/c]) boolean?]{ -Returns @scheme[#t] if either @scheme[(input-port? v)] or -@scheme[(output-port? v)] is @scheme[#t], @scheme[#f] otherwise.} +Returns @racket[#t] if either @racket[(input-port? v)] or +@racket[(output-port? v)] is @racket[#t], @racket[#f] otherwise.} @defproc[(close-input-port [in input-port?]) void?]{ -Closes the input port @scheme[in]. For some kinds of ports, closing +Closes the input port @racket[in]. For some kinds of ports, closing the port releases lower-level resources, such as a file handle. If -the port is already closed, @scheme[close-input-port] has no effect.} +the port is already closed, @racket[close-input-port] has no effect.} @defproc[(close-output-port [out output-port?]) void?]{ -Closes the output port @scheme[out]. For some kinds of ports, closing +Closes the output port @racket[out]. For some kinds of ports, closing the port releases lower-level resources, such as a file handle. Also, if the port is buffered, closing may first flush the port before closing it, and this flushing process can block. If the port is -already closed, @scheme[close-output-port] has no effect.} +already closed, @racket[close-output-port] has no effect.} @defproc[(port-closed? [port port?]) boolean?]{ -Returns @scheme[#t] if the input or output port @scheme[port] is -closed, @scheme[#f] otherwise.} +Returns @racket[#t] if the input or output port @racket[port] is +closed, @racket[#f] otherwise.} @defparam[current-input-port in input-port?]{A parameter that determines a default input port for many operations, such as -@scheme[read].} +@racket[read].} @defparam[current-output-port out output-port?]{A parameter that determines a default output port for many operations, such as -@scheme[write].} +@racket[write].} @defparam[current-error-port out output-port?]{A parameter that determines an output port that is typically used for errors and @@ -43,15 +43,15 @@ logging. For example, the default error display handler writes to this port.} @defproc[(file-stream-port? [port port?]) boolean?]{ -Returns @scheme[#t] if the given port is a @tech{file-stream port} (see -@secref["file-ports"]), @scheme[#f] otherwise.} +Returns @racket[#t] if the given port is a @tech{file-stream port} (see +@secref["file-ports"]), @racket[#f] otherwise.} @defproc[(terminal-port? [port port?]) boolean?]{ -Returns @scheme[#t] if the given port is attached to an interactive -terminal, @scheme[#f] otherwise.} +Returns @racket[#t] if the given port is attached to an interactive +terminal, @racket[#f] otherwise.} @defthing[eof eof-object?]{A value (distinct from all other values) that represents an end-of-file.} -@defproc[(eof-object? [a any/c]) boolean?]{Returns @scheme[#t] if -@scheme[v] is @scheme[eof], @scheme[#f] otherwise.} +@defproc[(eof-object? [a any/c]) boolean?]{Returns @racket[#t] if +@racket[v] is @racket[eof], @racket[#f] otherwise.} diff --git a/collects/scribblings/reference/ports.scrbl b/collects/scribblings/reference/ports.scrbl index d50c1c9188..dc93d4c276 100644 --- a/collects/scribblings/reference/ports.scrbl +++ b/collects/scribblings/reference/ports.scrbl @@ -9,22 +9,22 @@ a character-based operation, the port's bytes are decoded; see When a port corresponds to a file, network connection, or some other system resource, it must be explicitly closed via -@scheme[close-input-port] or @scheme[close-output-port] (or indirectly -via @scheme[custodian-shutdown-all]) to release low-level resources +@racket[close-input-port] or @racket[close-output-port] (or indirectly +via @racket[custodian-shutdown-all]) to release low-level resources associated with the port. For any kind of port, after it is closed, -attempting to read from or write to the port raises @scheme[exn:fail]. +attempting to read from or write to the port raises @racket[exn:fail]. -The global variable @scheme[eof] is bound to the end-of-file value, -and @scheme[eof-object?] returns @scheme[#t] only when applied to this +The global variable @racket[eof] is bound to the end-of-file value, +and @racket[eof-object?] returns @racket[#t] only when applied to this value. Reading from a port produces an end-of-file result when the port has no more data, but some ports may also return end-of-file mid-stream. For example, a port connected to a Unix terminal returns an end-of-file when the user types control-D; if the user provides more input, the port returns additional bytes after the end-of-file. -Every port has a name, as reported by @scheme[object-name]. The name +Every port has a name, as reported by @racket[object-name]. The name can be any value, and it is used mostly for error-reporting -purposes. The @scheme[read-syntax] procedure uses the name of an input +purposes. The @racket[read-syntax] procedure uses the name of an input port as the default source location for the @tech{syntax objects} that it produces. diff --git a/collects/scribblings/reference/pretty-print.scrbl b/collects/scribblings/reference/pretty-print.scrbl index 6f574ffde9..b62539bade 100644 --- a/collects/scribblings/reference/pretty-print.scrbl +++ b/collects/scribblings/reference/pretty-print.scrbl @@ -9,64 +9,64 @@ [quote-depth (or/c 0 1) 0]) void?]{ -Pretty-prints the value @scheme[v] using the same printed form as the -default @scheme[print] mode, but with newlines and whitespace inserted -to avoid lines longer than @scheme[(pretty-print-columns)], as -controlled by @scheme[(pretty-print-current-style-table)]. The printed -form ends in a newline, unless the @scheme[pretty-print-columns] -parameter is set to @scheme['infinity]. +Pretty-prints the value @racket[v] using the same printed form as the +default @racket[print] mode, but with newlines and whitespace inserted +to avoid lines longer than @racket[(pretty-print-columns)], as +controlled by @racket[(pretty-print-current-style-table)]. The printed +form ends in a newline, unless the @racket[pretty-print-columns] +parameter is set to @racket['infinity]. In addition to the parameters defined in this section, -@scheme[pretty-print] conforms to the @scheme[print-graph], -@scheme[print-struct], @scheme[print-hash-table], -@scheme[print-vector-length], @scheme[print-box], and -@scheme[print-as-expression] parameters. +@racket[pretty-print] conforms to the @racket[print-graph], +@racket[print-struct], @racket[print-hash-table], +@racket[print-vector-length], @racket[print-box], and +@racket[print-as-expression] parameters. The pretty printer detects structures that have the -@scheme[prop:custom-write] property and calls the corresponding +@racket[prop:custom-write] property and calls the corresponding custom-write procedure. The custom-write procedure can check the -parameter @scheme[pretty-printing] to cooperate with the +parameter @racket[pretty-printing] to cooperate with the pretty-printer. Recursive printing to the port automatically uses pretty printing, but if the structure has multiple recursively printed sub-expressions, a custom-write procedure may need to cooperate more -to insert explicit newlines. Use @scheme[port-next-location] to -determine the current output column, use @scheme[pretty-print-columns] +to insert explicit newlines. Use @racket[port-next-location] to +determine the current output column, use @racket[pretty-print-columns] to determine the target printing width, and use -@scheme[pretty-print-newline] to insert a newline (so that the -function in the @scheme[pretty-print-print-line] parameter can be +@racket[pretty-print-newline] to insert a newline (so that the +function in the @racket[pretty-print-print-line] parameter can be called appropriately). Use -@scheme[make-tentative-pretty-print-output-port] to obtain a port for +@racket[make-tentative-pretty-print-output-port] to obtain a port for tentative recursive prints (e.g., to check the length of the output).} @defproc[(pretty-write [v any/c] [port output-port? (current-output-port)]) void?]{ -Same as @scheme[pretty-print], but @scheme[v] is printed like -@scheme[write] instead of like @scheme[print].} +Same as @racket[pretty-print], but @racket[v] is printed like +@racket[write] instead of like @racket[print].} @defproc[(pretty-display [v any/c] [port output-port? (current-output-port)]) void?]{ -Same as @scheme[pretty-print], but @scheme[v] is printed like -@scheme[display] instead of like @scheme[print].} +Same as @racket[pretty-print], but @racket[v] is printed like +@racket[display] instead of like @racket[print].} @defproc[(pretty-format [v any/c] [columns exact-nonnegative-integer? (pretty-print-columns)]) string?]{ -Like @scheme[pretty-print], except that it returns a string containing +Like @racket[pretty-print], except that it returns a string containing the pretty-printed value, rather than sending the output to a port. -The optional argument @scheme[columns] argument is used to -parameterize @scheme[pretty-print-columns].} +The optional argument @racket[columns] argument is used to +parameterize @racket[pretty-print-columns].} @defproc[(pretty-print-handler [v any/c]) void?]{ -Pretty-prints @scheme[v] if @scheme[v] is not @|void-const|, or prints -nothing if @scheme[v] is @|void-const|. Pass this procedure to -@scheme[current-print] to install the pretty printer into the REPL run -by @scheme[read-eval-print-loop].} +Pretty-prints @racket[v] if @racket[v] is not @|void-const|, or prints +nothing if @racket[v] is @|void-const|. Pass this procedure to +@racket[current-print] to install the pretty printer into the REPL run +by @racket[read-eval-print-loop].} @; ---------------------------------------------------------------------- @@ -77,7 +77,7 @@ by @scheme[read-eval-print-loop].} A parameter that determines the default width for pretty printing. -If the display width is @scheme['infinity], then pretty-printed output +If the display width is @racket['infinity], then pretty-printed output is never broken into lines, and a newline is not added to the end of the output.} @@ -85,19 +85,19 @@ the output.} @defparam[pretty-print-depth depth (or/c exact-nonnegative-integer? #f)]{ Parameter that controls the default depth for recursive pretty -printing. Printing to @scheme[depth] means that elements nested more -deeply than @scheme[depth] are replaced with ``...''; in particular, a +printing. Printing to @racket[depth] means that elements nested more +deeply than @racket[depth] are replaced with ``...''; in particular, a depth of @racket[0] indicates that only simple values are printed. A depth of -@scheme[#f] (the default) allows printing to arbitrary +@racket[#f] (the default) allows printing to arbitrary depths.} @defboolparam[pretty-print-exact-as-decimal as-decimal?]{ A parameter that determines how exact non-integers are printed. If -the parameter's value is @scheme[#t], then an exact non-integer with a +the parameter's value is @racket[#t], then an exact non-integer with a decimal representation is printed as a decimal number instead of a -fraction. The initial value is @scheme[#f].} +fraction. The initial value is @racket[#f].} @defboolparam[pretty-print-.-symbol-without-bars on?]{ @@ -110,8 +110,8 @@ a period with vertical bars surrounding it.} @defboolparam[pretty-print-show-inexactness show?]{ A parameter that determines how inexact numbers are printed. If the -parameter's value is @scheme[#t], then inexact numbers are always -printed with a leading @litchar{#i}. The initial value is @scheme[#f].} +parameter's value is @racket[#t], then inexact numbers are always +printed with a leading @litchar{#i}. The initial value is @racket[#f].} @; ---------------------------------------------------------------------- @@ -120,25 +120,25 @@ printed with a leading @litchar{#i}. The initial value is @scheme[#f].} @defboolparam[pretty-print-abbreviate-read-macros abbrev?]{ -A parameter that controls whether or not @schemeidfont{quote}, -@schemeidfont{unquote}, @schemeidfont{unquote-splicing}, @|etc|, are +A parameter that controls whether or not @racketidfont{quote}, +@racketidfont{unquote}, @racketidfont{unquote-splicing}, @|etc|, are abbreviated with @litchar{'}, @litchar{,}, @litchar[",@"], etc. By default, the abbreviations are enabled. -See also @scheme[pretty-print-remap-stylable]. +See also @racket[pretty-print-remap-stylable]. } @defproc[(pretty-print-style-table? [v any/c]) boolean?]{ -Returns @scheme[#t] if @scheme[v] is a style table for use with -@scheme[pretty-print-current-style-table], @scheme[#f] otherwise.} +Returns @racket[#t] if @racket[v] is a style table for use with +@racket[pretty-print-current-style-table], @racket[#f] otherwise.} @defparam[pretty-print-current-style-table style-table pretty-print-style-table?]{ A parameter that holds a table of style mappings. See -@scheme[pretty-print-extend-style-table].} +@racket[pretty-print-extend-style-table].} @defproc[(pretty-print-extend-style-table [style-table pretty-print-style-table?] @@ -147,11 +147,11 @@ A parameter that holds a table of style mappings. See pretty-print-style-table?]{ Creates a new style table by extending an existing -@scheme[style-table], so that the style mapping for each symbol of -@scheme[like-symbol-list] in the original table is used for the -corresponding symbol of @scheme[symbol-list] in the new table. The -@scheme[symbol-list] and @scheme[like-symbol-list] lists must have the -same length. The @scheme[style-table] argument can be @scheme[#f], in +@racket[style-table], so that the style mapping for each symbol of +@racket[like-symbol-list] in the original table is used for the +corresponding symbol of @racket[symbol-list] in the new table. The +@racket[symbol-list] and @racket[like-symbol-list] lists must have the +same length. The @racket[style-table] argument can be @racket[#f], in which case the default mappings are used from the original table (see below). @@ -164,7 +164,7 @@ same indentation. The default style mapping includes mappings for the following symbols, so that the output follows popular code-formatting rules: -@schemeblock[ +@racketblock[ 'lambda 'case-lambda 'define 'define-macro 'define-syntax 'let 'letrec 'let* @@ -194,7 +194,7 @@ the reader shorthands. This procedure is called with each sub-expression that appears as the first element in a sequence. If it returns a symbol, the style table is used, as if that -symbol were at the head of the sequence. If it returns @scheme[#f], +symbol were at the head of the sequence. If it returns @racket[#f], the style table is treated normally. Similarly, when determining whether to abbreviate reader macros, this parameter is consulted. @@ -208,12 +208,12 @@ this parameter is consulted. @defproc[(pretty-print-newline [port out-port?] [width exact-nonnegative-integer?]) void?]{ Calls the procedure associated with the -@scheme[pretty-print-print-line] parameter to print a newline to -@scheme[port], if @scheme[port] is the output port that is redirected +@racket[pretty-print-print-line] parameter to print a newline to +@racket[port], if @racket[port] is the output port that is redirected to the original output port for printing, otherwise a plain newline is -printed to @scheme[port]. The @scheme[width] argument should be the +printed to @racket[port]. The @racket[width] argument should be the target column width, typically obtained from -@scheme[pretty-print-columns].} +@racket[pretty-print-columns].} @defparam[pretty-print-print-line proc @@ -228,33 +228,33 @@ A parameter that determines a procedure for printing the newline separator between lines of a pretty-printed value. The procedure is called with four arguments: a new line number, an output port, the old line's length, and the number of destination columns. The return value -from @scheme[proc] is the number of extra characters it printed at the +from @racket[proc] is the number of extra characters it printed at the beginning of the new line. -The @scheme[proc] procedure is called before any characters are -printed with @scheme[0] as the line number and @scheme[0] as the old -line length; @scheme[proc] is called after the last character of a -value has been printed with @scheme[#f] as the line number and with the +The @racket[proc] procedure is called before any characters are +printed with @racket[0] as the line number and @racket[0] as the old +line length; @racket[proc] is called after the last character of a +value has been printed with @racket[#f] as the line number and with the length of the last line. Whenever the pretty-printer starts a new -line, @scheme[proc] is called with the new line's number (where the -first new line is numbered @scheme[1]) and the just-finished line's -length. The destination-columns argument to @scheme[proc] is always +line, @racket[proc] is called with the new line's number (where the +first new line is numbered @racket[1]) and the just-finished line's +length. The destination-columns argument to @racket[proc] is always the total width of the destination printing area, or -@scheme['infinity] if pretty-printed values are not broken into lines. +@racket['infinity] if pretty-printed values are not broken into lines. -The default @scheme[proc] procedure prints a newline whenever the line -number is not @scheme[0] and the column count is not -@scheme['infinity], always returning @scheme[0]. A custom -@scheme[proc] procedure can be used to print extra text before each +The default @racket[proc] procedure prints a newline whenever the line +number is not @racket[0] and the column count is not +@racket['infinity], always returning @racket[0]. A custom +@racket[proc] procedure can be used to print extra text before each line of pretty-printed output; the number of characters printed before -each line should be returned by @scheme[proc] so that the next line +each line should be returned by @racket[proc] so that the next line break can be chosen correctly. -The destination port supplied to @scheme[proc] is generally not the -port supplied to @scheme[pretty-print] or @scheme[pretty-display] (or +The destination port supplied to @racket[proc] is generally not the +port supplied to @racket[pretty-print] or @racket[pretty-display] (or the current output port), but output to this port is ultimately -redirected to the port supplied to @scheme[pretty-print] or -@scheme[pretty-display].} +redirected to the port supplied to @racket[pretty-print] or +@racket[pretty-display].} @; ---------------------------------------------------------------------- @@ -270,18 +270,18 @@ redirected to the port supplied to @scheme[pretty-print] or A parameter that determines a sizing hook for pretty-printing. The sizing hook is applied to each value to be printed. If the hook -returns @scheme[#f], then printing is handled internally by the +returns @racket[#f], then printing is handled internally by the pretty-printer. Otherwise, the value should be an integer specifying the length of the printed value in characters; the print hook will be called to actually print the value (see -@scheme[pretty-print-print-hook]). +@racket[pretty-print-print-hook]). The sizing hook receives three arguments. The first argument is the -value to print. The second argument is a boolean: @scheme[#t] for -printing like @scheme[display] and @scheme[#f] for printing like -@scheme[write]. The third argument is the destination port; the port -is the one supplied to @scheme[pretty-print] or -@scheme[pretty-display] (or the current output port). The sizing hook +value to print. The second argument is a boolean: @racket[#t] for +printing like @racket[display] and @racket[#f] for printing like +@racket[write]. The third argument is the destination port; the port +is the one supplied to @racket[pretty-print] or +@racket[pretty-display] (or the current output port). The sizing hook may be applied to a single value multiple times during pretty-printing.} @@ -291,17 +291,17 @@ pretty-printing.} A parameter that determines a print hook for pretty-printing. The print-hook procedure is applied to a value for printing when the -sizing hook (see @scheme[pretty-print-size-hook]) returns an integer +sizing hook (see @racket[pretty-print-size-hook]) returns an integer size for the value. The print hook receives three arguments. The first argument is the -value to print. The second argument is a boolean: @scheme[#t] for -printing like @scheme[display] and @scheme[#f] for printing like -@scheme[write]. The third argument is the destination port; this port -is generally not the port supplied to @scheme[pretty-print] or -@scheme[pretty-display] (or the current output port), but output to +value to print. The second argument is a boolean: @racket[#t] for +printing like @racket[display] and @racket[#f] for printing like +@racket[write]. The third argument is the destination port; this port +is generally not the port supplied to @racket[pretty-print] or +@racket[pretty-display] (or the current output port), but output to this port is ultimately redirected to the port supplied to -@scheme[pretty-print] or @scheme[pretty-display].} +@racket[pretty-print] or @racket[pretty-display].} @defparam[pretty-print-pre-print-hook proc @@ -309,8 +309,8 @@ this port is ultimately redirected to the port supplied to A parameter that determines a hook procedure to be called just before an object is printed. The hook receives two arguments: the object and -the output port. The port is the one supplied to @scheme[pretty-print] -or @scheme[pretty-display] (or the current output port).} +the output port. The port is the one supplied to @racket[pretty-print] +or @racket[pretty-display] (or the current output port).} @defparam[pretty-print-post-print-hook proc @@ -318,8 +318,8 @@ or @scheme[pretty-display] (or the current output port).} A parameter that determines a hook procedure to be called just after an object is printed. The hook receives two arguments: the object and -the output port. The port is the one supplied to @scheme[pretty-print] -or @scheme[pretty-display] (or the current output port).} +the output port. The port is the one supplied to @racket[pretty-print] +or @racket[pretty-display] (or the current output port).} @; ---------------------------------------------------------------------- @@ -327,11 +327,11 @@ or @scheme[pretty-display] (or the current output port).} @defboolparam[pretty-printing on?]{ -A parameter that is set to @scheme[#t] when the pretty printer calls a -custom-write procedure (see @scheme[prop:custom-write]) for output in +A parameter that is set to @racket[#t] when the pretty printer calls a +custom-write procedure (see @racket[prop:custom-write]) for output in a mode that supports line breaks. When pretty printer calls a custom-write procedure merely to detect cycles or to try to print on a -single line, it sets this parameter to @scheme[#f].} +single line, it sets this parameter to @racket[#f].} @defproc[(make-tentative-pretty-print-output-port @@ -344,45 +344,45 @@ Produces an output port that is suitable for recursive pretty printing without actually producing output. Use such a port to tentatively print when proper output depends on the size of recursive prints. After printing, determine the size of the tentative output -using @scheme[file-position]. +using @racket[file-position]. -The @scheme[out] argument should be a pretty-printing port, such as +The @racket[out] argument should be a pretty-printing port, such as the one supplied to a custom-write procedure when -@scheme[pretty-printing] is set to true, or another tentative output -port. The @scheme[width] argument should be a target column width, -usually obtained from @scheme[pretty-print-columns], possibly +@racket[pretty-printing] is set to true, or another tentative output +port. The @racket[width] argument should be a target column width, +usually obtained from @racket[pretty-print-columns], possibly decremented to leave room for a terminator. The -@scheme[overflow-thunk] procedure is called if more than -@scheme[width] items are printed to the port or if a newline is +@racket[overflow-thunk] procedure is called if more than +@racket[width] items are printed to the port or if a newline is printed to the port via @racket[pretty-print-newline]; it can escape from the recursive print through a continuation as a shortcut, but -@scheme[overflow-thunk] can also return, in which case it is called +@racket[overflow-thunk] can also return, in which case it is called every time afterward that additional output is written to the port. After tentative printing, either accept the result with -@scheme[tentative-pretty-print-port-transfer] or reject it with -@scheme[tentative-pretty-print-port-cancel]. Failure to accept or +@racket[tentative-pretty-print-port-transfer] or reject it with +@racket[tentative-pretty-print-port-cancel]. Failure to accept or cancel properly interferes with graph-structure printing, calls to hook procedures, etc. Explicitly cancel the tentative print even when -@scheme[overflow-thunk] escapes from a recursive print.} +@racket[overflow-thunk] escapes from a recursive print.} @defproc[(tentative-pretty-print-port-transfer [tentative-out output-port?] [orig-out output-port?]) void?]{ -Causes the data written to @scheme[tentative-out] to be transferred as -if written to @scheme[orig-out]. The @scheme[tentative-out] argument +Causes the data written to @racket[tentative-out] to be transferred as +if written to @racket[orig-out]. The @racket[tentative-out] argument should be a port produced by -@scheme[make-tentative-pretty-print-output-port], and -@scheme[orig-out] should be either a pretty-printing port (provided to +@racket[make-tentative-pretty-print-output-port], and +@racket[orig-out] should be either a pretty-printing port (provided to a custom-write procedure) or another tentative output port.} @defproc[(tentative-pretty-print-port-cancel [tentative-out output-port?]) void?]{ -Cancels the content of @scheme[tentative-out], which was produced by -@scheme[make-tentative-pretty-print-output-port]. The main effect of +Cancels the content of @racket[tentative-out], which was produced by +@racket[make-tentative-pretty-print-output-port]. The main effect of canceling is that graph-reference definitions are undone, so that a future print of a graph-referenced object includes the defining @litchar{#}@nonterm{n}@litchar{=}.} diff --git a/collects/scribblings/reference/printer.scrbl b/collects/scribblings/reference/printer.scrbl index 3990dcc26b..a003e4db9f 100644 --- a/collects/scribblings/reference/printer.scrbl +++ b/collects/scribblings/reference/printer.scrbl @@ -17,7 +17,7 @@ The Racket printer supports three modes: without surrounding @litchar{"}s or escapes;} @item{@racket[print] mode by default---when - @scheme[print-as-expression] is @scheme[#t]---prints most + @racket[print-as-expression] is @racket[#t]---prints most datatypes in such a way that evaluating the output as an expression produces a value that is @racket[equal?] to the printed value; when @racket[print-as-expression] is set to @@ -27,27 +27,27 @@ The Racket printer supports three modes: ] In @racket[print] mode when @racket[print-as-expression] is -@scheme[#t] (as is the default), a value prints at a @deftech{quoting -depth} of either @scheme[0] (unquoted) or @scheme[1] (quoted). The +@racket[#t] (as is the default), a value prints at a @deftech{quoting +depth} of either @racket[0] (unquoted) or @racket[1] (quoted). The initial quoting depth is accepted as an optional argument by @racket[print], and printing of some compound datatypes adjusts the print depth for component values. For example, when a list is printed -at quoting depth @scheme[0] and all of its elements are +at quoting depth @racket[0] and all of its elements are @deftech{quotable}, the list is printed with a @litchar{'} prefix, and -the list's elements are printed at quoting depth @scheme[1]. +the list's elements are printed at quoting depth @racket[1]. -When the @scheme[print-graph] parameter is set to @scheme[#t], then +When the @racket[print-graph] parameter is set to @racket[#t], then the printer first scans an object to detect cycles. The scan traverses the components of pairs, mutable pairs, vectors, boxes (when -@scheme[print-box] is @scheme[#t]), hash tables (when -@scheme[print-hash-table] is @scheme[#t]), fields of structures -exposed by @scheme[struct->vector] (when @scheme[print-struct] is -@scheme[#t]), and fields of structures exposed by printing when the -structure's type has the @scheme[prop:custom-write] property. If -@scheme[print-graph] is @scheme[#t], then this information is used to +@racket[print-box] is @racket[#t]), hash tables (when +@racket[print-hash-table] is @racket[#t]), fields of structures +exposed by @racket[struct->vector] (when @racket[print-struct] is +@racket[#t]), and fields of structures exposed by printing when the +structure's type has the @racket[prop:custom-write] property. If +@racket[print-graph] is @racket[#t], then this information is used to print sharing through graph definitions and references (see @secref["parse-graph"]). If a cycle is detected in the initial scan, -then @scheme[print-graph] is effectively set to @scheme[#t] +then @racket[print-graph] is effectively set to @racket[#t] automatically. With the exception of displaying byte strings, printing is defined in @@ -58,22 +58,22 @@ stream. @section[#:tag "print-symbol"]{Printing Symbols} -Symbols containing spaces or special characters @scheme[write] using +Symbols containing spaces or special characters @racket[write] using escaping @litchar{\} and quoting @litchar{|}s. When the -@scheme[read-case-sensitive] parameter is set to @scheme[#f], then +@racket[read-case-sensitive] parameter is set to @racket[#f], then symbols containing uppercase characters also use escaping @litchar{\} and quoting @litchar{|}s. In addition, symbols are quoted with @litchar{|}s or leading @litchar{\} when they would otherwise print the same as a numerical constant or as a delimited -@litchar{.} (when @scheme[read-accept-dot] is @scheme[#t]). +@litchar{.} (when @racket[read-accept-dot] is @racket[#t]). -When @scheme[read-accept-bar-quote] is @scheme[#t], @litchar{|}s are +When @racket[read-accept-bar-quote] is @racket[#t], @litchar{|}s are used in printing when one @litchar{|} at the beginning and one @litchar{|} at the end suffice to correctly print the symbol. Otherwise, @litchar{\}s are always used to escape special characters, instead of quoting them with @litchar{|}s. -When @scheme[read-accept-bar-quote] is @scheme[#f], then @litchar{|} +When @racket[read-accept-bar-quote] is @racket[#f], then @litchar{|} is not treated as a special character. The following are always special characters: @@ -87,20 +87,20 @@ special characters: In addition, @litchar{#} is a special character when it appears at the beginning of the symbol, and when it is not followed by @litchar{%}. -Symbols @scheme[display] without escaping or quoting special +Symbols @racket[display] without escaping or quoting special characters. That is, the display form of a symbol is the same as the -display form of @scheme[symbol->string] applied to the symbol. +display form of @racket[symbol->string] applied to the symbol. -Symbols @scheme[print] the same as they @scheme[write], unless -@scheme[print-as-expression] is set to @scheme[#t] (as is the default) and the current -@tech{quoting depth} is @scheme[0]. In that case, the symbol's -@scheme[print]ed form is prefixed with @litchar{'}. For the purposes +Symbols @racket[print] the same as they @racket[write], unless +@racket[print-as-expression] is set to @racket[#t] (as is the default) and the current +@tech{quoting depth} is @racket[0]. In that case, the symbol's +@racket[print]ed form is prefixed with @litchar{'}. For the purposes of printing enclosing datatypes, a symbol is @tech{quotable}. @section{Printing Numbers} -A number prints the same way in @scheme[write], @scheme[display], and -@scheme[print] modes. For the purposes of printing enclosing +A number prints the same way in @racket[write], @racket[display], and +@racket[print] modes. For the purposes of printing enclosing datatypes, a symbol is @tech{quotable}. A @tech{complex number} that is not a @tech{real number} always prints @@ -111,56 +111,56 @@ respectively. An inexact real number prints with either a @litchar{.} decimal point, an @litchar{e} exponent marker, or both. The form is selected so that the output is as short as possible, with the constraint that -reading the printed form back in produces an @scheme[equal?] number. +reading the printed form back in produces an @racket[equal?] number. -An exact @scheme[0] prints as @litchar{0}. +An exact @racket[0] prints as @litchar{0}. A positive, exact integer prints as a sequence of decimal digits that -does not start with @scheme[0]. +does not start with @racket[0]. A positive, exact, real, non-integer number prints as @nonterm{m}@litchar{/}@nonterm{n}, where @nonterm{m} and @nonterm{n} are the printed forms of the number's numerator and denominator (as -determined by @scheme[numerator] and @scheme[denominator]). +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} -The constant @scheme[#t] prints as @litchar{#true} or @litchar{#t} in -all modes (@scheme[display], @scheme[write], and @scheme[print]), +The constant @racket[#t] prints as @litchar{#true} or @litchar{#t} in +all modes (@racket[display], @racket[write], and @racket[print]), depending on the value of @racket[print-boolean-long-form], and the -constant @scheme[#f] prints as @litchar{#false} or @litchar{#f}. For +constant @racket[#f] prints as @litchar{#false} or @litchar{#f}. For the purposes of printing enclosing datatypes, a symbol is @tech{quotable}. @section[#:tag "print-pairs"]{Printing Pairs and Lists} -In @scheme[write] and @scheme[display] modes, an empty list prints as +In @racket[write] and @racket[display] modes, an empty list prints as @litchar{()}. A pair normally prints starting with @litchar{(} -followed by the printed form of its @scheme[car]. The rest of the -printed form depends on the @scheme[cdr]: +followed by the printed form of its @racket[car]. The rest of the +printed form depends on the @racket[cdr]: @itemize[ - @item{If the @scheme[cdr] is a pair or the empty list, then the + @item{If the @racket[cdr] is a pair or the empty list, then the printed form of the pair completes with the printed form of the - @scheme[cdr], except that the leading @litchar{(} in the - @scheme[cdr]'s printed form is omitted.} + @racket[cdr], except that the leading @litchar{(} in the + @racket[cdr]'s printed form is omitted.} @item{Otherwise, the printed for of the pair continues with a space, @litchar{.}, another space, the printed form of the - @scheme[cdr], and a @litchar{)}.} + @racket[cdr], and a @litchar{)}.} ] -If @scheme[print-reader-abbreviations] is set to @scheme[#t], then -pair printing in @scheme[write] mode is adjusted in the case of a pair -that starts a two-element list whose first element is @scheme['quote], -@scheme['quasiquote], @scheme['unquote], @scheme['unquote-splicing], -@scheme['syntax], @scheme['quasisyntax], @scheme['unsyntax], or -@scheme['unsyntax-splicing]. In that case, the pair is printed with +If @racket[print-reader-abbreviations] is set to @racket[#t], then +pair printing in @racket[write] mode is adjusted in the case of a pair +that starts a two-element list whose first element is @racket['quote], +@racket['quasiquote], @racket['unquote], @racket['unquote-splicing], +@racket['syntax], @racket['quasisyntax], @racket['unsyntax], or +@racket['unsyntax-splicing]. In that case, the pair is printed with the corresponding reader syntax: @litchar{'}, @litchar{`}, @litchar{,}, @litchar[",@"], @litchar{#'}, @litchar{#`}, @litchar{#,}, or @litchar["#,@"], respectively. After the reader syntax, the second @@ -169,67 +169,67 @@ enclosing list, the tail is printed after a @litchar{.} in the enclosing list (after which the reader abbreviations work), instead of including the tail as two elements of the enclosing list. -The printed form of a pair is the same in both @scheme[write] and -@scheme[display] modes, except as the printed form of the pair's -@scheme[car] and @scheme[cdr] vary with the mode. The @scheme[print] -form is also the same if @scheme[print-as-expression] is @scheme[#f] -or the quoting depth is @scheme[1]. +The printed form of a pair is the same in both @racket[write] and +@racket[display] modes, except as the printed form of the pair's +@racket[car] and @racket[cdr] vary with the mode. The @racket[print] +form is also the same if @racket[print-as-expression] is @racket[#f] +or the quoting depth is @racket[1]. -For @scheme[print] mode when @scheme[print-as-expression] is -@scheme[#t] and the @tech{quoting depth} is @scheme[0], then the empty -list prints as @litchar{'()}. For a pair whose @scheme[car] and -@scheme[cdr] are @tech{quotable}, the pair prints in @scheme[write] +For @racket[print] mode when @racket[print-as-expression] is +@racket[#t] and the @tech{quoting depth} is @racket[0], then the empty +list prints as @litchar{'()}. For a pair whose @racket[car] and +@racket[cdr] are @tech{quotable}, the pair prints in @racket[write] mode but with a @litchar{'} prefix; the pair's content is printed with -@tech{quoting depth} @scheme[1]. Otherwise, when the @scheme[car] or -@scheme[cdr] is not @tech{quotable}, then pair prints with either -@litchar{cons} (when the @scheme[cdr] is not a pair), @litchar{list} +@tech{quoting depth} @racket[1]. Otherwise, when the @racket[car] or +@racket[cdr] is not @tech{quotable}, then pair prints with either +@litchar{cons} (when the @racket[cdr] is not a pair), @litchar{list} (when the pair is a list), or @litchar{list*} (otherwise) after the openining @litchar{(}, any @litchar{.} that would otherwise be printed is suppressed, and the pair content is printed at @tech{quoting depth} -@scheme[0]. In all cases, when @scheme[print-as-expression] is -@scheme[#t] for @scheme[print] mode, then the value of -@scheme[print-reader-abbreviations] is ignored and reader +@racket[0]. In all cases, when @racket[print-as-expression] is +@racket[#t] for @racket[print] mode, then the value of +@racket[print-reader-abbreviations] is ignored and reader abbreviations are always used for lists printed at @tech{quoting -depth} @scheme[1]. +depth} @racket[1]. -By default, mutable pairs (as created with @scheme[mcons]) print the -same as pairs for @scheme[write] and @scheme[display], except that +By default, mutable pairs (as created with @racket[mcons]) print the +same as pairs for @racket[write] and @racket[display], except that @litchar["{"] and @litchar["}"] are used instead of @litchar{(} and @litchar{)}. Note that the reader treats @litchar["{"]...@litchar["}"] and @litchar{(}...@litchar{)} equivalently on input, creating -immutable pairs in both cases. Mutable pairs in @scheme[print] mode with -@scheme[print-as-expression] as @scheme[#f] or a @tech{quoting depth} -of @scheme[1] also use @litchar["{"] and @litchar["}"]. In -@scheme[print] mode with @scheme[print-as-expression] as @scheme[#t] -and a @tech{quoting depth} of @scheme[0], a mutable pair prints as -@litchar{(mcons }, the @scheme[mcar] and @scheme[mcdr] printed at -@tech{quoting depth} @scheme[0] and separated by a space, and a +immutable pairs in both cases. Mutable pairs in @racket[print] mode with +@racket[print-as-expression] as @racket[#f] or a @tech{quoting depth} +of @racket[1] also use @litchar["{"] and @litchar["}"]. In +@racket[print] mode with @racket[print-as-expression] as @racket[#t] +and a @tech{quoting depth} of @racket[0], a mutable pair prints as +@litchar{(mcons }, the @racket[mcar] and @racket[mcdr] printed at +@tech{quoting depth} @racket[0] and separated by a space, and a closing @litchar{)}. -If the @scheme[print-pair-curly-braces] parameter is set to -@scheme[#t], then pairs print using @litchar["{"] and @litchar["}"] -when not using @scheme[print] mode with @scheme[print-as-expression] as -@scheme[#t] and a @tech{quoting depth} of @scheme[0]. If the -@scheme[print-mpair-curly-braces] parameter is set to @scheme[#f], +If the @racket[print-pair-curly-braces] parameter is set to +@racket[#t], then pairs print using @litchar["{"] and @litchar["}"] +when not using @racket[print] mode with @racket[print-as-expression] as +@racket[#t] and a @tech{quoting depth} of @racket[0]. If the +@racket[print-mpair-curly-braces] parameter is set to @racket[#f], then mutable pairs print using @litchar{(} and @litchar{)} in that mode. For the purposes of printing enclosing datatypes, an empty list is always @tech{quotable}, a pair is @tech{quotable} when its -@scheme[car] and @scheme[cdr] are @tech{quotable}, and a mutable list +@racket[car] and @racket[cdr] are @tech{quotable}, and a mutable list is never @tech{quotable}. @section{Printing Strings} -All strings @scheme[display] as their literal character sequences. +All strings @racket[display] as their literal character sequences. -The @scheme[write] or @scheme[print] form of a string starts with @litchar{"} and ends +The @racket[write] or @racket[print] form of a string starts with @litchar{"} and ends with another @litchar{"}. Between the @litchar{"}s, each character is represented. Each graphic or blank character is represented as itself, with two exceptions: @litchar{"} is printed as @litchar{\"}, and @litchar{\} is printed as @litchar{\\}. Each non-graphic, non-blank -character (according to @scheme[char-graphic?] and -@scheme[char-blank?]) is printed using the escape sequences described +character (according to @racket[char-graphic?] and +@racket[char-blank?]) is printed using the escape sequences described in @secref["parse-string"], using @litchar{\a}, @litchar{\b}, @litchar{\t}, @litchar{\n}, @litchar{\v}, @litchar{\f}, @litchar{\r}, or @litchar{\e} if possible, otherwise using @litchar{\u} with four @@ -237,15 +237,15 @@ hexadecimal digits or @litchar{\U} with eight hexadecimal digits (using the latter only if the character value does not fit into four digits). -All byte strings @scheme[display] as their literal byte sequence; this +All byte strings @racket[display] as their literal byte sequence; this byte sequence may not be a valid UTF-8 encoding, so it may not correspond to a sequence of characters. -The @scheme[write] or @scheme[print] form of a byte string starts with @litchar{#"} and +The @racket[write] or @racket[print] form of a byte string starts with @litchar{#"} and ends with a @litchar{"}. Between the @litchar{"}s, each byte is written using the corresponding ASCII decoding if the byte is between 0 and 127 and the character is graphic or blank (according to -@scheme[char-graphic?] and @scheme[char-blank?]). Otherwise, the byte +@racket[char-graphic?] and @racket[char-blank?]). Otherwise, the byte is written using @litchar{\a}, @litchar{\b}, @litchar{\t}, @litchar{\n}, @litchar{\v}, @litchar{\f}, @litchar{\r}, or @litchar{\e} if possible, otherwise using @litchar{\} followed by one @@ -257,102 +257,102 @@ string is @tech{quotable}. @section[#:tag "print-vectors"]{Printing Vectors} -In @scheme[display] mode, the printed form of a vector is @litchar{#} -followed by the printed form of @scheme[vector->list] applied to the -vector. In @scheme[write] mode, the printed form is the same, except -that when the @scheme[print-vector-length] parameter is @scheme[#t], a +In @racket[display] mode, the printed form of a vector is @litchar{#} +followed by the printed form of @racket[vector->list] applied to the +vector. In @racket[write] mode, the printed form is the same, except +that when the @racket[print-vector-length] parameter is @racket[#t], a decimal integer is printed after the @litchar{#}, and a repeated last element is printed only once. -Vectors @scheme[print] the same as they @scheme[write], unless -@scheme[print-as-expression] is set to @scheme[#t] and the current -@tech{quoting depth} is @scheme[0]. In that case, if all of the +Vectors @racket[print] the same as they @racket[write], unless +@racket[print-as-expression] is set to @racket[#t] and the current +@tech{quoting depth} is @racket[0]. In that case, if all of the vector's elements are @tech{quotable}, then the vector's -@scheme[print]ed form is prefixed with @litchar{'} and its elements -printed with @tech{quoting depth} @scheme[1]. If its elements are not +@racket[print]ed form is prefixed with @litchar{'} and its elements +printed with @tech{quoting depth} @racket[1]. If its elements are not all @tech{quotable}, then the vector @racket[print]s as -@litchar["(vector "], the elements at @tech{quoting depth} @scheme[0], +@litchar["(vector "], the elements at @tech{quoting depth} @racket[0], and a closing @litchar{)}. A vector is @tech{quotable} when all of its elements are @tech{quotable}. @section[#:tag "print-structure"]{Printing Structures} -When the @scheme[print-struct] parameter is set to @scheme[#t], then +When the @racket[print-struct] parameter is set to @racket[#t], then the way that structures print depends on details of the structure type for which the structure is an instance: @itemize[ @item{If the structure type is a @tech{prefab} structure type, - then it prints in @scheme[write] or @scheme[display] mode using + then it prints in @racket[write] or @racket[display] mode using @litchar{#s(} followed by the @tech{prefab} structure type key, then the printed form of each field in the structure, and then @litchar{)}. - In @scheme[print] mode when @scheme[print-as-expression] is set - to @scheme[#t] and the current @tech{quoting depth} is - @scheme[0], if the structure's content is all @tech{quotable}, - then the structure's @scheme[print]ed form is prefixed with + In @racket[print] mode when @racket[print-as-expression] is set + to @racket[#t] and the current @tech{quoting depth} is + @racket[0], if the structure's content is all @tech{quotable}, + then the structure's @racket[print]ed form is prefixed with @litchar{'} and its content is printed with @tech{quoting - depth} @scheme[1]. If any of its content is not quotable, then + depth} @racket[1]. If any of its content is not quotable, then the structure type prints the same as a non-@tech{prefab} structure type. An instance of a @tech{prefab} structure type is @tech{quotable} when all of its content is @tech{quotable}.} - @item{If the structure has a @scheme[prop:custom-write] property + @item{If the structure has a @racket[prop:custom-write] property value, then the associated procedure is used to print the structure, unless the @racket[print-unreadable] parameter is set to @racket[#f]. - For @scheme[print] mode, an instance of a structure type with a - @scheme[prop:custom-write] property is treated as + For @racket[print] mode, an instance of a structure type with a + @racket[prop:custom-write] property is treated as @tech{quotable} if it has the - @scheme[prop:custom-print-quotable] property with a value of - @scheme['always]. If it has @scheme['maybe] as the property + @racket[prop:custom-print-quotable] property with a value of + @racket['always]. If it has @racket['maybe] as the property value, then the structure is treated as @tech{quotable} if its content is @tech{quotable}, where the content is determined by the values recursively printed by the structure's - @scheme[prop:custom-write] procedure. Finally, if the structure - has @scheme['self] as the property value, then it is treated as + @racket[prop:custom-write] procedure. Finally, if the structure + has @racket['self] as the property value, then it is treated as @tech{quotable}. - In @scheme[print] mode when @scheme[print-as-expression] is - @scheme[#t], the structure's @scheme[prop:custom-write] - procedure is called with either @scheme[0] or @scheme[1] as the + In @racket[print] mode when @racket[print-as-expression] is + @racket[#t], the structure's @racket[prop:custom-write] + procedure is called with either @racket[0] or @racket[1] as the @tech{quoting depth}, normally depending on the structure's - @scheme[prop:custom-print-quotable] property value. If the - property value is @scheme['always], the @tech{quoting depth} is - normally @scheme[1]. If the property value is @scheme['maybe], - then the @tech{quoting depth} is @scheme[1] if the structure is - @tech{quotable}, or normally @scheme[0] otherwise. If the - property value is @scheme['self], then the quoting depth may be - @scheme[0] or @scheme[1]; it is normally @scheme[0] if the + @racket[prop:custom-print-quotable] property value. If the + property value is @racket['always], the @tech{quoting depth} is + normally @racket[1]. If the property value is @racket['maybe], + then the @tech{quoting depth} is @racket[1] if the structure is + @tech{quotable}, or normally @racket[0] otherwise. If the + property value is @racket['self], then the quoting depth may be + @racket[0] or @racket[1]; it is normally @racket[0] if the structure is not printed as a part of an enclosing @tech{quotable} value, even though the structure is treated as @tech{quotable}. Finally, if the property value is - @scheme['never], then the @tech{quoting depth} is normally - @scheme[0]. The @tech{quoting depth} can vary from its normal + @racket['never], then the @tech{quoting depth} is normally + @racket[0]. The @tech{quoting depth} can vary from its normal value if the structure is printed with an explicit quoting - depth of @scheme[1].} + depth of @racket[1].} @item{If the structure's type is transparent or if any ancestor is - transparent (i.e., @scheme[struct?] on the instance produces - @scheme[#t]), then the structure prints as the vector produced - by @scheme[struct->vector] in @scheme[display] mode, in - @scheme[write] mode, or in @scheme[print] mode when - @scheme[print-as-expression] is set to @scheme[#f] or when the - @tech{quoting depth} is @scheme[0]. + transparent (i.e., @racket[struct?] on the instance produces + @racket[#t]), then the structure prints as the vector produced + by @racket[struct->vector] in @racket[display] mode, in + @racket[write] mode, or in @racket[print] mode when + @racket[print-as-expression] is set to @racket[#f] or when the + @tech{quoting depth} is @racket[0]. - In @scheme[print] mode with @scheme[print-as-expression] as - @scheme[#t] and a @tech{quoting depth} of @scheme[0], the + In @racket[print] mode with @racket[print-as-expression] as + @racket[#t] and a @tech{quoting depth} of @racket[0], the structure content is printed with a @litchar{(} followed by the structure's type name (as determined by - @scheme[object-name]) in @scheme[write] mode; the remaining - elements are @scheme[print]ed at @tech{quoting depth} - @scheme[0] and separated by a space, and finally a closing + @racket[object-name]) in @racket[write] mode; the remaining + elements are @racket[print]ed at @tech{quoting depth} + @racket[0] and separated by a space, and finally a closing @litchar{)}. A transparent structure type that is not a @tech{prefab} @@ -363,76 +363,76 @@ for which the structure is an instance: information.} ] -If the @scheme[print-struct] parameter is set to @scheme[#f], then all -structures without a @scheme[prop:custom-write] property print as +If the @racket[print-struct] parameter is set to @racket[#f], then all +structures without a @racket[prop:custom-write] property print as unreadable values (see @secref["print-unreadable"]) and count as @tech{quotable}. @section[#:tag "print-hashtable"]{Printing Hash Tables} -When the @scheme[print-hash-table] parameter is set to @scheme[#t], in -@scheme[write] and @scheme[display] modes, a hash table prints +When the @racket[print-hash-table] parameter is set to @racket[#t], in +@racket[write] and @racket[display] modes, a hash table prints starting with @litchar{#hash(}, @litchar{#hasheqv(}, or -@litchar{#hasheq(} for a table using @scheme[equal?], @scheme[eqv?], -or @scheme[eq?] key comparisons, respectively. After the prefix, each +@litchar{#hasheq(} for a table using @racket[equal?], @racket[eqv?], +or @racket[eq?] key comparisons, respectively. After the prefix, each key--value mapping is shown as @litchar{(}, the printed form of a key, a space, @litchar{.}, a space, the printed form the corresponding value, and @litchar{)}, with an additional space if the key--value pair is not the last to be printed. After all key--value pairs, the printed form completes with @litchar{)}. -In @scheme[print] mode when @scheme[print-as-expression] is -@scheme[#f] or the @tech{quoting depth} is @scheme[1], the printed form -is the same as for @scheme[write]. Otherwise, if the hash table's keys +In @racket[print] mode when @racket[print-as-expression] is +@racket[#f] or the @tech{quoting depth} is @racket[1], the printed form +is the same as for @racket[write]. Otherwise, if the hash table's keys and values are all @tech{quotable}, the table prints with a @litchar{'} prefix, and the table's key and values are @racket[print]ed -at @tech{quoting depth} @scheme[1]. If some key or value is not +at @tech{quoting depth} @racket[1]. If some key or value is not @tech{quotable}, the hash table prints as @litchar["(hash "], @litchar["(hasheqv "], or @litchar["(hasheq "] followed by alternating -keys and values @racket[print]ed at @tech{quoting depth} @scheme[1] and +keys and values @racket[print]ed at @tech{quoting depth} @racket[1] and separated by spaces, and finally a closing @litchar{)}. A hash table is @tech{quotable} when all of its keys and values are @tech{quotable}. -When the @scheme[print-hash-table] parameter is set to @scheme[#f], a +When the @racket[print-hash-table] parameter is set to @racket[#f], a hash table prints as @litchar{#} and counts as @tech{quotable}. @section[#:tag "print-box"]{Printing Boxes} -When the @scheme[print-box] parameter is set to @scheme[#t], a box +When the @racket[print-box] parameter is set to @racket[#t], a box prints as @litchar{#&} followed by the printed form of its content in -@scheme[write], @scheme[display], or @scheme[print] mode when -@scheme[print-as-expression] is @scheme[#f] or the @tech{quoting -depth} is @scheme[1]. +@racket[write], @racket[display], or @racket[print] mode when +@racket[print-as-expression] is @racket[#f] or the @tech{quoting +depth} is @racket[1]. -In @scheme[print] mode when @scheme[print-as-expression] is -@scheme[#t] and the @tech{quoting depth} is @scheme[0], a box prints +In @racket[print] mode when @racket[print-as-expression] is +@racket[#t] and the @tech{quoting depth} is @racket[0], a box prints with a @litchar{'} prefix and its value is printed at @tech{quoting -depth} @scheme[1] when its content is @tech{quotable}, otherwise the +depth} @racket[1] when its content is @tech{quotable}, otherwise the box prints a @litchar["(box "] followed by the content at -@tech{quoting depth} @scheme[0] and a closing @litchar{)}. A box is +@tech{quoting depth} @racket[0] and a closing @litchar{)}. A box is @tech{quotable} when its content is @tech{quotable}. -When the @scheme[print-box] parameter is set to @scheme[#f], a box +When the @racket[print-box] parameter is set to @racket[#f], a box prints as @litchar{#} and counts as @tech{quotable}. @section{Printing Characters} Characters with the special names described in -@secref["parse-character"] @scheme[write] and @scheme[print] using the +@secref["parse-character"] @racket[write] and @racket[print] using the same name. (Some characters have multiple names; the -@scheme[#\newline] and @scheme[#\nul] names are used instead of -@schemevalfont{#\linefeed} and @schemevalfont{#\null}.) Other graphic characters -(according to @scheme[char-graphic?]) @scheme[write] as @litchar{#\} +@racket[#\newline] and @racket[#\nul] names are used instead of +@racketvalfont{#\linefeed} and @racketvalfont{#\null}.) Other graphic characters +(according to @racket[char-graphic?]) @racket[write] as @litchar{#\} followed by the single character, and all others characters are -written in @scheme[#\u] notation with four digits or @scheme[#\U] +written in @racket[#\u] notation with four digits or @racket[#\U] notation with eight digits (using the latter only if the character value does not fit in four digits). -All characters @scheme[display] directly as themselves (i.e., a single +All characters @racket[display] directly as themselves (i.e., a single character). For the purposes of printing enclosing datatypes, a character is @@ -441,9 +441,9 @@ For the purposes of printing enclosing datatypes, a character is @section{Printing Keywords} -Keywords @scheme[write], @scheme[print], and @scheme[display] the same +Keywords @racket[write], @racket[print], and @racket[display] the same as symbols (see @secref["print-symbol"]) except with a leading -@litchar{#:} (after any @litchar{'} prefix added in @scheme[print] +@litchar{#:} (after any @litchar{'} prefix added in @racket[print] mode), and without special handling for an initial @litchar{#} or when the printed form would match a number or a delimited @litchar{.} (since @litchar{#:} distinguishes the keyword). @@ -454,10 +454,10 @@ For the purposes of printing enclosing datatypes, a keyword is @section{Printing Regular Expressions} -Regexp values @scheme[write], @scheme[display], and @scheme[print] -starting with @litchar{#px} (for @scheme[pregexp]-based regexps) or -@litchar{#rx} (for @scheme[regexp]-based regexps) followed by the -@scheme[write] form of the regexp's source string or byte string. +Regexp values @racket[write], @racket[display], and @racket[print] +starting with @litchar{#px} (for @racket[pregexp]-based regexps) or +@litchar{#rx} (for @racket[regexp]-based regexps) followed by the +@racket[write] form of the regexp's source string or byte string. For the purposes of printing enclosing datatypes, a regexp value is @tech{quotable}. @@ -465,7 +465,7 @@ For the purposes of printing enclosing datatypes, a regexp value is @section[#:tag "print-path"]{Printing Paths} -Paths @scheme[write] and @scheme[print] as @litchar{#}. A +Paths @racket[write] and @racket[print] as @litchar{#}. A path @racket[display]s the same as the string produced by @racket[path->string]. For the purposes of printing enclosing datatypes, a path counts as @tech{quotable}. diff --git a/collects/scribblings/reference/procedures.scrbl b/collects/scribblings/reference/procedures.scrbl index 406be11321..04f3374f2a 100644 --- a/collects/scribblings/reference/procedures.scrbl +++ b/collects/scribblings/reference/procedures.scrbl @@ -3,27 +3,27 @@ @title[#:tag "procedures"]{Procedures} -@defproc[(procedure? [v any/c]) boolean]{ Returns @scheme[#t] if -@scheme[v] is a procedure, @scheme[#f] otherwise.} +@defproc[(procedure? [v any/c]) boolean]{ Returns @racket[#t] if +@racket[v] is a procedure, @racket[#f] otherwise.} @defproc[(apply [proc procedure?] [v any/c] ... [lst list?] [#: kw-arg any/c] ...) any]{ -@guideintro["apply"]{@scheme[apply]} +@guideintro["apply"]{@racket[apply]} -Applies @scheme[proc] using the content of @scheme[(list* v ... lst)] -as the (by-position) arguments. The @scheme[#: kw-arg] sequence is -also supplied as keyword arguments to @scheme[proc], where -@scheme[#:] stands for any keyword. +Applies @racket[proc] using the content of @racket[(list* v ... lst)] +as the (by-position) arguments. The @racket[#: kw-arg] sequence is +also supplied as keyword arguments to @racket[proc], where +@racket[#:] stands for any keyword. -The given @scheme[proc] must accept as many arguments as the number of -@scheme[v]s plus length of @scheme[lst], it must accept the supplied +The given @racket[proc] must accept as many arguments as the number of +@racket[v]s plus length of @racket[lst], it must accept the supplied keyword arguments, and it must not require any other keyword arguments; otherwise, the @exnraise[exn:fail:contract]. The given -@scheme[proc] is called in tail position with respect to the -@scheme[apply] call. +@racket[proc] is called in tail position with respect to the +@racket[apply] call. @mz-examples[ (apply + '(1 2 3)) @@ -36,17 +36,17 @@ arguments; otherwise, the @exnraise[exn:fail:contract]. The given @defproc[(compose1 [proc procedure?] ...) procedure?])]{ Returns a procedure that composes the given functions, applying the last -@scheme[proc] first and the first @scheme[proc] last. @scheme[compose] +@racket[proc] first and the first @racket[proc] last. @racket[compose] allows the functions to consume and produce any number of values, as long as each function produces as many values as the preceding function -consumes, and @scheme[compose1] restricts the internal value passing to +consumes, and @racket[compose1] restricts the internal value passing to a single value. In both cases the input arity of the last function and the output arity of the first are unrestricted, and become the corresponding arity of the resulting composition (including keyword arguments for the input side). -When no @scheme[proc] arguments are given, the result is -@scheme[values]. When exactly one is given, it is returned. +When no @racket[proc] arguments are given, the result is +@racket[values]. When exactly one is given, it is returned. @mz-examples[ ((compose1 - sqrt) 10) @@ -54,11 +54,11 @@ When no @scheme[proc] arguments are given, the result is ((compose list split-path) (bytes->path #"/a" 'unix)) ] -Note that in many cases @scheme[compose1] is preferred. For example, -using @scheme[compose] with two library functions may lead to problems +Note that in many cases @racket[compose1] is preferred. For example, +using @racket[compose] with two library functions may lead to problems when one function is extended to return two values, and the preceding one has an optional input with different semantics. In addition, -@scheme[compose1] may create faster compositions. +@racket[compose1] may create faster compositions. } @@ -66,27 +66,27 @@ one has an optional input with different semantics. In addition, [name symbol?]) procedure?]{ -Returns a procedure that is like @scheme[proc], except that its name -as returned by @scheme[object-name] (and as printed for debugging) is -@scheme[name]. +Returns a procedure that is like @racket[proc], except that its name +as returned by @racket[object-name] (and as printed for debugging) is +@racket[name]. -The given @scheme[name] is used for printing an error message if the +The given @racket[name] is used for printing an error message if the resulting procedure is applied to the wrong number of arguments. In -addition, if @scheme[proc] is an @tech{accessor} or @tech{mutator} -produced by @scheme[struct], -@scheme[make-struct-field-accessor], or -@scheme[make-struct-field-mutator], the resulting procedure also uses -@scheme[name] when its (first) argument has the wrong type. More -typically, however, @scheme[name] is not used for reporting errors, +addition, if @racket[proc] is an @tech{accessor} or @tech{mutator} +produced by @racket[struct], +@racket[make-struct-field-accessor], or +@racket[make-struct-field-mutator], the resulting procedure also uses +@racket[name] when its (first) argument has the wrong type. More +typically, however, @racket[name] is not used for reporting errors, since the procedure name is typically hard-wired into an internal check.} @defproc[(procedure->method [proc procedure?]) procedure?]{ -Returns a procedure that is like @scheme[proc] except that, when applied +Returns a procedure that is like @racket[proc] except that, when applied to the wrong number of arguments, the resulting error hides the first argument as if the procedure had been compiled with the -@indexed-scheme['method-arity-error] syntax property.} +@indexed-racket['method-arity-error] syntax property.} @; ---------------------------------------- @section{Keywords and Arity} @@ -99,23 +99,23 @@ argument as if the procedure had been compiled with the [#: kw-arg any/c] ...) any]{ -@guideintro["apply"]{@scheme[keyword-apply]} +@guideintro["apply"]{@racket[keyword-apply]} -Like @scheme[apply], but @scheme[kw-lst] and @scheme[kw-val-lst] +Like @racket[apply], but @racket[kw-lst] and @racket[kw-val-lst] supply by-keyword arguments in addition to the by-position arguments -of the @scheme[v]s and @scheme[lst], and in addition to the directly -supplied keyword arguments in the @scheme[#: kw-arg] sequence, -where @scheme[#:] stands for any keyword. +of the @racket[v]s and @racket[lst], and in addition to the directly +supplied keyword arguments in the @racket[#: kw-arg] sequence, +where @racket[#:] stands for any keyword. -The given @scheme[kw-lst] must be sorted using @scheme[keyword], otherwise, the -@exnraise[exn:fail:contract]. The given @scheme[kw-val-lst] must have -the same length as @scheme[kw-lst], otherwise, the -@exnraise[exn:fail:contract]. The given @scheme[proc] must accept all -of the keywords in @scheme[kw-lst] plus the @scheme[#:]s, it must +The given @racket[kw-lst] must be sorted using @racket[keyword], otherwise, the +@exnraise[exn:fail:contract]. The given @racket[kw-val-lst] must have +the same length as @racket[kw-lst], otherwise, the +@exnraise[exn:fail:contract]. The given @racket[proc] must accept all +of the keywords in @racket[kw-lst] plus the @racket[#:]s, it must not require any other keywords, and it must accept as many by-position -arguments as supplied via the @scheme[v]s and @scheme[lst]; otherwise, +arguments as supplied via the @racket[v]s and @racket[lst]; otherwise, the @exnraise[exn:fail:contract]. @defexamples[ @@ -130,32 +130,32 @@ the @exnraise[exn:fail:contract]. procedure-arity?]{ Returns information about the number of by-position arguments accepted -by @scheme[proc]. See also @scheme[procedure-arity?].} +by @racket[proc]. See also @racket[procedure-arity?].} @defproc[(procedure-arity? [v any/c]) boolean?]{ -A valid arity @scheme[_a] is one of the following: +A valid arity @racket[_a] is one of the following: @itemize[ @item{An exact non-negative integer, which means that the procedure - accepts @scheme[_a] arguments, only.} + accepts @racket[_a] arguments, only.} - @item{A @scheme[arity-at-least] instance, which means that the - procedure accepts @scheme[(arity-at-least-value _a)] or more + @item{A @racket[arity-at-least] instance, which means that the + procedure accepts @racket[(arity-at-least-value _a)] or more arguments.} - @item{A list containing integers and @scheme[arity-at-least] + @item{A list containing integers and @racket[arity-at-least] instances, which means that the procedure accepts any number of - arguments that can match one of the elements of @scheme[_a].} + arguments that can match one of the elements of @racket[_a].} ] -Generally, @scheme[procedure-arity] always produces an arity that is normalized. +Generally, @racket[procedure-arity] always produces an arity that is normalized. Specifically, it is either the empty list (corresponding to the procedure -@scheme[(case-lambda)]), one of the first two cases above, or a list +@racket[(case-lambda)]), one of the first two cases above, or a list that contains at least two elements. If it is a list, there is at most one -@scheme[arity-at-least] instance that appears as the last element of the list, +@racket[arity-at-least] instance that appears as the last element of the list, all of the other elements are sorted in ascending order, and there are no duplicate elements. @@ -173,8 +173,8 @@ elements. [kws-ok? any/c #f]) boolean?]{ -Returns @scheme[#t] if the procedure can accept @scheme[k] by-position -arguments, @scheme[#f] otherwise. If @racket[kws-ok?] is @racket[#f], +Returns @racket[#t] if the procedure can accept @racket[k] by-position +arguments, @racket[#f] otherwise. If @racket[kws-ok?] is @racket[#f], the result is @racket[#t] only if @racket[proc] has no required keyword arguments. @@ -189,18 +189,18 @@ keyword arguments. [arity procedure-arity?]) procedure?]{ -Returns a procedure that is the same as @scheme[proc] (including -the same name returned by @scheme[object-name]), but that accepts -only arguments consistent with @scheme[arity]. In particular, -when @scheme[procedure-arity] is applied to the generated -procedure, it returns a value that is @scheme[equal?] to -@scheme[arity]. +Returns a procedure that is the same as @racket[proc] (including +the same name returned by @racket[object-name]), but that accepts +only arguments consistent with @racket[arity]. In particular, +when @racket[procedure-arity] is applied to the generated +procedure, it returns a value that is @racket[equal?] to +@racket[arity]. -If the @scheme[arity] specification allows arguments that are not in -@scheme[(procedure-arity proc)], the @exnraise[exn:fail:contract]. If -@scheme[proc] accepts keyword argument, either the keyword arguments +If the @racket[arity] specification allows arguments that are not in +@racket[(procedure-arity proc)], the @exnraise[exn:fail:contract]. If +@racket[proc] accepts keyword argument, either the keyword arguments must be all optional (and they are not accepted in by the -arity-reduced procedure) or @scheme[arity] must be the empty list +arity-reduced procedure) or @racket[arity] must be the empty list (which makes a procedure that cannot be called); otherwise, the @exnraise[exn:fail:contract]. @@ -217,9 +217,9 @@ arity-reduced procedure) or @scheme[arity] must be the empty list Returns information about the keyword arguments required and accepted by a procedure. The first result is a list of keywords (sorted by -@scheme[keywordlist v)))] diff --git a/collects/scribblings/reference/reference.scrbl b/collects/scribblings/reference/reference.scrbl index d2004a752c..a1ba12764e 100644 --- a/collects/scribblings/reference/reference.scrbl +++ b/collects/scribblings/reference/reference.scrbl @@ -9,7 +9,7 @@ (let ([mods (append-map (lambda (k) (list ", " (resolve-get p ri k))) (sort (resolve-get-keys - p ri (lambda (v) (eq? (car v) 'scheme-extra-lib))) + p ri (lambda (v) (eq? (car v) 'racket-extra-lib))) stringstring (cadr k))) #:cache-keys? #t))]) diff --git a/collects/scribblings/reference/security-guards.scrbl b/collects/scribblings/reference/security-guards.scrbl index 2914840d2e..6fda62a3eb 100644 --- a/collects/scribblings/reference/security-guards.scrbl +++ b/collects/scribblings/reference/security-guards.scrbl @@ -5,14 +5,14 @@ @defproc[(security-guard? [v any/c]) boolean?]{ -Returns @scheme[#t] if @scheme[v] is a security guard value as created -by @scheme[make-security-guard], @scheme[#f] otherwise.} +Returns @racket[#t] if @racket[v] is a security guard value as created +by @racket[make-security-guard], @racket[#f] otherwise.} A @deftech{security guard} provides a set of access-checking procedures to be called when a thread initiates access of a file, directory, or network connection through a primitive procedure. For -example, when a thread calls @scheme[open-input-file], the thread's +example, when a thread calls @racket[open-input-file], the thread's current security guard is consulted to check whether the thread is allowed read access to the file. If access is granted, the thread receives a port that it may use indefinitely, regardless of changes to @@ -20,7 +20,7 @@ the security guard (although the port's custodian could shut down the port; see @secref["custodians"]). A thread's current security guard is determined by the -@scheme[current-security-guard] parameter. Every security guard has a +@racket[current-security-guard] parameter. Every security guard has a parent, and a parent's access procedures are called whenever a child's access procedures are called. Thus, a thread cannot increase its own access arbitrarily by installing a new guard. The initial security @@ -41,19 +41,19 @@ host platform. #f]) security-guard?]{ -Creates a new security guard as child of @scheme[parent]. +Creates a new security guard as child of @racket[parent]. -The @scheme[file-guard] procedure must accept three arguments: +The @racket[file-guard] procedure must accept three arguments: @itemize[ @item{a symbol for the primitive procedure that triggered the access check, which is useful for raising an exception to deny access.} - @item{a path (see @secref["pathutils"]) or @scheme[#f] for - pathless queries, such as @scheme[(current-directory)], - @scheme[(filesystem-root-list)], and @scheme[(find-system-path - symbol)]. A path provided to @scheme[file-guard] is not expanded or + @item{a path (see @secref["pathutils"]) or @racket[#f] for + pathless queries, such as @racket[(current-directory)], + @racket[(filesystem-root-list)], and @racket[(find-system-path + symbol)]. A path provided to @racket[file-guard] is not expanded or otherwise normalized before checking access; it may be a relative path, for example.} @@ -62,28 +62,28 @@ The @scheme[file-guard] procedure must accept three arguments: @itemize[ - @item{@indexed-scheme['read] --- read a file or directory} + @item{@indexed-racket['read] --- read a file or directory} - @item{@indexed-scheme['write] --- modify or create a file or + @item{@indexed-racket['write] --- modify or create a file or directory} - @item{@indexed-scheme['execute] --- execute a file} + @item{@indexed-racket['execute] --- execute a file} - @item{@indexed-scheme['delete] --- delete a file or directory} + @item{@indexed-racket['delete] --- delete a file or directory} - @item{@indexed-scheme['exists] --- determine whether a file or + @item{@indexed-racket['exists] --- determine whether a file or directory exists, or that a path string is well-formed} ] - The @scheme['exists] symbol is never combined with other symbols in - the last argument to @scheme[file-guard], but any other combination is - possible. When the second argument to @scheme[file-guard] is @scheme[#f], - the last argument always contains only @scheme['exists].} + The @racket['exists] symbol is never combined with other symbols in + the last argument to @racket[file-guard], but any other combination is + possible. When the second argument to @racket[file-guard] is @racket[#f], + the last argument always contains only @racket['exists].} ] -The @scheme[network-guard] procedure must accept four arguments: +The @racket[network-guard] procedure must accept four arguments: @itemize[ @@ -92,26 +92,26 @@ The @scheme[network-guard] procedure must accept four arguments: @item{an immutable string representing the target hostname for a client connection or the accepting hostname for a listening server; - @scheme[#f] for a listening server or UDP socket that accepts - connections at all of the host's address; or @scheme[#f] an unbound + @racket[#f] for a listening server or UDP socket that accepts + connections at all of the host's address; or @racket[#f] an unbound UDP socket.} - @item{an exact integer between @scheme[1] and @scheme[65535] - (inclusive) representing the port number, or @scheme[#f] for an + @item{an exact integer between @racket[1] and @racket[65535] + (inclusive) representing the port number, or @racket[#f] for an unbound UDP socket. In the case of a client connection, the port number is the target port on the server. For a listening server, the port number is the local port number.} - @item{a symbol, either @indexed-scheme['client] or - @indexed-scheme['server], indicating whether the check is for the + @item{a symbol, either @indexed-racket['client] or + @indexed-racket['server], indicating whether the check is for the creation of a client connection or a listening server. The opening of - an unbound UDP socket is identified as a @scheme['client] connection; - explicitly binding the socket is identified as a @scheme['server] + an unbound UDP socket is identified as a @racket['client] connection; + explicitly binding the socket is identified as a @racket['server] action.} ] -The @scheme[link-guard] argument can be @scheme[#f] or a procedure of +The @racket[link-guard] argument can be @racket[#f] or a procedure of three arguments: @itemize[ @@ -128,21 +128,21 @@ three arguments: ] -If @scheme[link-guard] is @scheme[#f], then a default -procedure is used that always raises @scheme[exn:fail]. +If @racket[link-guard] is @racket[#f], then a default +procedure is used that always raises @racket[exn:fail]. -The return value of @scheme[file-guard], @scheme[network-guard], or -@scheme[link-guard] is ignored. To deny access, the procedure must +The return value of @racket[file-guard], @racket[network-guard], or +@racket[link-guard] is ignored. To deny access, the procedure must raise an exception or otherwise escape from the context of the primitive call. If the procedure returns, the parent's corresponding procedure is called on the same inputs, and so on up the chain of security guards. -The @scheme[file-guard], @scheme[network-guard], and -@scheme[link-guard] procedures are invoked in the thread that called +The @racket[file-guard], @racket[network-guard], and +@racket[link-guard] procedures are invoked in the thread that called the access-checked primitive. Breaks may or may not be enabled (see @secref["breakhandler"]). Full continuation jumps are blocked going -into or out of the @scheme[file-guard] or @scheme[network-guard] call +into or out of the @racket[file-guard] or @racket[network-guard] call (see @secref["prompt-model"]).} diff --git a/collects/scribblings/reference/semaphores.scrbl b/collects/scribblings/reference/semaphores.scrbl index c70eee0ea1..c03aec294c 100644 --- a/collects/scribblings/reference/semaphores.scrbl +++ b/collects/scribblings/reference/semaphores.scrbl @@ -5,10 +5,10 @@ A @deftech{semaphore} has an internal counter; when this counter is zero, the semaphore can block a thread's execution (through -@scheme[semaphore-wait]) until another thread increments the counter -(using @scheme[semaphore-post]). The maximum value for a semaphore's +@racket[semaphore-wait]) until another thread increments the counter +(using @racket[semaphore-post]). The maximum value for a semaphore's internal counter is platform-specific, but always at least -@scheme[10000]. +@racket[10000]. A semaphore's counter is updated in a single-threaded manner, so that semaphores can be used for reliable synchronization. Semaphore waiting @@ -21,14 +21,14 @@ can be used as events; see @secref["sync"]. @defproc[(semaphore? [v any/c]) boolean?]{ -Returns @scheme[#t] if @scheme[v] is a @tech{semaphore}, -@scheme[#f] otherwise.} +Returns @racket[#t] if @racket[v] is a @tech{semaphore}, +@racket[#f] otherwise.} @defproc[(make-semaphore [init exact-nonnegative-integer? 0]) semaphore?]{ Creates and returns a new semaphore with the counter initially set to -@scheme[init]. If @scheme[init] is larger than a semaphore's maximum +@racket[init]. If @racket[init] is larger than a semaphore's maximum internal counter value, the @exnraise[exn:fail].} @@ -38,50 +38,50 @@ semaphore's internal counter has already reached its maximum value, the @exnraise[exn:fail].} @defproc[(semaphore-wait [sema semaphore?]) void?]{Blocks until the -internal counter for semaphore @scheme[sema] is non-zero. When the -counter is non-zero, it is decremented and @scheme[semaphore-wait] +internal counter for semaphore @racket[sema] is non-zero. When the +counter is non-zero, it is decremented and @racket[semaphore-wait] returns @|void-const|.} @defproc[(semaphore-try-wait? [sema semaphore?]) boolean?]{Like -@scheme[semaphore-wait], but @scheme[semaphore-try-wait?] never blocks -execution. If @scheme[sema]'s internal counter is zero, -@scheme[semaphore-try-wait?] returns @scheme[#f] immediately without -decrementing the counter. If @scheme[sema]'s counter is positive, it -is decremented and @scheme[#t] is returned.} +@racket[semaphore-wait], but @racket[semaphore-try-wait?] never blocks +execution. If @racket[sema]'s internal counter is zero, +@racket[semaphore-try-wait?] returns @racket[#f] immediately without +decrementing the counter. If @racket[sema]'s counter is positive, it +is decremented and @racket[#t] is returned.} @defproc[(semaphore-wait/enable-break [sema semaphore?]) void?]{Like -@scheme[semaphore-wait], but breaking is enabled (see -@secref["breakhandler"]) while waiting on @scheme[sema]. If -breaking is disabled when @scheme[semaphore-wait/enable-break] is +@racket[semaphore-wait], but breaking is enabled (see +@secref["breakhandler"]) while waiting on @racket[sema]. If +breaking is disabled when @racket[semaphore-wait/enable-break] is called, then either the semaphore's counter is decremented or the -@scheme[exn:break] exception is raised, but not both.} +@racket[exn:break] exception is raised, but not both.} @defproc[(semaphore-peek-evt [sema semaphore?]) evt?]{Creates and -returns a new synchronizable event (for use with @scheme[sync], for -example) that is ready when @scheme[sema] is ready, but synchronizing -the event does not decrement @scheme[sema]'s internal count.} +returns a new synchronizable event (for use with @racket[sync], for +example) that is ready when @racket[sema] is ready, but synchronizing +the event does not decrement @racket[sema]'s internal count.} @defproc[(call-with-semaphore [sema semaphore?] [proc procedure?] [try-fail-thunk (or/c (-> any) #f) #f] [arg any/c] ...) any]{ -Waits on @scheme[sema] using @scheme[semaphore-wait], calls -@scheme[proc] with all @scheme[arg]s, and then posts to -@scheme[sema]. A @tech{continuation barrier} blocks full continuation jumps -into or out of @scheme[proc] (see @secref["prompt-model"]), but -escape jumps are allowed, and @scheme[sema] is posted on escape. If -@scheme[try-fail-thunk] is provided and is not @scheme[#f], then -@scheme[semaphore-try-wait?] is called on @scheme[sema] instead of -@scheme[semaphore-wait], and @scheme[try-fail-thunk] is called if the +Waits on @racket[sema] using @racket[semaphore-wait], calls +@racket[proc] with all @racket[arg]s, and then posts to +@racket[sema]. A @tech{continuation barrier} blocks full continuation jumps +into or out of @racket[proc] (see @secref["prompt-model"]), but +escape jumps are allowed, and @racket[sema] is posted on escape. If +@racket[try-fail-thunk] is provided and is not @racket[#f], then +@racket[semaphore-try-wait?] is called on @racket[sema] instead of +@racket[semaphore-wait], and @racket[try-fail-thunk] is called if the wait fails.} @defproc[(call-with-semaphore/enable-break [sema semaphore?] [proc procedure?] [try-fail-thunk (or/c (-> any) #f) #f] [arg any/c] ...) any]{ -Like @scheme[call-with-semaphore], except that -@scheme[semaphore-wait/enable-break] is used with @scheme[sema] in -non-try mode. When @scheme[try-fail-thunk] is provided and not -@scheme[#f], then breaks are enabled around the use of -@scheme[semaphore-try-wait?] on @scheme[sema].} +Like @racket[call-with-semaphore], except that +@racket[semaphore-wait/enable-break] is used with @racket[sema] in +non-try mode. When @racket[try-fail-thunk] is provided and not +@racket[#f], then breaks are enabled around the use of +@racket[semaphore-try-wait?] on @racket[sema].} diff --git a/collects/scribblings/reference/sequences.scrbl b/collects/scribblings/reference/sequences.scrbl index 88c5908c54..5343cc92e3 100644 --- a/collects/scribblings/reference/sequences.scrbl +++ b/collects/scribblings/reference/sequences.scrbl @@ -24,8 +24,8 @@ be converted to a sequence and vice-versa. A @deftech{sequence} encapsulates an ordered collection of values. The elements of a sequence can be extracted with one of the -@scheme[for] syntactic forms, with the procedures returned by -@scheme[sequence-generate], or by converting the sequence into a +@racket[for] syntactic forms, with the procedures returned by +@racket[sequence-generate], or by converting the sequence into a @tech{stream}. The sequence datatype overlaps with many other datatypes. Among @@ -61,9 +61,9 @@ An @tech{exact number} @racket[_k] that is a non-negative @tech{integer} acts as a sequence similar to @racket[(in-range _k)], except that @racket[_k] by itself is not a @tech{stream}. -The @scheme[make-do-sequence] function creates a sequence given a +The @racket[make-do-sequence] function creates a sequence given a thunk that returns procedures to implement a sequence, and the -@scheme[prop:sequence] property can be associated with a structure +@racket[prop:sequence] property can be associated with a structure type to implement its implicit conversion to a sequence. For most sequence types, extracting elements from a sequence has no @@ -88,33 +88,33 @@ in the sequence. @subsection{Sequence Predicate and Constructors} @defproc[(sequence? [v any/c]) boolean?]{ - Returns @scheme[#t] if @scheme[v] can be used as a @tech{sequence}, - @scheme[#f] otherwise.} + Returns @racket[#t] if @racket[v] can be used as a @tech{sequence}, + @racket[#f] otherwise.} @defproc*[([(in-range [end number?]) stream?] [(in-range [start number?] [end number?] [step number? 1]) stream?])]{ Returns a sequence (that is also a @tech{stream}) whose elements are numbers. The single-argument - case @scheme[(in-range end)] is equivalent to @scheme[(in-range 0 end - 1)]. The first number in the sequence is @scheme[start], and each - successive element is generated by adding @scheme[step] to the + case @racket[(in-range end)] is equivalent to @racket[(in-range 0 end + 1)]. The first number in the sequence is @racket[start], and each + successive element is generated by adding @racket[step] to the previous element. The sequence stops before an element that would be - greater or equal to @scheme[end] if @scheme[step] is non-negative, or - less or equal to @scheme[end] if @scheme[step] is negative. + greater or equal to @racket[end] if @racket[step] is non-negative, or + less or equal to @racket[end] if @racket[step] is negative. @speed[in-range "number"]} @defproc[(in-naturals [start exact-nonnegative-integer? 0]) stream?]{ Returns an infinite sequence (that is also a @tech{stream}) of exact integers starting with - @scheme[start], where each element is one more than the preceding + @racket[start], where each element is one more than the preceding element. @speed[in-naturals "integer"]} @defproc[(in-list [lst list?]) stream?]{ Returns a sequence (that is also a @tech{stream}) that is equivalent - to using @scheme[lst] directly as a sequence. + to using @racket[lst] directly as a sequence. @info-on-seq["pairs" "lists"] @speed[in-list "list"]} @defproc[(in-mlist [mlst mlist?]) sequence?]{ - Returns a sequence equivalent to @scheme[mlst]. + Returns a sequence equivalent to @racket[mlst]. @info-on-seq["mpairs" "mutable lists"] @speed[in-mlist "mutable list"]} @@ -123,26 +123,26 @@ in the sequence. [stop (or/c exact-integer? #f) #f] [step (and/c exact-integer? (not/c zero?)) 1]) sequence?]{ - Returns a sequence equivalent to @scheme[vec] when no optional + Returns a sequence equivalent to @racket[vec] when no optional arguments are supplied. @info-on-seq["vectors" "vectors"] - The optional arguments @scheme[start], @scheme[stop], and - @scheme[step] are analogous to @scheme[in-range], except that a - @scheme[#f] value for @scheme[stop] is equivalent to - @scheme[(vector-length vec)]. That is, the first element in the - sequence is @scheme[(vector-ref vec start)], and each successive - element is generated by adding @scheme[step] to index of the previous + The optional arguments @racket[start], @racket[stop], and + @racket[step] are analogous to @racket[in-range], except that a + @racket[#f] value for @racket[stop] is equivalent to + @racket[(vector-length vec)]. That is, the first element in the + sequence is @racket[(vector-ref vec start)], and each successive + element is generated by adding @racket[step] to index of the previous element. The sequence stops before an index that would be greater or - equal to @scheme[end] if @scheme[step] is non-negative, or less or - equal to @scheme[end] if @scheme[step] is negative. + equal to @racket[end] if @racket[step] is non-negative, or less or + equal to @racket[end] if @racket[step] is negative. If @racket[start] is not a valid index, or @racket[stop] is not in [-1, @racket[(vector-length vec)]] then the @exnraise[exn:fail:contract]. - If @scheme[start] is less than @scheme[stop] and @scheme[step] is + If @racket[start] is less than @racket[stop] and @racket[step] is negative, then the @exnraise[exn:fail:contract:mismatch]. Similarly, - if @scheme[start] is more than @scheme[stop] and @scheme[step] is + if @racket[start] is more than @racket[stop] and @racket[step] is positive, then the @exnraise[exn:fail:contract:mismatch]. @speed[in-vector "vector"]} @@ -152,13 +152,13 @@ in the sequence. [stop (or/c exact-integer? #f) #f] [step (and/c exact-integer? (not/c zero?)) 1]) sequence?]{ - Returns a sequence equivalent to @scheme[str] when no optional + Returns a sequence equivalent to @racket[str] when no optional arguments are supplied. @info-on-seq["strings" "strings"] - The optional arguments @scheme[start], @scheme[stop], and - @scheme[step] are as in @scheme[in-vector]. + The optional arguments @racket[start], @racket[stop], and + @racket[step] are as in @racket[in-vector]. @speed[in-string "string"]} @@ -167,47 +167,47 @@ in the sequence. [stop (or/c exact-integer? #f) #f] [step (and/c exact-integer? (not/c zero?)) 1]) sequence?]{ - Returns a sequence equivalent to @scheme[bstr] when no optional + Returns a sequence equivalent to @racket[bstr] when no optional arguments are supplied. @info-on-seq["bytestrings" "byte strings"] - The optional arguments @scheme[start], @scheme[stop], and - @scheme[step] are as in @scheme[in-vector]. + The optional arguments @racket[start], @racket[stop], and + @racket[step] are as in @racket[in-vector]. @speed[in-bytes "byte string"]} @defproc[(in-port [r (input-port? . -> . any/c) read] [in input-port? (current-input-port)]) sequence?]{ - Returns a sequence whose elements are produced by calling @scheme[r] - on @scheme[in] until it produces @scheme[eof].} + Returns a sequence whose elements are produced by calling @racket[r] + on @racket[in] until it produces @racket[eof].} @defproc[(in-input-port-bytes [in input-port?]) sequence?]{ - Returns a sequence equivalent to @scheme[(in-port read-byte in)].} + Returns a sequence equivalent to @racket[(in-port read-byte in)].} @defproc[(in-input-port-chars [in input-port?]) sequence?]{ Returns a sequence whose elements are read as characters from - @scheme[in] (equivalent to @scheme[(in-port read-char in)]).} + @racket[in] (equivalent to @racket[(in-port read-char in)]).} @defproc[(in-lines [in input-port? (current-input-port)] [mode (or/c 'linefeed 'return 'return-linefeed 'any 'any-one) 'any]) sequence?]{ Returns a sequence equivalent to - @scheme[(in-port (lambda (p) (read-line p mode)) in)]. Note that the - default mode is @scheme['any], whereas the default mode of - @scheme[read-line] is @scheme['linefeed].} + @racket[(in-port (lambda (p) (read-line p mode)) in)]. Note that the + default mode is @racket['any], whereas the default mode of + @racket[read-line] is @racket['linefeed].} @defproc[(in-bytes-lines [in input-port? (current-input-port)] [mode (or/c 'linefeed 'return 'return-linefeed 'any 'any-one) 'any]) sequence?]{ Returns a sequence equivalent to - @scheme[(in-port (lambda (p) (read-bytes-line p mode)) in)]. Note - that the default mode is @scheme['any], whereas the default mode of - @scheme[read-bytes-line] is @scheme['linefeed].} + @racket[(in-port (lambda (p) (read-bytes-line p mode)) in)]. Note + that the default mode is @racket['any], whereas the default mode of + @racket[read-bytes-line] is @racket['linefeed].} @defproc[(in-hash [hash hash?]) sequence?]{ - Returns a sequence equivalent to @scheme[hash]. + Returns a sequence equivalent to @racket[hash]. @examples[ (define table (hash 'a 1 'b 2)) @@ -218,7 +218,7 @@ in the sequence. @info-on-seq["hashtables" "hash tables"]} @defproc[(in-hash-keys [hash hash?]) sequence?]{ - Returns a sequence whose elements are the keys of @scheme[hash]. + Returns a sequence whose elements are the keys of @racket[hash]. @examples[ (define table (hash 'a 1 'b 2)) @@ -229,7 +229,7 @@ in the sequence. } @defproc[(in-hash-values [hash hash?]) sequence?]{ - Returns a sequence whose elements are the values of @scheme[hash]. + Returns a sequence whose elements are the values of @racket[hash]. @examples[ (define table (hash 'a 1 'b 2)) @@ -241,7 +241,7 @@ in the sequence. @defproc[(in-hash-pairs [hash hash?]) sequence?]{ Returns a sequence whose elements are pairs, each containing a key and - its value from @scheme[hash] (as opposed to using @scheme[hash] + its value from @racket[hash] (as opposed to using @racket[hash] directly as a sequence to get the key and value as separate values for each element). @@ -263,38 +263,38 @@ in the sequence. @defproc[(in-producer [producer procedure?] [stop any/c] [args any/c] ...) sequence?]{ Returns a sequence that contains values from sequential calls to - @scheme[producer]. A @scheme[stop] value returned by + @racket[producer]. A @racket[stop] value returned by @racket[producer] marks the end of the sequence (and the - @racket[stop] value is not included in the sequence); @scheme[stop] + @racket[stop] value is not included in the sequence); @racket[stop] can be a predicate that is applied to the results of @racket[producer], or it can be a value that is tested against the result of - with @scheme[eq?]. (The @racket[stop] argument must be a predicate + with @racket[eq?]. (The @racket[stop] argument must be a predicate if the stop value is itself a function or if - @scheme[producer] returns multiple values.)} + @racket[producer] returns multiple values.)} @defproc[(in-value [v any/c]) sequence?]{ - Returns a sequence that produces a single value: @scheme[v]. This - form is mostly useful for @scheme[let]-like bindings in forms such as - @scheme[for*/list].} + Returns a sequence that produces a single value: @racket[v]. This + form is mostly useful for @racket[let]-like bindings in forms such as + @racket[for*/list].} @defproc[(in-indexed [seq sequence?]) sequence?]{ Returns a sequence where each element has two values: the value - produced by @scheme[seq], and a non-negative exact integer starting - with @scheme[0]. The elements of @scheme[seq] must be single-valued.} + produced by @racket[seq], and a non-negative exact integer starting + with @racket[0]. The elements of @racket[seq] must be single-valued.} @defproc[(in-sequences [seq sequence?] ...) sequence?]{ Returns a sequence that is made of all input sequences, one after the - other. The elements of each @scheme[seq] must all have the same + other. The elements of each @racket[seq] must all have the same number of values.} @defproc[(in-cycle [seq sequence?] ...) sequence?]{ - Similar to @scheme[in-sequences], but the sequences are repeated in an + Similar to @racket[in-sequences], but the sequences are repeated in an infinite cycle.} @defproc[(in-parallel [seq sequence?] ...) sequence?]{ Returns a sequence where each element has as many values as the number - of supplied @scheme[seq]s; the values, in order, are the values of - each @scheme[seq]. The elements of each @scheme[seq] must be + of supplied @racket[seq]s; the values, in order, are the values of + each @racket[seq]. The elements of each @racket[seq] must be single-valued.} @defproc[(in-values-sequence [seq sequence?]) sequence?]{ @@ -312,16 +312,16 @@ in the sequence. @defproc[(stop-before [seq sequence?] [pred (any/c . -> . any)]) sequence?]{ - Returns a sequence that contains the elements of @scheme[seq] (which + Returns a sequence that contains the elements of @racket[seq] (which must be single-valued), but only until the last element for which - applying @scheme[pred] to the element produces @scheme[#t], after + applying @racket[pred] to the element produces @racket[#t], after which the sequence ends.} @defproc[(stop-after [seq sequence?] [pred (any/c . -> . any)]) sequence?]{ - Returns a sequence that contains the elements of @scheme[seq] (which + Returns a sequence that contains the elements of @racket[seq] (which must be single-valued), but only until the element (inclusive) for - which applying @scheme[pred] to the element produces @scheme[#t], + which applying @racket[pred] to the element produces @racket[#t], after which the sequence ends.} @defproc[(make-do-sequence [thunk (-> (values (any/c . -> . any) @@ -338,12 +338,12 @@ in the sequence. the thunk, and the @defterm{element}, which may consist of multiple values. - The @scheme[thunk] results define the generated elements as follows: + The @racket[thunk] results define the generated elements as follows: @itemize[ - @item{The first result is a @scheme[_pos->element] procedure that takes + @item{The first result is a @racket[_pos->element] procedure that takes the current position and returns the value(s) for the current element.} - @item{The second result is a @scheme[_next-pos] procedure that takes + @item{The second result is a @racket[_next-pos] procedure that takes the current position and returns the next position.} @item{The third result is the initial position.} @item{The fourth result is a @racket[_continue-with-pos?] function that @@ -370,19 +370,19 @@ in the sequence. Each of the procedures listed above is called only once per position. Among the last three procedures, as soon as one of the procedures - returns @scheme[#f], the sequence ends, and none are called again. + returns @racket[#f], the sequence ends, and none are called again. Typically, one of the functions determines the end condition, and - @scheme[#f] is used in place of the other two functions.} + @racket[#f] is used in place of the other two functions.} @defthing[prop:sequence struct-type-property?]{ Associates a procedure to a structure type that takes an instance of - the structure and returns a sequence. If @scheme[v] is an instance of - a structure type with this property, then @scheme[(sequence? v)] - produces @scheme[#t]. + the structure and returns a sequence. If @racket[v] is an instance of + a structure type with this property, then @racket[(sequence? v)] + produces @racket[#t]. @let-syntax[([car (make-element-id-transformer - (lambda (id) #'@schemeidfont{car}))]) + (lambda (id) #'@racketidfont{car}))]) @examples[ (define-struct train (car next) #:property prop:sequence (lambda (t) @@ -420,7 +420,7 @@ in the sequence. (values (-> boolean?) (-> any))]{ @tech{Initiates} a sequence and returns two thunks to extract elements from the sequence. The first - returns @scheme[#t] if more values are available for the sequence. + returns @racket[#t] if more values are available for the sequence. The second returns the next element (which may be multiple values) from the sequence; if no more elements are available, the @exnraise[exn:fail:contract].} @@ -446,25 +446,25 @@ in the sequence. A sequence with no elements.} @defproc[(sequence->list [s sequence?]) list?]{ - Returns a list whose elements are the elements of @scheme[s], - each of which must be a single value. If @scheme[s] is infinite, this + Returns a list whose elements are the elements of @racket[s], + each of which must be a single value. If @racket[s] is infinite, this function does not terminate.} @defproc[(sequence-length [s sequence?]) exact-nonnegative-integer?]{ - Returns the number of elements of @scheme[s] by extracting and - discarding all of them. If @scheme[s] is infinite, this function + Returns the number of elements of @racket[s] by extracting and + discarding all of them. If @racket[s] is infinite, this function does not terminate.} @defproc[(sequence-ref [s sequence?] [i exact-nonnegative-integer?]) any]{ - Returns the @scheme[i]th element of @scheme[s] (which may be + Returns the @racket[i]th element of @racket[s] (which may be multiple values).} @defproc[(sequence-tail [s sequence?] [i exact-nonnegative-integer?]) sequence?]{ - Returns a sequence equivalent to @scheme[s], except that the first - @scheme[i] elements are omitted. + Returns a sequence equivalent to @racket[s], except that the first + @racket[i] elements are omitted. In case @tech[#:key "initiate"]{initiating} @racket[s] involves a side effect, the sequence @racket[s] is not @tech{initiate}d @@ -484,8 +484,8 @@ in the sequence. @defproc[(sequence-map [f procedure?] [s sequence?]) sequence?]{ - Returns a sequence that contains @scheme[f] applied to each element of - @scheme[s]. The new sequence is constructed lazily. + Returns a sequence that contains @racket[f] applied to each element of + @racket[s]. The new sequence is constructed lazily. If @racket[s] is a @tech{stream}, then the result is also a @tech{stream}.} @@ -493,45 +493,45 @@ in the sequence. @defproc[(sequence-andmap [f (-> any/c ... boolean?)] [s sequence?]) boolean?]{ - Returns @scheme[#t] if @scheme[f] returns a true result on every - element of @scheme[s]. If @scheme[s] is infinite and @scheme[f] never + Returns @racket[#t] if @racket[f] returns a true result on every + element of @racket[s]. If @racket[s] is infinite and @racket[f] never returns a false result, this function does not terminate.} @defproc[(sequence-ormap [f (-> any/c ... boolean?)] [s sequence?]) boolean?]{ - Returns @scheme[#t] if @scheme[f] returns a true result on some - element of @scheme[s]. If @scheme[s] is infinite and @scheme[f] never + Returns @racket[#t] if @racket[f] returns a true result on some + element of @racket[s]. If @racket[s] is infinite and @racket[f] never returns a true result, this function does not terminate.} @defproc[(sequence-for-each [f (-> any/c ... any)] [s sequence?]) (void)]{ - Applies @scheme[f] to each element of @scheme[s]. If @scheme[s] is + Applies @racket[f] to each element of @racket[s]. If @racket[s] is infinite, this function does not terminate.} @defproc[(sequence-fold [f (-> any/c any/c ... any/c)] [i any/c] [s sequence?]) (void)]{ - Folds @scheme[f] over each element of @scheme[s] with @scheme[i] as - the initial accumulator. If @scheme[s] is infinite, this function + Folds @racket[f] over each element of @racket[s] with @racket[i] as + the initial accumulator. If @racket[s] is infinite, this function does not terminate.} @defproc[(sequence-count [f procedure?] [s sequence?]) exact-nonnegative-integer?]{ - Returns the number of elements in @scheme[s] for which @scheme[f] - returns a true result. If @scheme[s] is infinite, this function does + Returns the number of elements in @racket[s] for which @racket[f] + returns a true result. If @racket[s] is infinite, this function does not terminate.} @defproc[(sequence-filter [f (-> any/c ... boolean?)] [s sequence?]) sequence?]{ - Returns a sequence whose elements are the elements of @scheme[s] for - which @scheme[f] returns a true result. Although the new sequence is - constructed lazily, if @scheme[s] has an infinite number of elements - where @scheme[f] returns a false result in between two elements where - @scheme[f] returns a true result, then operations on this sequence will + Returns a sequence whose elements are the elements of @racket[s] for + which @racket[f] returns a true result. Although the new sequence is + constructed lazily, if @racket[s] has an infinite number of elements + where @racket[f] returns a false result in between two elements where + @racket[f] returns a true result, then operations on this sequence will not terminate during the infinite sub-sequence. If @racket[s] is a @tech{stream}, then the result is also a @@ -539,8 +539,8 @@ in the sequence. @defproc[(sequence-add-between [s sequence?] [e any/c]) sequence?]{ - Returns a sequence whose elements are the elements of @scheme[s], - but with @scheme[e] between each pair of elements in @racket[s]. + Returns a sequence whose elements are the elements of @racket[s], + but with @racket[e] between each pair of elements in @racket[s]. The new sequence is constructed lazily. If @racket[s] is a @tech{stream}, then the result is also a @@ -558,8 +558,8 @@ can be used as stream, and functions such as @racket[in-range] and @note-lib[racket/stream] @defproc[(stream? [v any/c]) boolean?]{ - Returns @scheme[#t] if @scheme[v] can be used as a @tech{stream}, - @scheme[#f] otherwise.} + Returns @racket[#t] if @racket[v] can be used as a @tech{stream}, + @racket[#f] otherwise.} @defproc[(stream-empty? [s stream?]) boolean?]{ Returns @racket[#f] if @racket[s] has no elements, @racket[#f] @@ -595,13 +595,13 @@ when it is evaluated, otherwise the @exnraise[exn:fail:contract?].} A stream with no elements.} @defproc[(stream->list [s stream?]) list?]{ - Returns a list whose elements are the elements of @scheme[s], - each of which must be a single value. If @scheme[s] is infinite, this + Returns a list whose elements are the elements of @racket[s], + each of which must be a single value. If @racket[s] is infinite, this function does not terminate.} @defproc[(stream-length [s stream?]) exact-nonnegative-integer?]{ - Returns the number of elements of @scheme[s]. If @scheme[s] is + Returns the number of elements of @racket[s]. If @racket[s] is infinite, this function does not terminate. In the case of lazy streams, this function forces evaluation only of @@ -609,13 +609,13 @@ when it is evaluated, otherwise the @exnraise[exn:fail:contract?].} @defproc[(stream-ref [s stream?] [i exact-nonnegative-integer?]) any]{ - Returns the @scheme[i]th element of @scheme[s] (which may be + Returns the @racket[i]th element of @racket[s] (which may be multiple values).} @defproc[(stream-tail [s stream?] [i exact-nonnegative-integer?]) stream?]{ - Returns a stream equivalent to @scheme[s], except that the first - @scheme[i] elements are omitted. + Returns a stream equivalent to @racket[s], except that the first + @racket[i] elements are omitted. In case extracting elements from @racket[s] involves a side effect, they will not be extracted until the first element is extracted from @@ -630,57 +630,57 @@ when it is evaluated, otherwise the @exnraise[exn:fail:contract?].} @defproc[(stream-map [f procedure?] [s stream?]) stream?]{ - Returns a stream that contains @scheme[f] applied to each element of - @scheme[s]. The new stream is constructed lazily.} + Returns a stream that contains @racket[f] applied to each element of + @racket[s]. The new stream is constructed lazily.} @defproc[(stream-andmap [f (-> any/c ... boolean?)] [s stream?]) boolean?]{ - Returns @scheme[#t] if @scheme[f] returns a true result on every - element of @scheme[s]. If @scheme[s] is infinite and @scheme[f] never + Returns @racket[#t] if @racket[f] returns a true result on every + element of @racket[s]. If @racket[s] is infinite and @racket[f] never returns a false result, this function does not terminate.} @defproc[(stream-ormap [f (-> any/c ... boolean?)] [s stream?]) boolean?]{ - Returns @scheme[#t] if @scheme[f] returns a true result on some - element of @scheme[s]. If @scheme[s] is infinite and @scheme[f] never + Returns @racket[#t] if @racket[f] returns a true result on some + element of @racket[s]. If @racket[s] is infinite and @racket[f] never returns a true result, this function does not terminate.} @defproc[(stream-for-each [f (-> any/c ... any)] [s stream?]) (void)]{ - Applies @scheme[f] to each element of @scheme[s]. If @scheme[s] is + Applies @racket[f] to each element of @racket[s]. If @racket[s] is infinite, this function does not terminate.} @defproc[(stream-fold [f (-> any/c any/c ... any/c)] [i any/c] [s stream?]) (void)]{ - Folds @scheme[f] over each element of @scheme[s] with @scheme[i] as - the initial accumulator. If @scheme[s] is infinite, this function + Folds @racket[f] over each element of @racket[s] with @racket[i] as + the initial accumulator. If @racket[s] is infinite, this function does not terminate.} @defproc[(stream-count [f procedure?] [s stream?]) exact-nonnegative-integer?]{ - Returns the number of elements in @scheme[s] for which @scheme[f] - returns a true result. If @scheme[s] is infinite, this function does + Returns the number of elements in @racket[s] for which @racket[f] + returns a true result. If @racket[s] is infinite, this function does not terminate.} @defproc[(stream-filter [f (-> any/c ... boolean?)] [s stream?]) stream?]{ - Returns a stream whose elements are the elements of @scheme[s] for - which @scheme[f] returns a true result. Although the new stream is - constructed lazily, if @scheme[s] has an infinite number of elements - where @scheme[f] returns a false result in between two elements where - @scheme[f] returns a true result, then operations on this stream will + Returns a stream whose elements are the elements of @racket[s] for + which @racket[f] returns a true result. Although the new stream is + constructed lazily, if @racket[s] has an infinite number of elements + where @racket[f] returns a false result in between two elements where + @racket[f] returns a true result, then operations on this stream will not terminate during the infinite sub-stream.} @defproc[(stream-add-between [s stream?] [e any/c]) stream?]{ - Returns a stream whose elements are the elements of @scheme[s], - but with @scheme[e] between each pair of elements in @racket[s]. + Returns a stream whose elements are the elements of @racket[s], + but with @racket[e] between each pair of elements in @racket[s]. The new stream is constructed lazily.} @defthing[prop:stream struct-type-property?]{ @@ -712,8 +712,8 @@ values from the generator. @defproc[(generator? [v any/c]) boolean?]{ - Return @scheme[#t] if @scheme[v] is a @tech{generator}, - @scheme[#f] otherwise.} + Return @racket[#t] if @racket[v] is a @tech{generator}, + @racket[#f] otherwise.} @defform[(generator formals body ...+)]{ @@ -776,7 +776,7 @@ values from the generator. (pass-values-generator 12)]} @defform[(infinite-generator body ...+)]{ - Like @scheme[generator], but repeats evaluation of the @racket[body]s when + Like @racket[generator], but repeats evaluation of the @racket[body]s when the last @racket[body] completes without implicitly @racket[yield]ing. @examples[#:eval generator-eval @@ -802,7 +802,7 @@ Produces a @tech{sequence} that encapsulates the @tech{generator} formed by (loop (cdr x)))))]) i)] - To use an existing generator as a sequence, use @scheme[in-producer] + To use an existing generator as a sequence, use @racket[in-producer] with a stop-value known for the generator. @examples[#:eval generator-eval @@ -822,13 +822,13 @@ Produces a @tech{sequence} that encapsulates the @tech{generator} formed by Returns a symbol that describes the state of the generator. @itemize[ - @item{@scheme['fresh] --- The generator has been freshly created and + @item{@racket['fresh] --- The generator has been freshly created and has not been called yet.} - @item{@scheme['suspended] --- Control within the generator has been - suspended due to a call to @scheme[yield]. The generator can + @item{@racket['suspended] --- Control within the generator has been + suspended due to a call to @racket[yield]. The generator can be called.} - @item{@scheme['running] --- The generator is currently executing.} - @item{@scheme['done] --- The generator has executed its entire + @item{@racket['running] --- The generator is currently executing.} + @item{@racket['done] --- The generator has executed its entire body and will continue to produce the same result as from the last call.}] @@ -857,7 +857,7 @@ Produces a @tech{sequence} that encapsulates the @tech{generator} formed by as its final result.} @defproc[(sequence->repeated-generator [s sequence?]) (-> any)]{ - Like @scheme[sequence->generator], but when @racket[s] has no further + Like @racket[sequence->generator], but when @racket[s] has no further values, the generator starts the sequence again (so that the generator never stops producing values).} diff --git a/collects/scribblings/reference/serialization.scrbl b/collects/scribblings/reference/serialization.scrbl index 42a79a9f07..360fbaa965 100644 --- a/collects/scribblings/reference/serialization.scrbl +++ b/collects/scribblings/reference/serialization.scrbl @@ -10,19 +10,19 @@ @defproc[(serializable? [v any/c]) boolean?]{ -Returns @scheme[#t] if @scheme[v] appears to be serializable, without -checking the content of compound values, and @scheme[#f] otherwise. -See @scheme[serialize] for an enumeration of serializable values.} +Returns @racket[#t] if @racket[v] appears to be serializable, without +checking the content of compound values, and @racket[#f] otherwise. +See @racket[serialize] for an enumeration of serializable values.} @; ---------------------------------------------------------------------- @defproc[(serialize [v serializable?]) any]{ -Returns a value that encapsulates the value @scheme[v]. This value +Returns a value that encapsulates the value @racket[v]. This value includes only readable values, so it can be written to a stream with -@scheme[write] or @racket[s-exp->fasl], later read from a stream using -@scheme[read] or @racket[fasl->s-exp], and then converted to a value -like the original using @scheme[deserialize]. Serialization followed +@racket[write] or @racket[s-exp->fasl], later read from a stream using +@racket[read] or @racket[fasl->s-exp], and then converted to a value +like the original using @racket[deserialize]. Serialization followed by deserialization produces a value with the same graph structure and mutability as the original value, but the serialized value is a plain tree (i.e., no sharing). @@ -31,15 +31,15 @@ The following kinds of values are serializable: @itemize[ - @item{structures created through @scheme[serializable-struct] or - @scheme[serializable-struct/versions], or more generally - structures with the @scheme[prop:serializable] property (see - @scheme[prop:serializable] for more information);} + @item{structures created through @racket[serializable-struct] or + @racket[serializable-struct/versions], or more generally + structures with the @racket[prop:serializable] property (see + @racket[prop:serializable] for more information);} @item{structures that instantiate @techlink{prefab} structure types;} - @item{instances of classes defined with @scheme[define-serializable-class] - or @scheme[define-serializable-class];} + @item{instances of classes defined with @racket[define-serializable-class] + or @racket[define-serializable-class];} @item{booleans, numbers, characters, @tech{interned} symbols, @tech{unreadable symbols}, strings, byte strings, paths (for a @@ -47,7 +47,7 @@ The following kinds of values are serializable: @item{pairs, mutable pairs, vectors, boxes, hash tables, and sets;} - @item{@scheme[date] and @scheme[arity-at-least] structures; and} + @item{@racket[date] and @racket[arity-at-least] structures; and} @item{@tech{module path index} values.} @@ -55,7 +55,7 @@ The following kinds of values are serializable: Serialization succeeds for a compound value, such as a pair, only if all content of the value is serializable. If a value given to -@scheme[serialize] is not completely serializable, the +@racket[serialize] is not completely serializable, the @exnraise[exn:fail:contract]. If @racket[v] contains a cycle (i.e., a collection of objects that @@ -67,53 +67,53 @@ structure counts as mutable only if all of its fields are mutable. currently do not handle certain cyclic values that @racket[read] and @racket[write] can handle, such as @racket['@#,read[(open-input-string "#0=(#0#)")]].} -See @scheme[deserialize] for information on the format of serialized +See @racket[deserialize] for information on the format of serialized data.} @; ---------------------------------------------------------------------- @defproc[(deserialize [v any/c]) any]{ -Given a value @scheme[v] that was produced by @scheme[serialize], -produces a value like the one given to @scheme[serialize], including +Given a value @racket[v] that was produced by @racket[serialize], +produces a value like the one given to @racket[serialize], including the same graph structure and mutability. -A serialized representation @scheme[v] is a list of six or seven +A serialized representation @racket[v] is a list of six or seven elements: @itemize[ - @item{An optional list @scheme['(1)] or @scheme['(2)] that represents + @item{An optional list @racket['(1)] or @racket['(2)] that represents the version of the serialization format. If the first element of a representation is not a list, then the version is - @scheme[0]. Version 1 adds support for mutable pairs, and + @racket[0]. Version 1 adds support for mutable pairs, and version 2 adds support for @tech{unreadable symbols}.} - @item{A non-negative exact integer @scheme[_s-count] that represents the + @item{A non-negative exact integer @racket[_s-count] that represents the number of distinct structure types represented in the serialized data.} - @item{A list @scheme[_s-types] of length @scheme[_s-count], where + @item{A list @racket[_s-types] of length @racket[_s-count], where each element represents a structure type. Each structure type - is encoded as a pair. The @scheme[car] of the pair is - @scheme[#f] for a structure whose deserialization information + is encoded as a pair. The @racket[car] of the pair is + @racket[#f] for a structure whose deserialization information is defined at the top level, otherwise it is a quoted @tech{module path} or a byte string (to be converted into a - platform-specific path using @scheme[bytes->path]) for a module + platform-specific path using @racket[bytes->path]) for a module that exports the structure's deserialization information. The - @scheme[cdr] of the pair is the name of a binding (at the top + @racket[cdr] of the pair is the name of a binding (at the top level or exported from a module) for deserialization information, either a symbol or a string representing an @tech{unreadable symbol}. These two are used with either - @scheme[namespace-variable-binding] or @scheme[dynamic-require] + @racket[namespace-variable-binding] or @racket[dynamic-require] to obtain deserialization information. See - @scheme[make-deserialize-info] for more information on the - binding's value. See also @scheme[deserialize-module-guard].} + @racket[make-deserialize-info] for more information on the + binding's value. See also @racket[deserialize-module-guard].} - @item{A non-negative exact integer, @scheme[_g-count] that represents the + @item{A non-negative exact integer, @racket[_g-count] that represents the number of graph points contained in the following list.} - @item{A list @scheme[_graph] of length @scheme[_g-count], where each element + @item{A list @racket[_graph] of length @racket[_g-count], where each element represents a serialized value to be referenced during the construction of other serialized values. Each list element is either a box or not: @@ -121,60 +121,60 @@ elements: @itemize[ @item{A box represents a value that is part of a cycle, and for - deserialization, it must be allocated with @scheme[#f] for + deserialization, it must be allocated with @racket[#f] for each of its fields. The content of the box indicates the shape of the value: @itemize[ - @item{a non-negative exact integer @scheme[_i] for an instance + @item{a non-negative exact integer @racket[_i] for an instance of a structure type that is represented by the - @scheme[_i]th element of the @scheme[_s-types] list;} + @racket[_i]th element of the @racket[_s-types] list;} - @item{@scheme['c] for a pair, which fails on + @item{@racket['c] for a pair, which fails on deserialization (since pairs are immutable; this case does not appear in output generated by - @scheme[serialize]);} + @racket[serialize]);} - @item{@scheme['m] for a mutable pair;} + @item{@racket['m] for a mutable pair;} - @item{@scheme['b] for a box;} + @item{@racket['b] for a box;} - @item{a pair whose @scheme[car] is @scheme['v] and whose - @scheme[cdr] is a non-negative exact integer @scheme[_s] - for a vector of length @scheme[_s];} + @item{a pair whose @racket[car] is @racket['v] and whose + @racket[cdr] is a non-negative exact integer @racket[_s] + for a vector of length @racket[_s];} - @item{a list whose first element is @scheme['h] and whose + @item{a list whose first element is @racket['h] and whose remaining elements are symbols that determine the hash-table type: @itemize[ - @item{@scheme['equal] --- @scheme[(make-hash)]} - @item{@scheme['equal 'weak] --- @scheme[(make-weak-hash)]} - @item{@scheme['weak] --- @scheme[(make-weak-hasheq)]} - @item{no symbols --- @scheme[(make-hasheq)]} + @item{@racket['equal] --- @racket[(make-hash)]} + @item{@racket['equal 'weak] --- @racket[(make-weak-hash)]} + @item{@racket['weak] --- @racket[(make-weak-hasheq)]} + @item{no symbols --- @racket[(make-hasheq)]} ]} - @item{@scheme['date] for a @scheme[date] structure, which + @item{@racket['date] for a @racket[date] structure, which fails on deserialization (since dates are immutable; this case does not appear in output generated by - @scheme[serialize]);} + @racket[serialize]);} - @item{@scheme['arity-at-least] for an - @scheme[arity-at-least] structure, which fails on + @item{@racket['arity-at-least] for an + @racket[arity-at-least] structure, which fails on deserialization (since dates are immutable; this case does not appear in output generated by - @scheme[serialize]); or} + @racket[serialize]); or} - @item{@scheme['mpi] for a @tech{module path index}, which + @item{@racket['mpi] for a @tech{module path index}, which fails on deserialization (since dates are immutable; this case does not appear in output generated by - @scheme[serialize]).} + @racket[serialize]).} ] - The @scheme[#f]-filled value will be updated with content specified - by the fifth element of the serialization list @scheme[v].} + The @racket[#f]-filled value will be updated with content specified + by the fifth element of the serialization list @racket[v].} @item{A non-box represents a @defterm{serial} value to be constructed immediately, and it is one of the following: @@ -189,100 +189,100 @@ elements: @item{a byte string, representing an immutable byte string.} - @item{a pair whose @scheme[car] is @scheme['?] and whose - @scheme[cdr] is a non-negative exact integer - @scheme[_i]; it represents the value constructed for the - @scheme[_i]th element of @scheme[_graph], where @scheme[_i] is + @item{a pair whose @racket[car] is @racket['?] and whose + @racket[cdr] is a non-negative exact integer + @racket[_i]; it represents the value constructed for the + @racket[_i]th element of @racket[_graph], where @racket[_i] is less than the position of this element within - @scheme[_graph].} + @racket[_graph].} - @item{a pair whose @scheme[car] is a number @scheme[_i]; it + @item{a pair whose @racket[car] is a number @racket[_i]; it represents an instance of a structure type that is - described by the @scheme[_i]th element of the - @scheme[_s-types] list. The @scheme[cdr] of the pair is + described by the @racket[_i]th element of the + @racket[_s-types] list. The @racket[cdr] of the pair is a list of serials representing arguments to be provided to the structure type's deserializer.} - @item{a pair whose @scheme[car] is @scheme['f]; it + @item{a pair whose @racket[car] is @racket['f]; it represents an instance of a @tech{prefab} structure - type. The @scheme[cadr] of the pair is a @tech{prefab} - structure type key, and the @scheme[cddr] is a list of + type. The @racket[cadr] of the pair is a @tech{prefab} + structure type key, and the @racket[cddr] is a list of serials representing the field values.} - @item{a pair whose @scheme[car] is @scheme['void], + @item{a pair whose @racket[car] is @racket['void], representing @|void-const|.} - @item{a pair whose @scheme[car] is @scheme['su] and whose - @scheme[cdr] is a character string; it represents an + @item{a pair whose @racket[car] is @racket['su] and whose + @racket[cdr] is a character string; it represents an @tech{unreadable symbol}.} - @item{a pair whose @scheme[car] is @scheme['u] and whose - @scheme[cdr] is either a byte string or character + @item{a pair whose @racket[car] is @racket['u] and whose + @racket[cdr] is either a byte string or character string; it represents a mutable byte or character string.} - @item{a pair whose @scheme[car] is @scheme['p] and whose - @scheme[cdr] is a byte string; it represents a + @item{a pair whose @racket[car] is @racket['p] and whose + @racket[cdr] is a byte string; it represents a path using the serializer's path convention - (deprecated in favor of @scheme['p+]).} + (deprecated in favor of @racket['p+]).} - @item{a pair whose @scheme[car] is @scheme['p+], whose - @scheme[cadr] is a byte string, and whose @scheme[cddr] + @item{a pair whose @racket[car] is @racket['p+], whose + @racket[cadr] is a byte string, and whose @racket[cddr] is one of the possible symbol results of - @scheme[system-path-convention-type]; it represents a + @racket[system-path-convention-type]; it represents a path using the specified convention.} - @item{a pair whose @scheme[car] is @scheme['c] and whose - @scheme[cdr] is a pair of serials; it represents an + @item{a pair whose @racket[car] is @racket['c] and whose + @racket[cdr] is a pair of serials; it represents an immutable pair.} - @item{a pair whose @scheme[car] is @scheme['c!] and whose - @scheme[cdr] is a pair of serials; it represents a + @item{a pair whose @racket[car] is @racket['c!] and whose + @racket[cdr] is a pair of serials; it represents a pair (but formerly represented a mutable pair), and does not appear in output generated by - @scheme[serialize].} + @racket[serialize].} - @item{a pair whose @scheme[car] is @scheme['m] and whose - @scheme[cdr] is a pair of serials; it represents a + @item{a pair whose @racket[car] is @racket['m] and whose + @racket[cdr] is a pair of serials; it represents a mutable pair.} - @item{a pair whose @scheme[car] is @scheme['v] and whose - @scheme[cdr] is a list of serials; it represents an + @item{a pair whose @racket[car] is @racket['v] and whose + @racket[cdr] is a list of serials; it represents an immutable vector.} - @item{a pair whose @scheme[car] is @scheme['v!] and whose - @scheme[cdr] is a list of serials; it represents a + @item{a pair whose @racket[car] is @racket['v!] and whose + @racket[cdr] is a list of serials; it represents a mutable vector.} - @item{a pair whose @scheme[car] is @scheme['b] and whose - @scheme[cdr] is a serial; it represents an immutable + @item{a pair whose @racket[car] is @racket['b] and whose + @racket[cdr] is a serial; it represents an immutable box.} - @item{a pair whose @scheme[car] is @scheme['b!] and whose - @scheme[cdr] is a serial; it represents a mutable + @item{a pair whose @racket[car] is @racket['b!] and whose + @racket[cdr] is a serial; it represents a mutable box.} - @item{a pair whose @scheme[car] is @scheme['h], whose - @scheme[cadr] is either @scheme['!] or @scheme['-] + @item{a pair whose @racket[car] is @racket['h], whose + @racket[cadr] is either @racket['!] or @racket['-] (mutable or immutable, respectively), whose - @scheme[caddr] is a list of symbols (containing - @scheme['equal], @scheme['weak], both, or neither) + @racket[caddr] is a list of symbols (containing + @racket['equal], @racket['weak], both, or neither) that determines the hash table type, and whose - @scheme[cdddr] is a list of pairs, where the - @scheme[car] of each pair is a serial for a - hash-table key and the @scheme[cdr] is a serial for + @racket[cdddr] is a list of pairs, where the + @racket[car] of each pair is a serial for a + hash-table key and the @racket[cdr] is a serial for the corresponding value.} - @item{a pair whose @scheme[car] is @scheme['date] and whose - @scheme[cdr] is a list of serials; it represents a - @scheme[date] structure.} + @item{a pair whose @racket[car] is @racket['date] and whose + @racket[cdr] is a list of serials; it represents a + @racket[date] structure.} - @item{a pair whose @scheme[car] is @scheme['arity-at-least] - and whose @scheme[cdr] is a serial; it represents an - @scheme[arity-at-least] structure.} + @item{a pair whose @racket[car] is @racket['arity-at-least] + and whose @racket[cdr] is a serial; it represents an + @racket[arity-at-least] structure.} - @item{a pair whose @scheme[car] is @scheme['mpi] and whose - @scheme[cdr] is a pair; it represents a + @item{a pair whose @racket[car] is @racket['mpi] and whose + @racket[cdr] is a pair; it represents a @tech{module path index} that joins the paired values.} @@ -290,24 +290,24 @@ elements: ]} - @item{A list of pairs, where the @scheme[car] of each pair is a - non-negative exact integer @scheme[_i] and the @scheme[cdr] is a + @item{A list of pairs, where the @racket[car] of each pair is a + non-negative exact integer @racket[_i] and the @racket[cdr] is a serial (as defined in the previous bullet). Each element - represents an update to an @scheme[_i]th element of @scheme[_graph] + represents an update to an @racket[_i]th element of @racket[_graph] that was specified as a box, and the serial describes how to construct a new value with the same shape as specified by the box. The content of this new value must be transferred into the - value created for the box in @scheme[_graph].} + value created for the box in @racket[_graph].} @item{A final serial (as defined in the two bullets back) - representing the result of @scheme[deserialize].} + representing the result of @racket[deserialize].} ] -The result of @scheme[deserialize] shares no mutable values with the -argument to @scheme[deserialize]. +The result of @racket[deserialize] shares no mutable values with the +argument to @racket[deserialize]. -If a value provided to @scheme[serialize] is a simple tree (i.e., no +If a value provided to @racket[serialize] is a simple tree (i.e., no sharing), then the fourth and fifth elements in the serialized representation will be empty.} @@ -315,10 +315,10 @@ representation will be empty.} @defproc[(serialized=? [v1 any/c] [v2 any/c]) boolean?]{ -Returns @scheme[#t] if @scheme[v1] and @scheme[v2] represent the same +Returns @racket[#t] if @racket[v1] and @racket[v2] represent the same serialization information. -More precisely, it returns the same value that @scheme[(equal? +More precisely, it returns the same value that @racket[(equal? (deserialize v1) (deserialize v2))] would return if @itemize[ @@ -329,7 +329,7 @@ More precisely, it returns the same value that @scheme[(equal? @item{all structure types are transparent; and} @item{all structure instances contain only the constituent values - recorded in each of @scheme[v1] and @scheme[v2].} + recorded in each of @racket[v1] and @racket[v2].} ]} @@ -337,19 +337,19 @@ More precisely, it returns the same value that @scheme[(equal? @defparam[deserialize-module-guard guard (module-path? symbol? . -> . void?)]{ -A parameter whose value is called by @scheme[deserialize] before -dynamically loading a module via @scheme[dynamic-require]. The two +A parameter whose value is called by @racket[deserialize] before +dynamically loading a module via @racket[dynamic-require]. The two arguments provided to the procedure are the same as the arguments to -be passed to @scheme[dynamic-require]. The procedure can raise an -exception to disallow the @scheme[dynamic-require].} +be passed to @racket[dynamic-require]. The procedure can raise an +exception to disallow the @racket[dynamic-require].} @; ---------------------------------------------------------------------- @defform[(serializable-struct id maybe-super (field ...) struct-option ...)]{ -Like @scheme[struct], but instances of the structure type are -serializable with @scheme[serialize]. This form is allowed only at +Like @racket[struct], but instances of the structure type are +serializable with @racket[serialize]. This form is allowed only at the top level or in a module's top level (so that deserialization information can be found later). @@ -357,26 +357,26 @@ Serialization only supports cycles involving the created structure type when all fields are mutable (or when the cycle can be broken through some other mutable value). -In addition to the bindings generated by @scheme[struct], -@scheme[serializable-struct] binds -@schemeidfont{deserialize-info:}@scheme[_id]@schemeidfont{-v0} to +In addition to the bindings generated by @racket[struct], +@racket[serializable-struct] binds +@racketidfont{deserialize-info:}@racket[_id]@racketidfont{-v0} to deserialization information. Furthermore, in a module context, it -automatically @scheme[provide]s this binding. +automatically @racket[provide]s this binding. -The @scheme[serializable-struct] form enables the construction of -structure instances from places where @scheme[id] is not accessible, +The @racket[serializable-struct] form enables the construction of +structure instances from places where @racket[id] is not accessible, since deserialization must construct instances. Furthermore, -@scheme[serializable-struct] provides limited access to field +@racket[serializable-struct] provides limited access to field mutation, but only for instances generated through the deserialization information bound to -@schemeidfont{deserialize-info:}@scheme[_id]@schemeidfont{-v0}. See -@scheme[make-deserialize-info] for more information. +@racketidfont{deserialize-info:}@racket[_id]@racketidfont{-v0}. See +@racket[make-deserialize-info] for more information. -The @scheme[-v0] suffix on the deserialization enables future +The @racket[-v0] suffix on the deserialization enables future versioning on the structure type through -@scheme[serializable-struct/version]. +@racket[serializable-struct/version]. -When a supertype is supplied as @scheme[maybe-super], +When a supertype is supplied as @racket[maybe-super], compile-time information bound to the supertype identifier must include all of the supertype's field accessors. If any field mutator is missing, the structure type will be treated as immutable for the @@ -405,22 +405,22 @@ default constructor name of @racket[define-struct].} ([other-version-clause (other-vers make-proc-expr cycle-make-proc-expr)])]{ -Like @scheme[serializable-struct], but the generated deserializer +Like @racket[serializable-struct], but the generated deserializer binding is -@schemeidfont{deserialize-info:}@scheme[_id]@schemeidfont{-v}@scheme[vers]. In +@racketidfont{deserialize-info:}@racket[_id]@racketidfont{-v}@racket[vers]. In addition, -@schemeidfont{deserialize-info:}@scheme[_id]@schemeidfont{-v}@scheme[other-vers] -is bound for each @scheme[other-vers]. The @scheme[vers] and each -@scheme[other-vers] must be a literal, exact, nonnegative integer. +@racketidfont{deserialize-info:}@racket[_id]@racketidfont{-v}@racket[other-vers] +is bound for each @racket[other-vers]. The @racket[vers] and each +@racket[other-vers] must be a literal, exact, nonnegative integer. -Each @scheme[make-proc-expr] should produce a procedure, and the +Each @racket[make-proc-expr] should produce a procedure, and the procedure should accept as many argument as fields in the corresponding version of the structure type, and it produce an -instance of @scheme[id]. Each @scheme[cycle-make-proc-expr] should +instance of @racket[id]. Each @racket[cycle-make-proc-expr] should produce a procedure of no arguments; this procedure should return two -values: an instance @scheme[x] of @scheme[id] (typically with -@scheme[#f] for all fields) and a procedure that accepts another -instance of @scheme[id] and copies its field values into @scheme[x]. +values: an instance @racket[x] of @racket[id] (typically with +@racket[#f] for all fields) and a procedure that accepts another +instance of @racket[id] and copies its field values into @racket[x]. @examples[ #:eval ser-eval @@ -467,22 +467,22 @@ default constructor name of @racket[define-struct]. any]{ Produces a deserialization information record to be used by -@scheme[deserialize]. This information is normally tied to a +@racket[deserialize]. This information is normally tied to a particular structure because the structure has a -@scheme[prop:serializable] property value that points to a top-level +@racket[prop:serializable] property value that points to a top-level variable or module-exported variable that is bound to deserialization information. -The @scheme[make] procedure should accept as many arguments as the +The @racket[make] procedure should accept as many arguments as the structure's serializer put into a vector; normally, this is the number of fields in the structure. It should return an instance of the structure. -The @scheme[cycle-make] procedure should accept no arguments, and it -should return two values: a structure instance @scheme[x] (with dummy +The @racket[cycle-make] procedure should accept no arguments, and it +should return two values: a structure instance @racket[x] (with dummy field values) and an update procedure. The update procedure takes -another structure instance generated by the @scheme[make], and it -transfers the field values of this instance into @scheme[x].} +another structure instance generated by the @racket[make], and it +transfers the field values of this instance into @racket[x].} @; ---------------------------------------------------------------------- @@ -490,7 +490,7 @@ transfers the field values of this instance into @scheme[x].} This property identifies structures and structure types that are serializable. The property value should be constructed with -@scheme[make-serialize-info].} +@racket[make-serialize-info].} @; ---------------------------------------------------------------------- @@ -504,47 +504,47 @@ serializable. The property value should be constructed with any]{ Produces a value to be associated with a structure type through the -@scheme[prop:serializable] property. This value is used by -@scheme[serialize]. +@racket[prop:serializable] property. This value is used by +@racket[serialize]. -The @scheme[to-vector] procedure should accept a structure instance +The @racket[to-vector] procedure should accept a structure instance and produce a vector for the instance's content. -The @scheme[deserialize-id] value indicates a binding for deserialize +The @racket[deserialize-id] value indicates a binding for deserialize information, to either a module export or a top-level definition. It must be one of the following: @itemize[ - @item{If @scheme[deserialize-id] is an identifier, and if - @scheme[(identifier-binding deserialize-id)] produces a list, then + @item{If @racket[deserialize-id] is an identifier, and if + @racket[(identifier-binding deserialize-id)] produces a list, then the third element is used for the exporting module, otherwise the - top-level is assumed. In either case, @scheme[syntax-e] is used to + top-level is assumed. In either case, @racket[syntax-e] is used to obtain the name of an exported identifier or top-level definition.} - @item{If @scheme[deserialize-id] is a symbol, it indicates a + @item{If @racket[deserialize-id] is a symbol, it indicates a top-level variable that is named by the symbol.} - @item{If @scheme[deserialize-id] is a pair, the @scheme[car] must be - a symbol to name an exported identifier, and the @scheme[cdr] must be + @item{If @racket[deserialize-id] is a pair, the @racket[car] must be + a symbol to name an exported identifier, and the @racket[cdr] must be a module path index to specify the exporting module.} ] -See @scheme[make-deserialize-info] and @scheme[deserialize] for more +See @racket[make-deserialize-info] and @racket[deserialize] for more information. -The @scheme[can-cycle?] argument should be false if instances should +The @racket[can-cycle?] argument should be false if instances should not be serialized in such a way that deserialization requires creating a structure instance with dummy field values and then updating the instance later. -The @scheme[dir] argument should be a directory path that is used to -resolve a module reference for the binding of @scheme[deserialize-id]. +The @racket[dir] argument should be a directory path that is used to +resolve a module reference for the binding of @racket[deserialize-id]. This directory path is used as a last resort when -@scheme[deserialize-id] indicates a module that was loaded through a +@racket[deserialize-id] indicates a module that was loaded through a relative path with respect to the top level. Usually, it should be -@scheme[(or (current-load-relative-directory) (current-directory))].} +@racket[(or (current-load-relative-directory) (current-directory))].} @; ---------------------------------------------------------------------- diff --git a/collects/scribblings/reference/sets.scrbl b/collects/scribblings/reference/sets.scrbl index e6b90adc76..1f62220f0b 100644 --- a/collects/scribblings/reference/sets.scrbl +++ b/collects/scribblings/reference/sets.scrbl @@ -246,7 +246,7 @@ seteq lst)], and @racket[(apply seteqv lst)], respectively. @defproc[(set->list [st set?]) list?]{ -Produces a list containing the elements of @scheme[st].} +Produces a list containing the elements of @racket[st].} @close-eval[set-eval] diff --git a/collects/scribblings/reference/shared.scrbl b/collects/scribblings/reference/shared.scrbl index d689552b2d..c116eb0938 100644 --- a/collects/scribblings/reference/shared.scrbl +++ b/collects/scribblings/reference/shared.scrbl @@ -7,34 +7,34 @@ @(define maker (make-element #f (list - (schemevarfont "prefix:") - (schemeidfont "make-") - (schemevarfont "id")))) + (racketvarfont "prefix:") + (racketidfont "make-") + (racketvarfont "id")))) @(define typedef (make-element #f (list - (schemevarfont "prefix:") - (schemevarfont "id")))) + (racketvarfont "prefix:") + (racketvarfont "id")))) -@title[#:tag "shared"]{Constructing Graphs: @scheme[shared]} +@title[#:tag "shared"]{Constructing Graphs: @racket[shared]} @note-lib[racket/shared] @defform[(shared ([id expr] ...) body ...+)]{ -Binds @scheme[id]s with shared structure according to @scheme[exprs] -and then evaluates the @scheme[body-expr]s, returning the result of +Binds @racket[id]s with shared structure according to @racket[exprs] +and then evaluates the @racket[body-expr]s, returning the result of the last expression. -The @scheme[shared] form is similar to @scheme[letrec], except that -special forms of @scheme[expr] are recognized (after partial macro +The @racket[shared] form is similar to @racket[letrec], except that +special forms of @racket[expr] are recognized (after partial macro expansion) to construct graph-structured data, where the corresponding -@scheme[letrec] would instead produce @|undefined-const|s. +@racket[letrec] would instead produce @|undefined-const|s. -Each @scheme[expr] (after partial expansion) is matched against the -following @scheme[_shared-expr] grammar, where earlier variants in a +Each @racket[expr] (after partial expansion) is matched against the +following @racket[_shared-expr] grammar, where earlier variants in a production take precedence over later variants: -@schemegrammar*[ +@racketgrammar*[ #:literals (cons list list* append vector-immutable box-immutable mcons vector box) [shared-expr shell-expr plain-expr] @@ -58,43 +58,43 @@ production take precedence over later variants: ] The @|maker| identifier above matches three kinds of references. The -first kind is any binding whose name has @schemeidfont{make-} in the +first kind is any binding whose name has @racketidfont{make-} in the middle, and where @|typedef| has a @tech{transformer binding} to structure information with a full set of mutator bindings; see @secref["structinfo"]. The second kind is an identifier that itself has a @tech{transformer binding} to structure information. The third kind is an identifier that has a @racket['constructor-for] @tech{syntax property} whose value is an identifier with a @tech{transformer binding} to structure -information. A @scheme[_shell-id], meanwhile, must be one of the -@scheme[id]s bound by the @scheme[shared] form to a -@scheme[_shell-expr]. +information. A @racket[_shell-id], meanwhile, must be one of the +@racket[id]s bound by the @racket[shared] form to a +@racket[_shell-expr]. -When the @scheme[expr]s of the @scheme[shared] form are parsed as -@scheme[_shared-expr] (taking into account the order of the variants +When the @racket[expr]s of the @racket[shared] form are parsed as +@racket[_shared-expr] (taking into account the order of the variants for parsing precedence), the sub-expressions that were parsed via -@scheme[_early-expr] will be evaluated first when the @scheme[shared] +@racket[_early-expr] will be evaluated first when the @racket[shared] form is evaluated. Among such expressions, they are evaluated in the -order as they appear within the @scheme[shared] form. However, any -reference to an @scheme[id] bound by @scheme[shared] produces -@|undefined-const|, even if the binding for the @scheme[id] appears -before the corresponding @scheme[_early-expr] within the -@scheme[shared] form. +order as they appear within the @racket[shared] form. However, any +reference to an @racket[id] bound by @racket[shared] produces +@|undefined-const|, even if the binding for the @racket[id] appears +before the corresponding @racket[_early-expr] within the +@racket[shared] form. -The @scheme[_shell-ids] and @scheme[_shell-exprs] (not counting -@scheme[_patchable-expr] and @scheme[_early-expr] sub-expressions) are -effectively evaluated next. A @scheme[_shell-id] reference produces -the same value as the corresponding @scheme[_id] will produce within -the @scheme[body]s, assuming that @scheme[_id] is never mutated with -@scheme[set!]. This special handling of a @scheme[_shell-id] -reference is one way in which @scheme[shared] supports the creation of +The @racket[_shell-ids] and @racket[_shell-exprs] (not counting +@racket[_patchable-expr] and @racket[_early-expr] sub-expressions) are +effectively evaluated next. A @racket[_shell-id] reference produces +the same value as the corresponding @racket[_id] will produce within +the @racket[body]s, assuming that @racket[_id] is never mutated with +@racket[set!]. This special handling of a @racket[_shell-id] +reference is one way in which @racket[shared] supports the creation of cyclic data, including immutable cyclic data. -Next, the @scheme[_plain-expr]s are evaluated as for @scheme[letrec], -where a reference to an @scheme[id] produces @|undefined-const| if it -is evaluated before the right-hand side of the @scheme[id] binding. +Next, the @racket[_plain-expr]s are evaluated as for @racket[letrec], +where a reference to an @racket[id] produces @|undefined-const| if it +is evaluated before the right-hand side of the @racket[id] binding. -Finally, the @scheme[_patchable-expr]s are evaluated. At this point, -all @scheme[id]s are bound, so @scheme[_patchable-expr]s also creates +Finally, the @racket[_patchable-expr]s are evaluated. At this point, +all @racket[id]s are bound, so @racket[_patchable-expr]s also creates data cycles (but only with cycles that can be created via mutation). @examples[ @@ -109,10 +109,10 @@ data cycles (but only with cycles that can be created via mutation). a) (shared ([a a]) (code:comment @#,t{no indirection...}) a) -(shared ([a (cons 1 b)] (code:comment @#,t{@scheme[b] is early...}) +(shared ([a (cons 1 b)] (code:comment @#,t{@racket[b] is early...}) [b a]) a) -(shared ([a (mcons 1 b)] (code:comment @#,t{@scheme[b] is patchable...}) +(shared ([a (mcons 1 b)] (code:comment @#,t{@racket[b] is patchable...}) [b a]) a) (shared ([a (vector b b b)] @@ -120,8 +120,8 @@ data cycles (but only with cycles that can be created via mutation). (set-box! b 5) a) (shared ([a (box b)] - [b (vector (unbox a) (code:comment @#,t{@scheme[unbox] after @scheme[a] is patched}) - (unbox c))] (code:comment @#,t{@scheme[unbox] before @scheme[c] is patched}) + [b (vector (unbox a) (code:comment @#,t{@racket[unbox] after @racket[a] is patched}) + (unbox c))] (code:comment @#,t{@racket[unbox] before @racket[c] is patched}) [c (box b)]) b) ]} diff --git a/collects/scribblings/reference/splicing.scrbl b/collects/scribblings/reference/splicing.scrbl index 36f9c4f4ae..cb345e0e5c 100644 --- a/collects/scribblings/reference/splicing.scrbl +++ b/collects/scribblings/reference/splicing.scrbl @@ -23,12 +23,12 @@ @defidform[splicing-local] )]{ -Like @scheme[let], @scheme[letrec], @scheme[let-values], -@scheme[letrec-values], @scheme[let-syntax], @scheme[letrec-syntax], -@scheme[let-syntaxes], @scheme[letrec-syntaxes], -@scheme[letrec-syntaxes+values], and @scheme[local], except that in a +Like @racket[let], @racket[letrec], @racket[let-values], +@racket[letrec-values], @racket[let-syntax], @racket[letrec-syntax], +@racket[let-syntaxes], @racket[letrec-syntaxes], +@racket[letrec-syntaxes+values], and @racket[local], except that in a definition context, the body forms are spliced into the enclosing -definition context (in the same way as for @scheme[begin]). +definition context (in the same way as for @racket[begin]). @examples[ #:eval splice-eval @@ -45,7 +45,7 @@ form's bound variables is evaluated before the variable is initialized, an unbound variable error is raised, instead of the variable evaluating to the undefined value. Also, syntax bindings are evaluated every time the module is @tech{visit}ed, instead of only -once during compilation as in @scheme[let-syntax], etc. +once during compilation as in @racket[let-syntax], etc. @examples[ #:eval splice-eval @@ -56,16 +56,16 @@ once during compilation as in @scheme[let-syntax], etc. @defidform[splicing-syntax-parameterize]{ -Like @scheme[syntax-parameterize], except that in a definition context, the body +Like @racket[syntax-parameterize], except that in a definition context, the body forms are spliced into the enclosing definition context (in the same way as for -@scheme[begin]). In a definition context, the body of -@scheme[splicing-syntax-parameterize] can be empty. +@racket[begin]). In a definition context, the body of +@racket[splicing-syntax-parameterize] can be empty. Note that @tech{require transformers} and @tech{provide transformers} are not -affected by syntax parameterization. While all uses of @scheme[require] and -@scheme[provide] will be spliced into the enclosing context, derived import or +affected by syntax parameterization. While all uses of @racket[require] and +@racket[provide] will be spliced into the enclosing context, derived import or export specifications will expand as if they had not been inside of the -@scheme[splicing-syntax-parameterize]. +@racket[splicing-syntax-parameterize]. @examples[ #:eval splice-eval diff --git a/collects/scribblings/reference/string-input.scrbl b/collects/scribblings/reference/string-input.scrbl index 8df84387fc..32392dee0b 100644 --- a/collects/scribblings/reference/string-input.scrbl +++ b/collects/scribblings/reference/string-input.scrbl @@ -6,53 +6,53 @@ @defproc[(read-char [in input-port? (current-input-port)]) (or/c character? eof-object?)]{ -Reads a single character from @scheme[in]---which may involve reading +Reads a single character from @racket[in]---which may involve reading several bytes to UTF-8-decode them into a character (see @secref["ports"]); a minimal number of bytes are read/peeked to perform the decoding. If no bytes are available before an end-of-file, -then @scheme[eof] is returned.} +then @racket[eof] is returned.} @defproc[(read-byte [in input-port? (current-input-port)]) (or/c byte? eof-object?)]{ -Reads a single byte from @scheme[in]. If no bytes are available before -an end-of-file, then @scheme[eof] is returned.} +Reads a single byte from @racket[in]. If no bytes are available before +an end-of-file, then @racket[eof] is returned.} @defproc[(read-line [in input-port? (current-input-port)] [mode (or/c 'linefeed 'return 'return-linefeed 'any 'any-one) 'linefeed]) (or/c string? eof-object?)]{ -Returns a string containing the next line of bytes from @scheme[in]. +Returns a string containing the next line of bytes from @racket[in]. -Characters are read from @scheme[in] until a line separator or an +Characters are read from @racket[in] until a line separator or an end-of-file is read. The line separator is not included in the result string (but it is removed from the port's stream). If no characters -are read before an end-of-file is encountered, @scheme[eof] is +are read before an end-of-file is encountered, @racket[eof] is returned. -The @scheme[mode] argument determines the line separator(s). It +The @racket[mode] argument determines the line separator(s). It must be one of the following symbols: @itemize[ - @item{@indexed-scheme['linefeed] breaks lines on linefeed characters.} + @item{@indexed-racket['linefeed] breaks lines on linefeed characters.} - @item{@indexed-scheme['return] breaks lines on return characters.} + @item{@indexed-racket['return] breaks lines on return characters.} - @item{@indexed-scheme['return-linefeed] breaks lines on + @item{@indexed-racket['return-linefeed] breaks lines on return-linefeed combinations. If a return character is not followed by a linefeed character, it is included in the result string; similarly, a linefeed that is not preceded by a return is included in the result string.} - @item{@indexed-scheme['any] breaks lines on any of a return + @item{@indexed-racket['any] breaks lines on any of a return character, linefeed character, or return-linefeed combination. If a return character is followed by a linefeed character, the two are treated as a combination.} - @item{@indexed-scheme['any-one] breaks lines on either a return or + @item{@indexed-racket['any-one] breaks lines on either a return or linefeed character, without recognizing return-linefeed combinations.} @@ -62,42 +62,42 @@ Return and linefeed characters are detected after the conversions that are automatically performed when reading a file in text mode. For example, reading a file in text mode on Windows automatically changes return-linefeed combinations to a linefeed. Thus, when a file -is opened in text mode, @scheme['linefeed] is usually the appropriate -@scheme[read-line] mode.} +is opened in text mode, @racket['linefeed] is usually the appropriate +@racket[read-line] mode.} @defproc[(read-bytes-line [in input-port? (current-input-port)] [mode (or/c 'linefeed 'return 'return-linefeed 'any 'any-one) 'linefeed]) (or/c bytes? eof-object?)]{ -Like @scheme[read-line], but reads bytes and produces a byte string.} +Like @racket[read-line], but reads bytes and produces a byte string.} @defproc[(read-string [amt exact-nonnegative-integer?] [in input-port? (current-input-port)]) (or/c string? eof-object?)]{ -@margin-note{To read an entire port as a string use @scheme[port->string].} +@margin-note{To read an entire port as a string use @racket[port->string].} -Returns a string containing the next @scheme[amt] characters from -@scheme[in]. +Returns a string containing the next @racket[amt] characters from +@racket[in]. -If @scheme[amt] is @scheme[0], then the empty string is -returned. Otherwise, if fewer than @scheme[amt] characters are +If @racket[amt] is @racket[0], then the empty string is +returned. Otherwise, if fewer than @racket[amt] characters are available before an end-of-file is encountered, then the returned string will contain only those characters before the end-of-file; that -is, the returned string's length will be less than @scheme[amt]. (A -temporary string of size @scheme[amt] is allocated while reading the -input, even if the size of the result is less than @scheme[amt] +is, the returned string's length will be less than @racket[amt]. (A +temporary string of size @racket[amt] is allocated while reading the +input, even if the size of the result is less than @racket[amt] characters.) If no characters are available before an end-of-file, -then @scheme[eof] is returned. +then @racket[eof] is returned. If an error occurs during reading, some characters may be lost; that -is, if @scheme[read-string] successfully reads some characters before +is, if @racket[read-string] successfully reads some characters before encountering an error, the characters are dropped.} @defproc[(read-bytes [amt exact-nonnegative-integer?] [in input-port? (current-input-port)]) (or/c bytes? eof-object?)]{ -@margin-note{To read an entire port as bytes use @scheme[port->bytes].} -Like @scheme[read-string], but reads bytes and produces a byte string.} +@margin-note{To read an entire port as bytes use @racket[port->bytes].} +Like @racket[read-string], but reads bytes and produces a byte string.} @defproc[(read-string! [str (and/c string? (not/c immutable?))] [in input-port? (current-input-port)] @@ -105,28 +105,28 @@ Like @scheme[read-string], but reads bytes and produces a byte string.} [end-pos exact-nonnegative-integer? (string-length str)]) (or/c exact-positive-integer? eof-object?)]{ -Reads characters from @scheme[in] like @scheme[read-string], but puts -them into @scheme[str] starting from index @scheme[start-pos] -(inclusive) up to @scheme[end-pos] (exclusive). Like -@scheme[substring], the @exnraise[exn:fail:contract] if -@scheme[start-pos] or @scheme[end-pos] is out-of-range for -@scheme[str]. +Reads characters from @racket[in] like @racket[read-string], but puts +them into @racket[str] starting from index @racket[start-pos] +(inclusive) up to @racket[end-pos] (exclusive). Like +@racket[substring], the @exnraise[exn:fail:contract] if +@racket[start-pos] or @racket[end-pos] is out-of-range for +@racket[str]. -If the difference between @scheme[start-pos] and @scheme[end-pos] is -@scheme[0], then @scheme[0] is returned and @scheme[str] is not +If the difference between @racket[start-pos] and @racket[end-pos] is +@racket[0], then @racket[0] is returned and @racket[str] is not modified. If no bytes are available before an end-of-file, then -@scheme[eof] is returned. Otherwise, the return value is the number of +@racket[eof] is returned. Otherwise, the return value is the number of characters read. If @math{m} characters are read and -@math{m<@scheme[end-pos]-@scheme[start-pos]}, then @scheme[str] is -not modified at indices @math{@scheme[start-pos]+m} through -@scheme[end-pos].} +@math{m<@racket[end-pos]-@racket[start-pos]}, then @racket[str] is +not modified at indices @math{@racket[start-pos]+m} through +@racket[end-pos].} @defproc[(read-bytes! [bstr bytes?] [in input-port? (current-input-port)] [start-pos exact-nonnegative-integer? 0] [end-pos exact-nonnegative-integer? (bytes-length bstr)]) (or/c exact-positive-integer? eof-object?)]{ -Like @scheme[read-string!], but reads bytes, puts them into a byte +Like @racket[read-string!], but reads bytes, puts them into a byte string, and returns the number of bytes read.} @defproc[(read-bytes-avail! [bstr bytes?] @@ -135,26 +135,26 @@ string, and returns the number of bytes read.} [end-pos exact-nonnegative-integer? (bytes-length bstr)]) (or/c exact-positive-integer? eof-object? procedure?)]{ -Like @scheme[read-bytes!], but returns without blocking after having +Like @racket[read-bytes!], but returns without blocking after having read the immediately available bytes, and it may return a procedure for -a ``special'' result. The @scheme[read-bytes-avail!] procedure blocks +a ``special'' result. The @racket[read-bytes-avail!] procedure blocks only if no bytes (or specials) are yet available. Also unlike -@scheme[read-bytes!], @scheme[read-bytes-avail!] never drops bytes; if -@scheme[read-bytes-avail!] successfully reads some bytes and then +@racket[read-bytes!], @racket[read-bytes-avail!] never drops bytes; if +@racket[read-bytes-avail!] successfully reads some bytes and then encounters an error, it suppresses the error (treating it roughly like an end-of-file) and returns the read bytes. (The error will be triggered by future reads.) If an error is encountered before any bytes have been read, an exception is raised. -When @scheme[in] produces a special value, as described in +When @racket[in] produces a special value, as described in @secref["customport"], the result is a procedure of four arguments. The four arguments correspond to the location of the special value within the port, as described in @secref["customport"]. If the procedure is called more than once with valid arguments, the @exnraise[exn:fail:contract]. If -@scheme[read-bytes-avail] returns a special-producing procedure, then -it does not place characters in @scheme[bstr]. Similarly, -@scheme[read-bytes-avail] places only as many bytes into @scheme[bstr] +@racket[read-bytes-avail] returns a special-producing procedure, then +it does not place characters in @racket[bstr]. Similarly, +@racket[read-bytes-avail] places only as many bytes into @racket[bstr] as are available before a special value in the port's stream.} @defproc[(read-bytes-avail!* [bstr bytes?] @@ -163,7 +163,7 @@ as are available before a special value in the port's stream.} [end-pos exact-nonnegative-integer? (bytes-length bstr)]) (or/c exact-nonnegative-integer? eof-object? procedure?)]{ -Like @scheme[read-bytes-avail!], but returns @scheme[0] immediately if +Like @racket[read-bytes-avail!], but returns @racket[0] immediately if no bytes (or specials) are available for reading and the end-of-file is not reached.} @@ -173,11 +173,11 @@ is not reached.} [end-pos exact-nonnegative-integer? (bytes-length bstr)]) (or/c exact-positive-integer? eof-object? procedure?)]{ -Like @scheme[read-bytes-avail!], but breaks are enabled during the +Like @racket[read-bytes-avail!], but breaks are enabled during the read (see also @secref["breakhandler"]). If breaking is disabled -when @scheme[read-bytes-avail!/enable-break] is called, and if the -@scheme[exn:break] exception is raised as a result of the call, then -no bytes will have been read from @scheme[in].} +when @racket[read-bytes-avail!/enable-break] is called, and if the +@racket[exn:break] exception is raised as a result of the call, then +no bytes will have been read from @racket[in].} @defproc[(peek-string [amt exact-nonnegative-integer?] @@ -185,17 +185,17 @@ no bytes will have been read from @scheme[in].} [in input-port? (current-input-port)]) (or/c string? eof-object?)]{ -Similar to @scheme[read-string], except that the returned characters +Similar to @racket[read-string], except that the returned characters are preserved in the port for future reads. (More precisely, undecoded -bytes are left for future reads.) The @scheme[skip-bytes-amt] argument +bytes are left for future reads.) The @racket[skip-bytes-amt] argument indicates a number of bytes (@italic{not} characters) in the input stream to skip before collecting characters to return; thus, in total, -the next @scheme[skip-bytes-amt] bytes plus @scheme[amt] characters +the next @racket[skip-bytes-amt] bytes plus @racket[amt] characters are inspected. -For most kinds of ports, inspecting @scheme[skip-bytes-amt] bytes and -@scheme[amt] characters requires at least -@math{@scheme[skip-bytes-amt]+@scheme[amt]} bytes of memory overhead +For most kinds of ports, inspecting @racket[skip-bytes-amt] bytes and +@racket[amt] characters requires at least +@math{@racket[skip-bytes-amt]+@racket[amt]} bytes of memory overhead associated with the port, at least until the bytes/characters are read. No such overhead is required when peeking into a string port (see @secref["stringport"]), a pipe port (see @@ -203,15 +203,15 @@ read. No such overhead is required when peeking into a string port procedure (depending on how the peek procedure is implemented; see @secref["customport"]). -If a port produces @scheme[eof] mid-stream, peek skips beyond the -@scheme[eof] always produce @scheme[eof] until the @scheme[eof] is +If a port produces @racket[eof] mid-stream, peek skips beyond the +@racket[eof] always produce @racket[eof] until the @racket[eof] is read.} @defproc[(peek-bytes [amt exact-nonnegative-integer?] [skip-bytes-amt exact-nonnegative-integer?] [in input-port? (current-input-port)]) (or/c bytes? eof-object?)]{ -Like @scheme[peek-string], but peeks bytes and produces a byte string.} +Like @racket[peek-string], but peeks bytes and produces a byte string.} @defproc[(peek-string! [str (and/c string? (not/c immutable?))] [skip-bytes-amt exact-nonnegative-integer?] @@ -219,8 +219,8 @@ Like @scheme[peek-string], but peeks bytes and produces a byte string.} [start-pos exact-nonnegative-integer? 0] [end-pos exact-nonnegative-integer? (string-length str)]) (or/c exact-positive-integer? eof-object?)]{ -Like @scheme[read-string!], but for peeking, and with a -@scheme[skip-bytes-amt] argument like @scheme[peek-string].} +Like @racket[read-string!], but for peeking, and with a +@racket[skip-bytes-amt] argument like @racket[peek-string].} @defproc[(peek-bytes! [bstr (and/c bytes? (not/c immutable?))] [skip-bytes-amt exact-nonnegative-integer?] @@ -228,7 +228,7 @@ Like @scheme[read-string!], but for peeking, and with a [start-pos exact-nonnegative-integer? 0] [end-pos exact-nonnegative-integer? (bytes-length bstr)]) (or/c exact-positive-integer? eof-object?)]{ -Like @scheme[peek-string!], but peeks bytes, puts them into a byte +Like @racket[peek-string!], but peeks bytes, puts them into a byte string, and returns the number of bytes read.} @defproc[(peek-bytes-avail! [bstr (and/c bytes? (not/c immutable?))] @@ -239,21 +239,21 @@ string, and returns the number of bytes read.} [end-pos exact-nonnegative-integer? (bytes-length bstr)]) (or/c exact-nonnegative-integer? eof-object? procedure?)]{ -Like @scheme[read-bytes-avail!], but for peeking, and with two extra -arguments. The @scheme[skip-bytes-amt] argument is as in -@scheme[peek-bytes]. The @scheme[progress] argument must be either -@scheme[#f] or an event produced by -@scheme[port-progress-evt] for @scheme[in]. +Like @racket[read-bytes-avail!], but for peeking, and with two extra +arguments. The @racket[skip-bytes-amt] argument is as in +@racket[peek-bytes]. The @racket[progress] argument must be either +@racket[#f] or an event produced by +@racket[port-progress-evt] for @racket[in]. -To peek, @scheme[peek-bytes-avail!] blocks until finding an +To peek, @racket[peek-bytes-avail!] blocks until finding an end-of-file, at least one byte (or special) past the skipped bytes, or -until a non-@scheme[#f] @scheme[progress] becomes ready. Furthermore, -if @scheme[progress] is ready before bytes are peeked, no bytes are -peeked or skipped, and @scheme[progress] may cut short the skipping +until a non-@racket[#f] @racket[progress] becomes ready. Furthermore, +if @racket[progress] is ready before bytes are peeked, no bytes are +peeked or skipped, and @racket[progress] may cut short the skipping process if it becomes available during the peek attempt. -The result of @scheme[peek-bytes-avail!] is @scheme[0] only in the -case that @scheme[progress] becomes ready before bytes are peeked.} +The result of @racket[peek-bytes-avail!] is @racket[0] only in the +case that @racket[progress] becomes ready before bytes are peeked.} @defproc[(peek-bytes-avail!* [bstr (and/c bytes? (not/c immutable?))] [skip-bytes-amt exact-nonnegative-integer?] @@ -263,10 +263,10 @@ case that @scheme[progress] becomes ready before bytes are peeked.} [end-pos exact-nonnegative-integer? (bytes-length bstr)]) (or/c exact-nonnegative-integer? eof-object? procedure?)]{ -Like @scheme[read-bytes-avail!*], but for peeking, and with -@scheme[skip-bytes-amt] and @scheme[progress] arguments like -@scheme[peek-bytes-avail!]. Since this procedure never blocks, it may -return before even @scheme[skip-amt] bytes are available from the +Like @racket[read-bytes-avail!*], but for peeking, and with +@racket[skip-bytes-amt] and @racket[progress] arguments like +@racket[peek-bytes-avail!]. Since this procedure never blocks, it may +return before even @racket[skip-amt] bytes are available from the port.} @defproc[(peek-bytes-avail!/enable-break [bstr (and/c bytes? (not/c immutable?))] @@ -276,15 +276,15 @@ port.} [start-pos exact-nonnegative-integer? 0] [end-pos exact-nonnegative-integer? (bytes-length bstr)]) (or/c exact-nonnegative-integer? eof-object? procedure?)]{ -Like @scheme[read-bytes-avail!/enable-break], but for peeking, and -with @scheme[skip-bytes-amt] and @scheme[progress] arguments like -@scheme[peek-bytes-avail!].} +Like @racket[read-bytes-avail!/enable-break], but for peeking, and +with @racket[skip-bytes-amt] and @racket[progress] arguments like +@racket[peek-bytes-avail!].} @defproc[(read-char-or-special [in input-port? (current-input-port)]) (or/c character? eof-object? any/c)]{ -Like @scheme[read-char], but if the input port returns a non-byte +Like @racket[read-char], but if the input port returns a non-byte value (through a value-generating procedure in a custom port; see @secref["customport"] and @secref["special-comments"] for details), then the non-byte value is returned.} @@ -292,54 +292,54 @@ details), then the non-byte value is returned.} @defproc[(read-byte-or-special [in input-port? (current-input-port)]) (or/c byte? eof-object? any/c)]{ -Like @scheme[read-char-or-special], but reads and returns a byte +Like @racket[read-char-or-special], but reads and returns a byte instead of a character.} @defproc[(peek-char [in input-port? (current-input-port)] [skip-bytes-amt exact-nonnegative-integer? 0]) (or/c character? eof-object?)]{ -Like @scheme[read-char], but peeks instead of reading, and skips -@scheme[skip-bytes-amt] bytes (not characters) at the start of the +Like @racket[read-char], but peeks instead of reading, and skips +@racket[skip-bytes-amt] bytes (not characters) at the start of the port.} @defproc[(peek-byte [in input-port? (current-input-port)] [skip-bytes-amt exact-nonnegative-integer? 0]) (or/c byte? eof-object?)]{ -Like @scheme[peek-char], but reads and returns a byte instead of a +Like @racket[peek-char], but reads and returns a byte instead of a character.} @defproc[(peek-char-or-special [in input-port? (current-input-port)] [skip-bytes-amt exact-nonnegative-integer? 0]) (or/c character? eof-object? any/c)]{ -Like @scheme[peek-char], but if the input port returns a non-byte -value after @scheme[skip-bytes-amt] byte positions, then it is returned.} +Like @racket[peek-char], but if the input port returns a non-byte +value after @racket[skip-bytes-amt] byte positions, then it is returned.} @defproc[(peek-byte-or-special [in input-port? (current-input-port)] [skip-bytes-amt exact-nonnegative-integer? 0] [progress (or/c evt? #f) #f]) (or/c character? eof-object? any/c)]{ -Like @scheme[peek-char-or-special], but reads and returns a byte -instead of a character, and it supports a @scheme[progress] argument -like @scheme[peek-bytes-avail!].} +Like @racket[peek-char-or-special], but reads and returns a byte +instead of a character, and it supports a @racket[progress] argument +like @racket[peek-bytes-avail!].} @defproc[(port-progress-evt [in input-port? (current-input-port)]) evt?]{ Returns an event that becomes ready after any subsequent read from -@scheme[in], or after @scheme[in] is closed. After the event becomes +@racket[in], or after @racket[in] is closed. After the event becomes ready, it remains ready. If progress events are unavailable for -@scheme[in] (as reported by @scheme[port-provides-progress-evts?]), then the +@racket[in] (as reported by @racket[port-provides-progress-evts?]), then the @exnraise[exn:fail:contract].} @defproc[(port-provides-progress-evts? [in input-port?]) boolean]{ -Returns @scheme[#t] if @scheme[port-progress-evt] can return an event -for @scheme[in]. All built-in kinds of ports support progress events, -but ports created with @scheme[make-input-port] (see +Returns @racket[#t] if @racket[port-progress-evt] can return an event +for @racket[in]. All built-in kinds of ports support progress events, +but ports created with @racket[make-input-port] (see @secref["customport"]) may not.} @defproc[(port-commit-peeked [amt exact-nonnegative-integer?] @@ -348,47 +348,47 @@ but ports created with @scheme[make-input-port] (see [in input-port? (current-input-port)]) boolean?]{ -Attempts to commit as read the first @scheme[amt] previously peeked -bytes, non-byte specials, and @scheme[eof]s from @scheme[in], or the -first @scheme[eof] or special value peeked from -@scheme[in]. (Only mid-stream @scheme[eof]s can be -committed. An @scheme[eof] when the port is exhausted does not +Attempts to commit as read the first @racket[amt] previously peeked +bytes, non-byte specials, and @racket[eof]s from @racket[in], or the +first @racket[eof] or special value peeked from +@racket[in]. (Only mid-stream @racket[eof]s can be +committed. An @racket[eof] when the port is exhausted does not correspond to data in the stream.) -The read commits only if @scheme[progress] does not become ready first -(i.e., if no other process reads from @scheme[in] first), and only if -@scheme[evt] is chosen by a @scheme[sync] within -@scheme[port-commit-peeked] (in which case the event result is -ignored); the @scheme[evt] must be either a channel-put event, +The read commits only if @racket[progress] does not become ready first +(i.e., if no other process reads from @racket[in] first), and only if +@racket[evt] is chosen by a @racket[sync] within +@racket[port-commit-peeked] (in which case the event result is +ignored); the @racket[evt] must be either a channel-put event, channel, semaphore, semaphore-peek event, always event, or never -event. Suspending the thread that calls @scheme[port-commit-peeked] +event. Suspending the thread that calls @racket[port-commit-peeked] may or may not prevent the commit from proceeding. -The result from @scheme[port-commit-peeked] is @scheme[#t] if data has been -committed, and @scheme[#f] otherwise. +The result from @racket[port-commit-peeked] is @racket[#t] if data has been +committed, and @racket[#f] otherwise. -If no data has been peeked from @scheme[in] and @scheme[progress] is +If no data has been peeked from @racket[in] and @racket[progress] is not ready, then @exnraise[exn:fail:contract]. If fewer than -@scheme[amt] items have been peeked at the current start of -@scheme[in]'s stream, then only the peeked items are committed as -read. If @scheme[in]'s stream currently starts at an @scheme[eof] or -a non-byte special value, then only the @scheme[eof] or special value +@racket[amt] items have been peeked at the current start of +@racket[in]'s stream, then only the peeked items are committed as +read. If @racket[in]'s stream currently starts at an @racket[eof] or +a non-byte special value, then only the @racket[eof] or special value is committed as read. -If @scheme[progress] is not a result of @scheme[port-progress-evt] -applied to @scheme[in], then @exnraise[exn:fail:contract].} +If @racket[progress] is not a result of @racket[port-progress-evt] +applied to @racket[in], then @exnraise[exn:fail:contract].} @defproc[(byte-ready? [in input-port? (current-input-port)]) boolean?]{ -Returns @scheme[#t] if @scheme[(read-byte in)] would not block (at the -time that @scheme[byte-ready?] was called, at least). Equivalent to -@scheme[(and (sync/timeout 0 in) #t)].} +Returns @racket[#t] if @racket[(read-byte in)] would not block (at the +time that @racket[byte-ready?] was called, at least). Equivalent to +@racket[(and (sync/timeout 0 in) #t)].} @defproc[(char-ready? [in input-port? (current-input-port)]) boolean?]{ -Returns @scheme[#t] if @scheme[(read-char in)] would not block (at the -time that @scheme[char-ready?] was called, at least). Depending on the +Returns @racket[#t] if @racket[(read-char in)] would not block (at the +time that @racket[char-ready?] was called, at least). Depending on the initial bytes of the stream, multiple bytes may be needed to form a UTF-8 encoding.} diff --git a/collects/scribblings/reference/string-ports.scrbl b/collects/scribblings/reference/string-ports.scrbl index b7bfbcb328..13e6c01e1b 100644 --- a/collects/scribblings/reference/string-ports.scrbl +++ b/collects/scribblings/reference/string-ports.scrbl @@ -4,30 +4,30 @@ @title[#:tag "stringport"]{String Ports} String input and output ports do not need to be explicitly closed. The -@scheme[file-position] procedure works for string ports in +@racket[file-position] procedure works for string ports in position-setting mode. @defproc[(open-input-bytes [bstr bytes?] [name any/c 'string]) input-port?]{ -Creates an input port that reads characters from @scheme[bstr] (see -@secref["bytestrings"]). Modifying @scheme[bstr] afterward does not +Creates an input port that reads characters from @racket[bstr] (see +@secref["bytestrings"]). Modifying @racket[bstr] afterward does not affect the byte stream produced by the port. The optional -@scheme[name] argument is used as the name for the returned port.} +@racket[name] argument is used as the name for the returned port.} @defproc[(open-input-string [str string?] [name any/c 'string]) input-port?]{ Creates an input port that reads bytes from the UTF-8 encoding (see -@secref["encodings"]) of @scheme[str]. The optional @scheme[name] +@secref["encodings"]) of @racket[str]. The optional @racket[name] argument is used as the name for the returned port.} @defproc[(open-output-bytes [name any/c 'string]) output-port?]{ Creates an output port that accumulates the output into a byte -string. The optional @scheme[name] argument is used as the name for +string. The optional @racket[name] argument is used as the name for the returned port.} @defproc[(open-output-string [name any/c 'string]) output-port?]{The -same as @scheme[open-output-bytes].} +same as @racket[open-output-bytes].} @defproc[(get-output-bytes [out output-port?] [reset? any/c #f] @@ -35,31 +35,31 @@ same as @scheme[open-output-bytes].} [end-pos exact-nonnegative-integer? #f]) bytes?]{ -Returns the bytes accumulated in @scheme[out] so far in a +Returns the bytes accumulated in @racket[out] so far in a freshly allocated byte string (including any bytes written after the -port's current position, if any). The @scheme[out] port must be a -string output port produced by @scheme[open-output-bytes] (or -@scheme[open-output-string]) or a structure whose -@scheme[prop:output-port] property refers to such an output port +port's current position, if any). The @racket[out] port must be a +string output port produced by @racket[open-output-bytes] (or +@racket[open-output-string]) or a structure whose +@racket[prop:output-port] property refers to such an output port (transitively). -If @scheme[reset?] is true, then all bytes are removed from the port, -and the port's position is reset to @scheme[0]; if @scheme[reset?] is -@scheme[#f], then all bytes remain in the port for further +If @racket[reset?] is true, then all bytes are removed from the port, +and the port's position is reset to @racket[0]; if @racket[reset?] is +@racket[#f], then all bytes remain in the port for further accumulation (so they are returned for later calls to -@scheme[get-output-bytes] or @scheme[get-output-string]), and the +@racket[get-output-bytes] or @racket[get-output-string]), and the port's position is unchanged. -The @scheme[start-pos] and @scheme[end-pos] arguments specify the -range of bytes in the port to return; supplying @scheme[start-pos] and -@scheme[end-pos] is the same as using @scheme[subbytes] on the result -of @scheme[get-output-bytes], but supplying them to -@scheme[get-output-bytes] can avoid an allocation. The -@scheme[end-pos] argument can be @scheme[#f], which corresponds to not -passing a second argument to @scheme[subbytes].} +The @racket[start-pos] and @racket[end-pos] arguments specify the +range of bytes in the port to return; supplying @racket[start-pos] and +@racket[end-pos] is the same as using @racket[subbytes] on the result +of @racket[get-output-bytes], but supplying them to +@racket[get-output-bytes] can avoid an allocation. The +@racket[end-pos] argument can be @racket[#f], which corresponds to not +passing a second argument to @racket[subbytes].} @defproc[(get-output-string [out output-port?]) string?]{ -Returns @scheme[(bytes->string/utf-8 (get-output-bytes out) #\?)].} +Returns @racket[(bytes->string/utf-8 (get-output-bytes out) #\?)].} @examples[ (define i (open-input-string "hello world")) diff --git a/collects/scribblings/reference/strings.scrbl b/collects/scribblings/reference/strings.scrbl index 197fca6211..2a88811bfd 100644 --- a/collects/scribblings/reference/strings.scrbl +++ b/collects/scribblings/reference/strings.scrbl @@ -10,61 +10,61 @@ A @deftech{string} is a fixed-length array of @index['("strings" "immutable")]{A} string can be @defterm{mutable} or @defterm{immutable}. When an immutable string is provided to a -procedure like @scheme[string-set!], the +procedure like @racket[string-set!], the @exnraise[exn:fail:contract]. String constants generated by the default reader (see @secref["parse-string"]) are immutable. -Two strings are @scheme[equal?] when they have the same length and +Two strings are @racket[equal?] when they have the same length and contain the same sequence of characters. 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 @scheme[in-string]. +of the sequence. See also @racket[in-string]. -See also: @scheme[immutable?], @scheme[symbol->string], -@scheme[bytes->string/utf-8]. +See also: @racket[immutable?], @racket[symbol->string], +@racket[bytes->string/utf-8]. @; ---------------------------------------- @section{String Constructors, Selectors, and Mutators} -@defproc[(string? [v any/c]) boolean?]{ Returns @scheme[#t] if @scheme[v] - is a string, @scheme[#f] otherwise. +@defproc[(string? [v any/c]) boolean?]{ Returns @racket[#t] if @racket[v] + is a string, @racket[#f] otherwise. @mz-examples[(string? "Apple") (string? 'apple)]} @defproc[(make-string [k exact-nonnegative-integer?] [char char? -#\nul]) string?]{ Returns a new mutable string of length @scheme[k] where +#\nul]) string?]{ Returns a new mutable string of length @racket[k] where each position in the string is initialized with the character -@scheme[char]. +@racket[char]. @mz-examples[(make-string 5 #\z)]} @defproc[(string [char char?] ...) string?]{ Returns a new -mutable string whose length is the number of provided @scheme[char]s, and -whose positions are initialized with the given @scheme[char]s. +mutable string whose length is the number of provided @racket[char]s, and +whose positions are initialized with the given @racket[char]s. @mz-examples[(string #\A #\p #\p #\l #\e)]} @defproc[(string->immutable-string [str string?]) (and/c string? immutable?)]{ Returns an immutable string with the same content as - @scheme[str], returning @scheme[str] itself if @scheme[str] is + @racket[str], returning @racket[str] itself if @racket[str] is immutable.} @defproc[(string-length [str string?]) exact-nonnegative-integer?]{ - Returns the length of @scheme[str]. + Returns the length of @racket[str]. @mz-examples[(string-length "Apple")]} @defproc[(string-ref [str string?] [k exact-nonnegative-integer?]) - char?]{ Returns the character at position @scheme[k] in @scheme[str]. - The first position in the string corresponds to @scheme[0], so the - position @scheme[k] must be less than the length of the string, + char?]{ Returns the character at position @racket[k] in @racket[str]. + The first position in the string corresponds to @racket[0], so the + position @racket[k] must be less than the length of the string, otherwise the @exnraise[exn:fail:contract]. @mz-examples[(string-ref "Apple" 0)]} @@ -72,9 +72,9 @@ Returns an immutable string with the same content as @defproc[(string-set! [str (and/c string? (not/c immutable?))] [k exact-nonnegative-integer?] [char char?]) void?]{ Changes the - character position @scheme[k] in @scheme[str] to @scheme[char]. The first - position in the string corresponds to @scheme[0], so the position - @scheme[k] must be less than the length of the string, otherwise the + character position @racket[k] in @racket[str] to @racket[char]. The first + position in the string corresponds to @racket[0], so the position + @racket[k] must be less than the length of the string, otherwise the @exnraise[exn:fail:contract]. @examples[(define s (string #\A #\p #\p #\l #\e)) @@ -84,12 +84,12 @@ Returns an immutable string with the same content as @defproc[(substring [str string?] [start exact-nonnegative-integer?] [end exact-nonnegative-integer? (string-length str)]) string?]{ - Returns a new mutable string that is @scheme[(- end start)] + Returns a new mutable string that is @racket[(- end start)] characters long, and that contains the same characters as - @scheme[str] from @scheme[start] inclusive to @scheme[end] exclusive. - The @scheme[start] and @scheme[end] arguments must be less than or - equal to the length of @scheme[str], and @scheme[end] must be greater - than or equal to @scheme[start], otherwise the + @racket[str] from @racket[start] inclusive to @racket[end] exclusive. + The @racket[start] and @racket[end] arguments must be less than or + equal to the length of @racket[str], and @racket[end] must be greater + than or equal to @racket[start], otherwise the @exnraise[exn:fail:contract]. @mz-examples[(substring "Apple" 1 3) @@ -97,7 +97,7 @@ Returns an immutable string with the same content as @defproc[(string-copy [str string?]) string?]{ Returns - @scheme[(substring str 0)].} + @racket[(substring str 0)].} @defproc[(string-copy! [dest (and/c string? (not/c immutable?))] @@ -107,14 +107,14 @@ Returns an immutable string with the same content as [src-end exact-nonnegative-integer? (string-length src)]) void?]{ - Changes the characters of @scheme[dest] starting at position - @scheme[dest-start] to match the characters in @scheme[src] from - @scheme[src-start] (inclusive) to @scheme[src-end] (exclusive). The - strings @scheme[dest] and @scheme[src] can be the same string, and in + Changes the characters of @racket[dest] starting at position + @racket[dest-start] to match the characters in @racket[src] from + @racket[src-start] (inclusive) to @racket[src-end] (exclusive). The + strings @racket[dest] and @racket[src] can be the same string, and in that case the destination region can overlap with the source region; the destination characters after the copy match the source characters - from before the copy. If any of @scheme[dest-start], - @scheme[src-start], or @scheme[src-end] are out of range (taking into + from before the copy. If any of @racket[dest-start], + @racket[src-start], or @racket[src-end] are out of range (taking into account the sizes of the strings and the source and destination regions), the @exnraise[exn:fail:contract]. @@ -124,8 +124,8 @@ Returns an immutable string with the same content as s]} @defproc[(string-fill! [dest (and/c string? (not/c immutable?))] [char - char?]) void?]{ Changes @scheme[dest] so that every position in the - string is filled with @scheme[char]. + char?]) void?]{ Changes @racket[dest] so that every position in the + string is filled with @racket[char]. @mz-examples[(define s (string #\A #\p #\p #\l #\e)) (string-fill! s #\q) @@ -135,26 +135,26 @@ Returns an immutable string with the same content as @defproc[(string-append [str string?] ...) string?]{ @index['("strings" "concatenate")]{Returns} a new mutable string that is -as long as the sum of the given @scheme[str]s' lengths, and that -contains the concatenated characters of the given @scheme[str]s. If no -@scheme[str]s are provided, the result is a zero-length string. +as long as the sum of the given @racket[str]s' lengths, and that +contains the concatenated characters of the given @racket[str]s. If no +@racket[str]s are provided, the result is a zero-length string. @mz-examples[(string-append "Apple" "Banana")]} @defproc[(string->list [str string?]) (listof char?)]{ Returns a new - list of characters corresponding to the content of @scheme[str]. That is, - the length of the list is @scheme[(string-length str)], and the - sequence of characters in @scheme[str] is the same sequence in the + list of characters corresponding to the content of @racket[str]. That is, + the length of the list is @racket[(string-length str)], and the + sequence of characters in @racket[str] is the same sequence in the result list. @mz-examples[(string->list "Apple")]} @defproc[(list->string [lst (listof char?)]) string?]{ Returns a new - mutable string whose content is the list of characters in @scheme[lst]. - That is, the length of the string is @scheme[(length lst)], and - the sequence of characters in @scheme[lst] is the same sequence in + mutable string whose content is the list of characters in @racket[lst]. + That is, the length of the string is @racket[(length lst)], and + the sequence of characters in @racket[lst] is the same sequence in the result string. @mz-examples[(list->string (list #\A #\p #\p #\l #\e))]} @@ -164,10 +164,10 @@ contains the concatenated characters of the given @scheme[str]s. If no [proc (exact-nonnegative-integer? . -> . char?)]) string?]{ -Creates a string of @scheme[n] characters by applying @scheme[proc] to -the integers from @scheme[0] to @scheme[(sub1 n)] in order. If -@scheme[_str] is the resulting string, then @scheme[(string-ref _str -_i)] is the character produced by @scheme[(proc _i)]. +Creates a string of @racket[n] characters by applying @racket[proc] to +the integers from @racket[0] to @racket[(sub1 n)] in order. If +@racket[_str] is the resulting string, then @racket[(string-ref _str +_i)] is the character produced by @racket[(proc _i)]. @mz-examples[ (build-string 5 (lambda (i) (integer->char (+ i 97)))) @@ -179,20 +179,20 @@ _i)] is the character produced by @scheme[(proc _i)]. @defproc[(string=? [str1 string?] [str2 string?] ...+) boolean?]{ Returns - @scheme[#t] if all of the arguments are @scheme[equal?].} + @racket[#t] if all of the arguments are @racket[equal?].} @mz-examples[(string=? "Apple" "apple") (string=? "a" "as" "a")] @(define (string-sort direction folded?) (if folded? - @elem{Like @scheme[string-ci? [str1 string?] [str2 string?] ...+) - boolean?]{ Like @scheme[string>?], but locale-specific like - @scheme[string-locale?], but locale-specific like + @racket[string-locale? [str1 string?] [str2 string?] ...+) - boolean?]{ Like @scheme[string>?], but both locale-sensitive and - case-insensitive like @scheme[string-locale-ci=?].} + boolean?]{ Like @racket[string>?], but both locale-sensitive and + case-insensitive like @racket[string-locale-ci=?].} @defproc[(string-locale-upcase [string string?]) string?]{ Like - @scheme[string-upcase], but using locale-specific case-conversion - rules based on the value of @scheme[current-locale].} + @racket[string-upcase], but using locale-specific case-conversion + rules based on the value of @racket[current-locale].} @defproc[(string-locale-downcase [string string?]) string?]{ Like - @scheme[string-downcase], but using locale-specific case-conversion - rules based on the value of @scheme[current-locale]. + @racket[string-downcase], but using locale-specific case-conversion + rules based on the value of @racket[current-locale]. } @; ---------------------------------------- @@ -371,12 +371,12 @@ allocated string).} @defproc[(string-append* [str string?] ... [strs (listof string?)]) string?]{ @; Note: this is exactly the same description as the one for append* -Like @scheme[string-append], but the last argument is used as a list -of arguments for @scheme[string-append], so @scheme[(string-append* -str ... strs)] is the same as @scheme[(apply string-append str +Like @racket[string-append], but the last argument is used as a list +of arguments for @racket[string-append], so @racket[(string-append* +str ... strs)] is the same as @racket[(apply string-append str ... strs)]. In other words, the relationship between -@scheme[string-append] and @scheme[string-append*] is similar to the -one between @scheme[list] and @scheme[list*]. +@racket[string-append] and @racket[string-append*] is similar to the +one between @racket[list] and @racket[list*]. @mz-examples[#:eval string-eval (string-append* "a" "b" '("c" "d")) @@ -386,8 +386,8 @@ one between @scheme[list] and @scheme[list*]. @defproc[(string-join [strs (listof string?)] [sep string?]) string?]{ -Appends the strings in @scheme[strs], inserting @scheme[sep] between -each pair of strings in @scheme[strs]. +Appends the strings in @racket[strs], inserting @racket[sep] between +each pair of strings in @racket[strs]. @mz-examples[#:eval string-eval (string-join '("one" "two" "three" "four") " potato ") diff --git a/collects/scribblings/reference/struct-inspectors.scrbl b/collects/scribblings/reference/struct-inspectors.scrbl index 36dd44dbbb..f3b43fe58e 100644 --- a/collects/scribblings/reference/struct-inspectors.scrbl +++ b/collects/scribblings/reference/struct-inspectors.scrbl @@ -15,23 +15,23 @@ type; instead, the given inspector's parent will control the type. By using the parent of the given inspector, the structure type remains opaque to ``peer'' code that cannot access the parent inspector. -The @scheme[current-inspector] @tech{parameter} determines a default +The @racket[current-inspector] @tech{parameter} determines a default inspector argument for new structure types. An alternate inspector can -be provided though the @scheme[#:inspector] option of the -@scheme[define-struct] form (see @secref["define-struct"]), or -through an optional @scheme[inspector] argument to -@scheme[make-struct-type]. +be provided though the @racket[#:inspector] option of the +@racket[define-struct] form (see @secref["define-struct"]), or +through an optional @racket[inspector] argument to +@racket[make-struct-type]. -@defproc[(inspector? [v any/c]) boolean?]{Returns @scheme[#t] if -@scheme[v] is an inspector, @scheme[#f] otherwise.} +@defproc[(inspector? [v any/c]) boolean?]{Returns @racket[#t] if +@racket[v] is an inspector, @racket[#f] otherwise.} @defproc[(make-inspector [inspector inspector? (current-inspector)]) inspector?]{ Returns a new inspector that is a subinspector of -@scheme[inspector]. Any structure type controlled by the new inspector +@racket[inspector]. Any structure type controlled by the new inspector is also controlled by its ancestor inspectors, but no other inspectors.} @@ -40,7 +40,7 @@ inspectors.} inspector?]{ Returns a new inspector that is a subinspector of the same inspector -as @scheme[inspector]. That is, @scheme[inspector] and the result +as @racket[inspector]. That is, @racket[inspector] and the result inspector control mutually disjoint sets of structure types.} @@ -58,15 +58,15 @@ Returns two values: @itemize[ - @item{@scheme[_struct-type]: a structure type descriptor or @scheme[#f]; + @item{@racket[_struct-type]: a structure type descriptor or @racket[#f]; the result is a structure type descriptor of the most specific type - for which @scheme[v] is an instance, and for which the current - inspector has control, or the result is @scheme[#f] if the current + for which @racket[v] is an instance, and for which the current + inspector has control, or the result is @racket[#f] if the current inspector does not control any structure type for which the - @scheme[struct] is an instance.} + @racket[struct] is an instance.} - @item{@scheme[_skipped?]: @scheme[#f] if the first result corresponds to - the most specific structure type of @scheme[v], @scheme[#t] otherwise.} + @item{@racket[_skipped?]: @racket[#f] if the first result corresponds to + the most specific structure type of @racket[v], @racket[#t] otherwise.} ]} @@ -81,57 +81,57 @@ Returns two values: boolean?)]{ Returns eight values that provide information about the structure type - descriptor @scheme[struct-type], assuming that the type is controlled + descriptor @racket[struct-type], assuming that the type is controlled by the current inspector: @itemize[ - @item{@scheme[_name]: the structure type's name as a symbol;} + @item{@racket[_name]: the structure type's name as a symbol;} - @item{@scheme[_init-field-cnt]: the number of fields defined by the + @item{@racket[_init-field-cnt]: the number of fields defined by the structure type provided to the constructor procedure (not counting fields created by its ancestor types);} - @item{@scheme[_auto-field-cnt]: the number of fields defined by the + @item{@racket[_auto-field-cnt]: the number of fields defined by the structure type without a counterpart in the constructor procedure (not counting fields created by its ancestor types);} - @item{@scheme[_accessor-proc]: an accessor procedure for the structure - type, like the one returned by @scheme[make-struct-type];} + @item{@racket[_accessor-proc]: an accessor procedure for the structure + type, like the one returned by @racket[make-struct-type];} - @item{@scheme[_mutator-proc]: a mutator procedure for the structure - type, like the one returned by @scheme[make-struct-type];} + @item{@racket[_mutator-proc]: a mutator procedure for the structure + type, like the one returned by @racket[make-struct-type];} - @item{@scheme[_immutable-k-list]: an immutable list of exact + @item{@racket[_immutable-k-list]: an immutable list of exact non-negative integers that correspond to immutable fields for the structure type;} - @item{@scheme[_super-type]: a structure type descriptor for the + @item{@racket[_super-type]: a structure type descriptor for the most specific ancestor of the type that is controlled by the - current inspector, or @scheme[#f] if no ancestor is controlled by + current inspector, or @racket[#f] if no ancestor is controlled by the current inspector;} - @item{@scheme[_skipped?]: @scheme[#f] if the seventh result is the + @item{@racket[_skipped?]: @racket[#f] if the seventh result is the most specific ancestor type or if the type has no supertype, - @scheme[#t] otherwise.} + @racket[#t] otherwise.} ] -If the type for @scheme[struct-type] is not controlled by the current inspector, +If the type for @racket[struct-type] is not controlled by the current inspector, the @exnraise[exn:fail:contract].} @defproc[(struct-type-make-constructor [struct-type struct-type?]) struct-constructor-procedure?]{ Returns a @tech{constructor} procedure to create instances of the type -for @scheme[struct-type]. If the type for @scheme[struct-type] is not +for @racket[struct-type]. If the type for @racket[struct-type] is not controlled by the current inspector, the @exnraise[exn:fail:contract].} @defproc[(struct-type-make-predicate [struct-type any/c]) any]{ Returns a @tech{predicate} procedure to recognize instances of the -type for @scheme[struct-type]. If the type for @scheme[struct-type] +type for @racket[struct-type]. If the type for @racket[struct-type] is not controlled by the current inspector, the @exnraise[exn:fail:contract].} @@ -139,27 +139,27 @@ is not controlled by the current inspector, the @defproc[(object-name [v any/c]) any]{ -Returns a value for the name of @scheme[v] if @scheme[v] has a name, -@scheme[#f] otherwise. The argument @scheme[v] can be any value, but +Returns a value for the name of @racket[v] if @racket[v] has a name, +@racket[#f] otherwise. The argument @racket[v] can be any value, but only (some) procedures, @tech{structures}, @tech{structure types}, @tech{structure type properties}, @tech{regexp values}, and @tech{ports} have names. See also @secref["infernames"]. The name (if any) of a procedure is always a symbol. The -@scheme[procedure-rename] function creates a procedure with a specific +@racket[procedure-rename] function creates a procedure with a specific name. The name of a @tech{structure}, @tech{structure type}, @tech{structure type property} is always a symbol. If a @tech{structure} is a procedure as implemented by one of its fields (i.e., the -@scheme[prop:procedure] property value for the structure's type is an +@racket[prop:procedure] property value for the structure's type is an integer), then its name is the implementing procedure's name; otherwise, its name matches the name of the @tech{structure type} that it instantiates. The name of a @tech{regexp value} is a string or byte string. Passing -the string or byte string to @scheme[regexp], @scheme[byte-regexp], -@scheme[pregexp], or @scheme[byte-pregexp] (depending on the kind of +the string or byte string to @racket[regexp], @racket[byte-regexp], +@racket[pregexp], or @racket[byte-pregexp] (depending on the kind of regexp whose name was extracted) produces a value that matches the same inputs. diff --git a/collects/scribblings/reference/stx-certs.scrbl b/collects/scribblings/reference/stx-certs.scrbl index d5f896bfb2..6359329981 100644 --- a/collects/scribblings/reference/stx-certs.scrbl +++ b/collects/scribblings/reference/stx-certs.scrbl @@ -12,9 +12,9 @@ module name (see @secref["modpathidx"]), an @tech{inspector} (see is attached as either an @deftech{active certificate} or an @deftech{inactive certificate}. -The @scheme[datum->syntax] procedure never transfers an @tech{active +The @racket[datum->syntax] procedure never transfers an @tech{active certificate} from one syntax object to another. The -@scheme[syntax-recertify] procedure can be used to transfer a +@racket[syntax-recertify] procedure can be used to transfer a certificate from one syntax object to another, but only if the certificate's key is provided, or if a sufficiently powerful inspector is provided. Thus, a certificate's inspector serves two roles: it @@ -28,7 +28,7 @@ certificate's module reference corresponds to the module that defined the @tech{transformer binding}, the inspector is the inspector for the module's declaration (see @secref["modprotect"]), and the key object is hidden. (Applying the result of -@scheme[syntax-local-certifier] can introduce certificates with other +@racket[syntax-local-certifier] can introduce certificates with other keys.) The certificate's mark is applied to both the input and output of the syntax transformer, so that it identifies every piece of syntax that was introduced by the transformer (see @@ -38,48 +38,48 @@ shape and properties of the result: @itemize[ - @item{If the result has a @indexed-scheme['certify-mode] property + @item{If the result has a @indexed-racket['certify-mode] property (see @secref["stxprops"]) that is - @indexed-scheme['opaque], then the certificate is attached + @indexed-racket['opaque], then the certificate is attached to the immediate syntax object.} - @item{If the result has a @scheme['certify-mode] property that is - @indexed-scheme['transparent], then the certificate is also + @item{If the result has a @racket['certify-mode] property that is + @indexed-racket['transparent], then the certificate is also propagated recursively to syntax object that corresponds to elements of the syntax object's datum as a list (or, more - precisely, to the @scheme[car]s of the datum as reached by - any number of @scheme[cdr]s). This recursive propagation + precisely, to the @racket[car]s of the datum as reached by + any number of @racket[cdr]s). This recursive propagation uses syntax properties and shapes, as for the immediate attachment.} - @item{If the result has a @scheme['certify-mode] property that is - @indexed-scheme['transparent-binding], then the certificate - is attached in a way similar to @scheme['transparent], but further + @item{If the result has a @racket['certify-mode] property that is + @indexed-racket['transparent-binding], then the certificate + is attached in a way similar to @racket['transparent], but further treating the syntax object corresponding to the second list - element as having a @scheme['transparent] value for the - @scheme['certify-mode] property if it does not already have - a @scheme['certify-mode] property value.} + element as having a @racket['transparent] value for the + @racket['certify-mode] property if it does not already have + a @racket['certify-mode] property value.} - @item{If the result has no @scheme['certify-mode] property value, but + @item{If the result has no @racket['certify-mode] property value, but its datum is a pair, and if the syntax object corresponding - to the @scheme[car] of the pair is an identifier bound to - @scheme[begin], @scheme[module], or - @scheme[#%plain-module-begin], then the certificate is + to the @racket[car] of the pair is an identifier bound to + @racket[begin], @racket[module], or + @racket[#%plain-module-begin], then the certificate is propagated as if the syntax object had the - @scheme['transparent] property value.} + @racket['transparent] property value.} - @item{If the result has no @scheme['certify-mode] property value, + @item{If the result has no @racket['certify-mode] property value, but its datum is a pair, and if the syntax object - corresponding to the @scheme[car] of the pair is an - identifier bound to @scheme[define-values] or - @scheme[define-syntaxes], then the certificate is propagated - as if the syntax object had the @scheme['transparent-binding] + corresponding to the @racket[car] of the pair is an + identifier bound to @racket[define-values] or + @racket[define-syntaxes], then the certificate is propagated + as if the syntax object had the @racket['transparent-binding] property value.} ] -To avoid accidental transfer for a @scheme['certify-mode] property -value, the expander always removes any @scheme['certify-mode] property +To avoid accidental transfer for a @racket['certify-mode] property +value, the expander always removes any @racket['certify-mode] property on a syntax object that is passed to a syntax transformer. As the expander attaches a new active certificate to a syntax object, @@ -117,7 +117,7 @@ expansion context: module (if any) and the certificate key are not used for checking a local reference.} - @item{When the expander encounters a @scheme[quote-syntax] form, it + @item{When the expander encounters a @racket[quote-syntax] form, it attaches all accumulated @tech{active certificates} from the expression's context to the quoted syntax objects. A certificate for the enclosing module (if any) is also included. The @@ -128,10 +128,10 @@ expansion context: ] -Finally, for the result of @scheme[expand] or @scheme[local-expand] +Finally, for the result of @racket[expand] or @racket[local-expand] with an empty stop list, certificates are lifted to the outermost -result expression, except to the degree that @scheme['certify-mode] -property values and bindings like @scheme[begin] direct certificates +result expression, except to the degree that @racket['certify-mode] +property values and bindings like @racket[begin] direct certificates to sub-expressions. @@ -141,11 +141,11 @@ to sub-expressions. [key any/c]) syntax?]{ -Copies certain certificates of @scheme[old-stx] to @scheme[new-stx]: a -certificate is copied if its inspector is either @scheme[inspector] or -controlled by @scheme[inspector], or if the certificate's key is -@scheme[key]; otherwise the certificate is not copied. The result is -a syntax object like @scheme[new-stx], but with the copied -certificates. (The @scheme[new-stx] object itself is not modified.) +Copies certain certificates of @racket[old-stx] to @racket[new-stx]: a +certificate is copied if its inspector is either @racket[inspector] or +controlled by @racket[inspector], or if the certificate's key is +@racket[key]; otherwise the certificate is not copied. The result is +a syntax object like @racket[new-stx], but with the copied +certificates. (The @racket[new-stx] object itself is not modified.) Both @tech{active certificates} and @tech{inactive certificates} are copied.} diff --git a/collects/scribblings/reference/stx-comp.scrbl b/collects/scribblings/reference/stx-comp.scrbl index 40e695991d..2bc3269652 100644 --- a/collects/scribblings/reference/stx-comp.scrbl +++ b/collects/scribblings/reference/stx-comp.scrbl @@ -11,11 +11,11 @@ (syntax-local-phase-level)]) boolean?]{ -Returns @scheme[#t] if the identifier @scheme[a-id] would bind -@scheme[b-id] (or vice versa) if the identifiers were substituted in a +Returns @racket[#t] if the identifier @racket[a-id] would bind +@racket[b-id] (or vice versa) if the identifiers were substituted in a suitable expression context at the @tech{phase level} indicated by -@scheme[phase-level], @scheme[#f] otherwise. A @scheme[#f] value for -@scheme[phase-level] corresponds to the @tech{label phase level}. +@racket[phase-level], @racket[#f] otherwise. A @racket[#f] value for +@racket[phase-level] corresponds to the @tech{label phase level}. @examples[ #:eval stx-eval @@ -37,18 +37,18 @@ suitable expression context at the @tech{phase level} indicated by (syntax-local-phase-level)]) boolean?]{ -Returns @scheme[#t] if @scheme[a-id] and @scheme[b-id] access the same +Returns @racket[#t] if @racket[a-id] and @racket[b-id] access the same @tech{local binding}, @tech{module binding}, or @tech{top-level binding}---perhaps via @tech{rename transformers}---at the @tech{phase -level} indicated by @scheme[phase-level]. A @scheme[#f] value for -@scheme[phase-level] corresponds to the @tech{label phase level}. +level} indicated by @racket[phase-level]. A @racket[#f] value for +@racket[phase-level] corresponds to the @tech{label phase level}. ``Same module binding'' means that the identifiers refer to the same original definition site, and not necessarily to the same -@scheme[require] or @scheme[provide] site. Due to renaming in -@scheme[require] and @scheme[provide], or due to a transformer binding +@racket[require] or @racket[provide] site. Due to renaming in +@racket[require] and @racket[provide], or due to a transformer binding to a @tech{rename transformer}, the identifiers may return distinct -results with @scheme[syntax-e]. +results with @racket[syntax-e]. @examples[ #:eval stx-eval @@ -68,25 +68,25 @@ results with @scheme[syntax-e]. @defproc[(free-transformer-identifier=? [a-id syntax?] [b-id syntax?]) boolean?]{ -Same as @scheme[(free-identifier=? a-id b-id (add1 (syntax-local-phase-level)))].} +Same as @racket[(free-identifier=? a-id b-id (add1 (syntax-local-phase-level)))].} @defproc[(free-template-identifier=? [a-id syntax?] [b-id syntax?]) boolean?]{ -Same as @scheme[(free-identifier=? a-id b-id (sub1 (syntax-local-phase-level)))].} +Same as @racket[(free-identifier=? a-id b-id (sub1 (syntax-local-phase-level)))].} @defproc[(free-label-identifier=? [a-id syntax?] [b-id syntax?]) boolean?]{ -Same as @scheme[(free-identifier=? a-id b-id #f)].} +Same as @racket[(free-identifier=? a-id b-id #f)].} @defproc[(check-duplicate-identifier [ids (listof identifier?)]) (or/c identifier? #f)]{ -Compares each identifier in @scheme[ids] with every other identifier -in the list with @scheme[bound-identifier=?]. If any comparison -returns @scheme[#t], one of the duplicate identifiers is returned (the -first one in @scheme[ids] that is a duplicate), otherwise the result -is @scheme[#f].} +Compares each identifier in @racket[ids] with every other identifier +in the list with @racket[bound-identifier=?]. If any comparison +returns @racket[#t], one of the duplicate identifiers is returned (the +first one in @racket[ids] that is a duplicate), otherwise the result +is @racket[#f].} @defproc[(identifier-binding [id-stx syntax?] @@ -103,74 +103,74 @@ is @scheme[#f].} (or/c exact-integer? #f)))]{ Returns one of three kinds of values, depending on the binding of -@scheme[id-stx] at the @tech{phase level} indicated by -@scheme[phase-level] (where a @scheme[#f] value for -@scheme[phase-level] corresponds to the @tech{label phase level}): +@racket[id-stx] at the @tech{phase level} indicated by +@racket[phase-level] (where a @racket[#f] value for +@racket[phase-level] corresponds to the @tech{label phase level}): @itemize[ - @item{The result is @indexed-scheme['lexical] if @scheme[id-stx] - has a @tech{local binding}. If @scheme['lexical] is produced for - any @scheme[phase-level] value, then it is produced for all - @scheme[phase-level] values.} + @item{The result is @indexed-racket['lexical] if @racket[id-stx] + has a @tech{local binding}. If @racket['lexical] is produced for + any @racket[phase-level] value, then it is produced for all + @racket[phase-level] values.} - @item{The result is a list of seven items when @scheme[id-stx] - has a @tech{module binding}: @scheme[(list _source-mod _source-id + @item{The result is a list of seven items when @racket[id-stx] + has a @tech{module binding}: @racket[(list _source-mod _source-id _nominal-source-mod _nominal-source-id _source-phase _import-phase _nominal-export-phase)]. @itemize[ - @item{@scheme[_source-mod] is a module path index (see + @item{@racket[_source-mod] is a module path index (see @secref["modpathidx"]) that indicates the defining module.} - @item{@scheme[_source-id] is a symbol for the identifier's name + @item{@racket[_source-id] is a symbol for the identifier's name at its definition site in the source module. This can be different from the local name returned by - @scheme[syntax->datum] for several reasons: the identifier is + @racket[syntax->datum] for several reasons: the identifier is renamed on import, it is renamed on export, or it is implicitly renamed because the identifier (or its import) was generated by a macro invocation.} - @item{@scheme[_nominal-source-mod] is a module path index (see + @item{@racket[_nominal-source-mod] is a module path index (see @secref["modpathidx"]) that indicates the module - @scheme[require]d into the context of @scheme[id-stx] to + @racket[require]d into the context of @racket[id-stx] to provide its binding. It can be different from - @scheme[_source-mod] due to a re-export in - @scheme[_nominal-source-mod] of some imported identifier. If + @racket[_source-mod] due to a re-export in + @racket[_nominal-source-mod] of some imported identifier. If the same binding is imported in multiple ways, an arbitrary representative is chosen.} - @item{@scheme[_nominal-source-id] is a symbol for the + @item{@racket[_nominal-source-id] is a symbol for the identifier's name as exported by - @scheme[_nominal-source-mod]. It can be different from - @scheme[_source-id] due to a renaming @scheme[provide], even if - @scheme[_source-mod] and @scheme[_nominal-source-mod] are the + @racket[_nominal-source-mod]. It can be different from + @racket[_source-id] due to a renaming @racket[provide], even if + @racket[_source-mod] and @racket[_nominal-source-mod] are the same.} - @item{@scheme[_source-phase] is @scheme[1] if the source - definition is for-syntax, @scheme[0] otherwise.} + @item{@racket[_source-phase] is @racket[1] if the source + definition is for-syntax, @racket[0] otherwise.} - @item{@scheme[_import-phase] is @scheme[0] if the binding - import of @scheme[_nominal-source-mode] is a plain - @scheme[require], @scheme[1] if it is from a - @scheme[for-syntax] import, etc.} + @item{@racket[_import-phase] is @racket[0] if the binding + import of @racket[_nominal-source-mode] is a plain + @racket[require], @racket[1] if it is from a + @racket[for-syntax] import, etc.} - @item{@scheme[_nominal-export-phase] is the @tech{phase level} - of the export from @scheme[_nominal-source-mod].} + @item{@racket[_nominal-export-phase] is the @tech{phase level} + of the export from @racket[_nominal-source-mod].} ]} - @item{The result is @scheme[#f] if @scheme[id-stx] has a + @item{The result is @racket[#f] if @racket[id-stx] has a @tech{top-level binding} (or, equivalently, if it is @tech{unbound}).} ] -If @scheme[id-stx] is bound to a @tech{rename-transformer}, the result -from @scheme[identifier-binding] is for the identifier in the -transformer, so that @scheme[identifier-binding] is consistent with -@scheme[free-identifier=?].} +If @racket[id-stx] is bound to a @tech{rename-transformer}, the result +from @racket[identifier-binding] is for the identifier in the +transformer, so that @racket[identifier-binding] is consistent with +@racket[free-identifier=?].} @defproc[(identifier-transformer-binding [id-stx syntax?]) @@ -184,7 +184,7 @@ transformer, so that @scheme[identifier-binding] is consistent with (or/c exact-integer? #f) (or/c exact-integer? #f)))]{ -Same as @scheme[(identifier-binding id-stx (add1 (syntax-local-phase-level)))].} +Same as @racket[(identifier-binding id-stx (add1 (syntax-local-phase-level)))].} @defproc[(identifier-template-binding [id-stx syntax?]) @@ -198,7 +198,7 @@ Same as @scheme[(identifier-binding id-stx (add1 (syntax-local-phase-level)))].} (or/c exact-integer? #f) (or/c exact-integer? #f)))]{ -Same as @scheme[(identifier-binding id-stx (sub1 (syntax-local-phase-level)))].} +Same as @racket[(identifier-binding id-stx (sub1 (syntax-local-phase-level)))].} @defproc[(identifier-label-binding [id-stx syntax?]) @@ -212,6 +212,6 @@ Same as @scheme[(identifier-binding id-stx (sub1 (syntax-local-phase-level)))].} (or/c exact-integer? #f) (or/c exact-integer? #f)))]{ -Same as @scheme[(identifier-binding id-stx #f)].} +Same as @racket[(identifier-binding id-stx #f)].} @close-eval[stx-eval] diff --git a/collects/scribblings/reference/stx-expand.scrbl b/collects/scribblings/reference/stx-expand.scrbl index 7152ddc97e..895f9f9bdc 100644 --- a/collects/scribblings/reference/stx-expand.scrbl +++ b/collects/scribblings/reference/stx-expand.scrbl @@ -6,18 +6,18 @@ @defproc[(expand [top-level-form any/c]) syntax?]{ -Expands all non-primitive syntax in @scheme[top-level-form], and +Expands all non-primitive syntax in @racket[top-level-form], and returns a syntax object for the expanded form that contains only core forms, matching the grammar specified by @secref["fully-expanded"]. -Before @scheme[top-level-form] is expanded, its lexical context is -enriched with @scheme[namespace-syntax-introduce], just as for -@scheme[eval]. Use @scheme[syntax->datum] to convert the returned +Before @racket[top-level-form] is expanded, its lexical context is +enriched with @racket[namespace-syntax-introduce], just as for +@racket[eval]. Use @racket[syntax->datum] to convert the returned syntax object into a printable datum.} -Here's an example of using @scheme[expand] on a module: +Here's an example of using @racket[expand] on a module: -@schemeblock[ +@racketblock[ (parameterize ([current-namespace (make-base-namespace)]) (expand (datum->syntax @@ -26,9 +26,9 @@ Here's an example of using @scheme[expand] on a module: (define a 3) (+ a 4)))))] -Here's an example of using @scheme[expand] on a non-top-level form: +Here's an example of using @racket[expand] on a non-top-level form: -@schemeblock[ +@racketblock[ (define-namespace-anchor anchor) (parameterize ([current-namespace (namespace-anchor->namespace anchor)]) @@ -39,101 +39,101 @@ Here's an example of using @scheme[expand] on a non-top-level form: @defproc[(expand-syntax [stx syntax?]) syntax?]{ -Like @scheme[(expand stx)], except that the argument must be a +Like @racket[(expand stx)], except that the argument must be a @tech{syntax object}, and its lexical context is not enriched before expansion.} @defproc[(expand-once [top-level-form any/c]) syntax?]{ -Partially expands @scheme[top-level-form] and returns a syntax object +Partially expands @racket[top-level-form] and returns a syntax object for the partially-expanded expression. Due to limitations in the expansion mechanism, some context information may be lost. In -particular, calling @scheme[expand-once] on the result may produce a -result that is different from expansion via @scheme[expand]. +particular, calling @racket[expand-once] on the result may produce a +result that is different from expansion via @racket[expand]. -Before @scheme[top-level-form] is expanded, its lexical context is -enriched with @scheme[namespace-syntax-introduce], as for -@scheme[eval].} +Before @racket[top-level-form] is expanded, its lexical context is +enriched with @racket[namespace-syntax-introduce], as for +@racket[eval].} @defproc[(expand-syntax-once [stx syntax?]) syntax?]{ -Like @scheme[(expand-once stx)], except that the argument +Like @racket[(expand-once stx)], except that the argument must be a @tech{syntax object}, and its lexical context is not enriched before expansion.} @defproc[(expand-to-top-form [top-level-form any/c]) syntax?]{ -Partially expands @scheme[top-level-form] to reveal the outermost +Partially expands @racket[top-level-form] to reveal the outermost syntactic form. This partial expansion is mainly useful for detecting -top-level uses of @scheme[begin]. Unlike the result of -@scheme[expand-once], expanding the result of -@scheme[expand-to-top-form] with @scheme[expand] produces the same -result as using @scheme[expand] on the original syntax. +top-level uses of @racket[begin]. Unlike the result of +@racket[expand-once], expanding the result of +@racket[expand-to-top-form] with @racket[expand] produces the same +result as using @racket[expand] on the original syntax. -Before @scheme[stx-or-sexpr] is expanded, its lexical context is -enriched with @scheme[namespace-syntax-introduce], as for -@scheme[eval].} +Before @racket[stx-or-sexpr] is expanded, its lexical context is +enriched with @racket[namespace-syntax-introduce], as for +@racket[eval].} @defproc[(expand-syntax-to-top-form [stx syntax?]) syntax?]{ -Like @scheme[(expand-to-top-form stx)], except that the argument must +Like @racket[(expand-to-top-form stx)], except that the argument must be a @tech{syntax object}, and its lexical context is not enriched before expansion.} @;------------------------------------------------------------------------ @section[#:tag "modinfo"]{Information on Expanded Modules} -Information for an expanded @scheme[module] declaration is stored in a +Information for an expanded @racket[module] declaration is stored in a set of @tech{syntax properties} (see @secref["stxprops"]) attached to the syntax object: @itemize[ - @item{@indexed-scheme['module-direct-requires] --- a list of + @item{@indexed-racket['module-direct-requires] --- a list of @tech{module path index}es (or symbols) representing the modules explicitly imported into the module.} - @item{@indexed-scheme['module-direct-for-syntax-requires] --- a list + @item{@indexed-racket['module-direct-for-syntax-requires] --- a list of @tech{module path index}es (or symbols) representing the modules explicitly for-syntax imported into the module.} - @item{@indexed-scheme['module-direct-for-template-requires] --- a + @item{@indexed-racket['module-direct-for-template-requires] --- a list of @tech{module path index}es (or symbols) representing the modules explicitly for-template imported into the module.} - @item{@indexed-scheme['module-variable-provides] --- a list of + @item{@indexed-racket['module-variable-provides] --- a list of provided items, where each item is one of the following: @itemize[ - @item{@scheme[symbol] --- represents a locally defined variable that + @item{@racket[symbol] --- represents a locally defined variable that is provided with its defined name.} - @item{@scheme[(cons _provided-sym _defined-sym)] --- represents a + @item{@racket[(cons _provided-sym _defined-sym)] --- represents a locally defined variable that is provided with renaming; the first symbol is the exported name, and the second symbol is the defined name.} - @item{@scheme[(list* module-path-index _provided-sym _defined-sym)] + @item{@racket[(list* module-path-index _provided-sym _defined-sym)] --- represents a re-exported and possibly re-named variable from the - specified module; @scheme[module-path-index] is either a + specified module; @racket[module-path-index] is either a @tech{module path index} or symbol (see @secref["modpathidx"]), indicating the source module for the binding. The - @scheme[_provided-sym] is the external name for the re-export, and - @scheme[_defined-sym] is the originally defined name in the module - specified by @scheme[module-path-index].} + @racket[_provided-sym] is the external name for the re-export, and + @racket[_defined-sym] is the originally defined name in the module + specified by @racket[module-path-index].} ]} - @item{@indexed-scheme['module-syntax-provides] --- like - @scheme['module-variable-provides], but for syntax exports instead of + @item{@indexed-racket['module-syntax-provides] --- like + @racket['module-variable-provides], but for syntax exports instead of variable exports.} - @item{@indexed-scheme['module-indirect-provides] --- a list of symbols for + @item{@indexed-racket['module-indirect-provides] --- a list of symbols for variables that are defined in the module but not exported; they may be exported indirectly through macro expansions. Definitions of macro-generated identifiers create uninterned symbols in this list.} diff --git a/collects/scribblings/reference/stx-ops.scrbl b/collects/scribblings/reference/stx-ops.scrbl index 9fe975d905..2646e7fcc1 100644 --- a/collects/scribblings/reference/stx-ops.scrbl +++ b/collects/scribblings/reference/stx-ops.scrbl @@ -5,27 +5,27 @@ @defproc[(syntax? [v any/c]) boolean?]{ -Returns @scheme[#t] if @scheme[v] is a @tech{syntax object}, @scheme[#f] +Returns @racket[#t] if @racket[v] is a @tech{syntax object}, @racket[#f] otherwise. See also @secref["stxobj-model"].} @defproc[(syntax-source [stx syntax?]) any]{ -Returns the source for the @tech{syntax object} @scheme[stx], or @scheme[#f] +Returns the source for the @tech{syntax object} @racket[stx], or @racket[#f] if none is known. The source is represented by an arbitrary value -(e.g., one passed to @scheme[read-syntax]), but it is typically a file +(e.g., one passed to @racket[read-syntax]), but it is typically a file path string. Source-location information is dropped for a syntax object that is marshaled as part of compiled code; see also -@scheme[current-compile].} +@racket[current-compile].} @defproc[(syntax-line [stx syntax?]) (or/c exact-positive-integer? #f)]{ Returns the line number (positive exact integer) for the start of the -@tech{syntax object} in its source, or @scheme[#f] if the line number or -source is unknown. The result is @scheme[#f] if and only if -@scheme[(syntax-column stx)] produces @scheme[#f]. See also -@secref["linecol"], and see @scheme[syntax-source] for information +@tech{syntax object} in its source, or @racket[#f] if the line number or +source is unknown. The result is @racket[#f] if and only if +@racket[(syntax-column stx)] produces @racket[#f]. See also +@secref["linecol"], and see @racket[syntax-source] for information about marshaling compiled @tech{syntax object}s.} @@ -33,10 +33,10 @@ about marshaling compiled @tech{syntax object}s.} (or/c exact-nonnegative-integer? #f)]{ Returns the column number (non-negative exact integer) for the start -of the @tech{syntax object} in its source, or @scheme[#f] if the source -column is unknown. The result is @scheme[#f] if and only if -@scheme[(syntax-line stx)] produces @scheme[#f]. See also -@secref["linecol"], and see @scheme[syntax-source] for information +of the @tech{syntax object} in its source, or @racket[#f] if the source +column is unknown. The result is @racket[#f] if and only if +@racket[(syntax-line stx)] produces @racket[#f]. See also +@secref["linecol"], and see @racket[syntax-source] for information about marshaling compiled @tech{syntax object}s.} @@ -44,9 +44,9 @@ about marshaling compiled @tech{syntax object}s.} (or/c exact-positive-integer? #f)]{ Returns the character position (positive exact integer) for the start -of the @tech{syntax object} in its source, or @scheme[#f] if the source +of the @tech{syntax object} in its source, or @racket[#f] if the source position is unknown. See also @secref["linecol"], and see -@scheme[syntax-source] for information about marshaling compiled +@racket[syntax-source] for information about marshaling compiled @tech{syntax object}s.} @@ -54,19 +54,19 @@ position is unknown. See also @secref["linecol"], and see (or/c exact-nonnegative-integer? #f)]{ Returns the span (non-negative exact integer) in characters of the -@tech{syntax object} in its source, or @scheme[#f] if the span is -unknown. See also @scheme[syntax-source] for information about +@tech{syntax object} in its source, or @racket[#f] if the span is +unknown. See also @racket[syntax-source] for information about marshaling compiled @tech{syntax object}s.} @defproc[(syntax-original? [stx syntax?]) boolean?]{ -Returns @scheme[#t] if @scheme[stx] has the property that -@scheme[read-syntax] and @scheme[read-honu-syntax] attach to the +Returns @racket[#t] if @racket[stx] has the property that +@racket[read-syntax] and @racket[read-honu-syntax] attach to the @tech{syntax object}s that they generate (see @secref["stxprops"]), and if -@scheme[stx]'s @tech{lexical information} does not indicate that the +@racket[stx]'s @tech{lexical information} does not indicate that the object was introduced by a syntax transformer (see -@secref["stxobj-model"]). The result is @scheme[#f] otherwise. This +@secref["stxobj-model"]). The result is @racket[#f] otherwise. This predicate can be used to distinguish @tech{syntax object}s in an expanded expression that were directly present in the original expression, as opposed to @tech{syntax object}s inserted by macros.} @@ -76,18 +76,18 @@ opposed to @tech{syntax object}s inserted by macros.} (or/c module-path-index? symbol? path? #f)]{ Returns an indication of the module whose source contains -@scheme[stx], or @scheme[#f] if @scheme[stx] has no source module. If -@scheme[source?] is @scheme[#f], then result is a module path index or -symbol (see @secref["modpathidx"]); if @scheme[source?] is true, the +@racket[stx], or @racket[#f] if @racket[stx] has no source module. If +@racket[source?] is @racket[#f], then result is a module path index or +symbol (see @secref["modpathidx"]); if @racket[source?] is true, the result is a path or symbol corresponding to the loaded module's -source in the sense of @scheme[current-module-declare-source].} +source in the sense of @racket[current-module-declare-source].} @defproc[(syntax-e [stx syntax?]) any]{ Unwraps the immediate datum structure from a @tech{syntax object}, leaving nested syntax structure (if any) in place. The result of -@scheme[(syntax-e stx)] is one of the following: +@racket[(syntax-e stx)] is one of the following: @itemize[ @@ -114,7 +114,7 @@ A @deftech{syntax pair} is a pair containing a @tech{syntax object} as its first element, and either the empty list, a syntax pair, or a syntax object as its second element. -A @tech{syntax object} that is the result of @scheme[read-syntax] reflects +A @tech{syntax object} that is the result of @racket[read-syntax] reflects the use of delimited @litchar{.} in the input by creating a syntax object for every pair of parentheses in the source, and by creating a pair-valued @tech{syntax object} @italic{only} for parentheses in the @@ -123,21 +123,21 @@ source. See @secref["parse-pair"] for more information.} @defproc[(syntax->list [stx syntax?]) (or/c list? #f)]{ -Returns a list of @tech{syntax object}s or @scheme[#f]. The result is a list -of @tech{syntax object}s when @scheme[(syntax->datum stx)] would produce a -list. In other words, @tech{syntax pairs} in @scheme[(syntax-e stx)] +Returns a list of @tech{syntax object}s or @racket[#f]. The result is a list +of @tech{syntax object}s when @racket[(syntax->datum stx)] would produce a +list. In other words, @tech{syntax pairs} in @racket[(syntax-e stx)] are flattened.} @defproc[(syntax->datum [stx syntax?]) any]{ Returns a datum by stripping the lexical information, source-location -information, properties, and certificates from @scheme[stx]. Inside of +information, properties, and certificates from @racket[stx]. Inside of pairs, (immutable) vectors, (immutable) boxes, immutable @tech{hash table} values (not keys), and immutable @tech{prefab} structures, @tech{syntax object}s are recursively stripped. -The stripping operation does not mutate @scheme[stx]; it creates new +The stripping operation does not mutate @racket[stx]; it creates new pairs, vectors, boxes, hash tables, and @tech{prefab} structures as needed to strip lexical and source-location information recursively.} @@ -159,7 +159,7 @@ needed to strip lexical and source-location information recursively.} [cert (or/c syntax? #f) #f]) syntax?]{ -Converts the @tech{datum} @scheme[v] to a @tech{syntax object}. +Converts the @tech{datum} @racket[v] to a @tech{syntax object}. The contents of pairs, vectors, and boxes, the fields of @tech{prefab} structures, and the values of immutable hash tables are recursively converted. The keys of @tech{prefab} structures and the keys of immutable hash tables are @@ -170,47 +170,47 @@ pair, vector, box, immutable @tech{hash table}, immutable wrapping the value with lexical information, source-location information, properties, and certificates. -Converted objects in @scheme[v] are given the lexical context -information of @scheme[ctxt] and the source-location information of -@scheme[srcloc]. If @scheme[v] is not already a @tech{syntax object}, +Converted objects in @racket[v] are given the lexical context +information of @racket[ctxt] and the source-location information of +@racket[srcloc]. If @racket[v] is not already a @tech{syntax object}, then the resulting immediate @tech{syntax object} is given the -properties (see @secref["stxprops"]) of @scheme[prop] and the +properties (see @secref["stxprops"]) of @racket[prop] and the @tech{inactive certificates} (see @secref["stxcerts"]) of -@scheme[cert]; if @scheme[v] is a pair, vector, box, immutable +@racket[cert]; if @racket[v] is a pair, vector, box, immutable @tech{hash table}, or immutable @tech{prefab} structure, recursively converted values are not given properties or certificates. -Any of @scheme[ctxt], @scheme[srcloc], @scheme[prop], or @scheme[cert] -can be @scheme[#f], in which case the resulting syntax has no lexical +Any of @racket[ctxt], @racket[srcloc], @racket[prop], or @racket[cert] +can be @racket[#f], in which case the resulting syntax has no lexical context, source information, new properties, and/or certificates. -If @scheme[srcloc] is not @scheme[#f] or a @tech{syntax object}, it +If @racket[srcloc] is not @racket[#f] or a @tech{syntax object}, it must be a list or vector of five elements: -@schemeblock[ +@racketblock[ (list source-name line column position span) @#,elem{or} (vector source-name line column position span) ] -where @scheme[source-name-v] is an arbitrary value for the source -name; @scheme[line] is an integer for the source line, or @scheme[#f]; -@scheme[column] is an integer for the source column, or @scheme[#f]; -@scheme[position] is an integer for the source position, or -@scheme[#f]; and @scheme[span] is an integer for the source span, or -@scheme[#f]. The @scheme[line] and @scheme[column] values must both be -numbers or both be @scheme[#f], otherwise the +where @racket[source-name-v] is an arbitrary value for the source +name; @racket[line] is an integer for the source line, or @racket[#f]; +@racket[column] is an integer for the source column, or @racket[#f]; +@racket[position] is an integer for the source position, or +@racket[#f]; and @racket[span] is an integer for the source span, or +@racket[#f]. The @racket[line] and @racket[column] values must both be +numbers or both be @racket[#f], otherwise the @exnraise[exn:fail:contract]. -Graph structure is not preserved by the conversion of @scheme[v] to a -@tech{syntax object}. Instead, @scheme[v] is essentially unfolded into -a tree. If @scheme[v] has a cycle through pairs, vectors, boxes, +Graph structure is not preserved by the conversion of @racket[v] to a +@tech{syntax object}. Instead, @racket[v] is essentially unfolded into +a tree. If @racket[v] has a cycle through pairs, vectors, boxes, immutable @tech{hash tables}, and immutable @tech{prefab} structures, then the @exnraise[exn:fail:contract].} @defproc[(identifier? [v any/c]) boolean?]{ -Returns @scheme[#t] if @scheme[v] is a @tech{syntax object} and -@scheme[(syntax-e stx)] produces a symbol.} +Returns @racket[#t] if @racket[v] is a @tech{syntax object} and +@racket[(syntax-e stx)] produces a symbol.} @defproc[(generate-temporaries [stx-pair (or syntax? list?)]) @@ -218,33 +218,33 @@ Returns @scheme[#t] if @scheme[v] is a @tech{syntax object} and Returns a list of identifiers that are distinct from all other identifiers. The list contains as many identifiers as -@scheme[stx-pair] contains elements. The @scheme[stx-pair] argument +@racket[stx-pair] contains elements. The @racket[stx-pair] argument must be a syntax pair that can be flattened into a list. The elements -of @scheme[stx-pair] can be anything, but string, symbol, keyword +of @racket[stx-pair] can be anything, but string, symbol, keyword (possibly wrapped as syntax), and identifier elements will be embedded in the corresponding generated name, which is useful for debugging purposes. The generated identifiers are built with interned symbols -(not @scheme[gensym]s), so the limitations described with -@scheme[current-compile] do not apply.} +(not @racket[gensym]s), so the limitations described with +@racket[current-compile] do not apply.} @defproc[(identifier-prune-lexical-context [id-stx identifier?] [syms (listof symbol?) (list (syntax-e id-stx))]) identifier?]{ -Returns an identifier with the same binding as @scheme[id-stx], but -without lexical information from @scheme[id-stx] that does not apply -to the symbols in @scheme[syms], where even further extension of the +Returns an identifier with the same binding as @racket[id-stx], but +without lexical information from @racket[id-stx] that does not apply +to the symbols in @racket[syms], where even further extension of the lexical information drops information for other symbols. In particular, transferring the lexical context via -@scheme[datum->syntax] from the result of this function to a symbol -other than one in @scheme[syms] produces an identifier with no binding. +@racket[datum->syntax] from the result of this function to a symbol +other than one in @racket[syms] produces an identifier with no binding. -See also @scheme[quote-syntax/prune].} +See also @racket[quote-syntax/prune].} @defproc[(identifier-prune-to-source-module [id-stx identifier?]) identifier?]{ Returns an identifier with its lexical context minimized to that -needed for @scheme[syntax-source-module]. The minimized lexical +needed for @racket[syntax-source-module]. The minimized lexical context does not include any bindings.} diff --git a/collects/scribblings/reference/stx-param.scrbl b/collects/scribblings/reference/stx-param.scrbl index 4ec6a1c74a..1eff9cd21d 100644 --- a/collects/scribblings/reference/stx-param.scrbl +++ b/collects/scribblings/reference/stx-param.scrbl @@ -8,39 +8,39 @@ @defform[(define-syntax-parameter id expr)]{ -Binds @scheme[id] as syntax to a @deftech{syntax -parameter}. The @scheme[expr] is an expression in the +Binds @racket[id] as syntax to a @deftech{syntax +parameter}. The @racket[expr] is an expression in the @tech{transformer environment} that serves as the default value for the @tech{syntax parameter}. The value is typically obtained by a transformer -using @scheme[syntax-parameter-value]. +using @racket[syntax-parameter-value]. -The @scheme[id] can be used with @scheme[syntax-parameterize] -or @scheme[syntax-parameter-value] (in a transformer). If -@scheme[expr] produces a procedure of one argument or a -@scheme[make-set!-transformer] result, then @scheme[id] can be -used as a macro. If @scheme[expr] produces a -@scheme[rename-transformer] result, then @scheme[id] can be +The @racket[id] can be used with @racket[syntax-parameterize] +or @racket[syntax-parameter-value] (in a transformer). If +@racket[expr] produces a procedure of one argument or a +@racket[make-set!-transformer] result, then @racket[id] can be +used as a macro. If @racket[expr] produces a +@racket[rename-transformer] result, then @racket[id] can be used as a macro that expands to a use of the target identifier, but -@scheme[syntax-local-value] of @scheme[id] does not produce +@racket[syntax-local-value] of @racket[id] does not produce the target's value.} @defform[(syntax-parameterize ((id expr) ...) body-expr ...+)]{ -@margin-note/ref{See also @scheme[splicing-syntax-parameterize].} +@margin-note/ref{See also @racket[splicing-syntax-parameterize].} -Each @scheme[id] must be bound to a @tech{syntax parameter} using -@scheme[define-syntax-parameter]. Each @scheme[expr] is an expression +Each @racket[id] must be bound to a @tech{syntax parameter} using +@racket[define-syntax-parameter]. Each @racket[expr] is an expression in the @tech{transformer environment}. During the expansion of the -@scheme[body-expr]s, the value of each @scheme[expr] is bound to the -corresponding @scheme[id]. +@racket[body-expr]s, the value of each @racket[expr] is bound to the +corresponding @racket[id]. -If an @scheme[expr] produces a procedure of one argument or a -@scheme[make-set!-transformer] result, then its @scheme[id] +If an @racket[expr] produces a procedure of one argument or a +@racket[make-set!-transformer] result, then its @racket[id] can be used as a macro during the expansion of the -@scheme[body-expr]s. If @scheme[expr] produces a -@scheme[rename-transformer] result, then @scheme[id] can be +@racket[body-expr]s. If @racket[expr] produces a +@racket[rename-transformer] result, then @racket[id] can be used as a macro that expands to a use of the target identifier, but -@scheme[syntax-local-value] of @scheme[id] does not produce +@racket[syntax-local-value] of @racket[id] does not produce the target's value.} @; ---------------------------------------------------------------------- @@ -54,37 +54,37 @@ the target's value.} @defproc[(syntax-parameter-value [id-stx syntax?]) any]{ This procedure is intended for use in a @tech{transformer -environment}, where @scheme[id-stx] is an identifier bound in the +environment}, where @racket[id-stx] is an identifier bound in the normal environment to a @tech{syntax parameter}. The result is the current value of the @tech{syntax parameter}, as adjusted by -@scheme[syntax-parameterize] form. +@racket[syntax-parameterize] form. -This binding is provided @scheme[for-syntax] by -@schememodname[racket/stxparam], since it is normally used in a +This binding is provided @racket[for-syntax] by +@racketmodname[racket/stxparam], since it is normally used in a transformer. It is provided normally by -@schememodname[racket/stxparam-exptime].} +@racketmodname[racket/stxparam-exptime].} @defproc[(make-parameter-rename-transformer [id-stx syntax?]) any]{ This procedure is intended for use in a transformer, where -@scheme[id-stx] is an identifier bound to a @tech{syntax parameter}. The -result is a transformer that behaves as @scheme[id-stx], but that cannot -be used with @scheme[syntax-parameterize] or -@scheme[syntax-parameter-value]. +@racket[id-stx] is an identifier bound to a @tech{syntax parameter}. The +result is a transformer that behaves as @racket[id-stx], but that cannot +be used with @racket[syntax-parameterize] or +@racket[syntax-parameter-value]. -Using @scheme[make-parameter-rename-transformer] is analogous to +Using @racket[make-parameter-rename-transformer] is analogous to defining a procedure that calls a parameter. Such a procedure can be exported to others to allow access to the parameter value, but not to change the parameter value. Similarly, -@scheme[make-parameter-rename-transformer] allows a @tech{syntax parameter} +@racket[make-parameter-rename-transformer] allows a @tech{syntax parameter} to be used as a macro, but not changed. -The result of @scheme[make-parameter-rename-transformer] is not -treated specially by @scheme[syntax-local-value], unlike the result -of @scheme[make-rename-transformer]. +The result of @racket[make-parameter-rename-transformer] is not +treated specially by @racket[syntax-local-value], unlike the result +of @racket[make-rename-transformer]. -This binding is provided @scheme[for-syntax] by -@schememodname[racket/stxparam], since it is normally used in a +This binding is provided @racket[for-syntax] by +@racketmodname[racket/stxparam], since it is normally used in a transformer. It is provided normally by -@schememodname[racket/stxparam-exptime].} +@racketmodname[racket/stxparam-exptime].} diff --git a/collects/scribblings/reference/stx-patterns.scrbl b/collects/scribblings/reference/stx-patterns.scrbl index 2c15e7fa28..5e2c36a265 100644 --- a/collects/scribblings/reference/stx-patterns.scrbl +++ b/collects/scribblings/reference/stx-patterns.scrbl @@ -34,125 +34,125 @@ const] [ellipsis #,lit-ellipsis])]{ -Finds the first @scheme[pattern] that matches the syntax object -produced by @scheme[stx-expr], and for which the corresponding -@scheme[fender-expr] (if any) produces a true value; the result is -from the corresponding @scheme[result-expr], which is in tail position -for the @scheme[syntax-case] form. If no @scheme[clause] matches, then +Finds the first @racket[pattern] that matches the syntax object +produced by @racket[stx-expr], and for which the corresponding +@racket[fender-expr] (if any) produces a true value; the result is +from the corresponding @racket[result-expr], which is in tail position +for the @racket[syntax-case] form. If no @racket[clause] matches, then the @exnraise[exn:fail:syntax]; the exception is generated by calling -@scheme[raise-syntax-error] with @scheme[#f] as the ``name'' argument, -a string with a generic error message, and the result of @scheme[stx-expr]. +@racket[raise-syntax-error] with @racket[#f] as the ``name'' argument, +a string with a generic error message, and the result of @racket[stx-expr]. -A syntax object matches a @scheme[pattern] as follows: +A syntax object matches a @racket[pattern] as follows: @specsubform[_]{ - A @scheme[_] pattern (i.e., an identifier with the same binding as - @scheme[_]) matches any syntax object.} + A @racket[_] pattern (i.e., an identifier with the same binding as + @racket[_]) matches any syntax object.} @specsubform[id]{ - An @scheme[id] matches any syntax object when it is not bound to - @scheme[...] or @scheme[_] and does not have the same binding as - any @scheme[literal-id]. The @scheme[id] is further bound as - @deftech{pattern variable} for the corresponding @scheme[fender-expr] - (if any) and @scheme[result-expr]. A pattern-variable binding is a + An @racket[id] matches any syntax object when it is not bound to + @racket[...] or @racket[_] and does not have the same binding as + any @racket[literal-id]. The @racket[id] is further bound as + @deftech{pattern variable} for the corresponding @racket[fender-expr] + (if any) and @racket[result-expr]. A pattern-variable binding is a transformer binding; the pattern variable can be reference only - through forms like @scheme[syntax]. The binding's value is the syntax + through forms like @racket[syntax]. The binding's value is the syntax object that matched the pattern with a @deftech{depth marker} of @math{0}. - An @scheme[id] that has the same binding as a @scheme[literal-id] + An @racket[id] that has the same binding as a @racket[literal-id] matches a syntax object that is an identifier with the same binding - in the sense of @scheme[free-identifier=?]. The match does not + in the sense of @racket[free-identifier=?]. The match does not introduce any @tech{pattern variables}.} @specsubform[(pattern ...)]{ - A @scheme[(pattern ...)] pattern matches a syntax object whose datum + A @racket[(pattern ...)] pattern matches a syntax object whose datum form (i.e., without lexical information) is a list with as many - elements as sub-@scheme[pattern]s in the pattern, and where each + elements as sub-@racket[pattern]s in the pattern, and where each syntax object that corresponds to an element of the list matches - the corresponding sub-@scheme[pattern]. + the corresponding sub-@racket[pattern]. - Any @tech{pattern variables} bound by the sub-@scheme[pattern]s are + Any @tech{pattern variables} bound by the sub-@racket[pattern]s are bound by the complete pattern; the bindings must all be distinct.} @specsubform[(pattern ...+ . pattern)]{ - The last @scheme[pattern] must not be a @racket/form[(pattern ...)], + The last @racket[pattern] must not be a @racket/form[(pattern ...)], @racket/form[(pattern ...+ . pattern)], @racket/form[(pattern ... pattern ellipsis pattern ...)], or @racket/form[(pattern ... pattern ellipsis pattern ... . pattern)] form. Like the previous kind of pattern, but matches syntax objects that - are not necessarily lists; for @math{n} sub-@scheme[pattern]s before - the last sub-@scheme[pattern], the syntax object's datum must be a - pair such that @math{n-1} @scheme[cdr]s produce pairs. The last - sub-@scheme[pattern] is matched against the syntax object - corresponding to the @math{n}th @scheme[cdr] (or the - @scheme[datum->syntax] coercion of the datum using the nearest + are not necessarily lists; for @math{n} sub-@racket[pattern]s before + the last sub-@racket[pattern], the syntax object's datum must be a + pair such that @math{n-1} @racket[cdr]s produce pairs. The last + sub-@racket[pattern] is matched against the syntax object + corresponding to the @math{n}th @racket[cdr] (or the + @racket[datum->syntax] coercion of the datum using the nearest enclosing syntax object's lexical context and source location).} @specsubform[(pattern ... pattern ellipsis pattern ...)]{ - Like the @scheme[(pattern ...)] kind of pattern, but matching a + Like the @racket[(pattern ...)] kind of pattern, but matching a syntax object with any number (zero or more) elements that match the - sub-@scheme[pattern] followed by @scheme[ellipsis] in the - corresponding position relative to other sub-@scheme[pattern]s. + sub-@racket[pattern] followed by @racket[ellipsis] in the + corresponding position relative to other sub-@racket[pattern]s. - For each pattern variable bound by the sub-@scheme[pattern] followed - by @scheme[ellipsis], the larger pattern binds the same pattern + For each pattern variable bound by the sub-@racket[pattern] followed + by @racket[ellipsis], the larger pattern binds the same pattern variable to a list of values, one for each element of the syntax - object matched to the sub-@scheme[pattern], with an incremented - @tech{depth marker}. (The sub-@scheme[pattern] itself may contain - @scheme[ellipsis], leading to a pattern variables bound to lists of + object matched to the sub-@racket[pattern], with an incremented + @tech{depth marker}. (The sub-@racket[pattern] itself may contain + @racket[ellipsis], leading to a pattern variables bound to lists of lists of syntax objects with a @tech{depth marker} of @math{2}, and so on.)} @specsubform[(pattern ... pattern ellipsis pattern ... . pattern)]{ Like the previous kind of pattern, but with a final - sub-@scheme[pattern] as for @scheme[(pattern ...+ . pattern)]. The - final @scheme[pattern] never matches a syntax object whose datum is a + sub-@racket[pattern] as for @racket[(pattern ...+ . pattern)]. The + final @racket[pattern] never matches a syntax object whose datum is a pair.} @specsubform[(code:line #,(tt "#")(pattern ...))]{ - Like a @scheme[(pattern ...)] pattern, but matching a vector syntax object - whose elements match the corresponding sub-@scheme[pattern]s.} + Like a @racket[(pattern ...)] pattern, but matching a vector syntax object + whose elements match the corresponding sub-@racket[pattern]s.} @specsubform[(code:line #,(tt "#")(pattern ... pattern ellipsis pattern ...))]{ - Like a @scheme[(pattern ... pattern ellipsis pattern ...)] pattern, + Like a @racket[(pattern ... pattern ellipsis pattern ...)] pattern, but matching a vector syntax object whose elements match the - corresponding sub-@scheme[pattern]s.} + corresponding sub-@racket[pattern]s.} @specsubform[(code:line #,(tt "#s")(key-datum pattern ...))]{ - Like a @scheme[(pattern ...)] pattern, but matching a @tech{prefab} + Like a @racket[(pattern ...)] pattern, but matching a @tech{prefab} structure syntax object whose fields match the corresponding - sub-@scheme[pattern]s. The @scheme[key-datum] must correspond to a - valid first argument to @scheme[make-prefab-struct].} + sub-@racket[pattern]s. The @racket[key-datum] must correspond to a + valid first argument to @racket[make-prefab-struct].} @specsubform[(code:line #,(tt "#s")(key-datum pattern ... pattern ellipsis pattern ...))]{ - Like a @scheme[(pattern ... pattern ellipsis pattern ...)] pattern, + Like a @racket[(pattern ... pattern ellipsis pattern ...)] pattern, but matching a @tech{prefab} structure syntax object whose elements - match the corresponding sub-@scheme[pattern]s.} + match the corresponding sub-@racket[pattern]s.} @specsubform[(ellipsis stat-pattern)]{ - Matches the same as @scheme[stat-pattern], which is like a @scheme[pattern], - but identifiers with the binding @scheme[...] are treated the same as - other @scheme[id]s.} + Matches the same as @racket[stat-pattern], which is like a @racket[pattern], + but identifiers with the binding @racket[...] are treated the same as + other @racket[id]s.} @specsubform[const]{ - A @scheme[const] is any datum that does not match one of the - preceding forms; a syntax object matches a @scheme[const] pattern - when its datum is @scheme[equal?] to the @scheme[quote]d - @scheme[const].} + A @racket[const] is any datum that does not match one of the + preceding forms; a syntax object matches a @racket[const] pattern + when its datum is @racket[equal?] to the @racket[quote]d + @racket[const].} @mz-examples[ (require (for-syntax racket/base)) @@ -180,43 +180,43 @@ A syntax object matches a @scheme[pattern] as follows: @defform[(syntax-case* stx-expr (literal-id ...) id-compare-expr clause ...)]{ -Like @scheme[syntax-case], but @scheme[id-compare-expr] must produce a -procedure that accepts two arguments. A @scheme[literal-id] in a -@scheme[_pattern] matches an identifier for which the procedure +Like @racket[syntax-case], but @racket[id-compare-expr] must produce a +procedure that accepts two arguments. A @racket[literal-id] in a +@racket[_pattern] matches an identifier for which the procedure returns true when given the identifier to match (as the first argument) -and the identifier in the @scheme[_pattern] (as the second argument). +and the identifier in the @racket[_pattern] (as the second argument). -In other words, @scheme[syntax-case] is like @scheme[syntax-case*] with -an @scheme[id-compare-expr] that produces @scheme[free-identifier=?].} +In other words, @racket[syntax-case] is like @racket[syntax-case*] with +an @racket[id-compare-expr] that produces @racket[free-identifier=?].} @defform[(with-syntax ([pattern stx-expr] ...) body ...+)]{ -Similar to @scheme[syntax-case], in that it matches a @scheme[pattern] -to a syntax object. Unlike @scheme[syntax-case], all @scheme[pattern]s -are matched, each to the result of a corresponding @scheme[stx-expr], +Similar to @racket[syntax-case], in that it matches a @racket[pattern] +to a syntax object. Unlike @racket[syntax-case], all @racket[pattern]s +are matched, each to the result of a corresponding @racket[stx-expr], and the pattern variables from all matches (which must be distinct) -are bound with a single @scheme[body] sequence. The result of the -@scheme[with-syntax] form is the result of the last @scheme[body], -which is in tail position with respect to the @scheme[with-syntax] +are bound with a single @racket[body] sequence. The result of the +@racket[with-syntax] form is the result of the last @racket[body], +which is in tail position with respect to the @racket[with-syntax] form. -If any @scheme[pattern] fails to match the corresponding -@scheme[stx-expr], the @exnraise[exn:fail:syntax]. +If any @racket[pattern] fails to match the corresponding +@racket[stx-expr], the @exnraise[exn:fail:syntax]. -A @scheme[with-syntax] form is roughly equivalent to the following -@scheme[syntax-case] form: +A @racket[with-syntax] form is roughly equivalent to the following +@racket[syntax-case] form: -@schemeblock[ +@racketblock[ (syntax-case (list stx-expr ...) () [(pattern ...) (let () body ...+)]) ] -However, if any individual @scheme[stx-expr] produces a +However, if any individual @racket[stx-expr] produces a non-@tech{syntax object}, then it is converted to one using -@scheme[datum->syntax] and the lexical context and source location of -the individual @scheme[stx-expr]. +@racket[datum->syntax] and the lexical context and source location of +the individual @racket[stx-expr]. @examples[#:eval (syntax-eval) (define-syntax (hello stx) @@ -271,66 +271,66 @@ the individual @scheme[stx-expr]. const] [ellipsis #,lit-ellipsis])]{ -Constructs a syntax object based on a @scheme[template], which can -include @tech{pattern variables} bound by @scheme[syntax-case] or -@scheme[with-syntax]. +Constructs a syntax object based on a @racket[template], which can +include @tech{pattern variables} bound by @racket[syntax-case] or +@racket[with-syntax]. Template forms produce a syntax object as follows: @specsubform[id]{ - If @scheme[id] is bound as a @tech{pattern variable}, then - @scheme[id] as a template produces the @tech{pattern variable}'s - match result. Unless the @scheme[id] is a sub-@scheme[template] that is - replicated by @scheme[ellipsis] in a larger @scheme[template], the + If @racket[id] is bound as a @tech{pattern variable}, then + @racket[id] as a template produces the @tech{pattern variable}'s + match result. Unless the @racket[id] is a sub-@racket[template] that is + replicated by @racket[ellipsis] in a larger @racket[template], the @tech{pattern variable}'s value must be a syntax object with a @tech{depth marker} of @math{0} (as opposed to a list of matches). More generally, if the @tech{pattern variable}'s value has a depth marker @math{n}, then it can only appear within a template where it - is replicated by at least @math{n} @scheme[ellipsis]es. In that case, + is replicated by at least @math{n} @racket[ellipsis]es. In that case, the template will be replicated enough times to use each match result at least once. - If @scheme[id] is not bound as a pattern variable, then @scheme[id] - as a template produces @scheme[(quote-syntax id)].} + If @racket[id] is not bound as a pattern variable, then @racket[id] + as a template produces @racket[(quote-syntax id)].} @specsubform[(template-elem ...)]{ Produces a syntax object whose datum is a list, and where the elements of the list correspond to syntax objects produced by the - @scheme[template-elem]s. + @racket[template-elem]s. - A @scheme[template-elem] is a sub-@scheme[template] replicated by any - number of @scheme[ellipsis]es: + A @racket[template-elem] is a sub-@racket[template] replicated by any + number of @racket[ellipsis]es: @itemize[ - @item{If the sub-@scheme[template] is replicated by no - @scheme[ellipsis]es, then it generates a single syntax object to + @item{If the sub-@racket[template] is replicated by no + @racket[ellipsis]es, then it generates a single syntax object to incorporate into the result syntax object.} - @item{If the sub-@scheme[template] is replicated by one - @scheme[ellipsis], then it generates a sequence of syntax objects + @item{If the sub-@racket[template] is replicated by one + @racket[ellipsis], then it generates a sequence of syntax objects that is ``inlined'' into the resulting syntax object. The number of generated elements depends on the values of @tech{pattern variables} referenced within the - sub-@scheme[template]. There must be at least one @tech{pattern + sub-@racket[template]. There must be at least one @tech{pattern variable} whose value has a @tech{depth marker} less than the - number of @scheme[ellipsis]es after the pattern variable within the - sub-@scheme[template]. + number of @racket[ellipsis]es after the pattern variable within the + sub-@racket[template]. If a @tech{pattern variable} is replicated by more - @scheme[ellipsis]es in a @scheme[template] than the @tech{depth + @racket[ellipsis]es in a @racket[template] than the @tech{depth marker} of its binding, then the @tech{pattern variable}'s result - is determined normally for inner @scheme[ellipsis]es (up to the + is determined normally for inner @racket[ellipsis]es (up to the binding's @tech{depth marker}), and then the result is replicated - as necessary to satisfy outer @scheme[ellipsis]es.} + as necessary to satisfy outer @racket[ellipsis]es.} - @item{For each @scheme[ellipsis] after the first one, the preceding - element (with earlier replicating @scheme[ellipsis]es) is + @item{For each @racket[ellipsis] after the first one, the preceding + element (with earlier replicating @racket[ellipsis]es) is conceptually wrapped with parentheses for generating output, and then the wrapping parentheses are removed in the resulting syntax object.}]} @@ -339,97 +339,97 @@ Template forms produce a syntax object as follows: Like the previous form, but the result is not necessarily a list; instead, the place of the empty list in the resulting syntax object's - datum is taken by the syntax object produced by @scheme[template].} + datum is taken by the syntax object produced by @racket[template].} @specsubform[(code:line #,(tt "#")(template-elem ...))]{ - Like the @scheme[(template-elem ...)] form, but producing a syntax + Like the @racket[(template-elem ...)] form, but producing a syntax object whose datum is a vector instead of a list.} @specsubform[(code:line #,(tt "#s")(key-datum template-elem ...))]{ - Like the @scheme[(template-elem ...)] form, but producing a syntax + Like the @racket[(template-elem ...)] form, but producing a syntax object whose datum is a @tech{prefab} structure instead of a list. - The @scheme[key-datum] must correspond to a valid first argument of - @scheme[make-prefab-struct].} + The @racket[key-datum] must correspond to a valid first argument of + @racket[make-prefab-struct].} @specsubform[(ellipsis stat-template)]{ - Produces the same result as @scheme[stat-template], which is like a - @scheme[template], but @scheme[...] is treated like an @scheme[id] + Produces the same result as @racket[stat-template], which is like a + @racket[template], but @racket[...] is treated like an @racket[id] (with no pattern binding).} @specsubform[const]{ - A @scheme[const] template is any form that does not match the - preceding cases, and it produces the result @scheme[(quote-syntax + A @racket[const] template is any form that does not match the + preceding cases, and it produces the result @racket[(quote-syntax const)].} -A @scheme[(#,(schemekeywordfont "syntax") template)] form is normally -abbreviated as @scheme[#'template]; see also -@secref["parse-quote"]. If @scheme[template] contains no pattern -variables, then @scheme[#'template] is equivalent to -@scheme[(quote-syntax template)].} +A @racket[(#,(racketkeywordfont "syntax") template)] form is normally +abbreviated as @racket[#'template]; see also +@secref["parse-quote"]. If @racket[template] contains no pattern +variables, then @racket[#'template] is equivalent to +@racket[(quote-syntax template)].} @defform[(quasisyntax template)]{ -Like @scheme[syntax], but @scheme[(#,(schemekeywordfont "unsyntax") -_expr)] and @scheme[(#,(schemekeywordfont "unsyntax-splicing") _expr)] -escape to an expression within the @scheme[template]. +Like @racket[syntax], but @racket[(#,(racketkeywordfont "unsyntax") +_expr)] and @racket[(#,(racketkeywordfont "unsyntax-splicing") _expr)] +escape to an expression within the @racket[template]. -The @scheme[_expr] must produce a syntax object (or syntax list) to be -substituted in place of the @scheme[unsyntax] or -@scheme[unsyntax-splicing] form within the quasiquoting template, just -like @scheme[unquote] and @scheme[unquote-splicing] within -@scheme[quasiquote]. (If the escaped expression does not generate a +The @racket[_expr] must produce a syntax object (or syntax list) to be +substituted in place of the @racket[unsyntax] or +@racket[unsyntax-splicing] form within the quasiquoting template, just +like @racket[unquote] and @racket[unquote-splicing] within +@racket[quasiquote]. (If the escaped expression does not generate a syntax object, it is converted to one in the same way as for the -right-hand side of @scheme[with-syntax].) Nested -@scheme[quasisyntax]es introduce quasiquoting layers in the same way -as nested @scheme[quasiquote]s. +right-hand side of @racket[with-syntax].) Nested +@racket[quasisyntax]es introduce quasiquoting layers in the same way +as nested @racket[quasiquote]s. -Also analogous to @scheme[quasiquote], the reader converts @litchar{#`} -to @scheme[quasisyntax], @litchar{#,} to @scheme[unsyntax], and -@litchar["#,@"] to @scheme[unsyntax-splicing]. See also +Also analogous to @racket[quasiquote], the reader converts @litchar{#`} +to @racket[quasisyntax], @litchar{#,} to @racket[unsyntax], and +@litchar["#,@"] to @racket[unsyntax-splicing]. See also @secref["parse-quote"].} @defform[(unsyntax expr)]{ -Illegal as an expression form. The @scheme[unsyntax] form is for use -only with a @scheme[quasisyntax] template.} +Illegal as an expression form. The @racket[unsyntax] form is for use +only with a @racket[quasisyntax] template.} @defform[(unsyntax-splicing expr)]{ -Illegal as an expression form. The @scheme[unsyntax-splicing] form is -for use only with a @scheme[quasisyntax] template.} +Illegal as an expression form. The @racket[unsyntax-splicing] form is +for use only with a @racket[quasisyntax] template.} @defform[(syntax/loc stx-expr template)]{ -Like @scheme[syntax], except that the immediate resulting syntax +Like @racket[syntax], except that the immediate resulting syntax object takes its source-location information from the result of -@scheme[stx-expr] (which must produce a syntax object), unless the -@scheme[template] is just a pattern variable, or both the source and -position of @scheme[stx-expr] are @scheme[#f].} +@racket[stx-expr] (which must produce a syntax object), unless the +@racket[template] is just a pattern variable, or both the source and +position of @racket[stx-expr] are @racket[#f].} @defform[(quasisyntax/loc stx-expr template)]{ -Like @scheme[quasisyntax], but with source-location assignment like -@scheme[syntax/loc].} +Like @racket[quasisyntax], but with source-location assignment like +@racket[syntax/loc].} @defform[(quote-syntax/prune id)]{ -Like @scheme[quote-syntax], but the lexical context of @scheme[id] is -pruned via @scheme[identifier-prune-lexical-context] to including -binding only for the symbolic name of @scheme[id] and for -@scheme['#%top]. Use this form to quote an identifier when its lexical +Like @racket[quote-syntax], but the lexical context of @racket[id] is +pruned via @racket[identifier-prune-lexical-context] to including +binding only for the symbolic name of @racket[id] and for +@racket['#%top]. Use this form to quote an identifier when its lexical information will not be transferred to other syntax objects (except -maybe to @scheme['#%top] for a top-level binding).} +maybe to @racket['#%top] for a top-level binding).} @defform[(syntax-rules (literal-id ...) @@ -437,14 +437,14 @@ maybe to @scheme['#%top] for a top-level binding).} Equivalent to -@schemeblock/form[ +@racketblock/form[ (lambda (stx) (syntax-case stx (literal-id ...) [(_generated-id . pattern) (syntax template)] ...)) ] -where each @scheme[_generated-id] binds no identifier in the -corresponding @scheme[template].} +where each @racket[_generated-id] binds no identifier in the +corresponding @racket[template].} @defform[(syntax-id-rules (literal-id ...) @@ -452,7 +452,7 @@ corresponding @scheme[template].} Equivalent to -@schemeblock[ +@racketblock[ (lambda (stx) (make-set!-transformer (syntax-case stx (literal-id ...) @@ -464,7 +464,7 @@ Equivalent to Equivalent to -@schemeblock/form[ +@racketblock/form[ (define-syntax id (syntax-rules () [(id . pattern) template])) @@ -476,27 +476,27 @@ but with syntax errors potentially phrased in terms of @defidform[...]{ -The @scheme[...] transformer binding prohibits @scheme[...] from +The @racket[...] transformer binding prohibits @racket[...] from being used as an expression. This binding is useful only in syntax patterns and templates, where it indicates repetitions of a pattern or -template. See @scheme[syntax-case] and @scheme[syntax].} +template. See @racket[syntax-case] and @racket[syntax].} @defidform[_]{ -The @scheme[_] transformer binding prohibits @scheme[_] from being +The @racket[_] transformer binding prohibits @racket[_] from being used as an expression. This binding is useful only in syntax patterns, where it indicates a pattern that matches any syntax object. See -@scheme[syntax-case].} +@racket[syntax-case].} @defproc[(syntax-pattern-variable? [v any/c]) boolean?]{ -Returns @scheme[#t] if @scheme[v] is a value that, as a +Returns @racket[#t] if @racket[v] is a value that, as a transformer-binding value, makes the bound variable as pattern -variable in @scheme[syntax] and other forms. To check whether an -identifier is a pattern variable, use @scheme[syntax-local-value] to +variable in @racket[syntax] and other forms. To check whether an +identifier is a pattern variable, use @racket[syntax-local-value] to get the identifier's transformer value, and then test the value with -@scheme[syntax-pattern-variable?]. +@racket[syntax-pattern-variable?]. -The @scheme[syntax-pattern-variable?] procedure is provided -@scheme[for-syntax] by @schememodname[racket/base].} +The @racket[syntax-pattern-variable?] procedure is provided +@racket[for-syntax] by @racketmodname[racket/base].} diff --git a/collects/scribblings/reference/stx-trans.scrbl b/collects/scribblings/reference/stx-trans.scrbl index 9fcabc5be2..0d699b0e78 100644 --- a/collects/scribblings/reference/stx-trans.scrbl +++ b/collects/scribblings/reference/stx-trans.scrbl @@ -18,21 +18,21 @@ expander, otherwise the @exnraise[exn:fail:contract].}) @defproc[(set!-transformer? [v any/c]) boolean?]{ -Returns @scheme[#t] if @scheme[v] is a value created by -@scheme[make-set!-transformer] or an instance of a structure type with -the @scheme[prop:set!-transformer] property, @scheme[#f] otherwise.} +Returns @racket[#t] if @racket[v] is a value created by +@racket[make-set!-transformer] or an instance of a structure type with +the @racket[prop:set!-transformer] property, @racket[#f] otherwise.} @defproc[(make-set!-transformer [proc (syntax? . -> . syntax?)]) set!-transformer?]{ Creates an @tech{assignment transformer} that cooperates with -@scheme[set!]. If the result of @scheme[make-set!-transformer] is -bound to @scheme[_id] as a @tech{transformer binding}, then -@scheme[proc] is applied as a transformer when @scheme[_id] is +@racket[set!]. If the result of @racket[make-set!-transformer] is +bound to @racket[_id] as a @tech{transformer binding}, then +@racket[proc] is applied as a transformer when @racket[_id] is used in an expression position, or when it is used as the target of a -@scheme[set!] assignment as @scheme[(set! _id _expr)]. When the -identifier appears as a @scheme[set!] target, the entire @scheme[set!] +@racket[set!] assignment as @racket[(set! _id _expr)]. When the +identifier appears as a @racket[set!] target, the entire @racket[set!] expression is provided to the transformer. @examples[ @@ -44,7 +44,7 @@ expression is provided to the transformer. (syntax-case stx (set!) (code:comment @#,t{Redirect mutation of x to y}) [(set! id v) (syntax (set! y v))] - (code:comment @#,t{Normal use of @scheme[x] really gets @scheme[x]}) + (code:comment @#,t{Normal use of @racket[x] really gets @racket[x]}) [id (identifier? (syntax id)) (syntax x)])))]) (begin (set! x 3) @@ -56,50 +56,50 @@ expression is provided to the transformer. (syntax? . -> . syntax?)]{ Returns the procedure that was passed to -@scheme[make-set!-transformer] to create @scheme[transformer] or that -is identified by the @scheme[prop:set!-transformer] property of -@scheme[transformer].} +@racket[make-set!-transformer] to create @racket[transformer] or that +is identified by the @racket[prop:set!-transformer] property of +@racket[transformer].} @defthing[prop:set!-transformer struct-type-property?]{ A @tech{structure type property} to identify structure types that act as @tech{assignment transformers} like the ones created by -@scheme[make-set!-transformer]. +@racket[make-set!-transformer]. The property value must be an exact integer or procedure of one or two arguments. In the former case, the integer designates a field within the structure that should contain a procedure; the integer must be -between @scheme[0] (inclusive) and the number of non-automatic fields +between @racket[0] (inclusive) and the number of non-automatic fields in the structure type (exclusive, not counting supertype fields), and the designated field must also be specified as immutable. If the property value is a procedure of one argument, then the -procedure serves as a @tech{syntax transformer} and for @scheme[set!] +procedure serves as a @tech{syntax transformer} and for @racket[set!] transformations. If the property value is a procedure of two arguments, then the first argument is the structure whose type has -@scheme[prop:set!-transformer] property, and the second argument is a -syntax object as for a @tech{syntax transformer} and for @scheme[set!] -transformations; @scheme[set!-transformer-procedure] applied to the +@racket[prop:set!-transformer] property, and the second argument is a +syntax object as for a @tech{syntax transformer} and for @racket[set!] +transformations; @racket[set!-transformer-procedure] applied to the structure produces a new function that accepts just the syntax object and calls the procedure associated through the property. Finally, if the property value is an integer, the target identifier is extracted from the structure instance; if the field value is not a procedure of one argument, then a procedure that always calls -@scheme[raise-syntax-error] is used, instead. +@racket[raise-syntax-error] is used, instead. -If a value has both the @scheme[prop:set!-transformer] and -@scheme[prop:rename-transformer] properties, then the latter takes -precedence. If a structure type has the @scheme[prop:set!-transformer] -and @scheme[prop:procedure] properties, then the former takes +If a value has both the @racket[prop:set!-transformer] and +@racket[prop:rename-transformer] properties, then the latter takes +precedence. If a structure type has the @racket[prop:set!-transformer] +and @racket[prop:procedure] properties, then the former takes precedence for the purposes of macro expansion.} @defproc[(rename-transformer? [v any/c]) boolean?]{ -Returns @scheme[#t] if @scheme[v] is a value created by -@scheme[make-rename-transformer] or an instance of a structure type -with the @scheme[prop:rename-transformer] property, @scheme[#f] +Returns @racket[#t] if @racket[v] is a value created by +@racket[make-rename-transformer] or an instance of a structure type +with the @racket[prop:rename-transformer] property, @racket[#f] otherwise.} @@ -110,41 +110,41 @@ otherwise.} Creates a @tech{rename transformer} that, when used as a @tech{transformer binding}, acts as a transformer that inserts the -identifier @scheme[id-stx] in place of whatever identifier binds the -transformer, including in non-application positions, in @scheme[set!] +identifier @racket[id-stx] in place of whatever identifier binds the +transformer, including in non-application positions, in @racket[set!] expressions. Such a transformer could be written manually, but the one created by -@scheme[make-rename-transformer] triggers special cooperation with the +@racket[make-rename-transformer] triggers special cooperation with the parser and other syntactic forms when @racket[_id] is bound to the rename transformer: @itemlist[ - @item{The parser to installs a @scheme[free-identifier=?] and - @scheme[identifier-binding] equivalence between @racket[_id] - and @racket[_id-stx], as long as @scheme[id-stx] does not have - a true value for the @indexed-scheme['not-free-identifier=?] + @item{The parser to installs a @racket[free-identifier=?] and + @racket[identifier-binding] equivalence between @racket[_id] + and @racket[_id-stx], as long as @racket[id-stx] does not have + a true value for the @indexed-racket['not-free-identifier=?] @tech{syntax property}.} @item{A @racket[provide] of @racket[_id] provides the binding indicated by @racket[id-stx] instead of @racket[_id], as long - as @scheme[id-stx] does not have a true value for the - @indexed-scheme['not-free-identifier=?] @tech{syntax property} + as @racket[id-stx] does not have a true value for the + @indexed-racket['not-free-identifier=?] @tech{syntax property} and as long as @racket[id-stx] has a binding.} - @item{If @scheme[provide] exports @racket[_id], it uses a - symbol-valued @indexed-scheme['nominal-id] property of - @scheme[id-stx] to specify the ``nominal source identifier'' of + @item{If @racket[provide] exports @racket[_id], it uses a + symbol-valued @indexed-racket['nominal-id] property of + @racket[id-stx] to specify the ``nominal source identifier'' of the binding as reported by @racket[identifier-binding].} - @item{If @scheme[id-stx] has a true value for the - @indexed-scheme['not-provide-all-defined] @tech{syntax + @item{If @racket[id-stx] has a true value for the + @indexed-racket['not-provide-all-defined] @tech{syntax property}, then @racket[_id] (or its target) is not exported by - @scheme[all-defined-out].} + @racket[all-defined-out].} - @item{The @scheme[syntax-local-value] and - @scheme[syntax-local-make-delta-introducer] functions recognize + @item{The @racket[syntax-local-value] and + @racket[syntax-local-make-delta-introducer] functions recognize rename-transformer bindings and consult their targets.} ]} @@ -153,30 +153,30 @@ rename transformer: @defproc[(rename-transformer-target [transformer rename-transformer?]) identifier?]{ -Returns the identifier passed to @scheme[make-rename-transformer] to -create @scheme[transformer] or as indicated by a -@scheme[prop:rename-transformer] property on @scheme[transformer].} +Returns the identifier passed to @racket[make-rename-transformer] to +create @racket[transformer] or as indicated by a +@racket[prop:rename-transformer] property on @racket[transformer].} @defthing[prop:rename-transformer struct-type-property?]{ A @tech{structure type property} to identify structure types that act as @tech{rename transformers} like the ones created by -@scheme[make-rename-transformer]. +@racket[make-rename-transformer]. The property value must be an exact integer or an identifier @tech{syntax object}. In the former case, the integer designates a field within the structure that should contain an identifier; the -integer must be between @scheme[0] (inclusive) and the number of +integer must be between @racket[0] (inclusive) and the number of non-automatic fields in the structure type (exclusive, not counting supertype fields), and the designated field must also be specified as immutable. If the property value is an identifier, the identifier serves as the target for renaming, just like the first argument to -@scheme[make-rename-transformer]. If the property value is an integer, +@racket[make-rename-transformer]. If the property value is an integer, the target identifier is extracted from the structure instance; if the -field value is not an identifier, then an identifier @schemeidfont{?} +field value is not an identifier, then an identifier @racketidfont{?} with an empty context is used, instead.} @@ -190,48 +190,48 @@ with an empty context is used, instead.} #f]) syntax?]{ -Expands @scheme[stx] in the lexical context of the expression -currently being expanded. The @scheme[context-v] argument is used as -the result of @scheme[syntax-local-context] for immediate expansions; +Expands @racket[stx] in the lexical context of the expression +currently being expanded. The @racket[context-v] argument is used as +the result of @racket[syntax-local-context] for immediate expansions; for a particular @tech{internal-definition context}, generate a unique -value and @scheme[cons] it onto the current result of -@scheme[syntax-local-context] if it is a list. +value and @racket[cons] it onto the current result of +@racket[syntax-local-context] if it is a list. -When an identifier in @scheme[stop-ids] is encountered by the expander +When an identifier in @racket[stop-ids] is encountered by the expander in a sub-expression, expansions stops for the sub-expression. If -@scheme[stop-ids] is a non-empty list, then -@scheme[begin], @scheme[quote], @scheme[set!], @scheme[lambda], -@scheme[case-lambda], @scheme[let-values], @scheme[letrec-values], -@scheme[if], @scheme[begin0], @scheme[with-continuation-mark], -@scheme[letrec-syntaxes+values], @scheme[#%app], -@scheme[#%expression], @scheme[#%top], and -@scheme[#%variable-reference] are added to @scheme[stop-ids]. If -@scheme[#%app], @scheme[#%top], or @scheme[#%datum] appears in -@scheme[stop-ids], then application, top-level variable reference, and +@racket[stop-ids] is a non-empty list, then +@racket[begin], @racket[quote], @racket[set!], @racket[lambda], +@racket[case-lambda], @racket[let-values], @racket[letrec-values], +@racket[if], @racket[begin0], @racket[with-continuation-mark], +@racket[letrec-syntaxes+values], @racket[#%app], +@racket[#%expression], @racket[#%top], and +@racket[#%variable-reference] are added to @racket[stop-ids]. If +@racket[#%app], @racket[#%top], or @racket[#%datum] appears in +@racket[stop-ids], then application, top-level variable reference, and literal data expressions without the respective explicit form are not -wrapped with the explicit form. If @scheme[stop-ids] is @scheme[#f] -instead of a list, then @scheme[stx] is expanded only as long as the -outermost form of @scheme[stx] is a macro (i.e., expansion does not +wrapped with the explicit form. If @racket[stop-ids] is @racket[#f] +instead of a list, then @racket[stx] is expanded only as long as the +outermost form of @racket[stx] is a macro (i.e., expansion does not proceed to sub-expressions). A fully expanded form can include the bindings listed in @secref["fully-expanded"] plus the -@scheme[letrec-syntaxes+values] form. +@racket[letrec-syntaxes+values] form. -The optional @scheme[intdef-ctx] argument must be either @scheme[#f], -the result of @scheme[syntax-local-make-definition-context], or a list +The optional @racket[intdef-ctx] argument must be either @racket[#f], +the result of @racket[syntax-local-make-definition-context], or a list of such results. In the latter two cases, lexical information for -internal definitions is added to @scheme[stx] before it is expanded +internal definitions is added to @racket[stx] before it is expanded (in reverse order relative to the list). The lexical information is also added to the expansion result (because the expansion might introduce bindings or references to internal-definition bindings). -Expansion of @scheme[stx] can use certificates for the expression +Expansion of @racket[stx] can use certificates for the expression already being expanded (see @secref["stxcerts"]), and @tech{inactive -certificates} associated with @scheme[stx] are activated for -@scheme[stx] (see @secref["stxcerts"]). Furthermore, if the +certificates} associated with @racket[stx] are activated for +@racket[stx] (see @secref["stxcerts"]). Furthermore, if the transformer is defined within a module (i.e., the current expansion was triggered by a use of a module-defined identifier with a @tech{transformer binding}) or if the current expression is being -expanded for the body of a module, then the expansion of @scheme[stx] +expanded for the body of a module, then the expansion of @racket[stx] can use any identifier defined by the module. @transform-time[] @@ -265,7 +265,7 @@ can use any identifier defined by the module. @defproc[(syntax-local-expand-expression [stx syntax?]) (values syntax? syntax?)]{ -Like @scheme[local-expand] given @scheme['expression] and an empty +Like @racket[local-expand] given @racket['expression] and an empty stop list, but with two results: a syntax object for the fully expanded expression, and a syntax object whose content is opaque. The latter can be used in place of the former (perhaps in a larger @@ -275,7 +275,7 @@ expanded expression without re-expanding it; the @exnraise[exn:fail:syntax] if the expansion context includes bindings or marks that were not present for the original expansion, in which case re-expansion might produce different results. Consistent use of -@scheme[syntax-local-expand-expression] and the opaque object thus +@racket[syntax-local-expand-expression] and the opaque object thus avoids quadratic expansion times when local expansions are nested. @transform-time[]} @@ -287,11 +287,11 @@ avoids quadratic expansion times when local expansions are nested. [intdef-ctx (or/c internal-definition-context? #f) #f]) syntax?]{ -Like @scheme[local-expand], but @scheme[stx] is expanded as a +Like @racket[local-expand], but @racket[stx] is expanded as a transformer expression instead of a run-time expression, and any lifted expressions---from calls to -@scheme[syntax-local-lift-expression] during the expansion of -@scheme[stx]---are captured into a @scheme[let-values] form in the +@racket[syntax-local-lift-expression] during the expansion of +@racket[stx]---are captured into a @racket[let-values] form in the result.} @@ -302,15 +302,15 @@ result.} [lift-ctx any/c (gensym 'lifts)]) syntax?]{ -Like @scheme[local-expand], but the result is a syntax object that -represents a @scheme[begin] expression. Lifted expressions---from -calls to @scheme[syntax-local-lift-expression] during the expansion of -@scheme[stx]---appear with their identifiers in @scheme[define-values] -forms, and the expansion of @scheme[stx] is the last expression in the -@scheme[begin]. The @scheme[lift-ctx] value is reported by -@scheme[syntax-local-lift-context] during local expansion. The lifted +Like @racket[local-expand], but the result is a syntax object that +represents a @racket[begin] expression. Lifted expressions---from +calls to @racket[syntax-local-lift-expression] during the expansion of +@racket[stx]---appear with their identifiers in @racket[define-values] +forms, and the expansion of @racket[stx] is the last expression in the +@racket[begin]. The @racket[lift-ctx] value is reported by +@racket[syntax-local-lift-context] during local expansion. The lifted expressions are not expanded, but instead left as provided in the -@scheme[begin] form.} +@racket[begin] form.} @defproc[(local-transformer-expand/capture-lifts [stx syntax?] @@ -319,16 +319,16 @@ expressions are not expanded, but instead left as provided in the [intdef-ctx (or/c internal-definition-context? #f) #f]) syntax?]{ -Like @scheme[local-expand/capture-lifts], but @scheme[stx] is expanded +Like @racket[local-expand/capture-lifts], but @racket[stx] is expanded as a transformer expression instead of a run-time expression. Lifted -expressions are reported as @scheme[define-values] forms (in the +expressions are reported as @racket[define-values] forms (in the transformer environment).} @defproc[(internal-definition-context? [v any/c]) boolean?]{ -Returns @scheme[#t] if @scheme[v] is an @tech{internal-definition -context}, @scheme[#f] otherwise.} +Returns @racket[#t] if @racket[v] is an @tech{internal-definition +context}, @racket[#f] otherwise.} @defproc[(syntax-local-make-definition-context @@ -336,21 +336,21 @@ context}, @scheme[#f] otherwise.} internal-definition-context?]{ Creates an opaque @tech{internal-definition context} value to be used -with @scheme[local-expand] and other functions. A transformer should +with @racket[local-expand] and other functions. A transformer should create one context for each set of internal definitions to be expanded, and use it when expanding any form whose lexical context should include the definitions. After discovering an internal -@scheme[define-values] or @scheme[define-syntaxes] form, use -@scheme[syntax-local-bind-syntaxes] to add bindings to the context. +@racket[define-values] or @racket[define-syntaxes] form, use +@racket[syntax-local-bind-syntaxes] to add bindings to the context. Finally, the transformer must call -@scheme[internal-definition-context-seal] after all bindings have been +@racket[internal-definition-context-seal] after all bindings have been added; if an unsealed @tech{internal-definition context} is detected in a fully expanded expression, the @exnraise[exn:fail:contract]. -If @scheme[intdef-ctx] is not @scheme[#f], then the new +If @racket[intdef-ctx] is not @racket[#f], then the new internal-definition context extends the given one. That is, expanding in the new internal-definition context can use bindings previously -introduced into @scheme[intdef-ctx]. +introduced into @racket[intdef-ctx]. @transform-time[]} @@ -360,13 +360,13 @@ introduced into @scheme[intdef-ctx]. [intdef-ctx internal-definition-context?]) void?]{ -Binds each identifier in @scheme[id-list] within the -@tech{internal-definition context} represented by @scheme[intdef-ctx], where -@scheme[intdef-ctx] is the result of -@scheme[syntax-local-make-definition-context]. Supply @scheme[#f] for -@scheme[expr] when the identifiers correspond to -@scheme[define-values] bindings, and supply a compile-time expression -when the identifiers correspond to @scheme[define-syntaxes] bindings; +Binds each identifier in @racket[id-list] within the +@tech{internal-definition context} represented by @racket[intdef-ctx], where +@racket[intdef-ctx] is the result of +@racket[syntax-local-make-definition-context]. Supply @racket[#f] for +@racket[expr] when the identifiers correspond to +@racket[define-values] bindings, and supply a compile-time expression +when the identifiers correspond to @racket[define-syntaxes] bindings; in the latter case, the number of values produced by the expression should match the number of identifiers, otherwise the @exnraise[exn:fail:contract:arity]. @@ -378,8 +378,8 @@ match the number of identifiers, otherwise the void?]{ Indicates that no further bindings will be added to -@scheme[intdef-ctx], which must not be sealed already. See also -@scheme[syntax-local-make-definition-context].} +@racket[intdef-ctx], which must not be sealed already. See also +@racket[syntax-local-make-definition-context].} @defproc[(identifier-remove-from-definition-context [id-stx identifier?] @@ -387,8 +387,8 @@ Indicates that no further bindings will be added to (listof internal-definition-context?))]) identifier?]{ -Removes @scheme[intdef-ctx] (or each identifier in the list) from the -@tech{lexical information} of @scheme[id-stx]. This operation is +Removes @racket[intdef-ctx] (or each identifier in the list) from the +@tech{lexical information} of @racket[id-stx]. This operation is useful for correlating an identifier that is bound in an internal-definition context with its binding before the internal-definition context was created. @@ -397,7 +397,7 @@ If simply removing the contexts produces a different binding than completely ignoring the contexts (due to nested internal definition contexts, for example), then the resulting identifier is given a @tech{syntax mark} to simulate a non-existent lexical context. The -@scheme[intdef-ctx] argument can be a list because removing +@racket[intdef-ctx] argument can be a list because removing internal-definition contexts one at a time can produce a different intermediate binding than removing them all at once.} @@ -410,32 +410,32 @@ intermediate binding than removing them all at once.} #f]) any]{ -Returns the @tech{transformer binding} value of @scheme[id-stx] in -either the context associated with @scheme[intdef-ctx] (if not -@scheme[#f]) or the context of the expression being expanded (if -@scheme[intdef-ctx] is @scheme[#f]). If @scheme[intdef-ctx] is +Returns the @tech{transformer binding} value of @racket[id-stx] in +either the context associated with @racket[intdef-ctx] (if not +@racket[#f]) or the context of the expression being expanded (if +@racket[intdef-ctx] is @racket[#f]). If @racket[intdef-ctx] is provided, it must be an extension of the context of the expression being expanded. -If @scheme[id-stx] is bound to a @tech{rename transformer} created -with @scheme[make-rename-transformer], @scheme[syntax-local-value] +If @racket[id-stx] is bound to a @tech{rename transformer} created +with @racket[make-rename-transformer], @racket[syntax-local-value] effectively calls itself with the target of the rename and returns that result, instead of the @tech{rename transformer}. -If @scheme[id-stx] has no @tech{transformer binding} (via -@scheme[define-syntax], @scheme[let-syntax], etc.) in that -environment, the result is obtained by applying @scheme[failure-thunk] -if not @scheme[#f]. If @scheme[failure-thunk] is @scheme[false], the +If @racket[id-stx] has no @tech{transformer binding} (via +@racket[define-syntax], @racket[let-syntax], etc.) in that +environment, the result is obtained by applying @racket[failure-thunk] +if not @racket[#f]. If @racket[failure-thunk] is @racket[false], the @exnraise[exn:fail:contract]. -Resolving @scheme[id-stx] can use certificates for the expression +Resolving @racket[id-stx] can use certificates for the expression being transformed (see @secref["stxcerts"]) as well as @tech{inactive -certificates} associated with @scheme[id-stx] (see +certificates} associated with @racket[id-stx] (see @secref["stxcerts"]). Furthermore, if the transformer is defined within a module (i.e., the current transformation was triggered by a use of a module-defined identifier) or if the current expression is being expanded for the body of a module, then resolving -@scheme[id-stx] can access any identifier defined by the module. +@racket[id-stx] can access any identifier defined by the module. @transform-time[]} @@ -448,53 +448,53 @@ being expanded for the body of a module, then resolving #f]) any]{ -Like @scheme[syntax-local-value], but the result is normally two -values. If @scheme[id-stx] is bound to a @tech{rename transformer}, +Like @racket[syntax-local-value], but the result is normally two +values. If @racket[id-stx] is bound to a @tech{rename transformer}, the results are the rename transformer and the identifier in the transformer augmented with certificates from -@scheme[id-stx]. @margin-note*{Beware that @racket[provide] on an +@racket[id-stx]. @margin-note*{Beware that @racket[provide] on an @racket[_id] bound to a @tech{rename transformer} may export the target of the rename instead of @racket[_id]. See @racket[make-rename-transformer] for more information.} If -@scheme[id-stx] is not bound to a @tech{rename transformer}, then the -results are the value that @scheme[syntax-local-value] would produce -and @scheme[#f]. +@racket[id-stx] is not bound to a @tech{rename transformer}, then the +results are the value that @racket[syntax-local-value] would produce +and @racket[#f]. -If @scheme[id-stx] has no transformer binding, then -@scheme[failure-thunk] is called (and it can return any number of -values), or an exception is raised if @scheme[failure-thunk] is -@scheme[#f].} +If @racket[id-stx] has no transformer binding, then +@racket[failure-thunk] is called (and it can return any number of +values), or an exception is raised if @racket[failure-thunk] is +@racket[#f].} @defproc[(syntax-local-lift-expression [stx syntax?]) identifier?]{ -Returns a fresh identifier, and cooperates with the @scheme[module], -@scheme[letrec-syntaxes+values], @scheme[define-syntaxes], -@scheme[begin-for-syntax], and top-level expanders to bind the -generated identifier to the expression @scheme[stx]. +Returns a fresh identifier, and cooperates with the @racket[module], +@racket[letrec-syntaxes+values], @racket[define-syntaxes], +@racket[begin-for-syntax], and top-level expanders to bind the +generated identifier to the expression @racket[stx]. A run-time expression within a module is lifted to the module's top level, just before the expression whose expansion requests the lift. Similarly, a run-time expression outside of a module is lifted to a top-level definition. A compile-time expression in a -@scheme[letrec-syntaxes+values] or @scheme[define-syntaxes] binding is -lifted to a @scheme[let] wrapper around the corresponding right-hand +@racket[letrec-syntaxes+values] or @racket[define-syntaxes] binding is +lifted to a @racket[let] wrapper around the corresponding right-hand side of the binding. A compile-time expression within -@scheme[begin-for-syntax] is lifted to a @scheme[define-for-syntax] +@racket[begin-for-syntax] is lifted to a @racket[define-for-syntax] declaration just before the requesting expression. Other syntactic forms can capture lifts by using -@scheme[local-expand/capture-lifts] or -@scheme[local-transformer-expand/capture-lifts]. +@racket[local-expand/capture-lifts] or +@racket[local-transformer-expand/capture-lifts]. @transform-time[]} @defproc[(syntax-local-lift-values-expression [n exact-nonnegative-integer?] [stx syntax?]) (listof identifier?)]{ -Like @scheme[syntax-local-lift-expression], but binds the result to -@scheme[n] identifiers, and returns a list of the @scheme[n] +Like @racket[syntax-local-lift-expression], but binds the result to +@racket[n] identifiers, and returns a list of the @racket[n] identifiers. @transform-time[]} @@ -504,9 +504,9 @@ identifiers. any/c]{ Returns a value that represents the target for expressions lifted via -@scheme[syntax-local-lift-expression]. That is, for different +@racket[syntax-local-lift-expression]. That is, for different transformer calls for which this procedure returns the same value (as -determined by @scheme[eq?]), lifted expressions for the two +determined by @racket[eq?]), lifted expressions for the two transformer are moved to the same place. Thus, the result is useful for caching lift information to avoid redundant lifts. @@ -516,33 +516,33 @@ for caching lift information to avoid redundant lifts. @defproc[(syntax-local-lift-module-end-declaration [stx syntax?]) void?]{ -Cooperates with the @scheme[module] form to insert @scheme[stx] as +Cooperates with the @racket[module] form to insert @racket[stx] as a top-level declaration at the end of the module currently being expanded. If the current expression being -transformed is not in the module top-level, then @scheme[stx] is +transformed is not in the module top-level, then @racket[stx] is eventually expanded in an expression context. @transform-time[] If the current expression being transformed is not -within a @scheme[module] form, or if it is not a run-time expression, +within a @racket[module] form, or if it is not a run-time expression, then the @exnraise[exn:fail:contract].} @defproc[(syntax-local-lift-require [raw-require-spec any/c] [stx syntax?]) syntax?]{ -Lifts a @scheme[#%require] form corresponding to -@scheme[raw-require-spec] (either as a @tech{syntax object} or datum) +Lifts a @racket[#%require] form corresponding to +@racket[raw-require-spec] (either as a @tech{syntax object} or datum) to the top-level or to the top of the module currently being expanded, -wrapping it with @scheme[for-meta] if the current expansion context is +wrapping it with @racket[for-meta] if the current expansion context is not @tech{phase level} 0. -The resulting syntax object is the same as @scheme[stx], except that a +The resulting syntax object is the same as @racket[stx], except that a fresh @tech{syntax mark} is added. The same @tech{syntax mark} is -added to the lifted @scheme[#%require] form, so that the -@scheme[#%require] form can bind uses of imported identifiers in the +added to the lifted @racket[#%require] form, so that the +@racket[#%require] form can bind uses of imported identifiers in the resulting syntax object (assuming that the lexical information of -@scheme[stx] includes the binding environment into which the -@scheme[#%require] is lifted). +@racket[stx] includes the binding environment into which the +@racket[#%require] is lifted). If @racket[raw-require-spec] and @racket[stx] are part of the input to a transformer, then typically @racket[syntax-local-introduce] should be @@ -557,18 +557,18 @@ by the macro expander can prevent access to the new imports. @defproc[(syntax-local-lift-provide [raw-provide-spec-stx syntax?]) void?]{ -Lifts a @scheme[#%provide] form corresponding to -@scheme[raw-provide-spec-stx] to the top of the module currently being +Lifts a @racket[#%provide] form corresponding to +@racket[raw-provide-spec-stx] to the top of the module currently being expanded. @transform-time[] If the current expression being transformed is not -within a @scheme[module] form, or if it is not a run-time expression, +within a @racket[module] form, or if it is not a run-time expression, then the @exnraise[exn:fail:contract]. } @defproc[(syntax-local-name) any/c]{ Returns an inferred name for the expression position being -transformed, or @scheme[#f] if no such name is available. A name is +transformed, or @racket[#f] if no such name is available. A name is normally a symbol or an identifier. See also @secref["infernames"]. @transform-time[]} @@ -587,7 +587,7 @@ an @tech{expression context}, a @tech{top-level context}, a A list result indicates expansion in an @tech{internal-definition context}. The identity of the list's first element (i.e., its -@scheme[eq?]ness) reflects the identity of the internal-definition +@racket[eq?]ness) reflects the identity of the internal-definition context; in particular two transformer expansions receive the same first value if and only if they are invoked for the same @tech{internal-definition context}. Later values in the list similarly @@ -602,14 +602,14 @@ contexts. During the dynamic extent of a @tech{syntax transformer} application by the expander, the result is the @tech{phase level} of the form -being expanded. Otherwise, the result is @scheme[0].} +being expanded. Otherwise, the result is @racket[0].} @defproc[(syntax-local-module-exports [mod-path module-path?]) (values (listof symbol?) (listof symbol?) (listof symbol?))]{ -Returns three lists of symbols that represent the @scheme[provide]d -bindings of the module named by @scheme[mod-path]. The first list +Returns three lists of symbols that represent the @racket[provide]d +bindings of the module named by @racket[mod-path]. The first list corresponds to the @tech{phase level} 0 exports of the module, the second list corresponds to the @tech{phase level} -1 exports of the module, and the last list corresponds to the @tech{label phase level} @@ -620,27 +620,27 @@ exports of the module. @defproc[(syntax-local-get-shadower [id-stx identifier?]) identifier?]{ -Returns @scheme[id-stx] if no binding in the current expansion context -shadows @scheme[id-stx] (ignoring unsealed @tech{internal-definition -contexts} and identifiers that had the @indexed-scheme['unshadowable] -@tech{syntax property}), if @scheme[id-stx] has no module bindings in +Returns @racket[id-stx] if no binding in the current expansion context +shadows @racket[id-stx] (ignoring unsealed @tech{internal-definition +contexts} and identifiers that had the @indexed-racket['unshadowable] +@tech{syntax property}), if @racket[id-stx] has no module bindings in its lexical information, and if the current expansion context is not a @tech{module context}. -If a binding of @scheme[inner-identifier] shadows @scheme[id-stx], the -result is the same as @scheme[(syntax-local-get-shadower +If a binding of @racket[inner-identifier] shadows @racket[id-stx], the +result is the same as @racket[(syntax-local-get-shadower inner-identifier)], except that it has the location and properties of -@scheme[id-stx]. When searching for a shadowing binding, bindings from +@racket[id-stx]. When searching for a shadowing binding, bindings from unsealed @tech{internal-definition contexts} are ignored. -Otherwise, the result is the same as @scheme[id-stx] with its module +Otherwise, the result is the same as @racket[id-stx] with its module bindings (if any) removed from its lexical information, and the lexical information of the current @tech{module context} (if any) added. Thus, the result is an identifier corresponding to the innermost -shadowing of @scheme[id-stx] in the current context if it is shadowed, -and a module-contextless version of @scheme[id-stx] otherwise. +shadowing of @racket[id-stx] in the current context if it is shadowed, +and a module-contextless version of @racket[id-stx] otherwise. @transform-time[]} @@ -650,24 +650,24 @@ and a module-contextless version of @scheme[id-stx] otherwise. . ->* . syntax?)]{ Returns a procedure that captures any certificates currently available -for @scheme[syntax-local-value] or @scheme[local-expand]. The -procedure accepts one to three arguments: @scheme[_stx] (required), -@scheme[_key] (optional), and @scheme[_intro] (optional). The -procedure's result is a syntax object like @scheme[stx], except that +for @racket[syntax-local-value] or @racket[local-expand]. The +procedure accepts one to three arguments: @racket[_stx] (required), +@racket[_key] (optional), and @racket[_intro] (optional). The +procedure's result is a syntax object like @racket[stx], except that it includes the captured certificates as inactive (see -@secref["stxcerts"]) if @scheme[active?] is @scheme[#f] (the default) -or active otherwise. If @scheme[key] is supplied and not @scheme[#f], +@secref["stxcerts"]) if @racket[active?] is @racket[#f] (the default) +or active otherwise. If @racket[key] is supplied and not @racket[#f], it is associated with each captured certificate for later use through -@scheme[syntax-recertify]. If @scheme[_intro] is supplied, and if it -is not @scheme[#f] (the default), then it must be a procedure created -by @scheme[make-syntax-introducer], in which case the certificate -applies only to parts of @scheme[stx] that are marked as introduced by -@scheme[_intro]. +@racket[syntax-recertify]. If @racket[_intro] is supplied, and if it +is not @racket[#f] (the default), then it must be a procedure created +by @racket[make-syntax-introducer], in which case the certificate +applies only to parts of @racket[stx] that are marked as introduced by +@racket[_intro]. -Supply @scheme[#t] for @scheme[active?] when the syntax to be +Supply @racket[#t] for @racket[active?] when the syntax to be certified can be safely used in any context by any party, and where access to the syntax object should not confer any additional -access. Supply @scheme[#f] for @scheme[active?] when the syntax to be +access. Supply @racket[#f] for @racket[active?] when the syntax to be certified is not accessible to parties that might abuse the access that the certificate provides, and when the certified syntax eventually appears (via macro expansion) within a larger expression @@ -677,15 +677,15 @@ from which it cannot be safely extracted by other parties. @defproc[(syntax-transforming?) boolean?]{ -Returns @scheme[#t] during the dynamic extent of a @tech{syntax -transformer} application by the expander, @scheme[#f] otherwise.} +Returns @racket[#t] during the dynamic extent of a @tech{syntax +transformer} application by the expander, @racket[#f] otherwise.} @defproc[(syntax-local-introduce [stx syntax?]) syntax?]{ -Produces a syntax object that is like @scheme[stx], except that a +Produces a syntax object that is like @racket[stx], except that a @tech{syntax mark} for the current expansion is added (possibly -canceling an existing mark in parts of @scheme[stx]). See +canceling an existing mark in parts of @racket[stx]). See @secref["transformer-model"] for information on @tech{syntax marks}. @@ -695,9 +695,9 @@ marks}. @defproc[(make-syntax-introducer) (syntax? . -> . syntax?)]{ Produces a procedure that behaves like -@scheme[syntax-local-introduce], but using a fresh @tech{syntax +@racket[syntax-local-introduce], but using a fresh @tech{syntax mark}. Multiple applications of the same -@scheme[make-syntax-introducer] result procedure use the same mark, +@racket[make-syntax-introducer] result procedure use the same mark, and different result procedures use distinct marks.} @defproc[(make-syntax-delta-introducer [ext-stx syntax?] @@ -707,64 +707,64 @@ and different result procedures use distinct marks.} (syntax? . -> . syntax?)]{ Produces a procedure that behaves like -@scheme[syntax-local-introduce], but using the @tech{syntax marks} of -@scheme[ext-stx] that are not shared with @scheme[base-stx]. If -@scheme[ext-stx] does not extend the set of marks in @scheme[base-stx] -or if @scheme[base-stx] is @scheme[#f], and if @scheme[ext-stx] has a +@racket[syntax-local-introduce], but using the @tech{syntax marks} of +@racket[ext-stx] that are not shared with @racket[base-stx]. If +@racket[ext-stx] does not extend the set of marks in @racket[base-stx] +or if @racket[base-stx] is @racket[#f], and if @racket[ext-stx] has a module binding in the @tech{phase level} indicated by -@scheme[phase-level], then any marks of @scheme[ext-stx] that would be +@racket[phase-level], then any marks of @racket[ext-stx] that would be needed to preserve its binding are not transferred in an introduction. -This procedure is potentially useful when @scheme[_m-id] has a -transformer binding that records some @scheme[_orig-id], and a use of -@scheme[_m-id] introduces a binding of @scheme[_orig-id]. In that -case, the @tech{syntax marks} in the use of @scheme[_m-id] since the -binding of @scheme[_m-id] should be transferred to the binding -instance of @scheme[_orig-id], so that it captures uses with the same -lexical context as the use of @scheme[_m-id]. +This procedure is potentially useful when @racket[_m-id] has a +transformer binding that records some @racket[_orig-id], and a use of +@racket[_m-id] introduces a binding of @racket[_orig-id]. In that +case, the @tech{syntax marks} in the use of @racket[_m-id] since the +binding of @racket[_m-id] should be transferred to the binding +instance of @racket[_orig-id], so that it captures uses with the same +lexical context as the use of @racket[_m-id]. -More typically, however, @scheme[syntax-local-make-delta-introducer] +More typically, however, @racket[syntax-local-make-delta-introducer] should be used, since it cooperates with @tech{rename transformers}.} @defproc[(syntax-local-make-delta-introducer [id identifier?]) (identifier? . -> . identifier?)]{ -Determines the binding of @scheme[id]. If the binding is not a +Determines the binding of @racket[id]. If the binding is not a @tech{rename transformer}, the result is an introducer as created by -@scheme[make-syntax-delta-introducer] using @scheme[id] and the -binding of @scheme[id] in the environment of expansion. If the binding +@racket[make-syntax-delta-introducer] using @racket[id] and the +binding of @racket[id] in the environment of expansion. If the binding is a @tech{rename transformer}, then the introducer is one composed with the target of the @tech{rename transformer} and its -binding. Furthermore, the @scheme[_delta-introduce] functions +binding. Furthermore, the @racket[_delta-introduce] functions associated with the @tech{rename transformers} (supplied as the second -argument to @scheme[make-rename-transformer]) are composed (in +argument to @racket[make-rename-transformer]) are composed (in first-to-last order) before the introducers created with -@scheme[make-syntax-delta-introducer] (which are composed +@racket[make-syntax-delta-introducer] (which are composed last-to-first). -The @exnraise[exn:fail:contract] if @scheme[id] or any identifier in +The @exnraise[exn:fail:contract] if @racket[id] or any identifier in its rename-transformer chain has no binding. @transform-time[]} - + @defproc[(syntax-local-transforming-module-provides?) boolean?]{ -Returns @scheme[#t] while a @tech{provide transformer} is running (see -@scheme[make-provide-transformer]) or while an @schemeidfont{expand} sub-form of -@scheme[#%provide] is expanded, @scheme[#f] otherwise.} +Returns @racket[#t] while a @tech{provide transformer} is running (see +@racket[make-provide-transformer]) or while an @racketidfont{expand} sub-form of +@racket[#%provide] is expanded, @racket[#f] otherwise.} @defproc[(syntax-local-module-defined-identifiers) (values (listof identifier?) (listof identifier?))]{ Can be called only while -@scheme[syntax-local-transforming-module-provides?] returns -@scheme[#t]. +@racket[syntax-local-transforming-module-provides?] returns +@racket[#t]. It returns two lists of identifiers corresponding to all definitions within the module being expanded. This information is used for -implementing @scheme[provide] sub-forms like @scheme[all-defined-out]. +implementing @racket[provide] sub-forms like @racket[all-defined-out]. The first result list corresponds to @tech{phase} 0 (i.e., normal) definitions, and the second corresponds to @tech{phase} -1 (i.e., @@ -778,50 +778,50 @@ for-syntax) definitions.} (listof identifier?)))]{ Can be called only while -@scheme[syntax-local-transforming-module-provides?] returns -@scheme[#t]. +@racket[syntax-local-transforming-module-provides?] returns +@racket[#t]. It returns an association list mapping phase levels to lists of identifiers. Each list of identifiers includes all bindings imported (into the module being expanded) using the module path -@scheme[mod-path], or all modules if @scheme[mod-path] is -@scheme[#f]. The association list includes all identifiers imported -with a @scheme[phase-level] shift, of all shifts if -@scheme[phase-level] is @scheme[#t]. +@racket[mod-path], or all modules if @racket[mod-path] is +@racket[#f]. The association list includes all identifiers imported +with a @racket[phase-level] shift, of all shifts if +@racket[phase-level] is @racket[#t]. When an identifier is renamed on import, the result association list includes the identifier by its internal name. Use -@scheme[identifier-binding] to obtain more information about the +@racket[identifier-binding] to obtain more information about the identifier.} @; ---------------------------------------------------------------------- -@section[#:tag "require-trans"]{@scheme[require] Transformers} +@section[#:tag "require-trans"]{@racket[require] Transformers} @note-lib-only[racket/require-transform] A @tech{transformer binding} whose value is a structure with the -@scheme[prop:require-transformer] property implements a derived -@scheme[_require-spec] for @scheme[require]. +@racket[prop:require-transformer] property implements a derived +@racket[_require-spec] for @racket[require]. The transformer is called with the syntax object representing its use -as a @scheme[_require-spec] within a @scheme[require] form, and the -result must be two lists: a list of @scheme[import]s and a list of -@scheme[import-source]s. +as a @racket[_require-spec] within a @racket[require] form, and the +result must be two lists: a list of @racket[import]s and a list of +@racket[import-source]s. If the derived form contains a sub-form that is a -@scheme[_require-spec], then it can call @scheme[expand-import] to -transform the sub-@scheme[_require-spec] to lists of imports and +@racket[_require-spec], then it can call @racket[expand-import] to +transform the sub-@racket[_require-spec] to lists of imports and import sources. -See also @scheme[define-require-syntax], which supports macro-style -@scheme[require] transformers. +See also @racket[define-require-syntax], which supports macro-style +@racket[require] transformers. @defproc[(expand-import [stx syntax?]) (values (listof import?) (listof import-source?))]{ -Expands the given @scheme[_require-spec] to lists of imports and +Expands the given @racket[_require-spec] to lists of imports and import sources. The latter specifies modules to be @tech{instantiate}d or @tech{visit}ed, so the modules that it represents should be a superset of the modules represented in the @@ -836,21 +836,21 @@ former list).} require-transformer?]{ Creates a @deftech{require transformer} (i.e., a structure with the -@scheme[prop:require-transformer] property) using the given procedure +@racket[prop:require-transformer] property) using the given procedure as the transformer.} @defthing[prop:require-transformer struct-type-property?]{ -A property to identify @scheme[require] transformers. The property +A property to identify @racket[require] transformers. The property value must be a procedure that takes a syntax object and returns import and import-source lists.} @defproc[(require-transformer? [v any/c]) boolean?]{ -Returns @scheme[#t] if @scheme[v] has the -@scheme[prop:require-transformer] property, @scheme[#f] otherwise.} +Returns @racket[#t] if @racket[v] has the +@racket[prop:require-transformer] property, @racket[#f] otherwise.} @defstruct[import ([local-id identifier?] @@ -865,25 +865,25 @@ A structure representing a single imported identifier: @itemize[ - @item{@scheme[local-id] --- the identifier to be bound within the + @item{@racket[local-id] --- the identifier to be bound within the importing module.} - @item{@scheme[src-sym] --- the external name of the binding as + @item{@racket[src-sym] --- the external name of the binding as exported from its source module.} - @item{@scheme[src-mod-path] --- a @tech{module path} (relative to the + @item{@racket[src-mod-path] --- a @tech{module path} (relative to the importing module) for the source of the imported binding.} - @item{@scheme[orig-stx] --- a @tech{syntax object} for the source of + @item{@racket[orig-stx] --- a @tech{syntax object} for the source of the import, used for error reporting.} - @item{@scheme[mode] --- the @tech{phase level} of the binding in the + @item{@racket[mode] --- the @tech{phase level} of the binding in the importing module.} - @item{@scheme[req-mode] --- the @tech{phase level} shift of the + @item{@racket[req-mode] --- the @tech{phase level} shift of the import relative to the exporting module.} - @item{@scheme[orig-mode] --- the @tech{phase level} of the + @item{@racket[orig-mode] --- the @tech{phase level} of the binding as exported by the exporting module.} ]} @@ -900,10 +900,10 @@ into a module. @itemize[ - @item{@scheme[mod-path-stx] --- a @tech{module path} (relative + @item{@racket[mod-path-stx] --- a @tech{module path} (relative to the importing module) for the source of the imported binding.} - @item{@scheme[mode] --- the @tech{phase level} shift of the import.} + @item{@racket[mode] --- the @tech{phase level} shift of the import.} ]} @@ -912,44 +912,44 @@ into a module. ((syntax?) (or/c #f (syntax? . -> . syntax?)) . ->* . syntax?)]{ -Like @scheme[syntax-local-certifier], but to certify @tech{syntax -objects} that correspond to @scheme[require] sub-forms, so that -@scheme[expand-import] can deconstruct the @tech{syntax object} as +Like @racket[syntax-local-certifier], but to certify @tech{syntax +objects} that correspond to @racket[require] sub-forms, so that +@racket[expand-import] can deconstruct the @tech{syntax object} as necessary to expand it.} @; ---------------------------------------------------------------------- -@section[#:tag "provide-trans"]{@scheme[provide] Transformers} +@section[#:tag "provide-trans"]{@racket[provide] Transformers} @note-lib-only[racket/provide-transform] A @tech{transformer binding} whose value is a structure with the -@scheme[prop:provide-transformer] property implements a derived -@scheme[_provide-spec] for @scheme[provide]. +@racket[prop:provide-transformer] property implements a derived +@racket[_provide-spec] for @racket[provide]. The transformer is called with the syntax object representing its use -as a @scheme[_provide-spec] within a @scheme[provide] form and a list +as a @racket[_provide-spec] within a @racket[provide] form and a list of symbols representing the export modes specified by enclosing -@scheme[_provide-spec]s. The result must be a list of -@scheme[export]s. +@racket[_provide-spec]s. The result must be a list of +@racket[export]s. If the derived form contains a sub-form that is a -@scheme[_provide-spec], then it can call @scheme[expand-export] to -transform the sub-@scheme[_provide-spec] to a list of exports. +@racket[_provide-spec], then it can call @racket[expand-export] to +transform the sub-@racket[_provide-spec] to a list of exports. -See also @scheme[define-provide-syntax], which supports macro-style -@scheme[provide] transformers. +See also @racket[define-provide-syntax], which supports macro-style +@racket[provide] transformers. @defproc[(expand-export [stx syntax?] [modes (listof (or/c exact-integer? #f))]) (listof export?)]{ -Expands the given @scheme[_provide-spec] to a list of exports. The -@scheme[modes] list controls the expansion of -sub-@scheme[_provide-specs]; for example, an identifier refers to a -@tech{phase level} 0 binding unless the @scheme[modes] list specifies -otherwise. Normally, @scheme[modes] is either empty or contains a +Expands the given @racket[_provide-spec] to a list of exports. The +@racket[modes] list controls the expansion of +sub-@racket[_provide-specs]; for example, an identifier refers to a +@tech{phase level} 0 binding unless the @racket[modes] list specifies +otherwise. Normally, @racket[modes] is either empty or contains a single element.} @@ -958,21 +958,21 @@ single element.} provide-transformer?]{ Creates a @deftech{provide transformer} (i.e., a structure with the -@scheme[prop:provide-transformer] property) using the given procedure +@racket[prop:provide-transformer] property) using the given procedure as the transformer.} @defthing[prop:provide-transformer struct-type-property?]{ -A property to identify @scheme[provide] transformers. The property +A property to identify @racket[provide] transformers. The property value must be a procedure that takes a syntax object and mode list and returns an export list.} @defproc[(provide-transformer? [v any/c]) boolean?]{ -Returns @scheme[#t] if @scheme[v] has the -@scheme[prop:provide-transformer] property, @scheme[#f] otherwise.} +Returns @racket[#t] if @racket[v] has the +@racket[prop:provide-transformer] property, @racket[#f] otherwise.} @defstruct[export ([local-id identifier?] @@ -985,18 +985,18 @@ A structure representing a single imported identifier: @itemize[ - @item{@scheme[local-id] --- the identifier that is bound within the + @item{@racket[local-id] --- the identifier that is bound within the exporting module.} - @item{@scheme[out-sym] --- the external name of the binding.} + @item{@racket[out-sym] --- the external name of the binding.} - @item{@scheme[orig-stx] --- a @tech{syntax object} for the source of + @item{@racket[orig-stx] --- a @tech{syntax object} for the source of the export, used for error reporting.} - @item{@scheme[protect?] --- indicates whether the identifier should + @item{@racket[protect?] --- indicates whether the identifier should be protected (see @secref["modprotect"]).} - @item{@scheme[mode] --- the @tech{phase level} of the binding in the + @item{@racket[mode] --- the @tech{phase level} of the binding in the exporting module.} ]} @@ -1006,9 +1006,9 @@ A structure representing a single imported identifier: ((syntax?) (or/c #f (syntax? . -> . syntax?)) . ->* . syntax?)]{ -Like @scheme[syntax-local-certifier], but to certify @tech{syntax -objects} that correspond to @scheme[provide] sub-forms, so that -@scheme[expand-export] can deconstruct the @tech{syntax object} as +Like @racket[syntax-local-certifier], but to certify @tech{syntax +objects} that correspond to @racket[provide] sub-forms, so that +@racket[expand-export] can deconstruct the @tech{syntax object} as necessary to expand it.} @; ---------------------------------------------------------------------- diff --git a/collects/scribblings/reference/subprocess.scrbl b/collects/scribblings/reference/subprocess.scrbl index 67c18a4d2a..1d165bcba9 100644 --- a/collects/scribblings/reference/subprocess.scrbl +++ b/collects/scribblings/reference/subprocess.scrbl @@ -152,7 +152,7 @@ current platform: the process if the process still running.} @item{@racket[force?] is false, a group, on Unix or Mac OS X: The - same as when @racket[force?] is @scheme[#t], but when the group + same as when @racket[force?] is @racket[#t], but when the group is sent a signal, it is an interrupt signal instead of a kill signal.} diff --git a/collects/scribblings/reference/surrogate.scrbl b/collects/scribblings/reference/surrogate.scrbl index 7e7f3c1d69..d1548a61f5 100644 --- a/collects/scribblings/reference/surrogate.scrbl +++ b/collects/scribblings/reference/surrogate.scrbl @@ -2,10 +2,10 @@ @(require "mz.rkt" (for-label racket/surrogate racket/class)) @title{Surrogates} - + @note-lib-only[racket/surrogate] -The @schememodname[racket/surrogate] library provides an abstraction +The @racketmodname[racket/surrogate] library provides an abstraction for building an instance of the @deftech{proxy design pattern}. The pattern consists of two objects, a @defterm{host} and a @defterm{surrogate} object. The host object delegates method calls to @@ -22,31 +22,31 @@ surrogate. [arg-spec (id ...) id])]{ -If neither @scheme[override] nor @scheme[override-final] is specified -for a @scheme[method-id], then @scheme[override] is assumed. +If neither @racket[override] nor @racket[override-final] is specified +for a @racket[method-id], then @racket[override] is assumed. -The @scheme[surrogate] form produces four values: a host mixin (a +The @racket[surrogate] form produces four values: a host mixin (a procedure that accepts and returns a class), a host interface, a surrogate class, and a surrogate interface. -The host mixin adds one additional field, @scheme[surrogate], to its -argument. It also adds a getter method, @scheme[get-surrogate], and a -setter method, @scheme[set-surrogate], for changing the field. The -@scheme[set-surrogate] method accepts instances of the class returned by -the @racket[surrogate] form or @scheme[#f], and it updates the field with its -argument; then, @scheme[set-surrogate] calls the @scheme[on-disable-surrogate] on the -previous value of the field and @scheme[on-enable-surrogate] for the -new value of the field. The @scheme[get-surrogate] method returns the +The host mixin adds one additional field, @racket[surrogate], to its +argument. It also adds a getter method, @racket[get-surrogate], and a +setter method, @racket[set-surrogate], for changing the field. The +@racket[set-surrogate] method accepts instances of the class returned by +the @racket[surrogate] form or @racket[#f], and it updates the field with its +argument; then, @racket[set-surrogate] calls the @racket[on-disable-surrogate] on the +previous value of the field and @racket[on-enable-surrogate] for the +new value of the field. The @racket[get-surrogate] method returns the current value of the field. The host mixin has a single overriding method for each -@scheme[method-id] in the @scheme[surrogate] form. Each of these -methods is defined with a @scheme[case-lambda] with one arm for each -@scheme[arg-spec]. Each arm has the variables as arguments in the -@scheme[arg-spec]. The body of each method tests the -@scheme[surrogate] field. If it is @scheme[#f], the method just +@racket[method-id] in the @racket[surrogate] form. Each of these +methods is defined with a @racket[case-lambda] with one arm for each +@racket[arg-spec]. Each arm has the variables as arguments in the +@racket[arg-spec]. The body of each method tests the +@racket[surrogate] field. If it is @racket[#f], the method just returns the result of invoking the super or inner method. If the -@scheme[surrogate] field is not @scheme[#f], the corresponding method +@racket[surrogate] field is not @racket[#f], the corresponding method of the object in the field is invoked. This method receives the same arguments as the original method, plus two extras. The extra arguments come at the beginning of the argument list. The first is the original @@ -55,22 +55,22 @@ object. The second is a procedure that calls the super or inner method extension, or the method in an overriding class), with the arguments that the procedure receives. -The host interface has the names @scheme[set-surrogate], -@scheme[get-surrogate], and each of the @scheme[method-id]s in the +The host interface has the names @racket[set-surrogate], +@racket[get-surrogate], and each of the @racket[method-id]s in the original form. The surrogate class has a single public method for each -@scheme[method-id] in the @scheme[surrogate] form. These methods are +@racket[method-id] in the @racket[surrogate] form. These methods are invoked by classes constructed by the mixin. Each has a corresponding method signature, as described in the above paragraph. Each method just passes its argument along to the super procedure it receives. Note: if you derive a class from the surrogate class, do not both call -the @scheme[super] argument and the super method of the surrogate +the @racket[super] argument and the super method of the surrogate class itself. Only call one or the other, since the default methods -call the @scheme[super] argument. +call the @racket[super] argument. Finally, the interface contains all of the names specified in -surrogate's argument, plus @scheme[on-enable-surrogate] and -@scheme[on-disable-surrogate]. The class returned by -@scheme[surrogate] implements this interface.} +surrogate's argument, plus @racket[on-enable-surrogate] and +@racket[on-disable-surrogate]. The class returned by +@racket[surrogate] implements this interface.} diff --git a/collects/scribblings/reference/syntax-model.scrbl b/collects/scribblings/reference/syntax-model.scrbl index 5643732254..7b3154d872 100644 --- a/collects/scribblings/reference/syntax-model.scrbl +++ b/collects/scribblings/reference/syntax-model.scrbl @@ -184,7 +184,7 @@ following grammar: expanded program may not match the symbolic names in the grammar. Only the binding (according to @racket[free-identifier=?]) matters.} -@schemegrammar*[ +@racketgrammar*[ #:literals (#%expression module #%plain-module-begin begin #%provide define-values define-syntaxes define-values-for-syntax #%require diff --git a/collects/scribblings/reference/syntax.scrbl b/collects/scribblings/reference/syntax.scrbl index 0d23cf32ec..ab79919a0b 100644 --- a/collects/scribblings/reference/syntax.scrbl +++ b/collects/scribblings/reference/syntax.scrbl @@ -223,7 +223,7 @@ corresponding compiled and/or declared module. The third component of the vector should be printable and @racket[read]able, so that it can be preserved in marshaled bytecode. The @racketmodname[racket/base] and @racketmodname[racket] languages attach -@scheme['#(racket/language-info get-info #f)] to a @racket[module] +@racket['#(racket/language-info get-info #f)] to a @racket[module] form. See also @racket[module-compiled-language-info], @racket[module->language-info], and @racketmodname[racket/language-info].} @@ -673,7 +673,7 @@ an identifier can be either imported or defined for a given @defform[(local-require require-spec ...)]{ -Like @scheme[require], but for use in a @tech{internal-definition context} to +Like @racket[require], but for use in a @tech{internal-definition context} to import just into the local context. Only bindings from @tech{phase level} 0 are imported.} @@ -1111,7 +1111,7 @@ aliens @defform[(filtered-in proc-expr require-spec)]{ Applies an arbitrary transformation on the import names (as strings) - of @scheme[require-spec]. The @racket[proc-expr] must evaluate at + of @racket[require-spec]. The @racket[proc-expr] must evaluate at expansion time to a single-argument procedure, which is applied on each of the names from @racket[require-spec]. For each name, the procedure must return either a string for the import's new name or @@ -1125,7 +1125,7 @@ aliens (regexp-replace #rx"-" (string-titlecase name) ""))) racket/base))] imports only bindings from @racketmodname[racket/base] that match the - pattern @scheme[#rx"^[a-z-]+$"], and it converts the names to ``camel case.''} + pattern @racket[#rx"^[a-z-]+$"], and it converts the names to ``camel case.''} @defform[(path-up rel-string ...)]{ @@ -1196,7 +1196,7 @@ is equivalent to @racket[(sub-path)]. All @racket[sub-path]s in a given Examples: @subeqivs[ -[(require (multi-in racket (dict @#,schemeidfont{list}))) +[(require (multi-in racket (dict @#,racketidfont{list}))) (require racket/dict racket/list)] [(require (multi-in "math" "matrix" "utils.rkt")) (require "math/matrix/utils.rkt")] @@ -1205,7 +1205,7 @@ Examples: [(require (multi-in ("math" "matrix") "utils.rkt")) (require "math/utils.rkt" "matrix/utils.rkt")] [(require (multi-in ("math" "matrix") ("utils.rkt" "helpers.rkt"))) - (require "math/utils.rkt" "math/helpers.rkt" + (require "math/utils.rkt" "math/helpers.rkt" "matrix/utils.rkt" "matrix/helpers.rkt")] ]} @@ -1222,7 +1222,7 @@ Examples: @defform[(filtered-out proc-expr provide-spec)]{ - Analogous to @scheme[filtered-in], but for filtering and renaming + Analogous to @racket[filtered-in], but for filtering and renaming exports. For example, @@ -1234,7 +1234,7 @@ Examples: #rx"-" (string-titlecase name) ""))) (all-defined-out)))] exports only bindings that match the - pattern @scheme[#rx"^[a-z-]+$"], and it converts the names to ``camel case.''} + pattern @racket[#rx"^[a-z-]+$"], and it converts the names to ``camel case.''} @;------------------------------------------------------------------------ @section[#:tag "quote"]{Literals: @racket[quote] and @racket[#%datum]} diff --git a/collects/scribblings/reference/thread-cells.scrbl b/collects/scribblings/reference/thread-cells.scrbl index 0d15cb8d09..8b762d4a3d 100644 --- a/collects/scribblings/reference/thread-cells.scrbl +++ b/collects/scribblings/reference/thread-cells.scrbl @@ -7,9 +7,9 @@ A @defterm{@tech{thread cell}} contains a thread-specific value; that is, it contains a specific value for each thread, but it may contain different values for different threads. A thread cell is created with a default value that is used for all existing threads. When the cell's -content is changed with @scheme[thread-cell-set!], the cell's value +content is changed with @racket[thread-cell-set!], the cell's value changes only for the current thread. Similarly, -@scheme[thread-cell-ref] obtains the value of the cell that is +@racket[thread-cell-ref] obtains the value of the cell that is specific to the current thread. A thread cell's value can be @defterm{@tech{preserved}}, which means @@ -21,31 +21,31 @@ cell was created). Within the current thread, the current values of all preserved threads cells can be captured through -@scheme[current-preserved-thread-cell-values]. The captured set of +@racket[current-preserved-thread-cell-values]. The captured set of values can be imperatively installed into the current thread through -another call to @scheme[current-preserved-thread-cell-values]. The +another call to @racket[current-preserved-thread-cell-values]. The capturing and restoring threads can be different. @defproc[(thread-cell? [v any/c]) boolean?]{ -Returns @scheme[#t] if @scheme[v] is a @tech{thread cell}, -@scheme[#f] otherwise.} +Returns @racket[#t] if @racket[v] is a @tech{thread cell}, +@racket[#f] otherwise.} @defproc[(make-thread-cell [v any/c] [preserved? any/c #f]) thread-cell?]{ -Creates and returns a new thread cell. Initially, @scheme[v] is the -cell's value for all threads. If @scheme[preserved?] is true, then the +Creates and returns a new thread cell. Initially, @racket[v] is the +cell's value for all threads. If @racket[preserved?] is true, then the cell's initial value for a newly created threads is the creating thread's value for the cell, otherwise the cell's value is initially -@scheme[v] in all future threads.} +@racket[v] in all future threads.} @defproc[(thread-cell-ref [cell thread-cell?]) any]{Returns the -current value of @scheme[cell] for the current thread.} +current value of @racket[cell] for the current thread.} @defproc[(thread-cell-set! [cell thread-cell?] [v any/c]) any]{Sets the -value in @scheme[cell] to @scheme[v] for the current thread.} +value in @racket[cell] to @racket[v] for the current thread.} @examples[ (define cnp (make-thread-cell '(nerve) #f)) @@ -81,14 +81,14 @@ value in @scheme[cell] to @scheme[v] for the current thread.} [(current-preserved-thread-cell-values [thread-cell-vals any/c]) void?])]{ When called with no arguments, this procedure produces a -@scheme[thread-cell-vals] that represents the current values (in the +@racket[thread-cell-vals] that represents the current values (in the current thread) for all preserved thread cells. -When called with a @scheme[thread-cell-vals] generated by a previous -call to @scheme[current-preserved-thread-cell-values], the values of +When called with a @racket[thread-cell-vals] generated by a previous +call to @racket[current-preserved-thread-cell-values], the values of all preserved thread cells (in the current thread) are set to the -values captured in @scheme[thread-cell-vals]; if a preserved thread -cell was created after @scheme[thread-cell-vals] was generated, then +values captured in @racket[thread-cell-vals]; if a preserved thread +cell was created after @racket[thread-cell-vals] was generated, then the thread cell's value for the current thread reverts to its initial value.} diff --git a/collects/scribblings/reference/trace.scrbl b/collects/scribblings/reference/trace.scrbl index f83816e784..ac33ec9693 100644 --- a/collects/scribblings/reference/trace.scrbl +++ b/collects/scribblings/reference/trace.scrbl @@ -9,25 +9,25 @@ @note-lib-only[racket/trace] -The @schememodname[racket/trace] library mimics the tracing facility +The @racketmodname[racket/trace] library mimics the tracing facility available in Chez Scheme. @defform[(trace id ...)]{ -Each @scheme[id] must be bound to a procedure in the environment of -the @scheme[trace] expression. Each @scheme[id] is @scheme[set!]ed to +Each @racket[id] must be bound to a procedure in the environment of +the @racket[trace] expression. Each @racket[id] is @racket[set!]ed to a new procedure that traces procedure calls and returns by printing the arguments and results of the call via -@scheme[current-trace-notify]. If multiple values are returned, each +@racket[current-trace-notify]. If multiple values are returned, each value is displayed starting on a separate line. When traced procedures invoke each other, nested invocations are shown by printing a nesting prefix. If the nesting depth grows to ten and beyond, a number is printed to show the actual nesting depth. -The @scheme[trace] form can be used on an identifier that is already +The @racket[trace] form can be used on an identifier that is already traced. In this case, assuming that the variable's value has not been -changed, @scheme[trace] has no effect. If the variable has been +changed, @racket[trace] has no effect. If the variable has been changed to a different procedure, then a new trace is installed. Tracing respects tail calls to preserve loops, but its effect may be @@ -39,7 +39,7 @@ for an enclosing call). Otherwise, however, the body of a traced procedure is not evaluated in tail position with respect to a call to the procedure. -The result of a @scheme[trace] expression is @|void-const|. +The result of a @racket[trace] expression is @|void-const|. @examples[#:eval ev (define (f x) (if (zero? x) 0 (add1 (f (sub1 x))))) @@ -51,31 +51,31 @@ The result of a @scheme[trace] expression is @|void-const|. @defform[(untrace id ...)]{ -Undoes the effects of the @scheme[trace] form for each @scheme[id], -@scheme[set!]ing each @scheme[id] back to the untraced procedure, but -only if the current value of @scheme[id] is a traced procedure. If -the current value of a @scheme[id] is not a procedure installed by -@scheme[trace], then the variable is not changed. +Undoes the effects of the @racket[trace] form for each @racket[id], +@racket[set!]ing each @racket[id] back to the untraced procedure, but +only if the current value of @racket[id] is a traced procedure. If +the current value of a @racket[id] is not a procedure installed by +@racket[trace], then the variable is not changed. -The result of an @scheme[untrace] expression is @|void-const|.} +The result of an @racket[untrace] expression is @|void-const|.} @defparam[current-trace-notify proc (string? . -> . any)]{ A parameter that determines the way that trace output is -displayed. The string given to @scheme[proc] is a trace; it does not +displayed. The string given to @racket[proc] is a trace; it does not end with a newline, but it may contain internal newlines. Each call or -result is converted into a string using @scheme[pretty-print]. The +result is converted into a string using @racket[pretty-print]. The parameter's default value prints the given string followed by a newline to -@scheme[(current-output-port)].} +@racket[(current-output-port)].} @defproc[(trace-call [id symbol?] [proc procedure?] [#: kw-arg any/c] ...) any/c]{ -Calls @scheme[proc] with the arguments supplied in -@scheme[args], and possibly using keyword arguments. Also prints out the +Calls @racket[proc] with the arguments supplied in +@racket[args], and possibly using keyword arguments. Also prints out the trace information during the call, as described above in the docs for -@scheme[trace], using @scheme[id] as the name of @scheme[proc]. +@racket[trace], using @racket[id] as the name of @racket[proc]. } diff --git a/collects/scribblings/reference/units.scrbl b/collects/scribblings/reference/units.scrbl index 2835e2ffd3..9eeb90506c 100644 --- a/collects/scribblings/reference/units.scrbl +++ b/collects/scribblings/reference/units.scrbl @@ -5,10 +5,10 @@ (syntax-rules (*) [(_ [* (form ...) as see]) (defform* [form ...] - "Allowed only in a " (scheme as) "; see " (scheme see) ".")] + "Allowed only in a " (racket as) "; see " (racket see) ".")] [(_ [* (form ...) see-eg]) (defform* [form ...] - "Allowed only in certain forms; see, for example, " (scheme see-eg) ".")] + "Allowed only in certain forms; see, for example, " (racket see-eg) ".")] [(_ [form as see]) (defkeywords [* (form) as see])] [(_ [form see-eg]) @@ -29,8 +29,8 @@ together to form a larger unit, and a unit with no imports can be @deftech{invoked} to execute its body. @note-lib[racket/unit #:use-sources (mzlib/unit)]{ The -@schememodname[racket/unit] module name can be used as a language name -with @schemefont{#lang}; see @secref["single-unit"].} +@racketmodname[racket/unit] module name can be used as a language name +with @racketfont{#lang}; see @secref["single-unit"].} @local-table-of-contents[] @@ -67,47 +67,47 @@ with @schemefont{#lang}; see @secref["single-unit"].} (tag id sig-id)])]{ Produces a unit that encapsulates its -@scheme[unit-body-expr-or-defn]s. Expressions in the @scheme[unit] -body can refer to identifiers bound by the @scheme[sig-spec]s of the -@scheme[import] clause, and the body must include one definition for -each identifier of a @scheme[sig-spec] in the @scheme[export] clause. -An identifier that is exported cannot be @scheme[set!]ed in either the +@racket[unit-body-expr-or-defn]s. Expressions in the @racket[unit] +body can refer to identifiers bound by the @racket[sig-spec]s of the +@racket[import] clause, and the body must include one definition for +each identifier of a @racket[sig-spec] in the @racket[export] clause. +An identifier that is exported cannot be @racket[set!]ed in either the defining unit or in importing units, although the implicit assignment to initialize the variable may be visible as a mutation. -Each import or export @scheme[sig-spec] ultimately refers to a -@scheme[sig-id], which is an identifier that is bound to a signature -by @scheme[define-signature]. +Each import or export @racket[sig-spec] ultimately refers to a +@racket[sig-id], which is an identifier that is bound to a signature +by @racket[define-signature]. In a specific import or export position, the set of identifiers bound -or required by a particular @scheme[sig-id] can be adjusted in a few +or required by a particular @racket[sig-id] can be adjusted in a few ways: @itemize[ - @item{@scheme[(prefix id sig-spec)] as an import binds the same as - @scheme[sig-spec], except that each binding is prefixed with @scheme[id]. - As an export, this form causes definitions using the @scheme[id] - prefix to satisfy the exports required by @scheme[sig-spec].} + @item{@racket[(prefix id sig-spec)] as an import binds the same as + @racket[sig-spec], except that each binding is prefixed with @racket[id]. + As an export, this form causes definitions using the @racket[id] + prefix to satisfy the exports required by @racket[sig-spec].} - @item{@scheme[(rename sig-spec (id id) ...)] as an import binds the - same as @scheme[sig-spec], except that the first @scheme[id] is used - for the binding instead of the second @scheme[id] (where - @scheme[sig-spec] by itself must imply a binding that is - @scheme[bound-identifier=?] to second @scheme[id]). As an export, - this form causes a definition for the first @scheme[id] to satisfy - the export named by the second @scheme[id] in @scheme[sig-spec].} + @item{@racket[(rename sig-spec (id id) ...)] as an import binds the + same as @racket[sig-spec], except that the first @racket[id] is used + for the binding instead of the second @racket[id] (where + @racket[sig-spec] by itself must imply a binding that is + @racket[bound-identifier=?] to second @racket[id]). As an export, + this form causes a definition for the first @racket[id] to satisfy + the export named by the second @racket[id] in @racket[sig-spec].} - @item{@scheme[(only sig-spec id ...)] as an import binds the same as - @scheme[sig-spec], but restricted to just the listed @scheme[id]s - (where @scheme[sig-spec] by itself must imply a binding that is - @scheme[bound-identifier=?] to each @scheme[id]). This form is not + @item{@racket[(only sig-spec id ...)] as an import binds the same as + @racket[sig-spec], but restricted to just the listed @racket[id]s + (where @racket[sig-spec] by itself must imply a binding that is + @racket[bound-identifier=?] to each @racket[id]). This form is not allowed for an export.} - @item{@scheme[(except sig-spec id ...)] as an import binds the same - as @scheme[sig-spec], but excluding all listed @scheme[id]s (where - @scheme[sig-spec] by itself must imply a binding that is - @scheme[bound-identifier=?] to each @scheme[id]). This form is not + @item{@racket[(except sig-spec id ...)] as an import binds the same + as @racket[sig-spec], but excluding all listed @racket[id]s (where + @racket[sig-spec] by itself must imply a binding that is + @racket[bound-identifier=?] to each @racket[id]). This form is not allowed for an export.} ] @@ -124,7 +124,7 @@ multiple signatures, the order of the export signatures does not matter. To support multiple imports or exports for the same signature, an -import or export can be tagged using the form @scheme[(tag +import or export can be tagged using the form @racket[(tag id sig-spec)]. When an import declaration of a unit is tagged, then one actual import must be given the same tag (with the same signature) when the unit is linked. Similarly, when an export @@ -134,21 +134,21 @@ export must explicitly use the tag. A unit is prohibited syntactically from importing two signatures that are not distinct, unless they have different tags; two signatures are @defterm{distinct} only if they share no ancestor through -@scheme[extends]. The same syntactic constraint applies to exported +@racket[extends]. The same syntactic constraint applies to exported signatures. In addition, a unit is prohibited syntactically from importing the same identifier twice (after renaming and other -transformations on a @scheme[sig-spec]), exporting the same identifier +transformations on a @racket[sig-spec]), exporting the same identifier twice (again, after renaming), or exporting an identifier that is imported. When units are linked, the bodies of the linked units are executed in an order that is specified at the linking site. An -optional @scheme[(init-depend tagged-sig-id ...)] +optional @racket[(init-depend tagged-sig-id ...)] declaration constrains the allowed orders of linking by specifying that the current unit must be initialized after the unit that supplies -the corresponding import. Each @scheme[tagged-sig-id] in an -@scheme[init-depend] declaration must have a corresponding import in the -@scheme[import] clause.} +the corresponding import. Each @racket[tagged-sig-id] in an +@racket[init-depend] declaration must have a corresponding import in the +@racket[import] clause.} @defform/subs[ #:literals (define-syntaxes define-values define-values-for-export open extends contracted) @@ -183,56 +183,56 @@ of bindings for import or export: @itemize[ - @item{Each @scheme[id] in a signature declaration means that a unit + @item{Each @racket[id] in a signature declaration means that a unit implementing the signature must supply a variable definition for the - @scheme[id]. That is, @scheme[id] is available for use in units - importing the signature, and @scheme[id] must be defined by units + @racket[id]. That is, @racket[id] is available for use in units + importing the signature, and @racket[id] must be defined by units exporting the signature.} - - @item{Each @scheme[define-syntaxes] form in a signature declaration + + @item{Each @racket[define-syntaxes] form in a signature declaration introduces a macro that is available for use in any unit that imports the signature. Free variables in the definition's - @scheme[expr] refer to other identifiers in the signature first, or - the context of the @scheme[define-signature] form if the signature + @racket[expr] refer to other identifiers in the signature first, or + the context of the @racket[define-signature] form if the signature does not include the identifier.} - @item{Each @scheme[define-values] form in a signature declaration + @item{Each @racket[define-values] form in a signature declaration introduces code that effectively prefixes every unit that imports the - signature. Free variables in the definition's @scheme[expr] are - treated the same as for @scheme[define-syntaxes].} + signature. Free variables in the definition's @racket[expr] are + treated the same as for @racket[define-syntaxes].} - @item{Each @scheme[define-values-for-export] form in a signature + @item{Each @racket[define-values-for-export] form in a signature declaration introduces code that effectively suffixes every unit that exports the signature. Free variables in the definition's - @scheme[expr] are treated the same as for @scheme[define-syntaxes].} + @racket[expr] are treated the same as for @racket[define-syntaxes].} - @item{Each @scheme[contracted] form in a signature declaration means + @item{Each @racket[contracted] form in a signature declaration means that a unit exporting the signature must supply a variable definition - for each @scheme[id] in that form. If the signature is imported, then - uses of @scheme[id] inside the unit are protected by the appropriate + for each @racket[id] in that form. If the signature is imported, then + uses of @racket[id] inside the unit are protected by the appropriate contracts using the unit as the negative blame. If the signature is exported, then the exported values are protected by the appropriate contracts which use the unit as the positive blame, but internal uses of the exported identifiers are not protected. Variables in the - @scheme[contract] expressions are treated the same as for - @scheme[define-syntaxes].} + @racket[contract] expressions are treated the same as for + @racket[define-syntaxes].} - @item{Each @scheme[(open sig-spec)] adds to the signature everything - specified by @scheme[sig-spec].} + @item{Each @racket[(open sig-spec)] adds to the signature everything + specified by @racket[sig-spec].} - @item{Each @scheme[(struct id (field ...) struct-option ...)] adds - all of the identifiers that would be bound by @scheme[(struct id + @item{Each @racket[(struct id (field ...) struct-option ...)] adds + all of the identifiers that would be bound by @racket[(struct id (field ...) field-option ...)], where the extra option - @scheme[#:omit-constructor] omits the constructor identifier.} + @racket[#:omit-constructor] omits the constructor identifier.} - @item{Each @scheme[(sig-form-id . datum)] extends the signature in a - way that is defined by @scheme[sig-form-id], which must be bound by - @scheme[define-signature-form]. One such binding is for - @scheme[struct/ctc].} + @item{Each @racket[(sig-form-id . datum)] extends the signature in a + way that is defined by @racket[sig-form-id], which must be bound by + @racket[define-signature-form]. One such binding is for + @racket[struct/ctc].} ] -When a @scheme[define-signature] form includes an @scheme[extends] +When a @racket[define-signature] form includes an @racket[extends] clause, then the define signature automatically includes everything in the extended signature. Furthermore, any implementation of the new signature can be used as an implementation of the extended signature.} @@ -253,7 +253,7 @@ signature can be used as an implementation of the extended signature.} @defidform[extends]{ -Allowed only within @scheme[define-signature].} +Allowed only within @racket[define-signature].} @; ------------------------------------------------------------------------ @@ -263,26 +263,26 @@ Allowed only within @scheme[define-signature].} [(invoke-unit unit-expr) (invoke-unit unit-expr (import tagged-sig-spec ...))]]{ -Invokes the unit produced by @scheme[unit-expr]. For each of the -unit's imports, the @scheme[invoke-unit] expression must contain a -@scheme[tagged-sig-spec] in the @scheme[import] clause; see -@scheme[unit] for the grammar of @scheme[tagged-sig-spec]. If the unit -has no imports, the @scheme[import] clause can be omitted. +Invokes the unit produced by @racket[unit-expr]. For each of the +unit's imports, the @racket[invoke-unit] expression must contain a +@racket[tagged-sig-spec] in the @racket[import] clause; see +@racket[unit] for the grammar of @racket[tagged-sig-spec]. If the unit +has no imports, the @racket[import] clause can be omitted. -When no @scheme[tagged-sig-spec]s are provided, @scheme[unit-expr] +When no @racket[tagged-sig-spec]s are provided, @racket[unit-expr] must produce a unit that expects no imports. To invoke the unit, all bindings are first initialized to the @|undefined-const| value. Next, the unit's body definitions and expressions are evaluated in order; in the case of a definition, evaluation sets the value of the corresponding variable(s). Finally, the result of the last expression -in the unit is the result of the @scheme[invoke-unit] expression. +in the unit is the result of the @racket[invoke-unit] expression. -Each supplied @scheme[tagged-sig-spec] takes bindings from the +Each supplied @racket[tagged-sig-spec] takes bindings from the surrounding context and turns them into imports for the invoked unit. The unit need not declare an import for every provided -@scheme[tagged-sig-spec], but one @scheme[tagged-sig-spec] must be +@racket[tagged-sig-spec], but one @racket[tagged-sig-spec] must be provided for each declared import of the unit. For each variable -identifier in each provided @scheme[tagged-sig-spec], the value of the +identifier in each provided @racket[tagged-sig-spec], the value of the identifier's binding in the surrounding context is used for the corresponding import in the invoked unit.} @@ -292,16 +292,16 @@ corresponding import in the invoked unit.} (import tagged-sig-spec ...) (export tagged-sig-spec ...))]{ -Like @scheme[invoke-unit], but the values of the unit's exports are +Like @racket[invoke-unit], but the values of the unit's exports are copied to new bindings. -The unit produced by @scheme[unit-expr] is linked and invoked as for -@scheme[invoke-unit]. In addition, the @scheme[export] clause is +The unit produced by @racket[unit-expr] is linked and invoked as for +@racket[invoke-unit]. In addition, the @racket[export] clause is treated as a kind of import into the local definition context. That is, for every binding that would be available in a unit that used the -@scheme[export] clause's @scheme[tagged-sig-spec] as an import, a +@racket[export] clause's @racket[tagged-sig-spec] as an import, a definition is generated for the context of the -@scheme[define-values/invoke-unit] form.} +@racket[define-values/invoke-unit] form.} @; ------------------------------------------------------------------------ @@ -325,19 +325,19 @@ definition is generated for the context of the ((link-binding ...) unit-expr tagged-link-id ...)])]{ Links several units into one new compound unit without immediately -invoking any of the linked units. The @scheme[unit-expr]s in the -@scheme[link] clause determine the units to be linked in creating the -compound unit. The @scheme[unit-expr]s are evaluated when the -@scheme[compound-unit] form is evaluated. +invoking any of the linked units. The @racket[unit-expr]s in the +@racket[link] clause determine the units to be linked in creating the +compound unit. The @racket[unit-expr]s are evaluated when the +@racket[compound-unit] form is evaluated. -The @scheme[import] clause determines the imports of the compound +The @racket[import] clause determines the imports of the compound unit. Outside the compound unit, these imports behave as for a plain unit; inside the compound unit, they are propagated to some of the -linked units. The @scheme[export] clause determines the exports of the +linked units. The @racket[export] clause determines the exports of the compound unit. Again, outside the compound unit, these exports are treated the same as for a plain unit; inside the compound unit, they are drawn from the exports of the linked units. Finally, the left-hand -and right-hand parts of each declaration in the @scheme[link] clause +and right-hand parts of each declaration in the @racket[link] clause specify how the compound unit's imports and exports are propagated to the linked units. @@ -345,39 +345,39 @@ Individual elements of an imported or exported signature are not available within the compound unit. Instead, imports and exports are connected at the level of whole signatures. Each specific import or export (i.e., an instance of some signature, possibly tagged) is given -a @scheme[link-id] name. Specifically, a @scheme[link-id] is bound by -the @scheme[import] clause or the left-hand part of a declaration in -the @scheme[link] clause. A bound @scheme[link-id] is referenced in -the right-hand part of a declaration in the @scheme[link] clause or by -the @scheme[export] clause. +a @racket[link-id] name. Specifically, a @racket[link-id] is bound by +the @racket[import] clause or the left-hand part of a declaration in +the @racket[link] clause. A bound @racket[link-id] is referenced in +the right-hand part of a declaration in the @racket[link] clause or by +the @racket[export] clause. -The left-hand side of a @scheme[link] declaration gives names to each +The left-hand side of a @racket[link] declaration gives names to each expected export of the unit produced by the corresponding -@scheme[unit-expr]. The actual unit may export additional signatures, +@racket[unit-expr]. The actual unit may export additional signatures, and it may export an extension of a specific signature instead of just the specified one. If the unit does not export one of the specified signatures (with the specified tag, if any), the -@exnraise[exn:fail:contract] when the @scheme[compound-unit] form is +@exnraise[exn:fail:contract] when the @racket[compound-unit] form is evaluated. -The right-hand side of a @scheme[link] declaration specifies the +The right-hand side of a @racket[link] declaration specifies the imports to be supplied to the unit produced by the corresponding -@scheme[unit-expr]. The actual unit may import fewer signatures, and +@racket[unit-expr]. The actual unit may import fewer signatures, and it may import a signature that is extended by the specified one. If the unit imports a signature (with a particular tag) that is not included in the supplied imports, the @exnraise[exn:fail:contract] -when the @scheme[compound-unit] form is evaluated. Each -@scheme[link-id] supplied as an import must be bound either in the -@scheme[import] clause or in some declaration within the @scheme[link] +when the @racket[compound-unit] form is evaluated. Each +@racket[link-id] supplied as an import must be bound either in the +@racket[import] clause or in some declaration within the @racket[link] clause. -The order of declarations in the @scheme[link] clause determines the +The order of declarations in the @racket[link] clause determines the order of invocation of the linked units. When the compound unit is -invoked, the unit produced by the first @scheme[unit-expr] is invoked +invoked, the unit produced by the first @racket[unit-expr] is invoked first, then the second, and so on. If the order specified in the -@scheme[link] clause is inconsistent with @scheme[init-depend] +@racket[link] clause is inconsistent with @racket[init-depend] declarations of the actual units, then the -@exnraise[exn:fail:contract] when the @scheme[compound-unit] form is +@exnraise[exn:fail:contract] when the @racket[compound-unit] form is evaluated.} @; ------------------------------------------------------------------------ @@ -394,15 +394,15 @@ evaluated.} ...) ]{ -Binds @scheme[unit-id] to both a unit and static information about the +Binds @racket[unit-id] to both a unit and static information about the unit. -Evaluating a reference to a @scheme[unit-id] bound by -@scheme[define-unit] produces a unit, just like evaluating an -@scheme[id] bound by @scheme[(define id (unit ...))]. In addition, -however, @scheme[unit-id] can be used in @scheme[compound-unit/infer]. -See @scheme[unit] for information on @scheme[tagged-sig-spec], -@scheme[init-depends-decl], and @scheme[unit-body-expr-or-defn].} +Evaluating a reference to a @racket[unit-id] bound by +@racket[define-unit] produces a unit, just like evaluating an +@racket[id] bound by @racket[(define id (unit ...))]. In addition, +however, @racket[unit-id] can be used in @racket[compound-unit/infer]. +See @racket[unit] for information on @racket[tagged-sig-spec], +@racket[init-depends-decl], and @racket[unit-body-expr-or-defn].} @defform/subs[ #:literals (import export :) @@ -428,42 +428,42 @@ See @scheme[unit] for information on @scheme[tagged-sig-spec], tagged-link-id ...) unit-id])]{ -Like @scheme[compound-unit]. Syntactically, the difference between -@scheme[compound-unit] and @scheme[compound-unit/infer] is that the -@scheme[unit-expr] for a linked unit is replaced with a -@scheme[unit-id], where a @scheme[unit-id] is bound by -@scheme[define-unit] (or one of the other unit-binding forms that we +Like @racket[compound-unit]. Syntactically, the difference between +@racket[compound-unit] and @racket[compound-unit/infer] is that the +@racket[unit-expr] for a linked unit is replaced with a +@racket[unit-id], where a @racket[unit-id] is bound by +@racket[define-unit] (or one of the other unit-binding forms that we introduce later in this section). Furthermore, an import can name just -a @scheme[sig-id] without locally binding a @scheme[link-id], and an -export can be based on a @scheme[sig-id] instead of a -@scheme[link-id], and a declaration in the @scheme[link] clause can be -simply a @scheme[unit-id] with no specified exports or imports. +a @racket[sig-id] without locally binding a @racket[link-id], and an +export can be based on a @racket[sig-id] instead of a +@racket[link-id], and a declaration in the @racket[link] clause can be +simply a @racket[unit-id] with no specified exports or imports. -The @scheme[compound-unit/infer] form expands to -@scheme[compound-unit] by adding @scheme[sig-ids] as needed to -the @scheme[import] clause, by replacing @scheme[sig-id]s in the -@scheme[export] clause by @scheme[link-id]s, and by completing -the declarations of the @scheme[link] clause. This completion is based +The @racket[compound-unit/infer] form expands to +@racket[compound-unit] by adding @racket[sig-ids] as needed to +the @racket[import] clause, by replacing @racket[sig-id]s in the +@racket[export] clause by @racket[link-id]s, and by completing +the declarations of the @racket[link] clause. This completion is based on static information associated with each -@scheme[unit-id]. Links and exports can be inferred when all +@racket[unit-id]. Links and exports can be inferred when all signatures exported by the linked units are distinct from each other and from all imported signatures, and when all imported signatures are distinct. Two signatures are @defterm{distinct} only if they -share no ancestor through @scheme[extends]. +share no ancestor through @racket[extends]. -The long form of a @scheme[link] declaration can be used to resolve +The long form of a @racket[link] declaration can be used to resolve ambiguity by giving names to some of a unit's exports and supplying specific bindings for some of a unit's imports. The long form need not name all of a unit's exports or supply all of a unit's imports if the remaining parts can be inferred. -Like @scheme[compound-unit], the @scheme[compound-unit/infer] form +Like @racket[compound-unit], the @racket[compound-unit/infer] form produces a (compound) unit without statically binding information about the result unit's imports and exports. That is, -@scheme[compound-unit/infer] consumes static information, but it does +@racket[compound-unit/infer] consumes static information, but it does not generate it. Two additional forms, -@scheme[define-compound-unit] and -@scheme[define-compound-unit/infer], generate static information +@racket[define-compound-unit] and +@racket[define-compound-unit/infer], generate static information (where the former does not consume static information).} @defform[ @@ -474,8 +474,8 @@ not generate it. Two additional forms, (link linkage-decl ...)) ]{ -Like @scheme[compound-unit], but binds static information about the -compound unit like @scheme[define-unit].} +Like @racket[compound-unit], but binds static information about the +compound unit like @racket[define-unit].} @defform[ @@ -486,8 +486,8 @@ compound unit like @scheme[define-unit].} (link infer-linkage-decl ...)) ]{ -Like @scheme[compound-unit/infer], but binds static information about -the compound unit like @scheme[define-unit].} +Like @racket[compound-unit/infer], but binds static information about +the compound unit like @racket[define-unit].} @defform[ #:literals (import export) @@ -498,11 +498,11 @@ the compound unit like @scheme[define-unit].} init-depends-decl) ]{ -Like @scheme[define-unit], but the unit implementation is determined -from an existing unit produced by @scheme[unit-expr]. The imports and -exports of the unit produced by @scheme[unit-expr] must be consistent +Like @racket[define-unit], but the unit implementation is determined +from an existing unit produced by @racket[unit-expr]. The imports and +exports of the unit produced by @racket[unit-expr] must be consistent with the declared imports and exports, otherwise the -@exnraise[exn:fail:contract] when the @scheme[define-unit-binding] +@exnraise[exn:fail:contract] when the @racket[define-unit-binding] form is evaluated.} @defform/subs[ @@ -510,11 +510,11 @@ form is evaluated.} (invoke-unit/infer unit-spec) [(unit-spec unit-id (link link-unit-id ...))]]{ -Like @scheme[invoke-unit], but uses static information associated with -@scheme[unit-id] to infer which imports must be assembled from the +Like @racket[invoke-unit], but uses static information associated with +@racket[unit-id] to infer which imports must be assembled from the current context. If given a link form containing multiple -@scheme[link-unit-id]s, then the units are first linked via -@scheme[define-compound-unit/infer].} +@racket[link-unit-id]s, then the units are first linked via +@racket[define-compound-unit/infer].} @defform/subs[ #:literals (link) @@ -522,12 +522,12 @@ current context. If given a link form containing multiple [(maybe-exports code:blank (export tagged-sig-spec ...)) (unit-spec unit-id (link link-unit-id ...))]]{ -Like @scheme[define-values/invoke-unit], but uses static information -associated with @scheme[unit-id] to infer which imports must be +Like @racket[define-values/invoke-unit], but uses static information +associated with @racket[unit-id] to infer which imports must be assembled from the current context and which exports should be bound by the definition. If given a link form containing multiple -@scheme[link-unit-id]s, then the units are first linked via -@scheme[define-compound-unit/infer].} +@racket[link-unit-id]s, then the units are first linked via +@racket[define-compound-unit/infer].} @; ------------------------------------------------------------------------ @@ -540,28 +540,28 @@ by the definition. If given a link form containing multiple Creates a unit that implements an interface using bindings in the enclosing environment. The generated unit is essentially the same as -@schemeblock[ +@racketblock[ (unit (import) (export tagged-sig-spec) (define id expr) ...) ] -for each @scheme[id] that must be defined to satisfy the exports, and -each corresponding @scheme[expr] produces the value of @scheme[id] in -the environment of the @scheme[unit-from-context] expression. (The unit -cannot be written as above, however, since each @scheme[id] definition -within the unit shadows the binding outside the @scheme[unit] form.) +for each @racket[id] that must be defined to satisfy the exports, and +each corresponding @racket[expr] produces the value of @racket[id] in +the environment of the @racket[unit-from-context] expression. (The unit +cannot be written as above, however, since each @racket[id] definition +within the unit shadows the binding outside the @racket[unit] form.) -See @scheme[unit] for the grammar of @scheme[tagged-sig-spec].} +See @racket[unit] for the grammar of @racket[tagged-sig-spec].} @defform[ (define-unit-from-context id tagged-sig-spec) ]{ -Like @scheme[unit-from-context], in that a unit is constructed from -the enclosing environment, and like @scheme[define-unit], in that -@scheme[id] is bound to static information to be used later with inference.} +Like @racket[unit-from-context], in that a unit is constructed from +the enclosing environment, and like @racket[define-unit], in that +@racket[id] is bound to static information to be used later with inference.} @; ------------------------------------------------------------------------ @@ -576,27 +576,27 @@ the enclosing environment, and like @scheme[define-unit], in that ((tagged-sig-spec ...) unit-expr tagged-sig-spec)) ]{ -Similar to @scheme[unit], except the body of the unit is determined by -an existing unit produced by @scheme[unit-expr]. The result is a unit -whose implementation is @scheme[unit-expr], but whose imports, +Similar to @racket[unit], except the body of the unit is determined by +an existing unit produced by @racket[unit-expr]. The result is a unit +whose implementation is @racket[unit-expr], but whose imports, exports, and initialization dependencies are as in the -@scheme[unit/new-import-export] form (instead of as in the unit -produced by @scheme[unit-expr]). +@racket[unit/new-import-export] form (instead of as in the unit +produced by @racket[unit-expr]). -The final clause of the @scheme[unit/new-import-export] form +The final clause of the @racket[unit/new-import-export] form determines the connection between the old and new imports and exports. -The connection is similar to the way that @scheme[compound-unit] +The connection is similar to the way that @racket[compound-unit] propagates imports and exports; the difference is that the connection -between @scheme[import] and the right-hand side of the link clause is +between @racket[import] and the right-hand side of the link clause is based on the names of elements in signatures, rather than the names of -the signatures. That is, a @scheme[tagged-sig-spec] on the right-hand -side of the link clause need not apppear as a @scheme[tagged-sig-spec] -in the @scheme[import] clause, but each of the bindings implied by the -linking @scheme[tagged-sig-spec] must be implied by some -@scheme[tagged-sig-spec] in the @scheme[import] clause. Similarly, -each of the bindings implied by an @scheme[export] -@scheme[tagged-sig-spec] must be implied by some left-hand-side -@scheme[tagged-sig-spec] in the linking clause.} +the signatures. That is, a @racket[tagged-sig-spec] on the right-hand +side of the link clause need not apppear as a @racket[tagged-sig-spec] +in the @racket[import] clause, but each of the bindings implied by the +linking @racket[tagged-sig-spec] must be implied by some +@racket[tagged-sig-spec] in the @racket[import] clause. Similarly, +each of the bindings implied by an @racket[export] +@racket[tagged-sig-spec] must be implied by some left-hand-side +@racket[tagged-sig-spec] in the linking clause.} @defform[ #:literals (import export) @@ -607,8 +607,8 @@ each of the bindings implied by an @scheme[export] ((tagged-sig-spec ...) unit-expr tagged-sig-spec)) ]{ -Like @scheme[unit/new-import-export], but binds static information to -@scheme[unit-id] like @scheme[define-unit].} +Like @racket[unit/new-import-export], but binds static information to +@racket[unit-id] like @racket[define-unit].} @defform[ #:literals (import export) @@ -618,8 +618,8 @@ Like @scheme[unit/new-import-export], but binds static information to init-depends-decl unit-id)]{ -Like @scheme[unit/new-import-export], but the linking clause is -inferred, so @scheme[unit-id] must have the appropriate static +Like @racket[unit/new-import-export], but the linking clause is +inferred, so @racket[unit-id] must have the appropriate static information.} @defform[ #:literals (import export) @@ -629,8 +629,8 @@ information.} init-depends-decl unit-id)]{ -Like @scheme[unit/s], but binds static information to @scheme[name-id] -like @scheme[define-unit].} +Like @racket[unit/s], but binds static information to @racket[name-id] +like @racket[define-unit].} @; ------------------------------------------------------------------------ @@ -641,17 +641,17 @@ like @scheme[define-unit].} (define-signature-form (sig-form-id id) body ...+)] ]{ -Binds @scheme[sig-form-id] for use within a @scheme[define-signature] +Binds @racket[sig-form-id] for use within a @racket[define-signature] form. -In the first form, the result of @scheme[expr] must be a transformer -procedure. In the second form, @scheme[sig-form-id] is bound to a -transformer procedure whose argument is @scheme[id] and whose body is -the @scheme[body]s. The result of the transformer must be a list of +In the first form, the result of @racket[expr] must be a transformer +procedure. In the second form, @racket[sig-form-id] is bound to a +transformer procedure whose argument is @racket[id] and whose body is +the @racket[body]s. The result of the transformer must be a list of syntax objects, which are substituted for a use of -@scheme[sig-form-id] in a @scheme[define-signature] expansion. (The +@racket[sig-form-id] in a @racket[define-signature] expansion. (The result is a list so that the transformer can produce multiple -declarations; @scheme[define-signature] has no splicing @scheme[begin] +declarations; @racket[define-signature] has no splicing @racket[begin] form.)} @defform/subs[ @@ -664,8 +664,8 @@ form.)} #:omit-define-syntaxes #:omit-define-values])]{ -For use with @scheme[define-signature]. The @scheme[struct/ctc] form works -similarly to @scheme[struct], but the constructor, predicate, field +For use with @racket[define-signature]. The @racket[struct/ctc] form works +similarly to @racket[struct], but the constructor, predicate, field accessors, and field mutators are contracted appropriately.} @; ------------------------------------------------------------------------ @@ -674,14 +674,14 @@ accessors, and field mutators are contracted appropriately.} @defproc[(unit? [v any/c]) boolean?]{ -Returns @scheme[#t] if @scheme[v] is a unit, @scheme[#f] otherwise.} +Returns @racket[#t] if @racket[v] is a unit, @racket[#f] otherwise.} @defform[(provide-signature-elements sig-spec ...)]{ -Expands to a @scheme[provide] of all identifiers implied by the -@scheme[sig-spec]s. See @scheme[unit] for the grammar of -@scheme[sig-spec].} +Expands to a @racket[provide] of all identifiers implied by the +@racket[sig-spec]s. See @racket[unit] for the grammar of +@racket[sig-spec].} @; ------------------------------------------------------------------------ @@ -700,10 +700,10 @@ without adding contracts to the imported and exported signatures. The unit value must import a subset of the import signatures and export a superset of the export signatures listed in the unit contract. Any identifier which is not listed for a given signature is left alone. -Variables used in a given @scheme[contract] expression first refer to other +Variables used in a given @racket[contract] expression first refer to other variables in the same signature, and then to the context of the -@scheme[unit/c] expression.} - +@racket[unit/c] expression.} + @defform/subs[#:literals (import export) (define-unit/contract unit-id (import sig-spec-block ...) @@ -713,7 +713,7 @@ variables in the same signature, and then to the context of the ...) ([sig-spec-block (tagged-sig-spec [id contract] ...) tagged-sig-spec])]{ -The @scheme[define-unit/contract] form defines a unit compatible with +The @racket[define-unit/contract] form defines a unit compatible with link inference whose imports and exports are contracted with a unit contract. The unit name is used for the positive blame of the contract.} @@ -722,11 +722,11 @@ contract. The unit name is used for the positive blame of the contract.} @section[#:tag "single-unit"]{Single-Unit Modules} -When @schememodname[racket/unit] is used as a language name with -@schemefont{#lang}, the module body is treated as a unit body. The -body must match the following @scheme[_module-body] grammar: +When @racketmodname[racket/unit] is used as a language name with +@racketfont{#lang}, the module body is treated as a unit body. The +body must match the following @racket[_module-body] grammar: -@schemegrammar*[ +@racketgrammar*[ #:literals (import export require begin) [module-body (code:line require-decl ... @@ -739,44 +739,44 @@ body must match the following @scheme[_module-body] grammar: (begin require-decl ...) derived-require-form]] -After any number of @scheme[_require-decl]s, the content of the module -is the same as a @scheme[unit] body. +After any number of @racket[_require-decl]s, the content of the module +is the same as a @racket[unit] body. -The resulting unit is exported as @scheme[_base]@schemeidfont["@"], -where @scheme[_base] is derived from the enclosing module's name +The resulting unit is exported as @racket[_base]@racketidfont["@"], +where @racket[_base] is derived from the enclosing module's name (i.e., its symbolic name, or its path without the directory and file -suffix). If the module name ends in @schemeidfont{-unit}, then -@scheme[_base] corresponds to the module name before -@schemeidfont{-unit}. Otherwise, the module name serves as -@scheme[_base]. +suffix). If the module name ends in @racketidfont{-unit}, then +@racket[_base] corresponds to the module name before +@racketidfont{-unit}. Otherwise, the module name serves as +@racket[_base]. @; ------------------------------------------------------------------------ @section{Single-Signature Modules} -@defmodulelang[racket/signature]{The @schememodname[racket/signature] +@defmodulelang[racket/signature]{The @racketmodname[racket/signature] language treats a module body as a unit signature.} -The body must match the following @scheme[_module-body] grammar: +The body must match the following @racket[_module-body] grammar: -@schemegrammar*[ +@racketgrammar*[ #:literals (require) [module-body (code:line (require require-spec ...) ... sig-spec ...)] ] -See @secref["creatingunits"] for the grammar of @scheme[_sig-spec]. -Unlike the body of a @schememodname[racket/unit] module, a -@scheme[require] in a @schememodname[racket/signature] module must be -a literal use of @scheme[require]. +See @secref["creatingunits"] for the grammar of @racket[_sig-spec]. +Unlike the body of a @racketmodname[racket/unit] module, a +@racket[require] in a @racketmodname[racket/signature] module must be +a literal use of @racket[require]. The resulting signature is exported as -@scheme[_base]@schemeidfont["^"], where @scheme[_base] is derived from +@racket[_base]@racketidfont["^"], where @racket[_base] is derived from the enclosing module's name (i.e., its symbolic name, or its path without the directory and file suffix). If the module name ends in -@schemeidfont{-sig}, then @scheme[_base] corresponds to the module -name before @schemeidfont{-sig}. Otherwise, the module name serves as -@scheme[_base]. +@racketidfont{-sig}, then @racket[_base] corresponds to the module +name before @racketidfont{-sig}. Otherwise, the module name serves as +@racket[_base]. @; ---------------------------------------------------------------------- @@ -784,10 +784,10 @@ name before @schemeidfont{-sig}. Otherwise, the module name serves as @defmodule[racket/unit-exptime #:use-sources (mzlib/unit-exptime)] -The @schememodname[racket/unit-exptime] library provides procedures +The @racketmodname[racket/unit-exptime] library provides procedures that are intended for use by macro transformers. In particular, the -library is typically imported using @scheme[for-syntax] into a module -that defines macro with @scheme[define-syntax]. +library is typically imported using @racket[for-syntax] into a module +that defines macro with @racket[define-syntax]. @defproc[(unit-static-signatures [unit-identifier identifier?] [err-syntax syntax?]) @@ -796,19 +796,19 @@ that defines macro with @scheme[define-syntax]. (list/c (cons/c (or/c symbol? #f) identifier?)))]{ -If @scheme[unit-identifier] is bound to static unit information via -@scheme[define-unit] (or other such forms), the result is two +If @racket[unit-identifier] is bound to static unit information via +@racket[define-unit] (or other such forms), the result is two values. The first value is for the unit's imports, and the second is for the unit's exports. Each result value is a list, where each list -element pairs a symbol or @scheme[#f] with an identifier. The symbol -or @scheme[#f] indicates the import's or export's tag (where -@scheme[#f] indicates no tag), and the identifier indicates the +element pairs a symbol or @racket[#f] with an identifier. The symbol +or @racket[#f] indicates the import's or export's tag (where +@racket[#f] indicates no tag), and the identifier indicates the binding of the corresponding signature. -If @scheme[unit-identifier] is not bound to static unit information, +If @racket[unit-identifier] is not bound to static unit information, then the @exnraise[exn:fail:syntax]. In that case, the given -@scheme[err-syntax] argument is used as the source of the error, where -@scheme[unit-identifer] is used as the detail source location.} +@racket[err-syntax] argument is used as the source of the error, where +@racket[unit-identifer] is used as the detail source location.} @defproc[(signature-members [sig-identifier identifier?] @@ -818,14 +818,14 @@ then the @exnraise[exn:fail:syntax]. In that case, the given (listof identifier?) (listof identifier?))]{ -If @scheme[sig-identifier] is bound to static unit information via -@scheme[define-signature] (or other such forms), the result is four +If @racket[sig-identifier] is bound to static unit information via +@racket[define-signature] (or other such forms), the result is four values: @itemize[ - @item{an identifier or @scheme[#f] indicating the signature (of any) - that is extended by the @scheme[sig-identifier] binding;} + @item{an identifier or @racket[#f] indicating the signature (of any) + that is extended by the @racket[sig-identifier] binding;} @item{a list of identifiers representing the variables supplied/required by the signature;} @@ -839,8 +839,7 @@ values: ] -If @scheme[sig-identifier] is not bound to a signature, then the +If @racket[sig-identifier] is not bound to a signature, then the @exnraise[exn:fail:syntax]. In that case, the given -@scheme[err-syntax] argument is used as the source of the error, where -@scheme[sig-identifier] is used as the detail source location.} - +@racket[err-syntax] argument is used as the source of the error, where +@racket[sig-identifier] is used as the detail source location.} diff --git a/collects/scribblings/reference/unsafe.scrbl b/collects/scribblings/reference/unsafe.scrbl index 7337d5c307..26b30cd4a7 100644 --- a/collects/scribblings/reference/unsafe.scrbl +++ b/collects/scribblings/reference/unsafe.scrbl @@ -17,23 +17,23 @@ @defmodule[racket/unsafe/ops] -All fuctions and forms provided by @schememodname[racket/base] and -@schememodname[racket] check their arguments to ensure that the +All fuctions and forms provided by @racketmodname[racket/base] and +@racketmodname[racket] check their arguments to ensure that the arguments conform to contracts and other constraints. For example, -@scheme[vector-ref] checks its arguments to ensure that the first +@racket[vector-ref] checks its arguments to ensure that the first argument is a vector, that the second argument is an exact integer, -and that the second argument is between @scheme[0] and one less than +and that the second argument is between @racket[0] and one less than the vector's length, inclusive. -Functions provided by @schememodname[racket/unsafe/ops] are +Functions provided by @racketmodname[racket/unsafe/ops] are @deftech{unsafe}. They have certain constraints, but the constraints are not checked, which allows the system to generate and execute faster code. If arguments violate an unsafe function's constraints, the function's behavior and result is unpredictable, and the entire system can crash or become corrupted. -All of the exported bindings of @schememodname[racket/unsafe/ops] are -protected in the sense of @scheme[protect-out], so access to unsafe +All of the exported bindings of @racketmodname[racket/unsafe/ops] are +protected in the sense of @racket[protect-out], so access to unsafe operations can be prevented by adjusting the code inspector (see @secref["modprotect"]). @@ -49,13 +49,13 @@ operations can be prevented by adjusting the code inspector (see @defproc[(unsafe-fxabs [a fixnum?]) fixnum?] )]{ -For @tech{fixnums}: Like @scheme[+], @scheme[-], @scheme[*], -@scheme[quotient], @scheme[remainder], @scheme[modulo], and -@scheme[abs], but constrained to consume @tech{fixnums} and produce a -@tech{fixnum} result. The mathematical operation on @scheme[a] and -@scheme[b] must be representable as a @tech{fixnum}. In the case of -@scheme[unsafe-fxquotient], @scheme[unsafe-fxremainder], and -@scheme[unsafe-fxmodulo], @scheme[b] must not be @scheme[0].} +For @tech{fixnums}: Like @racket[+], @racket[-], @racket[*], +@racket[quotient], @racket[remainder], @racket[modulo], and +@racket[abs], but constrained to consume @tech{fixnums} and produce a +@tech{fixnum} result. The mathematical operation on @racket[a] and +@racket[b] must be representable as a @tech{fixnum}. In the case of +@racket[unsafe-fxquotient], @racket[unsafe-fxremainder], and +@racket[unsafe-fxmodulo], @racket[b] must not be @racket[0].} @deftogether[( @@ -67,16 +67,16 @@ For @tech{fixnums}: Like @scheme[+], @scheme[-], @scheme[*], @defproc[(unsafe-fxrshift [a fixnum?] [b fixnum?]) fixnum?] )]{ -For @tech{fixnums}: Like @scheme[bitwise-and], @scheme[bitwise-ior], -@scheme[bitwise-xor], @scheme[bitwise-not], and -@scheme[arithmetic-shift], but constrained to consume @tech{fixnums}; -the result is always a @tech{fixnum}. The @scheme[unsafe-fxlshift] and -@scheme[unsafe-fxrshift] operations correspond to -@scheme[arithmetic-shift], but require non-negative arguments; -@scheme[unsafe-fxlshift] is a positive (i.e., left) shift, and -@scheme[unsafe-fxrshift] is a negative (i.e., right) shift, where the +For @tech{fixnums}: Like @racket[bitwise-and], @racket[bitwise-ior], +@racket[bitwise-xor], @racket[bitwise-not], and +@racket[arithmetic-shift], but constrained to consume @tech{fixnums}; +the result is always a @tech{fixnum}. The @racket[unsafe-fxlshift] and +@racket[unsafe-fxrshift] operations correspond to +@racket[arithmetic-shift], but require non-negative arguments; +@racket[unsafe-fxlshift] is a positive (i.e., left) shift, and +@racket[unsafe-fxrshift] is a negative (i.e., right) shift, where the number of bits to shift must be less than the number of bits used to -represent a @tech{fixnum}. In the case of @scheme[unsafe-fxlshift], +represent a @tech{fixnum}. In the case of @racket[unsafe-fxlshift], bits in the result beyond the number of bits used to represent a @tech{fixnum} are effectively replaced with a copy of the high bit.} @@ -91,8 +91,8 @@ bits in the result beyond the number of bits used to represent a @defproc[(unsafe-fxmax [a fixnum?] [b fixnum?]) fixnum?] )]{ -For @tech{fixnums}: Like @scheme[=], @scheme[<], @scheme[>], -@scheme[<=], @scheme[>=], @scheme[min], and @scheme[max], but +For @tech{fixnums}: Like @racket[=], @racket[<], @racket[>], +@racket[<=], @racket[>=], @racket[min], and @racket[max], but constrained to consume @tech{fixnums}.} @@ -104,8 +104,8 @@ constrained to consume @tech{fixnums}.} @defproc[(unsafe-flabs [a inexact-real?]) inexact-real?] )]{ -For @tech{flonums}: Unchecked versions of @scheme[fl+], @scheme[fl-], -@scheme[fl*], @scheme[fl/], and @scheme[flabs].} +For @tech{flonums}: Unchecked versions of @racket[fl+], @racket[fl-], +@racket[fl*], @racket[fl/], and @racket[flabs].} @deftogether[( @@ -118,9 +118,9 @@ For @tech{flonums}: Unchecked versions of @scheme[fl+], @scheme[fl-], @defproc[(unsafe-flmax [a inexact-real?]) inexact-real?] )]{ -For @tech{flonums}: Unchecked versions of @scheme[fl=], @scheme[fl<], -@scheme[fl>], @scheme[fl<=], @scheme[fl>=], @scheme[flmin], and -@scheme[flmax].} +For @tech{flonums}: Unchecked versions of @racket[fl=], @racket[fl<], +@racket[fl>], @racket[fl<=], @racket[fl>=], @racket[flmin], and +@racket[flmax].} @deftogether[( @@ -131,8 +131,8 @@ For @tech{flonums}: Unchecked versions of @scheme[fl=], @scheme[fl<], )]{ For @tech{flonums}: Unchecked (potentially) versions of -@scheme[flround], @scheme[flfloor], @scheme[flceiling], and -@scheme[fltruncate]. Currently, these bindings are simply aliases for +@racket[flround], @racket[flfloor], @racket[flceiling], and +@racket[fltruncate]. Currently, these bindings are simply aliases for the corresponding safe bindings.} @@ -149,9 +149,9 @@ the corresponding safe bindings.} )]{ For @tech{flonums}: Unchecked (potentially) versions of -@scheme[flsin], @scheme[flcos], @scheme[fltan], @scheme[flasin], -@scheme[flacos], @scheme[flatan], @scheme[fllog], @scheme[flexp], and -@scheme[flsqrt]. Currently, some of these bindings are simply aliases +@racket[flsin], @racket[flcos], @racket[fltan], @racket[flasin], +@racket[flacos], @racket[flatan], @racket[fllog], @racket[flexp], and +@racket[flsqrt]. Currently, some of these bindings are simply aliases for the corresponding safe bindings.} @@ -171,7 +171,7 @@ For @tech{flonums}: Unchecked versions of @racket[make-flrectangular], @defproc[(unsafe-fl->fx [a inexact-real?]) fixnum?] )]{ Unchecked conversion of a fixnum to an integer flonum and vice versa. -These are similar to the safe bindings @scheme[->fl] and @scheme[fl->exact-integer], +These are similar to the safe bindings @racket[->fl] and @racket[fl->exact-integer], but further constrained to consume or produce a fixnum. } @@ -187,8 +187,8 @@ but further constrained to consume or produce a fixnum. @defproc[(unsafe-set-mcdr! [p mpair?] [v any/c]) void?] )]{ -Unsafe variants of @scheme[car], @scheme[cdr], @scheme[mcar], -@scheme[mcdr], @scheme[set-mcar!], and @scheme[set-mcdr!].} +Unsafe variants of @racket[car], @racket[cdr], @racket[mcar], +@racket[mcdr], @racket[set-mcar!], and @racket[set-mcdr!].} @deftogether[( @@ -198,7 +198,7 @@ Unsafe variants of @scheme[car], @scheme[cdr], @scheme[mcar], @defproc[(unsafe-set-box*! [v (and/c box? (not/c impersonator?))] [val any/c]) void?] )]{ -Unsafe versions of @scheme[unbox] and @scheme[set-box!].} +Unsafe versions of @racket[unbox] and @racket[set-box!].} @deftogether[( @@ -210,9 +210,9 @@ Unsafe versions of @scheme[unbox] and @scheme[set-box!].} @defproc[(unsafe-vector*-set! [v (and/c vector? (not/c impersonator?))] [k fixnum?] [val any/c]) void?] )]{ -Unsafe versions of @scheme[vector-length], @scheme[vector-ref], and -@scheme[vector-set!]. A vector's size can never be larger than a -@tech{fixnum} (so even @scheme[vector-length] always returns a +Unsafe versions of @racket[vector-length], @racket[vector-ref], and +@racket[vector-set!]. A vector's size can never be larger than a +@tech{fixnum} (so even @racket[vector-length] always returns a fixnum).} @@ -223,10 +223,10 @@ fixnum).} @defproc[(unsafe-string-set! [str (and/c string? (not/c immutable?))] [k fixnum?] [ch char?]) void?] )]{ -Unsafe versions of @scheme[string-length], @scheme[string-ref], and -@scheme[string-set!]. The @scheme[unsafe-string-ref] procedure can be used +Unsafe versions of @racket[string-length], @racket[string-ref], and +@racket[string-set!]. The @racket[unsafe-string-ref] procedure can be used only when the result will be a Latin-1 character. A string's size can -never be larger than a @tech{fixnum} (so even @scheme[string-length] +never be larger than a @tech{fixnum} (so even @racket[string-length] always returns a fixnum).} @@ -236,9 +236,9 @@ always returns a fixnum).} @defproc[(unsafe-bytes-set! [bstr (and/c bytes? (not/c immutable?))] [k fixnum?] [b byte?]) void?] )]{ -Unsafe versions of @scheme[bytes-length], @scheme[bytes-ref], and -@scheme[bytes-set!]. A bytes's size can never be larger than a -@tech{fixnum} (so even @scheme[bytes-length] always returns a +Unsafe versions of @racket[bytes-length], @racket[bytes-ref], and +@racket[bytes-set!]. A bytes's size can never be larger than a +@tech{fixnum} (so even @racket[bytes-length] always returns a fixnum).} @@ -248,9 +248,9 @@ fixnum).} @defproc[(unsafe-flvector-set! [v flvector?] [k fixnum?] [x inexact-real?]) void?] )]{ -Unsafe versions of @scheme[flvector-length], @scheme[flvector-ref], and -@scheme[flvector-set!]. A @tech{flvector}'s size can never be larger than a -@tech{fixnum} (so even @scheme[flvector-length] always returns a +Unsafe versions of @racket[flvector-length], @racket[flvector-ref], and +@racket[flvector-set!]. A @tech{flvector}'s size can never be larger than a +@tech{fixnum} (so even @racket[flvector-length] always returns a fixnum).} @@ -259,8 +259,8 @@ fixnum).} @defproc[(unsafe-f64vector-set! [vec f64vector?] [k fixnum?] [n inexact-real?]) void?] )]{ -Unsafe versions of @scheme[f64vector-ref] and -@scheme[f64vector-set!].} +Unsafe versions of @racket[f64vector-ref] and +@racket[f64vector-set!].} @deftogether[( @@ -268,8 +268,8 @@ Unsafe versions of @scheme[f64vector-ref] and @defproc[(unsafe-s16vector-set! [vec s16vector?] [k fixnum?] [n (integer-in -32768 32767)]) void?] )]{ -Unsafe versions of @scheme[s16vector-ref] and -@scheme[s16vector-set!].} +Unsafe versions of @racket[s16vector-ref] and +@racket[s16vector-set!].} @deftogether[( @@ -277,8 +277,8 @@ Unsafe versions of @scheme[s16vector-ref] and @defproc[(unsafe-u16vector-set! [vec u16vector?] [k fixnum?] [n (integer-in 0 65535)]) void?] )]{ -Unsafe versions of @scheme[u16vector-ref] and -@scheme[u16vector-set!].} +Unsafe versions of @racket[u16vector-ref] and +@racket[u16vector-set!].} @deftogether[( @@ -289,7 +289,7 @@ Unsafe versions of @scheme[u16vector-ref] and )]{ Unsafe field access and update for an instance of a structure -type. The index @scheme[k] must be between @scheme[0] (inclusive) and +type. The index @racket[k] must be between @racket[0] (inclusive) and the number of fields in the struture (exclusive). In the case of -@scheme[unsafe-struct-set!], the field must be mutable.} +@racket[unsafe-struct-set!], the field must be mutable.} diff --git a/collects/scribblings/reference/values.scrbl b/collects/scribblings/reference/values.scrbl index 5c000414bd..336ad789ae 100644 --- a/collects/scribblings/reference/values.scrbl +++ b/collects/scribblings/reference/values.scrbl @@ -4,14 +4,14 @@ @title[#:tag "values"]{Multiple Values} See @secref["values-model"] for general information about multiple -result values. In addition to @scheme[call-with-values] (described in -this section), the @scheme[let-values], @scheme[let*-values], -@scheme[letrec-values], and @scheme[define-values] forms (among +result values. In addition to @racket[call-with-values] (described in +this section), the @racket[let-values], @racket[let*-values], +@racket[letrec-values], and @racket[define-values] forms (among others) create continuations that receive multiple values. @defproc[(values [v any/c] ...) any]{ -Returns the given @scheme[v]s. That is, @scheme[values] returns as +Returns the given @racket[v]s. That is, @racket[values] returns as provided arguments. @examples[ @@ -22,12 +22,12 @@ provided arguments. @defproc[(call-with-values [generator (-> any)] [receiver procedure?]) any]{ -Calls @scheme[generator], and passes the values that -@scheme[generator] produces as arguments to @scheme[receiver]. Thus, -@scheme[call-with-values] creates a continuation that accepts any -number of values that @scheme[receiver] can accept. The -@scheme[receiver] procedure is called in tail position with respect to -the @scheme[call-with-values] call. +Calls @racket[generator], and passes the values that +@racket[generator] produces as arguments to @racket[receiver]. Thus, +@racket[call-with-values] creates a continuation that accepts any +number of values that @racket[receiver] can accept. The +@racket[receiver] procedure is called in tail position with respect to +the @racket[call-with-values] call. @examples[ (call-with-values (lambda () (values 1 2)) +) diff --git a/collects/scribblings/scheme/scheme.scrbl b/collects/scribblings/scheme/scheme.scrbl index 9b3e074315..c9c8617fad 100644 --- a/collects/scribblings/scheme/scheme.scrbl +++ b/collects/scribblings/scheme/scheme.scrbl @@ -43,44 +43,44 @@ @(define-syntax-rule (compat-except sid rid . rest) (begin - @section[@schememodname[sid]] + @section[@racketmodname[sid]] @defmodule[sid] - "The " @schememodname[sid] " library re-exports " @racketmodname[rid] (begin . rest) ".")) + "The " @racketmodname[sid] " library re-exports " @racketmodname[rid] (begin . rest) ".")) @(define-syntax-rule (compat sid rid) (compat-except sid rid)) @title{@bold{Scheme}: Compatibility Libraries and Executables} Racket was once called ``PLT Scheme,'' and a number of libraries with -names starting @schemeidfont{scheme} provide compatibility with the +names starting @racketidfont{scheme} provide compatibility with the old name. A few @seclink["compat-exe"]{old executables} are also provided. @table-of-contents[] -@compat-except[scheme racket]{, except based on @schememodname[scheme/base] -instead of @schememodname[racket/base], the @|unit-struct| from -@schememodname[scheme/unit] is exported, @schememodname[scheme/set] is -not re-exported, @schememodname[scheme/system] is +@compat-except[scheme racket]{, except based on @racketmodname[scheme/base] +instead of @racketmodname[racket/base], the @|unit-struct| 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 -@racketmodname[scheme/pretty], and @schememodname[scheme/nest] is +@racketmodname[scheme/pretty], and @racketmodname[scheme/nest] is re-exported} @compat-except[scheme/base racket/base]{, except that -@schememodname[racket]'s @scheme[struct], @scheme[hash], -@scheme[hasheq], @scheme[hasheqv], @scheme[in-directory], and -@scheme[local-require] are not exported, and -@scheme[make-base-namespace] and @scheme[make-base-empty-namespace] +@racketmodname[racket]'s @racket[struct], @racket[hash], +@racket[hasheq], @racket[hasheqv], @racket[in-directory], and +@racket[local-require] are not exported, and +@racket[make-base-namespace] and @racket[make-base-empty-namespace] are different} @defproc[(make-base-empty-namespace) namespace?]{ -Like @|make-base-empty-namespace-id| from @schememodname[racket/base], -but with @schememodname[scheme/base] attached.} +Like @|make-base-empty-namespace-id| from @racketmodname[racket/base], +but with @racketmodname[scheme/base] attached.} @defproc[(make-base-namespace) namespace?]{ -Like @|make-base-namespace-id| from @schememodname[racket/base], but -with @schememodname[scheme/base] attached.} +Like @|make-base-namespace-id| from @racketmodname[racket/base], but +with @racketmodname[scheme/base] attached.} @compat[scheme/async-channel racket/async-channel] @@ -90,7 +90,7 @@ with @schememodname[scheme/base] attached.} @compat-except[scheme/class racket/class]{, except that @racket[writable<%>] is exported under the name @racket[printable<%>] -(and @|printable<%>-id| from @schememodname[racket/class] is not +(and @|printable<%>-id| from @racketmodname[racket/class] is not exported)} @defthing[printable<%> interface?]{ @@ -113,9 +113,9 @@ An alias for @racket[writable<%>]. @; ---------------------------------------------------------------------- @compat-except[scheme/foreign ffi/unsafe]{, -@schememodname[ffi/unsafe/cvector], and @schememodname[ffi/vector], -except that @scheme[unsafe!] must be used to import the unsafe -bindings of @schememodname[ffi/unsafe] and @schememodname[ffi/unsafe/cvector]} +@racketmodname[ffi/unsafe/cvector], and @racketmodname[ffi/vector], +except that @racket[unsafe!] must be used to import the unsafe +bindings of @racketmodname[ffi/unsafe] and @racketmodname[ffi/unsafe/cvector]} @defform[(unsafe!)]{ @@ -128,16 +128,16 @@ Makes unsafe bindings available.} (unsafe (rename-out [id external-id])) provide-spec])]{ -Like @scheme[provide], but @scheme[id]s under @scheme[unsafe] are not +Like @racket[provide], but @racket[id]s under @racket[unsafe] are not actually provided. Instead, they are collected for introduction into -an importing module via a macro created by @scheme[define-unsafer].} +an importing module via a macro created by @racket[define-unsafer].} @defform[(define-unsafer id)]{ -Cooperates with @scheme[provide*] to define @scheme[id] as a -@scheme[unsafe!]-like form that introduces definitions for each -binding provided as @scheme[unsafe]. The @scheme[define-unsafer] form -must occur after all the @scheme[provide*] forms to which it refers.} +Cooperates with @racket[provide*] to define @racket[id] as a +@racket[unsafe!]-like form that introduces definitions for each +binding provided as @racket[unsafe]. The @racket[define-unsafer] form +must occur after all the @racket[provide*] forms to which it refers.} @; ---------------------------------------------------------------------- @@ -148,10 +148,10 @@ must occur after all the @scheme[provide*] forms to which it refers.} @; ---------------------------------------------------------------------- @compat-except[scheme/gui racket/gui]{, except that it builds on -@schememodname[scheme/gui/base] instead of @schememodname[racket/gui/base]} +@racketmodname[scheme/gui/base] instead of @racketmodname[racket/gui/base]} @compat-except[scheme/gui/base racket/gui/base]{, except that it builds on -@schememodname[scheme] instead of @schememodname[racket]} +@racketmodname[scheme] instead of @racketmodname[racket]} @defproc[(make-gui-empty-namespace) namespace?]{ @@ -177,13 +177,13 @@ environment of the result namespace.} @;------------------------------------------------------------------------ -@section[#:tag "scheme/language-info"]{@schememodname[scheme/language-info]} +@section[#:tag "scheme/language-info"]{@racketmodname[scheme/language-info]} @defmodule[scheme/language-info]{ -The @schememodname[scheme/language-info] library is like -@schememodname[racket/language-info], except that it produces -@scheme['(#(scheme/runtime-config configure #f))] for the -@scheme['configure-runtime] information key.} +The @racketmodname[scheme/language-info] library is like +@racketmodname[racket/language-info], except that it produces +@racket['(#(scheme/runtime-config configure #f))] for the +@racket['configure-runtime] information key.} See also @racketmodname[scheme/runtime-config]. @@ -197,7 +197,7 @@ See also @racketmodname[scheme/runtime-config]. @compat[scheme/mpair racket/mpair] @;------------------------------------------------------------------------ -@section[#:tag "nest"]{@schememodname[scheme/nest]} +@section[#:tag "nest"]{@racketmodname[scheme/nest]} @defmodule[scheme/nest] @@ -254,7 +254,7 @@ than a precise prose description: @compat-except[scheme/pretty racket/pretty]{, except that @racket[pretty-write] is exported under the name @racket[pretty-print] -(and @|pretty-print-id| from @schememodname[racket/pretty] is not +(and @|pretty-print-id| from @racketmodname[racket/pretty] is not exported)} @defproc[(pretty-print [v any/c] [port output-port? (current-output-port)]) @@ -274,13 +274,13 @@ An alias for @racket[pretty-write].} @;------------------------------------------------------------------------ -@section[#:tag "scheme/runtime-config"]{@schememodname[scheme/runtime-config]} +@section[#:tag "scheme/runtime-config"]{@racketmodname[scheme/runtime-config]} @defmodule[scheme/runtime-config]{ -The @schememodname[scheme/runtime-config] library is like -@schememodname[racket/runtime-config], except that the result of its -@schemeidfont{configure} function is a procedure that sets -@racket[print-as-expression] to @scheme[#f].} +The @racketmodname[scheme/runtime-config] library is like +@racketmodname[racket/runtime-config], except that the result of its +@racketidfont{configure} function is a procedure that sets +@racket[print-as-expression] to @racket[#f].} @; ---------------------------------------- @@ -343,23 +343,23 @@ and @|make-module-evaluator-id| from @racketmodname[racket/sandbox].} @; ---------------------------------------- -@section[@schememodname[mred]] +@section[@racketmodname[mred]] @defmodule[mred] -The @schememodname[mred] library is like -@schememodname[scheme/gui/base], except that it provides variants of +The @racketmodname[mred] library is like +@racketmodname[scheme/gui/base], except that it provides variants of @racket[make-gui-namespace] and @racket[make-gui-empty-namespace] that -attach @schememodname[mred] instead of -@schememodname[scheme/gui/base]. +attach @racketmodname[mred] instead of +@racketmodname[scheme/gui/base]. -Both @schememodname[scheme/gui/base] and -@schememodname[racket/gui/base] depend on @schememodname[mred], so it +Both @racketmodname[scheme/gui/base] and +@racketmodname[racket/gui/base] depend on @racketmodname[mred], so it is attached by all variants of @racket[make-gui-empty-namespace]. @defmodule*/no-declare[(mred/mred)] -The @schememodname[mred] library actually just re-exports -@schememodname[mred/mred], which is an even older name for the +The @racketmodname[mred] library actually just re-exports +@racketmodname[mred/mred], which is an even older name for the library. @; ---------------------------------------- diff --git a/collects/scribblings/scribble/core.scrbl b/collects/scribblings/scribble/core.scrbl index b97e4714de..b39fde2dc8 100644 --- a/collects/scribblings/scribble/core.scrbl +++ b/collects/scribblings/scribble/core.scrbl @@ -629,7 +629,7 @@ for Latex output (see @secref["extra-style"]). The following Produces another block during the @tech{traverse pass}, eventually. -The @scheme[traverse] procedure is called with @racket[_get] and +The @racket[traverse] procedure is called with @racket[_get] and @racket[_set] procedures to get and set symbol-keyed information; the @racket[traverse] procedure should return either a @tech{block} (which effectively takes the @racket[traverse-block]'s place) or a procedure @@ -640,10 +640,10 @@ All @racket[traverse-element] and @racket[traverse-block]s that have not been replaced are forced in document order relative to each other during an iteration of the @tech{traverse pass}. -The @racket[_get] procedure passed to @scheme[traverse] takes a symbol +The @racket[_get] procedure passed to @racket[traverse] takes a symbol and any value to act as a default; it returns information registered for the symbol or the given default if no value has been -registered. The @racket[_set] procedure passed to @scheme[traverse] +registered. The @racket[_set] procedure passed to @racket[traverse] takes a symbol and a value to registered for the symbol. @margin-note*{See also @racket[cond-block] in @racketmodname[scriblib/render-cond].} @@ -1204,7 +1204,7 @@ Produces the content that replaces @racket[e].} Defined as -@schemeblock[ +@racketblock[ (recursive-contract ((symbol? any/c . -> . any/c) (symbol? any/c . -> . any) @@ -1216,7 +1216,7 @@ Defined as Defined as -@schemeblock[ +@racketblock[ (recursive-contract ((symbol? any/c . -> . any/c) (symbol? any/c . -> . any) diff --git a/collects/scribblings/scribble/lp-ex.rkt b/collects/scribblings/scribble/lp-ex.rkt index 34017c90e5..bfcd0abc7a 100644 --- a/collects/scribblings/scribble/lp-ex.rkt +++ b/collects/scribblings/scribble/lp-ex.rkt @@ -13,5 +13,5 @@ and this one: that, when assembled, produce a complete program, in this case: -@schemeblock[(define (f x) +@racketblock[(define (f x) (* x x))] diff --git a/collects/scribblings/scribble/manual-stub.scrbl b/collects/scribblings/scribble/manual-stub.scrbl index c8a1536948..4d929d7f46 100644 --- a/collects/scribblings/scribble/manual-stub.scrbl +++ b/collects/scribblings/scribble/manual-stub.scrbl @@ -3,6 +3,6 @@ @title{Racket Manual Format} -The @schememodname[scribble/manual] language is a major component of +The @racketmodname[scribble/manual] language is a major component of Scribble, and it is documented in its own chapter: @secref["plt-manuals"]. diff --git a/collects/scribblings/slideshow/picts.scrbl b/collects/scribblings/slideshow/picts.scrbl index cfe3f368a4..f07b593902 100644 --- a/collects/scribblings/slideshow/picts.scrbl +++ b/collects/scribblings/slideshow/picts.scrbl @@ -989,7 +989,7 @@ dividing the gap between the RGB components and 255 by the factor.} Calls a @racket[proc] multiple times, gradually changing the pen and/or brush color for each call. For the first call, the current pen and/or brush color matches @racket[start]; for the last call, it -matches racket[end]; and for intermediate calls, the color is an +matches @racket[end]; and for intermediate calls, the color is an intermediate color. The @racket[max-step] and @racket[step-delta] arguments should be diff --git a/collects/scribblings/tools/frame.scrbl b/collects/scribblings/tools/frame.scrbl index ec682bc9fe..97553ba12f 100644 --- a/collects/scribblings/tools/frame.scrbl +++ b/collects/scribblings/tools/frame.scrbl @@ -21,9 +21,9 @@ Sets the names that the button shows. } @methimpl{ -The string @scheme[short-name] is the name that is shown on the button -and @scheme[name] is shown when the button is clicked on, in a separate -window. If @scheme[name] is @scheme[#f], a message indicating that the file +The string @racket[short-name] is the name that is shown on the button +and @racket[name] is shown when the button is clicked on, in a separate +window. If @racket[name] is @racket[#f], a message indicating that the file hasn't been saved is shown. @@ -34,7 +34,7 @@ hasn't been saved is shown. @defmixin[drracket:frame:mixin (drracket:frame:basics<%> frame:text-info<%> frame:editor<%>) (drracket:frame:<%>)]{ Provides an implementation of -@scheme[drracket:frame:<%>] +@racket[drracket:frame:<%>] } @@ -49,11 +49,11 @@ Use this mixin to establish some common menu items across various DrRacket windo void?]{ Adds a -@scheme[separator-menu-item%]. Next, adds the -@scheme["Keybindings"] menu item to the edit menu. Finally, +@racket[separator-menu-item%]. Next, adds the +@racket["Keybindings"] menu item to the edit menu. Finally, if the -@scheme[current-eventspace-has-standard-menus?] procedure returns @scheme[#f], creates another -@scheme[separator-menu-item%]. +@racket[current-eventspace-has-standard-menus?] procedure returns @racket[#f], creates another +@racket[separator-menu-item%]. @@ -78,7 +78,7 @@ method. Calls the super method. Then, creates a menu item for multi-file searching. Finally, adds a -@scheme[separator-menu-item%]. +@racket[separator-menu-item%]. } @@ -108,7 +108,7 @@ Returns the empty string. void?]{ Calls -@scheme[handler:edit-file]. +@racket[handler:edit-file]. } @@ -154,7 +154,7 @@ Opens an about box for DrRacket. (help-menu:about-string) string?]{ -Returns the string @scheme["DrRacket"]. +Returns the string @racket["DrRacket"]. } @@ -170,7 +170,7 @@ Adds the Help Desk menu item and the Welcome to DrRacket menu item. (help-menu:create-about?) boolean?]{ -Returns @scheme[#t]. +Returns @racket[#t]. }} @@ -178,7 +178,7 @@ Returns @scheme[#t]. @definterface[drracket:frame:basics<%> (frame:standard-menus<%>)]{ -This interface is the result of the @scheme[drracket:frame:basics-mixin] +This interface is the result of the @racket[drracket:frame:basics-mixin] } @@ -242,10 +242,10 @@ that evaluation is taking place in the user's program. @methspec{ This method is intended to be overridden. It's job is to -update the @scheme["View"] menu to match the state of the +update the @racket["View"] menu to match the state of the visible windows. In the case of the standard DrRacket window, it change the menu items to reflect the visibility of -the definitions and interaction @scheme[editor-canvas%]s. +the definitions and interaction @racket[editor-canvas%]s. Call this method whenever the state of the show menu might need to change. diff --git a/collects/scribblings/tools/language.scrbl b/collects/scribblings/tools/language.scrbl index b8af380086..f5de521d40 100644 --- a/collects/scribblings/tools/language.scrbl +++ b/collects/scribblings/tools/language.scrbl @@ -6,12 +6,12 @@ This interface represents the bare essentials when defining a module-based language. Use the -@scheme[drracket:language:simple-module-based-language->module-based-language-mixin] +@racket[drracket:language:simple-module-based-language->module-based-language-mixin] mixin to construct an implementation of -@scheme[drracket:language:module-based-language<%>] from an implementation of +@racket[drracket:language:module-based-language<%>] from an implementation of this interface. -The class @scheme[drracket:language:simple-module-based-language%] provides an +The class @racket[drracket:language:simple-module-based-language%] provides an implementation of this interface. @defmethod[(get-language-numbers) @@ -37,8 +37,8 @@ implementation of this interface. @method[drracket:language:language<%> front-end/complete-program] and @method[drracket:language:language<%> front-end/interaction]. - The result is expected to be the @scheme[module] (its initial require) - except as value, ie @scheme[quote]d. + The result is expected to be the @racket[module] (its initial require) + except as value, ie @racket[quote]d. } @defmethod[(get-one-line-summary) @@ -50,7 +50,7 @@ implementation of this interface. @defmethod[(get-reader) (->* () (any/c input-port?) (or/c syntax? eof-object?))]{ This method must return a procedure that is used to read syntax from a - port in the same manner as @scheme[read-syntax]. It is used as the + port in the same manner as @racket[read-syntax]. It is used as the reader for this language. }} @@ -109,7 +109,7 @@ implementation of this interface. @index{drracket:language:simple-settings} This mixin uses a struct definition for its settings: -@schemeblock[ +@racketblock[ (define-struct drracket:language:simple-settings (case-sensitive (code:comment @#,t{boolean?}) printing-style (code:comment @#,t{(symbols 'constructor 'quasiquote 'write 'print)}) @@ -124,12 +124,12 @@ This mixin uses a struct definition for its settings: The settings in this structure reflect the settings show in the language configuration dialog for languages constructed with this mixin. The first controls the input for the language. The rest specify printing -controls for the language. The style @scheme['print] is the default +controls for the language. The style @racket['print] is the default style, as normally used in the Racket REPL. The sharing field determines if cycles and sharing in values are displayed when the value is rendered. The insert newlines field determines if values in the repl -are formatted with @scheme[write] style-line printouts, or with -@scheme[pretty-print] multi-line printouts. +are formatted with @racket[write] style-line printouts, or with +@racket[pretty-print] multi-line printouts. @defmethod[#:mode override (config-panel) @@ -138,9 +138,9 @@ are formatted with @scheme[write] style-line printouts, or with the settings for this language. See also - @scheme[drracket:language:simple-module-based-language->module-based-language-mixin] + @racket[drracket:language:simple-module-based-language->module-based-language-mixin] for details of the simple-settings structure, this mixin's - @scheme[settings] type. + @racket[settings] type. } @defmethod[#:mode override @@ -148,16 +148,16 @@ are formatted with @scheme[write] style-line printouts, or with settings]{ The defaults for the settings are @itemize[ - @item{@scheme[case-sensitive] is @scheme[#f]} - @item{@scheme[printing-style] is @scheme['write]} - @item{@scheme[show-sharing] is @scheme[#f]} - @item{@scheme[insert-newlines] is @scheme[#t]} + @item{@racket[case-sensitive] is @racket[#f]} + @item{@racket[printing-style] is @racket['write]} + @item{@racket[show-sharing] is @racket[#f]} + @item{@racket[insert-newlines] is @racket[#t]} ] See also - @scheme[drracket:language:simple-module-based-language->module-based-language-mixin] + @racket[drracket:language:simple-module-based-language->module-based-language-mixin] for details of the simple-settings structure, this mixins - @scheme[settings] type. + @racket[settings] type. } @defmethod[#:mode override @@ -169,15 +169,15 @@ are formatted with @scheme[write] style-line printouts, or with (get-init-code [settings settings]) sexpression]{ Creates an s-expression of a module that sets the - @scheme[current-inspector], @scheme[read-case-sensitive], and - @scheme[error-value->string] parameters. Additionally, it may load - @scheme[errortrace], if debugging is enabled. + @racket[current-inspector], @racket[read-case-sensitive], and + @racket[error-value->string] parameters. Additionally, it may load + @racket[errortrace], if debugging is enabled. } @defmethod[#:mode override (get-transformer-module) s-expression]{ - Returns @scheme['mzscheme]. + Returns @racket['mzscheme]. } @defmethod[#:mode override @@ -186,9 +186,9 @@ are formatted with @scheme[write] style-line printouts, or with Constructs a vector from the structure. See also - @scheme[drracket:language:simple-module-based-language->module-based-language-mixin] + @racket[drracket:language:simple-module-based-language->module-based-language-mixin] for details of the simple-settings structure, this mixins - @scheme[settings] type. + @racket[settings] type. } @defmethod[#:mode override @@ -199,18 +199,18 @@ are formatted with @scheme[write] style-line printouts, or with Sets the structure inspector to a new inspector, saving the original inspector for use during printing. - Sets the @scheme[global-port-print-handler] to print based on the + Sets the @racket[global-port-print-handler] to print based on the settings structure, but without any newlines. - If debugging is enabled, it sets the @scheme[current-eval] handler to + If debugging is enabled, it sets the @racket[current-eval] handler to one that annotates each evaluated program with debugging annotations. - Additionally, it sets the @scheme[error-display-handler] to show the + Additionally, it sets the @racket[error-display-handler] to show the debugging annotations when an error is raised. See also - @scheme[drracket:language:simple-module-based-language->module-based-language-mixin] + @racket[drracket:language:simple-module-based-language->module-based-language-mixin] for details of the simple-settings structure, this mixin's - @scheme[settings] type. + @racket[settings] type. } @defmethod[#:mode override @@ -223,9 +223,9 @@ are formatted with @scheme[write] style-line printouts, or with @method[drracket:language:simple-module-based-language->module-based-language-mixin% on-execute]) See also - @scheme[drracket:language:simple-module-based-language->module-based-language-mixin] + @racket[drracket:language:simple-module-based-language->module-based-language-mixin] for details of the simple-settings structure, this mixin's - @scheme[settings] type. + @racket[settings] type. } @defmethod[#:mode override @@ -238,38 +238,38 @@ are formatted with @scheme[write] style-line printouts, or with @method[drracket:language:simple-module-based-language->module-based-language-mixin% on-execute].) See also - @scheme[drracket:language:simple-module-based-language->module-based-language-mixin] + @racket[drracket:language:simple-module-based-language->module-based-language-mixin] for details of the simple-settings structure, this mixin's - @scheme[settings] type. + @racket[settings] type. } @defmethod[#:mode override (unmarshall-settings) (or/c false/c settings)]{ - Builds a settings structure from the vector, or @scheme[#f] if the + Builds a settings structure from the vector, or @racket[#f] if the vector doesn't match the types of the structure. See also - @scheme[drracket:language:simple-module-based-language->module-based-language-mixin] + @racket[drracket:language:simple-module-based-language->module-based-language-mixin] for details of the simple-settings structure, this mixin's - @scheme[settings] type. + @racket[settings] type. } @defmethod[#:mode override (use-mred-launcher) boolean?]{ - Returns @scheme[#t]. + Returns @racket[#t]. }} @definterface[drracket:language:module-based-language<%> ()]{ This interface is for languages that can be implemented with Racket -@scheme[module]s. +@racket[module]s. -Use the @scheme[drracket:language:module-based-language->language-mixin] +Use the @racket[drracket:language:module-based-language->language-mixin] mixin to construct an implementation of -@scheme[drracket:language:language<%>] from an implementation of this +@racket[drracket:language:language<%>] from an implementation of this interface. @defmethod[(config-panel [parent (is-a?/c panel%)]) @@ -294,10 +294,10 @@ interface. sexp]{ Returns a module in sexpression form that is used for creating executables. The module must provide a thunk, called - @scheme[init-code]. + @racket[init-code]. When either a stand-alone executable or a launcher is created, the - module is required, and @scheme[init-code] is invoked. This procedure + module is required, and @racket[init-code] is invoked. This procedure is expected to set up the environment, based on the settings. } @@ -318,8 +318,8 @@ interface. This method specifies the module that defines the language. It is used to initialize the user's namespace. - The result is expected to be the @scheme[module] (its initial require) - except as value, ie @scheme[quote]d. + The result is expected to be the @racket[module] (its initial require) + except as value, ie @racket[quote]d. See also @method[drracket:language:module-based-language<%> get-transformer-module]. @@ -334,7 +334,7 @@ interface. @defmethod[(get-reader) (->* () (any/c input-port?) (or/c syntax? eof-object?))]{ This method must return a procedure that is used to read syntax from a - port in the same manner as @scheme[read-syntax]. It is used as the + port in the same manner as @racket[read-syntax]. It is used as the reader for this language. } @@ -344,10 +344,10 @@ interface. language. It is used to initialize the transformer portion of the user's namespace. - The result is expected to be the @scheme[module] (its initial require) - except as value, i.e., @scheme[quote]d or @scheme[#f]. + The result is expected to be the @racket[module] (its initial require) + except as value, i.e., @racket[quote]d or @racket[#f]. - If the result is @scheme[#f], no module is required into the + If the result is @racket[#f], no module is required into the transformer part of the namespace. See also @@ -400,12 +400,12 @@ interface. boolean?]{ @methspec{ The result of this method controls how the module is attached to the - user's namespace. If the method returns @scheme[#t], the Racket - primitive @scheme[namespace-require/copy] is used and if it returns - @scheme[#f], @scheme[namespace-require] is used. + user's namespace. If the method returns @racket[#t], the Racket + primitive @racket[namespace-require/copy] is used and if it returns + @racket[#f], @racket[namespace-require] is used. } @methimpl{ - Defaultly returns @scheme[#f]. + Defaultly returns @racket[#f]. }}} @@ -414,8 +414,8 @@ interface. @defmethod[#:mode override (front-end/complete-program) (-> (or/c sexp/c syntax? eof-object?))]{ - Reads a syntax object, from @scheme[input]. Does not use - @scheme[settings]. + Reads a syntax object, from @racket[input]. Does not use + @racket[settings]. For languages that use these mixins, there is no difference between this method and @@ -425,8 +425,8 @@ interface. @defmethod[#:mode override (front-end/interaction) (-> (or/c sexp/c syntax? eof-object?))]{ - Reads a syntax object, from @scheme[input]. Does not use - @scheme[settings]. + Reads a syntax object, from @racket[input]. Does not use + @racket[settings]. For languages that use these mixins, there is no difference between this method and @@ -445,9 +445,9 @@ interface. void?]{ Calls the super method. - Uses @scheme[namespace-require] to install the result of + Uses @racket[namespace-require] to install the result of @method[drracket:language:module-based-language<%> get-module] and - Uses @scheme[namespace-transformer-require] to install the result of + Uses @racket[namespace-transformer-require] to install the result of @method[drracket:language:module-based-language<%> get-transformer-module] into the user's namespace. }} @@ -464,11 +464,11 @@ DrRacket. any]{ @methspec{ Returns the language-specific value for some capability. See also - @scheme[drracket:language:register-capability]. + @racket[drracket:language:register-capability]. } @methimpl{ Defaultly returns the value from: - @scheme[drracket:language:get-capability-default]. + @racket[drracket:language:get-capability-default]. }} @defmethod[(config-panel [parent (is-a?/c panel%)]) @@ -484,13 +484,13 @@ DrRacket. [program-filename string?]) void?]{ This method creates an executable in the given language. The - @scheme[program-filename] is the name of the program to store in the - executable and @scheme[executable-filename] is the name of a file + @racket[program-filename] is the name of the program to store in the + executable and @racket[executable-filename] is the name of a file where the executable goes. See also - @scheme[drracket:language:create-module-based-stand-alone-executable] - and @scheme[drracket:language:create-module-based-launcher]. + @racket[drracket:language:create-module-based-stand-alone-executable] + and @racket[drracket:language:create-module-based-launcher]. } @defmethod[(default-settings) @@ -500,7 +500,7 @@ DrRacket. @defmethod[(default-settings? [settings settings]) boolean?]{ - Return @scheme[#t] if the input settings matches the default settings + Return @racket[#t] if the input settings matches the default settings obtained via @method[drracket:language:language<%> default-settings]. } @@ -535,32 +535,32 @@ DrRacket. @defmethod[(front-end/complete-program [port port] [settings settings]) (-> (or/c sexp/c syntax? eof-object?))]{ - @scheme[front-end/complete-program] method reads and parses a program - in the language. The @scheme[port] argument contains all of the data - to be read (until eof) and the name of the @scheme[port] (obtained via + @racket[front-end/complete-program] method reads and parses a program + in the language. The @racket[port] argument contains all of the data + to be read (until eof) and the name of the @racket[port] (obtained via @racket[object-name]) is a value representing the source of the program (typically an editor, but may also be a string naming a file - or some other value). The @scheme[settings] argument is the current + or some other value). The @racket[settings] argument is the current settings for the language. - The @scheme[front-end/complete-program] method is expected to return a + The @racket[front-end/complete-program] method is expected to return a thunk that is called repeatedly to get all of the expressions in the program. When all expressions have been read, the thunk is expected to - return @scheme[eof]. + return @racket[eof]. This method is only called for programs in the definitions window. Notably, it is not called for programs that are - @scheme[load]ed or @scheme[eval]ed. See @scheme[current-load] and - @scheme[current-eval] for those. + @racket[load]ed or @racket[eval]ed. See @racket[current-load] and + @racket[current-eval] for those. This method is expected to raise an appropriate exception if the - program is malformed, eg an @scheme[exn:syntax] or @scheme[exn:read]. + program is malformed, eg an @racket[exn:syntax] or @racket[exn:read]. This is called on the user's thread, as is the thunk it returns. Implementations of this method should not return fully expanded expressions, since there are two forms of expansion, using either - @scheme[expand] or @scheme[expand-top-level-with-compile-time-evals] + @racket[expand] or @racket[expand-top-level-with-compile-time-evals] and the use of the expanded code dictates which applies. See also @method[drracket:language:language<%> front-end/interaction] @@ -574,7 +574,7 @@ DrRacket. been called. Specifically, @method[drracket:language:language<%> front-end/complete-program] is first called to get a thunk that reads from the program. That thunk is called some number of times, - eventually returning @scheme[eof], or raising an exception. Then, this + eventually returning @racket[eof], or raising an exception. Then, this method is called. This method is called on the user's main eventspace thread, and @@ -639,11 +639,11 @@ DrRacket. same will be combined into the same turndown entry. For example, if one language's position is: - @schemeblock[ + @racketblock[ (list "General Category" "Specific Category" "My Language") ] and another's is: - @schemeblock[ + @racketblock[ (list "General Category" "Specific Category" "My Other Language") ] The language dialog will collapse the first two elements in the list, @@ -658,7 +658,7 @@ DrRacket. Returns a url for the language. } @methimpl{ - If the result isn't @scheme[#f], the name of the language is clickable + If the result isn't @racket[#f], the name of the language is clickable in the interactions window and clicking takes you to this url. }} @@ -677,9 +677,9 @@ DrRacket. The string is expect to be a prefix to the file that sets up a reader for files in this language, using @tt{#reader}. - The @scheme[modname] argument's printed form is the same as the file's + The @racket[modname] argument's printed form is the same as the file's name, but without the path, and without an extension. The - @scheme[settings] argument is the current language's settings value. + @racket[settings] argument is the current language's settings value. See also @method[drracket:language:language<%> metadata->settings], @method[drracket:language:language<%> get-metadata-lines], and @@ -730,7 +730,7 @@ DrRacket. The style delta that this method returns is used in the language dialog and the DrRacket REPL when the language's name is printed. - When it is @scheme[#f], no styling is used. + When it is @racket[#f], no styling is used. If the result is a list, each element is expected to be a list of three items, a style-delta, and two numbers. The style delta will be @@ -761,17 +761,17 @@ DrRacket. @method[drracket:language:language<%> get-reader-module] returns an sexp, the prefix of the file (the first N lines, where N is the number returned by @method[drracket:language:language<%> get-metadata-lines]) - is scanned for @scheme["#reader"] followed by the result of + is scanned for @racket["#reader"] followed by the result of @method[drracket:language:language<%> get-reader-module]. If that pattern is found, the language is set to this language. Also, the entire prefix is passed, as a string, to this method which returns a - @scheme[settings] value, used as the settings for this language. + @racket[settings] value, used as the settings for this language. } @defmethod[(on-execute [settings settings] [run-on-user-thread ((-> any) -> any)]) any]{ - The @scheme[on-execute] method is called on DrRacket's eventspace's + The @racket[on-execute] method is called on DrRacket's eventspace's main thread before any evaluation happens when the Run button is clicked. It is also called when a new DrRacket tab (or window) is created to initialize the empty interactions window. @@ -782,49 +782,49 @@ DrRacket. already been created, as has its custodian. These parameters have been changed from the defaults in Racket: @itemize[ - @item{@scheme[current-custodian] is set to a new custodian.} - @item{@scheme[current-namespace] has been set to a newly created empty + @item{@racket[current-custodian] is set to a new custodian.} + @item{@racket[current-namespace] has been set to a newly created empty namespace. This namespace has the following modules copied (with - @scheme[namespace-attach-module]) from DrRacket's original + @racket[namespace-attach-module]) from DrRacket's original namespace: @itemize[ - @item{@scheme['mzscheme]} - @item{@scheme['mred]} + @item{@racket['mzscheme]} + @item{@racket['mred]} ]} - @item{@scheme[read-curly-brace-as-paren] is @scheme[#t],} - @item{@scheme[read-square-bracket-as-paren] is @scheme[#t],} - @item{The @scheme[port-write-handler] and @scheme[port-display-handler] - have been set to procedures that call @scheme[pretty-print] and - @scheme[pretty-display] instead of @scheme[write] and - @scheme[display]. When @scheme[pretty-print] and - @scheme[pretty-display] are called by these parameters, the - @scheme[pretty-print-columns] parameter is set to - @scheme['infinity], so the output looks just like @scheme[write] and - @scheme[display]. This is done so that special scheme values can be + @item{@racket[read-curly-brace-as-paren] is @racket[#t],} + @item{@racket[read-square-bracket-as-paren] is @racket[#t],} + @item{The @racket[port-write-handler] and @racket[port-display-handler] + have been set to procedures that call @racket[pretty-print] and + @racket[pretty-display] instead of @racket[write] and + @racket[display]. When @racket[pretty-print] and + @racket[pretty-display] are called by these parameters, the + @racket[pretty-print-columns] parameter is set to + @racket['infinity], so the output looks just like @racket[write] and + @racket[display]. This is done so that special scheme values can be displayed as snips.} - @item{The @scheme[current-print-covert-hook] is to a procedure so that - @scheme[snip%]s are just returned directly to be inserted into the - interactions @scheme[text%] object.} + @item{The @racket[current-print-covert-hook] is to a procedure so that + @racket[snip%]s are just returned directly to be inserted into the + interactions @racket[text%] object.} @item{The output and input ports are set to point to the interactions - window with these parameters: @scheme[current-input-port], - @scheme[current-output-port], and @scheme[current-error-port].} - @item{The @scheme[event-dispatch-handler] is set so that DrRacket can + window with these parameters: @racket[current-input-port], + @racket[current-output-port], and @racket[current-error-port].} + @item{The @racket[event-dispatch-handler] is set so that DrRacket can perform some initial setup and close down around the user's code.} - @item{The @scheme[current-directory] and - @scheme[current-load-relative-directory] are set to the directory + @item{The @racket[current-directory] and + @racket[current-load-relative-directory] are set to the directory where the definitions file is saved, or if it isn't saved, to the initial directory where DrRacket started up.} - @item{The snip-class-list, returned by @scheme[get-the-snip-class-list] + @item{The snip-class-list, returned by @racket[get-the-snip-class-list] is initialized with all of the snipclasses in DrRacket's eventspace's snip-class-list.} - @item{The @scheme[error-print-source-location] parameter is set to - @scheme[#f] and the @scheme[error-display-handler] is set to a + @item{The @racket[error-print-source-location] parameter is set to + @racket[#f] and the @racket[error-display-handler] is set to a handler that creates an error message from the exception record, with font and color information and inserts that error message into the definitions window.} ] - The @scheme[run-on-user-thread] arguments accepts thunks and runs them + The @racket[run-on-user-thread] arguments accepts thunks and runs them on the user's eventspace's main thread. The output ports are not yet functioning, so print outs should be directed to the original DrRacket output port, if necessary. @@ -869,7 +869,7 @@ DrRacket. @defmethod[(unmarshall-settings [input writable]) (or/c settings false/c)]{ - Translates a Racket value into a settings, returning @scheme[#f] if + Translates a Racket value into a settings, returning @racket[#f] if that is not possible. }} diff --git a/collects/scribblings/tools/module-language-tools.scrbl b/collects/scribblings/tools/module-language-tools.scrbl index 4c6540436e..f86fb289b1 100644 --- a/collects/scribblings/tools/module-language-tools.scrbl +++ b/collects/scribblings/tools/module-language-tools.scrbl @@ -3,14 +3,14 @@ @(tools-title "module-language-tools") -If the result of @scheme[read-language] for a language is a function, +If the result of @racket[read-language] for a language is a function, DrRacket will query it to determine if there are any new toolbar buttons to be used when editing files in this language (when DrRacket's language is set to the Module language). -Specifically, DrRacket will pass @indexed-scheme['drscheme:toolbar-buttons] +Specifically, DrRacket will pass @indexed-racket['drscheme:toolbar-buttons] to the function and expect back a value matching this contract: -@schemeblock[(listof (list/c string? +@racketblock[(listof (list/c string? (is-a?/c bitmap%) (-> (is-a?/c drracket:unit:frame<%>) any)))] which is then used to create new toolbar buttons, one for each list in the diff --git a/collects/scribblings/tools/rep.scrbl b/collects/scribblings/tools/rep.scrbl index 267f4ac9cb..9e6e9e1b74 100644 --- a/collects/scribblings/tools/rep.scrbl +++ b/collects/scribblings/tools/rep.scrbl @@ -40,8 +40,8 @@ Resets any error highlighting in this editor. @defmethod[(display-results [results (list-of TST)]) void?]{ -This displays each of the elements of @scheme[results] in the interactions -window, expect those elements of @scheme[results] that are void. Those +This displays each of the elements of @racket[results] in the interactions +window, expect those elements of @racket[results] that are void. Those are just ignored. @@ -59,7 +59,7 @@ submitted at the prompt. } @methimpl{ -The function @scheme[run-loop] is called. It is expected to loop, calling +The function @racket[run-loop] is called. It is expected to loop, calling its argument with a thunk that corresponds to the user's evaluation. It should call its argument once for each expression the user is evaluating. It should pass a thunk to its argument that @@ -80,11 +80,11 @@ This function evaluates all of the expressions in a text. } @methimpl{ -It evaluates all of the expressions in @scheme[text] starting at -@scheme[start] and ending at @scheme[end], calling +It evaluates all of the expressions in @racket[text] starting at +@racket[start] and ending at @racket[end], calling @method[drracket:rep:text% do-many-evals] to handle the evaluation. -The @scheme[complete-program?] argument determines if the +The @racket[complete-program?] argument determines if the @method[drracket:language:language<%> front-end/complete-program] method or the @method[drracket:language:language<%> front-end/interaction] method is called. @@ -95,12 +95,12 @@ The @scheme[complete-program?] argument determines if the [complete-program? boolean?] [cleanup (-> void)]) any]{ - Evaluates the program in the @scheme[port] argument. If @scheme[complete-program?] - is @scheme[#t], this method calls the + Evaluates the program in the @racket[port] argument. If @racket[complete-program?] + is @racket[#t], this method calls the @method[drracket:language:language<%> front-end/complete-program] to evaluate - the program. If it is @scheme[#f], it calls + the program. If it is @racket[#f], it calls @method[drracket:language:language<%> front-end/interaction] method. - When evaluation finishes, it calls @scheme[cleanup] on the user's main thread. + When evaluation finishes, it calls @racket[cleanup] on the user's main thread. This method must be called from the DrRacket main thread. } @@ -113,13 +113,13 @@ The @scheme[complete-program?] argument determines if the @defmethod[(on-execute [run-on-user-thread (-> any)]) any]{ - Use @scheme[run-on-user-thread] to initialize the user's parameters, etc. + Use @racket[run-on-user-thread] to initialize the user's parameters, etc. Called from the DrRacket thread after the language's @method[drracket:language:language<%> on-execute] method has been invoked, and after the special values have been setup (the ones registered - via @scheme[drracket:language:add-snip-value]). + via @racket[drracket:language:add-snip-value]). Do not print to @racket[current-output-port] or @racket[current-error-port] during the dynamic extent of the thunk passed to @racket[run-on-user-thread] becuase @@ -140,7 +140,7 @@ there can only be one highlighted error region at a time. } @methimpl{ -If @scheme[#f], no region is highlighted. If a list, the first +If @racket[#f], no region is highlighted. If a list, the first element is the editor where the range is highlighted and the second and third are the beginning and ending regions, respectively. @@ -184,7 +184,7 @@ This method returns the thread that the users code runs in. It is returns a different result, each time the user runs the program. -It is @scheme[#f] before the first time the user click on +It is @racket[#f] before the first time the user click on the Run button or the evaluation has been killed. This thread has all of its parameters initialized according to the @@ -312,7 +312,7 @@ See also } @methimpl{ -Calls @scheme[f], after switching to the user's thread. +Calls @racket[f], after switching to the user's thread. }} @@ -375,7 +375,7 @@ interactions windows.} @definterface[drracket:rep:context<%> ()]{ Objects that match this interface provide all of the services that the -@scheme[drracket:rep:text%] class needs to connect with its context. +@racket[drracket:rep:text%] class needs to connect with its context. @@ -460,7 +460,7 @@ user's program to be evaluated in. (or/c string? false/c)]{ This method should return an explanatory string when the state of the program that the repl reflects has changed. It -should return @scheme[#f] otherwise. +should return @racket[#f] otherwise. } diff --git a/collects/scribblings/tools/unit.scrbl b/collects/scribblings/tools/unit.scrbl index 4bcd8cbbef..453bcc836a 100644 --- a/collects/scribblings/tools/unit.scrbl +++ b/collects/scribblings/tools/unit.scrbl @@ -47,9 +47,9 @@ Enables the Run button, and the Run menu item and unlocks This text is initially the top half of the DrRacket window and contains the users program. -This text defaults to a @scheme[text%] +This text defaults to a @racket[text%] object, but if you change -@scheme[drracket:get/extend:extend-definitions-text] procedure, it will use the extended class to create the text. +@racket[drracket:get/extend:extend-definitions-text] procedure, it will use the extended class to create the text. } @@ -83,9 +83,9 @@ Returns the frame that this tab is inside. This text is initially the bottom half of the DrRacket window and contains the users interactions with the REPL. -This text defaults to a @scheme[drracket:rep:text%] +This text defaults to a @racket[drracket:rep:text%] object, but if you use the -@scheme[drracket:get/extend:extend-interactions-text] procedure, +@racket[drracket:get/extend:extend-interactions-text] procedure, it will use the extended class to create the text. } @@ -196,7 +196,7 @@ Resets an error highlighting. @defconstructor/auto-super[()]{ -Passes all arguments to @scheme[super-init]. +Passes all arguments to @racket[super-init]. }} @@ -208,11 +208,11 @@ This frame inserts the @onscreen{Racket} and @onscreen{Language} menus into the @defconstructor/auto-super[()]{ -Passes all arguments to @scheme[super-init]. +Passes all arguments to @racket[super-init]. } @defconstructor[()]{ -Passes all arguments to @scheme[super-init]. +Passes all arguments to @racket[super-init]. } @defmethod[#:mode override @@ -257,7 +257,7 @@ safe to call this at anytime, however. (edit-menu:between-select-all-and-find) void?]{ -Adds the @scheme["Split"] and @scheme["Collapse"] menu items. +Adds the @racket["Split"] and @racket["Collapse"] menu items. } @@ -287,7 +287,7 @@ It calls void?]{ Calls the super method and adds a -@scheme[separator-menu-item%] to the menu. +@racket[separator-menu-item%] to the menu. } @@ -322,7 +322,7 @@ and adds a separator item. (file-menu:print-string) void?]{ -returns @scheme["Definitions"] +returns @racket["Definitions"] } @@ -331,7 +331,7 @@ returns @scheme["Definitions"] (file-menu:save-as-string) void?]{ -Returns @scheme["Definitions"]. +Returns @racket["Definitions"]. } @@ -340,7 +340,7 @@ Returns @scheme["Definitions"]. (file-menu:save-string) void?]{ -Returns @scheme["Definitions"]. +Returns @racket["Definitions"]. } @@ -359,7 +359,7 @@ for important actions the user frequently executes. A tool can add a button to this panel to make some new functionality easily accessible to the user. -See also mrlib's @scheme[switchable-button%]. +See also mrlib's @racket[switchable-button%]. } @@ -378,7 +378,7 @@ Returns the result of (is-a?/c canvas%)]{ Returns the result of -@scheme[drracket:get/extend:get-definitions-canvas]. +@racket[drracket:get/extend:get-definitions-canvas]. } @@ -390,7 +390,7 @@ Returns the result of @methspec{ This method is provided so that tools can add -@scheme[area-container<%>]s to the DrRacket frame. Override this method so that it +@racket[area-container<%>]s to the DrRacket frame. Override this method so that it returns a child of the super-classes's result and insert new children in between. @@ -427,7 +427,7 @@ Returns the result of (is-a?/c editor<%>)]{ Returns the result of -@scheme[drracket:get/extend:get-definitions-text]. +@racket[drracket:get/extend:get-definitions-text]. } @@ -493,7 +493,7 @@ modified. Used in conjunction with @methimpl{ -Returns @scheme[#t] if the buffer is empty, it has not been +Returns @racket[#t] if the buffer is empty, it has not been saved and it is unmodified. @@ -503,10 +503,10 @@ saved and it is unmodified. void?]{ This method hides or shows the save button, based on -the @scheme[modified?] argument. +the @racket[modified?] argument. If the save button has not been created yet, it remembers -the @scheme[modified?] argument as an initial visibility for +the @racket[modified?] argument as an initial visibility for the save button. This method is called by the @@ -541,8 +541,8 @@ items based on the contents of the windows. @defmethod[(get-language-menu) (is-a?/c menu%)]{ Returns the language-specific menu. This menu is called the @onscreen{Racket} menu in the Racket language but is, in general, - controlled by the @scheme['drscheme:language-menu-title] - capability (see @scheme[drracket:language:register-capability] + controlled by the @racket['drscheme:language-menu-title] + capability (see @racket[drracket:language:register-capability] for details on capabilities). } @@ -576,7 +576,7 @@ Returns the currently active tab. } @defmethod[(get-tab-filename [i (<=/c 0 (#,(method drracket:unit:frame<%> get-tab-count)))]) string?]{ - Returns a string naming the file in the @scheme[i]th tab or, if + Returns a string naming the file in the @racket[i]th tab or, if the file is not saved, something like ``Untitled''. } @@ -585,7 +585,7 @@ Returns the currently active tab. } @defmethod[(open-in-new-tab [filename (or/c path-string? #f)]) void?]{ - Opens a new tab in this frame. If @scheme[filename] is a @scheme[path-string?], + Opens a new tab in this frame. If @racket[filename] is a @racket[path-string?], It loads that file in the definitions window of the new tab. } @@ -600,9 +600,9 @@ Returns the currently active tab. This canvas is the canvas containing the @method[drracket:unit:frame<%> get-definitions-text]. It is initially the top half of the DrRacket window. -This canvas defaults to a @scheme[drracket:unit:definitions-canvas%] +This canvas defaults to a @racket[drracket:unit:definitions-canvas%] object, but if you change the -@scheme[drracket:get/extend:extend-definitions-canvas] procedure, it will use the class in the parameter to create the canvas. +@racket[drracket:get/extend:extend-definitions-canvas] procedure, it will use the class in the parameter to create the canvas. } @@ -631,9 +631,9 @@ Returns the Insert menu. This canvas is the canvas containing the @method[drracket:unit:frame<%> get-interactions-text]. It is initially the bottom half of the DrRacket window. -This canvas defaults to a @scheme[drracket:unit:interactions-canvas%] +This canvas defaults to a @racket[drracket:unit:interactions-canvas%] object, but if you use the -@scheme[drracket:get/extend:extend-interactions-canvas] procedure, +@racket[drracket:get/extend:extend-interactions-canvas] procedure, it will use the extended class to create the canvas. @@ -667,8 +667,8 @@ Called after a new tab becomes the selected tab in the frame. @methimpl{ -The @scheme[from-tab] argument is the previously selected tab, and the - @scheme[to-tab] argument is the newly selected tab. +The @racket[from-tab] argument is the previously selected tab, and the + @racket[to-tab] argument is the newly selected tab. @@ -678,7 +678,7 @@ The @scheme[from-tab] argument is the previously selected tab, and the [menu (is-a? menu%)]) void?]{ Registers the menu item that was most recently added as -being controlled by the capability @scheme[key]. This means +being controlled by the capability @racket[key]. This means that the (boolean) value of the capability determines if the menu item is present in the menu (the capability is checked when the menus are cliked on). @@ -688,25 +688,25 @@ around, except by the this capability. If they are, things can go funny (i.e., no good checks are in place). Note that the capability must be registered separately, via -@scheme[drracket:language:register-capability]. +@racket[drracket:language:register-capability]. } @defmethod[(register-toolbar-button [tb (is-a?/c switchable-button%)]) void?]{ -Registers the toolbar button @scheme[tb]. This is required +Registers the toolbar button @racket[tb]. This is required so that the toolbar buttons properly switch orientation when the toolbar's position is moved. } @defmethod[(register-toolbar-buttons [tbs (listof (is-a?/c switchable-button%))]) void?]{ -Simultaneously registers the toolbar buttons @scheme[tbs]. This is required +Simultaneously registers the toolbar buttons @racket[tbs]. This is required so that the toolbar buttons properly switch orientation when the toolbar's position is moved. } @defmethod[(unregister-toolbar-button [tb (is-a?/c switchable-button%)]) void?]{ -Unregisters the toolbar button @scheme[tb]. Use this method to ensure +Unregisters the toolbar button @racket[tb]. Use this method to ensure that the button is not referenced by this frame and thus can be gc'd. } @@ -719,7 +719,7 @@ that the button is not referenced by this frame and thus can be gc'd. (drracket:unit:definitions-text<%>)]{ @defconstructor[()]{ -Passes all arguments to @scheme[super-init]. +Passes all arguments to @racket[super-init]. } @defmethod[#:mode override @@ -771,8 +771,8 @@ need to ignore changes that occur after this method is called, and before @method[drracket:unit:definitions-text<%> end-metadata-changes] is called. -A call to @scheme[begin-metadata-changes] will always be -followed with a call to @scheme[end-metadata-changes] (ie, +A call to @racket[begin-metadata-changes] will always be +followed with a call to @racket[end-metadata-changes] (ie, the calls cannot be nested). } @@ -783,8 +783,8 @@ Called when the changes to insert metadata are done, and the editor is back to its state at the time of the call to @method[drracket:unit:definitions-text<%> begin-metadata-changes]. -A call to @scheme[begin-metadata-changes] will always be -followed with a call to @scheme[end-metadata-changes] (ie, +A call to @racket[begin-metadata-changes] will always be +followed with a call to @racket[end-metadata-changes] (ie, the calls cannot be nested). } @@ -815,7 +815,7 @@ the program is next Run. @methimpl{ -Records @scheme[msg] and uses it the next time the user submits +Records @racket[msg] and uses it the next time the user submits an interaction (unless the Runs first). @@ -826,7 +826,7 @@ an interaction (unless the Runs first). void?]{ Changes the language settings for this window. If -@scheme[update-prefs?] is a true value, the preference is +@racket[update-prefs?] is a true value, the preference is changed, which affects newly created windows. See also diff --git a/collects/scriblib/scribblings/autobib.scrbl b/collects/scriblib/scribblings/autobib.scrbl index ae1a844f9f..bb741b384a 100644 --- a/collects/scriblib/scribblings/autobib.scrbl +++ b/collects/scriblib/scribblings/autobib.scrbl @@ -11,31 +11,31 @@ @defform[(define-cite ~cite-id citet-id generate-bibliography-id)]{ -Binds @scheme[~cite-id], @scheme[citet-id], and -@scheme[generate-bibliography-id], which share state to accumulate and +Binds @racket[~cite-id], @racket[citet-id], and +@racket[generate-bibliography-id], which share state to accumulate and render citations. -The function bound to @scheme[~cite-id] produces a citation referring +The function bound to @racket[~cite-id] produces a citation referring to one or more bibliography entries with a preceding non-breaking space, by default sorting the entries to match the bibliography order. It has the contract -@schemeblock[ +@racketblock[ (->* (bib?) (#:sort? any/c) #:rest (listof bib?) element?) ] -The function bound to @scheme[citet-id] generates an element suitable +The function bound to @racket[citet-id] generates an element suitable for use as a noun---referring to a document or its author---for one or more bibliography entries which share an author. It has the contract -@schemeblock[ +@racketblock[ (->* (bib?) () #:rest (listof bib?) element?) ] -The function bound to @scheme[generate-bibliography-id] generates the +The function bound to @racket[generate-bibliography-id] generates the section for the bibliography. It has the contract -@schemeblock[ +@racketblock[ (->* () (#:tag string? #:sec-title string?) part?) ] @@ -46,8 +46,8 @@ and for @racket[#:sec-title] is @racket["Bibliography"]. @defproc[(bib? [v any/c]) boolean?]{ -Returns @scheme[#t] if @scheme[v] is a value produced by -@scheme[make-bib] or @scheme[in-bib], @scheme[#f] otherwise.} +Returns @racket[#t] if @racket[v] is a value produced by +@racket[make-bib] or @racket[in-bib], @racket[#f] otherwise.} @defproc[(make-bib [#:title title any/c] @@ -59,13 +59,13 @@ Returns @scheme[#t] if @scheme[v] is a value produced by bib?]{ Produces a value that represents a document to cite. Except for -@scheme[is-book?] and @scheme[url], the arguments are used as -elements, except that @scheme[#f] means that the information is not -supplied. Functions like @scheme[proceedings-location], -@scheme[author-name], and @scheme[authors] help produce elements in a +@racket[is-book?] and @racket[url], the arguments are used as +elements, except that @racket[#f] means that the information is not +supplied. Functions like @racket[proceedings-location], +@racket[author-name], and @racket[authors] help produce elements in a standard format. -An element produced by a function like @scheme[author-name] tracks +An element produced by a function like @racket[author-name] tracks first, last names, and name suffixes separately, so that names can be ordered and rendered correctly. When a string is provided as an author name, the last non-empty sequence of alphabetic characters or @@ -75,7 +75,7 @@ rest is treated as the first name.} @defproc[(in-bib [orig bib?] [where string?]) bib?]{ Extends a bib value so that the rendered citation is suffixed with -@scheme[where], which might be a page or chapter number.} +@racket[where], which might be a page or chapter number.} @defproc[(proceedings-location [location any/c] [#:pages pages (or (list/c any/c any/c) #f) #f] @@ -132,8 +132,8 @@ suffix (such as ``Jr.'').} @defproc[(authors [name any/c] ...) element?]{ Combines multiple author elements into one, so that it is rendered and -alphabetized appropriately. If a @scheme[name] is a string, it is -parsed in the same way as by @scheme[make-bib].} +alphabetized appropriately. If a @racket[name] is a string, it is +parsed in the same way as by @racket[make-bib].} @defproc[(org-author-name [name any/c]) element?]{ @@ -143,11 +143,11 @@ as a bib-value author.} @defproc[(other-authors) element?]{ Generates an element that is suitable for use as a ``others'' author. -When combined with another author element via @scheme[authors], the -one created by @scheme[other-authors] renders as ``et al.''} +When combined with another author element via @racket[authors], the +one created by @racket[other-authors] renders as ``et al.''} @defproc[(editor [name name/c]) element?]{ Takes an author-name element and create one that represents the editor -of a collection. If a @scheme[name] is a string, it is parsed in the -same way as by @scheme[make-bib].} +of a collection. If a @racket[name] is a string, it is parsed in the +same way as by @racket[make-bib].} diff --git a/collects/scriblib/scribblings/figure.scrbl b/collects/scriblib/scribblings/figure.scrbl index 2f79c39af7..9f8d936ead 100644 --- a/collects/scriblib/scribblings/figure.scrbl +++ b/collects/scriblib/scribblings/figure.scrbl @@ -17,19 +17,19 @@ block?] @defproc[(figure-here [tag string?] [caption content?] [pre-flow pre-flow?] ...) block?] )]{ -Creates a figure. The given @scheme[tag] is for use with -@scheme[figure-ref] or @scheme[Figure-ref]. The @scheme[caption] is an -element. The @scheme[pre-flow] is decoded as a flow. +Creates a figure. The given @racket[tag] is for use with +@racket[figure-ref] or @racket[Figure-ref]. The @racket[caption] is an +element. The @racket[pre-flow] is decoded as a flow. -For HTML output, the @scheme[figure] and @scheme[figure*] functions -center the figure content, while @scheme[figure**] allows the content +For HTML output, the @racket[figure] and @racket[figure*] functions +center the figure content, while @racket[figure**] allows the content to be wider than the document body. -For two-column Latex output, @scheme[figure*] and @scheme[figure**] +For two-column Latex output, @racket[figure*] and @racket[figure**] generate a figure that spans columns. -For Latex output, @scheme[figure-here] generates a figure to be included at -the position in the output text where the @scheme[figure-here] occurs -in the source text. For HTML output, all @scheme[figure] variants +For Latex output, @racket[figure-here] generates a figure to be included at +the position in the output text where the @racket[figure-here] occurs +in the source text. For HTML output, all @racket[figure] variants place the figure where the use appears in the source text.} @@ -46,4 +46,4 @@ Generates a reference to a figure, capitalizing the word ``Figure''.} @defproc[(Figure-target [tag string?]) element?]{ Generates a new figure label. This function is normally not used -directly, since it is used by @scheme[figure].} +directly, since it is used by @racket[figure].} diff --git a/collects/scriblib/scribblings/gui-eval.scrbl b/collects/scriblib/scribblings/gui-eval.scrbl index 8c1d2226cf..29dba0f616 100644 --- a/collects/scriblib/scribblings/gui-eval.scrbl +++ b/collects/scriblib/scribblings/gui-eval.scrbl @@ -4,11 +4,11 @@ @title[#:tag "gui-eval"]{Examples Using the GUI Toolbox} @defmodule[scriblib/gui-eval]{The -@schememodname[scriblib/gui-eval] library support example -evaluations that use @schememodname[racket/gui] facilities (as opposed +@racketmodname[scriblib/gui-eval] library support example +evaluations that use @racketmodname[racket/gui] facilities (as opposed to just @racketmodname[racket/draw]) to generate text and image results.} -The trick is that @schememodname[racket/gui] is not generally +The trick is that @racketmodname[racket/gui] is not generally available when rendering documentation, because it requires a GUI context. Text and image output is rendered to an image file when the @envvar{MREVAL} environment variable is set, so run the enclosing @@ -33,13 +33,13 @@ generated image. #:eval+opts the-eval get-predicate? get-render get-get-width get-get-height datum ...))] -@defform*[((gui-schemeblock+eval datum ...) - (gui-schemeblock+eval +@defform*[((gui-racketblock+eval datum ...) + (gui-racketblock+eval #:eval+opts the-eval get-predicate? get-render get-get-width get-get-height datum ...))] -@defform*[((gui-schememod+eval datum ...) - (gui-schememod+eval +@defform*[((gui-racketmod+eval datum ...) + (gui-racketmod+eval #:eval+opts the-eval get-predicate? get-render get-get-width get-get-height datum ...))] @@ -56,25 +56,25 @@ generated image. )]{ The first option of each of the above is -like @scheme[interaction], etc., but actually evaluating the forms +like @racket[interaction], etc., but actually evaluating the forms only when the @envvar{MREVAL} environment variable is set, and then in -an evaluator that is initialized with @schememodname[racket/gui/base] -and @schememodname[slideshow]. +an evaluator that is initialized with @racketmodname[racket/gui/base] +and @racketmodname[slideshow]. The second option of each allows you to specify your own evaluator via -the @scheme[the-eval] argument and then to specify four thunks that +the @racket[the-eval] argument and then to specify four thunks that return functions for finding and rendering graphical objects: @itemize[ - @item{@scheme[get-predicate? : (-> (-> any/c boolean?))] + @item{@racket[get-predicate? : (-> (-> any/c boolean?))] Determines if a value is a graphical object (and thus handled by the other operations)} - @item{@scheme[get-render : (-> (-> any/c (is-a?/c dc<%>) number? number? void?))] - Draws a graphical object (only called if the predicate returned @scheme[#t]; the first + @item{@racket[get-render : (-> (-> any/c (is-a?/c dc<%>) number? number? void?))] + Draws a graphical object (only called if the predicate returned @racket[#t]; the first argument will be the value for which the predicate holds).} - @item{@scheme[get-get-width : (-> (-> any/c number?))] - Gets the width of a graphical object (only called if the predicate returned @scheme[#t]; the first + @item{@racket[get-get-width : (-> (-> any/c number?))] + Gets the width of a graphical object (only called if the predicate returned @racket[#t]; the first argument will be the value for which the predicate holds).} - @item{@scheme[get-get-height : (-> (-> any/c number?))] - Gets the height of a graphical object (only called if the predicate returned @scheme[#t]; the first + @item{@racket[get-get-height : (-> (-> any/c number?))] + Gets the height of a graphical object (only called if the predicate returned @racket[#t]; the first argument will be the value for which the predicate holds).} ] diff --git a/collects/sgl/scribblings/sgl.scrbl b/collects/sgl/scribblings/sgl.scrbl index 59c9f65ea4..454e7322ea 100644 --- a/collects/sgl/scribblings/sgl.scrbl +++ b/collects/sgl/scribblings/sgl.scrbl @@ -5,15 +5,15 @@ @author["Scott Owens"] -The @schememodname[sgl] libraries provide access to the rendering +The @racketmodname[sgl] libraries provide access to the rendering functions of @as-index{OpenGL} 1.5 and @as-index{GLU} 1.3 -libraries. The @schememodname[sgl] libraries to not address +libraries. The @racketmodname[sgl] libraries to not address system-level concerns, such as the attachment of GL rendering contexts to displays. Instead, the libraries should work with any Racket extension that provides GL with access to the system (such as a -binding for @tt{glx}). Notably, the @schememodname[racket/gui/base] +binding for @tt{glx}). Notably, the @racketmodname[racket/gui/base] library provides support for rendering contexts via the -@scheme[canvas%] class and its @method[canvas% with-gl-context] +@racket[canvas%] class and its @method[canvas% with-gl-context] method. @table-of-contents[] diff --git a/collects/slatex/slatex-wrap.scrbl b/collects/slatex/slatex-wrap.scrbl index b8280e5aab..fb4d7f085b 100644 --- a/collects/slatex/slatex-wrap.scrbl +++ b/collects/slatex/slatex-wrap.scrbl @@ -32,27 +32,27 @@ launcher called (PDF-SLaTeX/pdf-slatex). @defproc[(pdf-slatex (filename string?)) boolean?])]{ Accepts a string naming a file and runs @slatex and @latex on the -file. It calls @scheme[filename->latex-filename] on @scheme[filename]. +file. It calls @racket[filename->latex-filename] on @racket[filename]. -@scheme[pdf-slatex] is like @scheme[slatex] except that it calls +@racket[pdf-slatex] is like @racket[slatex] except that it calls @pdflatex rather than @latex, and produces PDF output instead of PS output.} @defproc[(slatex/no-latex (filename string?)) void?]{ -Runs @slatex on the file named by @scheme[filename], without calling +Runs @slatex on the file named by @racket[filename], without calling @|latex|. That is, it only processes the @filepath{.tex} file to produce the @filepath{.Z} files. It calls -@scheme[filename->latex-filename] on @scheme[filename].} +@racket[filename->latex-filename] on @racket[filename].} @deftogether[( @defproc[(latex (filename string?)) boolean?] @defproc[(pdf-latex (filename string?)) boolean?])]{ -Runs @latex on the file named by @scheme[filename]. It calls -@scheme[filename->latex-filename] on @scheme[filename]. +Runs @latex on the file named by @racket[filename]. It calls +@racket[filename->latex-filename] on @racket[filename]. -@scheme[pdf-latex] is like @scheme[latex] except that it calls +@racket[pdf-latex] is like @racket[latex] except that it calls @pdflatex rather than @latex, and produces PDF output instead of PS output.} diff --git a/collects/srfi/srfi.scrbl b/collects/srfi/srfi.scrbl index a523248189..d8167eb939 100644 --- a/collects/srfi/srfi.scrbl +++ b/collects/srfi/srfi.scrbl @@ -40,7 +40,7 @@ (case-lambda [() (in-core ".")] [(k) @elem{This SRFI's bindings are also available in - @schememodname[scheme/base]@|k|}])) + @racketmodname[scheme/base]@|k|}])) @(begin (define-syntax-rule (def-mz mz-if) @@ -62,8 +62,8 @@ Racket is distributed with implementations of many SRFIs, most of which can be implemented as libraries. To import the bindings of SRFI @math{n}, use -@schemeblock[ -(require @#,elem{@schemeidfont{srfi/}@math{n}}) +@racketblock[ +(require @#,elem{@racketidfont{srfi/}@math{n}}) ] This document lists the SRFIs that are supported by Racket and @@ -76,11 +76,11 @@ distributed as part of Racket's documentation). @srfi[1]{List Library} -This SRFI works with pairs and lists as in @schememodname[scheme] and -@schememodname[mzscheme], which are immutable, so it does not export -@schemeidfont{set-car!} and @schemeidfont{set-cdr!}. The other -provided bindings that end in @schemeidfont{!} are equivalent to the -corresponding bindings without @schemeidfont{!}. +This SRFI works with pairs and lists as in @racketmodname[scheme] and +@racketmodname[mzscheme], which are immutable, so it does not export +@racketidfont{set-car!} and @racketidfont{set-cdr!}. The other +provided bindings that end in @racketidfont{!} are equivalent to the +corresponding bindings without @racketidfont{!}. @redirect[1 '( (cons #f "cons") @@ -230,7 +230,7 @@ corresponding bindings without @schemeidfont{!}. )] This SRFI's reader and printer syntax is not supported. The bindings -are also available from @schememodname[scheme/foreign]. +are also available from @racketmodname[scheme/foreign]. @; ---------------------------------------- @@ -566,7 +566,7 @@ are also available from @schememodname[scheme/foreign]. )] Take care NOT to confuse the internal date structure with the -Racket @scheme[date]; they are not the same, and all procedures +Racket @racket[date]; they are not the same, and all procedures from the SRFI library expect the former. @; ---------------------------------------- @@ -717,7 +717,7 @@ This SRFI's syntax is part of Racket's default reader and printer. (stream-filter #f "stream-filter") )] -Superceded by @schememodname[srfi/41]. +Superceded by @racketmodname[srfi/41]. @; ---------------------------------------- @@ -812,9 +812,9 @@ same as from @racketmodname[racket/stream]. (:until #t ":until") )] -Forms that syntactically detect @scheme[if] recognize both @scheme[if] -from @schememodname[scheme/base] and @mz-if from -@schememodname[mzscheme]. +Forms that syntactically detect @racket[if] recognize both @racket[if] +from @racketmodname[scheme/base] and @mz-if from +@racketmodname[mzscheme]. @; ---------------------------------------- @@ -873,7 +873,7 @@ from @schememodname[scheme/base] and @mz-if from Additional binding: @defproc[(promise? [v any/c]) boolean?]{ -Returns @scheme[#t] if @scheme[v] is a promise, @scheme[#f] otherwise.} +Returns @racket[#t] if @racket[v] is a promise, @racket[#f] otherwise.} @; ---------------------------------------- @@ -924,7 +924,7 @@ Returns @scheme[#t] if @scheme[v] is a promise, @scheme[#f] otherwise.} Original specification: @link["../srfi-std/srfi-62.html"]{SRFI 62} This SRFI's syntax is part of Racket's default reader (no -@scheme[require] is needed). +@racket[require] is needed). @; ---------------------------------------- diff --git a/collects/swindle/swindle.scrbl b/collects/swindle/swindle.scrbl index 3460330c9d..49f25c6cd9 100644 --- a/collects/swindle/swindle.scrbl +++ b/collects/swindle/swindle.scrbl @@ -24,65 +24,66 @@ only a subset of the system is needed. @itemize[ @item{Some basic syntax extensions, including lambda &-keywords, and - improved @scheme[define] and @scheme[let] forms. (Available - separately using @scheme[swindle/base])} + improved @racket[define] and @racket[let] forms. (Available + separately using @racket[swindle/base])} -@item{Generic setters with @scheme[set!], additional useful mutation - forms: @scheme[pset!], @scheme[shift!], @scheme[rotate!], and some - simple ones like @scheme[inc!], and @scheme[push!]. (Available - separately using @scheme[swindle/setf], where the names - @scheme[setf!] and @scheme[psetf!] are used to avoid changing the +@item{Generic setters with @racket[set!], additional useful mutation + forms: @racket[pset!], @racket[shift!], @racket[rotate!], and some + simple ones like @racket[inc!], and @racket[push!]. (Available + separately using @racket[swindle/setf], where the names + @racket[setf!] and @racket[psetf!] are used to avoid changing the Racket form)} -@item{Easy macro-defining macros --- simple @scheme[syntax-rules] macros with - @scheme[defsubst], and a generic @scheme[defmacro] utility, all with a local - @scheme[let...] form, and extended to easily create symbol macros. - (@scheme[swindle/misc])} +@item{Easy macro-defining macros --- simple @racket[syntax-rules] macros with + @racket[defsubst], and a generic @racket[defmacro] utility, all with a local + @racket[let...] form, and extended to easily create symbol macros. + (@racket[swindle/misc])} -@item{A @scheme[collect] macro that provides very sophisticated list - comprehensions and much more. (@scheme[swindle/misc])} +@item{A @racket[collect] macro that provides very sophisticated list + comprehensions and much more. (@racket[swindle/misc])} -@item{An @scheme[echo] mechanism which is an alternative to using +@item{An @racket[echo] mechanism which is an alternative to using format strings, and contains many useful features including a list iteration construct, and is easy to extend. - (@scheme[swindle/misc])} + (@racket[swindle/misc])} -@item{A @scheme[regexp-case] syntax which is similar to a - @scheme[case] on strings with easy access to submatches. - (@scheme[swindle/misc])} +@item{A @racket[regexp-case] syntax which is similar to a + @racket[case] on strings with easy access to submatches. + (@racket[swindle/misc])} @item{A CLOS-like object system -- based on Tiny CLOS, but with many extensions that bring it much closer to CLOS, and heavily optimized. Some added features include singleton and struct classes, applicable stand-alone methods, method-combination, and some MOP extensions. - (Available without syntax bindings in @scheme[swindle/tiny-clos])} + (Available without syntax bindings in @racket[swindle/tiny-clos])} @item{Good integration with the Racket implementation: primitive values have corresponding Swindle classes, and struct types can also be used as type specializers. A Swindle class will be made when needed, and it will reflect the struct hierarchy. In addition, - structs can be defined with a Swindle-line @scheme[defstruct] syntax which + structs can be defined with a Swindle-line @racket[defstruct] syntax which will also make it possible to create these structs with - @scheme[make] using keyword arguments. (@scheme[swindle/tiny-clos] - and @scheme[swindle/extra])} + @racket[make] using keyword arguments. (@racket[swindle/tiny-clos] + and @racket[swindle/extra])} @item{Many hairy macros that make the object system much more convenient (CLOS has also a lot of macro code). Some of the macros (especially - @scheme[defclass]) can be customized. (@scheme[swindle/clos])} + @racket[defclass]) can be customized. (@racket[swindle/clos])} -@item{Useful generic functions, including @scheme[print-object] which - is used to display all objects. (@scheme[swindle/extra])} +@item{Useful generic functions, including @racket[print-object] which + is used to display all objects. (@racket[swindle/extra])} -@item{A @scheme[match] mechanism with a generic-like interface. - (@scheme[swindle/extra])} +@item{A @racket[match] mechanism with a generic-like interface. + (@racket[swindle/extra])} -@item{The fun @scheme[amb] toy. (@scheme[swindle/extra])} +@item{The fun @racket[amb] toy. (@racket[swindle/extra])} @item{A language that can easily create HTML, where the result is - human-editable. (@scheme[swindle/html])} + human-editable. (@racket[swindle/html])} @item{Customizable syntax: easy to add customized languages to DrRacket. - (@scheme[custom])} + (@racket[custom])} + ] @@ -97,50 +98,50 @@ whole Swindle environment. @itemize[ -@item{@scheme[swindle/base] (language module) --- +@item{@racket[swindle/base] (language module) --- Basic syntax extensions, mainly Lisp-like lambda argument &-keywords.} -@item{@scheme[swindle/setf] (module) --- - Generic setters similar to @scheme[setf] in Lisp, and a few more useful +@item{@racket[swindle/setf] (module) --- + Generic setters similar to @racket[setf] in Lisp, and a few more useful macros.} -@item{@scheme[swindle/misc] (module) --- Lots of useful functionality +@item{@racket[swindle/misc] (module) --- Lots of useful functionality bits, including everything from frequently useful Racket legacy - libraries (@schememodname[mzlib/list], @schememodname[mzlib/etc], - and @schememodname[mzlib/string]).} + libraries (@racketmodname[mzlib/list], @racketmodname[mzlib/etc], + and @racketmodname[mzlib/string]).} -@item{@scheme[swindle/turbo] (language module) --- A module that - packages functionality from @scheme[swindle/base], - @scheme[swindle/setf] (overriding @scheme[set!] with - @scheme[setf!]), and @scheme[swindle/misc].} +@item{@racket[swindle/turbo] (language module) --- A module that + packages functionality from @racket[swindle/base], + @racket[swindle/setf] (overriding @racket[set!] with + @racket[setf!]), and @racket[swindle/misc].} -@item{@scheme[swindle/tiny-clos] (module) --- +@item{@racket[swindle/tiny-clos] (module) --- The core object system, based on Tiny CLOS from Xerox, but heavily modified, optimized and extended.} -@item{@scheme[swindle/clos] (module) --- Convenient macro wrappers for - @scheme[swindle/tiny-clos].} +@item{@racket[swindle/clos] (module) --- Convenient macro wrappers for + @racket[swindle/tiny-clos].} -@item{@scheme[swindle/extra] (module) --- Extra functionality on top - of @scheme[swindle/clos].} +@item{@racket[swindle/extra] (module) --- Extra functionality on top + of @racket[swindle/clos].} -@item{@scheme[swindle/swindle] (language module) --- The main Swindle - environment module: packages @scheme[swindle/tiny-clos], - @scheme[swindle/clos], and @scheme[swindle/extra] on top of - @scheme[swindle/turbo], and some more general definitions.} +@item{@racket[swindle/swindle] (language module) --- The main Swindle + environment module: packages @racket[swindle/tiny-clos], + @racket[swindle/clos], and @racket[swindle/extra] on top of + @racket[swindle/turbo], and some more general definitions.} -@item{@scheme[swindle/info] (module) --- +@item{@racket[swindle/info] (module) --- Compilation definitions.} -@item{@scheme[swindle/tool] (module) --- +@item{@racket[swindle/tool] (module) --- Setup for Swindle in DrRacket: makes some languages available in DrRacket, including custom Swindle-based languages.} -@item{@scheme[swindle/custom] (module) --- +@item{@racket[swindle/custom] (module) --- A sample file that demonstrates how to create a Swindle-based customized language; see the source for instructions.} -@item{@scheme[swindle/html] (module) --- +@item{@racket[swindle/html] (module) --- A language for creating HTML.} ] diff --git a/collects/syntax-color/syntax-color.scrbl b/collects/syntax-color/syntax-color.scrbl index 39773e839d..80ef6a86f2 100644 --- a/collects/syntax-color/syntax-color.scrbl +++ b/collects/syntax-color/syntax-color.scrbl @@ -15,7 +15,7 @@ @author["Scott Owens"] The @filepath{syntax-color} collection provides the underlying data -structures and some helpful utilities for the @scheme[color:text%] +structures and some helpful utilities for the @racket[color:text%] class of the @other-manual['(lib "scribblings/framework/framework.scrbl")]. @@ -27,7 +27,7 @@ class of the @other-manual['(lib @defclass[paren-tree% object% ()] -Parenthesis matching code built on top of @scheme[token-tree%]. +Parenthesis matching code built on top of @racket[token-tree%]. @; ---------------------------------------------------------------------- @@ -44,23 +44,23 @@ Parenthesis matching code built on top of @scheme[token-tree%]. A lexer for Scheme, including reader extensions (@secref[#:doc'(lib "scribblings/reference/reference.scrbl")]{Reader_Extension}), built -specifically for @scheme[color:text%]. +specifically for @racket[color:text%]. -The @scheme[scheme-lexer] function returns 5 values: +The @racket[scheme-lexer] function returns 5 values: @itemize[ @item{Either a string containing the matching text or the eof object. Block comments and specials currently return an empty string. This may change in the future to other string or non-string data.} - @item{A symbol in @scheme['(error comment sexp-comment + @item{A symbol in @racket['(error comment sexp-comment white-space constant string no-color parenthesis other symbol eof)].} - @item{A symbol in @scheme['(|(| |)| |[| |]| |{| |}|)] or @scheme[#f].} + @item{A symbol in @racket['(|(| |)| |[| |]| |{| |}|)] or @racket[#f].} - @item{A number representing the starting position of the match (or @scheme[#f] if eof).} + @item{A number representing the starting position of the match (or @racket[#f] if eof).} - @item{A number representing the ending position of the match (or @scheme[#f] if eof).}] + @item{A number representing the ending position of the match (or @racket[#f] if eof).}] } @@ -72,7 +72,7 @@ The @scheme[scheme-lexer] function returns 5 values: (or/c number? false/c) (or/c 'datum 'open 'close 'continue))]{ -Like @scheme[scheme-lexer], but returns an extra value. The last +Like @racket[scheme-lexer], but returns an extra value. The last return value indicates whether the consumed token should count as a datum, an opening parenthesis (or similar starting token to group other tokens), a closing parenthesis (or similar), or a prefix (such @@ -86,9 +86,9 @@ as whitespace) on a datum.} (or/c number? false/c) (or/c 'datum 'open 'close 'continue))]{ -Like @scheme[scheme-lexer/status], but for a dialect of Scheme where +Like @racket[scheme-lexer/status], but for a dialect of Scheme where @litchar{|} is a delimiter instead of quoting syntax for a symbol. -This function is used by @scheme[scribble-lexer].} +This function is used by @racket[scribble-lexer].} @section{Default lexer} @@ -103,24 +103,24 @@ This function is used by @scheme[scribble-lexer].} A lexer that only identifies @litchar{(}, @litchar{)}, @litchar{[}, @litchar{]}, @litchar["{"], and @litchar["}"] built specifically for -@scheme[color:text%]. +@racket[color:text%]. -@scheme[default-lexer] returns 5 values: +@racket[default-lexer] returns 5 values: @itemize[ @item{Either a string containing the matching text or the eof object. Block specials currently return an empty string. This may change in the future to other string or non-string data.} - @item{A symbol in @scheme['(comment white-space no-color eof)].} + @item{A symbol in @racket['(comment white-space no-color eof)].} - @item{A symbol in @scheme['(|(| |)| |[| |]| |{| |}|)] or @scheme[#f].} + @item{A symbol in @racket['(|(| |)| |[| |]| |{| |}|)] or @racket[#f].} - @item{A number representing the starting position of the match (or @scheme[#f] if eof).} + @item{A number representing the starting position of the match (or @racket[#f] if eof).} + + @item{A number representing the ending position of the match (or @racket[#f] if eof).}] - @item{A number representing the ending position of the match (or @scheme[#f] if eof).}] - @section{Module Lexer} @defmodule[syntax-color/module-lexer] @@ -140,44 +140,44 @@ A lexer that only identifies @litchar{(}, @litchar{)}, @litchar{[}, (-> input-port? any) (cons/c (-> input-port? any/c any) any/c)))]{ -Like @scheme[scheme-lexer], but with several differences: +Like @racket[scheme-lexer], but with several differences: @itemize[ - @item{The @scheme[module-lexer] function accepts an offset and lexer + @item{The @racket[module-lexer] function accepts an offset and lexer mode, instead of just an input port.} @item{In addition to the results of @racket[scheme-lexer], - @scheme[module-lexer] returns a backup distance and a new lexer + @racket[module-lexer] returns a backup distance and a new lexer mode.} - @item{When @scheme[mode] is @scheme[#f] (indicating the start of the - stream), the lexer checks @scheme[in] for a @hash-lang[] + @item{When @racket[mode] is @racket[#f] (indicating the start of the + stream), the lexer checks @racket[in] for a @hash-lang[] specification. If a @hash-lang[] line is present but the specified - language does not exist, the entire @scheme[in] input is - consumed and colored as @scheme['error]. + language does not exist, the entire @racket[in] input is + consumed and colored as @racket['error]. If the language exists and the language provides a - @scheme[get-info] function, then it is called with - @scheme['color-lexer]. If the result is not @scheme[#f], then + @racket[get-info] function, then it is called with + @racket['color-lexer]. If the result is not @racket[#f], then it should be a lexer function for use with - @scheme[color:text%]. The result mode is the lexer---paired - with @scheme[#f] if the lexer is a procedure arity 3---so that + @racket[color:text%]. The result mode is the lexer---paired + with @racket[#f] if the lexer is a procedure arity 3---so that future calls will dispatch to the language-supplied lexer. If the language is specified but it provides no - @scheme[get-info] or @scheme['color-lexer] result, then - @scheme[scheme-lexer] is returned as the mode.} + @racket[get-info] or @racket['color-lexer] result, then + @racket[scheme-lexer] is returned as the mode.} - @item{When @scheme[mode] is a lexer procedure, the lexer is applied - to @scheme[in]. The lexer's results are returned, plus the + @item{When @racket[mode] is a lexer procedure, the lexer is applied + to @racket[in]. The lexer's results are returned, plus the lexer again as the mode.} - @item{When @scheme[mode] is a pair, then the lexer procedure in the - @scheme[car] is applied to @scheme[in], @scheme[offset], and the mode in the - @scheme[cdr]. The lexer's results are returned, except that its + @item{When @racket[mode] is a pair, then the lexer procedure in the + @racket[car] is applied to @racket[in], @racket[offset], and the mode in the + @racket[cdr]. The lexer's results are returned, except that its mode result is paired back with the lexer procedure.} ]} @@ -197,7 +197,7 @@ Like @scheme[scheme-lexer], but with several differences: exact-nonnegative-integer? any/c)]{ -Like @scheme[scheme-lexer], but for Scheme extended with Scribbles +Like @racket[scheme-lexer], but for Scheme extended with Scribbles @"@" notation (see @secref[#:doc '(lib "scribblings/scribble/scribble.scrbl") "reader"]).} @@ -212,7 +212,7 @@ Like @scheme[scheme-lexer], but for Scheme extended with Scribbles exact-nonnegative-integer? any/c)]{ -Like @scheme[scribble-lexer], but starting in ``text'' mode instead of +Like @racket[scribble-lexer], but starting in ``text'' mode instead of Scheme mode.} @; ---------------------------------------------------------------------- @@ -240,8 +240,8 @@ FIXME: many methods are not yet documented. @defmethod[(search! [key-position natural-number/c]) void?]{ Splays, setting the root node to be the closest node to - offset @scheme[key-position] (i.e., making the total length of - the left tree at least @scheme[key-position], if possible). + offset @racket[key-position] (i.e., making the total length of + the left tree at least @racket[key-position], if possible). } } @@ -255,26 +255,26 @@ FIXME: many methods are not yet documented. @defproc[(node-right [n node?]) (or/c node? false/c)] )]{ -Functions for working with nodes in a @scheme[token-tree%].} +Functions for working with nodes in a @racket[token-tree%].} @defproc[(insert-first! [tree1 (is-a?/c token-tree%)] [tree2 (is-a?/c token-tree%)]) void?]{ -Inserts @scheme[tree1] into @scheme[tree2] as the first thing, setting -@scheme[tree2]'s root to @scheme[#f].} +Inserts @racket[tree1] into @racket[tree2] as the first thing, setting +@racket[tree2]'s root to @racket[#f].} @defproc[(insert-last! [tree1 (is-a?/c token-tree%)] [tree2 (is-a?/c token-tree%)]) void?]{ -Inserts @scheme[tree1] into @scheme[tree2] as the last thing, setting -@scheme[tree2]'s root to @scheme[#f].} +Inserts @racket[tree1] into @racket[tree2] as the last thing, setting +@racket[tree2]'s root to @racket[#f].} @defproc[(insert-last-spec! [tree (is-a?/c token-tree%)] [n natural-number/c] [v any/c]) void?]{ -Same as @scheme[(insert-last! tree (new token-tree% [length n] [data +Same as @racket[(insert-last! tree (new token-tree% [length n] [data v]))]. This optimization is important for the colorer.} diff --git a/collects/syntax/scribblings/boundmap.scrbl b/collects/syntax/scribblings/boundmap.scrbl index 5db59cb4de..533fcdb31c 100644 --- a/collects/syntax/scribblings/boundmap.scrbl +++ b/collects/syntax/scribblings/boundmap.scrbl @@ -1,10 +1,10 @@ #lang scribble/doc @(require "common.rkt" (for-label syntax/boundmap)) -@title[#:tag "boundmap"]{Hashing on @scheme[bound-identifier=?] and @scheme[free-identifier=?]} +@title[#:tag "boundmap"]{Hashing on @racket[bound-identifier=?] and @racket[free-identifier=?]} -See also @schememodname[syntax/id-table] for an implementation of -identifier mappings using the @schememodname[scheme/dict] dictionary +See also @racketmodname[syntax/id-table] for an implementation of +identifier mappings using the @racketmodname[scheme/dict] dictionary interface. @defmodule[syntax/boundmap] @@ -14,7 +14,7 @@ interface. Produces a hash-table-like value for storing a mapping from syntax identifiers to arbitrary values. -The mapping uses @scheme[bound-identifier=?] to compare mapping keys, +The mapping uses @racket[bound-identifier=?] to compare mapping keys, but also uses a hash table based on symbol equality to make the mapping efficient in the common case (i.e., where non-equivalent identifiers are derived from different symbolic names).} @@ -22,8 +22,8 @@ identifiers are derived from different symbolic names).} @defproc[(bound-identifier-mapping? [v any/c]) boolean?]{ -Returns @scheme[#t] if @scheme[v] was produced by -@scheme[make-bound-identifier-mapping], @scheme[#f] otherwise.} +Returns @racket[#t] if @racket[v] was produced by +@racket[make-bound-identifier-mapping], @racket[#f] otherwise.} @defproc[(bound-identifier-mapping-get [bound-map bound-identifier-mapping?] @@ -31,7 +31,7 @@ Returns @scheme[#t] if @scheme[v] was produced by [failure-thunk any/c (lambda () (raise (make-exn:fail ....)))]) any]{ -Like @scheme[hash-table-get] for bound-identifier mappings.} +Like @racket[hash-table-get] for bound-identifier mappings.} @defproc[(bound-identifier-mapping-put! [bound-map bound-identifier-mapping?] @@ -39,20 +39,20 @@ Like @scheme[hash-table-get] for bound-identifier mappings.} [v any/c]) void?]{ -Like @scheme[hash-table-put!] for bound-identifier mappings.} +Like @racket[hash-table-put!] for bound-identifier mappings.} @defproc[(bound-identifier-mapping-for-each [bound-map boud-identifier-mapping?] [proc (identifier? any/c . -> . any)]) void?]{ -Like @scheme[hash-table-for-each].} +Like @racket[hash-table-for-each].} @defproc[(bound-identifier-mapping-map [bound-map bound-identifier-mapping?] [proc (identifier? any/c . -> . any)]) (listof any?)]{ -Like @scheme[hash-table-map].} +Like @racket[hash-table-map].} @defproc[(make-free-identifier-mapping) free-identifier-mapping?]{ @@ -60,7 +60,7 @@ Like @scheme[hash-table-map].} Produces a hash-table-like value for storing a mapping from syntax identifiers to arbitrary values. -The mapping uses @scheme[free-identifier=?] to compare mapping keys, +The mapping uses @racket[free-identifier=?] to compare mapping keys, but also uses a hash table based on symbol equality to make the mapping efficient in the common case (i.e., where non-equivalent identifiers are derived from different symbolic names at their @@ -69,8 +69,8 @@ definition sites).} @defproc[(free-identifier-mapping? [v any/c]) boolean?]{ -Returns @scheme[#t] if @scheme[v] was produced by -@scheme[make-free-identifier-mapping], @scheme[#f] otherwise. +Returns @racket[#t] if @racket[v] was produced by +@racket[make-free-identifier-mapping], @racket[#f] otherwise. } @@ -79,7 +79,7 @@ Returns @scheme[#t] if @scheme[v] was produced by [failure-thunk any/c (lambda () (raise (make-exn:fail ....)))]) any]{ -Like @scheme[hash-table-get] for free-identifier mappings.} +Like @racket[hash-table-get] for free-identifier mappings.} @defproc[(free-identifier-mapping-put! [free-map free-identifier-mapping?] @@ -87,21 +87,21 @@ Like @scheme[hash-table-get] for free-identifier mappings.} [v any/c]) void?]{ -Like @scheme[hash-table-put!] for free-identifier mappings.} +Like @racket[hash-table-put!] for free-identifier mappings.} @defproc[(free-identifier-mapping-for-each [free-map free-identifier-mapping?] [proc (identifier? any/c . -> . any)]) void?]{ -Like @scheme[hash-table-for-each].} +Like @racket[hash-table-for-each].} @defproc[(free-identifier-mapping-map [free-map free-identifier-mapping?] [proc (identifier? any/c . -> . any)]) (listof any?)]{ -Like @scheme[hash-table-map].} +Like @racket[hash-table-map].} @deftogether[( @@ -123,4 +123,4 @@ Like @scheme[hash-table-map].} (listof any?)] )]{ -The same as @scheme[make-free-identifier-mapping], etc.} +The same as @racket[make-free-identifier-mapping], etc.} diff --git a/collects/syntax/scribblings/context.scrbl b/collects/syntax/scribblings/context.scrbl index 7c35506d03..f20f412f74 100644 --- a/collects/syntax/scribblings/context.scrbl +++ b/collects/syntax/scribblings/context.scrbl @@ -1,18 +1,18 @@ #lang scribble/doc @(require "common.rkt" (for-label syntax/context)) -@title[#:tag "context"]{Support for @scheme[local-expand]} +@title[#:tag "context"]{Support for @racket[local-expand]} @defmodule[syntax/context] @defproc[(build-expand-context [v (or/c symbol? list?)]) list?]{ Returns a list suitable for use as a context argument to -@scheme[local-expand] for an internal-definition context. The -@scheme[v] argument represents the immediate context for -expansion. The context list builds on @scheme[(syntax-local-context)] +@racket[local-expand] for an internal-definition context. The +@racket[v] argument represents the immediate context for +expansion. The context list builds on @racket[(syntax-local-context)] if it is a list.} @defproc[(generate-expand-context) list?]{ -Calls @scheme[build-expand-context] with a generated symbol.} +Calls @racket[build-expand-context] with a generated symbol.} diff --git a/collects/syntax/scribblings/define.scrbl b/collects/syntax/scribblings/define.scrbl index 4175d09b90..5ff9ec56ad 100644 --- a/collects/syntax/scribblings/define.scrbl +++ b/collects/syntax/scribblings/define.scrbl @@ -2,7 +2,7 @@ @(require "common.rkt" (for-label syntax/define)) -@title[#:tag "define"]{Parsing @scheme[define]-like Forms} +@title[#:tag "define"]{Parsing @racket[define]-like Forms} @defmodule[syntax/define] @@ -13,20 +13,20 @@ [opt+kws? boolean? #t]) (values identifier? syntax?)]{ -Takes a definition form whose shape is like @scheme[define] (though +Takes a definition form whose shape is like @racket[define] (though possibly with a different name) and returns two values: the defined identifier and the right-hand side expression. To generate the right-hand side, this function may need to insert uses -of @scheme[lambda]. The @scheme[lambda-id-stx] argument provides a -suitable @scheme[lambda] identifier. +of @racket[lambda]. The @racket[lambda-id-stx] argument provides a +suitable @racket[lambda] identifier. If the definition is ill-formed, a syntax error is raised. If -@scheme[check-context?] is true, then a syntax error is raised if -@scheme[(syntax-local-context)] indicates that the current context is -an expression context. The default value of @scheme[check-context?] is -@scheme[#t]. +@racket[check-context?] is true, then a syntax error is raised if +@racket[(syntax-local-context)] indicates that the current context is +an expression context. The default value of @racket[check-context?] is +@racket[#t]. -If @scheme[opt-kws?] is @scheme[#t], then arguments of the form -@scheme[[id expr]], @scheme[keyword id], and @scheme[keyword [id +If @racket[opt-kws?] is @racket[#t], then arguments of the form +@racket[[id expr]], @racket[keyword id], and @racket[keyword [id expr]] are allowed, and they are preserved in the expansion.} diff --git a/collects/syntax/scribblings/docprovide.scrbl b/collects/syntax/scribblings/docprovide.scrbl index 2f0a066f89..cfd02c76d1 100644 --- a/collects/syntax/scribblings/docprovide.scrbl +++ b/collects/syntax/scribblings/docprovide.scrbl @@ -17,35 +17,35 @@ A form that exports names and records documentation information. -The @scheme[doc-label-id] identifier is used as a key for accessing -the documentation through @scheme[lookup-documentation]. The actual +The @racket[doc-label-id] identifier is used as a key for accessing +the documentation through @racket[lookup-documentation]. The actual documentation is organized into ``rows'', each with a section title. -A @scheme[row] has one of the following forms: +A @racket[row] has one of the following forms: @itemize[ - @item{@scheme[(section-string (name type-datum doc-string ...) ...)] + @item{@racket[(section-string (name type-datum doc-string ...) ...)] - Creates a documentation section whose title is @scheme[section-string], - and provides/documents each @scheme[name]. The @scheme[type-datum] is arbitrary, - for use by clients that call @scheme[lookup-documentation]. The - @scheme[doc-string]s are also arbitrary documentation information, + Creates a documentation section whose title is @racket[section-string], + and provides/documents each @racket[name]. The @racket[type-datum] is arbitrary, + for use by clients that call @racket[lookup-documentation]. The + @racket[doc-string]s are also arbitrary documentation information, usually concatenated by clients. - A @scheme[name] is either an identifier or a renaming sequence - @scheme[(local-name-id extenal-name-id)]. + A @racket[name] is either an identifier or a renaming sequence + @racket[(local-name-id extenal-name-id)]. - Multiple @scheme[row]s with the same section name will be merged in the + Multiple @racket[row]s with the same section name will be merged in the documentation output. The final order of sections matches the order of the first mention of each section.} - @item{@scheme[(all-from prefix-id module-path doc-label-id)]} - @item{@scheme[(all-from-except prefix-id module-path doc-label-id id ...)] + @item{@racket[(all-from prefix-id module-path doc-label-id)]} + @item{@racket[(all-from-except prefix-id module-path doc-label-id id ...)] Merges documentation and provisions from the specified module -into the current one; the @scheme[prefix-id] is used to prefix the imports -into the current module (so they can be re-exported). If @scheme[id]s are -provided, the specified @scheme[id]s are not re-exported and their +into the current one; the @racket[prefix-id] is used to prefix the imports +into the current module (so they can be re-exported). If @racket[id]s are +provided, the specified @racket[id]s are not re-exported and their documentation is not merged.}]} @defproc[(lookup-documentation [module-path-v module-path?] @@ -53,8 +53,8 @@ documentation is not merged.}]} any]{ Returns documentation for the specified module and label. The -@scheme[module-path-v] argument is a quoted module path, like the -argument to @scheme[dynamic-require]. The -@scheme[label-sym] identifies a set of documentation using the symbol -as a label identifier in @scheme[provide-and-document].} +@racket[module-path-v] argument is a quoted module path, like the +argument to @racket[dynamic-require]. The +@racket[label-sym] identifies a set of documentation using the symbol +as a label identifier in @racket[provide-and-document].} diff --git a/collects/syntax/scribblings/flatten-begin.scrbl b/collects/syntax/scribblings/flatten-begin.scrbl index 116b560461..2cb9e3dd75 100644 --- a/collects/syntax/scribblings/flatten-begin.scrbl +++ b/collects/syntax/scribblings/flatten-begin.scrbl @@ -1,13 +1,13 @@ #lang scribble/doc @(require "common.rkt" (for-label syntax/flatten-begin)) -@title[#:tag "flatten-begin"]{Flattening @scheme[begin] Forms} +@title[#:tag "flatten-begin"]{Flattening @racket[begin] Forms} @defmodule[syntax/flatten-begin] @defproc[(flatten-begin [stx syntax?]) (listof syntax?)]{ -Extracts the sub-expressions from a @scheme[begin]-like form, -reporting an error if @scheme[stx] does not have the right shape +Extracts the sub-expressions from a @racket[begin]-like form, +reporting an error if @racket[stx] does not have the right shape (i.e., a syntax list). The resulting syntax objects have annotations -transferred from @scheme[stx] using @scheme[syntax-track-origin].} +transferred from @racket[stx] using @racket[syntax-track-origin].} diff --git a/collects/syntax/scribblings/free-vars.scrbl b/collects/syntax/scribblings/free-vars.scrbl index 2cc217bc0b..7166ac2b30 100644 --- a/collects/syntax/scribblings/free-vars.scrbl +++ b/collects/syntax/scribblings/free-vars.scrbl @@ -7,7 +7,7 @@ @defproc[(free-vars [expr-stx syntax?]) (listof identifier?)]{ -Returns a list of free @scheme[lambda]- and @scheme[let]-bound -identifiers in @scheme[expr-stx]. The expression must be fully +Returns a list of free @racket[lambda]- and @racket[let]-bound +identifiers in @racket[expr-stx]. The expression must be fully expanded (see @secref[#:doc refman "fully-expanded"] and -@scheme[expand]).} +@racket[expand]).} diff --git a/collects/syntax/scribblings/id-table.scrbl b/collects/syntax/scribblings/id-table.scrbl index cb0af6fcfc..4aede4f9cd 100644 --- a/collects/syntax/scribblings/id-table.scrbl +++ b/collects/syntax/scribblings/id-table.scrbl @@ -6,15 +6,15 @@ @defmodule[syntax/id-table] This module provides functionality like that of -@schememodname[syntax/boundmap] but with more operations, standard -names, implementation of the @schememodname[scheme/dict] interface, +@racketmodname[syntax/boundmap] but with more operations, standard +names, implementation of the @racketmodname[scheme/dict] interface, and immutable (functionally-updating) variants. -@section{Dictionaries for @scheme[bound-identifier=?]} +@section{Dictionaries for @racket[bound-identifier=?]} Bound-identifier tables implement the dictionary interface of -@scheme[scheme/dict]. Consequently, all of the appropriate generic -functions (@scheme[dict-ref], @scheme[dict-map], etc) can be used on +@racket[scheme/dict]. Consequently, all of the appropriate generic +functions (@racket[dict-ref], @racket[dict-map], etc) can be used on free-identifier tables. @deftogether[[ @@ -28,29 +28,29 @@ free-identifier tables. immutable-bound-id-table?]]]{ Produces a dictionary mapping syntax identifiers to arbitrary -values. The mapping uses @scheme[bound-identifier=?] to compare keys, +values. The mapping uses @racket[bound-identifier=?] to compare keys, but also uses a hash table based on symbol equality to make the mapping efficient in the common case. The two procedures produce mutable and immutable dictionaries, respectively. -The identifiers are compared at phase level @scheme[phase]. The +The identifiers are compared at phase level @racket[phase]. The default value is generally appropriate for identifier tables used by macros, but code that analyzes fully-expanded programs may need to create identifier tables at multiple different phases. -The optional @scheme[init-dict] argument provides the initial +The optional @racket[init-dict] argument provides the initial mappings. It must be a dictionary, and its keys must all be -identifiers. If the @scheme[init-dict] dictionary has multiple -distinct entries whose keys are @scheme[bound-identifier=?], only one +identifiers. If the @racket[init-dict] dictionary has multiple +distinct entries whose keys are @racket[bound-identifier=?], only one of the entries appears in the new id-table, and it is not specified which entry is picked. } @defproc[(bound-id-table? [v any/c]) boolean?]{ -Returns @scheme[#t] if @scheme[v] was produced by -@scheme[make-bound-id-table] or -@scheme[make-immutable-bound-id-table], @scheme[#f] otherwise. +Returns @racket[#t] if @racket[v] was produced by +@racket[make-bound-id-table] or +@racket[make-immutable-bound-id-table], @racket[#f] otherwise. } @deftogether[[ @@ -68,8 +68,8 @@ tables, respectively. (lambda () (raise (make-exn:fail .....)))]) any]{ -Like @scheme[hash-ref] for bound identifier tables. In particular, if -@scheme[id] is not found, the @scheme[failure] argument is applied if +Like @racket[hash-ref] for bound identifier tables. In particular, if +@racket[id] is not found, the @racket[failure] argument is applied if it is a procedure, or simply returned otherwise. } @@ -78,7 +78,7 @@ it is a procedure, or simply returned otherwise. [v any/c]) void?]{ -Like @scheme[hash-set!] for mutable bound-identifier tables. +Like @racket[hash-set!] for mutable bound-identifier tables. } @defproc[(bound-id-table-set [table immutable-bound-id-table?] @@ -86,14 +86,14 @@ Like @scheme[hash-set!] for mutable bound-identifier tables. [v any/c]) immutable-bound-id-table?]{ -Like @scheme[hash-set] for immutable bound-identifier tables. +Like @racket[hash-set] for immutable bound-identifier tables. } @defproc[(bound-id-table-remove! [table mutable-bound-id-table?] [id identifier?]) void?]{ -Like @scheme[hash-remove!] for mutable bound-identifier tables. +Like @racket[hash-remove!] for mutable bound-identifier tables. } @defproc[(bound-id-table-remove [table immutable-bound-id-table?] @@ -101,27 +101,27 @@ Like @scheme[hash-remove!] for mutable bound-identifier tables. [v any/c]) immutable-bound-id-table?]{ -Like @scheme[hash-remove] for immutable bound-identifier tables. +Like @racket[hash-remove] for immutable bound-identifier tables. } @defproc[(bound-id-table-map [table bound-id-table?] [proc (-> identifier? any/c any)]) list?]{ -Like @scheme[hash-map] for bound-identifier tables. +Like @racket[hash-map] for bound-identifier tables. } @defproc[(bound-id-table-for-each [table bound-id-table?] [proc (-> identifier? any/c any)]) void?]{ -Like @scheme[hash-for-each] for bound-identifier tables. +Like @racket[hash-for-each] for bound-identifier tables. } @defproc[(bound-id-table-count [table bound-id-table?]) exact-nonnegative-integer?]{ -Like @scheme[hash-count] for bound-identifier tables. +Like @racket[hash-count] for bound-identifier tables. } @@ -140,16 +140,16 @@ Like @scheme[hash-count] for bound-identifier tables. identifier?]]]{ Like the corresponding dictionary procedures from -@schememodname[scheme/dict] for for bound-identifier tables. +@racketmodname[scheme/dict] for for bound-identifier tables. } } @;{----------} -@section{Dictionaries for @scheme[free-identifier=?]} +@section{Dictionaries for @racket[free-identifier=?]} Free-identifier tables implement the dictionary interface of -@scheme[scheme/dict]. Consequently, all of the appropriate generic -functions (@scheme[dict-ref], @scheme[dict-map], etc) can be used on +@racket[scheme/dict]. Consequently, all of the appropriate generic +functions (@racket[dict-ref], @racket[dict-map], etc) can be used on free-identifier tables. @deftogether[[ @@ -207,7 +207,7 @@ free-identifier tables. }]]{ Like the procedures for bound-identifier tables -(@scheme[make-bound-id-table], @scheme[bound-id-table-ref], etc), but -for free-identifier tables, which use @scheme[free-identifier=?] to +(@racket[make-bound-id-table], @racket[bound-id-table-ref], etc), but +for free-identifier tables, which use @racket[free-identifier=?] to compare keys. } diff --git a/collects/syntax/scribblings/kerncase.scrbl b/collects/syntax/scribblings/kerncase.scrbl index 534d6fc573..aa38dbbe38 100644 --- a/collects/syntax/scribblings/kerncase.scrbl +++ b/collects/syntax/scribblings/kerncase.scrbl @@ -15,54 +15,54 @@ @defform[(kernel-syntax-case stx-expr trans?-expr clause ...)]{ -A syntactic form like @scheme[syntax-case*], except that the literals +A syntactic form like @racket[syntax-case*], except that the literals are built-in as the names of the primitive Racket forms as -exported by @schememodname[scheme/base]; see @secref[#:doc refman +exported by @racketmodname[scheme/base]; see @secref[#:doc refman "fully-expanded"]. -The @scheme[trans?-expr] boolean expression replaces the comparison +The @racket[trans?-expr] boolean expression replaces the comparison procedure, and instead selects simply between normal-phase comparisons -or transformer-phase comparisons. The @scheme[clause]s are the same as in -@scheme[syntax-case*]. +or transformer-phase comparisons. The @racket[clause]s are the same as in +@racket[syntax-case*]. The primitive syntactic forms must have their normal bindings in the -context of the @scheme[kernel-syntax-case] expression. Beware that -@scheme[kernel-syntax-case] does not work in a module whose language -is @scheme[mzscheme], since the binding of @mzscheme-if from -@scheme[mzscheme] is different than the primitive @scheme[if].} +context of the @racket[kernel-syntax-case] expression. Beware that +@racket[kernel-syntax-case] does not work in a module whose language +is @racket[mzscheme], since the binding of @mzscheme-if from +@racket[mzscheme] is different than the primitive @racket[if].} @defform[(kernel-syntax-case* stx-expr trans?-expr (extra-id ...) clause ...)]{ -A syntactic form like @scheme[kernel-syntax-case], except that it +A syntactic form like @racket[kernel-syntax-case], except that it takes an additional list of extra literals that are in addition to the primitive Racket forms.} @defform[(kernel-syntax-case/phase stx-expr phase-expr clause ...)]{ -Generalizes @scheme[kernel-syntax-case] to work at an arbitrary phase -level, as indicated by @scheme[phase-expr].} +Generalizes @racket[kernel-syntax-case] to work at an arbitrary phase +level, as indicated by @racket[phase-expr].} @defform[(kernel-syntax-case*/phase stx-expr phase-expr (extra-id ..) clause ...)]{ -Generalizes @scheme[kernel-syntax-case*] to work at an arbitrary phase -level, as indicated by @scheme[phase-expr].} +Generalizes @racket[kernel-syntax-case*] to work at an arbitrary phase +level, as indicated by @racket[phase-expr].} @defproc[(kernel-form-identifier-list) (listof identifier?)]{ Returns a list of identifiers that are bound normally, -@scheme[for-syntax], and @scheme[for-template] to the primitive +@racket[for-syntax], and @racket[for-template] to the primitive Racket forms for expressions, internal-definition positions, and module-level and top-level positions. This function is useful for generating a list of stopping points to provide to -@scheme[local-expand]. +@racket[local-expand]. In addition to the identifiers listed in @secref[#:doc '(lib "scribblings/reference/reference.scrbl") "fully-expanded"], the list -includes @scheme[letrec-syntaxes+values], which is the core form for +includes @racket[letrec-syntaxes+values], which is the core form for local expand-time binding and can appear in the result of -@scheme[local-expand].} +@racket[local-expand].} diff --git a/collects/syntax/scribblings/keyword.scrbl b/collects/syntax/scribblings/keyword.scrbl index de18ed1ce1..cb198f6559 100644 --- a/collects/syntax/scribblings/keyword.scrbl +++ b/collects/syntax/scribblings/keyword.scrbl @@ -3,17 +3,17 @@ scribble/struct scribble/decode scribble/eval - scheme/sandbox - (for-label scheme/base - scheme/contract - scheme/dict + racket/sandbox + (for-label racket/base + racket/contract + racket/dict syntax/keyword)) @(begin (define the-eval (parameterize ((sandbox-output 'string) (sandbox-error-output 'string)) - (make-evaluator 'scheme/base #:requires '(syntax/keyword)))) + (make-evaluator 'racket/base #:requires '(syntax/keyword)))) ;;(void (the-eval '(error-print-source-location #f))) (define-syntax-rule (myexamples e ...) (parameterize (#|(error-print-source-location #f)|#) @@ -22,15 +22,15 @@ @title[#:tag "stxkeyword"]{Helpers for Processing Keyword Syntax} -The @schememodname[syntax/keyword] module contains procedures for +The @racketmodname[syntax/keyword] module contains procedures for parsing keyword options in macros. @defmodule[syntax/keyword] -@schemegrammar[#, @deftech{keyword-table} +@racketgrammar[#, @deftech{keyword-table} (dict-of keyword (listof check-procedure))] -A keyword-table is a dictionary (@scheme[dict?]) mapping keywords to +A keyword-table is a dictionary (@racket[dict?]) mapping keywords to lists of @techlink{check-procedures}. (Note that an association list is a suitable dictionary.) The keyword's arity is the length of the list of procedures. @@ -41,7 +41,7 @@ procedures. (list '#:b check-expression check-expression))) ] -@schemegrammar[#, @deftech{check-procedure} +@racketgrammar[#, @deftech{check-procedure} (syntax syntax -> any)] A check procedure consumes the syntax to check and a context syntax @@ -55,7 +55,7 @@ syntax or returns a value as its parsed representation. stx) ] -@schemegrammar[#, @deftech{options} +@racketgrammar[#, @deftech{options} (listof (list keyword syntax-keyword any ...))] Parsed options are represented as an list of option entries. Each @@ -85,9 +85,9 @@ times in the input occurs multiple times in the options list. (lambda (....) (error ....))]) (values #, @techlink{options} any/c)]{ -Parses the keyword options in the syntax @scheme[stx] (@scheme[stx] +Parses the keyword options in the syntax @racket[stx] (@racket[stx] may be an improper syntax list). The keyword options are described in -the @scheme[table] association list. Each entry in @scheme[table] +the @racket[table] association list. Each entry in @racket[table] should be a list whose first element is a keyword and whose subsequent elements are procedures for checking the arguments following the keyword. The keyword's arity (number of arguments) is determined by @@ -104,18 +104,18 @@ A variety of errors and exceptional conditions can occur during the parsing process. The following keyword arguments determine the behavior in those situations. -The @scheme[#:context ctx] argument is used to report all errors in -parsing syntax. In addition, @scheme[ctx] is passed as the final +The @racket[#:context ctx] argument is used to report all errors in +parsing syntax. In addition, @racket[ctx] is passed as the final argument to all provided handler procedures. Macros using -@scheme[parse-keyword-options] should generally pass the syntax object -for the whole macro use as @scheme[ctx]. +@racket[parse-keyword-options] should generally pass the syntax object +for the whole macro use as @racket[ctx]. -If @scheme[no-duplicates?] is a non-false value, then duplicate +If @racket[no-duplicates?] is a non-false value, then duplicate keyword options are not allowed. If a duplicate is seen, the keyword's associated check procedures are not called and an @tech{incompatibility} is reported. -The @scheme[incompatible] argument is a list of incompatibility +The @racket[incompatible] argument is a list of incompatibility entries, where each entry is a list of @emph{at least two} keywords. If any keyword in the entry occurs after any other keyword in the entry, an @tech{incompatibility} is reported. @@ -123,36 +123,36 @@ in the entry, an @tech{incompatibility} is reported. Note that including a keyword in an incompatibility entry does not prevent it from occurring multiple times. To disallow duplicates of some keywords (as opposed to all keywords), include those keywords in -the @scheme[incompatible] list as being incompatible with +the @racket[incompatible] list as being incompatible with themselves. That is, include them twice: -@schemeblock[ +@racketblock[ (code:comment "Disallow duplicates of only the #:foo keyword") (parse-keyword-options .... #:incompatible '((#:foo #:foo))) ] When an @deftech{incompatibility} occurs, the -@scheme[incompatible-handler] is tail-called with the two keywords +@racket[incompatible-handler] is tail-called with the two keywords causing the incompatibility (in the order that they occurred in the syntax list, so the keyword triggering the incompatibility occurs second), the syntax list starting with the occurrence of the second -keyword, and the context (@scheme[ctx]). If the incompatibility is due +keyword, and the context (@racket[ctx]). If the incompatibility is due to a duplicate, the two keywords are the same. When a keyword is not followed by enough arguments according to its -arity in @scheme[table], the @scheme[too-short-handler] is tail-called +arity in @racket[table], the @racket[too-short-handler] is tail-called with the keyword, the @techlink{options} parsed thus far, the syntax list -starting with the occurrence of the keyword, and @scheme[ctx]. +starting with the occurrence of the keyword, and @racket[ctx]. When a keyword occurs in the syntax list that is not in -@scheme[table], the @scheme[not-in-table-handler] is tail-called with +@racket[table], the @racket[not-in-table-handler] is tail-called with the keyword, the @techlink{options} parsed thus far, the syntax list -starting with the occurrence of the keyword, and @scheme[ctx]. +starting with the occurrence of the keyword, and @racket[ctx]. Handlers typically escape---all of the default handlers raise errors---but if they return, they should return two values: the parsed @techlink{options} and a syntax object; these are returned as the results -of @scheme[parse-keyword-options]. +of @racket[parse-keyword-options]. @(myexamples (parse-keyword-options @@ -196,10 +196,10 @@ of @scheme[parse-keyword-options]. (lambda (....) (error ....))]) #, @techlink{options}]{ -Like @scheme[parse-keyword-options], but checks that there are no +Like @racket[parse-keyword-options], but checks that there are no terms left over after parsing all of the keyword options. If there -are, @scheme[not-eol-handler] is tail-called with the @techlink{options} -parsed thus far, the leftover syntax, and @scheme[ctx]. +are, @racket[not-eol-handler] is tail-called with the @techlink{options} +parsed thus far, the leftover syntax, and @racket[ctx]. } @@ -219,10 +219,10 @@ the arity of the keyword. [#:default default any/c]) any]{ -Like @scheme[options-select], except that the given keyword must occur -either zero or one times in @scheme[options]. If the keyword occurs, +Like @racket[options-select], except that the given keyword must occur +either zero or one times in @racket[options]. If the keyword occurs, the associated list of parsed argument values is returned. Otherwise, -the @scheme[default] list is returned. +the @racket[default] list is returned. } @@ -231,11 +231,11 @@ the @scheme[default] list is returned. [#:default default any/c]) any]{ -Like @scheme[options-select], except that the given keyword must occur -either zero or one times in @scheme[options]. If the keyword occurs, +Like @racket[options-select], except that the given keyword must occur +either zero or one times in @racket[options]. If the keyword occurs, the associated list of parsed argument values must have exactly one element, and that element is returned. If the keyword does not occur -in @scheme[options], the @scheme[default] value is returned. +in @racket[options], the @racket[default] value is returned. } diff --git a/collects/syntax/scribblings/modcode.scrbl b/collects/syntax/scribblings/modcode.scrbl index b090881d6a..55e8a50c1f 100644 --- a/collects/syntax/scribblings/modcode.scrbl +++ b/collects/syntax/scribblings/modcode.scrbl @@ -24,57 +24,57 @@ any]{ Returns a compiled expression for the declaration of the module -specified by @scheme[module-path-v]. +specified by @racket[module-path-v]. -The @scheme[compiled-subdir] argument defaults to @scheme["compiled"]; +The @racket[compiled-subdir] argument defaults to @racket["compiled"]; it specifies the sub-directory to search for a compiled version of the module. -The @scheme[compile-proc] argument defaults to @scheme[compile]. This +The @racket[compile-proc] argument defaults to @racket[compile]. This procedure is used to compile module source if an already-compiled version is not available. -The @scheme[ext-proc] argument defaults to @scheme[#f]. If it is not -@scheme[#f], it must be a procedure of two arguments that is called -when a native-code version of @scheme[path] is should be used. In that -case, the arguments to @scheme[ext-proc] are the path for the +The @racket[ext-proc] argument defaults to @racket[#f]. If it is not +@racket[#f], it must be a procedure of two arguments that is called +when a native-code version of @racket[path] is should be used. In that +case, the arguments to @racket[ext-proc] are the path for the extension, and a boolean indicating whether the extension is a @tt{_loader} -file (@scheme[#t]) or not (@scheme[#f]). +file (@racket[#t]) or not (@racket[#f]). -The @scheme[choose-proc] argument is a procedure that takes three +The @racket[choose-proc] argument is a procedure that takes three paths: a source path, a @filepath{.zo} file path, and an extension path (for a non-@tt{_loader} extension). Some of the paths may not -exist. The result should be either @scheme['src], @scheme['zo], -@scheme['so], or @scheme[#f], indicating which variant should be used -or (in the case of @scheme[#f]) that the default choice should be +exist. The result should be either @racket['src], @racket['zo], +@racket['so], or @racket[#f], indicating which variant should be used +or (in the case of @racket[#f]) that the default choice should be used. The default choice is computed as follows: if a @filepath{.zo} version -of @scheme[path] is available and newer than @scheme[path] itself (in -one of the directories specified by @scheme[compiled-subdir]), then it -is used instead of the source. Native-code versions of @scheme[path] +of @racket[path] is available and newer than @racket[path] itself (in +one of the directories specified by @racket[compiled-subdir]), then it +is used instead of the source. Native-code versions of @racket[path] are ignored, unless only a native-code non-@tt{_loader} version exists -(i.e., @scheme[path] itself does not exist). A @tt{_loader} extension +(i.e., @racket[path] itself does not exist). A @tt{_loader} extension is selected a last resort. If an extension is preferred or is the only file that exists, it is -supplied to @scheme[ext-proc] when @scheme[ext-proc] is @scheme[#f], +supplied to @racket[ext-proc] when @racket[ext-proc] is @racket[#f], or an exception is raised (to report that an extension file cannot be -used) when @scheme[ext-proc] is @scheme[#f]. +used) when @racket[ext-proc] is @racket[#f]. -If @scheme[notify-proc] is supplied, it is called for the file +If @racket[notify-proc] is supplied, it is called for the file (source, @filepath{.zo} or extension) that is chosen. -If @scheme[read-syntax-proc] is provided, it is used to read the +If @racket[read-syntax-proc] is provided, it is used to read the module from a source file (but not from a bytecode file).} @defparam[moddep-current-open-input-file proc (path-string? . -> . input-port?)]{ -A parameter whose value is used like @scheme[open-input-file] to read +A parameter whose value is used like @racket[open-input-file] to read a module source or @filepath{.zo} file.} @defstruct[(exn:get-module-code exn) ([path path?])]{ An exception structure type for exceptions raised by -@scheme[get-module-code].} +@racket[get-module-code].} diff --git a/collects/syntax/scribblings/modcollapse.scrbl b/collects/syntax/scribblings/modcollapse.scrbl index 171ba4ee9c..8d1a9bdd37 100644 --- a/collects/syntax/scribblings/modcollapse.scrbl +++ b/collects/syntax/scribblings/modcollapse.scrbl @@ -10,26 +10,26 @@ (or/c path? module-path?)]{ Returns a ``simplified'' module path by combining -@scheme[module-path-v] with @scheme[rel-to-module-path-v], where the -latter must have the form @scheme['(lib ....)] or a symbol, -@scheme['(file )], @scheme['(planet ....)], a @techlink[#:doc +@racket[module-path-v] with @racket[rel-to-module-path-v], where the +latter must have the form @racket['(lib ....)] or a symbol, +@racket['(file )], @racket['(planet ....)], a @techlink[#:doc refman]{path}, or a thunk to generate one of those. -The result can be a path if @scheme[module-path-v] contains a path +The result can be a path if @racket[module-path-v] contains a path element that is needed for the result, or if -@scheme[rel-to-module-path-v] is a non-string path that is needed for +@racket[rel-to-module-path-v] is a non-string path that is needed for the result; otherwise, the result is a module path in the sense of -@scheme[module-path?]. +@racket[module-path?]. -When the result is a @scheme['lib] or @scheme['planet] module path, it +When the result is a @racket['lib] or @racket['planet] module path, it is normalized so that equivalent module paths are represented by -@scheme[equal?] results.} +@racket[equal?] results.} @defproc[(collapse-module-path-index [module-path-index module-path-index?] [rel-to-module-path-v any/c]) (or/c path? module-path?)]{ -Like @scheme[collapse-module-path], but the input is a @techlink[#:doc +Like @racket[collapse-module-path], but the input is a @techlink[#:doc refman]{module path index}; in this case, the -@scheme[rel-to-module-path-v] base is used where the module path index +@racket[rel-to-module-path-v] base is used where the module path index contains the ``self'' index.} diff --git a/collects/syntax/scribblings/moddep.scrbl b/collects/syntax/scribblings/moddep.scrbl index 2fd0691338..27e7748fd8 100644 --- a/collects/syntax/scribblings/moddep.scrbl +++ b/collects/syntax/scribblings/moddep.scrbl @@ -5,9 +5,9 @@ @defmodule[syntax/moddep] -Re-exports @schememodname[syntax/modread], -@schememodname[syntax/modcode], @schememodname[syntax/modcollapse], -and @schememodname[syntax/modresolve], in addition to the following: +Re-exports @racketmodname[syntax/modread], +@racketmodname[syntax/modcode], @racketmodname[syntax/modcollapse], +and @racketmodname[syntax/modresolve], in addition to the following: @defproc[(show-import-tree [module-path-v module-path?]) void?]{ diff --git a/collects/syntax/scribblings/modread.scrbl b/collects/syntax/scribblings/modread.scrbl index c58d617630..9251f7f10e 100644 --- a/collects/syntax/scribblings/modread.scrbl +++ b/collects/syntax/scribblings/modread.scrbl @@ -7,7 +7,7 @@ @defproc[(with-module-reading-parameterization [thunk (-> any)]) any]{ -Calls @scheme[thunk] with all reader parameters reset to their default +Calls @racket[thunk] with all reader parameters reset to their default values.} @defproc[(check-module-form [stx (or/c syntax? eof-object?)] @@ -15,24 +15,24 @@ values.} [source-v (or/c string? false/c)]) (or/c syntax? false/c)]{ -Inspects @scheme[stx] to check whether evaluating it will declare a -module---at least if @scheme[module] is bound in the top-level to -Racket's @scheme[module]. The syntax object @scheme[stx] can contain a -compiled expression. Also, @scheme[stx] can be an end-of-file, on the -grounds that @scheme[read-syntax] can produce an end-of-file. +Inspects @racket[stx] to check whether evaluating it will declare a +module---at least if @racket[module] is bound in the top-level to +Racket's @racket[module]. The syntax object @racket[stx] can contain a +compiled expression. Also, @racket[stx] can be an end-of-file, on the +grounds that @racket[read-syntax] can produce an end-of-file. -The @scheme[expected-module-sym] argument is currently ignored. In -previous versions, the module form @scheme[stx] was obliged to declare -a module who name matched @scheme[expected-module-sym]. +The @racket[expected-module-sym] argument is currently ignored. In +previous versions, the module form @racket[stx] was obliged to declare +a module who name matched @racket[expected-module-sym]. -If @scheme[stx] can declare a module in an appropriate top-level, then -the @scheme[check-module-form] procedure returns a syntax object that +If @racket[stx] can declare a module in an appropriate top-level, then +the @racket[check-module-form] procedure returns a syntax object that certainly will declare a module (adding explicit context to the -leading @scheme[module] if necessary) in any top-level. Otherwise, if -@scheme[source-v] is not @scheme[#f], a suitable exception is raised -using the @scheme[write] form of the source in the message; if -@scheme[source-v] is @scheme[#f], @scheme[#f] is returned. +leading @racket[module] if necessary) in any top-level. Otherwise, if +@racket[source-v] is not @racket[#f], a suitable exception is raised +using the @racket[write] form of the source in the message; if +@racket[source-v] is @racket[#f], @racket[#f] is returned. -If @scheme[stx] is eof or eof wrapped as a syntax object, then an -error is raised or @scheme[#f] is returned.} +If @racket[stx] is eof or eof wrapped as a syntax object, then an +error is raised or @racket[#f] is returned.} diff --git a/collects/syntax/scribblings/modresolve.scrbl b/collects/syntax/scribblings/modresolve.scrbl index 9634643949..08e006232b 100644 --- a/collects/syntax/scribblings/modresolve.scrbl +++ b/collects/syntax/scribblings/modresolve.scrbl @@ -10,7 +10,7 @@ path?]{ Resolves a module path to filename path. The module path is resolved -relative to @scheme[rel-to-path-v] if it is a path string (assumed to +relative to @racket[rel-to-path-v] if it is a path string (assumed to be for a file), to the directory result of calling the thunk if it is a thunk, or to the current directory otherwise.} @@ -18,9 +18,9 @@ a thunk, or to the current directory otherwise.} [rel-to-path-v (or/c path-string? (-> any) false/c)]) path?]{ -Like @scheme[resolve-module-path] but the input is a @techlink[#:doc -refman]{module path index}; in this case, the @scheme[rel-to-path-v] +Like @racket[resolve-module-path] but the input is a @techlink[#:doc +refman]{module path index}; in this case, the @racket[rel-to-path-v] base is used where the module path index contains the ``self'' index. -If @scheme[module-path-index] depends on the ``self'' module path -index, then an exception is raised unless @scheme[rel-to-path-v] is a +If @racket[module-path-index] depends on the ``self'' module path +index, then an exception is raised unless @racket[rel-to-path-v] is a path string.} diff --git a/collects/syntax/scribblings/module-reader.scrbl b/collects/syntax/scribblings/module-reader.scrbl index 8e9f43bd57..af5db2afb8 100644 --- a/collects/syntax/scribblings/module-reader.scrbl +++ b/collects/syntax/scribblings/module-reader.scrbl @@ -9,7 +9,7 @@ (define-syntax-rule (define-mb name) (begin (require (for-label scheme/base)) - (define name @scheme[#%module-begin]))) + (define name @racket[#%module-begin]))) (define-mb scheme-#%module-begin)) @(define guide-doc '(lib "scribblings/guide/guide.scrbl")) @@ -21,11 +21,11 @@ @defmodule[syntax/module-reader] -The @schememodname[syntax/module-reader] library provides support for +The @racketmodname[syntax/module-reader] library provides support for defining @hash-lang[] readers. It is normally used as a module -language, though it may also be @scheme[require]d to get -@scheme[make-meta-reader]. It provides all of the bindings of -@scheme[scheme/base] other than @|scheme-#%module-begin|. +language, though it may also be @racket[require]d to get +@racket[make-meta-reader]. It provides all of the bindings of +@racket[scheme/base] other than @|scheme-#%module-begin|. @defform*/subs[ [(#%module-begin module-path) @@ -55,86 +55,86 @@ language, though it may also be @scheme[require]d to get procedure?)])]{ In its simplest form, the body of a module written with -@schememodname[syntax/module-reader] contains just a module path, +@racketmodname[syntax/module-reader] contains just a module path, which is used in the language position of read modules. For example, a -module @scheme[_something]@scheme[/lang/reader] implemented as +module @racket[_something]@racket[/lang/reader] implemented as -@schemeblock[ -(module reader @#,schememodname[syntax/module-reader] +@racketblock[ +(module reader @#,racketmodname[syntax/module-reader] module-path) ] creates a reader such that a module source -@schememod[ -@#,scheme[_something] +@racketmod[ +@#,racket[_something] .... ] is read as -@schemeblock[ +@racketblock[ (module _name-id module-path (#%module-begin ....)) ] -Keyword-based @scheme[reader-option]s allow further customization, as -listed below. Additional @scheme[form]s are as in the body of -@scheme[scheme/base] module; they can import bindings and define -identifiers used by the @scheme[reader-option]s. +Keyword-based @racket[reader-option]s allow further customization, as +listed below. Additional @racket[form]s are as in the body of +@racket[scheme/base] module; they can import bindings and define +identifiers used by the @racket[reader-option]s. @itemlist[ - @item{@scheme[#:read] and @scheme[#:read-syntax] (both or neither + @item{@racket[#:read] and @racket[#:read-syntax] (both or neither must be supplied) specify alternate readers for parsing the - module body---replacements @scheme[read] and - @scheme[read-syntax], respectively. Normally, the replacements - for @scheme[read] and @scheme[read-syntax] are applied - repeatedly to the module source until @scheme[eof] is produced, - but see also @scheme[#:whole-body-readers?]. + module body---replacements @racket[read] and + @racket[read-syntax], respectively. Normally, the replacements + for @racket[read] and @racket[read-syntax] are applied + repeatedly to the module source until @racket[eof] is produced, + but see also @racket[#:whole-body-readers?]. For example, a language built on the @secref[#:doc '(lib "scribblings/honu/honu.scrbl")]{Honu} reader could be implemented with: - @schemeblock[ + @racketblock[ (module reader syntax/module-reader module-path #:read read-honu #:read-syntax read-honu-syntax) ] - See also @scheme[#:wrapper1] and @scheme[#:wrapper2], which + See also @racket[#:wrapper1] and @racket[#:wrapper2], which support simple parameterization of readers rather than wholesale replacement.} - @item{@scheme[#:whole-body-readers?] specified as true indicates that - the @scheme[#:read] and @scheme[#:read-syntax] functions each produce a + @item{@racket[#:whole-body-readers?] specified as true indicates that + the @racket[#:read] and @racket[#:read-syntax] functions each produce a list of S-expressions or syntax objects for the module content, so that each is applied just once to the input stream. If the resulting list contains a single form that starts with - the symbol @scheme['#%module-begin] (or a syntax object whose + the symbol @racket['#%module-begin] (or a syntax object whose datum is that symbol), then the first item is used as the - module body; otherwise, a @scheme['#%module-begin] (symbol or + module body; otherwise, a @racket['#%module-begin] (symbol or identifier) is added to the beginning of the list to form the module body.} - @item{@scheme[#:wrapper1] specifies a function that controls the - dynamic context in which the @scheme[read] and - @scheme[read-syntax] functions are called. A - @scheme[#:wrapper1]-specified function must accept a thunk, and + @item{@racket[#:wrapper1] specifies a function that controls the + dynamic context in which the @racket[read] and + @racket[read-syntax] functions are called. A + @racket[#:wrapper1]-specified function must accept a thunk, and it normally calls the thunk to produce a result while - @scheme[parameterizing] the call. Optionally, a - @scheme[#:wrapper1]-specified function can accept a boolean - that indicates whether it is used in @scheme[read] - (@scheme[#f]) or @scheme[read-syntax] (@scheme[#t]) mode. + @racket[parameterizing] the call. Optionally, a + @racket[#:wrapper1]-specified function can accept a boolean + that indicates whether it is used in @racket[read] + (@racket[#f]) or @racket[read-syntax] (@racket[#t]) mode. - For example, a language like @scheme[scheme/base] but with + For example, a language like @racket[scheme/base] but with case-insensitive reading of symbols and identifiers can be implemented as - @schemeblock[ + @racketblock[ (module reader syntax/module-reader scheme/base #:wrapper1 (lambda (t) @@ -145,98 +145,98 @@ identifiers used by the @scheme[reader-option]s. Using a @tech[#:doc refman]{readtable}, you can implement languages that are extensions of plain S-expressions.} - @item{@scheme[#:wrapper2] is like @scheme[#:wrapper1], but a - @scheme[#:wrapper2]-specified function receives the input port + @item{@racket[#:wrapper2] is like @racket[#:wrapper1], but a + @racket[#:wrapper2]-specified function receives the input port to be read, and the function that it receives accepts an input port (usually, but not necessarily the same input port). A - @scheme[#:wrapper2]-specified function can optionally accept an - boolean that indicates whether it is used in @scheme[read] - (@scheme[#f]) or @scheme[read-syntax] (@scheme[#t]) mode.} + @racket[#:wrapper2]-specified function can optionally accept an + boolean that indicates whether it is used in @racket[read] + (@racket[#f]) or @racket[read-syntax] (@racket[#t]) mode.} - @item{@scheme[#:info] specifies an implementation of reflective + @item{@racket[#:info] specifies an implementation of reflective information that is used by external tools to manipulate the - @emph{source} of modules in the language @scheme[_something]. For - example, DrRacket uses information from @scheme[#:info] to + @emph{source} of modules in the language @racket[_something]. For + example, DrRacket uses information from @racket[#:info] to determine the style of syntax coloring that it should use for editing a module's source. - The @scheme[#:info] specification should be a function of three + The @racket[#:info] specification should be a function of three arguments: a symbol indicating the kind of information requested (as defined by external tools), a default value that normally should be returned if the symbol is not recognized, and a default-filtering function that takes the first two arguments and returns a result. - The expression after @scheme[#:info] is placed into a context - where @scheme[language-module] and @scheme[language-data] are - bound. The @scheme[language-module] identifier is bound to the - @scheme[module-path] that is used for the read module's + The expression after @racket[#:info] is placed into a context + where @racket[language-module] and @racket[language-data] are + bound. The @racket[language-module] identifier is bound to the + @racket[module-path] that is used for the read module's language as written directly or as determined through - @scheme[#:language]. The @scheme[language-data] identifier is - bound to the second result from @scheme[#:language], or - @scheme[#f] by default. + @racket[#:language]. The @racket[language-data] identifier is + bound to the second result from @racket[#:language], or + @racket[#f] by default. - The default-filtering function passed to the @scheme[#:info] + The default-filtering function passed to the @racket[#:info] function is intended to provide support for information that - @schememodname[syntax/module-reader] can provide automatically. - Currently, it recognizes only the @scheme['module-language] - key, for which it returns @scheme[language-module]; it returns + @racketmodname[syntax/module-reader] can provide automatically. + Currently, it recognizes only the @racket['module-language] + key, for which it returns @racket[language-module]; it returns the given default value for any other key. In the case of the DrRacket syntax-coloring example, DrRacket - supplies @scheme['color-lexer] as the symbol argument, and it - supplies @scheme[#f] as the default. The default-filtering - argument (i.e., the third argument to the @scheme[#:info] + supplies @racket['color-lexer] as the symbol argument, and it + supplies @racket[#f] as the default. The default-filtering + argument (i.e., the third argument to the @racket[#:info] function) currently just returns the default for - @scheme['color-lexer].} + @racket['color-lexer].} - @item{@scheme[#:language-info] specifies an implementation of + @item{@racket[#:language-info] specifies an implementation of reflective information that is used by external tools to - manipulate the module in the language @scheme[_something] in + manipulate the module in the language @racket[_something] in its @emph{expanded}, @emph{compiled}, or @emph{declared} form (as opposed to source). For example, when Racket starts a program, it uses information attached to the main module to initialize the run-time environment. Since the expanded/compiled/declared form exists at a different time - than when the source is read, a @scheme[#:language-info] + than when the source is read, a @racket[#:language-info] specification is a vector that indicates an implementation of the reflective information, instead of a direct implementation - as a function like @scheme[#:info]. The first element of the + as a function like @racket[#:info]. The first element of the vector is a module path, the second is a symbol corresponding to a function exported from the module, and the last element is a value to be passed to the function. The last value in the - vector must be one that can be written with @scheme[write] and - read back with @scheme[read]. When the exported function + vector must be one that can be written with @racket[write] and + read back with @racket[read]. When the exported function indicated by the first two vector elements is called with the value from the last vector element, the result should be a function or two arguments: a symbol and a default value. The - symbol and default value are used as for the @scheme[#:info] + symbol and default value are used as for the @racket[#:info] function (but without an extra default-filtering function). - The value specified by @scheme[#:language-info] is attached to - the @scheme[module] form that is parsed from source through the - @scheme['module-language] syntax property. See @scheme[module] + The value specified by @racket[#:language-info] is attached to + the @racket[module] form that is parsed from source through the + @racket['module-language] syntax property. See @racket[module] for more information. - The expression after @scheme[#:language-info] is placed into a - context where @scheme[language-module] are - @scheme[language-data] are bound, the same as for - @scheme[#:info]. + The expression after @racket[#:language-info] is placed into a + context where @racket[language-module] are + @racket[language-data] are bound, the same as for + @racket[#:info]. In the case of the Racket run-time configuration example, - Racket uses the @scheme[#:language-info] vector to obtain a - function, and then it passes @scheme['configure-runtime] to the + Racket uses the @racket[#:language-info] vector to obtain a + function, and then it passes @racket['configure-runtime] to the function to obtain information about configuring the runtime environment. See also @secref[#:doc refman "configure-runtime"].} - @item{@scheme[#:language] allows the language of the read - @scheme[module] to be computed dynamically and based on the + @item{@racket[#:language] allows the language of the read + @racket[module] to be computed dynamically and based on the program source, instead of using a constant - @scheme[module-path]. (Either @scheme[#:language] or - @scheme[module-path] must be provided, but not both.) + @racket[module-path]. (Either @racket[#:language] or + @racket[module-path] must be provided, but not both.) - This value of the @scheme[#:language] option can be either a + This value of the @racket[#:language] option can be either a module path (possibly as a syntax object) that is used as a module language, or it can be a procedure. If it is a procedure it can accept either @@ -247,27 +247,27 @@ identifiers used by the @scheme[reader-option]s. @item{5 arguments: an input port, a syntax object whose datum is a module path for the enclosing module as it was referenced through @hash-lang[] or - @schememetafont{#reader}, a starting line number - (positive exact integer) or @scheme[#f], a column - number (non-negative exact integer) or @scheme[#f], and + @racketmetafont{#reader}, a starting line number + (positive exact integer) or @racket[#f], a column + number (non-negative exact integer) or @racket[#f], and a position number (positive exact integer) or - @scheme[#f].} - ] + @racket[#f].} + ] The result can be either @itemlist[ @item{a single value, which is a module path or a syntax object whose datum is a module path, to be used - like @scheme[module-path]; or} + like @racket[module-path]; or} @item{two values, where the first is like a single-value result and the second can be any value.} ] - The second result, which defaults to @scheme[#f] if only a + The second result, which defaults to @racket[#f] if only a single result is produced, is made available to the - @scheme[#:info] and @scheme[#:module-info] functions through - the @scheme[language-data] binding. For example, it can be a + @racket[#:info] and @racket[#:module-info] functions through + the @racket[language-data] binding. For example, it can be a specification derived from the input stream that changes the module's reflective information (such as the syntax-coloring mode or the output-printing styles).} @@ -278,7 +278,7 @@ As another example, the following reader defines a ``language'' that ignores the contents of the file, and simply reads files as if they were empty: - @schemeblock[ + @racketblock[ (module ignored syntax/module-reader scheme/base #:wrapper1 (lambda (t) (t) '()))] @@ -287,11 +287,11 @@ Note that the wrapper still performs the read, otherwise the module loader would complain about extra expressions. As a more useful example, the following module language is similar to -@schememodname[at-exp], where the first datum in the file determines +@racketmodname[at-exp], where the first datum in the file determines the actual language (which means that the library specification is effectively ignored): -@schemeblock[ +@racketblock[ (module reader syntax/module-reader -ignored- #:wrapper2 @@ -313,18 +313,18 @@ effectively ignored): The ability to change the language position in the resulting module expression can be useful in cases such as the above, where the base language module is chosen based on the input. To make this more -convenient, you can omit the @scheme[module-path] and instead specify -it via a @scheme[#:language] expression. This expression can evaluate +convenient, you can omit the @racket[module-path] and instead specify +it via a @racket[#:language] expression. This expression can evaluate to a datum or syntax object that is used as a language, or it can evaluate to a thunk. In the latter case, the thunk is invoked to obtain such a datum before reading the module body begins, in a -dynamic extent where @scheme[current-input-port] is the source -input. A syntax object is converted using @scheme[syntax->datum] when -a datum is needed (for @scheme[read] instead of @scheme[read-syntax]). -Using @scheme[#:language], the last example above can be written more +dynamic extent where @racket[current-input-port] is the source +input. A syntax object is converted using @racket[syntax->datum] when +a datum is needed (for @racket[read] instead of @racket[read-syntax]). +Using @racket[#:language], the last example above can be written more concisely: -@schemeblock[ +@racketblock[ (module reader syntax/module-reader #:language read #:wrapper2 (lambda (in rd stx?) @@ -335,7 +335,7 @@ concisely: ] For such cases, however, the alternative reader constructor -@scheme[make-meta-reader] implements a might tightly controlled +@racket[make-meta-reader] implements a might tightly controlled reading of the module language.} @@ -348,51 +348,51 @@ reading of the module language.} [convert-get-info (procedure? . -> . procedure?)]) (values procedure? procedure? procedure?)]{ -Generates procedures suitable for export as @schemeidfont{read} (see -@scheme[read] and @hash-lang[]), @schemeidfont{read-syntax} (see -@scheme[read-syntax] and @hash-lang[]), and @schemeidfont{get-info} -(see @scheme[read-language] and @hash-lang[]), respectively, where the +Generates procedures suitable for export as @racketidfont{read} (see +@racket[read] and @hash-lang[]), @racketidfont{read-syntax} (see +@racket[read-syntax] and @hash-lang[]), and @racketidfont{get-info} +(see @racket[read-language] and @hash-lang[]), respectively, where the procedures chains to another language that is specified in an input stream. -@margin-note{The @schememodname[at-exp], @schememodname[reader], and - @schememodname[planet] languages are implemented using this +@margin-note{The @racketmodname[at-exp], @racketmodname[reader], and + @racketmodname[planet] languages are implemented using this function.} The generated functions expect a target language description in the -input stream that is provided to @scheme[read-spec]. The default -@scheme[read-spec] extracts a non-empty sequence of bytes after one or +input stream that is provided to @racket[read-spec]. The default +@racket[read-spec] extracts a non-empty sequence of bytes after one or more space and tab bytes, stopping at the first whitespace byte or end-of-file (whichever is first), and it produces either such a byte -string or @scheme[#f]. If @scheme[read-spec] produces @scheme[#f], a -reader exception is raised, and @scheme[path-desc-str] is used as a +string or @racket[#f]. If @racket[read-spec] produces @racket[#f], a +reader exception is raised, and @racket[path-desc-str] is used as a description of the expected language form in the error message. -@margin-note{The @schememodname[reader] language supplies - @scheme[read] for @scheme[read-spec]. The @schememodname[at-exp] and - @schememodname[planet] languages use the default - @scheme[read-spec].} +@margin-note{The @racketmodname[reader] language supplies + @racket[read] for @racket[read-spec]. The @racketmodname[at-exp] and + @racketmodname[planet] languages use the default + @racket[read-spec].} -The result of @scheme[read-spec] is converted to a module path using -@scheme[module-path-parser]. If @scheme[module-path-parser] produces -@scheme[#f], a reader exception is raised in the same way as when -@scheme[read-spec] produces a @scheme[#f]. The @schememodname[planet] -languages supply a @scheme[module-path-parser] that converts a byte +The result of @racket[read-spec] is converted to a module path using +@racket[module-path-parser]. If @racket[module-path-parser] produces +@racket[#f], a reader exception is raised in the same way as when +@racket[read-spec] produces a @racket[#f]. The @racketmodname[planet] +languages supply a @racket[module-path-parser] that converts a byte string to a module path. -If loading the module produced by @scheme[module-path-parser] -succeeds, then the loaded module's @schemeidfont{read}, -@schemeidfont{read-syntax}, or @schemeidfont{get-info} export is -passed to @scheme[convert-read], @scheme[convert-read-syntax], or -@scheme[convert-get-info], respectively. +If loading the module produced by @racket[module-path-parser] +succeeds, then the loaded module's @racketidfont{read}, +@racketidfont{read-syntax}, or @racketidfont{get-info} export is +passed to @racket[convert-read], @racket[convert-read-syntax], or +@racket[convert-get-info], respectively. -@margin-note{The @schememodname[at-exp] language supplies - @scheme[convert-read] and @scheme[convert-read-syntax] to add +@margin-note{The @racketmodname[at-exp] language supplies + @racket[convert-read] and @racket[convert-read-syntax] to add @"@"-expression support to the current readtable before chaining to the given procedures.} -The procedures generated by @scheme[make-meta-reader] are not meant -for use with the @schememodname[syntax/module-reader] language; they +The procedures generated by @racket[make-meta-reader] are not meant +for use with the @racketmodname[syntax/module-reader] language; they are meant to be exported directly.} @@ -407,15 +407,15 @@ are meant to be exported directly.} any/c]{ @emph{This function is deprecated; the -@schememodname[syntax/module-reader] language can be adapted using the +@racketmodname[syntax/module-reader] language can be adapted using the various keywords to arbitrary readers; please use it instead.} -Repeatedly calls @scheme[read] on @scheme[in] until an end of file, -collecting the results in order into @scheme[_lst], and derives a -@scheme[_name-id] from @scheme[(object-name in)]. The last five +Repeatedly calls @racket[read] on @racket[in] until an end of file, +collecting the results in order into @racket[_lst], and derives a +@racket[_name-id] from @racket[(object-name in)]. The last five arguments are used to construct the syntax object for the language position of the module. The result is roughly -@schemeblock[ +@racketblock[ `(module ,_name-id ,mod-path ,@_lst) ]} diff --git a/collects/syntax/scribblings/name.scrbl b/collects/syntax/scribblings/name.scrbl index d08b3e0735..a42a55172f 100644 --- a/collects/syntax/scribblings/name.scrbl +++ b/collects/syntax/scribblings/name.scrbl @@ -7,10 +7,10 @@ @defproc[(syntax-local-infer-name [stx syntax?]) any/c]{ -Similar to @scheme[syntax-local-name] except that @scheme[stx] is -checked for an @scheme['inferred-name] property (which overrides any -inferred name). If neither @scheme[syntax-local-name] nor -@scheme['inferred-name] produce a name, or if the -@scheme['inferred-name] property value is @|void-const|, then a name -is constructed from the source-location information in @scheme[stx], -if any. If no name can be constructed, the result is @scheme[#f].} +Similar to @racket[syntax-local-name] except that @racket[stx] is +checked for an @racket['inferred-name] property (which overrides any +inferred name). If neither @racket[syntax-local-name] nor +@racket['inferred-name] produce a name, or if the +@racket['inferred-name] property value is @|void-const|, then a name +is constructed from the source-location information in @racket[stx], +if any. If no name can be constructed, the result is @racket[#f].} diff --git a/collects/syntax/scribblings/parse.scrbl b/collects/syntax/scribblings/parse.scrbl index 31507a7082..63fc654aeb 100644 --- a/collects/syntax/scribblings/parse.scrbl +++ b/collects/syntax/scribblings/parse.scrbl @@ -4,11 +4,11 @@ @title[#:tag "stxparse" #:style '(toc)]{Parsing and specifying syntax} -The @schememodname[syntax/parse] library provides a framework for +The @racketmodname[syntax/parse] library provides a framework for writing macros and processing syntax. The library provides a powerful language of syntax patterns, used by the pattern-matching form -@scheme[syntax-parse] and the specification form -@scheme[define-syntax-class]. Macros that use @scheme[syntax-parse] +@racket[syntax-parse] and the specification form +@racket[define-syntax-class]. Macros that use @racket[syntax-parse] automatically generate error messages based on descriptions and messages embedded in the macro's syntax patterns. @defmodule[syntax/parse] diff --git a/collects/syntax/scribblings/parse/debug.scrbl b/collects/syntax/scribblings/parse/debug.scrbl index b3270aebc4..ddcb156f65 100644 --- a/collects/syntax/scribblings/parse/debug.scrbl +++ b/collects/syntax/scribblings/parse/debug.scrbl @@ -22,15 +22,15 @@ consists of the attribute's name and ellipsis depth. @defform[(syntax-class-keywords syntax-class-id)]]]{ Returns the syntax class's arity and keywords, respectively. Compare -with @scheme[procedure-arity] and @scheme[procedure-keywords]. +with @racket[procedure-arity] and @racket[procedure-keywords]. } @defform[(syntax-class-parse syntax-class-id stx-expr arg ...) #:contracts ([stx-expr syntax?])]{ Runs the parser for the syntax class (parameterized by the -@scheme[arg-expr]s) on the syntax object produced by -@scheme[stx-expr]. On success, the result is a list of vectors +@racket[arg-expr]s) on the syntax object produced by +@racket[stx-expr]. On success, the result is a list of vectors representing the attribute bindings of the syntax class. Each vector contains the attribute name, depth, and associated value. On failure, the result is some internal representation of the failure. @@ -39,8 +39,8 @@ the result is some internal representation of the failure. @defform[(debug-parse stx-expr S-pattern ...+) #:contracts ([stx-expr syntax?])]{ -Tries to match @scheme[stx-expr] against the @scheme[S-pattern]s. If -matching succeeds, the symbol @scheme['success] is +Tries to match @racket[stx-expr] against the @racket[S-pattern]s. If +matching succeeds, the symbol @racket['success] is returned. Otherwise, an S-expression describing the failure is returned. The failure S-expression shows both the raw set of failures (unsorted) @@ -49,8 +49,8 @@ divided into equivalence classes based on their progress (progress is a partial order); that is, failures within an equivalence class have the same progress and, in principle, pinpoint the same term as the problematic term. Multiple equivalence classes only arise from -@scheme[~parse] patterns (or equivalently, @scheme[#:with] clauses) -that match computed terms or @scheme[~fail] (@scheme[#:fail-when], +@racket[~parse] patterns (or equivalently, @racket[#:with] clauses) +that match computed terms or @racket[~fail] (@racket[#:fail-when], etc) clauses that allow a computed term to be pinpointed. } diff --git a/collects/syntax/scribblings/parse/ex-exprc.scrbl b/collects/syntax/scribblings/parse/ex-exprc.scrbl index 89167d8ef3..d7b7d50dbf 100644 --- a/collects/syntax/scribblings/parse/ex-exprc.scrbl +++ b/collects/syntax/scribblings/parse/ex-exprc.scrbl @@ -14,10 +14,10 @@ subject to change.} Just as procedures often expect certain kinds of values as arguments, macros often have expectations about the expressions they are given. And just as procedures express those expectations via -contracts, so can macros, using the @scheme[expr/c] syntax class. +contracts, so can macros, using the @racket[expr/c] syntax class. -For example, here is a macro @scheme[myparameterize] that behaves like -@scheme[parameterize] but enforces the @scheme[parameter?] contract on +For example, here is a macro @racket[myparameterize] that behaves like +@racket[parameterize] but enforces the @racket[parameter?] contract on the parameter expressions. @myinteraction[ @@ -34,9 +34,9 @@ the parameter expressions. 'whatever) ] -@bold{Important:} Make sure when using @scheme[expr/c] to use the -@scheme[c] attribute. If the macro above had used @scheme[p] in the +@bold{Important:} Make sure when using @racket[expr/c] to use the +@racket[c] attribute. If the macro above had used @racket[p] in the template, the expansion would have used the raw, unchecked -expressions. The @scheme[expr/c] syntax class does not change how +expressions. The @racket[expr/c] syntax class does not change how pattern variables are bound; it only computes an attribute that represents the checked expression. diff --git a/collects/syntax/scribblings/parse/ex-kw-args.scrbl b/collects/syntax/scribblings/parse/ex-kw-args.scrbl index 1511047f67..e5a6df1b38 100644 --- a/collects/syntax/scribblings/parse/ex-kw-args.scrbl +++ b/collects/syntax/scribblings/parse/ex-kw-args.scrbl @@ -9,16 +9,16 @@ @title{Optional keyword arguments} This section explains how to write a macro that accepts (simple) -optional keyword arguments. We use the example @scheme[mycond], which -is like Racket's @scheme[cond] except that it takes an optional +optional keyword arguments. We use the example @racket[mycond], which +is like Racket's @racket[cond] except that it takes an optional keyword argument that controls what happens if none of the clauses match. Optional keyword arguments are supported via @tech{head patterns}. Unlike normal patterns, which match one term, head patterns can match a variable number of subterms in a list. Some important -head-pattern forms are @scheme[~seq], @scheme[~or], and -@scheme[~optional]. +head-pattern forms are @racket[~seq], @racket[~or], and +@racket[~optional]. Here's one way to do it: @@ -41,10 +41,10 @@ Here's one way to do it: (void)])) ] -We cannot write @scheme[#'who] in the macro's right-hand side, because -the @scheme[who] attribute does not receive a value if the keyword -argument is omitted. Instead we must write @scheme[(attribute who)], -which produces @scheme[#f] if matching did not assign a value to the +We cannot write @racket[#'who] in the macro's right-hand side, because +the @racket[who] attribute does not receive a value if the keyword +argument is omitted. Instead we must write @racket[(attribute who)], +which produces @racket[#f] if matching did not assign a value to the attribute. @myinteraction[ @@ -55,8 +55,8 @@ attribute. [(odd? 4) 'red]) ] -There's a simpler way of writing the @scheme[~or] pattern above: -@schemeblock[ +There's a simpler way of writing the @racket[~or] pattern above: +@racketblock[ (~optional (~seq #:error-on-fallthrough who:expr)) ] @@ -78,9 +78,9 @@ is like an ordinary syntax class but for head patterns. ] Defining a splicing syntax class also makes it easy to eliminate the -case analysis we did before using @scheme[attribute] by defining -@scheme[error?] and @scheme[who] as attributes within both of the +case analysis we did before using @racket[attribute] by defining +@racket[error?] and @racket[who] as attributes within both of the syntax class's variants. (This is possible to do in the inline pattern -version too, using @scheme[~and] and @scheme[~parse], just less +version too, using @racket[~and] and @racket[~parse], just less convenient.) Splicing syntax classes also closely parallel the style of grammars in macro documentation. diff --git a/collects/syntax/scribblings/parse/ex-many-kws.scrbl b/collects/syntax/scribblings/parse/ex-many-kws.scrbl index e6cd248c5d..60f0971fac 100644 --- a/collects/syntax/scribblings/parse/ex-many-kws.scrbl +++ b/collects/syntax/scribblings/parse/ex-many-kws.scrbl @@ -8,10 +8,10 @@ @title{More keyword arguments} -This section shows how to express the syntax of @scheme[struct]'s -optional keyword arguments using @scheme[syntax-parse] patterns. +This section shows how to express the syntax of @racket[struct]'s +optional keyword arguments using @racket[syntax-parse] patterns. -The part of @scheme[struct]'s syntax that is difficult to specify is +The part of @racket[struct]'s syntax that is difficult to specify is the sequence of struct options. Let's get the easy part out of the way first. @@ -32,7 +32,7 @@ first. Given those auxiliary syntax classes, here is a first approximation of the main pattern, including the struct options: -@schemeblock[ +@racketblock[ (struct name:id super:maybe-super (field:field ...) (~or (~seq #:mutable) (~seq #:super super-expr:expr) @@ -48,26 +48,26 @@ the main pattern, including the struct options: (~seq #:omit-define-values)) ...) ] -The fact that @scheme[expr] does not match keywords helps in the case +The fact that @racket[expr] does not match keywords helps in the case where the programmer omits a keyword's argument; instead of accepting -the next keyword as the argument expression, @scheme[syntax-parse] +the next keyword as the argument expression, @racket[syntax-parse] reports that an expression was expected. There are two main problems with the pattern above: @itemize[ @item{There's no way to tell whether a zero-argument keyword like -@scheme[#:mutable] was seen.} -@item{Some options, like @scheme[#:mutable], should appear at most +@racket[#:mutable] was seen.} +@item{Some options, like @racket[#:mutable], should appear at most once.} ] -The first problem can be remedied using @scheme[~and] patterns to bind +The first problem can be remedied using @racket[~and] patterns to bind a pattern variable to the keyword itself, as in this sub-pattern: -@schemeblock[ +@racketblock[ (~seq (~and #:mutable mutable-kw)) ] The second problem can be solved using @emph{repetition constraints}: -@schemeblock[ +@racketblock[ (struct name:id super:maybe-super (field:field ...) (~or (~optional (~seq (~and #:mutable) mutable-kw)) (~optional (~seq #:super super-expr:expr)) @@ -85,19 +85,19 @@ The second problem can be solved using @emph{repetition constraints}: (~optional (~seq (~and #:omit-define-values omit-def-vals-kw)))) ...) ] -The @scheme[~optional] repetition constraint indicates that an -alternative can appear at most once. (There is a @scheme[~once] form -that means it must appear exactly once.) In @scheme[struct]'s keyword -options, only @scheme[#:property] may occur any number of times. +The @racket[~optional] repetition constraint indicates that an +alternative can appear at most once. (There is a @racket[~once] form +that means it must appear exactly once.) In @racket[struct]'s keyword +options, only @racket[#:property] may occur any number of times. There are still some problems, though. Without additional help, -@scheme[~optional] does not report particularly good errors. We must +@racket[~optional] does not report particularly good errors. We must give it the language to use, just as we had to give descriptions to sub-patterns via syntax classes. Also, some related options are -mutually exclusive, such as @scheme[#:inspector], -@scheme[#:transparent], and @scheme[#:prefab]. +mutually exclusive, such as @racket[#:inspector], +@racket[#:transparent], and @racket[#:prefab]. -@schemeblock[ +@racketblock[ (struct name:id super:maybe-super (field:field ...) (~or (~optional (~or (~seq #:inspector inspector:expr) @@ -125,13 +125,13 @@ mutually exclusive, such as @scheme[#:inspector], ...) ] Here we have grouped the three incompatible options together under a -single @scheme[~optional] constraint. That means that at most one of +single @racket[~optional] constraint. That means that at most one of any of those options is allowed. We have given names to the optional -clauses. See @scheme[~optional] for other customization options. +clauses. See @racket[~optional] for other customization options. Note that there are other constraints that we have not represented in -the pattern. For example, @scheme[#:prefab] is also incompatible with -both @scheme[#:guard] and @scheme[#:property]. Repetition constraints +the pattern. For example, @racket[#:prefab] is also incompatible with +both @racket[#:guard] and @racket[#:property]. Repetition constraints cannot express arbitrary incompatibility relations. The best way to handle such contraints is with a side condition using -@scheme[#:fail-when]. +@racket[#:fail-when]. diff --git a/collects/syntax/scribblings/parse/ex-mods-stxclasses.scrbl b/collects/syntax/scribblings/parse/ex-mods-stxclasses.scrbl index c5ff0639e8..11e45974d1 100644 --- a/collects/syntax/scribblings/parse/ex-mods-stxclasses.scrbl +++ b/collects/syntax/scribblings/parse/ex-mods-stxclasses.scrbl @@ -27,14 +27,14 @@ same module; it is defined at the wrong phase. [(_ f:foo) #'(+ f.a f.b f.c)]))) ] -In the module above, the syntax class @scheme[foo] is defined at phase -level 0. The reference to @scheme[foo] within @scheme[macro], however, +In the module above, the syntax class @racket[foo] is defined at phase +level 0. The reference to @racket[foo] within @racket[macro], however, is at phase level 1, being the implementation of a macro -transformer. (Needing to require @schememodname[syntax/parse] twice, -once normally and once @scheme[for-syntax] is another sign of the +transformer. (Needing to require @racketmodname[syntax/parse] twice, +once normally and once @racket[for-syntax] is another sign of the phase level incompatibility.) The only way to define reusable syntax classes that can be used within macros is to define them in a separate -module and require that module @scheme[for-syntax]. +module and require that module @racket[for-syntax]. @myinteraction[ (module stxclass-mod racket @@ -56,7 +56,7 @@ module and require that module @scheme[for-syntax]. If the syntax classes refer to keywords, or if they compute expressions via syntax templates, then the module containing the syntax classes must generally require the keywords or bindings used in -the syntax templates @scheme[for-template]. +the syntax templates @racket[for-template]. @myinteraction[ (module arith-keywords-mod racket @@ -93,15 +93,15 @@ the syntax templates @scheme[for-template]. (arith-macro (plus 1 (times 2 3))) ] -In @scheme['arith-stxclass-mod], the module -@scheme['arith-keywords-mod] must be required @scheme[for-template] +In @racket['arith-stxclass-mod], the module +@racket['arith-keywords-mod] must be required @racket[for-template] because the keywords are used in phase-0 expressions. Likewise, the -module @schememodname[racket] must be required @scheme[for-template] +module @racketmodname[racket] must be required @racket[for-template] because the syntax class contains syntax templates involving -@scheme[+] and @scheme[*] (and, in fact, the implicit @scheme[#%app] -syntax). All of these identifiers (the keywords @scheme[plus] and -@scheme[times]; the procedures @scheme[+] and @scheme[*]; and the -implicit syntax @scheme[#%app]) must be bound at ``absolute'' phase -level 0. Since the module @scheme['arith-stxclass-mod] is required -with a phase level offset of 1 (that is, @scheme[for-syntax]), it must -compensate with a phase level offset of -1, or @scheme[for-template]. +@racket[+] and @racket[*] (and, in fact, the implicit @racket[#%app] +syntax). All of these identifiers (the keywords @racket[plus] and +@racket[times]; the procedures @racket[+] and @racket[*]; and the +implicit syntax @racket[#%app]) must be bound at ``absolute'' phase +level 0. Since the module @racket['arith-stxclass-mod] is required +with a phase level offset of 1 (that is, @racket[for-syntax]), it must +compensate with a phase level offset of -1, or @racket[for-template]. diff --git a/collects/syntax/scribblings/parse/ex-uniform.scrbl b/collects/syntax/scribblings/parse/ex-uniform.scrbl index 65425b9d17..ab194a0509 100644 --- a/collects/syntax/scribblings/parse/ex-uniform.scrbl +++ b/collects/syntax/scribblings/parse/ex-uniform.scrbl @@ -22,10 +22,10 @@ information, that information can be cleanly represented via attributes, and it can be concisely processed using ellipses. One example of a syntax class with uniform meaning: the -@scheme[init-decl] syntax of the @scheme[class] macro. Here is the -specification of @scheme[init-decl]: +@racket[init-decl] syntax of the @racket[class] macro. Here is the +specification of @racket[init-decl]: -@schemegrammar*[[init-decl +@racketgrammar*[[init-decl id (maybe-renamed) (maybe-renamed default-expr)] @@ -33,19 +33,19 @@ specification of @scheme[init-decl]: id (internal-id external-id)]] -The @scheme[init-decl] syntax class has three variants, plus an +The @racket[init-decl] syntax class has three variants, plus an auxiliary syntax class that has two variants of its own. But all forms -of @scheme[init-decl] ultimately carry just three pieces of +of @racket[init-decl] ultimately carry just three pieces of information: an internal name, an external name, and a default configuration of some sort. The simpler syntactic variants are just abbreviations for the full information. The three pieces of information determine the syntax class's attributes. It is useful to declare the attributes explicitly using -the @scheme[#:attributes] keyword; the declaration acts both as +the @racket[#:attributes] keyword; the declaration acts both as in-code documentation and as a check on the variants. -@schemeblock[ +@racketblock[ (define-syntax-class init-decl #:attributes (internal external default) ___) @@ -54,7 +54,7 @@ in-code documentation and as a check on the variants. Next we fill in the syntactic variants, deferring the computation of the attributes: -@schemeblock[ +@racketblock[ (define-syntax-class init-decl #:attributes (internal external default) (pattern ???:id @@ -65,8 +65,8 @@ the attributes: ___)) ] -We perform a similar analysis of @scheme[maybe-renamed]: -@schemeblock[ +We perform a similar analysis of @racket[maybe-renamed]: +@racketblock[ (define-syntax-class maybe-renamed #:attributes (internal external) (pattern ???:id @@ -76,9 +76,9 @@ We perform a similar analysis of @scheme[maybe-renamed]: ] Here's one straightforward way of matching syntactic structure with -attributes for @scheme[maybe-renamed]: +attributes for @racket[maybe-renamed]: -@schemeblock[ +@racketblock[ (define-syntax-class maybe-renamed #:attributes (internal external) (pattern internal:id @@ -86,10 +86,10 @@ attributes for @scheme[maybe-renamed]: (pattern (internal:id external:id))) ] -Given that definition of @scheme[maybe-renamed], we can fill in most -of the definition of @scheme[init-decl]: +Given that definition of @racket[maybe-renamed], we can fill in most +of the definition of @racket[init-decl]: -@schemeblock[ +@racketblock[ (define-syntax-class init-decl #:attributes (internal external default) (pattern internal:id @@ -119,7 +119,7 @@ argument is mandatory. We represent the variants as a (syntax) list containing the default expression and as the empty (syntax) list, respectively. More precisely: -@schemeblock[ +@racketblock[ (define-syntax-class init-decl #:attributes (internal external default) (pattern internal:id diff --git a/collects/syntax/scribblings/parse/ex-varied.scrbl b/collects/syntax/scribblings/parse/ex-varied.scrbl index 660d4f76d3..688644541c 100644 --- a/collects/syntax/scribblings/parse/ex-varied.scrbl +++ b/collects/syntax/scribblings/parse/ex-varied.scrbl @@ -15,9 +15,9 @@ kinds of information. This section discusses the latter kind of syntax class. A good example of a syntax class with varied meanings is the -@scheme[for-clause] of the @scheme[for] family of special forms. +@racket[for-clause] of the @racket[for] family of special forms. -@schemegrammar[for-clause +@racketgrammar[for-clause [id seq-expr] [(id ...) seq-expr] (code:line #:when guard-expr)] @@ -26,8 +26,8 @@ The first two variants carry the same kind of information; both consist of identifiers to bind and a sequence expression. The third variant, however, means something totally different: a condition that determines whether to continue the current iteration of the loop, plus -a change in scoping for subsequent @scheme[seq-expr]s. The information -of a @scheme[for-clause] must be represented in a way that a client +a change in scoping for subsequent @racket[seq-expr]s. The information +of a @racket[for-clause] must be represented in a way that a client macro can do further case analysis to distinguish the ``bind variables from a sequence'' case from the ``skip or continue this iteration and enter a new scope'' case. @@ -43,7 +43,7 @@ why not adapt that representation, removing redundancies and eliminating simplifying the syntax to make subsequent re-parsing trivial. -@schemeblock[ +@racketblock[ (define-splicing-syntax-class for-clause #:attribute (norm) (pattern [var:id seq:expr] @@ -54,18 +54,18 @@ trivial. #:with norm #'[#:when guard])) ] -First, note that since the @scheme[#:when] variant consists of two -separate terms, we define @scheme[for-clause] as a splicing syntax +First, note that since the @racket[#:when] variant consists of two +separate terms, we define @racket[for-clause] as a splicing syntax class. Second, that kind of irregularity is just the sort of thing we'd like to remove so we don't have to deal with it again later. Thus we represent the normalized syntax as a single term beginning with either a sequence of identifiers (the first two cases) or the keyword -@scheme[#:when] (the third case). The two normalized cases are easy to +@racket[#:when] (the third case). The two normalized cases are easy to process and easy to tell apart. We have also taken the opportunity to desugar the first case into the second. A normalized syntactic representation is most useful when the -subsequent case analysis is performed by @scheme[syntax-parse] or a +subsequent case analysis is performed by @racket[syntax-parse] or a similar form. @section{Non-syntax-valued attributes} @@ -76,11 +76,11 @@ intermediate representation using idiomatic Racket data structures, such as lists, hashes, structs, and even objects. Thus far we have only used syntax pattern variables and the -@scheme[#:with] keyword to bind attribues, and the values of the +@racket[#:with] keyword to bind attribues, and the values of the attributes have always been syntax. To bind attributes to values other -than syntax, use the @scheme[#:attr] keyword. +than syntax, use the @racket[#:attr] keyword. -@schemeblock[ +@racketblock[ (code:comment "A ForClause is either") (code:comment " - (bind-clause (listof identifier) syntax)") (code:comment " - (when-clause syntax)") @@ -98,10 +98,10 @@ than syntax, use the @scheme[#:attr] keyword. #:attr ast (when-clause #'guard))) ] -Be careful! If we had used @scheme[#:with] instead of @scheme[#:attr], -the @scheme[#f] would have been coerced to a syntax object before -being matched against the pattern @scheme[default]. +Be careful! If we had used @racket[#:with] instead of @racket[#:attr], +the @racket[#f] would have been coerced to a syntax object before +being matched against the pattern @racket[default]. Attributes with non-syntax values cannot be used in syntax -templates. Use the @scheme[attribute] form to get the value of an +templates. Use the @racket[attribute] form to get the value of an attribute. diff --git a/collects/syntax/scribblings/parse/examples.scrbl b/collects/syntax/scribblings/parse/examples.scrbl index 47918526ea..5ede0fe791 100644 --- a/collects/syntax/scribblings/parse/examples.scrbl +++ b/collects/syntax/scribblings/parse/examples.scrbl @@ -9,7 +9,7 @@ @title[#:tag "stxparse-examples" #:style '(toc)]{Examples} This section provides an extended introduction to -@schememodname[syntax/parse] as a series of worked examples. +@racketmodname[syntax/parse] as a series of worked examples. @local-table-of-contents[] diff --git a/collects/syntax/scribblings/parse/experimental.scrbl b/collects/syntax/scribblings/parse/experimental.scrbl index 29ca0fed1f..e545185f6d 100644 --- a/collects/syntax/scribblings/parse/experimental.scrbl +++ b/collects/syntax/scribblings/parse/experimental.scrbl @@ -24,9 +24,9 @@ Macros can apply contracts to their sub-expressions using the [#:context ctx #f]) (attributes c)]{ -Accepts an expression (@scheme[expr]) and computes an attribute -@scheme[c] that represents the expression wrapped with the contract -represented by @scheme[contract-expr]. +Accepts an expression (@racket[expr]) and computes an attribute +@racket[c] that represents the expression wrapped with the contract +represented by @racket[contract-expr]. See @secref{exprc} for an example. } @@ -46,13 +46,13 @@ See @secref{exprc} for an example. #:contracts ([contract-expr contract?])]{ Provides the syntax class (or splicing syntax class) -@scheme[syntax-class-id] with the given contracts imposed on its +@racket[syntax-class-id] with the given contracts imposed on its formal parameters. } @defidform[syntax-class/c]{ -Keyword recognized by @scheme[provide-syntax-class/contract]. +Keyword recognized by @racket[provide-syntax-class/contract]. } @section{Reflection} @@ -60,21 +60,21 @@ Keyword recognized by @scheme[provide-syntax-class/contract]. @defmodule[syntax/parse/experimental/reflect] A syntax class can be reified into a run-time value, and a reified -syntax class can be used in a pattern via the @scheme[~reflect] and -@scheme[~splicing-reflect] pattern forms. +syntax class can be used in a pattern via the @racket[~reflect] and +@racket[~splicing-reflect] pattern forms. @defform[(reify-syntax-class syntax-class-id)]{ -Reifies the syntax class named @scheme[syntax-class-id] as a run-time +Reifies the syntax class named @racket[syntax-class-id] as a run-time value. The same form also handles splicing syntax classes. Syntax -classes with the @scheme[#:no-delimit-cut] option cannot be reified. +classes with the @racket[#:no-delimit-cut] option cannot be reified. } @deftogether[( @defproc[(reified-syntax-class? [x any/c]) boolean?] @defproc[(reified-splicing-syntax-class? [x any/c]) boolean?])]{ -Returns @scheme[#t] if @scheme[x] is a reified (normal) syntax class +Returns @racket[#t] if @racket[x] is a reified (normal) syntax class or a reified splicing syntax class, respectively. } @@ -94,8 +94,8 @@ Returns the reified syntax class's attributes. (values (listof keyword?) (listof keyword?))]]]{ Returns the reified syntax class's arity and keywords, -respectively. Compare with @scheme[procedure-arity] and -@scheme[procedure-keywords]. +respectively. Compare with @racket[procedure-arity] and +@racket[procedure-keywords]. } @defproc[(reified-syntax-class-curry @@ -109,7 +109,7 @@ more arguments are given than the reified syntax class accepts, an error is raised. } -@schemegrammar*[#:literals (~reflect ~splicing-reflect) +@racketgrammar*[#:literals (~reflect ~splicing-reflect) [S-pattern .... (~reflect var-id (reified-expr arg-expr ...) maybe-attrs)] [H-pattern .... @@ -120,7 +120,7 @@ error is raised. ([maybe-attrs (code:line) (code:line #:attributes (attr-arity-decl ...))])]{ -Like @scheme[~var], except that the syntax class position is an +Like @racket[~var], except that the syntax class position is an expression evaluating to a reified syntax object, not a syntax class name, and the attributes bound by the reified syntax class (if any) must be specified explicitly. @@ -128,7 +128,7 @@ must be specified explicitly. @specsubform[(@#,(defhere ~splicing-reflect) var-id (reified-expr arg-expr ...) maybe-attrs)]{ -Like @scheme[~reflect] but for reified splicing syntax classes. +Like @racket[~reflect] but for reified splicing syntax classes. } @myexamples[ @@ -182,7 +182,7 @@ Defines a splicing syntax via a procedural parser. The parser procedure is given two arguments, the syntax to parse and a failure procedure. To signal a successful parse, the parser procedure -returns a list of @scheme[N]+1 elements, where @scheme[N] is the +returns a list of @racket[N]+1 elements, where @racket[N] is the number of attributes declared by the splicing syntax class. The first element is the size of the prefix consumed. The rest of the list contains the values of the attributes. @@ -208,24 +208,24 @@ reusable encapsulations of @|EHpatterns|. (define-eh-alternative-set name eh-alternative ...) ([alternative (pattern EH-pattern)])]{ -Defines @scheme[name] as an ellipsis-head alternative set. Using -@scheme[name] (via @scheme[~eh-var]) in an ellipsis-head pattern is +Defines @racket[name] as an ellipsis-head alternative set. Using +@racket[name] (via @racket[~eh-var]) in an ellipsis-head pattern is equivalent to including each of the alternatives in the pattern via @ref[~or eh], except that the attributes bound by the alternatives are -prefixed with the name given to @scheme[~eh-var]. +prefixed with the name given to @racket[~eh-var]. Unlike syntax classes, ellipsis-head alternative sets must be defined before they are referenced. } -@schemegrammar*[#:literals (~eh-var) +@racketgrammar*[#:literals (~eh-var) [EH-pattern .... (~eh-var name eh-alternative-set-id)]] @specsubform[(@#,(defhere ~eh-var) name eh-alternative-set-id)]{ -Includes the alternatives of @scheme[eh-alternative-set-id], prefixing -their attributes with @scheme[name]. +Includes the alternatives of @racket[eh-alternative-set-id], prefixing +their attributes with @racket[name]. } @myexamples[ diff --git a/collects/syntax/scribblings/parse/intro.scrbl b/collects/syntax/scribblings/parse/intro.scrbl index c6e047e504..6c57b9f4ed 100644 --- a/collects/syntax/scribblings/parse/intro.scrbl +++ b/collects/syntax/scribblings/parse/intro.scrbl @@ -16,14 +16,14 @@ @declare-exporting[syntax/scribblings/parse/parse-dummy-bindings] This section provides an introduction to writing robust macros with -@scheme[syntax-parse] and syntax classes. +@racket[syntax-parse] and syntax classes. As a running example we use the following task: write a macro named -@scheme[mylet] that has the same syntax and behavior as Racket's -@scheme[let] form. The macro should produce good error messages when +@racket[mylet] that has the same syntax and behavior as Racket's +@racket[let] form. The macro should produce good error messages when used incorrectly. -Here is the specification of @scheme[mylet]'s syntax: +Here is the specification of @racket[mylet]'s syntax: @;{bleh!} @specform[#:literals (mylet) @@ -44,7 +44,7 @@ The macro can be implemented very simply using When used correctly, the macro works, but it behaves very badly in the presence of errors. In some cases, the macro merely fails with an uninformative error message; in others, it blithely accepts illegal -syntax and passes it along to @scheme[lambda], with strange +syntax and passes it along to @racket[lambda], with strange consequences: @myinteraction[ @@ -56,16 +56,16 @@ consequences: These examples of illegal syntax are not to suggest that a typical programmer would make such mistakes attempting to use -@scheme[mylet]. At least, not often, not after an initial learning +@racket[mylet]. At least, not often, not after an initial learning curve. But macros are also used by inexpert programmers and as targets of other macros (or code generators), and many macros are far more -complex than @scheme[mylet]. Macros must validate their syntax and +complex than @racket[mylet]. Macros must validate their syntax and report appropriate errors. Furthermore, the macro writer benefits from the @emph{machine-checked} specification of syntax in the form of more readable, maintainable code. We can improve the error behavior of the macro by using -@racket[syntax-parse]. First, we import @scheme[syntax-parse] into the +@racket[syntax-parse]. First, we import @racket[syntax-parse] into the @tech[#:doc '(lib "scribblings/reference/reference.scrbl")]{transformer environment}, since we will use it to implement a macro transformer. @@ -83,20 +83,20 @@ version using @racket[define-syntax-rule] above. #'((lambda (var-id ...) body ...) rhs-expr ...)])) ] -One minor difference is the use of @scheme[...+] in the pattern; -@scheme[...] means match zero or more repetitions of the preceding -pattern; @scheme[...+] means match one or more. Only @scheme[...] may +One minor difference is the use of @racket[...+] in the pattern; +@racket[...] means match zero or more repetitions of the preceding +pattern; @racket[...+] means match one or more. Only @racket[...] may be used in the template, however. The first step toward validation and high-quality error reporting is annotating each of the macro's pattern variables with the @tech{syntax -class} that describes its acceptable syntax. In @scheme[mylet], each -variable must be an @scheme[identifier] (@scheme[id] for short) and -each right-hand side must be an @scheme[expr] (expression). An +class} that describes its acceptable syntax. In @racket[mylet], each +variable must be an @racket[identifier] (@racket[id] for short) and +each right-hand side must be an @racket[expr] (expression). An @tech{annotated pattern variable} is written by concatenating the pattern variable name, a colon character, and the syntax class name.@margin-note*{For an alternative to the ``colon'' syntax, see the -@scheme[~var] pattern form.} +@racket[~var] pattern form.} @myinteraction[ (define-syntax (mylet stx) @@ -105,20 +105,20 @@ name.@margin-note*{For an alternative to the ``colon'' syntax, see the #'((lambda (var ...) body ...) rhs ...)])) ] Note that the syntax class annotations do not appear in the template -(i.e., @scheme[var], not @scheme[var:id]). +(i.e., @racket[var], not @racket[var:id]). The syntax class annotations are checked when we use the macro. @myinteraction[ (mylet ([a 1] [b 2]) (+ a b)) (mylet (["a" 1]) (add1 a)) ] -The @scheme[expr] syntax class does not actually check that the term +The @racket[expr] syntax class does not actually check that the term it matches is a valid expression---that would require calling that -macro expander. Instead, @scheme[expr] just means not a keyword. +macro expander. Instead, @racket[expr] just means not a keyword. @myinteraction[ (mylet ([a #:whoops]) 1) ] -Also, @scheme[syntax-parse] knows how to report a few kinds of errors +Also, @racket[syntax-parse] knows how to report a few kinds of errors without any help: @myinteraction[ (mylet ([a 1 2]) (* a a)) @@ -129,15 +129,15 @@ handle gracefully: (mylet (a 1) (+ a 2)) ] It's too much to ask for the macro to respond, ``This expression is -missing a pair of parentheses around @scheme[(a 1)].'' The pattern +missing a pair of parentheses around @racket[(a 1)].'' The pattern matcher is not that smart. But it can pinpoint the source of the -error: when it encountered @scheme[a] it was expecting what we might +error: when it encountered @racket[a] it was expecting what we might call a ``binding pair,'' but that term is not in its vocabulary yet. -To allow @scheme[syntax-parse] to synthesize better errors, we must +To allow @racket[syntax-parse] to synthesize better errors, we must attach @emph{descriptions} to the patterns we recognize as discrete syntactic categories. One way of doing that is by defining new syntax -classes:@margin-note*{Another way is the @scheme[~describe] pattern +classes:@margin-note*{Another way is the @racket[~describe] pattern form.} @myinteraction[ @@ -152,10 +152,10 @@ form.} #'((lambda (b.var ...) body ...) b.rhs ...)])) ] -Note that we write @scheme[b.var] and @scheme[b.rhs] now. They are the +Note that we write @racket[b.var] and @racket[b.rhs] now. They are the @tech{nested attributes} formed from the annotated pattern variable -@scheme[b] and the attributes @scheme[var] and @scheme[rhs] of the -syntax class @scheme[binding]. +@racket[b] and the attributes @racket[var] and @racket[rhs] of the +syntax class @racket[binding]. Now the error messages can talk about ``binding pairs.'' @myinteraction[ @@ -167,9 +167,9 @@ Errors are still reported in more specific terms when possible: ] There is one other constraint on the legal syntax of -@scheme[mylet]. The variables bound by the different binding pairs +@racket[mylet]. The variables bound by the different binding pairs must be distinct. Otherwise the macro creates an illegal -@scheme[lambda] form: +@racket[lambda] form: @myinteraction[ (mylet ([a 1] [a 2]) (+ a a)) ] @@ -193,9 +193,9 @@ conditions, thus: @myinteraction[ (mylet ([a 1] [a 2]) (+ a a)) ] -The @scheme[#:fail-when] keyword is followed by two expressions: the +The @racket[#:fail-when] keyword is followed by two expressions: the condition and the error message. When the condition evaluates to -anything but @scheme[#f], the pattern fails. Additionally, if the +anything but @racket[#f], the pattern fails. Additionally, if the condition evaluates to a syntax object, that syntax object is used to pinpoint the cause of the failure. @@ -222,20 +222,20 @@ distinct binding pairs.'' [(_ bs:distinct-bindings . body) #'((lambda (bs.var ...) . body) bs.rhs ...)])) ] -Here we've introduced the @scheme[#:with] clause. A @scheme[#:with] +Here we've introduced the @racket[#:with] clause. A @racket[#:with] clause matches a pattern with a computed term. Here we use it to bind -@scheme[var] and @scheme[rhs] as attributes of -@scheme[distinct-bindings]. By default, a syntax class only exports +@racket[var] and @racket[rhs] as attributes of +@racket[distinct-bindings]. By default, a syntax class only exports its patterns' pattern variables as attributes, not their nested attributes.@margin-note*{The alternative would be to explicitly declare -the attributes of @scheme[distinct-bindings] to include the nested -attributes @scheme[b.var] and @scheme[b.rhs], using the -@scheme[#:attribute] option. Then the macro would refer to -@scheme[bs.b.var] and @scheme[bs.b.rhs].} +the attributes of @racket[distinct-bindings] to include the nested +attributes @racket[b.var] and @racket[b.rhs], using the +@racket[#:attribute] option. Then the macro would refer to +@racket[bs.b.var] and @racket[bs.b.rhs].} Alas, so far the macro only implements half of the functionality -offered by Racket's @scheme[let]. We must add the -``named-@scheme[let]'' form. That turns out to be as simple as adding +offered by Racket's @racket[let]. We must add the +``named-@racket[let]'' form. That turns out to be as simple as adding a new clause: @myinteraction[ @@ -261,11 +261,11 @@ a new clause: #'(letrec ([loop (lambda (bs.var ...) body ...)]) (loop bs.rhs ...))])) ] -We are able to reuse the @scheme[distinct-bindings] syntax class, so -the addition of the ``named-@scheme[let]'' syntax requires only three +We are able to reuse the @racket[distinct-bindings] syntax class, so +the addition of the ``named-@racket[let]'' syntax requires only three lines. -But does adding this new case affect @scheme[syntax-parse]'s ability +But does adding this new case affect @racket[syntax-parse]'s ability to pinpoint and report errors? @myinteraction[ (mylet ([a 1] [b 2]) (+ a b)) @@ -276,8 +276,8 @@ to pinpoint and report errors? (mylet ([a 1] [a 2]) (+ a a)) ] The error reporting for the original syntax seems intact. We should -verify that the named-@scheme[let] syntax is working, that -@scheme[syntax-parse] is not simply ignoring that clause. +verify that the named-@racket[let] syntax is working, that +@racket[syntax-parse] is not simply ignoring that clause. @myinteraction[ (mylet loop ([a 1] [b 2]) (+ a b)) (mylet loop (["a" 1]) (add1 a)) @@ -287,24 +287,24 @@ verify that the named-@scheme[let] syntax is working, that (mylet loop ([a 1] [a 2]) (+ a a)) ] -How does @scheme[syntax-parse] decide which clause the programmer was +How does @racket[syntax-parse] decide which clause the programmer was attempting, so it can use it as a basis for error reporting? After -all, each of the bad uses of the named-@scheme[let] syntax are also +all, each of the bad uses of the named-@racket[let] syntax are also bad uses of the normal syntax, and vice versa. And yet the macro doen -not produce errors like ``@scheme[mylet]: expected sequence of -distinct binding pairs at: @scheme[loop].'' +not produce errors like ``@racket[mylet]: expected sequence of +distinct binding pairs at: @racket[loop].'' -The answer is that @scheme[syntax-parse] records a list of all the -potential errors (including ones like @scheme[loop] not matching -@scheme[distinct-binding]) along with the @emph{progress} made before +The answer is that @racket[syntax-parse] records a list of all the +potential errors (including ones like @racket[loop] not matching +@racket[distinct-binding]) along with the @emph{progress} made before each error. Only the error with the most progress is reported. For example, in this bad use of the macro, @myinteraction[ (mylet loop (["a" 1]) (add1 a)) ] -there are two potential errors: expected @scheme[distinct-bindings] at -@scheme[loop] and expected @scheme[identifier] at @scheme["a"]. The +there are two potential errors: expected @racket[distinct-bindings] at +@racket[loop] and expected @racket[identifier] at @racket["a"]. The second error occurs further in the term than the first, so it is reported. @@ -312,9 +312,9 @@ For another example, consider this term: @myinteraction[ (mylet (["a" 1]) (add1 a)) ] -Again, there are two potential errors: expected @scheme[identifier] at -@scheme[(["a" 1])] and expected @scheme[identifier] at -@scheme["a"]. They both occur at the second term (or first argument, +Again, there are two potential errors: expected @racket[identifier] at +@racket[(["a" 1])] and expected @racket[identifier] at +@racket["a"]. They both occur at the second term (or first argument, if you prefer), but the second error occurs deeper in the term. Progress is based on a left-to-right traversal of the syntax. @@ -322,13 +322,13 @@ A final example: consider the following: @myinteraction[ (mylet ([a 1] [a 2]) (+ a a)) ] -There are two errors again: duplicate variable name at @scheme[([a 1] -[a 2])] and expected @scheme[identifier] at @scheme[([a 1] [a -2])]. Note that as far as @scheme[syntax-parse] is concerned, the +There are two errors again: duplicate variable name at @racket[([a 1] +[a 2])] and expected @racket[identifier] at @racket[([a 1] [a +2])]. Note that as far as @racket[syntax-parse] is concerned, the progress associated with the duplicate error message is the second -term (first argument), not the second occurrence of @scheme[a]. That's +term (first argument), not the second occurrence of @racket[a]. That's because the check is associated with the entire -@scheme[distinct-bindings] pattern. It would seem that both errors +@racket[distinct-bindings] pattern. It would seem that both errors have the same progress, and yet only the first one is reported. The difference between the two is that the first error is from a @emph{post-traversal} check, whereas the second is from a normal @@ -342,24 +342,24 @@ the same progress. Here's one example: @myinteraction[ (mylet "not-even-close") ] -In this case @scheme[syntax-parse] reports both errors. +In this case @racket[syntax-parse] reports both errors. Even with all of the annotations we have added to our macro, there are -still some misuses that defy @scheme[syntax-parse]'s error reporting +still some misuses that defy @racket[syntax-parse]'s error reporting capabilities, such as this example: @myinteraction[ (mylet) ] -The philosophy behind @scheme[syntax-parse] is that in these +The philosophy behind @racket[syntax-parse] is that in these situations, a generic error such as ``bad syntax'' is justified. The -use of @scheme[mylet] here is so far off that the only informative +use of @racket[mylet] here is so far off that the only informative error message would include a complete recapitulation of the syntax of -@scheme[mylet]. That is not the role of error messages, however; it is +@racket[mylet]. That is not the role of error messages, however; it is the role of documentation. This section has provided an introduction to syntax classes, side conditions, and progress-ordered error reporting. But -@scheme[syntax-parse] has many more features. Continue to the +@racket[syntax-parse] has many more features. Continue to the @secref{stxparse-examples} section for samples of other features in working code, or skip to the subsequent sections for the complete reference documentation. diff --git a/collects/syntax/scribblings/parse/lib.scrbl b/collects/syntax/scribblings/parse/lib.scrbl index ec6b79733a..e9f20d530a 100644 --- a/collects/syntax/scribblings/parse/lib.scrbl +++ b/collects/syntax/scribblings/parse/lib.scrbl @@ -39,8 +39,8 @@ actually a valid expression. Match syntax satisfying the corresponding predicates. } -@defstxclass[id]{ Alias for @scheme[identifier]. } -@defstxclass[nat]{ Alias for @scheme[exact-nonnegative-integer]. } +@defstxclass[id]{ Alias for @racket[identifier]. } +@defstxclass[nat]{ Alias for @racket[exact-nonnegative-integer]. } @defproc[(static [predicate (-> any/c any/c)] [description (or/c string? #f)]) @@ -48,12 +48,12 @@ Match syntax satisfying the corresponding predicates. The @racket[static] syntax class matches an identifier that is bound in the syntactic environment to static -information (see @scheme[syntax-local-value]) satisfying the given -@scheme[predicate]. If the term does not match, the -@scheme[description] argument is used to describe the expected syntax. +information (see @racket[syntax-local-value]) satisfying the given +@racket[predicate]. If the term does not match, the +@racket[description] argument is used to describe the expected syntax. When used outside of the dynamic extent of a macro transformer (see -@scheme[syntax-transforming?]), matching fails. +@racket[syntax-transforming?]), matching fails. The attribute @var[value] contains the value the name is bound to. } @@ -66,10 +66,10 @@ The attribute @var[value] contains the value the name is bound to. Literal set containing the identifiers for fully-expanded code (@secref[#:doc '(lib "scribblings/reference/reference.scrbl") "fully-expanded"]). The set contains all of the forms listed by -@scheme[kernel-form-identifier-list], plus @scheme[module], -@scheme[#%plain-module-begin], @scheme[#%require], and -@scheme[#%provide]. +@racket[kernel-form-identifier-list], plus @racket[module], +@racket[#%plain-module-begin], @racket[#%require], and +@racket[#%provide]. -Note that the literal-set uses the names @scheme[#%plain-lambda] and -@scheme[#%plain-app], not @scheme[lambda] and @scheme[#%app]. +Note that the literal-set uses the names @racket[#%plain-lambda] and +@racket[#%plain-app], not @racket[lambda] and @racket[#%app]. } diff --git a/collects/syntax/scribblings/parse/litconv.scrbl b/collects/syntax/scribblings/parse/litconv.scrbl index 27ca3db59c..927b4a3d38 100644 --- a/collects/syntax/scribblings/parse/litconv.scrbl +++ b/collects/syntax/scribblings/parse/litconv.scrbl @@ -11,9 +11,9 @@ Sometimes the same literals are recognized in a number of different places. The most common example is the literals for fully expanded programs, which are used in many analysis and transformation tools. Specifying literals individually is burdensome and error-prone. -As a remedy, @schememodname[syntax/parse] offers @deftech{literal -sets}. A literal set is defined via @scheme[define-literal-set] and -used via the @scheme[#:literal-set] option of @scheme[syntax-parse]. +As a remedy, @racketmodname[syntax/parse] offers @deftech{literal +sets}. A literal set is defined via @racket[define-literal-set] and +used via the @racket[#:literal-set] option of @racket[syntax-parse]. @defform/subs[(define-literal-set id maybe-phase maybe-imports (literal ...)) ([literal literal-id @@ -26,10 +26,10 @@ used via the @scheme[#:literal-set] option of @scheme[syntax-parse]. [maybe-imports (code:line) (code:line #:literal-sets (imported-litset-id ...))])]{ -Defines @scheme[id] as a @tech{literal set}. Each @scheme[literal] can -have a separate @scheme[pattern-id] and @scheme[literal-id]. The -@scheme[pattern-id] determines what identifiers in the pattern are -treated as literals. The @scheme[literal-id] determines what +Defines @racket[id] as a @tech{literal set}. Each @racket[literal] can +have a separate @racket[pattern-id] and @racket[literal-id]. The +@racket[pattern-id] determines what identifiers in the pattern are +treated as literals. The @racket[literal-id] determines what identifiers the literal matches. If the @racket[#:literal-sets] option is present, the contents of the given @racket[imported-litset-id]s are included. @@ -44,9 +44,9 @@ included. ] The literals in a literal set always refer to the bindings at phase -@scheme[phase-level] @emph{relative to the enclosing module}. If the -@scheme[#:for-template] option is given, @scheme[phase-level] is -@scheme[-1]; @scheme[#:for-syntax] means @racket[1], and +@racket[phase-level] @emph{relative to the enclosing module}. If the +@racket[#:for-template] option is given, @racket[phase-level] is +@racket[-1]; @racket[#:for-syntax] means @racket[1], and @racket[#:for-label] means @racket[#f]. If no phase keyword option is given, then @racket[phase-level] is @racket[0]. @@ -63,9 +63,9 @@ For example: (provide common-lits)) ] -In the literal set @scheme[common-lits], the literal @scheme[x] always -recognizes identifiers bound to the variable @scheme[x] defined in -module @schememodname['common]. +In the literal set @racket[common-lits], the literal @racket[x] always +recognizes identifiers bound to the variable @racket[x] defined in +module @racketmodname['common]. The following module defines an equivalent literal set, but imports the @racket['common] module for-template instead: @@ -77,7 +77,7 @@ the @racket['common] module for-template instead: (provide common-lits)) ] -When a literal set is @emph{used} with the @scheme[#:phase phase-expr] +When a literal set is @emph{used} with the @racket[#:phase phase-expr] option, the literals' fixed bindings are compared against the binding of the input literal at the specified phase. Continuing the example: @@ -88,9 +88,9 @@ the input literal at the specified phase. Continuing the example: [_ 'no]) ] -The occurrence of @scheme[x] in the pattern matches any identifier -whose binding at phase 1 is the @scheme[x] from module -@schememodname['common]. +The occurrence of @racket[x] in the pattern matches any identifier +whose binding at phase 1 is the @racket[x] from module +@racketmodname['common]. } @defform[(literal-set->predicate litset-id)]{ @@ -120,9 +120,9 @@ the @racket[_phase] argument defaults to Defines @deftech{conventions} that supply default syntax classes for pattern variables. A pattern variable that has no explicit syntax -class is checked against each @scheme[id-pattern], and the first one +class is checked against each @racket[id-pattern], and the first one that matches determines the syntax class for the pattern. If no -@scheme[id-pattern] matches, then the pattern variable has no syntax +@racket[id-pattern] matches, then the pattern variable has no syntax class. @myexamples[ @@ -140,8 +140,8 @@ class. (syntax->datum #'(x0 (x ...) n0 (n ...)))]) ] -Local conventions, introduced with the @scheme[#:local-conventions] -keyword argument of @scheme[syntax-parse] and syntax class +Local conventions, introduced with the @racket[#:local-conventions] +keyword argument of @racket[syntax-parse] and syntax class definitions, may refer to local bindings: @myexamples[ diff --git a/collects/syntax/scribblings/parse/parse-common.rkt b/collects/syntax/scribblings/parse/parse-common.rkt index bc4c8a02be..6626ff059c 100644 --- a/collects/syntax/scribblings/parse/parse-common.rkt +++ b/collects/syntax/scribblings/parse/parse-common.rkt @@ -61,10 +61,10 @@ (define Apatterns "action patterns") (provide Spattern - Lpattern - Hpattern + Lpattern + Hpattern EHpattern - Apattern + Apattern Spatterns Lpatterns Hpatterns @@ -79,7 +79,7 @@ (syntax-rules () [(ref id suffix ...) (elemref (list 'pattern-link (list 'id 'suffix ...)) - (schemekeywordfont (symbol->string 'id)) + (racketkeywordfont (symbol->string 'id)) (superscript (symbol->string 'suffix)) ... #:underline? #f)])) (define-syntax def diff --git a/collects/syntax/scribblings/parse/parsing.scrbl b/collects/syntax/scribblings/parse/parsing.scrbl index 61bd754478..bd4d67aa0d 100644 --- a/collects/syntax/scribblings/parse/parsing.scrbl +++ b/collects/syntax/scribblings/parse/parsing.scrbl @@ -7,17 +7,17 @@ @title{Parsing syntax} -This section describes @scheme[syntax-parse], the -@schememodname[syntax/parse] library's facility for parsing -syntax. Both @scheme[syntax-parse] and the specification facility, +This section describes @racket[syntax-parse], the +@racketmodname[syntax/parse] library's facility for parsing +syntax. Both @racket[syntax-parse] and the specification facility, @seclink["stxparse-specifying"]{syntax classes}, use a common language of @tech{syntax patterns}, which is described in detail in @secref{stxparse-patterns}. @declare-exporting[syntax/parse] -Two parsing forms are provided: @scheme[syntax-parse] and -@scheme[syntax-parser]. +Two parsing forms are provided: @racket[syntax-parse] and +@racket[syntax-parser]. @defform/subs[(syntax-parse stx-expr parse-option ... clause ...+) ([parse-option (code:line #:context context-expr) @@ -38,11 +38,11 @@ Two parsing forms are provided: @scheme[syntax-parse] and [context-expr syntax?] [phase-expr (or/c exact-integer? #f)])]{ -Evaluates @scheme[stx-expr], which should produce a syntax object, and -matches it against the @scheme[clause]s in order. If some clause's +Evaluates @racket[stx-expr], which should produce a syntax object, and +matches it against the @racket[clause]s in order. If some clause's pattern matches, its attributes are bound to the corresponding subterms of the syntax object and that clause's side conditions and -@scheme[expr] is evaluated. The result is the result of @scheme[expr]. +@racket[expr] is evaluated. The result is the result of @racket[expr]. Each clause consists of a @tech{syntax pattern}, an optional sequence of @tech{pattern directives}, and a non-empty sequence of body @@ -57,8 +57,8 @@ The following options are supported: @specsubform[(code:line #:context context-expr) #:contracts ([context-expr syntax?])]{ -When present, @scheme[context-expr] is used in reporting parse -failures; otherwise @scheme[stx-expr] is used. +When present, @racket[context-expr] is used in reporting parse +failures; otherwise @racket[stx-expr] is used. @(myexamples (syntax-parse #'(a b 3) @@ -74,23 +74,23 @@ failures; otherwise @scheme[stx-expr] is used. (pattern-id literal-id #:phase phase-expr)]) #:contracts ([phase-expr (or/c exact-integer? #f)])]{ @margin-note*{ - Unlike @scheme[syntax-case], @scheme[syntax-parse] requires all + Unlike @racket[syntax-case], @racket[syntax-parse] requires all literals to have a binding. To match identifiers by their symbolic - names, use the @scheme[~datum] pattern form instead. + names, use the @racket[~datum] pattern form instead. } @; -The @scheme[#:literals] option specifies identifiers that should be +The @racket[#:literals] option specifies identifiers that should be treated as @tech{literals} rather than @tech{pattern variables}. An entry in the literals list has two components: the identifier used within the pattern to signify the positions to be matched -(@scheme[pattern-id]), and the identifier expected to occur in those -positions (@scheme[literal-id]). If the entry is a single identifier, +(@racket[pattern-id]), and the identifier expected to occur in those +positions (@racket[literal-id]). If the entry is a single identifier, that identifier is used for both purposes. -If the @scheme[#:phase] option is given, then the literal is compared -at phase @scheme[phase-expr]. Specifically, the binding of the -@scheme[literal-id] at phase @scheme[phase-expr] must match the -input's binding at phase @scheme[phase-expr]. +If the @racket[#:phase] option is given, then the literal is compared +at phase @racket[phase-expr]. Specifically, the binding of the +@racket[literal-id] at phase @racket[phase-expr] must match the +input's binding at phase @racket[phase-expr]. } @specsubform/subs[(code:line #:literal-sets (literal-set ...)) @@ -101,7 +101,7 @@ input's binding at phase @scheme[phase-expr]. #:contracts ([phase-expr (or/c exact-integer? #f)])]{ Many literals can be declared at once via one or more @tech{literal -sets}, imported with the @scheme[#:literal-sets] option. See +sets}, imported with the @racket[#:literal-sets] option. See @tech{literal sets} for more information. If the @racket[#:at] keyword is given, the lexical context of the @@ -119,7 +119,7 @@ variables that do not explicitly specify a syntax class. @specsubform[(code:line #:local-conventions (convention-rule ...))]{ Uses the @tech{conventions} specified. The advantage of -@scheme[#:local-conventions] over @scheme[#:conventions] is that local +@racket[#:local-conventions] over @racket[#:conventions] is that local conventions can be in the scope of syntax-class parameter bindings. See the section on @tech{conventions} for examples. } @@ -139,7 +139,7 @@ Suppresses the ``colon notation'' for annotated pattern variables. @defform[(syntax-parser parse-option ... clause ...+)]{ -Like @scheme[syntax-parse], but produces a matching procedure. The +Like @racket[syntax-parse], but produces a matching procedure. The procedure accepts a single argument, which should be a syntax object. } diff --git a/collects/syntax/scribblings/parse/patterns.scrbl b/collects/syntax/scribblings/parse/patterns.scrbl index a3b976e968..1a64275b80 100644 --- a/collects/syntax/scribblings/parse/patterns.scrbl +++ b/collects/syntax/scribblings/parse/patterns.scrbl @@ -14,7 +14,7 @@ @title[#:tag "stxparse-patterns"]{Syntax patterns} The grammar of @deftech{syntax patterns} used by -@schememodname[syntax/parse] facilities is given in the following +@racketmodname[syntax/parse] facilities is given in the following table. There are four main kinds of syntax pattern: @itemize[ @item{@tech{@Spatterns}, abbreviated @svar[S-pattern]} @@ -27,10 +27,10 @@ A fifth kind, @tech{@Lpatterns} (abbreviated @tech{@Spatterns}. When a special form in this manual refers to @svar[syntax-pattern] -(eg, the description of the @scheme[syntax-parse] special form), it +(eg, the description of the @racket[syntax-parse] special form), it means specifically @tech{@Spattern}. -@schemegrammar*[#:literals (_ ~var ~literal ~or ~and ~not ~rest ~datum +@racketgrammar*[#:literals (_ ~var ~literal ~or ~and ~not ~rest ~datum ~describe ~seq ~optional ~rep ~once ~between ~! ~bind ~fail ~parse ~peek ~peek-not ~do) [S-pattern @@ -100,7 +100,7 @@ means specifically @tech{@Spattern}. The following pattern keywords can be used in multiple pattern variants: -@defidform[~var]{ +@defidform[~var]{ One of @ref[~var s-], @ref[~var s+], or @ref[~var h]. } @@ -171,13 +171,13 @@ eh] pattern} A @deftech{@Spattern} (abbreviated @svar[S-pattern]) is a pattern that describes a single term. These are like the traditional patterns used -in @scheme[syntax-rules] and @scheme[syntax-case], but with additional +in @racket[syntax-rules] and @racket[syntax-case], but with additional variants that make them more expressive. ``Single-term'' does not mean ``atomic''; a @Spattern can have complex structure, and it can match terms that have many parts. For -example, @scheme[(17 ...)] is a @Spattern that matches any -term that is a proper list of repeated @schemeresult[17] numerals. +example, @racket[(17 ...)] is a @Spattern that matches any +term that is a proper list of repeated @racketresult[17] numerals. A @deftech{proper @Spattern} is one that is not an @tech{@Apattern}. @@ -194,9 +194,9 @@ An identifier can be either a @tech{pattern variable}, an @itemize[ -@item{If @scheme[id] is the ``pattern'' name of an entry in the +@item{If @racket[id] is the ``pattern'' name of an entry in the literals list, it is a @tech{literal} pattern that behaves - like @scheme[(~literal id)]. + like @racket[(~literal id)]. @myexamples[ (syntax-parse #'(define x 12) @@ -214,10 +214,10 @@ An identifier can be either a @tech{pattern variable}, an ] } -@item{If @scheme[id] is of the form @scheme[_pvar-id:syntax-class-id] +@item{If @racket[id] is of the form @racket[_pvar-id:syntax-class-id] (that is, two names joined by a colon character), it is an @tech{annotated pattern variable}, and the pattern is equivalent to - @scheme[(~var pvar-id syntax-class-id)]. + @racket[(~var pvar-id syntax-class-id)]. @myexamples[ (syntax-parse #'a @@ -236,21 +236,21 @@ An identifier can be either a @tech{pattern variable}, an ] } -@item{Otherwise, @scheme[id] is a @tech{pattern variable}, and the -pattern is equivalent to @scheme[(~var id)]. +@item{Otherwise, @racket[id] is a @tech{pattern variable}, and the +pattern is equivalent to @racket[(~var id)]. } ] } @specsubform[(@#,def[~var s-] pvar-id)]{ -A @deftech{pattern variable}. If @scheme[pvar-id] has no syntax class -(by @scheme[#:convention]), the pattern variable matches anything. The +A @deftech{pattern variable}. If @racket[pvar-id] has no syntax class +(by @racket[#:convention]), the pattern variable matches anything. The pattern variable is bound to the matched subterm, unless the pattern -variable is the wildcard (@scheme[_]), in which case no binding +variable is the wildcard (@racket[_]), in which case no binding occurs. -If @scheme[pvar-id] does have an associated syntax class, it behaves +If @racket[pvar-id] does have an associated syntax class, it behaves like an @tech{annotated pattern variable} with the implicit syntax class inserted. } @@ -261,7 +261,7 @@ class inserted. An @deftech{annotated pattern variable}. The pattern matches only terms accepted by @svar[syntax-class-id] (parameterized by the -@scheme[arg-expr]s, if present). +@racket[arg-expr]s, if present). In addition to binding @svar[pvar-id], an annotated pattern variable also binds @deftech{nested attributes} from the syntax @@ -269,7 +269,7 @@ class. The names of the nested attributes are formed by prefixing @svar[pvar-id.] (that is, @svar[pvar-id] followed by a ``dot'' character) to the name of the syntax class's attribute. -If @svar[pvar-id] is @scheme[_], no attributes are bound. +If @svar[pvar-id] is @racket[_], no attributes are bound. @myexamples[ (syntax-parse #'a @@ -292,7 +292,7 @@ If @svar[pvar-id] is @scheme[_], no attributes are bound. @specsubform[(@#,defhere[~literal] literal-id)]{ A @deftech{literal} identifier pattern. Matches any identifier -@scheme[free-identifier=?] to @scheme[literal-id]. +@racket[free-identifier=?] to @racket[literal-id]. @myexamples[ (syntax-parse #'(define x 12) @@ -318,8 +318,8 @@ literals. @specsubform[(@#,defhere[~datum] datum)]{ Matches syntax whose S-expression contents (obtained by -@scheme[syntax->datum]) is @scheme[equal?] to the given -@scheme[datum]. +@racket[syntax->datum]) is @racket[equal?] to the given +@racket[datum]. @myexamples[ (syntax-parse #'(a #:foo bar) @@ -328,8 +328,8 @@ Matches syntax whose S-expression contents (obtained by [(x (~datum #:foo) y) (syntax->datum #'y)]) ] -The @scheme[~datum] form is useful for recognizing identifiers -symbolically, in contrast to the @scheme[~literal] form, which +The @racket[~datum] form is useful for recognizing identifiers +symbolically, in contrast to the @racket[~literal] form, which recognizes them by binding. @myexamples[ @@ -345,7 +345,7 @@ recognizes them by binding. @specsubform[(H-pattern . S-pattern)]{ Matches any term that can be decomposed into a list prefix matching -@scheme[H-pattern] and a suffix matching @scheme[S-pattern]. +@racket[H-pattern] and a suffix matching @racket[S-pattern]. Note that the pattern may match terms that are not even improper lists; if the head pattern can match a zero-length head, then the @@ -360,12 +360,12 @@ See @tech{@Hpatterns} for more information. @specsubform[(A-pattern . S-pattern)]{ -Performs the actions specified by @scheme[A-pattern], then matches -any term that matches @scheme[S-pattern]. +Performs the actions specified by @racket[A-pattern], then matches +any term that matches @racket[S-pattern]. Pragmatically, one can throw an @tech{@Apattern} into any list -pattern. Thus, @scheme[(x y z)] is a pattern matching a list of three -terms, and @scheme[(x y ~! z)] is a pattern matching a list of three +pattern. Thus, @racket[(x y z)] is a pattern matching a list of three +terms, and @racket[(x y ~! z)] is a pattern matching a list of three terms, with a @tech{cut} performed after the second one. In other words, @Apatterns ``don't take up space.'' @@ -375,9 +375,9 @@ See @tech{@Apatterns} for more information. @specsubform[(EH-pattern #,ellipses . S-pattern)]{ Matches any term that can be decomposed into a list head matching some -number of repetitions of the @scheme[EH-pattern] alternatives (subject +number of repetitions of the @racket[EH-pattern] alternatives (subject to its repetition constraints) followed by a list tail matching -@scheme[S-pattern]. +@racket[S-pattern]. In other words, the whole pattern matches either the second pattern (which need not be a list) or a term whose head matches one of the @@ -394,8 +394,8 @@ of the head pattern to be present. That is, the following patterns are equivalent: @itemize[ -@item[@scheme[(H @#,dotsplus . S)]] -@item[@scheme[((~between H 1 +inf.0) ... . S)]] +@item[@racket[(H @#,dotsplus . S)]] +@item[@racket[((~between H 1 +inf.0) ... . S)]] ] @myexamples[ @@ -419,10 +419,10 @@ Attributes bound in subpatterns are available to subsequent subpatterns. The whole pattern binds all of the subpatterns' attributes. -One use for @scheme[~and]-patterns is preserving a whole +One use for @racket[~and]-patterns is preserving a whole term (including its lexical context, source location, etc) while also examining its structure. Syntax classes are useful for the same -purpose, but @scheme[~and] can be lighter weight. +purpose, but @racket[~and] can be lighter weight. @myexamples[ (define-syntax (import stx) @@ -449,7 +449,7 @@ alternatives are tried in order. The whole pattern binds @emph{all} of the subpatterns' attributes. An attribute that is not bound by the ``chosen'' subpattern has a value -of @scheme[#f]. The same attribute may be bound by multiple +of @racket[#f]. The same attribute may be bound by multiple subpatterns, and if it is bound by all of the subpatterns, it is sure to have a value if the whole pattern matches. @@ -467,7 +467,7 @@ to have a value if the whole pattern matches. Matches any term that does not match the subpattern. None of the subpattern's attributes are bound outside of the -@scheme[~not]-pattern. +@racket[~not]-pattern. @myexamples[ (syntax-parse #'(x y z => u v) @@ -481,7 +481,7 @@ subpattern's attributes are bound outside of the Matches a term that is a vector whose elements, when considered as a list, match the @tech{@Spattern} corresponding to -@scheme[(pattern-part ...)]. +@racket[(pattern-part ...)]. @myexamples[ (syntax-parse #'#(1 2 3) @@ -497,7 +497,7 @@ list, match the @tech{@Spattern} corresponding to Matches a term that is a prefab struct whose key is exactly the given key and whose sequence of fields, when considered as a list, match the -@tech{@Spattern} corresponding to @scheme[(pattern-part ...)]. +@tech{@Spattern} corresponding to @racket[(pattern-part ...)]. @myexamples[ (syntax-parse #'#s(point 1 2 3) @@ -522,7 +522,7 @@ Matches a term that is a box whose contents matches the inner @specsubform[(#, @defhere[~rest] S-pattern)]{ -Matches just like @scheme[S-pattern]. The @scheme[~rest] pattern form +Matches just like @racket[S-pattern]. The @racket[~rest] pattern form is useful in positions where improper (``dotted'') lists are not allowed by the reader, such as vector and structure patterns (see above). @@ -540,41 +540,41 @@ above). (code:line #:opaque)]) #:contracts ([expr (or/c string? #f)])]{ -The @scheme[~describe] pattern form annotates a pattern with a +The @racket[~describe] pattern form annotates a pattern with a description, a string expression that is evaluated in the scope of all prior attribute bindings. If parsing the inner pattern fails, then the description is used to synthesize the error message. -A @scheme[~describe] pattern has no effect on backtracking. +A @racket[~describe] pattern has no effect on backtracking. } @specsubform[(@#,def[~commit s] S-pattern)]{ -The @scheme[~commit] pattern form affects backtracking in two ways: +The @racket[~commit] pattern form affects backtracking in two ways: @itemize[ @item{If the pattern succeeds, then all choice points created within the subpattern are discarded, and a failure @emph{after} the -@scheme[~commit] pattern backtracks only to choice points -@emph{before} the @scheme[~commit] pattern, never one @emph{within} +@racket[~commit] pattern backtracks only to choice points +@emph{before} the @racket[~commit] pattern, never one @emph{within} it.} -@item{A cut (@scheme[~!]) within a @scheme[~commit] pattern only -eliminates choice-points created within the @scheme[~commit] -pattern. In this sense, it acts just like @scheme[~delimit-cut].} +@item{A cut (@racket[~!]) within a @racket[~commit] pattern only +eliminates choice-points created within the @racket[~commit] +pattern. In this sense, it acts just like @racket[~delimit-cut].} ] } @specsubform[(@#,def[~delimit-cut s] S-pattern)]{ -The @scheme[~delimit-cut] pattern form affects backtracking in the +The @racket[~delimit-cut] pattern form affects backtracking in the following way: @itemize[ -@item{A cut (@scheme[~!]) within a @scheme[~delimit-cut] pattern only -eliminates choice-points created within the @scheme[~delimit-cut] +@item{A cut (@racket[~!]) within a @racket[~delimit-cut] pattern only +eliminates choice-points created within the @racket[~delimit-cut] pattern.} ] @@ -601,7 +601,7 @@ Here are the variants of @elem{@Hpattern}: @specsubform[pvar-id:splicing-syntax-class-id]{ -Equivalent to @scheme[(~var pvar-id splicing-syntax-class-id)]. +Equivalent to @racket[(~var pvar-id splicing-syntax-class-id)]. } @@ -617,7 +617,7 @@ matches a head pattern. @specsubform[(@#,defhere[~seq] . L-pattern)]{ Matches a sequence of terms whose elements, if put in a list, would -match @scheme[L-pattern]. +match @racket[L-pattern]. @myexamples[ (syntax-parse #'(1 2 3 4) @@ -625,7 +625,7 @@ match @scheme[L-pattern]. ] See also the section on @tech{@EHpatterns} for more interesting -examples of @scheme[~seq]. +examples of @racket[~seq]. } @specsubform[(@#,def[~and h] H-pattern ...)]{ @@ -641,10 +641,10 @@ terms instead. (syntax->datum #'((k ...) (e ...) (keyword-stuff ...)))]) ] -The @Hpattern variant of @scheme[~and] requires that all of the +The @Hpattern variant of @racket[~and] requires that all of the subpatterns be @tech{proper @Hpatterns} (not @tech{@Spatterns}). This is to prevent typos like the following, a variant of the previous -example with the second @scheme[~seq] omitted: +example with the second @racket[~seq] omitted: @myexamples[ (syntax-parse #'(#:a 1 #:b 2 3 4 5) @@ -685,7 +685,7 @@ terms instead. (attr-id depth)])]{ Matches either the given head subpattern or an empty sequence of -terms. If the @scheme[#:defaults] option is given, the subsequent +terms. If the @racket[#:defaults] option is given, the subsequent attribute bindings are used if the subpattern does not match. The default attributes must be a subset of the subpattern's attributes. @@ -747,7 +747,7 @@ Like @racket[~peek], but succeeds if the subpattern fails and fails if the subpattern succeeds. On success, the @racket[~peek-not] resets the matching position, so the pattern consumes no input. Used to look ahead in a sequence. None of the subpattern's attributes are bound -outside of the @scheme[~peek-not]-pattern. +outside of the @racket[~peek-not]-pattern. @myexamples[ (define-splicing-syntax-class final (code:comment "final term") @@ -763,7 +763,7 @@ outside of the @scheme[~peek-not]-pattern. @specsubform[S-pattern]{ Matches a sequence of one element, which must be a term matching -@scheme[S-pattern]. +@racket[S-pattern]. } @@ -790,16 +790,16 @@ alternatives are grouped together via @ref[~or eh]. (parser1 #'(#:a 1 #:a 2)) ] -The pattern requires exactly one occurrence of the @scheme[#:a] -keyword and argument, at most one occurrence of the @scheme[#:b] -keyword and argument, and any number of @scheme[#:c] keywords and +The pattern requires exactly one occurrence of the @racket[#:a] +keyword and argument, at most one occurrence of the @racket[#:b] +keyword and argument, and any number of @racket[#:c] keywords and arguments. The ``pieces'' can occur in any order. Here are the variants of @elem{@EHpattern}: @specsubform[(@#,def[~or eh] EH-pattern ...)]{ -Matches if any of the inner @scheme[EH-pattern] alternatives match. +Matches if any of the inner @racket[EH-pattern] alternatives match. } @specsubform/subs[(@#,defhere[~once] H-pattern once-option ...) @@ -810,18 +810,18 @@ Matches if any of the inner @scheme[EH-pattern] alternatives match. [too-few-message-expr (or/c string? #f)] [too-many-message-expr (or/c string? #f)])]{ -Matches if the inner @scheme[H-pattern] matches. This pattern must be +Matches if the inner @racket[H-pattern] matches. This pattern must be matched exactly once in the match of the entire repetition sequence. If the pattern is not matched in the repetition sequence, then the ellipsis pattern fails with the message either -@scheme[too-few-message-expr] or @schemevalfont{"missing required -occurrence of @scheme[name-expr]"}. +@racket[too-few-message-expr] or @racketvalfont{"missing required +occurrence of @racket[name-expr]"}. If the pattern is chosen more than once in the repetition sequence, then the ellipsis pattern fails with the message either -@scheme[too-many-message-expr] or @schemevalfont{"too many occurrences -of @scheme[name-expr]"}. +@racket[too-many-message-expr] or @racketvalfont{"too many occurrences +of @racket[name-expr]"}. } @specsubform/subs[(@#,def[~optional eh] H-pattern optional-option ...) @@ -831,15 +831,15 @@ of @scheme[name-expr]"}. #:contracts ([name-expr (or/c string? #f)] [too-many-message-expr (or/c string? #f)])]{ -Matches if the inner @scheme[H-pattern] matches. This pattern may be used at +Matches if the inner @racket[H-pattern] matches. This pattern may be used at most once in the match of the entire repetition. If the pattern is matched more than once in the repetition sequence, then the ellipsis pattern fails with the message either -@scheme[too-many-message-expr] or @schemevalfont{"too many occurrences -of @scheme[name-expr]"}. +@racket[too-many-message-expr] or @racketvalfont{"too many occurrences +of @racket[name-expr]"}. -If the @scheme[#:defaults] option is given, the following attribute +If the @racket[#:defaults] option is given, the following attribute bindings are used if the subpattern does not match at all in the sequence. The default attributes must be a subset of the subpattern's attributes. @@ -852,17 +852,17 @@ attributes. #:contracts ([name-expr (or/c syntax? #f)] [too-few-message-expr (or/c syntax? #f)])]{ -Matches if the inner @scheme[H-pattern] matches. This pattern must be -matched at least @scheme[min-number] and at most @scheme[max-number] +Matches if the inner @racket[H-pattern] matches. This pattern must be +matched at least @racket[min-number] and at most @racket[max-number] times in the entire repetition. If the pattern is matched too few times, then the ellipsis pattern -fails with the message either @scheme[too-few-message-expr] or -@schemevalfont{"too few occurrences of @scheme[name-expr]"}. +fails with the message either @racket[too-few-message-expr] or +@racketvalfont{"too few occurrences of @racket[name-expr]"}. If the pattern is chosen too many times, then the ellipsis pattern -fails with the message either @scheme[too-many-message-expr] or -@schemevalfont{"too few occurrences of @scheme[name-expr]"}. +fails with the message either @racket[too-many-message-expr] or +@racketvalfont{"too few occurrences of @racket[name-expr]"}. } @@ -877,7 +877,7 @@ attributes or the modification of the matching process. @specsubform[@#,defhere[~!]]{ -The @deftech{cut} operator, written @scheme[~!], eliminates +The @deftech{cut} operator, written @racket[~!], eliminates backtracking choice points and commits parsing to the current branch of the pattern it is exploring. @@ -891,13 +891,13 @@ forms based on keywords. Consider the following expression: [(define-syntaxes (x:id ...) e) 'define-syntaxes] [e 'expression])] -Given the ill-formed term @scheme[(define-values a 123)], the -expression tries the first clause, fails to match @scheme[a] against -the pattern @scheme[(x:id ...)], and then backtracks to the second +Given the ill-formed term @racket[(define-values a 123)], the +expression tries the first clause, fails to match @racket[a] against +the pattern @racket[(x:id ...)], and then backtracks to the second clause and ultimately the third clause, producing the value -@scheme['expression]. But the term is not an expression; it is an -ill-formed use of @scheme[define-values]. The proper way to write the -@scheme[syntax-parse] expression follows: +@racket['expression]. But the term is not an expression; it is an +ill-formed use of @racket[define-values]. The proper way to write the +@racket[syntax-parse] expression follows: @interaction[#:eval the-eval (syntax-parse #'(define-values a 123) @@ -906,19 +906,19 @@ ill-formed use of @scheme[define-values]. The proper way to write the [(define-syntaxes ~! (x:id ...) e) 'define-syntaxes] [e 'expression])] -Now, given the same term, @scheme[syntax-parse] tries the first -clause, and since the keyword @scheme[define-values] matches, the +Now, given the same term, @racket[syntax-parse] tries the first +clause, and since the keyword @racket[define-values] matches, the cut-pattern commits to the current pattern, eliminating the choice points for the second and third clauses. So when the clause fails to -match, the @scheme[syntax-parse] expression raises an error. +match, the @racket[syntax-parse] expression raises an error. -The effect of a @scheme[~!] pattern is delimited by the nearest -enclosing @scheme[~delimit-cut] or @scheme[~commit] pattern. If there -is no enclosing @scheme[~describe] pattern but the cut occurs within a +The effect of a @racket[~!] pattern is delimited by the nearest +enclosing @racket[~delimit-cut] or @racket[~commit] pattern. If there +is no enclosing @racket[~describe] pattern but the cut occurs within a syntax class definition, then only choice points within the syntax -class definition are discarded. A @scheme[~!] pattern is not allowed -within a @scheme[~not] pattern unless there is an intervening -@scheme[~delimit-cut] or @scheme[~commit] pattern. +class definition are discarded. A @racket[~!] pattern is not allowed +within a @racket[~not] pattern unless there is an intervening +@racket[~delimit-cut] or @racket[~commit] pattern. } @specsubform/subs[(@#,defhere[~bind] [attr-arity-decl expr] ...) @@ -926,8 +926,8 @@ within a @scheme[~not] pattern unless there is an intervening attr-name-id (attr-name-id depth)])]{ -Evaluates the @scheme[expr]s and binds them to the given -@scheme[attr-id]s as attributes. +Evaluates the @racket[expr]s and binds them to the given +@racket[attr-id]s as attributes. } @specsubform/subs[(@#,defhere[~fail] maybe-fail-condition maybe-message-expr) @@ -938,10 +938,10 @@ Evaluates the @scheme[expr]s and binds them to the given (code:line message-expr)]) #:contracts ([message-expr (or/c string? #f)])]{ -If the condition is absent, or if the @scheme[#:when] condition -evaluates to a true value, or if the @scheme[#:unless] condition -evaluates to @scheme[#f], then the pattern fails with the given -message. If the message is omitted, the default value @scheme[#f] is +If the condition is absent, or if the @racket[#:when] condition +evaluates to a true value, or if the @racket[#:unless] condition +evaluates to @racket[#f], then the pattern fails with the given +message. If the message is omitted, the default value @racket[#f] is used, representing ``no message.'' Fail patterns can be used together with cut patterns to recognize @@ -952,13 +952,13 @@ messages. @specsubform[(@#,defhere[~parse] S-pattern stx-expr) #:contracts ([stx-expr syntax?])]{ -Evaluates @scheme[stx-expr] to a syntax object and matches it against -@scheme[S-pattern]. +Evaluates @racket[stx-expr] to a syntax object and matches it against +@racket[S-pattern]. } @specsubform[(@#,def[~and a] A-pattern ...+)]{ -Performs the actions of each @scheme[A-pattern]. +Performs the actions of each @racket[A-pattern]. } @specsubform[(@#,defhere[~do] defn-or-expr ...)]{ @@ -968,9 +968,9 @@ intermixed, and evaluates them in the scope of all previous attribute bindings. The names bound by the definitions are in scope in the expressions of subsequent patterns and clauses. -There is currently no way to bind attributes using a @scheme[~do] +There is currently no way to bind attributes using a @racket[~do] pattern. It is an error to shadow an attribute binding with a -definition in a @scheme[~do] block. +definition in a @racket[~do] block. @myexamples[ (syntax-parse #'(1 2 3) diff --git a/collects/syntax/scribblings/parse/stxclasses.scrbl b/collects/syntax/scribblings/parse/stxclasses.scrbl index 15915928ec..9f2eb7a2e4 100644 --- a/collects/syntax/scribblings/parse/stxclasses.scrbl +++ b/collects/syntax/scribblings/parse/stxclasses.scrbl @@ -11,7 +11,7 @@ Syntax classes provide an abstraction mechanism for @tech{syntax patterns}. Built-in syntax classes are supplied that recognize basic -classes such as @scheme[identifier] and @scheme[keyword]. Programmers +classes such as @racket[identifier] and @racket[keyword]. Programmers can compose basic syntax classes to build specifications of more complex syntax, such as lists of distinct identifiers and formal arguments with keywords. Macros that manipulate the same syntactic @@ -40,14 +40,14 @@ structures can share syntax class definitions. (pattern syntax-pattern pattern-directive ...)]) #:contracts ([description-expr (or/c string? #f)])]{ -Defines @scheme[name-id] as a @deftech{syntax class}, which +Defines @racket[name-id] as a @deftech{syntax class}, which encapsulates one or more @tech{single-term patterns}. A syntax class may have formal parameters, in which case they are bound as variables in the body. Syntax classes support optional arguments and keyword arguments using the same syntax as -@scheme[lambda]. The body of the syntax-class definition contains a -non-empty sequence of @scheme[pattern] variants. +@racket[lambda]. The body of the syntax-class definition contains a +non-empty sequence of @racket[pattern] variants. The following options are supported: @@ -69,12 +69,12 @@ depths are not included, nor are nested attributes from @specsubform[(code:line #:description description-expr) #:contracts ([description-expr (or/c string? #f)])]{ -The @scheme[description] argument is evaluated in a scope containing +The @racket[description] argument is evaluated in a scope containing the syntax class's parameters. If the result is a string, it is used in error messages involving the syntax class. For example, if a term is rejected by the syntax class, an error of the form -@schemevalfont{"expected @scheme[description]"} may be synthesized. If -the result is @scheme[#f], the syntax class is skipped in the search +@racketvalfont{"expected @racket[description]"} may be synthesized. If +the result is @racket[#f], the syntax class is skipped in the search for a description to report. If the option is not given absent, the name of the syntax class is @@ -91,20 +91,20 @@ internal structure of the syntax class. Directs the syntax class to ``commit'' to the first successful match. When a variant succeeds, all choice points within the syntax -class are discarded. See also @scheme[~commit]. +class are discarded. See also @racket[~commit]. } @specsubform[#:no-delimit-cut]{ -By default, a cut (@scheme[~!]) within a syntax class only discards +By default, a cut (@racket[~!]) within a syntax class only discards choice points within the syntax class. That is, the body of the syntax -class acts as though it is wrapped in a @scheme[~delimit-cut] form. If -@scheme[#:no-delimit-cut] is specified, a cut may affect choice points +class acts as though it is wrapped in a @racket[~delimit-cut] form. If +@racket[#:no-delimit-cut] is specified, a cut may affect choice points of the syntax class's calling context (another syntax class's patterns -or a @scheme[syntax-parse] form). +or a @racket[syntax-parse] form). -It is an error to use both @scheme[#:commit] and -@scheme[#:no-delimit-cut]. +It is an error to use both @racket[#:commit] and +@racket[#:no-delimit-cut]. } @specsubform[(code:line #:literals (literal-entry))] @@ -112,16 +112,16 @@ It is an error to use both @scheme[#:commit] and @specsubform[(code:line #:conventions (convention-id ...))]{ Declares the literals and conventions that apply to the syntax class's -variant patterns and their immediate @scheme[#:with] clauses. Patterns +variant patterns and their immediate @racket[#:with] clauses. Patterns occuring within subexpressions of the syntax class (for example, on -the right-hand side of a @scheme[#:fail-when] clause) are not +the right-hand side of a @racket[#:fail-when] clause) are not affected. -These options have the same meaning as in @scheme[syntax-parse]. +These options have the same meaning as in @racket[syntax-parse]. } Each variant of a syntax class is specified as a separate -@scheme[pattern]-form whose syntax pattern is a @tech{single-term +@racket[pattern]-form whose syntax pattern is a @tech{single-term pattern}. } @@ -131,14 +131,14 @@ pattern}. (define-splicing-syntax-class (name-id kw-formals) stxclass-option ... stxclass-variant ...+)]]{ -Defines @scheme[name-id] as a @deftech{splicing syntax class}, +Defines @racket[name-id] as a @deftech{splicing syntax class}, analogous to a @tech{syntax class} but encapsulating @tech{head patterns} rather than @tech{single-term patterns}. -The options are the same as for @scheme[define-syntax-class]. +The options are the same as for @racket[define-syntax-class]. Each variant of a splicing syntax class is specified as a separate -@scheme[pattern]-form whose syntax pattern is a @tech{head pattern}. +@racket[pattern]-form whose syntax pattern is a @tech{head pattern}. } @defform[#:literals (pattern) @@ -148,13 +148,13 @@ Used to indicate a variant of a syntax class or splicing syntax class. The variant accepts syntax matching the given syntax pattern with the accompanying @tech{pattern directives}. -When used within @scheme[define-syntax-class], @scheme[syntax-pattern] +When used within @racket[define-syntax-class], @racket[syntax-pattern] should be a @tech{single-term pattern}; within -@scheme[define-splicing-syntax-class], it should be a @tech{head +@racket[define-splicing-syntax-class], it should be a @tech{head pattern}. The attributes of the variant are the attributes of the pattern -together with all attributes bound by @scheme[#:with] clauses, +together with all attributes bound by @racket[#:with] clauses, including nested attributes produced by syntax classes associated with the pattern variables. } @@ -170,7 +170,7 @@ Both the parsing forms and syntax class definition forms support specifying side conditions. The grammar for pattern directives follows: -@schemegrammar[pattern-directive +@racketgrammar[pattern-directive (code:line #:declare pattern-id syntax-class-id) (code:line #:declare pattern-id (syntax-class-id arg ...)) (code:line #:with syntax-pattern expr) @@ -188,18 +188,18 @@ The first form is equivalent to using the to use both for the same pattern variable). The second form allows the use of parameterized syntax classes, which -cannot be expressed using the ``colon'' notation. The @scheme[arg]s +cannot be expressed using the ``colon'' notation. The @racket[arg]s are evaluated outside the scope of any of the attribute bindings from -pattern that the @scheme[#:declare] directive applies to. Keyword -arguments are supported, using the same syntax as in @scheme[#%app]. +pattern that the @racket[#:declare] directive applies to. Keyword +arguments are supported, using the same syntax as in @racket[#%app]. } @specsubform[(code:line #:with syntax-pattern stx-expr)]{ -Evaluates the @scheme[stx-expr] in the context of all previous +Evaluates the @racket[stx-expr] in the context of all previous attribute bindings and matches it against the pattern. If the match succeeds, the pattern's attributes are added to environment for the -evaluation of subsequent side conditions. If the @scheme[#:with] match +evaluation of subsequent side conditions. If the @racket[#:with] match fails, the matching process backtracks. Since a syntax object may match a pattern in several ways, backtracking may cause the same clause to be tried multiple times before the next clause is reached. @@ -207,21 +207,21 @@ clause to be tried multiple times before the next clause is reached. @specsubform[(code:line #:attr attr-arity-decl expr)]{ -Evaluates the @scheme[expr] in the context of all previous attribute +Evaluates the @racket[expr] in the context of all previous attribute bindings and binds it to the given attribute. The value of -@scheme[expr] need not be syntax. +@racket[expr] need not be syntax. } @specsubform[(code:line #:fail-when condition-expr message-expr) #:contracts ([message-expr (or/c string? #f)])]{ -Evaluates the @scheme[condition-expr] in the context of all previous -attribute bindings. If the value is any true value (not @scheme[#f]), +Evaluates the @racket[condition-expr] in the context of all previous +attribute bindings. If the value is any true value (not @racket[#f]), the matching process backtracks (with the given message); otherwise, it continues. If the value of the condition expression is a syntax object, it is indicated as the cause of the error. -If the @scheme[message-expr] produces a string it is used as the +If the @racket[message-expr] produces a string it is used as the failure message; otherwise the failure is reported in terms of the enclosing descriptions. } @@ -229,15 +229,15 @@ enclosing descriptions. @specsubform[(code:line #:fail-unless condition-expr message-expr) #:contracts ([message-expr (or/c string? #f)])]{ -Like @scheme[#:fail-when] with the condition negated. +Like @racket[#:fail-when] with the condition negated. } @specsubform[(code:line #:when condition-expr)]{ -Evaluates the @scheme[condition-expr] in the context of all previous -attribute bindings. If the value is @scheme[#f], the matching process -backtracks. In other words, @scheme[#:when] is like -@scheme[#:fail-unless] without the message argument. +Evaluates the @racket[condition-expr] in the context of all previous +attribute bindings. If the value is @racket[#f], the matching process +backtracks. In other words, @racket[#:when] is like +@racket[#:fail-unless] without the message argument. } @specsubform[(code:line #:do [def-or-expr ...])]{ @@ -247,9 +247,9 @@ intermixed, and evaluates them in the scope of all previous attribute bindings. The names bound by the definitions are in scope in the expressions of subsequent patterns and clauses. -There is currently no way to bind attributes using a @scheme[#:do] +There is currently no way to bind attributes using a @racket[#:do] block. It is an error to shadow an attribute binding with a definition -in a @scheme[#:do] block. +in a @racket[#:do] block. } @@ -266,20 +266,20 @@ name, separated by a dot (see the example below). Attribute names cannot be used directly as expressions; that is, attributes are not variables. Instead, an attribute's value can be -gotten using the @scheme[attribute] special form. +gotten using the @racket[attribute] special form. @defform[(attribute attr-id)]{ Returns the value associated with the attribute named -@scheme[attr-id]. If @scheme[attr-id] is not bound as an attribute, an +@racket[attr-id]. If @racket[attr-id] is not bound as an attribute, an error is raised. } The value of an attribute need not be syntax. Non-syntax-valued attributes can be used to return a parsed representation of a subterm or the results of an analysis on the subterm. A non-syntax-valued -attribute should be bound using the @scheme[#:attr] directive or a -@scheme[~bind] pattern. +attribute should be bound using the @racket[#:attr] directive or a +@racket[~bind] pattern. @myexamples[ (define-syntax-class table @@ -295,8 +295,8 @@ attribute should be bound using the @scheme[#:attr] directive or a A syntax-valued attribute is an attribute whose value is a syntax object or a syntax list of the appropriate @tech{ellipsis -depth}. Syntax-valued attributes can be used within @scheme[syntax], -@scheme[quasisyntax], etc as part of a syntax template. If a +depth}. Syntax-valued attributes can be used within @racket[syntax], +@racket[quasisyntax], etc as part of a syntax template. If a non-syntax-valued attribute is used in a syntax template, a runtime error is signalled. @@ -311,13 +311,13 @@ error is signalled. Every attribute has an associated @deftech{ellipsis depth} that determines how it can be used in a syntax template (see the discussion -of ellipses in @scheme[syntax]). For a pattern variable, the ellipsis +of ellipses in @racket[syntax]). For a pattern variable, the ellipsis depth is the number of ellipses the pattern variable ``occurs under'' in the pattern. For a nested attribute the depth is the sum of the pattern variable's depth and the depth of the attribute in the syntax class. Consider the following code: -@schemeblock[ +@racketblock[ (define-syntax-class quark (pattern (a b ...))) (syntax-parse some-term @@ -325,18 +325,18 @@ class. Consider the following code: some-code]) ] -The syntax class @scheme[quark] exports two attributes: @scheme[a] at -depth 0 and @scheme[b] at depth 1. The @scheme[syntax-parse] pattern -has three pattern variables: @scheme[x] at depth 0, @scheme[y] at -depth 2, and @scheme[z] at depth 0. Since @scheme[x] and @scheme[y] -are annotated with the @scheme[quark] syntax class, the pattern also -binds the following nested attributes: @scheme[y.a] at depth 2, -@scheme[y.b] at depth 3, @scheme[z.a] at depth 0, and @scheme[z.b] at +The syntax class @racket[quark] exports two attributes: @racket[a] at +depth 0 and @racket[b] at depth 1. The @racket[syntax-parse] pattern +has three pattern variables: @racket[x] at depth 0, @racket[y] at +depth 2, and @racket[z] at depth 0. Since @racket[x] and @racket[y] +are annotated with the @racket[quark] syntax class, the pattern also +binds the following nested attributes: @racket[y.a] at depth 2, +@racket[y.b] at depth 3, @racket[z.a] at depth 0, and @racket[z.b] at depth 1. An attribute's ellipsis nesting depth is @emph{not} a guarantee that -its value has that level of list nesting. In particular, @scheme[~or] -and @scheme[~optional] patterns may result in attributes with fewer +its value has that level of list nesting. In particular, @racket[~or] +and @racket[~optional] patterns may result in attributes with fewer than expected levels of list nesting. @(myexamples diff --git a/collects/syntax/scribblings/path-spec.scrbl b/collects/syntax/scribblings/path-spec.scrbl index dfc896388e..5829e9177f 100644 --- a/collects/syntax/scribblings/path-spec.scrbl +++ b/collects/syntax/scribblings/path-spec.scrbl @@ -1,7 +1,7 @@ #lang scribble/doc @(require "common.rkt" (for-label syntax/path-spec)) -@title[#:tag "path-spec"]{Resolving @scheme[include]-like Paths} +@title[#:tag "path-spec"]{Resolving @racket[include]-like Paths} @defmodule[syntax/path-spec] @@ -11,12 +11,12 @@ [build-path-stx syntax?]) complete-path?]{ -Resolves the syntactic path specification @scheme[path-spec-stx] as -for @scheme[include]. +Resolves the syntactic path specification @racket[path-spec-stx] as +for @racket[include]. -The @scheme[source-stx] specifies a syntax object whose +The @racket[source-stx] specifies a syntax object whose source-location information determines relative-path resolution. The -@scheme[expr-stx] is used for reporting syntax errors. The -@scheme[build-path-stx] is usually @scheme[#'build-path]; it provides -an identifier to compare to parts of @scheme[path-spec-stx] to -recognize the @scheme[build-path] keyword.} +@racket[expr-stx] is used for reporting syntax errors. The +@racket[build-path-stx] is usually @racket[#'build-path]; it provides +an identifier to compare to parts of @racket[path-spec-stx] to +recognize the @racket[build-path] keyword.} diff --git a/collects/syntax/scribblings/readerr.scrbl b/collects/syntax/scribblings/readerr.scrbl index 02d333cb38..f50523006c 100644 --- a/collects/syntax/scribblings/readerr.scrbl +++ b/collects/syntax/scribblings/readerr.scrbl @@ -1,7 +1,7 @@ #lang scribble/doc @(require "common.rkt" (for-label syntax/readerr)) -@title[#:tag "readerr"]{Raising @scheme[exn:fail:read]} +@title[#:tag "readerr"]{Raising @racket[exn:fail:read]} @defmodule[syntax/readerr] @@ -13,18 +13,18 @@ [span (or/c number? false/c)]) any]{ -Creates and raises an @scheme[exn:fail:read] exception, using -@scheme[msg-string] as the base error message. +Creates and raises an @racket[exn:fail:read] exception, using +@racket[msg-string] as the base error message. Source-location information is added to the error message using the -last five arguments (if the @scheme[error-print-source-location] -parameter is set to @scheme[#t]). The @scheme[source] argument is an +last five arguments (if the @racket[error-print-source-location] +parameter is set to @racket[#t]). The @racket[source] argument is an arbitrary value naming the source location---usually a file path -string. Each of the @scheme[line], @scheme[pos] arguments is -@scheme[#f] or a positive exact integer representing the location -within @scheme[source-name] (as much as known), @scheme[col] is a +string. Each of the @racket[line], @racket[pos] arguments is +@racket[#f] or a positive exact integer representing the location +within @racket[source-name] (as much as known), @racket[col] is a non-negative exact integer for the source column (if known), and -@scheme[span] is @scheme[#f] or a non-negative exact integer for an +@racket[span] is @racket[#f] or a non-negative exact integer for an item range starting from the indicated position. The usual location values should point at the beginning of whatever it @@ -39,5 +39,5 @@ was discovered.} [span (or/c number? false/c)]) any]{ -Like @scheme[raise-read-error], but raises @scheme[exn:fail:read:eof] -instead of @scheme[exn:fail:read].} +Like @racket[raise-read-error], but raises @racket[exn:fail:read:eof] +instead of @racket[exn:fail:read].} diff --git a/collects/syntax/scribblings/strip-context.scrbl b/collects/syntax/scribblings/strip-context.scrbl index 933252b57d..52db3dd716 100644 --- a/collects/syntax/scribblings/strip-context.scrbl +++ b/collects/syntax/scribblings/strip-context.scrbl @@ -7,11 +7,11 @@ @defproc[(strip-context [stx syntax?]) syntax?]{ -Removes all lexical context from @scheme[stx], preserving +Removes all lexical context from @racket[stx], preserving source-location information and properties.} @defproc[(replace-context [ctx-stx (or/c syntax? #f)] [stx syntax?]) syntax?]{ -Uses the lexical context of @scheme[ctx-stx] to replace the lexical -context of all parts of @scheme[stx], preserving source-location -information and properties of @scheme[stx].} +Uses the lexical context of @racket[ctx-stx] to replace the lexical +context of all parts of @racket[stx], preserving source-location +information and properties of @racket[stx].} diff --git a/collects/syntax/scribblings/struct.scrbl b/collects/syntax/scribblings/struct.scrbl index 48b604de0f..c31ccd9ebc 100644 --- a/collects/syntax/scribblings/struct.scrbl +++ b/collects/syntax/scribblings/struct.scrbl @@ -1,7 +1,7 @@ #lang scribble/doc @(require "common.rkt" (for-label syntax/struct)) -@title[#:tag "struct"]{Expanding @scheme[define-struct]-like Forms} +@title[#:tag "struct"]{Expanding @racket[define-struct]-like Forms} @defmodule[syntax/struct] @@ -11,9 +11,9 @@ (listof identifier?) syntax?)]{ -Parses @scheme[stx] as a @scheme[define-struct] form, but uses -@scheme[orig-stx] to report syntax errors (under the assumption that -@scheme[orig-stx] is the same as @scheme[stx], or that they at least share +Parses @racket[stx] as a @racket[define-struct] form, but uses +@racket[orig-stx] to report syntax errors (under the assumption that +@racket[orig-stx] is the same as @racket[stx], or that they at least share sub-forms). The result is four values: an identifier for the struct type name, a identifier or #f for the super-name, a list of identifiers for fields, and a syntax object for the inspector @@ -27,25 +27,25 @@ expression.} [src-stx (or/c syntax? false/c) #f]) (listof identifier?)]{ -Generates the names bound by @scheme[define-struct] given an +Generates the names bound by @racket[define-struct] given an identifier for the struct type name and a list of identifiers for the field names. The result is a list of identifiers: @itemize[ - @item{@schemeidfont{struct:}@scheme[name-id]} - @item{@scheme[ctr-name], or @schemeidfont{make-}@scheme[name-id] if @racket[ctr-name] is @racket[#f]} - @item{@scheme[name-id]@schemeidfont{?}} - @item{@scheme[name-id]@schemeidfont{-}@scheme[_field], for each - @scheme[_field] in @scheme[field-ids].} - @item{@schemeidfont{set-}@scheme[name-id]@schemeidfont{-}@scheme[_field]@schemeidfont{!} + @item{@racketidfont{struct:}@racket[name-id]} + @item{@racket[ctr-name], or @racketidfont{make-}@racket[name-id] if @racket[ctr-name] is @racket[#f]} + @item{@racket[name-id]@racketidfont{?}} + @item{@racket[name-id]@racketidfont{-}@racket[_field], for each + @racket[_field] in @racket[field-ids].} + @item{@racketidfont{set-}@racket[name-id]@racketidfont{-}@racket[_field]@racketidfont{!} (getter and setter names alternate).} @item{....}] -If @scheme[omit-sel?] is true, then the selector names are omitted from the -result list. If @scheme[omit-set?] is true, then the setter names are omitted +If @racket[omit-sel?] is true, then the selector names are omitted from the +result list. If @racket[omit-set?] is true, then the setter names are omitted from the result list. -The default @scheme[src-stx] is @scheme[#f]; it is used to provide a +The default @racket[src-stx] is @racket[#f]; it is used to provide a source location to the generated identifiers.} @defproc[(build-struct-generation [name-id identifier?] @@ -60,13 +60,13 @@ source location to the generated identifiers.} [immutable-k-list list? empty]) (listof identifier?)]{ -Takes the same arguments as @scheme[build-struct-names] and generates -an S-expression for code using @scheme[make-struct-type] to generate +Takes the same arguments as @racket[build-struct-names] and generates +an S-expression for code using @racket[make-struct-type] to generate the structure type and return values for the identifiers created by -@scheme[build-struct-names]. The optional @scheme[super-type], -@scheme[prop-value-list], and @scheme[immutable-k-list] parameters take +@racket[build-struct-names]. The optional @racket[super-type], +@racket[prop-value-list], and @racket[immutable-k-list] parameters take S-expression values that are used as the corresponding arguments to -@scheme[make-struct-type].} +@racket[make-struct-type].} @defproc[(build-struct-generation* [all-name-ids (listof identifier?)] @@ -80,8 +80,8 @@ S-expression values that are used as the corresponding arguments to [immutable-k-list list? empty]) (listof identifier?)]{ -Like @scheme[build-struct-generation], but given the names produced by -@scheme[build-struct-names], instead of re-generating them.} +Like @racket[build-struct-generation], but given the names produced by +@racket[build-struct-names], instead of re-generating them.} @defproc[(build-struct-expand-info [name-id identifier?] [field-ids (listof identifier?)] @@ -95,9 +95,9 @@ Like @scheme[build-struct-generation], but given the names produced by [base-setters (listof (or/c identifier? false/c))]) any]{ -Takes mostly the same arguments as @scheme[build-struct-names], plus a parent -identifier/@scheme[#t]/@scheme[#f] and a list of accessor and mutator -identifiers (possibly ending in @scheme[#f]) for a parent type, and +Takes mostly the same arguments as @racket[build-struct-names], plus a parent +identifier/@racket[#t]/@racket[#f] and a list of accessor and mutator +identifiers (possibly ending in @racket[#f]) for a parent type, and generates an S-expression for expansion-time code to be used in the binding for the structure name. @@ -105,15 +105,15 @@ If @racket[no-ctr?] is true, then the constructor name is omitted from the expansion-time information. Similarly, if @racket[no-type?] is true, then the structure-type name is omitted. -A @scheme[#t] for the @scheme[base-name] means no super-type, -@scheme[#f] means that the super-type (if any) is unknown, and an +A @racket[#t] for the @racket[base-name] means no super-type, +@racket[#f] means that the super-type (if any) is unknown, and an identifier indicates the super-type identifier.} @defproc[(struct-declaration-info? [v any/c]) boolean?]{ -Returns @scheme[#t] if @scheme[x] has the shape of expansion-time -information for structure type declarations, @scheme[#f] otherwise. +Returns @racket[#t] if @racket[x] has the shape of expansion-time +information for structure type declarations, @racket[#f] otherwise. See @secref[#:doc refman]{structinfo}.} @@ -127,37 +127,37 @@ See @secref[#:doc refman]{structinfo}.} [omit-set? boolean? #f]) syntax?]{ -This procedure implements the core of a @scheme[define-struct] +This procedure implements the core of a @racket[define-struct] expansion. -The @scheme[generate-struct-declaration] procedure is called by a -macro expander to generate the expansion, where the @scheme[name-id], -@scheme[super-id-or-false], and @scheme[field-id-list] arguments -provide the main parameters. The @scheme[current-context] argument is -normally the result of @scheme[syntax-local-context]. The -@scheme[orig-stx] argument is used for syntax errors. The optional -@scheme[omit-sel?] and @scheme[omit-set?] arguments default to -@scheme[#f]; a @scheme[#t] value suppresses definitions of field +The @racket[generate-struct-declaration] procedure is called by a +macro expander to generate the expansion, where the @racket[name-id], +@racket[super-id-or-false], and @racket[field-id-list] arguments +provide the main parameters. The @racket[current-context] argument is +normally the result of @racket[syntax-local-context]. The +@racket[orig-stx] argument is used for syntax errors. The optional +@racket[omit-sel?] and @racket[omit-set?] arguments default to +@racket[#f]; a @racket[#t] value suppresses definitions of field selectors or mutators, respectively. -The @scheme[make-struct-type] procedure is called to generate the +The @racket[make-struct-type] procedure is called to generate the expression to actually create the struct type. Its arguments are -@scheme[orig-stx], @scheme[name-id-stx], @scheme[defined-name-stxes], -and @scheme[super-info]. The first two are as provided originally to -@scheme[generate-struct-declaration], the third is the set of names -generated by @scheme[build-struct-names], and the last is super-struct -info obtained by resolving @scheme[super-id-or-false] when it is not -@scheme[#f], @scheme[#f] otherwise. +@racket[orig-stx], @racket[name-id-stx], @racket[defined-name-stxes], +and @racket[super-info]. The first two are as provided originally to +@racket[generate-struct-declaration], the third is the set of names +generated by @racket[build-struct-names], and the last is super-struct +info obtained by resolving @racket[super-id-or-false] when it is not +@racket[#f], @racket[#f] otherwise. The result should be an expression whose values are the same as the -result of @scheme[make-struct-type]. Thus, the following is a basic -@scheme[make-make-struct-type]: +result of @racket[make-struct-type]. Thus, the following is a basic +@racket[make-make-struct-type]: -@SCHEMEBLOCK[ +@RACKETBLOCK[ (lambda (orig-stx name-stx defined-name-stxes super-info) - #`(make-struct-type '#,name-stx - #,(and super-info (list-ref super-info 0)) - #,(/ (- (length defined-name-stxes) 3) 2) - 0 #f))] + #`(make-struct-type '#,name-stx + #,(and super-info (list-ref super-info 0)) + #,(/ (- (length defined-name-stxes) 3) 2) + 0 #f))] -but an actual @scheme[make-make-struct-type] will likely do more.} +but an actual @racket[make-make-struct-type] will likely do more.} diff --git a/collects/syntax/scribblings/stx.scrbl b/collects/syntax/scribblings/stx.scrbl index 2c48eab75d..ea8e066a37 100644 --- a/collects/syntax/scribblings/stx.scrbl +++ b/collects/syntax/scribblings/stx.scrbl @@ -7,26 +7,26 @@ @defproc[(stx-null? [v any/c]) boolean?]{ -Returns @scheme[#t] if @scheme[v] is either the empty list or a +Returns @racket[#t] if @racket[v] is either the empty list or a @tech[#:doc refman]{syntax object} representing the empty list (i.e., -@scheme[syntax-e] on the @tech[#:doc refman]{syntax object} returns +@racket[syntax-e] on the @tech[#:doc refman]{syntax object} returns the empty list).} @defproc[(stx-pair? [v any/c]) boolean?]{ -Returns @scheme[#t] if @scheme[v] is either a pair or a syntax object +Returns @racket[#t] if @racket[v] is either a pair or a syntax object representing a pair (see @techlink[#:doc refman]{syntax pair}).} @defproc[(stx-list? [v any/c]) boolean?]{ -Returns @scheme[#t] if @scheme[v] is a list, or if it is a sequence of -pairs leading to a syntax object such that @scheme[syntax->list] would +Returns @racket[#t] if @racket[v] is a list, or if it is a sequence of +pairs leading to a syntax object such that @racket[syntax->list] would produce a list.} @defproc[(stx->list [stx-list stx-list?]) (or/c list? #f)]{ Produces a list by flatting out a trailing syntax object using -@scheme[syntax->list].} +@racket[syntax->list].} @defproc[(stx-car [v stx-pair?]) any]{ @@ -47,15 +47,15 @@ Equivalent to @racket[(map proc (stx->list stxl) ...)]. [b-id identifier?]) boolean?]{ -Returns @scheme[#t] if @scheme[a-id] and @scheme[b-id] are -@scheme[free-identifier=?], or if @scheme[a-id] and @scheme[b-id] have -the same name (as extracted by @scheme[syntax-e]) and @scheme[a-id] +Returns @racket[#t] if @racket[a-id] and @racket[b-id] are +@racket[free-identifier=?], or if @racket[a-id] and @racket[b-id] have +the same name (as extracted by @racket[syntax-e]) and @racket[a-id] has no binding other than at the top level. -This procedure is useful in conjunction with @scheme[syntax-case*] to +This procedure is useful in conjunction with @racket[syntax-case*] to match procedure names that are normally bound by Racket. For -example, the @scheme[include] macro uses this procedure to recognize -@scheme[build-path]; using @scheme[free-identifier=?] would not work -well outside of @scheme[module], since the top-level -@scheme[build-path] is a distinct variable from the @schememodname[racket/base] export +example, the @racket[include] macro uses this procedure to recognize +@racket[build-path]; using @racket[free-identifier=?] would not work +well outside of @racket[module], since the top-level +@racket[build-path] is a distinct variable from the @racketmodname[racket/base] export (though it's bound to the same procedure, initially).} diff --git a/collects/syntax/scribblings/template.scrbl b/collects/syntax/scribblings/template.scrbl index 29058fb6df..f140bfe24a 100644 --- a/collects/syntax/scribblings/template.scrbl +++ b/collects/syntax/scribblings/template.scrbl @@ -19,68 +19,68 @@ syntax?]{ Produces an representation of an expression similar to -@SCHEME[#`((UNSYNTAX @scheme[syntax]) #,template-stx)], but functions like -@scheme[save-proc] can collect information that might otherwise be -lost by @scheme[syntax] (such as properties when the syntax object is +@RACKET[#`((UNSYNTAX @racket[syntax]) #,template-stx)], but functions like +@racket[save-proc] can collect information that might otherwise be +lost by @racket[syntax] (such as properties when the syntax object is marshaled within bytecode), and run-time functions like the one -specified by @scheme[restore-proc-stx] can use the saved information or +specified by @racket[restore-proc-stx] can use the saved information or otherwise process the syntax object that is generated by the template. -The @scheme[save-proc] is applied to each syntax object in the +The @racket[save-proc] is applied to each syntax object in the representation of the original template (i.e., in -@scheme[template-stx]). If @scheme[constant-as-leaf?] is @scheme[#t], -then @scheme[save-proc] is applied only to syntax objects that contain +@racket[template-stx]). If @racket[constant-as-leaf?] is @racket[#t], +then @racket[save-proc] is applied only to syntax objects that contain at least one pattern variable in a sub-form. The result of -@scheme[save-proc] is provided back as the first argument to -@scheme[restore-proc-stx], which indicates a function with a contract -@scheme[(any/c syntax any/c . -> . any/c)]; the second argument to -@scheme[restore-proc-stx] is the syntax object that @scheme[syntax] +@racket[save-proc] is provided back as the first argument to +@racket[restore-proc-stx], which indicates a function with a contract +@racket[(any/c syntax any/c . -> . any/c)]; the second argument to +@racket[restore-proc-stx] is the syntax object that @racket[syntax] generates, and the last argument is a datum that have been processed -recursively (by functions such as @scheme[restore-proc-stx]) and that +recursively (by functions such as @racket[restore-proc-stx]) and that normally would be converted back to a syntax object using the second argument's context, source, and properties. Note that -@scheme[save-proc] works at expansion time (with respect to the -template form), while @scheme[restore-proc-stx] indicates a function +@racket[save-proc] works at expansion time (with respect to the +template form), while @racket[restore-proc-stx] indicates a function that is called at run time (for the template form), and the data that -flows from @scheme[save-proc] to @scheme[restore-proc-stx] crosses -phases via @scheme[quote]. +flows from @racket[save-proc] to @racket[restore-proc-stx] crosses +phases via @racket[quote]. -The @scheme[leaf-save-proc] and @scheme[leaf-restore-proc-stx] procedures -are analogous to @scheme[save-proc] and -@scheme[restore-proc-stx], but they are applied to leaves, so +The @racket[leaf-save-proc] and @racket[leaf-restore-proc-stx] procedures +are analogous to @racket[save-proc] and +@racket[restore-proc-stx], but they are applied to leaves, so there is no third argument for recursively processed sub-forms. The -function indicated by @scheme[leaf-restore-proc-stx] should have the -contract @scheme[(any/c syntax? . -> . any/c)]. +function indicated by @racket[leaf-restore-proc-stx] should have the +contract @racket[(any/c syntax? . -> . any/c)]. -The @scheme[leaf-datum-proc-stx] procedure is applied to leaves that +The @racket[leaf-datum-proc-stx] procedure is applied to leaves that are not syntax objects, which can happen because pairs and the empty list are not always individually wrapped as syntax objects. The -function should have the contract @scheme[(any/c . -> . any/c)]. When -@scheme[constant-as-leaf?] is @scheme[#f], the only possible argument -to the procedure is @scheme[null]. +function should have the contract @racket[(any/c . -> . any/c)]. When +@racket[constant-as-leaf?] is @racket[#f], the only possible argument +to the procedure is @racket[null]. -The @scheme[pvar-save] and @scheme[pvar-restore-stx] procedures are -analogous to @scheme[save-proc] and @scheme[restore-proc-stx], +The @racket[pvar-save] and @racket[pvar-restore-stx] procedures are +analogous to @racket[save-proc] and @racket[restore-proc-stx], but they are applied to pattern variables. The -@scheme[pvar-restore-stx] procedure should have the contract -@scheme[(any/c syntax? . -> . any/c)], where the second argument +@racket[pvar-restore-stx] procedure should have the contract +@racket[(any/c syntax? . -> . any/c)], where the second argument corresponds to the substitution of the pattern variable. -The @scheme[cons-proc-stx] procedure is used to build intermediate -pairs, including pairs passed to @scheme[restore-proc-stx] and pairs +The @racket[cons-proc-stx] procedure is used to build intermediate +pairs, including pairs passed to @racket[restore-proc-stx] and pairs that do not correspond to syntax objects. -The @scheme[ellipses-end-stx] procedure is an extra filter on the -syntax object that follows a sequence of @scheme[...] ellipses in the -template. The procedure should have the contract @scheme[(any/c . -> +The @racket[ellipses-end-stx] procedure is an extra filter on the +syntax object that follows a sequence of @racket[...] ellipses in the +template. The procedure should have the contract @racket[(any/c . -> . any/c)]. -The following example illustrates a use of @scheme[transform-template] -to implement a @scheme[syntax/shape] form that preserves the -@scheme['paren-shape] property from the original template, even if the +The following example illustrates a use of @racket[transform-template] +to implement a @racket[syntax/shape] form that preserves the +@racket['paren-shape] property from the original template, even if the template code is marshaled within bytecode. -@schemeblock[ +@racketblock[ (define-for-syntax (get-shape-prop stx) (syntax-property stx 'paren-shape)) diff --git a/collects/syntax/scribblings/to-string.scrbl b/collects/syntax/scribblings/to-string.scrbl index ec30408bee..a9e8f0836d 100644 --- a/collects/syntax/scribblings/to-string.scrbl +++ b/collects/syntax/scribblings/to-string.scrbl @@ -8,5 +8,5 @@ @defproc[(syntax->string [stx-list stx-list?]) string?]{ Builds a string with newlines and indenting according to the source -locations in @scheme[stx-list]; the outer pair of parens are not -rendered from @scheme[stx-list].} +locations in @racket[stx-list]; the outer pair of parens are not +rendered from @racket[stx-list].} diff --git a/collects/syntax/scribblings/toplevel.scrbl b/collects/syntax/scribblings/toplevel.scrbl index b67177cbb6..30f79feb9d 100644 --- a/collects/syntax/scribblings/toplevel.scrbl +++ b/collects/syntax/scribblings/toplevel.scrbl @@ -8,48 +8,48 @@ @defproc[(expand-syntax-top-level-with-compile-time-evals [stx syntax?]) syntax?]{ -Expands @scheme[stx] as a top-level expression, and evaluates its +Expands @racket[stx] as a top-level expression, and evaluates its compile-time portion for the benefit of later expansions. -The expander recognizes top-level @scheme[begin] expressions, and -interleaves the evaluation and expansion of of the @scheme[begin] -body, so that compile-time expressions within the @scheme[begin] body +The expander recognizes top-level @racket[begin] expressions, and +interleaves the evaluation and expansion of of the @racket[begin] +body, so that compile-time expressions within the @racket[begin] body affect later expansions within the body. (In other words, it ensures -that expanding a @scheme[begin] is the same as expanding separate +that expanding a @racket[begin] is the same as expanding separate top-level expressions.) -The @scheme[stx] should have a context already, possibly introduced with -@scheme[namespace-syntax-introduce].} +The @racket[stx] should have a context already, possibly introduced with +@racket[namespace-syntax-introduce].} @defproc[(expand-top-level-with-compile-time-evals [stx syntax?]) syntax?]{ -Like @scheme[expand-syntax-top-level-with-compile-time-evals], but -@scheme[stx] is first given context by applying -@scheme[namespace-syntax-introduce] to it.} +Like @racket[expand-syntax-top-level-with-compile-time-evals], but +@racket[stx] is first given context by applying +@racket[namespace-syntax-introduce] to it.} @defproc[(expand-syntax-top-level-with-compile-time-evals/flatten [stx syntax?]) (listof syntax?)]{ -Like @scheme[expand-syntax-top-level-with-compile-time-evals], except +Like @racket[expand-syntax-top-level-with-compile-time-evals], except that it returns a list of syntax objects, none of which have a -@scheme[begin]. These syntax objects are the flattened out contents of -any @scheme[begin]s in the expansion of @scheme[stx].} +@racket[begin]. These syntax objects are the flattened out contents of +any @racket[begin]s in the expansion of @racket[stx].} @defproc[(eval-compile-time-part-of-top-level [stx syntax?]) void?]{ Evaluates expansion-time code in the fully expanded top-level -expression represented by @scheme[stx] (or a part of it, in the case -of @scheme[begin] expressions). The expansion-time code might affect +expression represented by @racket[stx] (or a part of it, in the case +of @racket[begin] expressions). The expansion-time code might affect the compilation of later top-level expressions. For example, if -@scheme[stx] is a @scheme[require] expression, then -@scheme[namespace-require/expansion-time] is used on each require +@racket[stx] is a @racket[require] expression, then +@racket[namespace-require/expansion-time] is used on each require specification in the form. Normally, this function is used only by -@scheme[expand-top-level-with-compile-time-evals].} +@racket[expand-top-level-with-compile-time-evals].} @defproc[(eval-compile-time-part-of-top-level/compile [stx syntax?]) (listof compiled-expression?)]{ -Like @scheme[eval-compile-time-part-of-top-level], but the result is +Like @racket[eval-compile-time-part-of-top-level], but the result is compiled code.} diff --git a/collects/syntax/scribblings/trusted-xforms.scrbl b/collects/syntax/scribblings/trusted-xforms.scrbl index aca34d9770..5719bd4bd6 100644 --- a/collects/syntax/scribblings/trusted-xforms.scrbl +++ b/collects/syntax/scribblings/trusted-xforms.scrbl @@ -5,11 +5,11 @@ @defmodule[syntax/trusted-xforms] -The @schememodname[syntax/trusted-xforms] library has no exports. It +The @racketmodname[syntax/trusted-xforms] library has no exports. It exists only to require other modules that perform syntax transformations, where the other transformations must use -@scheme[syntax-recertify]. An application that wishes to provide a +@racket[syntax-recertify]. An application that wishes to provide a less powerful code inspector to a sub-program should generally attach -@schememodname[syntax/trusted-xforms] to the sub-program's namespace -so that things like the class system from @schememodname[scheme/class] +@racketmodname[syntax/trusted-xforms] to the sub-program's namespace +so that things like the class system from @racketmodname[scheme/class] work properly. diff --git a/collects/teachpack/2htdp/scribblings/batch-io.scrbl b/collects/teachpack/2htdp/scribblings/batch-io.scrbl index 89dbef8e1e..1afb0b4717 100644 --- a/collects/teachpack/2htdp/scribblings/batch-io.scrbl +++ b/collects/teachpack/2htdp/scribblings/batch-io.scrbl @@ -34,7 +34,7 @@ @(define-syntax-rule (reading name ctc s) @defproc[(@name [f (and/c string? file-exists?)]) @ctc ]{ - reads the content of file @scheme[f] and produces it as @s .} ) + reads the content of file @racket[f] and produces it as @s .} ) @teachpack["batch-io"]{Batch Input/Output} @@ -55,10 +55,10 @@ All functions that read a file consume the name of a file and possibly @examples[#:eval (examples-batch-io) (read-file "data.txt") ] -assuming the file named @scheme["data.txt"] has this shape: +assuming the file named @racket["data.txt"] has this shape: @(file-is "data.txt") Note how the leading space in the second line translates into the space -between the newline indicator and the word @scheme["good"] in the result.} +between the newline indicator and the word @racket["good"] in the result.} @item{@reading[read-1strings (listof 1string?)]{a list of one-char strings, one per character} @@ -72,7 +72,7 @@ including spaces and newlines.} @examples[#:eval (examples-batch-io) (read-lines "data.txt") ] -when @scheme["data.txt"] is the name of the same file as in the preceding +when @racket["data.txt"] is the name of the same file as in the preceding item. And again, the leading space of the second line shows up in the second string in the list.} @@ -82,8 +82,8 @@ second string in the list.} (read-words "data.txt") ] This time, however, the extra leading space of the second line of -@scheme["data.txt"] has disappeared in the result. The space is considered -a part of the separator that surrounds the word @scheme["good"]. +@racket["data.txt"] has disappeared in the result. The space is considered +a part of the separator that surrounds the word @racket["good"]. } @item{@reading[read-words/line (listof string?)]{a list of lists, one per line; each line is represented as a list of white-space separated tokens} @@ -91,7 +91,7 @@ a part of the separator that surrounds the word @scheme["good"]. @examples[#:eval (examples-batch-io) (read-words/line "data.txt") ] -The results is similar to the one that @scheme[read-words] produces, +The results is similar to the one that @racket[read-words] produces, except that the organization of the file into lines is preserved. In particular, the empty third line is represented as an empty list of words. } @@ -101,7 +101,7 @@ In particular, the empty third line is represented as an empty list of words. @examples[#:eval (examples-batch-io) (read-csv-file "data.csv") ] -where the file named @scheme["data.csv"] has this shape: +where the file named @racket["data.csv"] has this shape: @(file-is "data.csv") It is important to understand that the rows don't have to have the same length. Here the third line of the file turns into a row of three @@ -109,15 +109,15 @@ elements. } @item{@defproc[(@read-csv-file/rows [f (and/c string? exists?)][s - (-> (listof any/c) X?)]) (listof X?)]{reads the content of file @scheme[f] and - produces it as list of rows, each constructed via @scheme[s]} + (-> (listof any/c) X?)]) (listof X?)]{reads the content of file @racket[f] and + produces it as list of rows, each constructed via @racket[s]} @examples[#:eval (examples-batch-io) (read-csv-file/rows "data.csv" (lambda (x) x)) (read-csv-file/rows "data.csv" length) ] - The first example shows how @scheme[read-csv-file] is just a short form - for @scheme[read-csv-file/rows]; the second one simply counts the + The first example shows how @racket[read-csv-file] is just a short form + for @racket[read-csv-file/rows]; the second one simply counts the number of separated tokens and the result is just a list of numbers. In many cases, the function argument is used to construct a structure from a row.} @@ -127,9 +127,9 @@ There is only one writer function at the moment: @itemlist[ @item{@defproc[(write-file [f string?] [cntnt string?]) string?]{ - turns @scheme[cntnt] into the content of file @scheme[f], located in the + turns @racket[cntnt] into the content of file @racket[f], located in the same folder (directory) as the program. If the write succeeds, the - function produces the name of the file (@scheme[f]); otherwise it signals + function produces the name of the file (@racket[f]); otherwise it signals an error.} @examples[#:eval (examples-batch-io) @@ -137,7 +137,7 @@ There is only one writer function at the moment: (write-file "output.txt" "cruel world") (write-file "output.txt" "cruel world")) ] - After evaluating this examples, the file named @scheme["output.txt"] + After evaluating this examples, the file named @racket["output.txt"] looks like this: @(file-is "output.txt") Explain why. @@ -151,7 +151,7 @@ There is only one writer function at the moment: @section{Testing} @defform[(simulate-file process str ...)]{ - simulates a file system for the function @scheme[process], which reads a + simulates a file system for the function @racket[process], which reads a file and may produce one. Note: this form is under development and will be documented in a precise manner after it is finalized and useful for a wide audience.} diff --git a/collects/teachpack/2htdp/scribblings/image.scrbl b/collects/teachpack/2htdp/scribblings/image.scrbl index 1ff443744f..c3b5eaec3e 100644 --- a/collects/teachpack/2htdp/scribblings/image.scrbl +++ b/collects/teachpack/2htdp/scribblings/image.scrbl @@ -264,9 +264,9 @@ Unlike @racket[scene+curve], if the line passes outside of @racket[image], the i } To create a general triangle given known sides and angles the following -family of functions are useful: @scheme[triangle/sss], -@scheme[triangle/ass], @scheme[triangle/sas], @scheme[triangle/ssa], -@scheme[triangle/sss], @scheme[triangle/sss], and, @scheme[triangle/sss]. +family of functions are useful: @racket[triangle/sss], +@racket[triangle/ass], @racket[triangle/sas], @racket[triangle/ssa], +@racket[triangle/sss], @racket[triangle/sss], and, @racket[triangle/sss]. They all construct a triangle oriented as follows: @image["triangle-xxx.png"] @@ -283,8 +283,8 @@ They all construct a triangle oriented as follows: [outline-mode (or/c 'outline "outline")] [pen-or-color (or/c pen? image-color?)]) image?])]{ - Creates a triangle where the side lengths a, b, and, c are given by @scheme[side-length-a], - @scheme[side-length-b], and, @scheme[side-length-c] respectively. + Creates a triangle where the side lengths a, b, and, c are given by @racket[side-length-a], + @racket[side-length-b], and, @racket[side-length-c] respectively. @mode/color-text @@ -305,8 +305,8 @@ They all construct a triangle oriented as follows: [outline-mode (or/c 'outline "outline")] [pen-or-color (or/c pen? image-color?)]) image?])]{ - Creates a triangle where the angle A and side length a and b, are given by @scheme[angle-a], - @scheme[side-length-b], and, @scheme[side-length-c] respectively. + Creates a triangle where the angle A and side length a and b, are given by @racket[angle-a], + @racket[side-length-b], and, @racket[side-length-c] respectively. @mode/color-text @@ -327,8 +327,8 @@ They all construct a triangle oriented as follows: [outline-mode (or/c 'outline "outline")] [pen-or-color (or/c pen? image-color?)]) image?])]{ - Creates a triangle where the side length a, angle B, and, side length c given by @scheme[side-length-a], - @scheme[angle-b], and, @scheme[side-length-c] respectively. + Creates a triangle where the side length a, angle B, and, side length c given by @racket[side-length-a], + @racket[angle-b], and, @racket[side-length-c] respectively. @mode/color-text @@ -349,8 +349,8 @@ They all construct a triangle oriented as follows: [outline-mode (or/c 'outline "outline")] [pen-or-color (or/c pen? image-color?)]) image?])]{ - Creates a triangle where the side length a, side length b, and, angle c given by @scheme[side-length-a], - @scheme[side-length-b], and, @scheme[angle-c] respectively. + Creates a triangle where the side length a, side length b, and, angle c given by @racket[side-length-a], + @racket[side-length-b], and, @racket[angle-c] respectively. @mode/color-text @@ -370,8 +370,8 @@ They all construct a triangle oriented as follows: [outline-mode (or/c 'outline "outline")] [pen-or-color (or/c pen? image-color?)]) image?])]{ - Creates a triangle where the angle A, angle B, and, side length c given by @scheme[angle-a], - @scheme[angle-b], and, @scheme[side-length-c] respectively. + Creates a triangle where the angle A, angle B, and, side length c given by @racket[angle-a], + @racket[angle-b], and, @racket[side-length-c] respectively. @mode/color-text @@ -392,8 +392,8 @@ They all construct a triangle oriented as follows: [outline-mode (or/c 'outline "outline")] [pen-or-color (or/c pen? image-color?)]) image?])]{ - Creates a triangle where the angle A, side length b, and, angle C given by @scheme[angle-a], - @scheme[side-length-b], and, @scheme[angle-c] respectively. + Creates a triangle where the angle A, side length b, and, angle C given by @racket[angle-a], + @racket[side-length-b], and, @racket[angle-c] respectively. @mode/color-text @@ -414,8 +414,8 @@ They all construct a triangle oriented as follows: [outline-mode (or/c 'outline "outline")] [pen-or-color (or/c pen? image-color?)]) image?])]{ - Creates a triangle where the side length a, angle B, and, angle C given by @scheme[side-length-a], - @scheme[angle-b], and, @scheme[angle-c] respectively. + Creates a triangle where the side length a, angle B, and, angle C given by @racket[side-length-a], + @racket[angle-b], and, @racket[angle-c] respectively. @mode/color-text @@ -543,7 +543,7 @@ other. The top and bottom pair of angles is @racket[angle] and the left and righ Constructs a star-like polygon where the star is specified by two radii and a number of points. The first radius determines where the points begin, the second determines where they end, and -the @scheme[point-count] argument determines how many points the star has. +the @racket[point-count] argument determines how many points the star has. @image-examples[(radial-star 8 8 64 "solid" "darkslategray") (radial-star 32 30 40 "outline" "black")] @@ -1119,10 +1119,10 @@ the parts that fit onto @racket[scene]. } @defproc[(flip-horizontal [image image?]) image?]{ - Flips @scheme[image] left to right. + Flips @racket[image] left to right. - Flipping images with text is not supported (so passing @scheme[flip-horizontal] an image - that contains a @scheme[text] or @scheme[text/font] image inside somewhere signals an error). + Flipping images with text is not supported (so passing @racket[flip-horizontal] an image + that contains a @racket[text] or @racket[text/font] image inside somewhere signals an error). @image-examples[(beside (rotate 30 (square 50 "solid" "red")) @@ -1131,10 +1131,10 @@ the parts that fit onto @racket[scene]. } @defproc[(flip-vertical [image image?]) image?]{ - Flips @scheme[image] top to bottom. + Flips @racket[image] top to bottom. - Flipping images with text is not supported (so passing @scheme[flip-horizontal] an image - that contains a @scheme[text] or @scheme[text/font] image inside somewhere signals an error). + Flipping images with text is not supported (so passing @racket[flip-horizontal] an image + that contains a @racket[text] or @racket[text/font] image inside somewhere signals an error). @image-examples[(above (star 40 "solid" "firebrick") diff --git a/collects/teachpack/2htdp/scribblings/port.scrbl b/collects/teachpack/2htdp/scribblings/port.scrbl index cede9829bb..7eccb74ecf 100644 --- a/collects/teachpack/2htdp/scribblings/port.scrbl +++ b/collects/teachpack/2htdp/scribblings/port.scrbl @@ -30,20 +30,20 @@ In this document, we explain how to port programs that assume the old world @port[ @(begin #reader scribble/comment-reader -(schemeblock -(require #,(schememodname htdp/world)) +(racketblock +(require #,(racketmodname htdp/world)) )) @; --------------------------------- @(begin #reader scribble/comment-reader -(schemeblock -(require #,(schememodname 2htdp/universe)) -(require #,(schememodname htdp/image)) +(racketblock +(require #,(racketmodname 2htdp/universe)) +(require #,(racketmodname htdp/image)) )) ] The table shows the old style on the left and the new style on the right. If your programs imported teachpacks via the drscheme teachpack - menu, we recommend that you use the @scheme[require] form from now on; + menu, we recommend that you use the @racket[require] form from now on; alternatively, you use the drscheme menu @emph{twice} to import the functions from two teachpacks. @@ -63,8 +63,8 @@ In order to distinguish between the various pieces of functionality, we Here is the first program from the documentation for the world teachpack: @(begin #reader scribble/comment-reader -(schemeblock -(require #,(schememodname htdp/world)) +(racketblock +(require #,(racketmodname htdp/world)) ;; Number -> Scene (define (create-UFO-scene height) @@ -83,29 +83,29 @@ Here is the first program from the documentation for the world teachpack: (htdp:on-tick-event add1) (htdp:on-redraw create-UFO-scene) )) - This program defines a function for placing a @scheme[UFO] into a 100 by - 100 scene, where @scheme[UFO] is a defined image. The world program itself + This program defines a function for placing a @racket[UFO] into a 100 by + 100 scene, where @racket[UFO] is a defined image. The world program itself consists of three lines: @itemize[ @item{the first one creates the 100 by 100 scene, specifies a rate of 28 - images per second, and @scheme[0] as the initial world description;} + images per second, and @racket[0] as the initial world description;} @item{the second one says that for each clock tick, the world (a number) is - increased by @scheme[1]; and} -@item{the last line tells drscheme to use @scheme[create-UFO-scene] as the + increased by @racket[1]; and} +@item{the last line tells drscheme to use @racket[create-UFO-scene] as the function that renders the current world as a scene.} ] Let us now convert this program into the universe setting, step by - step, staring with the @scheme[require] specification, which is converted + step, staring with the @racket[require] specification, which is converted as above: @port[ -@schemeblock[(require #,(schememodname htdp/world))] +@racketblock[(require #,(racketmodname htdp/world))] @; --------------------------------- @(begin #reader scribble/comment-reader -(schemeblock -(require #,(schememodname 2htdp/universe)) -(require #,(schememodname htdp/image)) +(racketblock +(require #,(racketmodname 2htdp/universe)) +(require #,(racketmodname htdp/image)) )) ] @@ -113,7 +113,7 @@ The function that renders the world as a scene remains the same: @port[ @(begin #reader scribble/comment-reader -(schemeblock +(racketblock ;; Number -> Scene (define (create-UFO-scene height) (htdp:place-image @@ -124,7 +124,7 @@ The function that renders the world as a scene remains the same: @; --------------------------------- @(begin #reader scribble/comment-reader -(schemeblock +(racketblock ;; Number -> Scene (define (create-UFO-scene height) (htdp:place-image @@ -138,7 +138,7 @@ For the image constant we switch from symbols to strings: @port[ @(begin #reader scribble/comment-reader -(schemeblock +(racketblock ;; Scene (define UFO (htdp:overlay @@ -150,7 +150,7 @@ For the image constant we switch from symbols to strings: @; --------------------------------- @(begin #reader scribble/comment-reader -(schemeblock +(racketblock ;; Scene (define UFO (htdp:overlay @@ -166,13 +166,13 @@ For the image constant we switch from symbols to strings: The most important change concerns the lines that launch the world program: @port[ -@schemeblock[ +@racketblock[ (htdp:big-bang 100 100 (/1 28) 0) (htdp:on-tick-event add1) (htdp:on-redraw create-UFO-scene) ] @; --------------------------------- -@schemeblock[ +@racketblock[ (2htdp:big-bang 0 (on-tick add1) @@ -181,7 +181,7 @@ The most important change concerns the lines that launch the world program: ] They are turned into a single expression that comes with as many clauses as there are lines in the old program. As you can see, the - @scheme[big-bang] expression from the universe teachpack no longer + @racket[big-bang] expression from the universe teachpack no longer requires the specification of the size of the scene or the rate at which the clock ticks (though it is possible to supply the clock rate if the default is not satisfactory). @@ -195,7 +195,7 @@ The other big change concerns key event handling and mouse event of the world teachpack: @port[ -@schemeblock[ +@racketblock[ (define (change w a-key-event) (cond [(key=? a-key-event 'left) @@ -211,7 +211,7 @@ The other big change concerns key event handling and mouse event [else w]))] @; --------------------------------- -@schemeblock[ +@racketblock[ (define (change w a-key-event) (cond [(key=? a-key-event "left") @@ -227,14 +227,14 @@ The other big change concerns key event handling and mouse event [else w])) ]] - Note how the @scheme[char?] clause changed. Since all chars are now + Note how the @racket[char?] clause changed. Since all chars are now represented as strings containing one ``letter'', the program on the right just checks the length of the string. Otherwise, we simply change all symbols into strings. If you ever recorded your programs' work via an animated gif, you can still - do so. Instead of adding a fifth argument to @scheme[big-bang], however, - you will need to add a clause of the shape @scheme[(record? x)]. + do so. Instead of adding a fifth argument to @racket[big-bang], however, + you will need to add a clause of the shape @racket[(record? x)]. Finally, the universe teachpack implements a richer functionality than the world teachpack. @@ -242,11 +242,11 @@ Finally, the universe teachpack implements a richer functionality than the @; ----------------------------------------------------------------------------- @section{Porting Image Programs} -The universe library also comes with a new image library, @schememodname[2htdp/image]. +The universe library also comes with a new image library, @racketmodname[2htdp/image]. Using the old image -library still works fine with @schememodname[2htdp/universe], but the +library still works fine with @racketmodname[2htdp/universe], but the new image library provides a number of improvements, including faster -image comparison (especially useful in @scheme[check-expect] expressions), +image comparison (especially useful in @racket[check-expect] expressions), rotating images, scaling images, curves, a number of new polygon shapes, and more control over line drawing. @@ -255,14 +255,14 @@ To use the new image library in isloation: @port[ @(begin #reader scribble/comment-reader -(schemeblock -(require #,(schememodname htdp/image)) +(racketblock +(require #,(racketmodname htdp/image)) )) @; --------------------------------- @(begin #reader scribble/comment-reader -(schemeblock -(require #,(schememodname 2htdp/image)) +(racketblock +(require #,(racketmodname 2htdp/image)) )) ] @@ -271,31 +271,31 @@ and to use the new image library with the universe teachpack: @port[ @(begin #reader scribble/comment-reader -(schemeblock -(require #,(schememodname htdp/world)) +(racketblock +(require #,(racketmodname htdp/world)) )) @; --------------------------------- @(begin #reader scribble/comment-reader -(schemeblock -(require #,(schememodname 2htdp/universe)) -(require #,(schememodname 2htdp/image)) +(racketblock +(require #,(racketmodname 2htdp/universe)) +(require #,(racketmodname 2htdp/image)) ))] @bold{Overlay vs Underlay} -The @scheme[htdp:overlay] function places its first argument +The @racket[htdp:overlay] function places its first argument under its second (and subsequent) arguments and so in -@schememodname[2htdp/image], we decided to call that -function @scheme[2htdp:underlay]. +@racketmodname[2htdp/image], we decided to call that +function @racket[2htdp:underlay]. -@port[(schemeblock +@port[(racketblock (htdp:overlay (htdp:rectangle 10 20 "solid" "red") (htdp:rectangle 20 10 "solid" "blue"))) - (schemeblock + (racketblock (2htdp:underlay (2htdp:rectangle 10 20 "solid" "red") @@ -304,63 +304,63 @@ function @scheme[2htdp:underlay]. @bold{No more pinholes} -The concept of pinholes from @schememodname[htdp/image] -has no correspondance in @schememodname[2htdp/image] -(we do expect to bring back pinholes in @schememodname[2htdp/image] +The concept of pinholes from @racketmodname[htdp/image] +has no correspondance in @racketmodname[2htdp/image] +(we do expect to bring back pinholes in @racketmodname[2htdp/image] eventually, but they will not be as pervasive as they are -in @scheme[htdp/image]). +in @racket[htdp/image]). Instead of a special position in the image that overlay operations are sensitive to, -@schememodname[2htdp/image] has a family of overlay operations, +@racketmodname[2htdp/image] has a family of overlay operations, that overlay images based on their centers or their edges. Since the default position of the pinhole is in the center for most images and the default for overlaying and underlaying -images in @scheme[2htdp/image] is based on the center, +images in @racket[2htdp/image] is based on the center, simple examples (like the one above) behave the same in both libraries. But, consider this expression that overlays two images on their upper-left corners, written using both libraries. -@port[@schemeblock[(htdp:overlay +@port[@racketblock[(htdp:overlay (htdp:put-pinhole (htdp:rectangle 10 20 "solid" "red") 0 0) (htdp:put-pinhole (htdp:rectangle 20 10 "solid" "blue") 0 0))] - @schemeblock[(2htdp:underlay/align - "left" - "top" - (2htdp:rectangle - 10 20 "solid" "red") - (2htdp:rectangle - 20 10 "solid" "blue"))]] + @racketblock[(2htdp:underlay/align + "left" + "top" + (2htdp:rectangle + 10 20 "solid" "red") + (2htdp:rectangle + 20 10 "solid" "blue"))]] -In the @schememodname[2htdp/image] version, the programmer -uses @scheme[2htdp:underlay/align] to specify where +In the @racketmodname[2htdp/image] version, the programmer +uses @racket[2htdp:underlay/align] to specify where the images should be lined up, instead of using the pinhole. @bold{Outlines in different places} -The outline style shapes are now shifted by one pixel for @schememodname[2htdp/image] -images as compared to @schememodname[htdp/image]. +The outline style shapes are now shifted by one pixel for @racketmodname[2htdp/image] +images as compared to @racketmodname[htdp/image]. This means that these two rectangles draw the same sets of pixels. -@port[@schemeblock[(htdp:rectangle +@port[@racketblock[(htdp:rectangle 11 11 "outline" "black")] - @schemeblock[(2htdp:rectangle - 10 10 "outline" "black")]] + @racketblock[(2htdp:rectangle + 10 10 "outline" "black")]] See also @secref["nitty-gritty"]. @bold{Star changed} -The @scheme[2htdp:star] function is a completely different -function from @scheme[htdp:star]. Both produce stars based, -on polygons, but @scheme[2htdp:star] always produces a five-pointed -star. See also @scheme[2htdp:star-polygon] for more general star +The @racket[2htdp:star] function is a completely different +function from @racket[htdp:star]. Both produce stars based, +on polygons, but @racket[2htdp:star] always produces a five-pointed +star. See also @racket[2htdp:star-polygon] for more general star shapes. diff --git a/collects/teachpack/2htdp/scribblings/universe.scrbl b/collects/teachpack/2htdp/scribblings/universe.scrbl index 4a1bd4ffde..f8fbd2a8f9 100644 --- a/collects/teachpack/2htdp/scribblings/universe.scrbl +++ b/collects/teachpack/2htdp/scribblings/universe.scrbl @@ -59,11 +59,11 @@ The purpose of this documentation is to give experienced Schemers and HtDP @section{Background} The universe teachpack assumes working knowledge of the basic image manipulation primitives, -either @schememodname[htdp/image] or @schememodname[2htdp/image]. Its operations -sometimes require scenes which for @scheme[htdp/image] images means an image whose -pinhole is at (0,0). For @schememodname[2htdp/image], every image is a scene. +either @racketmodname[htdp/image] or @racketmodname[2htdp/image]. Its operations +sometimes require scenes which for @racket[htdp/image] images means an image whose +pinhole is at (0,0). For @racketmodname[2htdp/image], every image is a scene. -The example programs in this document are all written using @schememodname[2htdp/image] +The example programs in this document are all written using @racketmodname[2htdp/image] primitives. @; ----------------------------------------------------------------------------- @@ -78,16 +78,16 @@ The simplest kind of animated @tech{world} program is a time-based natural-number/c]{ opens a canvas and starts a clock that ticks 28 times per second. Every - time the clock ticks, DrRacket applies @scheme[create-image] to the + time the clock ticks, DrRacket applies @racket[create-image] to the number of ticks passed since this function call. The results of these function calls are displayed in the canvas. The simulation runs until you click the @tt{Stop} button in DrRacket or close the window. At that - point, @scheme[animate] returns the number of ticks that have + point, @racket[animate] returns the number of ticks that have passed. } Example: -@schemeblock[ +@racketblock[ (define (create-UFO-scene height) (underlay/xy (rectangle 100 100 "solid" "white") 50 height UFO)) @@ -103,14 +103,14 @@ Example: @defproc[(run-simulation [create-image (-> natural-number/c scene?)]) true]{ - @scheme[animate] was originally called @scheme[run-simulation], and this + @racket[animate] was originally called @racket[run-simulation], and this binding is retained for backwards compatibility} @defproc[(run-movie [r (and/c real? positive?)] [m [Listof image?]]) true]{ - @scheme[run-movie] displays the list of images @scheme[m] at the rate of - @scheme[r] images per second.} + @racket[run-movie] displays the list of images @racket[m] at the rate of + @racket[r] images per second.} @;----------------------------------------------------------------------------- @@ -118,7 +118,7 @@ Example: The step from simulations to interactive programs is relatively small. Roughly speaking, a simulation designates one function, - @scheme[_create-image], as a handler for one kind of event: clock ticks. In + @racket[_create-image], as a handler for one kind of event: clock ticks. In addition to clock ticks, @tech{world} programs can also deal with two other kinds of events: keyboard events and mouse events. A keyboard event is triggered when a computer user presses a key on the @@ -127,10 +127,10 @@ The step from simulations to interactive programs is relatively Your program may deal with such events via the @emph{designation} of @emph{handler} functions. Specifically, the teachpack provides for the - installation of three event handlers: @scheme[on-tick], @scheme[on-key], - and @scheme[on-mouse]. In addition, a @tech{world} program may specify a - @scheme[draw] function, which is called every time your program should - visualize the current world, and a @scheme[done] predicate, which is used + installation of three event handlers: @racket[on-tick], @racket[on-key], + and @racket[on-mouse]. In addition, a @tech{world} program may specify a + @racket[draw] function, which is called every time your program should + visualize the current world, and a @racket[done] predicate, which is used to determine when the @tech{world} program should shut down. Each handler function consumes the current state of the @tech{world} and @@ -142,14 +142,14 @@ The following picture provides an intuitive overview of the workings of a @image["nuworld.png"] - The @scheme[big-bang] form installs @scheme[World_0] as the initial @tech{WorldState}. - The handlers @scheme[tock], @scheme[react], and @scheme[click] transform - one world into another one; each time an event is handled, @scheme[done] is + The @racket[big-bang] form installs @racket[World_0] as the initial @tech{WorldState}. + The handlers @racket[tock], @racket[react], and @racket[click] transform + one world into another one; each time an event is handled, @racket[done] is used to check whether the world is final, in which case the program is - shut down; and finally, @scheme[draw] renders each world as a scene, which + shut down; and finally, @racket[draw] renders each world as a scene, which is then displayed on an external canvas. -@deftech{WorldState} : @scheme[any/c] +@deftech{WorldState} : @racket[any/c] The design of a world program demands that you come up with a data definition of all possible states. We use @tech{WorldState} to refer to @@ -182,22 +182,22 @@ The design of a world program demands that you come up with a data ])]{ starts a @tech{world} program in the initial state specified with - @scheme[state-expr], which must of course evaluate to an element of + @racket[state-expr], which must of course evaluate to an element of @tech{WorldState}. Its behavior is specified via the handler functions - designated in the optional @scheme[spec] clauses, especially how the + designated in the optional @racket[spec] clauses, especially how the @tech{world} program deals with clock ticks, with key events, with mouse events, and eventually with messages from the universe; how it renders itself as a scene; when the program must shut down; where to register the world with a universe; and whether to record the stream of events. A world - specification may not contain more than one @scheme[on-tick], - @scheme[to-draw], or @scheme[register] clause. A @scheme[big-bang] + specification may not contain more than one @racket[on-tick], + @racket[to-draw], or @racket[register] clause. A @racket[big-bang] expression returns the last world when the stop condition is satisfied (see below) or when the programmer clicks on the @tt{Stop} button or closes the canvas. } -The only mandatory clause of a @scheme[big-bang] description is -@scheme[to-draw] (or @scheme[on-draw] for backwards compatibility): +The only mandatory clause of a @racket[big-bang] description is +@racket[to-draw] (or @racket[on-draw] for backwards compatibility): @itemize[ @item{ @@ -206,7 +206,7 @@ The only mandatory clause of a @scheme[big-bang] description is #:contracts ([render-expr (-> (unsyntax @tech{WorldState}) scene?)])]{ - tells DrRacket to call the function @scheme[render-expr] whenever the + tells DrRacket to call the function @racket[render-expr] whenever the canvas must be drawn. The external canvas is usually re-drawn after DrRacket has dealt with an event. Its size is determined by the size of the first generated @tech{scene}.} @@ -218,12 +218,12 @@ The only mandatory clause of a @scheme[big-bang] description is [width-expr natural-number/c] [height-expr natural-number/c])]{ - tells DrRacket to use a @scheme[width-expr] by @scheme[height-expr] + tells DrRacket to use a @racket[width-expr] by @racket[height-expr] canvas instead of one determine by the first generated @tech{scene}. } For compatibility reasons, the teachpack also supports the keyword -@defidform/inline[on-draw] in lieu of @scheme[to-draw] but the latter is preferred +@defidform/inline[on-draw] in lieu of @racket[to-draw] but the latter is preferred now. } @@ -237,7 +237,7 @@ All remaining clauses are optional: #:contracts ([tick-expr (-> (unsyntax @tech{WorldState}) (unsyntax @tech{WorldState}))])]{ -tells DrRacket to call the @scheme[tick-expr] function on the current +tells DrRacket to call the @racket[tick-expr] function on the current world every time the clock ticks. The result of the call becomes the current world. The clock ticks at the rate of 28 times per second.}} @@ -247,13 +247,13 @@ current world. The clock ticks at the rate of 28 times per second.}} #:contracts ([tick-expr (-> (unsyntax @tech{WorldState}) (unsyntax @tech{WorldState}))] [rate-expr (and/c real? positive?)])]{ -tells DrRacket to call the @scheme[tick-expr] function on the current +tells DrRacket to call the @racket[tick-expr] function on the current world every time the clock ticks. The result of the call becomes the -current world. The clock ticks every @scheme[rate-expr] seconds.}} +current world. The clock ticks every @racket[rate-expr] seconds.}} @item{A @tech{KeyEvent} represents key board events. -@deftech{KeyEvent} : @scheme[string?] +@deftech{KeyEvent} : @racket[string?] For simplicity, we represent key events with strings, but not all strings are key events. The representation of key events comes in distinct @@ -262,91 +262,91 @@ For simplicity, we represent key events with strings, but not all strings unusual: @itemize[ -@item{@scheme[" "] stands for the space bar (@scheme[#\space]);} -@item{@scheme["\r"] stands for the return key (@scheme[#\return]);} -@item{@scheme["\t"] stands for the tab key (@scheme[#\tab]); and} -@item{@scheme["\b"] stands for the backspace key (@scheme[#\backspace]).} +@item{@racket[" "] stands for the space bar (@racket[#\space]);} +@item{@racket["\r"] stands for the return key (@racket[#\return]);} +@item{@racket["\t"] stands for the tab key (@racket[#\tab]); and} +@item{@racket["\b"] stands for the backspace key (@racket[#\backspace]).} ] - On rare occasions you may also encounter @scheme["\u007F"], which is the + On rare occasions you may also encounter @racket["\u007F"], which is the string representing the delete key (aka rubout). Second, some keys have multiple-character string representations. Strings with more than one character denote arrow keys or other special events, starting with the most important: @itemize[ -@item{@scheme["left"] is the left arrow;} -@item{@scheme["right"] is the right arrow;} -@item{@scheme["up"] is the up arrow;} -@item{@scheme["down"] is the down arrow;} -@item{@scheme["start"]} -@item{@scheme["cancel"]} -@item{@scheme["clear"]} -@item{@scheme["shift"]} -@item{@scheme["control"]} -@item{@scheme["menu"]} -@item{@scheme["pause"]} -@item{@scheme["capital"]} -@item{@scheme["prior"]} -@item{@scheme["next"]} -@item{@scheme["end"]} -@item{@scheme["home"]} -@item{@scheme["escape"]} -@item{@scheme["select"]} -@item{@scheme["print"]} -@item{@scheme["execute"]} -@item{@scheme["snapshot"]} -@item{@scheme["insert"]} -@item{@scheme["help"]} -@item{@scheme["numpad0"], - @scheme["numpad1"], - @scheme["numpad2"], - @scheme["numpad3"], - @scheme["numpad4"], - @scheme["numpad5"], - @scheme["numpad6"], - @scheme["numpad7"], - @scheme["numpad8"], - @scheme["numpad9"], - @scheme["numpad-enter"], - @scheme["multiply"], - @scheme["add"], - @scheme["separator"], - @scheme["subtract"], - @scheme["decimal"], - @scheme["divide"]} -@item{@scheme["f1"], - @scheme["f2"], - @scheme["f3"], - @scheme["f4"], - @scheme["f5"], - @scheme["f6"], - @scheme["f7"], - @scheme["f8"], - @scheme["f9"], - @scheme["f10"], - @scheme["f11"], - @scheme["f12"], - @scheme["f13"], - @scheme["f14"], - @scheme["f15"], - @scheme["f16"], - @scheme["f17"], - @scheme["f18"], - @scheme["f19"], - @scheme["f20"], - @scheme["f21"], - @scheme["f22"], - @scheme["f23"], - @scheme["f24"]} -@item{@scheme["numlock"]} -@item{@scheme["scroll"]} -@item{@scheme["wheel-up"]} -@item{@scheme["wheel-down"]} +@item{@racket["left"] is the left arrow;} +@item{@racket["right"] is the right arrow;} +@item{@racket["up"] is the up arrow;} +@item{@racket["down"] is the down arrow;} +@item{@racket["start"]} +@item{@racket["cancel"]} +@item{@racket["clear"]} +@item{@racket["shift"]} +@item{@racket["control"]} +@item{@racket["menu"]} +@item{@racket["pause"]} +@item{@racket["capital"]} +@item{@racket["prior"]} +@item{@racket["next"]} +@item{@racket["end"]} +@item{@racket["home"]} +@item{@racket["escape"]} +@item{@racket["select"]} +@item{@racket["print"]} +@item{@racket["execute"]} +@item{@racket["snapshot"]} +@item{@racket["insert"]} +@item{@racket["help"]} +@item{@racket["numpad0"], + @racket["numpad1"], + @racket["numpad2"], + @racket["numpad3"], + @racket["numpad4"], + @racket["numpad5"], + @racket["numpad6"], + @racket["numpad7"], + @racket["numpad8"], + @racket["numpad9"], + @racket["numpad-enter"], + @racket["multiply"], + @racket["add"], + @racket["separator"], + @racket["subtract"], + @racket["decimal"], + @racket["divide"]} +@item{@racket["f1"], + @racket["f2"], + @racket["f3"], + @racket["f4"], + @racket["f5"], + @racket["f6"], + @racket["f7"], + @racket["f8"], + @racket["f9"], + @racket["f10"], + @racket["f11"], + @racket["f12"], + @racket["f13"], + @racket["f14"], + @racket["f15"], + @racket["f16"], + @racket["f17"], + @racket["f18"], + @racket["f19"], + @racket["f20"], + @racket["f21"], + @racket["f22"], + @racket["f23"], + @racket["f24"]} +@item{@racket["numlock"]} +@item{@racket["scroll"]} +@item{@racket["wheel-up"]} +@item{@racket["wheel-down"]} ] @defproc[(key-event? [x any]) boolean?]{ - determines whether @scheme[x] is a @tech{KeyEvent}} + determines whether @racket[x] is a @tech{KeyEvent}} @defproc[(key=? [x key-event?][y key-event?]) boolean?]{ compares two @tech{KeyEvent} for equality} @@ -354,12 +354,12 @@ Second, some keys have multiple-character string representations. Strings @defform[(on-key key-expr) #:contracts ([key-expr (-> (unsyntax @tech{WorldState}) key-event? (unsyntax @tech{WorldState}))])]{ - tells DrRacket to call the @scheme[key-expr] function on the current world and a + tells DrRacket to call the @racket[key-expr] function on the current world and a @tech{KeyEvent} for every keystroke the user of the computer makes. The result of the call becomes the current world. Here is a typical key-event handler: -@schemeblock[ +@racketblock[ (define (change w a-key) (cond [(key=? a-key "left") (world-go w -DELTA)] @@ -376,7 +376,7 @@ Second, some keys have multiple-character string representations. Strings @defform[(on-release release-expr) #:contracts ([release-expr (-> (unsyntax @tech{WorldState}) key-event? (unsyntax @tech{WorldState}))])]{ - tells DrRacket to call the @scheme[release-expr] function on the current world and a + tells DrRacket to call the @racket[release-expr] function on the current world and a @tech{KeyEvent} for every release event on the keyboard. A release event occurs when a user presses the key and then releases it. The second argument indicates which key has been released. The result of the function call @@ -387,28 +387,28 @@ Second, some keys have multiple-character string representations. Strings @item{ A @tech{MouseEvent} represents mouse events, e.g., mouse movements or mouse clicks, by the computer's user. -@deftech{MouseEvent} : @scheme[(one-of/c "button-down" "button-up" "drag" "move" "enter" "leave")] +@deftech{MouseEvent} : @racket[(one-of/c "button-down" "button-up" "drag" "move" "enter" "leave")] All @tech{MouseEvent}s are represented via strings: @itemize[ -@item{@scheme["button-down"] +@item{@racket["button-down"] signals that the computer user has pushed a mouse button down;} -@item{@scheme["button-up"] +@item{@racket["button-up"] signals that the computer user has let go of a mouse button;} -@item{@scheme["drag"] +@item{@racket["drag"] signals that the computer user is dragging the mouse. A dragging event occurs when the mouse moves while a mouse button is pressed.} -@item{@scheme["move"] +@item{@racket["move"] signals that the computer user has moved the mouse;} -@item{@scheme["enter"] +@item{@racket["enter"] signals that the computer user has moved the mouse into the canvas area; and} -@item{@scheme["leave"] +@item{@racket["leave"] signals that the computer user has moved the mouse out of the canvas area.} ] @defproc[(mouse-event? [x any]) boolean?]{ - determines whether @scheme[x] is a @tech{MouseEvent}} + determines whether @racket[x] is a @tech{MouseEvent}} @defproc[(mouse=? [x mouse-event?][y mouse-event?]) boolean?]{ compares two @tech{MouseEvent}s for equality} @@ -419,12 +419,12 @@ All @tech{MouseEvent}s are represented via strings: (-> (unsyntax @tech{WorldState}) integer? integer? (unsyntax @tech{MouseEvent}) (unsyntax @tech{WorldState}))])]{ - tells DrRacket to call @scheme[mouse-expr] on the current world, the current - @scheme[x] and @scheme[y] coordinates of the mouse, and a + tells DrRacket to call @racket[mouse-expr] on the current world, the current + @racket[x] and @racket[y] coordinates of the mouse, and a @tech{MouseEvent} for every (noticeable) action of the mouse by the computer user. The result of the call becomes the current world. - For @scheme["leave"] and @scheme["enter"] events, the coordinates of the + For @racket["leave"] and @racket["enter"] events, the coordinates of the mouse click may be outside of the (implicit) rectangle. That is, the coordinates may be negative or larger than the (implicitly) specified width and height. @@ -439,11 +439,11 @@ All @tech{MouseEvent}s are represented via strings: @defform[(stop-when last-world?) #:contracts ([last-world? (-> (unsyntax @tech{WorldState}) boolean?)])]{ - tells DrRacket to call the @scheme[last-world?] function whenever the canvas is - drawn. If this call produces @scheme[true], the world program is shut + tells DrRacket to call the @racket[last-world?] function whenever the canvas is + drawn. If this call produces @racket[true], the world program is shut down. Specifically, the clock is stopped; no more tick events, @tech{KeyEvent}s, or @tech{MouseEvent}s are forwarded to - the respective handlers. The @scheme[big-bang] expression returns this + the respective handlers. The @racket[big-bang] expression returns this last world. } @@ -452,12 +452,12 @@ All @tech{MouseEvent}s are represented via strings: #:contracts ([last-world? (-> (unsyntax @tech{WorldState}) boolean?)] [last-picture (-> (unsyntax @tech{WorldState}) scene?)])]{ - tells DrRacket to call the @scheme[last-world?] function whenever the canvas is - drawn. If this call produces @scheme[true], the world program is shut + tells DrRacket to call the @racket[last-world?] function whenever the canvas is + drawn. If this call produces @racket[true], the world program is shut down after displaying the world one last time, this time using the scene - rendered with @scheme[last-picture]. Specifically, the clock is stopped; no more + rendered with @racket[last-picture]. Specifically, the clock is stopped; no more tick events, @tech{KeyEvent}s, or @tech{MouseEvent}s are forwarded to - the respective handlers. The @scheme[big-bang] expression returns this + the respective handlers. The @racket[big-bang] expression returns this last world. } } @@ -466,9 +466,9 @@ All @tech{MouseEvent}s are represented via strings: @defstruct*[stop-with ([w (unsyntax @tech{WorldState})])]{signals to DrRacket that the world program should shut down. That is, any -handler may return @scheme[(stop-with w)] provided @scheme[w] is a -@tech{WorldState}. If it does, the state of the world becomes @scheme[w] -and @scheme[big-bang] will close down all event handling.} +handler may return @racket[(stop-with w)] provided @racket[w] is a +@tech{WorldState}. If it does, the state of the world becomes @racket[w] +and @racket[big-bang] will close down all event handling.} } @@ -477,8 +477,8 @@ and @scheme[big-bang] will close down all event handling.} @defform[(check-with world-expr?) #:contracts ([world-expr? (-> Any boolean?)])]{ - tells DrRacket to call the @scheme[world-expr?] function on the result of - every world handler call. If this call produces @scheme[true], the result + tells DrRacket to call the @racket[world-expr?] function on the result of + every world handler call. If this call produces @racket[true], the result is considered a world; otherwise the world program signals an error. }} @@ -488,10 +488,10 @@ and @scheme[big-bang] will close down all event handling.} #:contracts ([r-expr any/c])]{ tells DrRacket to enable a visual replay of the interaction, - unless @scheme[#false]. + unless @racket[#false]. The replay action generates one png image per scene and an animated gif for the entire sequence in the directory of the user's - choice. If @scheme[r-expr] evaluates to the name of an existing + choice. If @racket[r-expr] evaluates to the name of an existing directory/folder (in the local directory/folder), the directory is used to deposit the images. }} @@ -511,18 +511,18 @@ and @scheme[big-bang] will close down all event handling.} @defform[(name name-expr) #:contracts ([name-expr (or/c symbol? string?)])]{ - provide a name (@scheme[namer-expr]) to this world, which is used as the + provide a name (@racket[namer-expr]) to this world, which is used as the title of the canvas.} } ] -The following example shows that @scheme[(run-simulation create-UFO-scene)] is +The following example shows that @racket[(run-simulation create-UFO-scene)] is a short-hand for three lines of code: @(begin #reader scribble/comment-reader -@schemeblock[ +@racketblock[ (define (create-UFO-scene height) (underlay/xy (rectangle 100 100 "solid" "white") 50 height UFO)) @@ -610,7 +610,7 @@ Second, we must translate the actions in our domain---the arrows in the @(begin #reader scribble/comment-reader -(schemeblock +(racketblock ;; tick : WorldState -> WorldState ;; deal with the passing of time (define (tick w) ...) @@ -675,10 +675,10 @@ data; to be precise, an S-expression is one of: @item{a char, or} @item{a list of S-expressions.} ] -Note the last clause includes @scheme[empty] of course. +Note the last clause includes @racket[empty] of course. @defproc[(sexp? [x any/c]) boolean?]{ - determines whether @scheme[x] is an @tech{S-expression}.} + determines whether @racket[x] is an @tech{S-expression}.} @subsection{Sending Messages} @@ -693,7 +693,7 @@ Each world-producing callback in a world program---those for handling clock predicate. @defproc[(package? [x any/c]) boolean?]{ - determine whether @scheme[x] is a @tech{Package}.} + determine whether @racket[x] is a @tech{Package}.} @defproc[(make-package [w any/c][m sexp?]) package?]{ create a @tech{Package} from a @tech{WorldState} and an @tech{S-expression}.} @@ -747,13 +747,13 @@ Messages are sent to the universe program, which runs on some computer in server. For now, we just need to know that it exists and that it is the recipient of messages. -@deftech{IP} @scheme[string?] +@deftech{IP} @racket[string?] Before a world program can send messages, it must register with the server. Registration must specify the internet address of the computer on which the server runs, also known as an @tech{IP} address or a host. Here a - @tech{IP} address is a string of the right shape, e.g., @scheme["192.168.1.1"] - or @scheme["www.google.com"]. + @tech{IP} address is a string of the right shape, e.g., @racket["192.168.1.1"] + or @racket["www.google.com"]. @defthing[LOCALHOST string?]{the @tech{IP} of your computer. Use it while you are developing a distributed program, especially while you are @@ -761,18 +761,18 @@ Before a world program can send messages, it must register with the appropriate manner. This is called @emph{integration testing} and differs from unit testing quite a bit.} -A @scheme[big-bang] description of a world program that wishes to communicate -with other programs must contain a @scheme[register] clause of one of the +A @racket[big-bang] description of a world program that wishes to communicate +with other programs must contain a @racket[register] clause of one of the following shapes: @itemize[ @item{ @defform[(register ip-expr) #:contracts ([ip-expr string?])]{ - connect this world to a universe server at the specified @scheme[ip-expr] + connect this world to a universe server at the specified @racket[ip-expr] address and set up capabilities for sending and receiving messages. If the world description includes a name specification of the form - @scheme[(name SomeString)] or @scheme[(name SomeSymbol)], the name of the + @racket[(name SomeString)] or @racket[(name SomeSymbol)], the name of the world is sent along to the server. }} ] @@ -788,17 +788,17 @@ Finally, the receipt of a message from the server is an event, just like applies the event handler that the world program specifies; if there is no clause, the message is discarded. -The @scheme[on-receive] clause of a @scheme[big-bang] specifies the event handler +The @racket[on-receive] clause of a @racket[big-bang] specifies the event handler for message receipts. @defform[(on-receive receive-expr) #:contracts ([receive-expr (-> (unsyntax @tech{WorldState}) sexp? (or/c (unsyntax @tech{WorldState}) package?))])]{ - tells DrRacket to call @scheme[receive-expr] for every message receipt, on the current + tells DrRacket to call @racket[receive-expr] for every message receipt, on the current @tech{WorldState} and the received message. The result of the call becomes the current @tech{WorldState}. - Because @scheme[receive-expr] is (or evaluates to) a world-transforming + Because @racket[receive-expr] is (or evaluates to) a world-transforming function, it too can produce a @tech{Package} instead of just a @tech{WorldState}. If the result is a @tech{Package}, its message content is sent to the @tech{server}.} @@ -877,7 +877,7 @@ Understanding the server's event handling functions demands several data universe. @defproc[(iworld? [x any/c]) boolean?]{ - determines whether @scheme[x] is an @emph{iworld}. Because the universe server + determines whether @racket[x] is an @emph{iworld}. Because the universe server represents worlds via structures that collect essential information about the connections, the teachpack does not export any constructor or selector functions on worlds.} @@ -895,7 +895,7 @@ Understanding the server's event handling functions demands several data The three sample iworlds are provided so that you can test your functions for universe programs. For example: -@schemeblock[ +@racketblock[ (check-expect (iworld=? iworld1 iworld2) false) (check-expect (iworld=? iworld2 iworld2) true) ] @@ -906,7 +906,7 @@ for universe programs. For example: and the list of @emph{iworld}s that are to be disconnected. @defproc[(bundle? [x any/c]) boolean?]{ - determines whether @scheme[x] is a @emph{bundle}.} + determines whether @racket[x] is a @emph{bundle}.} @defproc[(make-bundle [state any/c] [mails (listof mail?)] [low (listof iworld?)]) bundle?]{ creates a @emph{bundle} from a piece of data that @@ -919,7 +919,7 @@ A @emph{mail} represents a message from an event handler to a world. The teachpack provides only a predicate and a constructor for these structures: @defproc[(mail? [x any/c]) boolean?]{ - determines whether @scheme[x] is a @emph{mail}.} + determines whether @racket[x] is a @emph{mail}.} @defproc[(make-mail [to iworld?] [content sexp?]) mail?]{ creates a @emph{mail} from a @emph{iworld} and an @tech{S-expression}.} @@ -935,7 +935,7 @@ A @tech{server} keeps track of information about the @tech{universe} that a server tracks and how the information is represented depends on the situation and the programmer, just as with @tech{world} programs. -@deftech{UniverseState} @scheme[any/c] represents the server's state. For running +@deftech{UniverseState} @racket[any/c] represents the server's state. For running @tech{universe}s, the teachpack demands that you come up with a data definition for (your state of the) @tech{server}. Any piece of data can represent the state. We just assume that you introduce a data definition @@ -961,14 +961,14 @@ The @tech{server} itself is created with a description that includes the (check-with universe?-expr) ])]{ -creates a server with a given state, @scheme[state-expr]. The +creates a server with a given state, @racket[state-expr]. The behavior is specified via handler functions through mandatory and optional @emph{clause}s. These functions govern how the server deals with the registration of new worlds, how it disconnects worlds, how it sends messages from one world to the rest of the registered worlds, and how it renders its current state as a string.} -Evaluating a @scheme[universe] expression starts a server. Visually it opens +Evaluating a @racket[universe] expression starts a server. Visually it opens a console window on which you can see that worlds join, which messages are received from which world, and which messages are sent to which world. For convenience, the console also has two buttons: one for shutting down a @@ -976,8 +976,8 @@ Evaluating a @scheme[universe] expression starts a server. Visually it opens especially useful during the integration of the various pieces of a distributed program. -The mandatory clauses of a @scheme[universe] server description are -@scheme[on-new] and @scheme[on-msg]: +The mandatory clauses of a @racket[universe] server description are +@racket[on-new] and @racket[on-msg]: @itemize[ @@ -985,20 +985,20 @@ The mandatory clauses of a @scheme[universe] server description are @defform[(on-new new-expr) #:contracts ([new-expr (-> (unsyntax @tech{UniverseState}) iworld? bundle?)])]{ - tells DrRacket to call the function @scheme[new-expr] every time another world joins the + tells DrRacket to call the function @racket[new-expr] every time another world joins the universe. The event handler is called with the current state and the joining iworld, which isn't on the list yet. In particular, the handler may reject a @tech{world} program from participating in a @tech{universe}, - by simply including it in the resulting @scheme[bundle] structure (third field).} + by simply including it in the resulting @racket[bundle] structure (third field).} } @item{ @defform[(on-msg msg-expr) #:contracts ([msg-expr (-> (unsyntax @tech{UniverseState}) iworld? sexp? bundle?)])]{ - tells DrRacket to apply @scheme[msg-expr] to the current state of the + tells DrRacket to apply @racket[msg-expr] to the current state of the universe, the world - @scheme[w] that sent the message, and the message itself. + @racket[w] that sent the message, and the message itself. } }] All proper event handlers produce a @emph{bundle}. The state in the @@ -1025,22 +1025,22 @@ optional handlers: (on-tick tick-expr) #:contracts ([tick-expr (-> (unsyntax @tech{UniverseState}) bundle?)])]{ - tells DrRacket to apply @scheme[tick-expr] to the current state of the universe.} + tells DrRacket to apply @racket[tick-expr] to the current state of the universe.} @defform/none[#:literals (on-tick) (on-tick tick-expr rate-expr) #:contracts ([tick-expr (-> (unsyntax @tech{UniverseState}) bundle?)] [rate-expr (and/c real? positive?)])]{ - tells DrRacket to apply @scheme[tick-expr] as above; the clock ticks - every @scheme[rate-expr] seconds.} + tells DrRacket to apply @racket[tick-expr] as above; the clock ticks + every @racket[rate-expr] seconds.} } @item{ @defform[(on-disconnect dis-expr) #:contracts ([dis-expr (-> (unsyntax @tech{UniverseState}) iworld? bundle?)])]{ - tells DrRacket to invoke @scheme[dis-expr] every time a participating + tells DrRacket to invoke @racket[dis-expr] every time a participating @tech{world} drops its connection to the server. The first argument is the current state of the universe server, while the second argument is the (representation of the) world that got disconnected. The resulting @@ -1087,24 +1087,24 @@ In order to explore the workings of a universe, it is necessary to launch a @defform[(launch-many-worlds expression ...)]{ evaluates all sub-expressions in parallel. Typically each sub-expression - is an application of a function that evaluates a @scheme[big-bang] + is an application of a function that evaluates a @racket[big-bang] expression. When all worlds have stopped, the expression returns all final worlds in order.} Once you have designed a world program, add a function definition - concerning @scheme[big-bang] to the end of the tab: + concerning @racket[big-bang] to the end of the tab: @(begin #reader scribble/comment-reader -(schemeblock +(racketblock ;; String -> World (define (main n) (big-bang ... (name n) ...)) )) - Then in DrRacket's Interactions area, use @scheme[launch-many-worlds] + Then in DrRacket's Interactions area, use @racket[launch-many-worlds] to create several distinctively named worlds: @(begin #reader scribble/comment-reader -(schemeblock +(racketblock > (launch-many-worlds (main "matthew") (main "kathi") (main "h3")) @@ -1113,8 +1113,8 @@ Once you have designed a world program, add a function definition 33 )) The three worlds can then interact via a server. When all of them have - stopped, they produce the final states, here @scheme[10], @scheme[25], and - @scheme[33]. + stopped, they produce the final states, here @racket[10], @racket[25], and + @racket[33]. @; ----------------------------------------------------------------------------- @section[#:tag "universe-sample"]{A First Sample Universe} @@ -1233,18 +1233,18 @@ translates into the design of two functions with the following headers, @(begin #reader scribble/comment-reader -(schemeblock +(racketblock ;; Bundle is ;; (make-bundle UniverseState [Listof mail?] [Listof iworld?]) ;; UniverseState iworld? -> Bundle -;; next list of worlds when world @scheme[iw] is joining -;; the universe in state @scheme[s] +;; next list of worlds when world @racket[iw] is joining +;; the universe in state @racket[s] (define (add-world s iw) ...) ;; UniverseState iworld? W2U -> Bundle -;; next list of worlds when world @scheme[iw] is sending message @scheme[m] to -;; the universe in state @scheme[s] +;; next list of worlds when world @racket[iw] is sending message @racket[m] to +;; the universe in state @racket[s] (define (process s iw m) ...) )) @@ -1292,13 +1292,13 @@ The server should send messages to the first @emph{iworld} of its list as means that the turn is over. Just so that we don't confuse ourselves, we use two distinct symbols for these two messages: @itemize[ -@item{A @defterm{GoMessage} is @scheme['it-is-your-turn].} -@item{A @defterm{StopMessage} is @scheme['done].} +@item{A @defterm{GoMessage} is @racket['it-is-your-turn].} +@item{A @defterm{StopMessage} is @racket['done].} ] From the @tech{universe}'s perspective, each @tech{world} is in one of two states: @itemize[ -@item{A passive @tech{world} is @emph{resting}. We use @scheme['resting] for this state.} +@item{A passive @tech{world} is @emph{resting}. We use @racket['resting] for this state.} @item{An active @tech{world} is not resting. We delay choosing a representation for this part of a @tech{world}'s state until we design its ``local'' behavior.} ] @@ -1341,7 +1341,7 @@ The preceding subsection dictates that our server program starts like this: @(begin #reader scribble/comment-reader -[schemeblock +[racketblock ;; teachpack: universe.rkt ;; UniverseState is '* @@ -1358,18 +1358,18 @@ The preceding subsection dictates that our server program starts like this: @(begin #reader scribble/comment-reader -[schemeblock +[racketblock ;; Result is ;; (make-bundle [Listof iworld?] ;; (list (make-mail iworld? GoMessage)) ;; '()) ;; [Listof iworld?] iworld? -> Result -;; add world @scheme[iw] to the universe, when server is in state @scheme[u] +;; add world @racket[iw] to the universe, when server is in state @racket[u] (define (add-world u iw) ...) ;; [Listof iworld?] iworld? StopMessage -> Result -;; world @scheme[iw] sent message @scheme[m] when server is in state @scheme[u] +;; world @racket[iw] sent message @racket[m] when server is in state @racket[u] (define (switch u iw m) ...) ]) @@ -1383,7 +1383,7 @@ The second step of the design recipe calls for functional examples: @(begin #reader scribble/comment-reader -[schemeblock +[racketblock ;; an obvious example for adding a world: (check-expect (add-world '() world1) @@ -1400,8 +1400,8 @@ The second step of the design recipe calls for functional examples: ]) Note that our protocol analysis dictates this behavior for the two - functions. Also note how we use @scheme[world1], @scheme[world2], and - @scheme[world3] because the teachpack applies these event handlers to real + functions. Also note how we use @racket[world1], @racket[world2], and + @racket[world3] because the teachpack applies these event handlers to real worlds. Exercise: Create additional examples for the two functions based on our @@ -1414,7 +1414,7 @@ The protocol tells us that @emph{add-world} just adds the given @(begin #reader scribble/comment-reader -[schemeblock +[racketblock (define (add-world univ wrld) (local ((define univ* (append univ (list wrld)))) (make-bundle univ* @@ -1423,9 +1423,9 @@ The protocol tells us that @emph{add-world} just adds the given ]) Because @emph{univ*} contains at least @emph{wrld}, it is acceptable to -create a mail to @scheme[(first univ*)]. Of course, this same reasoning +create a mail to @racket[(first univ*)]. Of course, this same reasoning also implies that if @emph{univ} isn't empty, its first element is an -active world and is about to receive a second @scheme['it-is-your-turn] message. +active world and is about to receive a second @racket['it-is-your-turn] message. Similarly, the protocol says that when @emph{switch} is invoked because a @tech{world} program sends a message, the data representation of the @@ -1434,25 +1434,25 @@ Similarly, the protocol says that when @emph{switch} is invoked because a @(begin #reader scribble/comment-reader -[schemeblock +[racketblock (define (switch univ wrld m) (local ((define univ* (append (rest univ) (list (first univ))))) (make-bundle univ* (list (make-mail (first univ*) 'it-is-your-turn)) - '()))) + '()))) ]) As before, appending the first world to the end of the list guarantees that there is at least this one world on this list. It is therefore acceptable to create a mail for this world. -Start the server now. +Start the server now. + + @racketblock[(universe '() (on-new add-world) (on-msg switch))] - @schemeblock[(universe '() (on-new add-world) (on-msg switch))] - Exercise: The function definition simply assumes that @emph{wrld} is - @scheme[world=?] to @scheme[(first univ)] and that the received message - @emph{m} is @scheme['done]. Modify the function definition so that it + @racket[world=?] to @racket[(first univ)] and that the received message + @emph{m} is @racket['done]. Modify the function definition so that it checks these assumptions and raises an error signal if either of them is wrong. Start with functional examples. If stuck, re-read the section on checked functions from HtDP. (Note: in a @tech{universe} it is quite @@ -1464,7 +1464,7 @@ Exercise: The function definition simply assumes that @emph{wrld} is Exercise: An alternative state representation would equate @tech{UniverseState} with @emph{world} structures, keeping track of the active world. The list of world in the server would track the passive - worlds only. Design appropriate @scheme[add-world] and @scheme[switch] + worlds only. Design appropriate @racket[add-world] and @racket[switch] functions. @; ----------------------------------------------------------------------------- @@ -1479,12 +1479,12 @@ The final step is to design the ball @tech{world}. Recall that each world enumeration of two cases: @(begin #reader scribble/comment-reader -(schemeblock +(racketblock ;; teachpack: universe.rkt ;; WorldState is one of: ;; -- Number %% representing the @emph{y} coordinate -;; -- @scheme['resting] +;; -- @racket['resting] (define WORLD0 'resting) @@ -1499,7 +1499,7 @@ The communication protocol and the refined data definition of @tech{WorldState} @(begin #reader scribble/comment-reader -(schemeblock +(racketblock ;; WorldState GoMessage -> WorldResult ;; make sure the ball is moving @@ -1507,7 +1507,7 @@ The communication protocol and the refined data definition of @tech{WorldState} ;; WorldState -> WorldResult ;; move this ball upwards for each clock tick -;; or stay @scheme['resting] +;; or stay @racket['resting] (define (move w) ...) ;; WorldState -> Scene @@ -1522,13 +1522,13 @@ Let's design one function at a time, starting with @emph{receive}. Since @(begin #reader scribble/comment-reader -(schemeblock +(racketblock (check-expect (receive 'resting 'it-is-your-turn) HEIGHT) (check-expect (receive (- HEIGHT 1) 'it-is-your-turn) ...) )) Since there are two kinds of states, we make up at least two kinds of - examples: one for a @scheme['resting] state and another one for a numeric + examples: one for a @racket['resting] state and another one for a numeric state. The dots in the result part of the second unit test reveal the first ambiguity; specifically it isn't clear what the result should be when an active @tech{world} receives another message to activate itself. The @@ -1538,13 +1538,13 @@ Since there are two kinds of states, we make up at least two kinds of to @emph{receive}: @itemize[ -@item{@scheme[HEIGHT] when the ball is at the bottom of the scene;} -@item{@scheme[(- HEIGHT 1)] when the ball is properly inside the scene; and} -@item{@scheme[0] when the ball has hit the top of the scene.} +@item{@racket[HEIGHT] when the ball is at the bottom of the scene;} +@item{@racket[(- HEIGHT 1)] when the ball is properly inside the scene; and} +@item{@racket[0] when the ball has hit the top of the scene.} ] In the third case the function could produce three distinct results: - @scheme[0], @scheme['resting], or @scheme[(make-package 'resting + @racket[0], @racket['resting], or @racket[(make-package 'resting 'done)]. The first leaves things alone; the second turns the active @tech{world} into a resting one; the third does so, too, and tells the universe about this switch. @@ -1554,15 +1554,15 @@ We choose to design @emph{receive} so that it ignores the message and moves in a continuous fashion and that the @tech{world} remains active. Exercise: One alternative design is to move the ball back to the bottom of -the scene every time @scheme['it-is-your-turn] is received. Design this function, too. +the scene every time @racket['it-is-your-turn] is received. Design this function, too. @(begin #reader scribble/comment-reader -(schemeblock +(racketblock (define (receive w m) (cond - [(symbol? w) HEIGHT] ;; meaning: @scheme[(symbol=? w 'resting)] + [(symbol? w) HEIGHT] ;; meaning: @racket[(symbol=? w 'resting)] [else w])) )) @@ -1572,8 +1572,8 @@ the scene every time @scheme['it-is-your-turn] is received. Design this function @(begin #reader scribble/comment-reader -(schemeblock -; WorldState -> WorldState or @scheme[(make-package 'resting 'done)] +(racketblock +; WorldState -> WorldState or @racket[(make-package 'resting 'done)] ; move the ball if it is flying (check-expect (move 'resting) 'resting) @@ -1585,17 +1585,17 @@ the scene every time @scheme['it-is-your-turn] is received. Design this function )) Following HtDP again, the examples cover four typical situations: - @scheme['resting], two end points of the specified numeric interval, and + @racket['resting], two end points of the specified numeric interval, and one interior point. They tell us that @emph{move} leaves a passive @tech{world} alone and that it otherwise moves the ball until the @emph{y} coordinate - becomes @scheme[0]. In the latter case, the result is a package that + becomes @racket[0]. In the latter case, the result is a package that renders the @tech{world} passive and tells the server about it. Turning these thoughts into a complete definition is straightforward now: @(begin #reader scribble/comment-reader -(schemeblock +(racketblock (define (move x) (cond [(symbol? x) x] @@ -1605,7 +1605,7 @@ the scene every time @scheme['it-is-your-turn] is received. Design this function )) Exercise: what could happen if we had designed @emph{receive} so that it - produces @scheme['resting] when the state of the world is @scheme[0]? Use + produces @racket['resting] when the state of the world is @racket[0]? Use your answer to explain why you think it is better to leave this kind of state change to the tick event handler instead of the message receipt handler? @@ -1614,7 +1614,7 @@ Finally, here is the third function, which renders the state as a scene: @(begin #reader scribble/comment-reader -(schemeblock +(racketblock ; WorldState -> Scene ; render the state of the world as a scene @@ -1637,7 +1637,7 @@ Finally, here is the third function, which renders the state as a scene: @(begin #reader scribble/comment-reader -(schemeblock +(racketblock ; String -> (WorldState -> Scene) ; render the state of the world as a scene @@ -1662,10 +1662,10 @@ Finally, here is the third function, which renders the state as a scene: @tech{world}s that register with a @tech{server} on your computer: @(begin #reader scribble/comment-reader -(schemeblock +(racketblock ; String -> WorldState -; create and hook up a world with the @scheme[LOCALHOST] server +; create and hook up a world with the @racket[LOCALHOST] server (define (create-world n) (big-bang WORLD0 (on-receive receive) @@ -1675,7 +1675,7 @@ Finally, here is the third function, which renders the state as a scene: (register LOCALHOST))) )) - Now you can use @scheme[(create-world 'carl)] and @scheme[(create-world 'same)], + Now you can use @racket[(create-world 'carl)] and @racket[(create-world 'same)], respectively, to run two different worlds, after launching a @tech{server} first. diff --git a/collects/teachpack/htdp/scribblings/arrow-gui.scrbl b/collects/teachpack/htdp/scribblings/arrow-gui.scrbl index 8f29ab4b94..6c820e33f8 100644 --- a/collects/teachpack/htdp/scribblings/arrow-gui.scrbl +++ b/collects/teachpack/htdp/scribblings/arrow-gui.scrbl @@ -10,14 +10,14 @@ The teachpack provides operations for creating and manipulating an arrow GUI. We recommend using the @seclink["world"]{world teachpack} instead. -@deftech{modelT} @scheme[(-> button% event% true)] +@deftech{modelT} @racket[(-> button% event% true)] A @tech{modelT} is a function that accepts and ignores two arguments. @defproc[(control) symbol?]{Reads out the current state of the message field.} -@defproc[(view [s (or/c string? symbol?)]) true]{Displays @scheme[s] in the +@defproc[(view [s (or/c string? symbol?)]) true]{Displays @racket[s] in the message field.} @defproc[(connect [l (unsyntax @tech{modelT})][r (unsyntax @tech{modelT})][u (unsyntax @tech{modelT})][d (unsyntax @tech{modelT})]) true]{Connects four @@ -26,7 +26,7 @@ controllers with the four directions in the arrow window.} Example: @(begin #reader scribble/comment-reader -(schemeblock +(racketblock ;; Advanced (define (make-model dir) (lambda (b e) diff --git a/collects/teachpack/htdp/scribblings/arrow.scrbl b/collects/teachpack/htdp/scribblings/arrow.scrbl index 51e692671c..11334bea28 100644 --- a/collects/teachpack/htdp/scribblings/arrow.scrbl +++ b/collects/teachpack/htdp/scribblings/arrow.scrbl @@ -9,21 +9,21 @@ @defmodule[#:require-form beginner-require htdp/arrow] The teachpack implements a controller for moving shapes across a canvass. A -shape is a class of data for which @scheme[move] and @scheme[draw] +shape is a class of data for which @racket[move] and @racket[draw] operations can be drawn. @defproc[(control-left-right [shape Shape] [n number?] [move (-> number? Shape Shape)] - [draw (-> Shape true)]) true]{Moves shape @scheme[n] pixels left + [draw (-> Shape true)]) true]{Moves shape @racket[n] pixels left (negative) or right (positive).} @defproc[(control-up-down [shape Shape] [n number?] [move (-> number? Shape Shape)] - [draw (-> Shape true)]) true]{Moves shape @scheme[n] pixels up + [draw (-> Shape true)]) true]{Moves shape @racket[n] pixels up (negative) or down (positive).} @defproc[(control @@ -32,12 +32,12 @@ operations can be drawn. [move-lr (-> number? Shape Shape)] [move-ud (-> number? Shape Shape)] [draw (-> Shape true)]) true]{ -Moves shape @scheme[N] pixels left or right and up or down, respectively.} +Moves shape @racket[N] pixels left or right and up or down, respectively.} Example: @(begin #reader scribble/comment-reader -(schemeblock +(racketblock ;; A shape is a structure: ;; (make-posn num num) diff --git a/collects/teachpack/htdp/scribblings/convert.scrbl b/collects/teachpack/htdp/scribblings/convert.scrbl index b4156f4396..c611d4c03c 100644 --- a/collects/teachpack/htdp/scribblings/convert.scrbl +++ b/collects/teachpack/htdp/scribblings/convert.scrbl @@ -8,7 +8,7 @@ @;declare-exporting[teachpack/htdp/convert] @defmodule[#:require-form beginner-require htdp/convert] -The teachpack @scheme[convert.rkt] provides three functions for +The teachpack @racket[convert.rkt] provides three functions for converting Fahrenheit temperatures to Celsius. It is useful for a single exercise in HtDP. Its purpose is to demonstrate the independence of ``form'' (user interface) and ``function'' (also known as ``model''). @@ -25,26 +25,26 @@ converts the number according to the given temperature conversion function. A user can exit the loop by entering ``x.''} @defproc[(convert-file [in string?][convert (-> number? number?)][out string?]) true]{Consumes a -file name @scheme[in], a +file name @racket[in], a conversion function from Fahrenheit to Celsius, and a string -@scheme[out]. The program then reads all the number from -@scheme[in], converts them according to @scheme[convert], and prints the -results to the newly created file @scheme[out]. +@racket[out]. The program then reads all the number from +@racket[in], converts them according to @racket[convert], and prints the +results to the newly created file @racket[out]. -@bold{Warning}: If @scheme[out] already exists, it is deleted.} +@bold{Warning}: If @racket[out] already exists, it is deleted.} -Example: Create a file with name @scheme["in.dat"] with some numbers in +Example: Create a file with name @racket["in.dat"] with some numbers in it, using your favorite text editor on your computer. Define a function -@scheme[f2c] in the Definitions window and set teachpack to +@racket[f2c] in the Definitions window and set teachpack to @filepath{convert.rkt} and click Run. Then evaluate @(begin #reader scribble/comment-reader -(schemeblock +(racketblock (convert-gui f2c) ;; and (convert-file "in.dat" f2c "out.dat") ;; and (convert-repl f2c) )) -Finally inspect the file @scheme["out.dat"] and use the repl to check the +Finally inspect the file @racket["out.dat"] and use the repl to check the answers. diff --git a/collects/teachpack/htdp/scribblings/dir.scrbl b/collects/teachpack/htdp/scribblings/dir.scrbl index bfba50b41c..7577ca78d3 100644 --- a/collects/teachpack/htdp/scribblings/dir.scrbl +++ b/collects/teachpack/htdp/scribblings/dir.scrbl @@ -18,12 +18,12 @@ directories: @defstruct[file ([name symbol?][size integer?][content (listof char?)])]{} @defproc[(create-dir [path symbol?]) dir?]{ - Turns the directory found at @scheme[path] on your computer into an instance of @scheme[dir?].} + Turns the directory found at @racket[path] on your computer into an instance of @racket[dir?].} Sample: Set teachpack to @filepath{dir.rkt} and click Run: @(begin #reader scribble/comment-reader -(schemeblock +(racketblock > (create-dir ".") (make-dir '|.| diff --git a/collects/teachpack/htdp/scribblings/docs.scrbl b/collects/teachpack/htdp/scribblings/docs.scrbl index 5a659ee305..990cba54c5 100644 --- a/collects/teachpack/htdp/scribblings/docs.scrbl +++ b/collects/teachpack/htdp/scribblings/docs.scrbl @@ -29,7 +29,7 @@ Consumes a list of symbols and annotations and prints them out as a Sample session: set teachpack to @filepath{docs.rkt} and click Run: @(begin #reader scribble/comment-reader -(schemeblock +(racketblock > (annotation? 0) false > (annotation? ') diff --git a/collects/teachpack/htdp/scribblings/draw.scrbl b/collects/teachpack/htdp/scribblings/draw.scrbl index c6837418fe..3d5df4b52f 100644 --- a/collects/teachpack/htdp/scribblings/draw.scrbl +++ b/collects/teachpack/htdp/scribblings/draw.scrbl @@ -17,71 +17,71 @@ you to use the world teachpack instead; see @secref{world}.} @section[#:tag "drawing"]{Drawing on a Canvas} -@deftech{DrawColor}: @scheme[(and/c symbol? (one-of/c 'white 'yellow 'red 'blue 'green 'black))] +@deftech{DrawColor}: @racket[(and/c symbol? (one-of/c 'white 'yellow 'red 'blue 'green 'black))] These six colors are definitely provided. If you want other colors, -guess! For example, @scheme['orange] works, but @scheme['mauve] +guess! For example, @racket['orange] works, but @racket['mauve] doesn't. If you apply the function to a symbol that it doesn't recognize as a color, it raises an error. @defproc[(start [width number?][height number?]) true]{Opens a -@scheme[width] x @scheme[height] canvas.} +@racket[width] x @racket[height] canvas.} @defproc[(start/cartesian-plane [width number?][height number?]) true]{ -Opens a @scheme[width] x @scheme[height] canvas and draws a Cartesian +Opens a @racket[width] x @racket[height] canvas and draws a Cartesian plane.} @defproc[(stop) true]{Closes the canvas.} @defproc[(draw-circle [p posn?] [r number?] [c (unsyntax @tech{DrawColor})]) true]{ -Draws a @scheme[c] circle at @scheme[p] with radius @scheme[r].} +Draws a @racket[c] circle at @racket[p] with radius @racket[r].} @defproc[(draw-solid-disk [p posn?] [r number?] [c (unsyntax @tech{DrawColor})]) true]{ -Draws a @scheme[c] disk at @scheme[p] with radius @scheme[r].} +Draws a @racket[c] disk at @racket[p] with radius @racket[r].} @defproc[(draw-solid-rect [ul posn?] [width number?] [height number?] [c (unsyntax @tech{DrawColor})]) true]{ -Draws a @scheme[width] x @scheme[height], @scheme[c] rectangle with the -upper-left corner at @scheme[ul].} +Draws a @racket[width] x @racket[height], @racket[c] rectangle with the +upper-left corner at @racket[ul].} @defproc[(draw-solid-line [strt posn?] [end posn?] [c (unsyntax @tech{DrawColor})]) true]{ -Draws a @scheme[c] line from @scheme[strt] to @scheme[end].} +Draws a @racket[c] line from @racket[strt] to @racket[end].} @defproc[(draw-solid-string [p posn?] [s string?]) true]{ -Draws @scheme[s] at @scheme[p].} +Draws @racket[s] at @racket[p].} @defproc[(sleep-for-a-while [s number?]) true]{ -Suspends evaluation for @scheme[s] seconds.} +Suspends evaluation for @racket[s] seconds.} -The teachpack also provides @scheme[clear-] operations for each -@scheme[draw-] operation: +The teachpack also provides @racket[clear-] operations for each +@racket[draw-] operation: @defproc[(clear-circle [p posn?] [r number?] [c (unsyntax @tech{DrawColor})]) true]{ -clears a @scheme[c] circle at @scheme[p] with radius @scheme[r].} +clears a @racket[c] circle at @racket[p] with radius @racket[r].} @defproc[(clear-solid-disk [p posn?] [r number?] [c (unsyntax @tech{DrawColor})]) true]{ -clears a @scheme[c] disk at @scheme[p] with radius @scheme[r].} +clears a @racket[c] disk at @racket[p] with radius @racket[r].} @defproc[(clear-solid-rect [ul posn?] [width number?] [height number?] [c (unsyntax @tech{DrawColor})]) true]{ -clears a @scheme[width] x @scheme[height], @scheme[c] rectangle with the -upper-left corner at @scheme[ul].} +clears a @racket[width] x @racket[height], @racket[c] rectangle with the +upper-left corner at @racket[ul].} @defproc[(clear-solid-line [strt posn?] [end posn?] [c (unsyntax @tech{DrawColor})]) true]{ -clears a @scheme[c] line from @scheme[strt] to @scheme[end].} +clears a @racket[c] line from @racket[strt] to @racket[end].} @defproc[(clear-solid-string [p posn?] [s string?]) true]{ - clears @scheme[s] at @scheme[p].} + clears @racket[s] at @racket[p].} @defproc[(clear-all) true]{ clears the entire screen.} @@ -92,16 +92,16 @@ clears a @scheme[c] line from @scheme[strt] to @scheme[end].} @defproc[(wait-for-mouse-click) posn?]{ Waits for the user to click on the mouse, within the canvas.} -@deftech{DrawKeyEvent}: @scheme[(or/c char? symbol?)] A +@deftech{DrawKeyEvent}: @racket[(or/c char? symbol?)] A @tech{DrawKeyEvent} represents keyboard events: @itemize[ - @item{@scheme[char?], if the user pressed an alphanumeric key;} - @item{@scheme[symbol?], if the user pressed, for example, an arror key: - @scheme['up] @scheme['down] @scheme['left] @scheme['right]} + @item{@racket[char?], if the user pressed an alphanumeric key;} + @item{@racket[symbol?], if the user pressed, for example, an arror key: + @racket['up] @racket['down] @racket['left] @racket['right]} ] @defproc[(get-key-event) (or/c false (unsyntax @tech{DrawKeyEvent}))]{Checks whether the -user has pressed a key within the window; @scheme[false] if not.} +user has pressed a key within the window; @racket[false] if not.} @deftech{DrawWorld}: For proper interactions, using the teachpack requires that you provide a data definition for @tech{DrawWorld} . In @@ -111,13 +111,13 @@ user has pressed a key within the window; @scheme[false] if not.} The following functions allow programs to react to events from the canvas. @defproc[(big-bang [n number?] [w (unsyntax @tech{DrawWorld})]) true]{Starts the clock, one tick every -@scheme[n] (fractal) seconds; @scheme[w] becomes the first ``current'' world.} +@racket[n] (fractal) seconds; @racket[w] becomes the first ``current'' world.} @defproc[(on-key-event [change (-> (unsyntax @tech{DrawKeyEvent}) (unsyntax @tech{DrawWorld}) (unsyntax @tech{DrawWorld}))]) -true]{Adds @scheme[change] to the world. The function reacts to keyboard -events and creates a new @scheme[@#,tech{DrawWorld}].} +true]{Adds @racket[change] to the world. The function reacts to keyboard +events and creates a new @racket[@#,tech{DrawWorld}].} -@defproc[(on-tick-event [tock (-> (unsyntax @tech{DrawWorld}) (unsyntax @tech{DrawWorld}))]) true]{Adds @scheme[tock] +@defproc[(on-tick-event [tock (-> (unsyntax @tech{DrawWorld}) (unsyntax @tech{DrawWorld}))]) true]{Adds @racket[tock] to the world. The function reacts to clock tick events, creating a new current world.} diff --git a/collects/teachpack/htdp/scribblings/elevator.scrbl b/collects/teachpack/htdp/scribblings/elevator.scrbl index 5369d3cbdd..08c1bafaec 100644 --- a/collects/teachpack/htdp/scribblings/elevator.scrbl +++ b/collects/teachpack/htdp/scribblings/elevator.scrbl @@ -14,7 +14,7 @@ It displays an eight-floor elevator and accepts mouse clicks from the user, which are translated into service demands for the elevator. @defproc[(run [NextFloor number?]) any/c]{Creates an elevator simulator -that is controlled by @scheme[NextFloor]. This function consumes the +that is controlled by @racket[NextFloor]. This function consumes the current floor, the direction in which the elevator is moving, and the current demands. From that, it computes where to send the elevator next.} @@ -22,10 +22,10 @@ Example: Define a function that consumes the current state of the elevator (three arguments) and returns a number between 1 and 8. Here is a non-sensical definition: -@schemeblock[(define (controller x y z) 7)] +@racketblock[(define (controller x y z) 7)] It moves the elevator once, to the 7th floor. Second, set the teachpack to @filepath{elevator.rkt}, click Run, and evaluate -@schemeblock[(run controller)] +@racketblock[(run controller)] diff --git a/collects/teachpack/htdp/scribblings/graphing.scrbl b/collects/teachpack/htdp/scribblings/graphing.scrbl index ed238cb3b8..f779950a6f 100644 --- a/collects/teachpack/htdp/scribblings/graphing.scrbl +++ b/collects/teachpack/htdp/scribblings/graphing.scrbl @@ -13,10 +13,10 @@ The teachpack provides two operations for graphing functions in the regular directions): @defproc[(graph-fun [f (-> number? number?)][color symbol?]) true]{ -Draws the graph of @scheme[f] with the given @scheme[color].} +Draws the graph of @racket[f] with the given @racket[color].} @defproc[(graph-line [line (-> number? number?)][color symbol?]) true]{ -Draws @scheme[line], a function representing a straight line, with a given +Draws @racket[line], a function representing a straight line, with a given color.} For color symbols, see @secref{draw}. diff --git a/collects/teachpack/htdp/scribblings/guess-gui.scrbl b/collects/teachpack/htdp/scribblings/guess-gui.scrbl index b20188e942..5088cf8ec7 100644 --- a/collects/teachpack/htdp/scribblings/guess-gui.scrbl +++ b/collects/teachpack/htdp/scribblings/guess-gui.scrbl @@ -10,19 +10,19 @@ The teachpack provides three functions: @defproc[(control [index natural-number?]) symbol?]{ - reads out the @scheme[index]th guess choice, starting with 0} + reads out the @racket[index]th guess choice, starting with 0} @defproc[(view [msg (or/c string? symbol?)]) true/c]{ - displays its @scheme[msg] argument in the message panel} + displays its @racket[msg] argument in the message panel} @defproc[(connect [handler (-> button% event% true/c)]) true/c]{ - connects a controller (@scheme[handler]) with the Check button displays frame} + connects a controller (@racket[handler]) with the Check button displays frame} Example: @;% @(begin #reader scribble/comment-reader -(schemeblock +(racketblock (connect (lambda (e b) (begin (printf "0th digit: ~s~n" (control 0)) diff --git a/collects/teachpack/htdp/scribblings/guess.scrbl b/collects/teachpack/htdp/scribblings/guess.scrbl index 1617c8faf0..a2f007e5c7 100644 --- a/collects/teachpack/htdp/scribblings/guess.scrbl +++ b/collects/teachpack/htdp/scribblings/guess.scrbl @@ -14,30 +14,30 @@ some number of digits and then check the guess. The more advanced operations ask students to implement more of the game. @defproc[(guess-with-gui [check-guess (-> number? number? symbol?)]) true]{ -The @scheme[check-guess] function consumes two numbers: @scheme[guess], which -is the user's guess, and @scheme[target], which is the randomly +The @racket[check-guess] function consumes two numbers: @racket[guess], which +is the user's guess, and @racket[target], which is the randomly chosen number-to-be-guessed. The result is a symbol that reflects the relationship of the player's guess to the target.} @defproc[(guess-with-gui-3 [check-guess (-> digit? digit? digit? number? symbol?)]) true]{ -The @scheme[check-guess] function consumes three digits (@scheme[digit0], -@scheme[digit1], @scheme[digit2]) and one number (@scheme[target]). The +The @racket[check-guess] function consumes three digits (@racket[digit0], +@racket[digit1], @racket[digit2]) and one number (@racket[target]). The latter is the randomly chosen number-to-be-guessed; the three digits are the current guess. The result is a symbol that reflects the relationship of the player's guess (the digits converted to a number) to the target. -Note: @scheme[digit0] is the @emph{least} significant digit that -the user chose and @scheme[digit2] is the @emph{most} significant +Note: @racket[digit0] is the @emph{least} significant digit that +the user chose and @racket[digit2] is the @emph{most} significant one.} @defproc[(guess-with-gui-list [check-guess (-> (list-of digit?) number? symbol?)]) true]{ -The @scheme[check-guess] function consumes a list of digits -(@scheme[digits]) and a number (@scheme[target]). The former is a list +The @racket[check-guess] function consumes a list of digits +(@racket[digits]) and a number (@racket[target]). The former is a list that makes up the user's guess, and the latter is the randomly chosen number-to-be-guessed. The result is a symbol that reflects the relationship of the player's guess (the digits converted to a number) to the target. -Note: the first item on @scheme[digits] is the @emph{least} +Note: the first item on @racket[digits] is the @emph{least} significant digit that the user chose, and the last one is the @emph{most} significant digit.} diff --git a/collects/teachpack/htdp/scribblings/gui.scrbl b/collects/teachpack/htdp/scribblings/gui.scrbl index beef74f4e4..a5adc9cce8 100644 --- a/collects/teachpack/htdp/scribblings/gui.scrbl +++ b/collects/teachpack/htdp/scribblings/gui.scrbl @@ -19,31 +19,31 @@ window on your computer screen. component of a window on your computer screen. @defproc[(create-window [g (listof (listof (unsyntax @tech{GUI-ITEM})))]) Window]{ -Creates a window from the ``matrix'' of gui items @scheme[g].} +Creates a window from the ``matrix'' of gui items @racket[g].} @defproc[(window? [x any/c]) boolean?]{Is the given value a window?} -@defproc[(show-window [w Window]) true]{Shows @scheme[w].} +@defproc[(show-window [w Window]) true]{Shows @racket[w].} -@defproc[(hide-window [w window]) true]{Hides @scheme[w].} +@defproc[(hide-window [w window]) true]{Hides @racket[w].} @defproc[(make-button [label string>][callback (-> event% boolean)]) (unsyntax @tech{GUI-ITEM})]{Creates a -button with @scheme[label] and @scheme[callback] function. The latter +button with @racket[label] and @racket[callback] function. The latter receives an argument that it may safely ignore.} -@defproc[(make-message [msg string?]) (unsyntax @tech{GUI-ITEM})]{Creates a message item from @scheme[msg].} +@defproc[(make-message [msg string?]) (unsyntax @tech{GUI-ITEM})]{Creates a message item from @racket[msg].} -@defproc[(draw-message [g (unsyntax @tech{GUI-ITEM})][m string?]) true]{Displays @scheme[m] -in message item @scheme[g] and erases the current message.} +@defproc[(draw-message [g (unsyntax @tech{GUI-ITEM})][m string?]) true]{Displays @racket[m] +in message item @racket[g] and erases the current message.} @defproc[(make-text [txt string?]) (unsyntax @tech{GUI-ITEM})]{Creates an text editor (with -label @scheme[txt]) that allows users to enter text.} +label @racket[txt]) that allows users to enter text.} @defproc[(text-contents [g (unsyntax @tech{GUI-ITEM})]) string?]{ Determines the current contents of a text @tech{GUI-ITEM}.} @defproc[(make-choice [choices (listof string?)]) (unsyntax @tech{GUI-ITEM})]{ -Creates a choice menu from @scheme[choices] that permits users to choose +Creates a choice menu from @racket[choices] that permits users to choose from some alternatives.} @defproc[(choice-index [g (unsyntax @tech{GUI-ITEM})]) natural-number/c]{Determines the @@ -53,7 +53,7 @@ is the 0-based index in the choice menu} Example 1: @(begin #reader scribble/comment-reader -(schemeblock +(racketblock > (define w (create-window (list (list (make-button "QUIT" (lambda (e) (hide-window w))))))) @@ -66,7 +66,7 @@ Example 1: Example 2: @(begin #reader scribble/comment-reader -(schemeblock +(racketblock ;; text1 : GUI-ITEM (define text1 (make-text "Please enter your name")) diff --git a/collects/teachpack/htdp/scribblings/hangman.scrbl b/collects/teachpack/htdp/scribblings/hangman.scrbl index e12f598003..1e12704f37 100644 --- a/collects/teachpack/htdp/scribblings/hangman.scrbl +++ b/collects/teachpack/htdp/scribblings/hangman.scrbl @@ -22,9 +22,9 @@ manage the @emph{Hangman} game.} [draw-next-part (-> symbol? true)]) true]{ Chooses a ``secret'' word---a list of symbolic letters---and uses the given functions to manage the @emph{Hangman} game: -@scheme[reveal-for-list] determines how many times the chosen letter occurs +@racket[reveal-for-list] determines how many times the chosen letter occurs in the secret word; -@scheme[draw-next-part] is given the symbolic name of a body part and draws +@racket[draw-next-part] is given the symbolic name of a body part and draws it on a separately managed canvas. } diff --git a/collects/teachpack/htdp/scribblings/image.scrbl b/collects/teachpack/htdp/scribblings/image.scrbl index 8ecb43a210..e946928e57 100644 --- a/collects/teachpack/htdp/scribblings/image.scrbl +++ b/collects/teachpack/htdp/scribblings/image.scrbl @@ -13,15 +13,15 @@ shapes. Additional primitives allow for the composition of images. @;----------------------------------------------------------------------------- @section{Images} -@defproc[(image? [x any/c]) boolean?]{Is @scheme[x] an image?} +@defproc[(image? [x any/c]) boolean?]{Is @racket[x] an image?} -@defproc[(image=? [x image?] [y image?]) boolean?]{Are @scheme[x] and -@scheme[y] the same image?} +@defproc[(image=? [x image?] [y image?]) boolean?]{Are @racket[x] and +@racket[y] the same image?} @;----------------------------------------------------------------------------- @section[#:tag "modes-colors"]{Modes and Colors} -@deftech{Mode} @scheme[(one-of/c 'solid 'outline "solid" "outline")] +@deftech{Mode} @racket[(one-of/c 'solid 'outline "solid" "outline")] A @tech{Mode} is used to specify whether painting a shape fills or outlines the form. @@ -30,15 +30,15 @@ outlines the form. (green (and/c natural-number/c (<=/c 255))) (blue (and/c natural-number/c (<=/c 255)))]] -@deftech{RGB} @scheme[color?] +@deftech{RGB} @racket[color?] A @tech{RGB} describes a color via a shade of red, blue, and green colors - (e.g., @scheme[(make-color 100 200 30)]). + (e.g., @racket[(make-color 100 200 30)]). -@deftech{Color} @scheme[(or/c symbol? string? color?)] +@deftech{Color} @racket[(or/c symbol? string? color?)] -A @tech{Color} is a color-symbol (e.g., @scheme['blue]) or a color-string - (e.g., @scheme["blue"]) or an @tech{RGB} structure. +A @tech{Color} is a color-symbol (e.g., @racket['blue]) or a color-string + (e.g., @racket["blue"]) or an @tech{RGB} structure. @defproc[(image-color? [x any]) boolean?]{ Determines if the input is a valid image @tech{Color}.} @@ -51,46 +51,46 @@ instead whenever possible for insertions. In addition, you can create basic shapes with the following functions. @defproc[(rectangle [w (and/c number? (or/c zero? positive?))] [h (and/c number? (or/c zero? positive?))] [m (unsyntax @tech{Mode})] [c (unsyntax @tech{Color})]) image?]{ - Creates a @scheme[w] by @scheme[h] rectangle, filled in according to - @scheme[m] and painted in color @scheme[c]} + Creates a @racket[w] by @racket[h] rectangle, filled in according to + @racket[m] and painted in color @racket[c]} @defproc[(circle [r (and/c number? (or/c zero? positive?))] [m (unsyntax @tech{Mode})] [c (unsyntax @tech{Color})]) image?]{ - Creates a circle or disk of radius @scheme[r], filled in according to - @scheme[m] and painted in color @scheme[c]} + Creates a circle or disk of radius @racket[r], filled in according to + @racket[m] and painted in color @racket[c]} @defproc[(ellipse [w (and/c number? (or/c zero? positive?))] [h (and/c number? (or/c zero? positive?))] [m (unsyntax @tech{Mode})] [c (unsyntax @tech{Color})]) image?]{ - Creates a @scheme[w] by @scheme[h] ellipse, filled in according to - @scheme[m] and painted in color @scheme[c]} + Creates a @racket[w] by @racket[h] ellipse, filled in according to + @racket[m] and painted in color @racket[c]} @defproc[(triangle [s number?] [m (unsyntax @tech{Mode})] [c (unsyntax @tech{Color})]) image?]{ Creates an upward pointing equilateral - triangle whose side is @scheme[s] pixels long, filled in according to - @scheme[m] and painted in color @scheme[c]} + triangle whose side is @racket[s] pixels long, filled in according to + @racket[m] and painted in color @racket[c]} @defproc[(star [n (and/c number? (>=/c 2))] [outer (and/c number? (>=/c 1))] [inner (and/c number? (>=/c 1))] [m (unsyntax @tech{Mode})] [c (unsyntax @tech{Color})]) image?]{ - Creates a multi-pointed star with @scheme[n] points, an @scheme[outer] + Creates a multi-pointed star with @racket[n] points, an @racket[outer] radius for the max distance of the points to the center, and - an @scheme[inner] radius for the min distance to the center. } + an @racket[inner] radius for the min distance to the center. } @defproc[(regular-polygon [s side] [r number?] [m (unsyntax @tech{Mode})] [c (unsyntax @tech{Color})] [angle real? 0]) image?]{ -Creates a regular polygon with @scheme[s] sides inscribed in -a circle of radius @scheme[r], using mode @scheme[m] and -color @scheme[c]. If an angle is specified, the polygon is rotated by that +Creates a regular polygon with @racket[s] sides inscribed in +a circle of radius @racket[r], using mode @racket[m] and +color @racket[c]. If an angle is specified, the polygon is rotated by that angle. } @defproc[(line [x number?][y number?] [c (unsyntax @tech{Color})]) image?]{ - Creates a line colored @scheme[c] from (0,0) to @scheme[(x,y)]. - See @scheme[add-line] below. + Creates a line colored @racket[c] from (0,0) to @racket[(x,y)]. + See @racket[add-line] below. } @defproc[(text [s string?] [f (and/c number? positive?)] [c (unsyntax @tech{Color})]) Image]{ - Creates an image of the text @scheme[s] at point size @scheme[f] - and painted in color @scheme[c].} + Creates an image of the text @racket[s] at point size @racket[f] + and painted in color @racket[c].} @;----------------------------------------------------------------------------- @section[#:tag "properties"]{Basic Image Properties} @@ -99,37 +99,37 @@ To understand how images are manipulated, you need to understand the basic properties of images. @defproc[(image-width [i image?]) integer?]{ - Obtain @scheme[i]'s width in pixels} + Obtain @racket[i]'s width in pixels} @defproc[(image-height [i image?]) integer?]{ - Obtain @scheme[i]'s height in pixels} + Obtain @racket[i]'s height in pixels} For the composition of images, you must know about @emph{pinholes}. Each image, including primitive ones, come with a pinhole. For images created with the above primitives, the pinhole is at the center of the shape except -for those created from @scheme[line] and @scheme[text]. -The @scheme[text] function puts the pinhole at the upper left corner of -the image, and @scheme[line] puts the pinhole at the beginning of the line -(meaning that if the first two arguments to @scheme[line] are positive, +for those created from @racket[line] and @racket[text]. +The @racket[text] function puts the pinhole at the upper left corner of +the image, and @racket[line] puts the pinhole at the beginning of the line +(meaning that if the first two arguments to @racket[line] are positive, the pinhole is also in the upper left corner). The pinhole can be moved, of course, and compositions locate pinholes according to their own rules. When in doubt you can always find out where the pinhole is and place it where convenient. -@defproc[(pinhole-x [i image?]) integer?]{Determines the @scheme[x] +@defproc[(pinhole-x [i image?]) integer?]{Determines the @racket[x] coordinate of the pinhole, measuring from the left of the image.} -@defproc[(pinhole-y [i image?]) integer?]{Determines the @scheme[y] +@defproc[(pinhole-y [i image?]) integer?]{Determines the @racket[y] coordinate of the pinhole, measuring from the top (down) of the image.} @defproc[(put-pinhole [i image?] [x number?] [y number?]) image?]{ Creates a new image with the pinhole in the location specified by - @scheme[x] and @scheme[y], counting from the left and top (down), + @racket[x] and @racket[y], counting from the left and top (down), respectively.} @defproc[(move-pinhole [i image?] [delta-x number?] [delta-y number?]) image?]{ Creates a new image with the pinhole moved down and right by - @scheme[delta-x] and @scheme[delta-y] with respect to its current + @racket[delta-x] and @racket[delta-y] with respect to its current location. Use negative numbers to move it up or left.} @;----------------------------------------------------------------------------- @@ -143,10 +143,10 @@ Images can be composed, and images can be found within compositions. [x2 number?] [y2 number?] [c (unsyntax @tech{Color})]) image?]{ -Creates an image by adding a line (colored @scheme[c]) from -(@scheme[x1],@scheme[y1]) to -(@scheme[x2],@scheme[y2]) -to image @scheme[i].} +Creates an image by adding a line (colored @racket[c]) from +(@racket[x1],@racket[y1]) to +(@racket[x2],@racket[y2]) +to image @racket[i].} @defproc[(overlay [img image?] [img2 image?] [img* image?] ...) image?]{ Creates an image by overlaying all images on their pinholes. @@ -155,12 +155,12 @@ first image. } @defproc[(overlay/xy [img image?] [delta-x number?] [delta-y number?] [other image?]) image?]{ -Creates an image by adding the pixels of @scheme[other] to -@scheme[img]. +Creates an image by adding the pixels of @racket[other] to +@racket[img]. Instead of lining the two images up on their pinholes, -@scheme[other]'s pinhole is lined up on the point: -@schemeblock[ +@racket[other]'s pinhole is lined up on the point: +@racketblock[ (make-posn (+ (pinhole-x img) delta-x) (+ (pinhole-y img) delta-y)) ] @@ -169,8 +169,8 @@ The pinhole of the resulting image is the same place as the pinhole in the first image. The same effect can be had by combining -@scheme[move-pinhole] and @scheme[overlay], -@schemeblock[ +@racket[move-pinhole] and @racket[overlay], +@racketblock[ (overlay img (move-pinhole other (- delta-x) @@ -183,13 +183,13 @@ The same effect can be had by combining Be careful when using this function with jpeg images. If you use an image-editing program to crop a jpeg image and then save it, -@scheme[image-inside?] does not recognize the cropped image, due to +@racket[image-inside?] does not recognize the cropped image, due to standard compression applied to JPEG images.} @defproc[(find-image [img image?] [other image?]) posn?]{ Determines where the pixels of the second image appear in the first, with - respect to the pinhole of the first image. If @scheme[(image-inside? img - other)] isn't true, @scheme[find-image] signals an error.} + respect to the pinhole of the first image. If @racket[(image-inside? img + other)] isn't true, @racket[find-image] signals an error.} @;----------------------------------------------------------------------------- @section[#:tag "manipulation"]{Manipulating Images} @@ -198,22 +198,22 @@ Images can also be shrunk. These ``shrink'' functions trim an image by eliminating extraneous pixels. @defproc[(shrink-tl [img image?][width number?][height number?]) image?]{ -Shrinks the image to a @scheme[width] by @scheme[height] image, starting +Shrinks the image to a @racket[width] by @racket[height] image, starting from the @emph{top-left} corner. The pinhole of the resulting image is in the center of the image.} @defproc[(shrink-tr [img image?][width number?][height number?]) image?]{ -Shrinks the image to a @scheme[width] by @scheme[height] image, starting +Shrinks the image to a @racket[width] by @racket[height] image, starting from the @emph{top-right} corner. The pinhole of the resulting image is in the center of the image.} @defproc[(shrink-bl [img image?][width number?][height number?]) image?]{ -Shrinks the image to a @scheme[width] by @scheme[height] image, starting +Shrinks the image to a @racket[width] by @racket[height] image, starting from the @emph{bottom-left} corner. The pinhole of the resulting image is in the center of the image.} @defproc[(shrink-br [img image?][width number?][height number?]) image?]{ -Shrinks the image to a @scheme[width] by @scheme[height] image, starting +Shrinks the image to a @racket[width] by @racket[height] image, starting from the @emph{bottom-right} corner. The pinhole of the resulting image is in the center of the image.} @@ -226,43 +226,41 @@ directly on the pinhole is always saved.} @section[#:tag "scenes"]{Scenes} A @deftech{scene} is an image, but with the pinhole in the upper-left corner, i.e. -an image where @scheme[pinhole-x] and @scheme[pinhole-y] both return -@scheme[0]. +an image where @racket[pinhole-x] and @racket[pinhole-y] both return +@racket[0]. Scenes are particularly useful with the -@schememodname[2htdp/universe] -and -@schememodname[htdp/world] -teachpacks, since it displays only @tech{scene}s in its canvas. +@racketmodname[2htdp/universe] and @racketmodname[htdp/world] +teachpacks, since it displays only @tech{scene}s in its canvas. -@defproc[(scene? [x any/c]) boolean?]{Is @scheme[x] an scene?} +@defproc[(scene? [x any/c]) boolean?]{Is @racket[x] an scene?} @defproc[(empty-scene [width natural-number/c] [height natural-number/c]) scene?]{ - creates a plain white, @scheme[width] x @scheme[height] @tech{scene}.} + creates a plain white, @racket[width] x @racket[height] @tech{scene}.} @defproc[(place-image [img image?] [x number?] [y number?] [s scene?]) scene?]{ - creates a scene by placing @scheme[img] at - @math{(@scheme[x], @scheme[y])} into @scheme[s]; - @math{(@scheme[x], @scheme[y])} are computer graphics coordinates, + creates a scene by placing @racket[img] at + @math{(@racket[x], @racket[y])} into @racket[s]; + @math{(@racket[x], @racket[y])} are computer graphics coordinates, i.e., they count right and down from the upper-left corner.} @defproc[(nw:rectangle [width natural-number/c] [height natural-number/c] [solid-or-outline Mode] [c Color]) image?]{ - creates a @scheme[width] by @scheme[height] rectangle, solid or outlined as specified by - @scheme[solid-or-outline] and colored according to @scheme[c], with a pinhole at the upper left + creates a @racket[width] by @racket[height] rectangle, solid or outlined as specified by + @racket[solid-or-outline] and colored according to @racket[c], with a pinhole at the upper left corner.} @defproc[(scene+line [s scene?][x0 number?][y0 number?][x1 number?][y1 number?][c Color]) scene?]{ - creates a scene by placing a line of color @scheme[c] from - @math{(@scheme[x0], @scheme[y0])} to @math{(@scheme[x1], - @scheme[y1])} using computer graphics coordinates. In contrast to - the @scheme[add-line] function, @scheme[scene+line] cuts off those + creates a scene by placing a line of color @racket[c] from + @math{(@racket[x0], @racket[y0])} to @math{(@racket[x1], + @racket[y1])} using computer graphics coordinates. In contrast to + the @racket[add-line] function, @racket[scene+line] cuts off those portions of the line that go beyond the boundaries of the given - @scheme[s].} + @racket[s].} @;----------------------------------------------------------------------------- @section[#:tag "pixel-lists"]{Miscellaneous Image Manipulation and Creation} @@ -273,9 +271,9 @@ and converts a list of colors into an image. @defthing[List-of-color list?]{is one of:} @(begin #reader scribble/comment-reader -(schemeblock -;; -- @scheme[empty] -;; -- @scheme[(cons @#,tech{Color} List-of-color)] +(racketblock +;; -- @racket[empty] +;; -- @racket[(cons @#,tech{Color} List-of-color)] ;; Interpretation: represents a list of colors. )) @@ -287,8 +285,8 @@ and converts a list of colors into an image. [height natural-number/c] [x natural-number/c] [y natural-number/c]) image?]{ - Converts a list of colors @scheme[l] to an image with the given - @scheme[width] and @scheme[height] and pinhole (@scheme[x],@scheme[y]) + Converts a list of colors @racket[l] to an image with the given + @racket[width] and @racket[height] and pinhole (@racket[x],@racket[y]) coordinates, specified with respect to the top-left of the image.} The remaining functions provide alpha-channel information as well. Alpha @@ -311,6 +309,6 @@ indicates fully transparent. [height integer?] [x integer?] [y integer?]) image?]{ - Converts a list of @scheme[alpha-color]s @scheme[l] to an image with the given - @scheme[width] and @scheme[height] and pinhole (@scheme[x],@scheme[y]) + Converts a list of @racket[alpha-color]s @racket[l] to an image with the given + @racket[width] and @racket[height] and pinhole (@racket[x],@racket[y]) coordinates, specified with respect to the top-left of the image.} diff --git a/collects/teachpack/htdp/scribblings/lkup-gui.scrbl b/collects/teachpack/htdp/scribblings/lkup-gui.scrbl index 1bcb208bc1..818b8c1e27 100644 --- a/collects/teachpack/htdp/scribblings/lkup-gui.scrbl +++ b/collects/teachpack/htdp/scribblings/lkup-gui.scrbl @@ -9,19 +9,19 @@ The teachpack provides three functions: @defproc[(control [index natural-number?]) symbol?]{ - reads out the @scheme[index]th guess choice, starting with 0} + reads out the @racket[index]th guess choice, starting with 0} @defproc[(view [msg (or/c string? symbol?)]) true/c]{ - displays its @scheme[msg] argument in the message panel} + displays its @racket[msg] argument in the message panel} @defproc[(connect [event-handler (-> button% event% true/c)]) true/c]{ - connects a controller (@scheme[handler]) with the Check button displays frame} + connects a controller (@racket[handler]) with the Check button displays frame} Example: @;% @(begin #reader scribble/comment-reader -(schemeblock +(racketblock (connect (lambda (e b) (view (control)))) diff --git a/collects/teachpack/htdp/scribblings/master.scrbl b/collects/teachpack/htdp/scribblings/master.scrbl index a709ab3e5d..7c08594651 100644 --- a/collects/teachpack/htdp/scribblings/master.scrbl +++ b/collects/teachpack/htdp/scribblings/master.scrbl @@ -16,9 +16,9 @@ places were correct. @defproc[(master [check-guess (-> symbol? symbol? symbol? symbol? boolean?)]) symbol?]{ Chooses two ``secret'' colors and then opens a graphical user interface for playing @emph{MasterMind}. The player is prompted to choose two colors, via -a choice tablet and mouse clicks. Once chosen, @scheme[master] uses -@scheme[check-guess] to compare them. +a choice tablet and mouse clicks. Once chosen, @racket[master] uses +@racket[check-guess] to compare them. If the two guesses completely match the two secret colors, -@scheme[check-guess] must return @scheme['PerfectGuess]; otherwise it must +@racket[check-guess] must return @racket['PerfectGuess]; otherwise it must return a different, informative symbol.} diff --git a/collects/teachpack/htdp/scribblings/matrix.scrbl b/collects/teachpack/htdp/scribblings/matrix.scrbl index d6a7101e40..a6b29018f5 100644 --- a/collects/teachpack/htdp/scribblings/matrix.scrbl +++ b/collects/teachpack/htdp/scribblings/matrix.scrbl @@ -29,22 +29,22 @@ elements of the list are lists of equal (non-zero) length. determines whether the given object is a matrix?} @defproc[(matrix-rows [m matrix?]) natural-number/c]{ -determines how many rows this matrix @scheme[m] has} +determines how many rows this matrix @racket[m] has} @defproc[(matrix-cols [m matrix?]) natural-number/c]{ -determines ow many columns this matrix @scheme[m] has} +determines ow many columns this matrix @racket[m] has} @defproc[(rectangle->matrix [r (unsyntax @tech{Rectangle})]) matrix?]{ creates a matrix from the given @tech{Rectangle}} @defproc[(matrix->rectangle [m matrix?]) (unsyntax @tech{Rectangle})]{ -creates a rectangle from this matrix @scheme[m]} +creates a rectangle from this matrix @racket[m]} @defproc[(make-matrix [n natural-number/c][m natural-number/c][l (Listof X)]) matrix?]{ -creates an @scheme[n] by @scheme[m] matrix from @scheme[l] +creates an @racket[n] by @racket[m] matrix from @racket[l] -NOTE: @scheme[make-matrix] would consume an optional number of entries, if -it were like @scheme[make-vector]} +NOTE: @racket[make-matrix] would consume an optional number of entries, if +it were like @racket[make-vector]} @defproc[(build-matrix [n natural-number/c][m natural-number/c] @@ -52,31 +52,31 @@ it were like @scheme[make-vector]} (and/c natural-number/c ( any/c boolean?)]) (listof posn?)]{ -@scheme[(matrix-where? M P)] produces a list of @scheme[(make-posn i j)] -such that @scheme[(P (matrix-ref M i j))] holds} +@racket[(matrix-where? M P)] produces a list of @racket[(make-posn i j)] +such that @racket[(P (matrix-ref M i j))] holds} @defproc[(matrix-render [m matrix?]) (unsyntax @tech{Rectangle})]{ -renders this matrix @scheme[m] as a rectangle of strings} +renders this matrix @racket[m] as a rectangle of strings} @defproc[(matrix-minor [m matrix?][i (and/c natural-number/c ( natural-number/c scene)]) true]{ - creates and shows a canvas of width @scheme[w] and height @scheme[h] , - starts a clock, making it tick every @scheme[r] (usually fractional) - seconds. Every time the clock ticks, drscheme applies @scheme[create-image] to + creates and shows a canvas of width @racket[w] and height @racket[h] , + starts a clock, making it tick every @racket[r] (usually fractional) + seconds. Every time the clock ticks, drscheme applies @racket[create-image] to the number of ticks passed since this function call. The results of these applications are displayed in the canvas. } Example: -@schemeblock[ +@racketblock[ (define (create-UFO-scene height) (place-image UFO 50 height (empty-scene 100 100))) @@ -87,9 +87,9 @@ An animation starts from a given ``world'' and generates new ones in Your program may deal with such events via the @emph{installation} of @emph{handlers}. The teachpack provides for the installation of three - event handlers: @scheme[on-tick-event], @scheme[on-key-event], and - @scheme[on-mouse-event]. In addition, it provides for the installation of - a @scheme[draw] handler, which is called every time your program should + event handlers: @racket[on-tick-event], @racket[on-key-event], and + @racket[on-mouse-event]. In addition, it provides for the installation of + a @racket[draw] handler, which is called every time your program should visualize the current world. The following picture provides an intuitive overview of the workings of @@ -97,12 +97,12 @@ The following picture provides an intuitive overview of the workings of @image["world.png"] - The @scheme[big-bang] function installs @emph{World_0} as the initial + The @racket[big-bang] function installs @emph{World_0} as the initial world; the callbacks @emph{tock}, @emph{react}, and @emph{click} transform one world into another one; @emph{done} checks each time whether the world is final; and @emph{draw} renders each world as a scene. -@deftech{World} @scheme[any/c] +@deftech{World} @racket[any/c] For animated worlds and games, using the teachpack requires that you provide a data definition for @tech{World}. In principle, there are no @@ -113,42 +113,42 @@ The following picture provides an intuitive overview of the workings of [(big-bang [width natural-number/c] [height natural-number/c] [r number?] [world0 (unsyntax @tech{World})]) true] [(big-bang [width natural-number/c] [height natural-number/c] [r number?] [world0 (unsyntax @tech{World})][animated-gif? boolean?]) true] )]{ - Creates and displays a @scheme[width] x @scheme[height] canvas, + Creates and displays a @racket[width] x @racket[height] canvas, starts the clock, - makes it tick every @scheme[r] seconds, - and makes @scheme[world0] the current world. + makes it tick every @racket[r] seconds, + and makes @racket[world0] the current world. If it is called with five instead of four arguments and the last one - (@scheme[animated-gif?]) is @scheme[true], the teachpack allows the + (@racket[animated-gif?]) is @racket[true], the teachpack allows the generation of images from the animation, including an animated GIF image. } @defproc[(on-tick-event [tock (-> (unsyntax @tech{World}) (unsyntax @tech{World}))]) true]{ - Tell DrRacket to call @scheme[tock] on the current world every time the + Tell DrRacket to call @racket[tock] on the current world every time the clock ticks. The result of the call becomes the current world.} -@deftech{KeyEvent} @scheme[(or/c char? symbol?)] +@deftech{KeyEvent} @racket[(or/c char? symbol?)] A @tech{KeyEvent} represents key board events, e.g., keys pressed or - released, by the computer's user. A @scheme[char?] @tech{KeyEvent} is + released, by the computer's user. A @racket[char?] @tech{KeyEvent} is used to signal that the user has hit an alphanumeric key. Symbols such - as @scheme['left], @scheme['right], @scheme['up], @scheme['down], - @scheme['release] denote arrow keys or special events, such as releasing + as @racket['left], @racket['right], @racket['up], @racket['down], + @racket['release] denote arrow keys or special events, such as releasing the key on the keypad. @defproc[(key-event? [x any]) boolean?]{ - is @scheme[x] a @tech{KeyEvent}} + is @racket[x] a @tech{KeyEvent}} @defproc[(key=? [x key-event?][y key-event?]) boolean?]{ compares two @tech{KeyEvent} for equality} @defproc[(on-key-event [change (-> (unsyntax @tech{World}) key-event? (unsyntax @tech{World}))]) true]{ - Tell DrRacket to call @scheme[change] on the current world and a + Tell DrRacket to call @racket[change] on the current world and a @tech{KeyEvent} for every keystroke the user of the computer makes. The result of the call becomes the current world. Here is a typical key-event handler: @(begin #reader scribble/comment-reader -(schemeblock +(racketblock (define (change w a-key-event) (cond [(key=? a-key-event 'left) (world-go w -DELTA)] @@ -161,30 +161,30 @@ A @tech{KeyEvent} represents key board events, e.g., keys pressed or } -@deftech{MouseEvent} @scheme[(one-of/c 'button-down 'button-up 'drag 'move 'enter 'leave)] +@deftech{MouseEvent} @racket[(one-of/c 'button-down 'button-up 'drag 'move 'enter 'leave)] A @tech{MouseEvent} represents mouse events, e.g., mouse movements or mouse clicks, by the computer's user. @defproc[(on-mouse-event [clack (-> (unsyntax @tech{World}) natural-number/c natural-number/c (unsyntax @tech{MouseEvent}) (unsyntax @tech{World}))]) true]{ - Tell DrRacket to call @scheme[clack] on the current world, the current - @scheme[x] and @scheme[y] coordinates of the mouse, and a + Tell DrRacket to call @racket[clack] on the current world, the current + @racket[x] and @racket[y] coordinates of the mouse, and a @tech{MouseEvent} for every action of the mouse by the user of the computer. The result of the call becomes the current world.} -@defproc[(on-redraw [to-scene (-> (unsyntax @tech{World}) (unsyntax @tech{Scene}))]) true]{ Tell DrRacket to call @scheme[to-scene] +@defproc[(on-redraw [to-scene (-> (unsyntax @tech{World}) (unsyntax @tech{Scene}))]) true]{ Tell DrRacket to call @racket[to-scene] whenever the canvas must be redrawn. The canvas is usually re-drawn after a tick event, a keyboard event, or a mouse event has occurred. The generated scene is displayed in the world's canvas.} @defproc[(stop-when [last-world? (-> (unsyntax @tech{World}) boolean?)]) true]{ - Tell DrRacket to call @scheme[last-world?] whenever the canvas is - drawn. If this call produces @scheme[true], the clock is stopped; no more + Tell DrRacket to call @racket[last-world?] whenever the canvas is + drawn. If this call produces @racket[true], the clock is stopped; no more tick events, @tech{KeyEvent}s, or @tech{MouseEvent}s are forwarded to the respective handlers. As a result, the canvas isn't updated either.} -Example: The following examples shows that @scheme[(run-simulation 100 100 +Example: The following examples shows that @racket[(run-simulation 100 100 (/ 1 28) create-UFO-scene)] is a short-hand for three lines of code: -@schemeblock[ +@racketblock[ (define (create-UFO-scene height) (place-image UFO 50 height (empty-scene 100 100))) @@ -272,19 +272,19 @@ Second, we must translate the "world" actions---the arrows in the above @(begin #reader scribble/comment-reader -(schemeblock +(racketblock ;; tick : @tech{D} -> @tech{D} ;; deal with the passing of time (define (tick w) ...) -;; click : @tech{D} @scheme[Number] @scheme[Number] @tech{MouseEvent} -> @tech{D} -;; deal with a mouse click at (x,y) of kind @scheme[me] -;; in the current world @scheme[w] +;; click : @tech{D} @racket[Number] @racket[Number] @tech{MouseEvent} -> @tech{D} +;; deal with a mouse click at (x,y) of kind @racket[me] +;; in the current world @racket[w] (define (click w x y me) ...) ;; control : @tech{D} @tech{KeyEvent} -> @tech{D} -;; deal with a key event (symbol, char) @scheme[ke] -;; in the current world @scheme[w] +;; deal with a key event (symbol, char) @racket[ke] +;; in the current world @racket[w] (define (control w ke) ...) )) @@ -309,12 +309,12 @@ Our first and immediate goal is to represent the world as data. In this @(begin #reader scribble/comment-reader -(schemeblock +(racketblock ;; DATA DEF. ;; The state of the door (SD) is one of: -;; -- @scheme['locked] -;; -- @scheme['closed] -;; -- @scheme['open] +;; -- @racket['locked] +;; -- @racket['closed] +;; -- @racket['open] )) Symbols are particularly well-suited here because they directly express @@ -327,9 +327,9 @@ Now that we have a data definition, we must also decide which computer function that simulates time. For the other three arrows, we could use either keyboard events or mouse clicks or both. Our solution uses three keystrokes: -@scheme[#\u] for unlocking the door, -@scheme[#\l] for locking it, and -@scheme[#\space] for pushing it open. +@racket[#\u] for unlocking the door, +@racket[#\l] for locking it, and +@racket[#\space] for pushing it open. We can express these choices graphically by translating the above "state machine" from the world of information into the world of data: @@ -342,22 +342,22 @@ Our analysis and data definition leaves us with three functions to design: @itemize[ -@item{@scheme[automatic-closer], which closes the time during one tick;} +@item{@racket[automatic-closer], which closes the time during one tick;} -@item{@scheme[door-actions], which manipulates the time in response to +@item{@racket[door-actions], which manipulates the time in response to pressing a key; and} -@item{@scheme[render], which translates the current state of the door into +@item{@racket[render], which translates the current state of the door into a visible scene.} ] -Let's start with @scheme[automatic-closer]. We know its contract and it is +Let's start with @racket[automatic-closer]. We know its contract and it is easy to refine the purpose statement, too: @(begin #reader scribble/comment-reader -(schemeblock +(racketblock ;; automatic-closer : SD -> SD ;; closes an open door over the period of one tick (define (automatic-closer state-of-door) ...) @@ -375,7 +375,7 @@ easy to refine the purpose statement, too: @(begin #reader scribble/comment-reader -(schemeblock +(racketblock ;; automatic-closer : SD -> SD ;; closes an open door over the period of one tick @@ -390,7 +390,7 @@ easy to refine the purpose statement, too: @(begin #reader scribble/comment-reader -(schemeblock +(racketblock (define (automatic-closer state-of-door) (cond [(symbol=? 'locked state-of-door) ...] @@ -403,7 +403,7 @@ easy to refine the purpose statement, too: @(begin #reader scribble/comment-reader -(schemeblock +(racketblock (define (automatic-closer state-of-door) (cond [(symbol=? 'locked state-of-door) 'locked] @@ -419,7 +419,7 @@ For the remaining three arrows of the diagram, we design a function that @(begin #reader scribble/comment-reader -(schemeblock +(racketblock ;; door-actions : SD Keyevent -> SD ;; key events simulate actions on the door (define (door-actions s k) ...) @@ -438,7 +438,7 @@ For the remaining three arrows of the diagram, we design a function that From here, it is straightforward to turn this into a complete design: -@schemeblock[ +@racketblock[ (define (door-actions s k) (cond [(and (symbol=? 'locked s) (key=? #\u k)) 'closed] @@ -459,16 +459,16 @@ this purpose: @(begin #reader scribble/comment-reader -(schemeblock -;; render : @tech{SD} -> @scheme[Scene] +(racketblock +;; render : @tech{SD} -> @racket[Scene] ;; translate the current state of the door into a large text (define (render s) (text (symbol->string s) 40 'red)) (check-expecy (render 'closed) (text "closed" 40 'red)) )) - The function @scheme[symbol->string] translates a symbol into a string, - which is needed because @scheme[text] can deal only with the latter, not + The function @racket[symbol->string] translates a symbol into a string, + which is needed because @racket[text] can deal only with the latter, not the former. A look into the language documentation revealed that this conversion function exists, and so we use it. @@ -478,7 +478,7 @@ which function takes care of tick events, key events, and redraws: @(begin #reader scribble/comment-reader -(schemeblock +(racketblock (big-bang 100 100 1 'locked) (on-tick-event automatic-closer) (on-key-event door-actions) diff --git a/collects/test-box-recovery/test-box-recovery.scrbl b/collects/test-box-recovery/test-box-recovery.scrbl index 2d1cc9d1f5..ad8eb5fa57 100644 --- a/collects/test-box-recovery/test-box-recovery.scrbl +++ b/collects/test-box-recovery/test-box-recovery.scrbl @@ -8,12 +8,12 @@ The text-box recovery tool allows DrRacket or DrScheme v370 and later to read programs created using v360 and earlier that include test-case boxes. When opened using this tool, test-case boxes are turned into -@scheme[check-expect] forms. +@racket[check-expect] forms. Test boxes plain-text tests and expected results are converted to -plain-text @scheme[check-expect] forms. +plain-text @racket[check-expect] forms. If either the test or expected-result expression contains non-text (e.g., an image), the converted form is a comment box containing a -@scheme[check-expect] form. The box should be easy to remove using the +@racket[check-expect] form. The box should be easy to remove using the @menuitem["Racket" "Uncomment"] menu item in DrRacket. diff --git a/collects/trace/scribblings/trace.scrbl b/collects/trace/scribblings/trace.scrbl index 14e1103972..c38917656c 100644 --- a/collects/trace/scribblings/trace.scrbl +++ b/collects/trace/scribblings/trace.scrbl @@ -17,21 +17,21 @@ depth of the continuation. @itemize[ @item{Throw away @filepath{.zo} versions of your source} @item{Prefix your program with - @schemeblock[(require trace)] + @racketblock[(require trace)] perhaps by starting @exec{racket} with @commandline{racket -l trace ...} before arguments to load your program.} @item{Run your program} ] -The @schememodname[trace] module is odd; don't import it -into another module. Instead, the @schememodname[trace] +The @racketmodname[trace] module is odd; don't import it +into another module. Instead, the @racketmodname[trace] module is meant to be invoked from the top-level, so that it can install an evaluation handler, exception handler, etc. -To reuse parts of the code of @schememodname[trace], import -@schememodname[trace/calltrace-lib]. It contains all of the bindings -described here, but it but does not set the @scheme[current-eval] +To reuse parts of the code of @racketmodname[trace], import +@racketmodname[trace/calltrace-lib]. It contains all of the bindings +described here, but it but does not set the @racket[current-eval] parameter. @; ---------------------------------------- @@ -39,21 +39,21 @@ parameter. @section{Installing Calltrace} @defmodule[trace]{Invoking the -@schememodname[trace] module sets the evaluation handler -(via @scheme[current-eval]) to instrument Racket source code.} +@racketmodname[trace] module sets the evaluation handler +(via @racket[current-eval]) to instrument Racket source code.} - NOTE: @schememodname[trace] has no effect on code loaded as + NOTE: @racketmodname[trace] has no effect on code loaded as compiled byte code (i.e., from a @filepath{.zo} file) or native code (i.e., from a @filepath{.dll}, @filepath{.so}, or @filepath{.dylib} file). Calltrace's instrumentation can be explicitly disabled via the -@scheme[instrumenting-enabled] parameter. Instrumentation is on by -default. The @scheme[instrumenting-enabled] parameter affects only the +@racket[instrumenting-enabled] parameter. Instrumentation is on by +default. The @racket[instrumenting-enabled] parameter affects only the way that source code is compiled, not the way that exception information is reported. -Do not load @schememodname[trace] before writing +Do not load @racketmodname[trace] before writing @filepath{.zo} files. Calltrace instruments S-expressions with unprintable values; this works fine if the instrumented S-expression is passed to the default eval handler, but neither the S-expression @@ -64,8 +64,8 @@ nor its byte-code form can be marshalled to a string. @section{Calltrace Library} @defmodule[trace/calltrace-lib]{The -@schememodname[trace/calltrace-lib] module provides functions that -implement @scheme[trace].} +@racketmodname[trace/calltrace-lib] module provides functions that +implement @racket[trace].} @defboolparam[instrumenting-enabled on?]{ @@ -74,15 +74,15 @@ enabled.} @defproc[(calltrace-eval-handler [e any/c]) any]{ -A procedure suitable for use with @scheme[current-eval], which +A procedure suitable for use with @racket[current-eval], which instruments expressions for Calltrace output (when instrumentation is -not disabled via @scheme[instrumenting-enabled]). +not disabled via @racket[instrumenting-enabled]). -Requiring @scheme[trace] installs this procedure as the -value for @scheme[current-eval].} +Requiring @racket[trace] installs this procedure as the +value for @racket[current-eval].} @defproc[(annotate [e any/c]) syntax?]{ -Instruments the expression @scheme[e] with Calltrace support. This -function is normally used by @scheme[calltrace-eval-handler].} +Instruments the expression @racket[e] with Calltrace support. This +function is normally used by @racket[calltrace-eval-handler].} diff --git a/collects/typed-scheme/scribblings/utils.rkt b/collects/typed-scheme/scribblings/utils.rkt index 13bf90781f..ab158a8c18 100644 --- a/collects/typed-scheme/scribblings/utils.rkt +++ b/collects/typed-scheme/scribblings/utils.rkt @@ -4,23 +4,23 @@ (provide (all-defined-out)) (define (item* header . args) (apply item @bold[header]{: } args)) -(define-syntax-rule (tmod forms ...) (schememod typed-scheme forms ...)) +(define-syntax-rule (tmod forms ...) (racketmod typed-scheme forms ...)) (define (gtech . x) (apply tech x #:doc '(lib "scribblings/guide/guide.scrbl"))) (define (rtech . x) (apply tech x #:doc '(lib "scribblings/reference/reference.scrbl"))) -(define ** (let ([* #f]) @scheme[*])) +(define ** (let ([* #f]) @racket[*])) (define-syntax-rule (annvar x t) - (make-element #f (list @schemeparenfont["#{"] - @scheme[x : t] - @schemeparenfont["}"]))) + (make-element #f (list @racketparenfont["#{"] + @racket[x : t] + @racketparenfont["}"]))) (define-syntax-rule (annexpr x t) - (make-element #f (list @schemeparenfont["#{"] - @scheme[x :: t] - @schemeparenfont["}"]))) + (make-element #f (list @racketparenfont["#{"] + @racket[x :: t] + @racketparenfont["}"]))) (define-syntax-rule (defalias id1 id2) @defidform[id1]{An alias for @racket[id2].}) diff --git a/collects/unstable/scribblings/contract.scrbl b/collects/unstable/scribblings/contract.scrbl index f0ea33378d..87a26fed3d 100644 --- a/collects/unstable/scribblings/contract.scrbl +++ b/collects/unstable/scribblings/contract.scrbl @@ -98,14 +98,14 @@ or default value may be used. @defthing[nat/c flat-contract?]{ This contract recognizes natural numbers that satisfy -@scheme[exact-nonnegative-integer?]. +@racket[exact-nonnegative-integer?]. } @defthing[pos/c flat-contract?]{ This contract recognizes positive integers that satisfy -@scheme[exact-positive-integer?]. +@racket[exact-positive-integer?]. } @@ -121,22 +121,22 @@ that accept arbitrary truth values that may not be booleans. @defproc[(syntax-datum/c [datum/c any/c]) flat-contract?]{ -Recognizes syntax objects @scheme[stx] such that @scheme[(syntax->datum stx)] -satisfies @scheme[datum/c]. +Recognizes syntax objects @racket[stx] such that @racket[(syntax->datum stx)] +satisfies @racket[datum/c]. } @defproc[(syntax-listof/c [elem/c any/c]) flat-contract?]{ -Recognizes syntax objects @scheme[stx] such that @scheme[(syntax->list stx)] -satisfies @scheme[(listof elem/c)]. +Recognizes syntax objects @racket[stx] such that @racket[(syntax->list stx)] +satisfies @racket[(listof elem/c)]. } @defproc[(syntax-list/c [elem/c any/c] ...) flat-contract?]{ -Recognizes syntax objects @scheme[stx] such that @scheme[(syntax->list stx)] -satisfies @scheme[(list/c elem/c ...)]. +Recognizes syntax objects @racket[stx] such that @racket[(syntax->list stx)] +satisfies @racket[(list/c elem/c ...)]. } @@ -161,12 +161,12 @@ respectively, and produce a single result. These contracts recognize predicates: functions of a single argument that produce a boolean result. -The first constrains its output to satisfy @scheme[boolean?]. Use -@scheme[predicate/c] in positive position for predicates that guarantee a result -of @scheme[#t] or @scheme[#f]. +The first constrains its output to satisfy @racket[boolean?]. Use +@racket[predicate/c] in positive position for predicates that guarantee a result +of @racket[#t] or @racket[#f]. -The second constrains its output to satisfy @scheme[truth/c]. Use -@scheme[predicate-like/c] in negative position for predicates passed as +The second constrains its output to satisfy @racket[truth/c]. Use +@racket[predicate-like/c] in negative position for predicates passed as arguments that may return arbitrary values as truth values. } @@ -179,12 +179,12 @@ arguments that may return arbitrary values as truth values. These contracts recognize comparisons: functions of two arguments that produce a boolean result. -The first constrains its output to satisfy @scheme[boolean?]. Use -@scheme[comparison/c] in positive position for comparisons that guarantee a -result of @scheme[#t] or @scheme[#f]. +The first constrains its output to satisfy @racket[boolean?]. Use +@racket[comparison/c] in positive position for comparisons that guarantee a +result of @racket[#t] or @racket[#f]. -The second constrains its output to satisfy @scheme[truth/c]. Use -@scheme[comparison-like/c] in negative position for comparisons passed as +The second constrains its output to satisfy @racket[truth/c]. Use +@racket[comparison-like/c] in negative position for comparisons passed as arguments that may return arbitrary values as truth values. } @@ -192,10 +192,10 @@ arguments that may return arbitrary values as truth values. @defproc[(sequence/c [elem/c contract?] ...) contract?]{ Wraps a @tech[#:doc '(lib "scribblings/reference/reference.scrbl")]{sequence}, -obligating it to produce as many values as there are @scheme[elem/c] contracts, -and obligating each value to satisfy the corresponding @scheme[elem/c]. The +obligating it to produce as many values as there are @racket[elem/c] contracts, +and obligating each value to satisfy the corresponding @racket[elem/c]. The result is not guaranteed to be the same kind of sequence as the original value; -for instance, a wrapped list is not guaranteed to satisfy @scheme[list?]. +for instance, a wrapped list is not guaranteed to satisfy @racket[list?]. @defexamples[ #:eval the-eval @@ -211,10 +211,10 @@ for instance, a wrapped list is not guaranteed to satisfy @scheme[list?]. @defproc[(dict/c [key/c contract?] [value/c contract?]) contract?]{ Wraps a @tech[#:doc '(lib "scribblings/reference/reference.scrbl")]{dictionary}, -obligating its keys to satisfy @scheme[key/c] and their corresponding values to -satisfy @scheme[value/c]. The result is not guaranteed to be the same kind of +obligating its keys to satisfy @racket[key/c] and their corresponding values to +satisfy @racket[value/c]. The result is not guaranteed to be the same kind of dictionary as the original value; for instance, a wrapped hash table is not -guaranteed to satisfy @scheme[hash?]. +guaranteed to satisfy @racket[hash?]. @defexamples[ #:eval the-eval @@ -227,10 +227,10 @@ guaranteed to satisfy @scheme[hash?]. ] @emph{Warning:} Bear in mind that key and value contracts are re-wrapped on -every dictionary operation, and dictionaries wrapped in @scheme[dict/c] multiple +every dictionary operation, and dictionaries wrapped in @racket[dict/c] multiple times will perform the checks as many times for each operation. Especially for immutable dictionaries (which may be passed through a constructor that involves -@scheme[dict/c] on each update), contract-wrapped dictionaries may be much less +@racket[dict/c] on each update), contract-wrapped dictionaries may be much less efficient than the original dictionaries. } diff --git a/collects/unstable/scribblings/debug.scrbl b/collects/unstable/scribblings/debug.scrbl index 8420bcafc2..347278629d 100644 --- a/collects/unstable/scribblings/debug.scrbl +++ b/collects/unstable/scribblings/debug.scrbl @@ -20,7 +20,7 @@ information. (code:line #:source srcloc-expr)]) ]{ -Writes debugging information about the evaluation of @scheme[expr] to the +Writes debugging information about the evaluation of @racket[expr] to the current error port. The name and source location of the expression may be overridden by keyword options; their defaults are the syntactic form of the expression and its syntactic source location, respectively. @@ -36,9 +36,9 @@ expression and its syntactic source location, respectively. @defproc[(dprintf [fmt string?] [arg any/c] ...) void?]{ -Constructs a message in the same manner as @scheme[format] and writes it to -@scheme[(current-error-port)], with indentation reflecting the number of nested -@scheme[debug] forms. +Constructs a message in the same manner as @racket[format] and writes it to +@racket[(current-error-port)], with indentation reflecting the number of nested +@racket[debug] forms. @examples[#:eval the-eval (dprintf "level: ~a" 0) @@ -53,7 +53,7 @@ Constructs a message in the same manner as @scheme[format] and writes it to ([argument argument-expr (code:line argument-keyword argument-expr)]) ]{ -Logs debugging information for @scheme[(#%app function-expr argument ...)], +Logs debugging information for @racket[(#%app function-expr argument ...)], including the evaluation and results of the function and each argument. @examples[#:eval the-eval @@ -86,12 +86,12 @@ including the evaluation and results of the function and each argument. @defform[(parameterize/debug ([param-expr value-expr] ...) body ...+)] )]{ -These macros add logging based on @scheme[debug] to the evaluation of -expressions in @scheme[begin], @scheme[define], @scheme[define/private], -@scheme[define/public], @scheme[define/override], @scheme[define/augment], -@scheme[let], @scheme[let*], @scheme[letrec], @scheme[let-values], -@scheme[let*-values], @scheme[letrec-values], @scheme[with-syntax], -@scheme[with-syntax*], and @scheme[parameterize]. +These macros add logging based on @racket[debug] to the evaluation of +expressions in @racket[begin], @racket[define], @racket[define/private], +@racket[define/public], @racket[define/override], @racket[define/augment], +@racket[let], @racket[let*], @racket[letrec], @racket[let-values], +@racket[let*-values], @racket[letrec-values], @racket[with-syntax], +@racket[with-syntax*], and @racket[parameterize]. } diff --git a/collects/unstable/scribblings/define.scrbl b/collects/unstable/scribblings/define.scrbl index 23225004c0..e381580b94 100644 --- a/collects/unstable/scribblings/define.scrbl +++ b/collects/unstable/scribblings/define.scrbl @@ -18,7 +18,7 @@ Provides macros for creating and manipulating definitions. @defform[(at-end expr)]{ -When used at the top level of a module, evaluates @scheme[expr] at the end of +When used at the top level of a module, evaluates @racket[expr] at the end of the module. This can be useful for calling functions before their definitions. @defexamples[ @@ -47,9 +47,9 @@ the module. This can be useful for calling functions before their definitions. @defform[(define-syntaxes-if-unbound [x ...] e)] )]{ -Define each @scheme[x] (or @scheme[f]) if no such binding exists, or +Define each @racket[x] (or @racket[f]) if no such binding exists, or do nothing if the name(s) is(are) already bound. The -@scheme[define-values-if-unbound] and @scheme[define-syntaxes-if-unbound] forms +@racket[define-values-if-unbound] and @racket[define-syntaxes-if-unbound] forms raise a syntax error if some of the given names are bound and some are not. These are useful for writing programs that are portable across versions of @@ -76,8 +76,8 @@ y Establishes a @tech[#:doc '(lib "scribblings/reference/reference.scrbl")]{rename transformer} -for each @scheme[new] identifier, redirecting it to the corresponding -@scheme[old] identifier. +for each @racket[new] identifier, redirecting it to the corresponding +@racket[old] identifier. @defexamples[ #:eval the-eval @@ -103,9 +103,9 @@ forward references, that may be used at the Racket top level. @defform[(define-with-parameter name parameter)]{ -Defines the form @scheme[name] as a shorthand for setting the parameter -@scheme[parameter]. Specifically, @scheme[(name value body ...)] is equivalent -to @scheme[(parameterize ([parameter value]) body ...)]. +Defines the form @racket[name] as a shorthand for setting the parameter +@racket[parameter]. Specifically, @racket[(name value body ...)] is equivalent +to @racket[(parameterize ([parameter value]) body ...)]. @defexamples[ #:eval the-eval @@ -117,10 +117,10 @@ to @scheme[(parameterize ([parameter value]) body ...)]. @defform[(define-single-definition define-one-name define-many-name)]{ -Defines a marco @scheme[define-one-name] as a single identifier -definition form with function shorthand like @scheme[define] and -@scheme[define-syntax], based on an existing macro @scheme[define-many-name] -which works like @scheme[define-values] or @scheme[define-syntaxes]. +Defines a marco @racket[define-one-name] as a single identifier +definition form with function shorthand like @racket[define] and +@racket[define-syntax], based on an existing macro @racket[define-many-name] +which works like @racket[define-values] or @racket[define-syntaxes]. @defexamples[ #:eval the-eval @@ -170,7 +170,7 @@ definitions. Subsumes the behavior of @racket[define-syntax-set]. @defform[(in-phase1 e)]{ -Executes @scheme[e] during phase 1 (the syntax transformation phase) +Executes @racket[e] during phase 1 (the syntax transformation phase) relative to its context, during pass 1 if it occurs in a head expansion position. @@ -178,7 +178,7 @@ position. @defform[(in-phase1/pass2 e)]{ -Executes @scheme[e] during phase 1 (the syntax transformation phase) +Executes @racket[e] during phase 1 (the syntax transformation phase) relative to its context, during pass 2 (after head expansion). } diff --git a/collects/unstable/scribblings/dict.scrbl b/collects/unstable/scribblings/dict.scrbl index 383d08f1af..e188372f1d 100644 --- a/collects/unstable/scribblings/dict.scrbl +++ b/collects/unstable/scribblings/dict.scrbl @@ -14,7 +14,7 @@ This module provides tools for manipulating dictionary values. @defproc[(dict-empty? [d dict?]) boolean?]{ -Reports whether @scheme[d] is empty (has no keys). +Reports whether @racket[d] is empty (has no keys). @defexamples[ #:eval the-eval @@ -34,11 +34,11 @@ Reports whether @scheme[d] is empty (has no keys). (lambda (k a b) (combine a b))]) (and/c dict? dict-can-functional-set?)]{ -Computes the union of @scheme[d0] with each dictionary @scheme[d] by functional -update, adding each element of each @scheme[d] to @scheme[d0] in turn. For each -key @scheme[k] and value @scheme[v], if a mapping from @scheme[k] to some value -@scheme[v0] already exists, it is replaced with a mapping from @scheme[k] to -@scheme[(combine/key k v0 v)]. +Computes the union of @racket[d0] with each dictionary @racket[d] by functional +update, adding each element of each @racket[d] to @racket[d0] in turn. For each +key @racket[k] and value @racket[v], if a mapping from @racket[k] to some value +@racket[v0] already exists, it is replaced with a mapping from @racket[k] to +@racket[(combine/key k v0 v)]. @defexamples[ #:eval the-eval @@ -60,11 +60,11 @@ key @scheme[k] and value @scheme[v], if a mapping from @scheme[k] to some value (lambda (k a b) (combine a b))]) void?]{ -Computes the union of @scheme[d0] with each dictionary @scheme[d] by mutable -update, adding each element of each @scheme[d] to @scheme[d0] in turn. For each -key @scheme[k] and value @scheme[v], if a mapping from @scheme[k] to some value -@scheme[v0] already exists, it is replaced with a mapping from @scheme[k] to -@scheme[(combine/key k v0 v)]. +Computes the union of @racket[d0] with each dictionary @racket[d] by mutable +update, adding each element of each @racket[d] to @racket[d0] in turn. For each +key @racket[k] and value @racket[v], if a mapping from @racket[k] to some value +@racket[v0] already exists, it is replaced with a mapping from @racket[k] to +@racket[(combine/key k v0 v)]. @defexamples[ #:eval the-eval diff --git a/collects/unstable/scribblings/exn.scrbl b/collects/unstable/scribblings/exn.scrbl index 225d05e289..4b54b634a6 100644 --- a/collects/unstable/scribblings/exn.scrbl +++ b/collects/unstable/scribblings/exn.scrbl @@ -27,13 +27,13 @@ @defform[(try expr ...+)]{ -Executes the first expression @scheme[expr] in the sequence, producing its +Executes the first expression @racket[expr] in the sequence, producing its result value(s) if it returns any. If it raises an exception instead, -@scheme[try] continues with the next @scheme[expr]. Exceptions raised by +@racket[try] continues with the next @racket[expr]. Exceptions raised by intermediate expressions are reported to the @tech[#:doc '(lib -"scribblings/reference/reference.scrbl")]{current logger} at the @scheme['debug] +"scribblings/reference/reference.scrbl")]{current logger} at the @racket['debug] level before continuing. Exceptions raised by the final expression are not -caught by @scheme[try]. +caught by @racket[try]. @defexamples[ #:eval the-eval diff --git a/collects/unstable/scribblings/function.scrbl b/collects/unstable/scribblings/function.scrbl index 05cd91b286..c70ae9d9d6 100644 --- a/collects/unstable/scribblings/function.scrbl +++ b/collects/unstable/scribblings/function.scrbl @@ -18,9 +18,9 @@ This module provides tools for higher-order programming and creating functions. @defproc[((negate [f (-> A ... boolean?)]) [x A] ...) boolean?]{ -Negates the results of @scheme[f]; equivalent to @scheme[(not (f x ...))]. +Negates the results of @racket[f]; equivalent to @racket[(not (f x ...))]. -This function is reprovided from @schememodname[scheme/function]. +This function is reprovided from @racketmodname[scheme/function]. @defexamples[ #:eval the-eval @@ -33,8 +33,8 @@ This function is reprovided from @schememodname[scheme/function]. @defproc[((conjoin [f (-> A ... boolean?)] ...) [x A] ...) boolean?]{ -Combines calls to each function with @scheme[and]. Equivalent to -@scheme[(and (f x ...) ...)] +Combines calls to each function with @racket[and]. Equivalent to +@racket[(and (f x ...) ...)] @defexamples[ #:eval the-eval @@ -49,8 +49,8 @@ Combines calls to each function with @scheme[and]. Equivalent to @defproc[((disjoin [f (-> A ... boolean?)] ...) [x A] ...) boolean?]{ -Combines calls to each function with @scheme[or]. Equivalent to -@scheme[(or (f x ...) ...)] +Combines calls to each function with @racket[or]. Equivalent to +@racket[(or (f x ...) ...)] @defexamples[ #:eval the-eval @@ -67,8 +67,8 @@ Combines calls to each function with @scheme[or]. Equivalent to @defproc[(call [f (-> A ... B)] [x A] ...) B]{ -Passes @scheme[x ...] to @scheme[f]. Keyword arguments are allowed. Equivalent -to @scheme[(f x ...)]. Useful for application in higher-order contexts. +Passes @racket[x ...] to @racket[f]. Keyword arguments are allowed. Equivalent +to @racket[(f x ...)]. Useful for application in higher-order contexts. @defexamples[ #:eval the-eval @@ -93,11 +93,11 @@ to @scheme[(f x ...)]. Useful for application in higher-order contexts. @defproc[(papplyr [f (A ... B ... -> C)] [x B] ...) (A ... -> C)] )]{ -The @scheme[papply] and @scheme[papplyr] functions partially apply @scheme[f] to -@scheme[x ...], which may include keyword arguments. They obey the following +The @racket[papply] and @racket[papplyr] functions partially apply @racket[f] to +@racket[x ...], which may include keyword arguments. They obey the following equations: -@schemeblock[ +@racketblock[ ((papply f x ...) y ...) = (f x ... y ...) ((papplyr f x ...) y ...) = (f y ... x ...) ] @@ -125,15 +125,15 @@ equations: (An ... -> ooo -> A1 ... -> B)] )]{ -@emph{Note:} The @scheme[ooo] above denotes a loosely associating ellipsis. +@emph{Note:} The @racket[ooo] above denotes a loosely associating ellipsis. -The @scheme[curryn] and @scheme[currynr] functions construct a curried version -of @scheme[f], specialized at @scheme[x ...], that produces a result after -@scheme[n] further applications. Arguments at any stage of application may +The @racket[curryn] and @racket[currynr] functions construct a curried version +of @racket[f], specialized at @racket[x ...], that produces a result after +@racket[n] further applications. Arguments at any stage of application may include keyword arguments, so long as no keyword is duplicated. These curried functions obey the following equations: -@schemeblock[ +@racketblock[ (curryn 0 f x ...) = (f x ...) ((curryn (+ n 1) f x ...) y ...) = (curryn n f x ... y ...) @@ -141,10 +141,10 @@ functions obey the following equations: ((currynr (+ n 1) f x ...) y ...) = (currynr n f y ... x ...) ] -The @scheme[call], @scheme[papply], and @scheme[papplyr] utilities are related -to @scheme[curryn] and @scheme[currynr] in the following manner: +The @racket[call], @racket[papply], and @racket[papplyr] utilities are related +to @racket[curryn] and @racket[currynr] in the following manner: -@schemeblock[ +@racketblock[ (call f x ...) = (curryn 0 f x ...) = (currynr 0 f x ...) (papply f x ...) = (curryn 1 f x ...) (papplyr f x ...) = (currynr 1 f x ...) @@ -185,12 +185,12 @@ to @scheme[curryn] and @scheme[currynr] in the following manner: @defform[(eta f)]{ -Produces a function equivalent to @scheme[f], except that @scheme[f] is +Produces a function equivalent to @racket[f], except that @racket[f] is evaluated every time it is called. This is useful for function expressions that may be run, but not called, before -@scheme[f] is defined. The @scheme[eta] expression will produce a function -without evaluating @scheme[f]. +@racket[f] is defined. The @racket[eta] expression will produce a function +without evaluating @racket[f]. @defexamples[ #:eval the-eval @@ -204,11 +204,11 @@ f @defform[(eta* f x ...)]{ -Produces a function equivalent to @scheme[f], with argument list @scheme[x ...]. -In simple cases, this is equivalent to @scheme[(lambda (x ...) (f x ...))]. +Produces a function equivalent to @racket[f], with argument list @racket[x ...]. +In simple cases, this is equivalent to @racket[(lambda (x ...) (f x ...))]. Optional (positional or keyword) arguments are not allowed. -This macro behaves similarly to @scheme[eta], but produces a function with +This macro behaves similarly to @racket[eta], but produces a function with statically known arity which may improve efficiency and error reporting. @defexamples[ @@ -230,12 +230,12 @@ f [param-arg-spec id [id default-expr] [id #:param param-expr]]) ]{ -Constructs a function much like @scheme[lambda], except that some optional +Constructs a function much like @racket[lambda], except that some optional arguments correspond to the value of a parameter. For each clause of the form -@scheme[[id #:param param-expr]], @scheme[param-expr] must evaluate to a value -@scheme[param] satisfying @scheme[parameter?]. The default value of the -argument @scheme[id] is @scheme[(param)]; @scheme[param] is bound to @scheme[id] -via @scheme[parameterize] during the function call. +@racket[[id #:param param-expr]], @racket[param-expr] must evaluate to a value +@racket[param] satisfying @racket[parameter?]. The default value of the +argument @racket[id] is @racket[(param)]; @racket[param] is bound to @racket[id] +via @racket[parameterize] during the function call. @defexamples[ #:eval the-eval diff --git a/collects/unstable/scribblings/gui/language-level.scrbl b/collects/unstable/scribblings/gui/language-level.scrbl index 51686ab3fa..8a67e79181 100644 --- a/collects/unstable/scribblings/gui/language-level.scrbl +++ b/collects/unstable/scribblings/gui/language-level.scrbl @@ -12,7 +12,7 @@ @defthing[language-level@ unit?]{ -This unit imports @scheme[drracket:tool^] and exports @scheme[language-level^]. +This unit imports @racket[drracket:tool^] and exports @racket[language-level^]. } @@ -32,9 +32,9 @@ This unit imports @scheme[drracket:tool^] and exports @scheme[language-level^]. (is-a?/c drracket:language:language<%>)]{ Constructs a language level as an instance of -@scheme[drracket:language:language<%>] with the given @scheme[name] based on the -language defined by the module at @scheme[path]. Applies -@scheme[(drracket:language:get-default-mixin)] and the given @scheme[mixin]s to +@racket[drracket:language:language<%>] with the given @racket[name] based on the +language defined by the module at @racket[path]. Applies +@racket[(drracket:language:get-default-mixin)] and the given @racket[mixin]s to @sigelem[language-level^ simple-language-level%] to construct the class, and uses the optional keyword arguments to fill in the language's description and reader. @@ -47,7 +47,7 @@ reader. (implementation?/c drracket:language:simple-module-based-language<%>))]{ Equal to -@scheme[ +@racket[ (drracket:language:module-based-language->language-mixin (drracket:language:simple-module-based-language->module-based-language-mixin drracket:language:simple-module-based-language%))]. @@ -59,9 +59,9 @@ Equal to (make-mixin-contract drracket:language:language<%>)]{ Produces a mixin that overrides @method[drracket:language:language<%> -render-value/format] to apply @scheme[to-sexp] to each value before printing it, -and to skip @scheme[void?] values (pre-transformation) if @scheme[show-void?] is -@scheme[#f]. +render-value/format] to apply @racket[to-sexp] to each value before printing it, +and to skip @racket[void?] values (pre-transformation) if @racket[show-void?] is +@racket[#f]. } @@ -69,8 +69,8 @@ and to skip @scheme[void?] values (pre-transformation) if @scheme[show-void?] is (make-mixin-contract drracket:language:language<%>)]{ Produces a mixin that augments @method[drracket:language:language<%> -capability-value] to look up each key in @scheme[dict], producing the -corresponding value if the key is found and deferring to @scheme[inner] +capability-value] to look up each key in @racket[dict], producing the +corresponding value if the key is found and deferring to @racket[inner] otherwise. } @@ -105,7 +105,7 @@ This mixin enables the macro stepper for its language level. (make-mixin-contract drracket:language:language<%>)]{ This mixin overrides @method[drracket:language:language<%> on-execute] to set up -the @scheme[check-expect] test engine to a language level similarly to the HtDP +the @racket[check-expect] test engine to a language level similarly to the HtDP teaching languages. } @@ -124,12 +124,12 @@ get-reader-module], @method[drracket:language:language<%> get-metadata], @method[drracket:language:language<%> metadata->settings], and @method[drracket:language:language<%> get-metadata-lines]. -The resulting language level uses the reader from @scheme[reader-module], and is +The resulting language level uses the reader from @racket[reader-module], and is recognized in files that start with a reader directive for that module path -within the first @scheme[meta-lines] lines. Metadata about the language's +within the first @racket[meta-lines] lines. Metadata about the language's settings is marshalled between a string and a usable value (based on a default -value) by @scheme[meta->settings], and between a usable value for a current -module (with a symbolic name) by @scheme[settings->meta]. +value) by @racket[meta->settings], and between a usable value for a current +module (with a symbolic name) by @racket[settings->meta]. } diff --git a/collects/unstable/scribblings/gui/slideshow.scrbl b/collects/unstable/scribblings/gui/slideshow.scrbl index 9047d293d3..4e3c32c23e 100644 --- a/collects/unstable/scribblings/gui/slideshow.scrbl +++ b/collects/unstable/scribblings/gui/slideshow.scrbl @@ -14,14 +14,14 @@ @defform[(with-size size expr)]{ -Sets @scheme[current-font-size] to @scheme[size] while running @scheme[expr]. +Sets @racket[current-font-size] to @racket[size] while running @racket[expr]. } @defform[(with-scale scale expr)]{ -Multiplies @scheme[current-font-size] by @scheme[scale] while running -@scheme[expr]. +Multiplies @racket[current-font-size] by @racket[scale] while running +@racket[expr]. } @@ -30,21 +30,21 @@ Multiplies @scheme[current-font-size] by @scheme[scale] while running @defform[(small text)] )]{ -Scale @scheme[current-font-size] by @scheme[3/2] or @scheme[2/3], respectively, -while running @scheme[text]. +Scale @racket[current-font-size] by @racket[3/2] or @racket[2/3], respectively, +while running @racket[text]. } @defform[(with-font font expr)]{ -Sets @scheme[current-main-font] to @scheme[font] while running @scheme[expr]. +Sets @racket[current-main-font] to @racket[font] while running @racket[expr]. } @defform[(with-style style expr)]{ -Adds @scheme[style] to @scheme[current-main-font] (via @scheme[cons]) while -running @scheme[expr]. +Adds @racket[style] to @racket[current-main-font] (via @racket[cons]) while +running @racket[expr]. } @@ -57,7 +57,7 @@ running @scheme[expr]. )]{ Adds the attributes for bold, italic, superscript, subscript, or small caps -text, respectively, to @scheme[current-main-font] while running @scheme[text]. +text, respectively, to @racket[current-main-font] while running @racket[text]. } @@ -65,7 +65,7 @@ text, respectively, to @scheme[current-main-font] while running @scheme[text]. @defproc[(color [c color/c] [p pict?]) pict?]{ -Applies color @scheme[c] to picture @scheme[p]. Equivalent to @scheme[(colorize +Applies color @racket[c] to picture @racket[p]. Equivalent to @racket[(colorize p c)]. } @@ -85,7 +85,7 @@ p c)]. @defproc[(magenta [pict pict?]) pict?] )]{ -These functions apply appropriate colors to picture @scheme[p]. +These functions apply appropriate colors to picture @racket[p]. } @@ -100,7 +100,7 @@ These functions produce ligher or darker versions of a color. @defthing[color/c flat-contract?]{ -This contract recognizes color strings, @scheme[color%] instances, and RGB color +This contract recognizes color strings, @racket[color%] instances, and RGB color lists. } @@ -110,8 +110,8 @@ lists. @defproc[(fill [pict pict?] [width (or/c real? #f)] [height (or/c real? #f)]) pict?]{ -Extends @scheme[pict]'s bounding box to a minimum @scheme[width] and/or -@scheme[height], placing the original picture in the middle of the space. +Extends @racket[pict]'s bounding box to a minimum @racket[width] and/or +@racket[height], placing the original picture in the middle of the space. } @@ -129,16 +129,16 @@ argument between slides can control when the transformation occurs. )]{ These functions conditionally show or hide an image, essentially choosing -between @scheme[pict] and @scheme[(ghost pict)]. The only difference between -the two is the default behavior and the opposite meaning of the @scheme[show?] -and @scheme[hide?] booleans. Both functions are provided for mnemonic purposes. +between @racket[pict] and @racket[(ghost pict)]. The only difference between +the two is the default behavior and the opposite meaning of the @racket[show?] +and @racket[hide?] booleans. Both functions are provided for mnemonic purposes. } @defproc[(strike [pict pict?] [strike? truth/c #t]) pict?]{ Displays a strikethrough image by putting a line through the middle of -@scheme[pict] if @scheme[strike?] is true; produces @scheme[pict] unchanged +@racket[pict] if @racket[strike?] is true; produces @racket[pict] unchanged otherwise. } @@ -148,9 +148,9 @@ otherwise. [#:ratio ratio (real-in 0 1) 1/2]) pict?]{ -Shades @scheme[pict] to show with @scheme[ratio] of its normal opacity; if -@scheme[ratio] is @scheme[1] or @scheme[shade?] is @scheme[#f], shows -@scheme[pict] unchanged. +Shades @racket[pict] to show with @racket[ratio] of its normal opacity; if +@racket[ratio] is @racket[1] or @racket[shade?] is @racket[#f], shows +@racket[pict] unchanged. } @@ -158,7 +158,7 @@ Shades @scheme[pict] to show with @scheme[ratio] of its normal opacity; if These pict control flow operators decide which pict of several to use. All branches are evaluated; the resulting pict is a combination of the pict chosen -by normal conditional flow with @scheme[ghost] applied to all the other picts. +by normal conditional flow with @racket[ghost] applied to all the other picts. The result is a picture large enough to accommodate each alternative, but showing only the chosen one. This is useful for staged slides, as the pict chosen may change with each slide but its size and position will not. @@ -166,54 +166,54 @@ change with each slide but its size and position will not. @defform/subs[(pict-if maybe-combine test-expr then-expr else-expr) ([maybe-combine code:blank (code:line #:combine combine-expr)])]{ -Chooses either @scheme[then-expr] or @scheme[else-expr] based on -@scheme[test-expr], similarly to @scheme[if]. Combines the chosen, visible -image with the other, invisible image using @scheme[combine-expr], defaulting to -@scheme[pict-combine]. +Chooses either @racket[then-expr] or @racket[else-expr] based on +@racket[test-expr], similarly to @racket[if]. Combines the chosen, visible +image with the other, invisible image using @racket[combine-expr], defaulting to +@racket[pict-combine]. } @defform/subs[(pict-cond maybe-combine [test-expr pict-expr] ...) ([maybe-combine code:blank (code:line #:combine combine-expr)])]{ -Chooses a @scheme[pict-expr] based on the first successful @scheme[test-expr], -similarly to @scheme[cond]. Combines the chosen, visible image with the other, -invisible images using @scheme[combine-expr], defaulting to -@scheme[pict-combine]. +Chooses a @racket[pict-expr] based on the first successful @racket[test-expr], +similarly to @racket[cond]. Combines the chosen, visible image with the other, +invisible images using @racket[combine-expr], defaulting to +@racket[pict-combine]. } @defform/subs[(pict-case test-expr maybe-combine [literals pict-expr] ...) ([maybe-combine code:blank (code:line #:combine combine-expr)])]{ -Chooses a @scheme[pict-expr] based on @scheme[test-expr] and each list of -@scheme[literals], similarly to @scheme[case]. Combines the chosen, visible -image with the other, invisible images using @scheme[combine-expr], defaulting -to @scheme[pict-combine]. +Chooses a @racket[pict-expr] based on @racket[test-expr] and each list of +@racket[literals], similarly to @racket[case]. Combines the chosen, visible +image with the other, invisible images using @racket[combine-expr], defaulting +to @racket[pict-combine]. } @defform/subs[(pict-match test-expr maybe-combine [pattern pict-expr] ...) ([maybe-combine code:blank (code:line #:combine combine-expr)])]{ -Chooses a @scheme[pict-expr] based on @scheme[test-expr] and each -@scheme[pattern], similarly to @scheme[match]. Combines the chosen, visible -image with the other, invisible images using @scheme[combine-expr], defaulting -to @scheme[pict-combine]. +Chooses a @racket[pict-expr] based on @racket[test-expr] and each +@racket[pattern], similarly to @racket[match]. Combines the chosen, visible +image with the other, invisible images using @racket[combine-expr], defaulting +to @racket[pict-combine]. } @defform[#:id pict-combine pict-combine]{ This syntax parameter determines the default pict combining form used by the -above macros. It defaults to @scheme[lbl-superimpose]. +above macros. It defaults to @racket[lbl-superimpose]. } @defform[(with-pict-combine combine-id body ...)]{ -Sets @scheme[pict-combine] to refer to @scheme[combine-id] within each of the -@scheme[body] terms, which are spliced into the containing context. +Sets @racket[pict-combine] to refer to @racket[combine-id] within each of the +@racket[body] terms, which are spliced into the containing context. } @@ -221,14 +221,14 @@ Sets @scheme[pict-combine] to refer to @scheme[combine-id] within each of the @defform[(staged [name ...] body ...)]{ -Executes the @scheme[body] terms once for each stage @scheme[name]. The terms +Executes the @racket[body] terms once for each stage @racket[name]. The terms may include expressions and mutually recursive definitions. Within the body, -each @scheme[name] is bound to a number from @scheme[1] to the number of stages -in order. Furthermore, during execution @scheme[stage] is bound to the number -of the current stage and @scheme[stage-name] is bound to a symbol representing -the @scheme[name] of the current stage. By comparing @scheme[stage] to the -numeric value of each @scheme[name], or @scheme[stage-name] to quoted symbols of -the form @scheme['name], the user may compute based on the progression of the +each @racket[name] is bound to a number from @racket[1] to the number of stages +in order. Furthermore, during execution @racket[stage] is bound to the number +of the current stage and @racket[stage-name] is bound to a symbol representing +the @racket[name] of the current stage. By comparing @racket[stage] to the +numeric value of each @racket[name], or @racket[stage-name] to quoted symbols of +the form @racket['name], the user may compute based on the progression of the stages. } @@ -238,20 +238,20 @@ stages. @defform[#:id stage-name stage-name] )]{ -These keywords are bound during the execution of @scheme[staged] and should not +These keywords are bound during the execution of @racket[staged] and should not be used otherwise. } @defform[(slide/staged [name ...] arg ...)]{ -Creates a staged slide. Equivalent to @scheme[(staged [name ...] (slide arg +Creates a staged slide. Equivalent to @racket[(staged [name ...] (slide arg ...))]. -Within a staged slide, the boolean arguments to @scheme[hide], @scheme[show], -@scheme[strike], and @scheme[shade] can be used to determine in which stages to -perform a transformation. The macros @scheme[pict-if], @scheme[pict-cond], -@scheme[pict-case], and @scheme[pict-match] may also be used to create images +Within a staged slide, the boolean arguments to @racket[hide], @racket[show], +@racket[strike], and @racket[shade] can be used to determine in which stages to +perform a transformation. The macros @racket[pict-if], @racket[pict-cond], +@racket[pict-case], and @racket[pict-match] may also be used to create images which change naturally between stages. } @@ -267,11 +267,11 @@ which change naturally between stages. [#:valign valign (->* [] [] #:rest (listof pict?) pict?) align]) pict?]{ -Constructs a table containing the given @scheme[row]s, all of which must be of -the same length. Applies @scheme[t] to each string in a @scheme[row] to -construct a pict. The @scheme[hgap], @scheme[vgap], @scheme[halign], and -@scheme[valign] are used to determine the horizontal and vertical gaps and -alignments as in @scheme[table] (except that every row and column is uniform). +Constructs a table containing the given @racket[row]s, all of which must be of +the same length. Applies @racket[t] to each string in a @racket[row] to +construct a pict. The @racket[hgap], @racket[vgap], @racket[halign], and +@racket[valign] are used to determine the horizontal and vertical gaps and +alignments as in @racket[table] (except that every row and column is uniform). } @@ -279,29 +279,29 @@ alignments as in @scheme[table] (except that every row and column is uniform). @defform[(two-columns one two)]{ -Constructs a two-column pict using @scheme[one] and @scheme[two] as the two -columns. Sets @scheme[current-para-width] appropriately in each column. +Constructs a two-column pict using @racket[one] and @racket[two] as the two +columns. Sets @racket[current-para-width] appropriately in each column. } @defproc[(mini-slide [pict pict?] ...) pict?]{ -Appends each @scheme[pict] vertically with space between them, similarly to the -@scheme[slide] function. +Appends each @racket[pict] vertically with space between them, similarly to the +@racket[slide] function. } @defproc[(columns [pict pict?] ...) pict?]{ -Combines each @scheme[pict] horizontally, aligned at the top, with space in +Combines each @racket[pict] horizontally, aligned at the top, with space in between. } @defform[(column width body ...)]{ -Sets @scheme[current-para-width] to @scheme[width] during execution of the -@scheme[body] expressions. +Sets @racket[current-para-width] to @racket[width] during execution of the +@racket[body] expressions. } @@ -309,8 +309,8 @@ Sets @scheme[current-para-width] to @scheme[width] during execution of the [r real? (/ n )]) real?]{ -Computes the width of one column out of @scheme[n] that takes up a ratio of -@scheme[r] of the available space (according to @scheme[current-para-width]). +Computes the width of one column out of @racket[n] that takes up a ratio of +@racket[r] of the available space (according to @racket[current-para-width]). } diff --git a/collects/unstable/scribblings/hash.scrbl b/collects/unstable/scribblings/hash.scrbl index d259bd7993..704ef5fba5 100644 --- a/collects/unstable/scribblings/hash.scrbl +++ b/collects/unstable/scribblings/hash.scrbl @@ -22,11 +22,11 @@ This module provides tools for manipulating hash tables. (lambda (k a b) (combine a b))]) (and/c hash? hash-can-functional-set?)]{ -Computes the union of @scheme[h0] with each hash table @scheme[h] by functional -update, adding each element of each @scheme[h] to @scheme[h0] in turn. For each -key @scheme[k] and value @scheme[v], if a mapping from @scheme[k] to some value -@scheme[v0] already exists, it is replaced with a mapping from @scheme[k] to -@scheme[(combine/key k v0 v)]. +Computes the union of @racket[h0] with each hash table @racket[h] by functional +update, adding each element of each @racket[h] to @racket[h0] in turn. For each +key @racket[k] and value @racket[v], if a mapping from @racket[k] to some value +@racket[v0] already exists, it is replaced with a mapping from @racket[k] to +@racket[(combine/key k v0 v)]. @defexamples[ #:eval the-eval @@ -48,11 +48,11 @@ key @scheme[k] and value @scheme[v], if a mapping from @scheme[k] to some value (lambda (k a b) (combine a b))]) void?]{ -Computes the union of @scheme[h0] with each hash table @scheme[h] by mutable -update, adding each element of each @scheme[h] to @scheme[h0] in turn. For each -key @scheme[k] and value @scheme[v], if a mapping from @scheme[k] to some value -@scheme[v0] already exists, it is replaced with a mapping from @scheme[k] to -@scheme[(combine/key k v0 v)]. +Computes the union of @racket[h0] with each hash table @racket[h] by mutable +update, adding each element of each @racket[h] to @racket[h0] in turn. For each +key @racket[k] and value @racket[v], if a mapping from @racket[k] to some value +@racket[v0] already exists, it is replaced with a mapping from @racket[k] to +@racket[(combine/key k v0 v)]. @defexamples[ #:eval the-eval diff --git a/collects/unstable/scribblings/list.scrbl b/collects/unstable/scribblings/list.scrbl index 9307ae5c57..4598444af0 100644 --- a/collects/unstable/scribblings/list.scrbl +++ b/collects/unstable/scribblings/list.scrbl @@ -135,8 +135,8 @@ Produces lists of the respective values of @racket[f] applied to the elements in @defproc[(map2 [f (-> A ... (values B C))] [lst (listof A)] ...) (values (listof B) (listof C))]{ -Produces a pair of lists of the respective values of @scheme[f] applied to the -elements in @scheme[lst ...] sequentially. +Produces a pair of lists of the respective values of @racket[f] applied to the +elements in @racket[lst ...] sequentially. @defexamples[ #:eval the-eval diff --git a/collects/unstable/scribblings/match.scrbl b/collects/unstable/scribblings/match.scrbl index 2922df4c25..384e53ba08 100644 --- a/collects/unstable/scribblings/match.scrbl +++ b/collects/unstable/scribblings/match.scrbl @@ -34,8 +34,8 @@ not provided, it defaults to @racket[equal?]. @defform[(match? val-expr pat ...)]{ -Returns @scheme[#t] if the result of @scheme[val-expr] matches any of -@scheme[pat], and returns @scheme[#f] otherwise. +Returns @racket[#t] if the result of @racket[val-expr] matches any of +@racket[pat], and returns @racket[#f] otherwise. @defexamples[ #:eval the-eval @@ -54,9 +54,9 @@ Returns @scheme[#t] if the result of @scheme[val-expr] matches any of @defform[(as ([lhs-id rhs-expr] ...) pat ...)]{ -As a match expander, binds each @scheme[lhs-id] as a pattern variable with the -result value of @scheme[rhs-expr], and continues matching each subsequent -@scheme[pat]. +As a match expander, binds each @racket[lhs-id] as a pattern variable with the +result value of @racket[rhs-expr], and continues matching each subsequent +@racket[pat]. @defexamples[ #:eval the-eval diff --git a/collects/unstable/scribblings/port.scrbl b/collects/unstable/scribblings/port.scrbl index 952c8f95ee..577d02a815 100644 --- a/collects/unstable/scribblings/port.scrbl +++ b/collects/unstable/scribblings/port.scrbl @@ -17,8 +17,8 @@ This module provides tools for port I/O. list?]{ This function produces a list of all the values produced by calling -@scheme[(reader)] while @scheme[current-input-port] is set to @scheme[port], up -until it produces @scheme[eof]. +@racket[(reader)] while @racket[current-input-port] is set to @racket[port], up +until it produces @racket[eof]. @defexamples[ #:eval the-eval @@ -34,8 +34,8 @@ until it produces @scheme[eof]. (syntax/c list?)]{ This function produces a syntax object containing a list of all the syntax -objects produced by calling @scheme[(reader)] while @scheme[current-input-port] -is set to @scheme[port], up until it produces @scheme[eof]. The source location +objects produced by calling @racket[(reader)] while @racket[current-input-port] +is set to @racket[port], up until it produces @racket[eof]. The source location of the result spans the entire portion of the port that was read. @defexamples[ @@ -56,10 +56,10 @@ of the result spans the entire portion of the port that was read. [span exact-nonnegative-integer? 0]) srcloc?]{ -Produces a @scheme[srcloc] structure representing the current position of a -port, using the provided @scheme[source] and @scheme[span] values to fill in -missing fields. This function relies on @scheme[port-next-location], so line -counting must be enabled for @scheme[port] to get meaningful results. +Produces a @racket[srcloc] structure representing the current position of a +port, using the provided @racket[source] and @racket[span] values to fill in +missing fields. This function relies on @racket[port-next-location], so line +counting must be enabled for @racket[port] to get meaningful results. @defexamples[ #:eval the-eval diff --git a/collects/unstable/scribblings/pretty.scrbl b/collects/unstable/scribblings/pretty.scrbl index 0b04dab43d..2d4c35b59d 100644 --- a/collects/unstable/scribblings/pretty.scrbl +++ b/collects/unstable/scribblings/pretty.scrbl @@ -18,8 +18,8 @@ This module provides tools for pretty-printing. (pretty-print-columns)]) string?]{ -This procedure behaves like @scheme[pretty-format], but it formats values -consistently with @scheme[write] instead of @scheme[print]. +This procedure behaves like @racket[pretty-format], but it formats values +consistently with @racket[write] instead of @racket[print]. @examples[#:eval the-eval (struct both [a b] #:transparent) @@ -34,8 +34,8 @@ consistently with @scheme[write] instead of @scheme[print]. (pretty-print-columns)]) string?]{ -This procedure behaves like @scheme[pretty-format], but it formats values -consistently with @scheme[display] instead of @scheme[print]. +This procedure behaves like @racket[pretty-format], but it formats values +consistently with @racket[display] instead of @racket[print]. @examples[#:eval the-eval (struct both [a b] #:transparent) @@ -50,9 +50,9 @@ consistently with @scheme[display] instead of @scheme[print]. (pretty-print-columns)]) string?]{ -This procedure behaves the same as @scheme[pretty-format], but is named +This procedure behaves the same as @racket[pretty-format], but is named more explicitly to describe how it formats values. It is included for -symmetry with @scheme[pretty-format/write] and @scheme[pretty-format/display]. +symmetry with @racket[pretty-format/write] and @racket[pretty-format/display]. @examples[#:eval the-eval (struct both [a b] #:transparent) diff --git a/collects/unstable/scribblings/require.scrbl b/collects/unstable/scribblings/require.scrbl index ddc5d57984..4675cfa5b0 100644 --- a/collects/unstable/scribblings/require.scrbl +++ b/collects/unstable/scribblings/require.scrbl @@ -12,9 +12,9 @@ This module provides tools for importing from modules. @defform[(require/provide module-path ...)]{ -Re-exports all bindings provided by each @scheme[module-path]. Equivalent to: +Re-exports all bindings provided by each @racket[module-path]. Equivalent to: -@schemeblock[ +@racketblock[ (require module-path ...) (provide (all-from-out module-path ...)) ] @@ -23,7 +23,7 @@ Re-exports all bindings provided by each @scheme[module-path]. Equivalent to: @defform[(quote-require require-spec ...)]{ -Produces the names exported by the @scheme[require-spec]s as a list of symbols. +Produces the names exported by the @racket[require-spec]s as a list of symbols. @examples[ #:eval the-eval diff --git a/collects/unstable/scribblings/syntax.scrbl b/collects/unstable/scribblings/syntax.scrbl index 7fd66b0889..933a996887 100644 --- a/collects/unstable/scribblings/syntax.scrbl +++ b/collects/unstable/scribblings/syntax.scrbl @@ -79,7 +79,7 @@ Performs @racket[(map f (syntax->list stxl) ...)]. @defform[(syntax-list template ...)]{ This form constructs a list of syntax objects based on the given templates. It -is equivalent to @scheme[(syntax->list (syntax (template ...)))]. +is equivalent to @racket[(syntax->list (syntax (template ...)))]. @defexamples[ #:eval the-eval @@ -96,7 +96,7 @@ is equivalent to @scheme[(syntax->list (syntax (template ...)))]. )]{ These produce the directory and file name, respectively, of the path with which -@scheme[stx] is associated, or @scheme[#f] if @scheme[stx] is not associated +@racket[stx] is associated, or @racket[#f] if @racket[stx] is not associated with a path. @defexamples[ diff --git a/collects/unstable/scribblings/wrapc.scrbl b/collects/unstable/scribblings/wrapc.scrbl index d9b21f1dc4..9c05bb10de 100644 --- a/collects/unstable/scribblings/wrapc.scrbl +++ b/collects/unstable/scribblings/wrapc.scrbl @@ -7,7 +7,7 @@ @title[#:tag "wrapc"]{Contracts for macro subexpressions} -This library provides a procedure @scheme[wrap-expr/c] for applying +This library provides a procedure @racket[wrap-expr/c] for applying contracts to macro subexpressions. @defmodule[unstable/wrapc] @@ -32,20 +32,20 @@ contracts to macro subexpressions. syntax?]{ Returns a syntax object representing an expression that applies the -contract represented by @scheme[contract-expr] to the value produced -by @scheme[expr]. +contract represented by @racket[contract-expr] to the value produced +by @racket[expr]. The contract's positive blame represents the obligations of the expression being wrapped. The negative blame represents the obligations of the macro imposing the contract---the ultimate caller -of @scheme[wrap-expr/c]. By default, the positive blame is taken as +of @racket[wrap-expr/c]. By default, the positive blame is taken as the module currently being expanded, and the negative blame is inferred from the definition site of the macro (itself inferred from -the @scheme[context] argument). But both blame locations can be +the @racket[context] argument). But both blame locations can be overridden. Positive and negative blame locations are determined from -@scheme[pos-blame] and @scheme[neg-blame], respectively, as follows: +@racket[pos-blame] and @racket[neg-blame], respectively, as follows: @itemize[ @item{If the argument is a string, it is used directly as the blame label.} @@ -53,31 +53,31 @@ label.} to produce the blame label.} @item{If the argument is a module path index, its resolved module path is used.} -@item{If the argument is @scheme['from-macro], the macro is inferred -from either the @scheme[macro-name] argument (if @scheme[macro-name] -is an identifier) or the @scheme[context] argument, and the module +@item{If the argument is @racket['from-macro], the macro is inferred +from either the @racket[macro-name] argument (if @racket[macro-name] +is an identifier) or the @racket[context] argument, and the module where it is @emph{defined} is used as the negative blame location. If -neither an identifier @scheme[macro-name] nor a @scheme[context] -argument is given, the location is @scheme["unknown"].} -@item{If the argument is @scheme['use-site], the module being +neither an identifier @racket[macro-name] nor a @racket[context] +argument is given, the location is @racket["unknown"].} +@item{If the argument is @racket['use-site], the module being expanded is used.} -@item{If the argument is @scheme['unknown], the blame label is -@scheme["unknown"].} +@item{If the argument is @racket['unknown], the blame label is +@racket["unknown"].} ] -The @scheme[macro-name] argument is used to determine the macro's -binding, if it is an identifier. If @scheme[expr-name] is given, -@scheme[macro-name] is also included in the contract error message. If -@scheme[macro-name] is omitted or @scheme[#f], but @scheme[context] is -a syntax object, then @scheme[macro-name] is determined from -@scheme[context]. +The @racket[macro-name] argument is used to determine the macro's +binding, if it is an identifier. If @racket[expr-name] is given, +@racket[macro-name] is also included in the contract error message. If +@racket[macro-name] is omitted or @racket[#f], but @racket[context] is +a syntax object, then @racket[macro-name] is determined from +@racket[context]. -If @scheme[expr-name] is not @scheme[#f], it is used in the contract's +If @racket[expr-name] is not @racket[#f], it is used in the contract's error message to describe the expression the contract is applied to. -The @scheme[context] argument is used, when necessary, to infer the +The @racket[context] argument is used, when necessary, to infer the macro name for the negative blame party and the contract error -message. The @scheme[context] should be either an identifier or a +message. The @racket[context] should be either an identifier or a syntax pair with an identifer in operator position; in either case, that identifier is taken as the macro ultimately requesting the contract wrapping. diff --git a/collects/version/version.scrbl b/collects/version/version.scrbl index aaf70bbc41..b36d358a65 100644 --- a/collects/version/version.scrbl +++ b/collects/version/version.scrbl @@ -5,16 +5,16 @@ version/check version/tool version/utils - scheme/base - scheme/contract)) + racket/base + racket/contract)) @(define (selflink s) (link s (tt s))) @title{@bold{Version}: Racket Version Checking} The version collection contains several version-related pieces that -are used by Racket. See also @scheme[version] from -@schememodname[scheme/base]. +are used by Racket. See also @racket[version] from +@racketmodname[racket/base]. @; ---------------------------------------------------------------------- @@ -41,29 +41,29 @@ indicates the current state of the curent installation: @itemize[ - @item{@scheme[`ok] --- You're fine.} + @item{@racket[`ok] --- You're fine.} - @item{@scheme[`(ok-but ,_version)] --- You have a fine stable + @item{@racket[`(ok-but ,_version)] --- You have a fine stable version, but note that there is a newer alpha version available - numbered @scheme[_version].} + numbered @racket[_version].} - @item{@scheme[`(newer ,_version)] --- You have an old - version. Please upgrade to @scheme[_version].} + @item{@racket[`(newer ,_version)] --- You have an old + version. Please upgrade to @racket[_version].} - @item{@scheme[`(newer ,_version ,_alpha)] --- You have an - old-but-stable version, please upgrade to @scheme[_version]; you + @item{@racket[`(newer ,_version ,_alpha)] --- You have an + old-but-stable version, please upgrade to @racket[_version]; you may consider also the newer alpha version numbered - @scheme[_alpha].} + @racket[_alpha].} - @item{@scheme[`(error ,_message)] --- An error occurred, and - @scheme[_message] is a string that indicates the error.} + @item{@racket[`(error ,_message)] --- An error occurred, and + @racket[_message] is a string that indicates the error.} - @item{@scheme[`(error ,_message ,_additional-info)] --- An error - occurred; @scheme[_message] is a string that indicates the - error, and @scheme[_additional-info] is a string containing a - system error. The @scheme[_additional-info] content is always - parenthesizes, so @scheme[message] is a short error and - @scheme[(string-append message " " additional-info)] is a + @item{@racket[`(error ,_message ,_additional-info)] --- An error + occurred; @racket[_message] is a string that indicates the + error, and @racket[_additional-info] is a string containing a + system error. The @racket[_additional-info] content is always + parenthesizes, so @racket[message] is a short error and + @racket[(string-append message " " additional-info)] is a verbose one.} ] @@ -76,13 +76,13 @@ indicates the current state of the curent installation: @defmodule[version/tool] -The @scheme[version/tool] library implements a DrRacket tool that +The @racket[version/tool] library implements a DrRacket tool that @itemize[ @item{makes the patchlevel display as a version @tt{p}@nonterm{N} suffix in DrRacket (though the base verion reported by - @scheme[(version)] is not changed);} + @racket[(version)] is not changed);} @item{if enabled by the user, periodically checks whether a new Racket distribution is available for download.} @@ -95,47 +95,47 @@ The @scheme[version/tool] library implements a DrRacket tool that @defmodule[version/utils]{ -The @schememodname[version/utils] library provides a few of convenient +The @racketmodname[version/utils] library provides a few of convenient utilities for dealing with version strings. Unless explicitly noted, these functions do not handle legacy versions of Racket.} @defproc[(valid-version? [str string?]) boolean?]{ -Returns @scheme[#t] if @scheme[str] is a valid Racket version -string, @scheme[#f] otherwise.} +Returns @racket[#t] if @racket[str] is a valid Racket version +string, @racket[#f] otherwise.} @defproc[(version->list [str valid-version?]) (list integer? integer? integer? integer?)]{ Returns a list of four numbers that the given version string -represent. @scheme[str] is assumed to be a valid version.} +represent. @racket[str] is assumed to be a valid version.} @defproc[(versioninteger [str string?]) (or/c integer? false/c)]{ Converts the version string into an integer. For version -@scheme["X.YY.ZZZ.WWW"], the result will be @schemevalfont{XYYZZZWWW}. +@racket["X.YY.ZZZ.WWW"], the result will be @racketvalfont{XYYZZZWWW}. This function works also for legacy Racket versions, by -translating @scheme["XYY.ZZZ"] to @schemevalfont{XYYZZZ000}. The +translating @racket["XYY.ZZZ"] to @racketvalfont{XYYZZZ000}. The resulting integer can thefore be used to conveniently compare any two (valid) version strings. If the version string is invalid the -resulting value is @scheme[#f]. +resulting value is @racket[#f]. Note that this is the only function that deals with legacy version strings.}