From dfb4916f109c65b654c8c151c7ddd6e6682601d2 Mon Sep 17 00:00:00 2001 From: Sam Tobin-Hochstadt Date: Fri, 4 Jun 2010 16:22:26 -0400 Subject: [PATCH] Fix more references to Scheme. --- .../scribblings/gui/editor-admin-class.scrbl | 2 +- collects/scribblings/gui/editor-funcs.scrbl | 302 +++++++++--------- collects/scribblings/gui/editor-intf.scrbl | 2 +- .../scribblings/gui/gl-context-intf.scrbl | 6 +- .../scribblings/gui/global-draw-funcs.scrbl | 4 +- .../guide/contracts-examples/1-test.rkt | 2 +- .../guide/contracts-examples/1.rkt | 2 +- .../guide/contracts-examples/1b.rkt | 2 +- .../guide/contracts-examples/2-test.rkt | 2 +- .../guide/contracts-examples/2.rkt | 2 +- .../guide/contracts-examples/3-test.rkt | 2 +- .../guide/contracts-examples/3.rkt | 2 +- .../guide/contracts-examples/5-test.rkt | 2 +- .../guide/contracts-examples/5.rkt | 2 +- collects/scribblings/guide/futures.scrbl | 82 ++--- 15 files changed, 208 insertions(+), 208 deletions(-) diff --git a/collects/scribblings/gui/editor-admin-class.scrbl b/collects/scribblings/gui/editor-admin-class.scrbl index a21bda3a83..6da0ea487a 100644 --- a/collects/scribblings/gui/editor-admin-class.scrbl +++ b/collects/scribblings/gui/editor-admin-class.scrbl @@ -218,7 +218,7 @@ Returns @scheme[#t] if updating on this administrator's } @methimpl{ -Returns Scheme[#f]. +Returns @scheme[#f]. }} diff --git a/collects/scribblings/gui/editor-funcs.scrbl b/collects/scribblings/gui/editor-funcs.scrbl index 164ad220ca..d378d87389 100644 --- a/collects/scribblings/gui/editor-funcs.scrbl +++ b/collects/scribblings/gui/editor-funcs.scrbl @@ -8,21 +8,21 @@ @defproc[(add-editor-keymap-functions [keymap (is-a?/c keymap%)]) void?]{ -Given a @scheme[keymap%] object, the keymap is loaded with mappable - functions that apply to all @scheme[editor<%>] objects: +Given a @racket[keymap%] object, the keymap is loaded with mappable + functions that apply to all @racket[editor<%>] objects: @itemize[ -@item{@scheme["copy-clipboard"]} -@item{@scheme["copy-append-clipboard"]} -@item{@scheme["cut-clipboard"]} -@item{@scheme["cut-append-clipboard"]} -@item{@scheme["paste-clipboard"]} -@item{@scheme["paste-x-selection"]} -@item{@scheme["delete-selection"]} -@item{@scheme["clear-selection"]} -@item{@scheme["undo"]} -@item{@scheme["redo"]} -@item{@scheme["select-all"]} +@item{@racket["copy-clipboard"]} +@item{@racket["copy-append-clipboard"]} +@item{@racket["cut-clipboard"]} +@item{@racket["cut-append-clipboard"]} +@item{@racket["paste-clipboard"]} +@item{@racket["paste-x-selection"]} +@item{@racket["delete-selection"]} +@item{@racket["clear-selection"]} +@item{@racket["undo"]} +@item{@racket["redo"]} +@item{@racket["select-all"]} ] } @@ -30,92 +30,92 @@ Given a @scheme[keymap%] object, the keymap is loaded with mappable @defproc[(add-pasteboard-keymap-functions [keymap (is-a?/c keymap%)]) void?]{ -Given a @scheme[keymap%] object, the table is loaded with mappable - functions that apply to @scheme[pasteboard%] objects. Currently, +Given a @racket[keymap%] object, the table is loaded with mappable + functions that apply to @racket[pasteboard%] objects. Currently, there are no such functions. See also -@scheme[add-editor-keymap-functions]. +@racket[add-editor-keymap-functions]. } @defproc[(add-text-keymap-functions [keymap (is-a?/c keymap%)]) void?]{ -Given a @scheme[keymap%] object, the table is loaded with functions - that apply to all @scheme[text%] objects: +Given a @racket[keymap%] object, the table is loaded with functions + that apply to all @racket[text%] objects: @itemize[ -@item{@scheme["forward-character"]} -@item{@scheme["backward-character"]} -@item{@scheme["previous-line"]} -@item{@scheme["next-line"]} -@item{@scheme["previous-page"]} -@item{@scheme["next-page"]} -@item{@scheme["forward-word"]} -@item{@scheme["backward-word"]} -@item{@scheme["forward-select"]} -@item{@scheme["backward-select"]} -@item{@scheme["select-down"]} -@item{@scheme["select-up"]} -@item{@scheme["select-page-up"]} -@item{@scheme["select-page-down"]} -@item{@scheme["forward-select-word"]} -@item{@scheme["backward-select-word"]} -@item{@scheme["beginning-of-file"]} -@item{@scheme["end-of-file"]} -@item{@scheme["beginning-of-line"]} -@item{@scheme["end-of-line"]} -@item{@scheme["select-to-beginning-of-file"]} -@item{@scheme["select-to-end-of-file"]} -@item{@scheme["select-to-beginning-of-line"]} -@item{@scheme["select-to-end-of-line"]} -@item{@scheme["copy-clipboard"]} -@item{@scheme["copy-append-clipboard"]} -@item{@scheme["cut-clipboard"]} -@item{@scheme["cut-append-clipboard"]} -@item{@scheme["paste-clipboard"]} -@item{@scheme["paste-x-selection"]} -@item{@scheme["delete-selection"]} -@item{@scheme["delete-previous-character"]} -@item{@scheme["delete-next-character"]} -@item{@scheme["clear-selection"]} -@item{@scheme["delete-to-end-of-line"]} -@item{@scheme["delete-next-word"]} -@item{@scheme["delete-previous-word"]} -@item{@scheme["delete-line"]} -@item{@scheme["undo"]} -@item{@scheme["redo"]} +@item{@racket["forward-character"]} +@item{@racket["backward-character"]} +@item{@racket["previous-line"]} +@item{@racket["next-line"]} +@item{@racket["previous-page"]} +@item{@racket["next-page"]} +@item{@racket["forward-word"]} +@item{@racket["backward-word"]} +@item{@racket["forward-select"]} +@item{@racket["backward-select"]} +@item{@racket["select-down"]} +@item{@racket["select-up"]} +@item{@racket["select-page-up"]} +@item{@racket["select-page-down"]} +@item{@racket["forward-select-word"]} +@item{@racket["backward-select-word"]} +@item{@racket["beginning-of-file"]} +@item{@racket["end-of-file"]} +@item{@racket["beginning-of-line"]} +@item{@racket["end-of-line"]} +@item{@racket["select-to-beginning-of-file"]} +@item{@racket["select-to-end-of-file"]} +@item{@racket["select-to-beginning-of-line"]} +@item{@racket["select-to-end-of-line"]} +@item{@racket["copy-clipboard"]} +@item{@racket["copy-append-clipboard"]} +@item{@racket["cut-clipboard"]} +@item{@racket["cut-append-clipboard"]} +@item{@racket["paste-clipboard"]} +@item{@racket["paste-x-selection"]} +@item{@racket["delete-selection"]} +@item{@racket["delete-previous-character"]} +@item{@racket["delete-next-character"]} +@item{@racket["clear-selection"]} +@item{@racket["delete-to-end-of-line"]} +@item{@racket["delete-next-word"]} +@item{@racket["delete-previous-word"]} +@item{@racket["delete-line"]} +@item{@racket["undo"]} +@item{@racket["redo"]} ] See also -@scheme[add-editor-keymap-functions]. +@racket[add-editor-keymap-functions]. } -@defproc[(append-editor-font-menu-items [menu (or/c @scheme[menu%] (is-a?/c popup-menu%))]) +@defproc[(append-editor-font-menu-items [menu (or/c (is-a?/c menu%) (is-a?/c popup-menu%))]) void?]{ Appends menu items to a given menu (not a popup menu) to implement a standard set of font-manipulation operations, such as changing the font face or style. The callback for each menu item uses @xmethod[top-level-window<%> get-edit-target-object] (finding the frame by following a chain of parents until a frame is - reached); if the result is an @scheme[editor<%>] object, + reached); if the result is an @racket[editor<%>] object, @xmethod[editor<%> change-style] is called on the editor. } -@defproc[(append-editor-operation-menu-items [menu (or/c @scheme[menu%] (is-a?/c popup-menu%))] +@defproc[(append-editor-operation-menu-items [menu (or/c (is-a?/c menu%) (is-a?/c popup-menu%))] [text-only? any/c #t]) void?]{ Appends menu items to a given menu (not a popup menu) to implement the standard editor operations, such as cut and paste. The callback for each menu item uses @xmethod[top-level-window<%> get-edit-target-object] (finding the frame by following a chain of parents until a frame is - reached); if the result is an @scheme[editor<%>] object, + reached); if the result is an @racket[editor<%>] object, @xmethod[editor<%> do-edit-operation] is called on the editor. -If @scheme[text-only?] is @scheme[#f], then menu items that insert +If @racket[text-only?] is @racket[#f], then menu items that insert non-text snips (such as @onscreen{Insert Image...}) are appended to the menu. @@ -127,8 +127,8 @@ If @scheme[text-only?] is @scheme[#f], then menu items that insert Parameter that specifies a keymap-initialization procedure. This procedure is called to initialize the keymap of a - @scheme[text-field%] object or a @scheme[text%] object created by - @scheme[graphical-read-eval-print-loop]. + @racket[text-field%] object or a @racket[text%] object created by + @racket[graphical-read-eval-print-loop]. The initializer takes a keymap object and returns nothing. The default initializer chains the given keymap to an internal keymap that @@ -143,8 +143,8 @@ The initializer takes a keymap object and returns nothing. The default void?]{ Under X Windows, editor selections conform to the X Windows selection -conventions instead of a clipboard-based convention. If @scheme[on] is -@scheme[#f], the behavior is switched to the clipboard-based convention +conventions instead of a clipboard-based convention. If @racket[on] is +@racket[#f], the behavior is switched to the clipboard-based convention (where copy must be explicitly requested before a paste). @@ -173,7 +173,7 @@ Gets the snip class list instance for the current eventspace. void?] [(map-command-as-meta-key) boolean?])]{ -Determines the interpretation of @litchar{m:} for a @scheme[keymap%] +Determines the interpretation of @litchar{m:} for a @racket[keymap%] mapping under Mac OS X. See also @xmethod[keymap% map-function]. @@ -181,8 +181,8 @@ mapping under Mac OS X. See also First case: -If @scheme[on?] is @scheme[#t], @litchar{m:} corresponds to the Command key. If -@scheme[on?] is @scheme[#f], then @litchar{m:} corresponds to no key under Mac OS +If @racket[on?] is @racket[#t], @litchar{m:} corresponds to the Command key. If +@racket[on?] is @racket[#f], then @litchar{m:} corresponds to no key under Mac OS X. @@ -190,20 +190,20 @@ X. Second case: -Returns @scheme[#t] if @litchar{m:} corresponds to Command, - @scheme[#f] otherwise. +Returns @racket[#t] if @litchar{m:} corresponds to Command, + @racket[#f] otherwise. } @defproc[(open-input-graphical-file [filename string?]) input-port]{ -Opens @scheme[filename] (in @scheme['binary] mode) and checks whether it looks +Opens @racket[filename] (in @racket['binary] mode) and checks whether it looks like a ``graphical'' file in editor format. If the file does not appear to be an editor file, the file port is returned with line counting enabled. Otherwise, the file is loaded into an editor, and the result port is created with -@scheme[open-input-text-editor]. +@racket[open-input-text-editor]. } @@ -212,38 +212,38 @@ Opens @scheme[filename] (in @scheme['binary] mode) and checks whether it looks [start-position exact-nonnegative-integer? 0] [end-position (or/c exact-nonnegative-integer? (one/of 'end)) 'end] [snip-filter ((is-a?/c snip%) . -> . any/c) (lambda (s) s)] - [port-name any/c @scheme[text-editor]] + [port-name any/c text-editor] [expect-to-read-all? any/c #f]) input-port]{ -Creates an input port that draws its content from @scheme[text-editor]. - The editor content between positions @scheme[start-position] and - @scheme[end-position] is the content of the port. If @scheme[end-position] - is @scheme['end], the content runs until the end of the editor. If a - snip that is not a @scheme[string-snip%] object spans - @scheme[start-position] or @scheme[end-position], the entire snip - contributes to the port. If a @scheme[string-snip%] instance spans - @scheme[start-position], only the part of the snip after - @scheme[start-position] contributes, and if a @scheme[string-snip%] - object spans @scheme[end-position], only the part before - @scheme[end-position] contributes. +Creates an input port that draws its content from @racket[text-editor]. + The editor content between positions @racket[start-position] and + @racket[end-position] is the content of the port. If @racket[end-position] + is @racket['end], the content runs until the end of the editor. If a + snip that is not a @racket[string-snip%] object spans + @racket[start-position] or @racket[end-position], the entire snip + contributes to the port. If a @racket[string-snip%] instance spans + @racket[start-position], only the part of the snip after + @racket[start-position] contributes, and if a @racket[string-snip%] + object spans @racket[end-position], only the part before + @racket[end-position] contributes. -An instance of @scheme[string-snip%] in @scheme[text-editor] generates +An instance of @racket[string-snip%] in @racket[text-editor] generates a character sequence in the resulting port. All other kinds of snips - are passed to @scheme[snip-filter] to obtain a ``special'' value for + are passed to @racket[snip-filter] to obtain a ``special'' value for the port. If a snip is returned as the first result from - @scheme[snip-filter], and if the snip is an instance of - @scheme[readable-snip<%>], the snip generates a special value for the + @racket[snip-filter], and if the snip is an instance of + @racket[readable-snip<%>], the snip generates a special value for the port through the @method[readable-snip<%> read-special] method. If - @scheme[snip-filter] returns any other kind of snip, it is copied for + @racket[snip-filter] returns any other kind of snip, it is copied for the special result. Finally, a non-snip first result from - @scheme[snip-filter] is used directly as the special result. + @racket[snip-filter] is used directly as the special result. -The @scheme[port-name] argument is used for the input port's name. The - @scheme[expect-to-read-all?] argument is a performance hint; use - @scheme[#t] if the entire port's stream will be read. +The @racket[port-name] argument is used for the input port's name. The + @racket[expect-to-read-all?] argument is a performance hint; use + @racket[#t] if the entire port's stream will be read. -The result port must not be used if @scheme[text-editor] changes in any +The result port must not be used if @racket[text-editor] changes in any of the following ways: a snip is inserted (see @method[text% after-insert]), a snip is deleted (see @method[text% after-delete]), a snip is split (see @@ -259,19 +259,19 @@ The result port must not be used if @scheme[text-editor] changes in any @defproc[(open-output-text-editor [text-editor (is-a?/c text%)] [start-position (or/c exact-nonnegative-integer? (one/of 'end)) 'end] [special-filter (any/c . -> . any/c) (lambda (x) x)] - [port-name any/c @scheme[text-editor]]) + [port-name any/c text-editor]) output-port]{ -Creates an output port that delivers its content to @scheme[text-editor]. - The content is written to @scheme[text-editor] starting at the position - @scheme[start-position], where @scheme['end] indicates that output should +Creates an output port that delivers its content to @racket[text-editor]. + The content is written to @racket[text-editor] starting at the position + @racket[start-position], where @racket['end] indicates that output should start at the text editor's current end position. -If @scheme[special-filter] is provided, it is applied to any value - written to the port with @scheme[write-special], and the result is - inserted in its place. If a special value is a @scheme[snip%] +If @racket[special-filter] is provided, it is applied to any value + written to the port with @racket[write-special], and the result is + inserted in its place. If a special value is a @racket[snip%] object, it is inserted into the editor. Otherwise, the special value - is @scheme[display]ed into the editor. + is @racket[display]ed into the editor. If line counting is enabled for the resulting output port, then the port will report the line, offset from the line's start, and position @@ -285,9 +285,9 @@ If line counting is enabled for the resulting output port, then the boolean?]{ See -@scheme[read-editor-global-header]. Call -@scheme[read-editor-global-footer] even if -@scheme[read-editor-global-header] returns @scheme[#f]. +@racket[read-editor-global-header]. Call +@racket[read-editor-global-footer] even if +@racket[read-editor-global-header] returns @racket[#f]. @@ -296,8 +296,8 @@ See @defproc[(read-editor-global-header [in (is-a?/c editor-stream-in%)]) boolean?]{ -Reads data from @scheme[in] to initialize for reading editors from the -stream. The return value is @scheme[#t] if the read succeeds, or @scheme[#f] +Reads data from @racket[in] to initialize for reading editors from the +stream. The return value is @racket[#t] if the read succeeds, or @racket[#f] otherwise. One or more editors can be read from the stream by calling @@ -305,16 +305,16 @@ the editor's @method[editor<%> read-from-file] method. (The number of editors to be read must be known by the application beforehand.) When all editors are read, call -@scheme[read-editor-global-footer]. Calls to -@scheme[read-editor-global-header] and -@scheme[read-editor-global-footer] must bracket any call to +@racket[read-editor-global-footer]. Calls to +@racket[read-editor-global-header] and +@racket[read-editor-global-footer] must bracket any call to @method[editor<%> read-from-file], and only one stream at a time can be read using these methods or written using -@scheme[write-editor-global-header] and -@scheme[write-editor-global-footer]. +@racket[write-editor-global-header] and +@racket[write-editor-global-footer]. -When reading from streams that span PLT Scheme versions, use -@scheme[read-editor-version] before this procedure. +When reading from streams that span Racket versions, use +@racket[read-editor-version] before this procedure. @@ -326,18 +326,18 @@ When reading from streams that span PLT Scheme versions, use [raise-errors? any/c #t]) boolean?]{ -Reads version information from @scheme[in-base], where @scheme[in-base] is - the base for @scheme[in]. The version information parsed from - @scheme[in-base] is recorded in @scheme[in] for later version-sensitive +Reads version information from @racket[in-base], where @racket[in-base] is + the base for @racket[in]. The version information parsed from + @racket[in-base] is recorded in @racket[in] for later version-sensitive parsing. The procedure result is true if the version information was read successfully and if the version is supported. -If @scheme[parse-format?] is true, then @scheme[in-base] is checked for an - initial @scheme["WXME"] format indicator. Use @scheme[#f] when - @scheme["WXME"] has been consumed already by format-dispatching code. +If @racket[parse-format?] is true, then @racket[in-base] is checked for an + initial @racket["WXME"] format indicator. Use @racket[#f] when + @racket["WXME"] has been consumed already by format-dispatching code. -If @scheme[raise-errors?] is true, then an error in reading triggers an - exception, instead of a @scheme[#f] result. +If @racket[raise-errors?] is true, then an error in reading triggers an + exception, instead of a @racket[#f] result. @@ -347,46 +347,46 @@ If @scheme[raise-errors?] is true, then an error in reading triggers an [expected-module-name (or/c symbol false/c)]) any/c]{ -This procedure is a load handler for use with @scheme[current-load]. +This procedure is a load handler for use with @racket[current-load]. -The handler recognizes PLT Scheme editor-format files (see +The handler recognizes Racket editor-format files (see @secref["editorfileformat"]) and decodes them for loading. It is normally installed as GRacket starts (see @secref[#:doc reference-doc "running-sa"]). The handler recognizes editor files by the first twelve characters of the file: @litchar{WXME01}@nonterm{digit}@nonterm{digit}@litchar{ ## }. - Such a file is opened for loading by creating a @scheme[text%] + Such a file is opened for loading by creating a @racket[text%] object, loading the file into the object with @method[editor<%> insert-file], and then converting the editor content into a port with - @scheme[open-input-text-editor]. After obtaining a port in this way, + @racket[open-input-text-editor]. After obtaining a port in this way, the content is read in essentially the same way as by the default Racket load handler. The difference is that the editor may contain - instances of @scheme[readable-snip<%>], which are ``read'' though the + instances of @racket[readable-snip<%>], which are ``read'' though the snips' @method[readable-snip<%> read-special] method; see - @scheme[open-input-text-editor] for details. + @racket[open-input-text-editor] for details. } @defthing[the-editor-wordbreak-map (is-a?/c editor-wordbreak-map%)]{ -See @scheme[editor-wordbreak-map%]. +See @racket[editor-wordbreak-map%]. } @defthing[the-style-list (is-a?/c style-list%)]{ -See @scheme[style-list%]. +See @racket[style-list%]. } @defproc[(write-editor-global-footer [out (is-a?/c editor-stream-out%)]) boolean?]{ -See @scheme[write-editor-global-header]. Call - @scheme[write-editor-global-footer] even if - @scheme[write-editor-global-header] returns @scheme[#f]. +See @racket[write-editor-global-header]. Call + @racket[write-editor-global-footer] even if + @racket[write-editor-global-header] returns @racket[#f]. @@ -395,22 +395,22 @@ See @scheme[write-editor-global-header]. Call @defproc[(write-editor-global-header [out (is-a?/c editor-stream-out%)]) boolean?]{ -Writes data to @scheme[out], initializing it for writing editors to - the stream. The return value is @scheme[#t] if the write succeeds, or - @scheme[#f] otherwise. +Writes data to @racket[out], initializing it for writing editors to + the stream. The return value is @racket[#t] if the write succeeds, or + @racket[#f] otherwise. One or more editors can be written to the stream by calling the editor's @method[editor<%> write-to-file] method. When all editors - are written, call @scheme[write-editor-global-footer]. Calls to - @scheme[write-editor-global-header] and - @scheme[write-editor-global-footer] must bracket any call to + are written, call @racket[write-editor-global-footer]. Calls to + @racket[write-editor-global-header] and + @racket[write-editor-global-footer] must bracket any call to @method[editor<%> write-to-file], and only one stream at a time can be written using these methods or read using - @scheme[read-editor-global-header] and - @scheme[read-editor-global-footer]. + @racket[read-editor-global-header] and + @racket[read-editor-global-footer]. -To support streams that span PLT Scheme versions, use - @scheme[write-editor-version] before this procedure. +To support streams that span Racket versions, use + @racket[write-editor-version] before this procedure. See also @secref["editorfileformat"]. @@ -420,13 +420,13 @@ See also @secref["editorfileformat"]. [out-base (is-a?/c editor-stream-out-base%)]) boolean?]{ -Writes version information to @scheme[out-base] in preparation for - writing editor information to the stream @scheme[out]. +Writes version information to @racket[out-base] in preparation for + writing editor information to the stream @racket[out]. -The @scheme[out] argument is currently not used, but @scheme[out-base] - should be the base for @scheme[out]. In the future, @scheme[out] may record +The @racket[out] argument is currently not used, but @racket[out-base] + should be the base for @racket[out]. In the future, @racket[out] may record information about the version for later version-sensitive output. -The result is @scheme[#t] if the write succeeded, @scheme[#f] otherwise. +The result is @racket[#t] if the write succeeded, @racket[#f] otherwise. } diff --git a/collects/scribblings/gui/editor-intf.scrbl b/collects/scribblings/gui/editor-intf.scrbl index a15fa7a570..5134b7e240 100644 --- a/collects/scribblings/gui/editor-intf.scrbl +++ b/collects/scribblings/gui/editor-intf.scrbl @@ -1724,7 +1724,7 @@ If @scheme[fit-on-page?] is a true value, then during printing for a The @scheme[output-mode] setting is used for Windows and Mac OS X. It determines whether the output is generated directly as a PostScript - file (using PLT Scheme's built-in PostScript system) or generated + file (using Racket's built-in PostScript system) or generated using the platform-specific standard printing mechanism. The possible values are diff --git a/collects/scribblings/gui/gl-context-intf.scrbl b/collects/scribblings/gui/gl-context-intf.scrbl index 3d4a95f7c8..1607267fe5 100644 --- a/collects/scribblings/gui/gl-context-intf.scrbl +++ b/collects/scribblings/gui/gl-context-intf.scrbl @@ -17,10 +17,10 @@ Only canvas @scheme[dc<%>] and @scheme[bitmap-dc%] objects support @scheme[gl-context<%>] keeps its identity. Canvas contexts are double buffered, and bitmap contexts are single buffered. -The @schememodname[scheme/gui/base] library provides no OpenGL +The @schememodname[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[scheme/gui/base] merely manage the current OpenGL + @schememodname[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 @@ -31,7 +31,7 @@ Only one OpenGL context can be active at a time across all threads and only within a thunk passed to @method[gl-context<%> call-as-current], then drawing from the separate threads will not interfere, because @method[gl-context<%> call-as-current] uses a lock to serialize - context selection across all threads in PLT Scheme. + context selection across all threads in Racket. @defmethod[(call-as-current [thunk (-> any)] diff --git a/collects/scribblings/gui/global-draw-funcs.scrbl b/collects/scribblings/gui/global-draw-funcs.scrbl index 98006f2014..0ff0932fa3 100644 --- a/collects/scribblings/gui/global-draw-funcs.scrbl +++ b/collects/scribblings/gui/global-draw-funcs.scrbl @@ -19,7 +19,7 @@ Returns the depth of the main display (a value of 1 denotes a monochrome display } -@defproc[(get-display-left-top-inset [avoid-bars? bool @scheme[#f]]) +@defproc[(get-display-left-top-inset [avoid-bars? bool #f]) (values exact-nonnegative-integer? exact-nonnegative-integer?)]{ When the optional argument is @scheme[#f] (the default), this function @@ -35,7 +35,7 @@ When the optional argument is true, this function returns the amount } -@defproc[(get-display-size [full-screen? bool @scheme[#f]]) +@defproc[(get-display-size [full-screen? bool #f]) (values exact-nonnegative-integer? exact-nonnegative-integer?)]{ @index["screen resolution"]{Gets} the physical size of the display in diff --git a/collects/scribblings/guide/contracts-examples/1-test.rkt b/collects/scribblings/guide/contracts-examples/1-test.rkt index e244da8322..f2bbbb1f24 100644 --- a/collects/scribblings/guide/contracts-examples/1-test.rkt +++ b/collects/scribblings/guide/contracts-examples/1-test.rkt @@ -1,4 +1,4 @@ -#lang scheme +#lang racket (require rackunit rackunit/text-ui "1.ss" "1b.ss") (add (make-basic-customer 'mf "matthias" "brookstone")) diff --git a/collects/scribblings/guide/contracts-examples/1.rkt b/collects/scribblings/guide/contracts-examples/1.rkt index 98247ebe36..992b30e3eb 100644 --- a/collects/scribblings/guide/contracts-examples/1.rkt +++ b/collects/scribblings/guide/contracts-examples/1.rkt @@ -1,4 +1,4 @@ -#lang scheme +#lang racket ;; data definitions (define id? symbol?) diff --git a/collects/scribblings/guide/contracts-examples/1b.rkt b/collects/scribblings/guide/contracts-examples/1b.rkt index 805d8549e0..803c92df26 100644 --- a/collects/scribblings/guide/contracts-examples/1b.rkt +++ b/collects/scribblings/guide/contracts-examples/1b.rkt @@ -1,4 +1,4 @@ -#lang scheme +#lang racket (require "1.ss") ;; the module just above diff --git a/collects/scribblings/guide/contracts-examples/2-test.rkt b/collects/scribblings/guide/contracts-examples/2-test.rkt index 684722a1be..0343fc3224 100644 --- a/collects/scribblings/guide/contracts-examples/2-test.rkt +++ b/collects/scribblings/guide/contracts-examples/2-test.rkt @@ -1,4 +1,4 @@ -#lang scheme +#lang racket (require rackunit rackunit/text-ui "2.ss") (define s0 (initialize (flat-contract integer?) =)) diff --git a/collects/scribblings/guide/contracts-examples/2.rkt b/collects/scribblings/guide/contracts-examples/2.rkt index db4f4479c1..9a53886be4 100644 --- a/collects/scribblings/guide/contracts-examples/2.rkt +++ b/collects/scribblings/guide/contracts-examples/2.rkt @@ -1,4 +1,4 @@ -#lang scheme +#lang racket ;; a contract utility (define (eq/c x) (lambda (y) (eq? x y))) diff --git a/collects/scribblings/guide/contracts-examples/3-test.rkt b/collects/scribblings/guide/contracts-examples/3-test.rkt index e357f8d76a..f25cb4ac4e 100644 --- a/collects/scribblings/guide/contracts-examples/3-test.rkt +++ b/collects/scribblings/guide/contracts-examples/3-test.rkt @@ -1,4 +1,4 @@ -#lang scheme +#lang racket (require rackunit rackunit/text-ui "3.ss") (define d0 (initialize (flat-contract integer?) =)) diff --git a/collects/scribblings/guide/contracts-examples/3.rkt b/collects/scribblings/guide/contracts-examples/3.rkt index d511c25bdc..e3a6dfb694 100644 --- a/collects/scribblings/guide/contracts-examples/3.rkt +++ b/collects/scribblings/guide/contracts-examples/3.rkt @@ -1,4 +1,4 @@ -#lang scheme +#lang racket ;; a shorthand for use below (define-syntax ⇒ diff --git a/collects/scribblings/guide/contracts-examples/5-test.rkt b/collects/scribblings/guide/contracts-examples/5-test.rkt index d903372040..617a87883a 100644 --- a/collects/scribblings/guide/contracts-examples/5-test.rkt +++ b/collects/scribblings/guide/contracts-examples/5-test.rkt @@ -1,4 +1,4 @@ -#lang scheme +#lang racket (require rackunit rackunit/text-ui "5.ss") (define s (put (put (initialize (flat-contract integer?) =) 2) 1)) diff --git a/collects/scribblings/guide/contracts-examples/5.rkt b/collects/scribblings/guide/contracts-examples/5.rkt index d60c7d8305..ceeb0f96ec 100644 --- a/collects/scribblings/guide/contracts-examples/5.rkt +++ b/collects/scribblings/guide/contracts-examples/5.rkt @@ -1,4 +1,4 @@ -#lang scheme +#lang racket ;; Note: this queue doesn't implement the capacity restriction ;; of McKim and Mitchell's queue but this is easy to add. diff --git a/collects/scribblings/guide/futures.scrbl b/collects/scribblings/guide/futures.scrbl index 46f59156f3..38977fc02a 100644 --- a/collects/scribblings/guide/futures.scrbl +++ b/collects/scribblings/guide/futures.scrbl @@ -1,26 +1,26 @@ #lang scribble/doc @(require scribble/manual "guide-utils.ss" - (for-label scheme/flonum scheme/future)) + (for-label racket/flonum racket/future)) @title[#:tag "effective-futures"]{Parallelism with Futures} -The @schememodname[scheme/future] library provides support for -performance improvement through parallelism with the @scheme[future] -and @scheme[touch] functions. The level of parallelism available from +The @racketmodname[racket/future] library provides support for +performance improvement through parallelism with the @racket[future] +and @racket[touch] functions. The level of parallelism available from those constructs, however, is limited by several factors, and the current implementation is best suited to numerical tasks. -@margin-note{Other functions, such as @scheme[thread], support the +@margin-note{Other functions, such as @racket[thread], support the creation of reliably concurrent tasks. However, thread never run truly in parallel, even if the hardware and operating system support parallelism.} -As a starting example, the @scheme[any-double?] function below takes a +As a starting example, the @racket[any-double?] function below takes a list of numbers and determines whether any number in the list has a double that is also in the list: -@schemeblock[ +@racketblock[ (define (any-double? l) (for/or ([i (in-list l)]) (for/or ([i2 (in-list l)]) @@ -28,10 +28,10 @@ double that is also in the list: ] This function runs in quadratic time, so it can take a long time (on -the order of a second) on large lists like @scheme[l1] and -@scheme[l2]: +the order of a second) on large lists like @racket[l1] and +@racket[l2]: -@schemeblock[ +@racketblock[ (define l1 (for/list ([i (in-range 5000)]) (+ (* 2 i) 1))) (define l2 (for/list ([i (in-range 5000)]) @@ -40,30 +40,30 @@ the order of a second) on large lists like @scheme[l1] and (any-double? l2)) ] -The best way to speed up @scheme[any-double?] is to use a different +The best way to speed up @racket[any-double?] is to use a different algorithm. However, on a machine that offers at least two processing units, the example above can run in about half the time using -@scheme[future] and @scheme[touch]: +@racket[future] and @racket[touch]: -@schemeblock[ +@racketblock[ (let ([f (future (lambda () (any-double? l2)))]) (or (any-double? l1) (touch f))) ] -The future @scheme[f] runs @scheme[(any-double? l2)] in parallel to -@scheme[(any-double? l1)], and the result for @scheme[(any-double? +The future @racket[f] runs @racket[(any-double? l2)] in parallel to +@racket[(any-double? l1)], and the result for @racket[(any-double? l2)] becomes available about the same time that it is demanded by -@scheme[(touch f)]. +@racket[(touch f)]. Futures run in parallel as long as they can do so safely, but the notion of ``safe'' for parallelism is inherently tied to the system implementation. The distinction between ``safe'' and ``unsafe'' -operations may be far from apparent at the level of a Scheme program. +operations may be far from apparent at the level of a Racket program. Consider the following core of a Mandelbrot-set computation: -@schemeblock[ +@racketblock[ (define (mandelbrot iterations x y n) (let ((ci (- (/ (* 2.0 y) n) 1.0)) (cr (- (/ (* 2.0 x) n) 1.5))) @@ -79,44 +79,44 @@ Consider the following core of a Mandelbrot-set computation: (+ (* 2.0 zr zi) ci))))))))) ] -The expressions @scheme[(mandelbrot 10000000 62 500 1000)] and -@scheme[(mandelbrot 10000000 62 501 1000)] each take a while to +The expressions @racket[(mandelbrot 10000000 62 500 1000)] and +@racket[(mandelbrot 10000000 62 501 1000)] each take a while to produce an answer. Computing them both, of course, takes twice as long: -@schemeblock[ +@racketblock[ (list (mandelbrot 10000000 62 500 1000) (mandelbrot 10000000 62 501 1000)) ] Unfortunately, attempting to run the two computations in parallel with -@scheme[future] does not improve performance: +@racket[future] does not improve performance: -@schemeblock[ +@racketblock[ (let ([f (future (lambda () (mandelbrot 10000000 62 501 1000)))]) (list (mandelbrot 10000000 62 500 1000) (touch f))) ] -One problem is that the @scheme[*] and @scheme[/] operations in the -first two lines of @scheme[mandelbrot] involve a mixture of exact and +One problem is that the @racket[*] and @racket[/] operations in the +first two lines of @racket[mandelbrot] involve a mixture of exact and inexact real numbers. Such mixtures typically trigger a slow path in execution, and the general slow path is not safe for parallelism. Consequently, the future created in this example is almost immediately suspended, and it cannot resume until -@scheme[touch] is called. +@racket[touch] is called. -Changing the first two lines of @scheme[mandelbrot] addresses that +Changing the first two lines of @racket[mandelbrot] addresses that first the problem: -@schemeblock[ +@racketblock[ (define (mandelbrot iterations x y n) (let ((ci (- (/ (* 2.0 (->fl y)) (->fl n)) 1.0)) (cr (- (/ (* 2.0 (->fl x)) (->fl n)) 1.5))) ....)) ] -With that change, @scheme[mandelbrot] computations can run in +With that change, @racket[mandelbrot] computations can run in parallel. Nevertheless, performance still does not improve. The problem is that most every arithmetic operation in this example produces an inexact number whose storage must be allocated. Especially @@ -124,10 +124,10 @@ frequent allocation triggers communication between parallel tasks that defeats any performance improvement. By using @tech{flonum}-specific operations (see -@secref["fixnums+flonums"]), we can re-write @scheme[mandelbot] to use +@secref["fixnums+flonums"]), we can re-write @racket[mandelbot] to use much less allocation: -@schemeblock[ +@racketblock[ (define (mandelbrot iterations x y n) (let ((ci (fl- (fl/ (* 2.0 (->fl y)) (->fl n)) 1.0)) (cr (fl- (fl/ (* 2.0 (->fl x)) (->fl n)) 1.5))) @@ -143,9 +143,9 @@ much less allocation: (fl+ (fl* 2.0 (fl* zr zi)) ci))))))))) ] -This conversion can speed @scheme[mandelbrot] by a factor of 8, even +This conversion can speed @racket[mandelbrot] by a factor of 8, even in sequential mode, but avoiding allocation also allows -@scheme[mandelbrot] to run usefully faster in parallel. +@racket[mandelbrot] to run usefully faster in parallel. As a general guideline, any operation that is inlined by the @tech{JIT} compiler runs safely in parallel, while other operations @@ -156,14 +156,14 @@ annotates operations that can be inlined by the compiler (see decompiler can be used to help predict parallel performance. To more directly report what is happening in a program that uses -@scheme[future] and @scheme[touch], operations are logged when they +@racket[future] and @racket[touch], operations are logged when they suspend a computation or synchronize with the main computation. For -example, running the original @scheme[mandelbrot] in a future produces -the following output in the @scheme['debug] log level: +example, running the original @racket[mandelbrot] in a future produces +the following output in the @racket['debug] log level: -@margin-note{To see @scheme['debug] logging output on stderr, set the +@margin-note{To see @racket['debug] logging output on stderr, set the @envvar{PLTSTDERR} environment variable to @tt{debug} or start -@exec{mzscheme} with @Flag{W} @tt{debug}.} +@exec{racket} with @Flag{W} @tt{debug}.} @verbatim[#:indent 2]|{ future: 0 waiting for runtime at 1267392979341.989: * @@ -171,11 +171,11 @@ the following output in the @scheme['debug] log level: The message indicates which internal future-running task became blocked on an unsafe operation, the time it blocked (in terms of -@scheme[current-inexact-miliseconds]), and the operation that caused +@racket[current-inexact-miliseconds]), and the operation that caused the computation it to block. -The first revision to @scheme[mandelbrot] avoids suspending at -@scheme[*], but produces many log entries of the form +The first revision to @racket[mandelbrot] avoids suspending at +@racket[*], but produces many log entries of the form @verbatim[#:indent 2]|{ future: 0 waiting for runtime at 1267392980465.066: [acquire_gc_page]