Some random tidyings.

This commit is contained in:
Eli Barzilay 2011-02-16 15:26:11 -05:00
parent 8886b87876
commit 1be26400cb
7 changed files with 1279 additions and 1531 deletions

View File

@ -9,22 +9,25 @@
The preferences dialog consists of several panels.
@section{@onscreen{Font}}
This panel controls the main font used by DrRacket.
@section{@onscreen{Colors}}
The @onscreen{Colors} panel has several sub-panels that let you
configure the colors that DrRacket uses for the editor background,
for highlighting matching parentheses, for the online coloring for
Racket and Java modes, for @onscreen{Check Syntax}, and for the
colors of the text in the @tech{interactions window}.
configure the colors that DrRacket uses for the editor background, for
highlighting matching parentheses, for the online coloring for Racket
and Java modes, for @onscreen{Check Syntax}, and for the colors of the
text in the @tech{interactions window}.
It also has two buttons, @onscreen{White on Black} and @onscreen{Black
on White}, which set a number of defaults for the color preferences and
change a few other aspects of DrRacket's behavior to make DrRacket's
colors look nicer for those two modes.
It also has two buttons, @onscreen{White on Black} and
@onscreen{Black on White}, which set a number of defaults for the
color preferences and change a few other aspects of DrRacket's
behavior to make DrRacket's colors look nicer for those two modes.
@section{@onscreen{Editing}}
@ -39,76 +42,78 @@ The preferences dialog consists of several panels.
@item{@onscreen{Square bracket}
This panel controls which keywords DrRacket uses to determine
when to rewrite @litchar["["] to @litchar["("]. For
@racket[cond]-like keywords, the number in parenthesis indicates
how many sub-expressions are skipped before square brackets are
started.
This panel controls which keywords DrRacket uses to determine when
to rewrite @litchar["["] to @litchar["("]. For @racket[cond]-like
keywords, the number in parenthesis indicates how many
sub-expressions are skipped before square brackets are started.
See @secref["editor"] for details on how the entries in the
columns behave.}
@item{@onscreen{General}
@itemize[@item{@PrefItem{Map delete to backspace} --- If checked, the editor
@itemize[
@item{@PrefItem{Map delete to backspace} --- If checked, the editor
treats the Delete key like the Backspace key.}
@item{@PrefItem{Wrap words in editor buffers} --- If checked,
DrRacket editors auto-wrap text lines by default. Changing this
preference affects new windows only.}
DrRacket editors auto-wrap text lines by default. Changing
this preference affects new windows only.}
@item{@PrefItem{Reuse existing frames when opening new files} ---
If checked, new files are opened in the same DrRacket window,
rather than creating a new DrRacket window for each new file.}
If checked, new files are opened in the same DrRacket
window, rather than creating a new DrRacket window for each
new file.}
@item{@PrefItem{Enable keybindings in menus} --- If checked, some
DrRacket menu items have keybindings. Otherwise, no menu items
have key bindings. This preference is designed for people who are
comfortable editing in Emacs and find the standard menu
keybindings interfere with the Emacs keybindings.}
@item{@PrefItem{Treat command key as meta} --- If checked, DrRacket will use the command key for some Emacs-like keybindings, instead of using it for menu shortcuts. This option is only available under Mac OS X.}
@item{@PrefItem{Color syntax interactively} --- If checked, DrRacket
colors your syntax as you type.}
@item{@PrefItem{Search using anchors} --- If checked, DrRacket's searching mode will jump directly to the first search hit, using an ``anchor'' to determine where to search if the search string changes.}
@item{@PrefItem{Normalize pasted strings} --- If checked, DrRacket adjusts strings that are pasted into the editor to avoid confusion. For example, non-breaking spaces look just like spaces but are not considered separators like ordinary spaces are. If this is checked DrRacket will automatically turn those non-breaking spaces into regular spaces. Similarly with other (less common) characters.}
@item{@PrefItem{Enable overwrite mode keybindings} --- If checked, DrRacket enables the insert keybinding to swap into overwrite mode}
@item{@PrefItem{Show line numbers} --- If checked, DrRacket shows line numbers for the file being edited in the left-hand column}
]}
DrRacket menu items have keybindings. Otherwise, no menu
items have key bindings. This preference is designed for
people who are comfortable editing in Emacs and find the
standard menu keybindings interfere with the Emacs
keybindings.}
@item{@PrefItem{Treat command key as meta} --- If checked,
DrRacket will use the command key for some Emacs-like
keybindings, instead of using it for menu shortcuts. This
option is only available under Mac OS X.}
@item{@PrefItem{Color syntax interactively} --- If checked,
DrRacket colors your syntax as you type.}
@item{@PrefItem{Search using anchors} --- If checked, DrRacket's
searching mode will jump directly to the first search hit,
using an ``anchor'' to determine where to search if the
search string changes.}
@item{@PrefItem{Normalize pasted strings} --- If checked, DrRacket
adjusts strings that are pasted into the editor to avoid
confusion. For example, non-breaking spaces look just like
spaces but are not considered separators like ordinary
spaces are. If this is checked DrRacket will automatically
turn those non-breaking spaces into regular spaces.
Similarly with other (less common) characters.}
@item{@PrefItem{Enable overwrite mode keybindings} --- If checked,
DrRacket enables the insert keybinding to swap into
overwrite mode}
@item{@PrefItem{Show line numbers} --- If checked, DrRacket shows
line numbers for the file being edited in the left-hand
column}]}
@item{@onscreen{Racket}
@itemize[
@item{@PrefItem{Highlight between matching parens} --- If checked,
the editor marks the region between matching parenthesis
with a gray background (in color) or a stipple pattern (in
monochrome) when the blinking caret is next to a
parenthesis.}
@item{@PrefItem{Automatically adjust closing parens} --- If
checked, the editor automatically converts a typed
@litchar[")"] to @litchar["]"] to match @litchar["["], or it
converts a typed @litchar["]"] to @litchar[")"] to match
@litchar["("].}
@item{@PrefItem{Automatically adjust opening square brackets} If
checked, the editor changes typed @litchar["["] to match the
context (as explained in @secref["editor"]).}
@item{@PrefItem{Flash paren match} --- If checked, typing a
closing parenthesis, square bracket, or quotation mark
flashes the matching open parenthesis/bracket/quote.}]}
@item{@PrefItem{Highlight between matching parens} --- If checked, the
editor marks the region between matching parenthesis with a gray
background (in color) or a stipple pattern (in monochrome) when
the blinking caret is next to a parenthesis.}
]
@item{@PrefItem{Automatically adjust closing parens} --- If checked, the editor
automatically converts a typed @litchar[")"] to @litchar["]"] to
match @litchar["["], or it converts a typed @litchar["]"] to
@litchar[")"] to match @litchar["("].}
@item{@PrefItem{Automatically adjust opening square brackets} If checked, the editor changes
typed @litchar["["] to match the context (as explained in
@secref["editor"]).}
@item{@PrefItem{Flash paren match} --- If checked, typing a closing
parenthesis, square bracket, or quotation mark flashes the
matching open parenthesis/bracket/quote.}
]}]
@section{@onscreen{Warnings}}
@ -122,41 +127,41 @@ The preferences dialog consists of several panels.
user before exiting.}
@item{@PrefItem{Ask about normalizing strings} --- If checked, DrRacket
consults the user before normalizing a string pasted into the editor.}
consults the user before normalizing a string pasted into the
editor.}
@item{@PrefItem{Only warn once when executions and interactions are
not synchronized} --- If checked, DrRacket warns the user on the
first interaction after the definitions window, language, or
teachpack is changed without a corresponding click on
@onscreen{Run}. Otherwise, the warning appears on every
interaction.}
@item{@PrefItem{Only warn once when executions and interactions are not
synchronized} --- If checked, DrRacket warns the user on the first
interaction after the definitions window, language, or teachpack
is changed without a corresponding click on @onscreen{Run}.
Otherwise, the warning appears on every interaction.}
@item{@PrefItem{Ask about clearing test coverage} --- If checked,
when test coverage annotations are displayed DrRacket prompts
about removing them. This setting only applies to the PLT
languages. DrRacket never asks in the teaching languages.}
@item{@PrefItem{Ask about clearing test coverage} --- If checked, when
test coverage annotations are displayed DrRacket prompts about
removing them. This setting only applies to the PLT languages.
DrRacket never asks in the teaching languages.}
@item{@PrefItem{Check for newer Racket versions} --- If
checked, DrRacket periodically polls a server to determine
whether a newer version of DrRacket is available.}
@item{@PrefItem{Check for newer Racket versions} --- If checked,
DrRacket periodically polls a server to determine whether a newer
version of DrRacket is available.}
]
@section{@onscreen{General}}
@itemize[
@item{@PrefItem{Number of recent items} --- controls the
length of the @onscreen{Open Recent} menu (in the @onscreen{File}
menu).}
@item{@PrefItem{Number of recent items} --- controls the length of the
@onscreen{Open Recent} menu (in the @onscreen{File} menu).}
@item{@PrefItem{Auto-save files} --- If checked, the editor
generates autosave files (see @secref["drracket-autosave-files"])
for files that have not been saved after five minutes.}
@item{@PrefItem{Auto-save files} --- If checked, the editor generates
autosave files (see @secref["drracket-autosave-files"]) for files
that have not been saved after five minutes.}
@item{@PrefItem{Backup files} --- If checked, when saving a file for
the first time in each editing session, the original copy of the
file is copied to a backup file in the same directory. The backup
@item{@PrefItem{Backup files} --- If checked, when saving a file for the
first time in each editing session, the original copy of the file
is copied to a backup file in the same directory. The backup
files have the same name as the original, except that they end in
either @indexed-file{.bak} or @indexed-file{~}.}
@ -164,61 +169,63 @@ The preferences dialog consists of several panels.
status line at the bottom of each window.}
@item{@PrefItem{Count column numbers from one} --- If checked, the
status line's column counter counts from one. Otherwise, it counts
from zero.}
status line's column counter counts from one. Otherwise, it
counts from zero.}
@item{@PrefItem{Display line numbers in buffer; not character
offsets} --- If checked, the status line shows a
@item{@PrefItem{Display line numbers in buffer; not character offsets}
--- If checked, the status line shows a
@nonterm{line}:@nonterm{column} display for the current selection
rather than the character offset into the text.}
@item{@PrefItem{Automatically print to PostScript file} --- If
checked, printing will automatically save PostScript files. If
not, printing will use the standard printing mechanisms for your
@item{@PrefItem{Automatically print to PostScript file} --- If checked,
printing will automatically save PostScript files. If not,
printing will use the standard printing mechanisms for your
computer.}
@item{@PrefItem{Open files in separate tabs (not separate windows)}
-- If checked, DrRacket will use tabs in the front-most window to
@item{@PrefItem{Open files in separate tabs (not separate windows)} ---
If checked, DrRacket will use tabs in the front-most window to
open new files, rather than creating new windows for new files.}
@item{@PrefItem{Automatically open interactions window when running
a program} -- If checked, DrRacket shows the interactions window
@item{@PrefItem{Automatically open interactions window when running a
program} --- If checked, DrRacket shows the interactions window
(if it is hidden) when a program is run.}
@item{@PrefItem{Automatically switch to the module language when opening a module} --
If checked, DrRacket will recognize files that have a @tt{#lang} line
and adjust the language setting automatically.}
@item{@PrefItem{Automatically switch to the module language when opening
a module} --- If checked, DrRacket will recognize files that have
a @tt{#lang} line and adjust the language setting automatically.}
@item{@PrefItem{Put the interactions window beside the definitions
window} -- If checked, DrRacket puts the interactions window to the
right of the definitions window. By default, the interactions
window} --- If checked, DrRacket puts the interactions window to
the right of the definitions window. By default, the interactions
window is below the definitions window.}
@item{@PrefItem{Always show the #lang line in the Module language} --
If checked, the module language always shows the @hash-lang[]
line (even when it would ordinarily be scrolled off of the page), assuming
that the @hash-lang[] line is the first line in the file.
}
@item{@PrefItem{Always show the #lang line in the Module language} ---
If checked, the module language always shows the @hash-lang[] line
(even when it would ordinarily be scrolled off of the page),
assuming that the @hash-lang[] line is the first line in the file.}
]
@section{@onscreen{Profiling}}
This preference panel configures the profiling report. The band of
color shows the range of colors that profiled functions take
on. Colors near the right are used for code that is not invoked
often and colors on the right are used for code that is invoked
often.
color shows the range of colors that profiled functions take on. Colors
near the right are used for code that is not invoked often and colors on
the right are used for code that is invoked often.
If you are interested in more detail at the low end, choose the
@onscreen{Square root} check box. If you are interested in more
detail at the upper end, choose the @onscreen{Square} check box.
@onscreen{Square root} check box. If you are interested in more detail
at the upper end, choose the @onscreen{Square} check box.
@section{@onscreen{Browser}}
This preferences panel allows you to configure your HTTP
proxy. Contact your system administrator for details.
This preferences panel allows you to configure your HTTP proxy. Contact
your system administrator for details.
@section{@onscreen{Tools}}
This preference panel allows you to configure the currently active plugins.
This preference panel allows you to configure the currently active
plugins.

View File

@ -25,7 +25,7 @@
for more info about edit sequences.
}
@defmethod*[(((run-after-edit-sequence (thunk (-> void)) (tag (union symbol? |#f|) |#f|)) void))]{
@defmethod*[(((run-after-edit-sequence (thunk (-> void)) (tag (union symbol? #f) #f)) void))]{
This method is used to install callbacks that will be run after any
edit-sequence completes.
@ -40,7 +40,7 @@
@method[editor:basic<%> run-after-edit-sequence]'s argument will be called.
}
@defmethod*[(((get-top-level-window) (union |#f| (is-a?/c top-level-window<%>))))]{
@defmethod*[(((get-top-level-window) (union #f (is-a?/c top-level-window<%>))))]{
Returns the
@scheme[top-level-window<%>]
currently associated with this buffer.
@ -53,7 +53,7 @@
Returns @scheme[#t] if the file on disk has been modified, by some other program.
}
@defmethod*[(((save-file/gui-error (filename (union path |#f|) |#f|) (format (union (quote guess) (quote standard) (quote text) (quote text-force-cr) same copy) (quote same)) (show-errors? boolean |#t|)) boolean?))]{
@defmethod*[(((save-file/gui-error (filename (union path #f) #f) (format (union (quote guess) (quote standard) (quote text) (quote text-force-cr) same copy) (quote same)) (show-errors? boolean |#t|)) boolean?))]{
This method is an alternative to
@method[editor<%> save-file]. Rather than showing errors via the original stdout, it
opens a dialog with an error message showing the error.
@ -63,7 +63,7 @@
no error occurred and @scheme[#f] if an error occurred.
}
@defmethod*[(((load-file/gui-error (filename (union string |#f|) |#f|) (format (union (quote guess) (quote standard) (quote text) (quote text-force-cr) (quote same) (quote copy)) (quote guess)) (show-errors? boolean |#t|)) boolean?))]{
@defmethod*[(((load-file/gui-error (filename (union string #f) #f) (format (union (quote guess) (quote standard) (quote text) (quote text-force-cr) (quote same) (quote copy)) (quote guess)) (show-errors? boolean |#t|)) boolean?))]{
This method is an alternative to
@method[editor<%> load-file]. Rather than showing errors via the original stdout, it
opens a dialog with an error message showing the error.
@ -347,7 +347,7 @@
The class that this mixin produces uses the same initialization
arguments as its input.
@defmethod*[#:mode override (((set-filename (name string) (temp? boolean |#f|)) void))]{
@defmethod*[#:mode override (((set-filename (name string) (temp? boolean #f)) void))]{
Updates the filename on each frame displaying this editor, for each
frame that matches
@ -399,7 +399,7 @@
Returns @scheme[#t].
}
@defmethod*[(((do-autosave) (union |#f| string)))]{
@defmethod*[(((do-autosave) (union #f string)))]{
This method is called to perform the autosaving.
See also
@scheme[autosave:register]

View File

@ -7,272 +7,251 @@
@definterface[scheme:sexp-snip<%> ()]{
@defmethod*[(((get-saved-snips) (listof snip%)))]{
This returns the list of snips hidden by the sexp snip.
}
}
@defclass[scheme:sexp-snip% snip% (scheme:sexp-snip<%> readable-snip<%>)]{
@defmethod*[#:mode override (((get-text (offset number) (num number) (flattened? boolean |#f|)) string))]{
Returns the concatenation of the text for all of the hidden
snips.
@defmethod*[#:mode override
(((get-text (offset number) (num number)
(flattened? boolean #f))
string))]{
Returns the concatenation of the text for all of the hidden snips.
}
@defmethod*[#:mode override (((copy) (is-a?/c scheme:sexp-snip%)))]{
Returns a copy of this snip that includes the hidden snips.
}
@defmethod*[#:mode override (((write (stream-out editor-stream-out%)) void))]{
Saves the embedded snips
}
@defmethod*[#:mode override (((draw (dc dc<%>) (x real) (y real) (left real) (top real) (right real) (bottom real) (dx real) (dy real) (draw-caret symbol?)) void))]{
@defmethod*[#:mode override
(((draw (dc dc<%>) (x real) (y real)
(left real) (top real) (right real) (bottom real)
(dx real) (dy real) (draw-caret symbol?))
void))]{
Draws brackets with a centered ellipses between them.
}
@defmethod*[#:mode override (((get-extent (dc (is-a?/c dc<%>)) (x real) (y real) (w boxed |#f|) (h boxed |#f|) (descent boxed |#f|) (space boxed |#f|) (lspace boxed |#f|) (rspace boxed |#f|)) void))]{
@defmethod*[#:mode override
(((get-extent (dc (is-a?/c dc<%>)) (x real) (y real)
(w boxed #f) (h boxed #f)
(descent boxed #f) (space boxed #f)
(lspace boxed #f) (rspace boxed #f))
void))]{
Returns a size corresponding to what this snip draws.
}
}
@definterface[scheme:text<%> (text:basic<%> mode:host-text<%> color:text<%>)]{
Texts matching this interface support Racket mode operations.
@defmethod*[(((get-limit (start exact-integer)) int))]{
Returns a limit for backward-matching parenthesis starting at position
@scheme[start].
Returns a limit for backward-matching parenthesis starting at
position @scheme[start].
}
@defmethod*[(((balance-parens (key-event (instance 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 @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.
}
@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))]{
@defmethod*[(((tabify (start-pos exact-integer
(send this text get-start-position)))
void))]{
Tabs the line containing by @scheme[start-pos]
}
@defmethod*[(((tabify-selection (start exact-integer) (end exact-integer)) void))]{
@defmethod*[(((tabify-selection (start exact-integer) (end exact-integer))
void))]{
Sets the tabbing for the lines containing positions @scheme[start]
through @scheme[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.
@method[scheme:text<%> tabify-on-return?] returns @scheme[#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.
@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.
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 @scheme[start-pos] to @scheme[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 @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.
}
@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.
@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.
}
@defmethod*[(((uncomment-selection (start int) (end int)) void))]{
Uncomments the lines containing positions @scheme[start] through @scheme[end].
Uncomments the lines containing positions @scheme[start] through
@scheme[end].
}
@defmethod*[(((get-forward-sexp (start exact-integer)) (union |#f| exact-integer)))]{
@defmethod*[(((get-forward-sexp (start exact-integer))
(union #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.
}
@defmethod*[(((remove-sexp (start exact-integer)) void))]{
Forward-deletes the S-expression starting after the position @scheme[start].
Forward-deletes the S-expression starting after the position
@scheme[start].
}
@defmethod*[(((forward-sexp (start |#t|)) exact-integer))]{
Moves forward over the S-expression starting at position @scheme[start].
Moves forward over the S-expression starting at position
@scheme[start].
}
@defmethod*[(((flash-forward-sexp (start-pos exact-integer)) void))]{
Flashes the parenthesis that closes the sexpression at
@scheme[start-pos].
}
@defmethod*[(((get-backward-sexp (start exact-integer)) (union exact-integer |#f|)))]{
@defmethod*[(((get-backward-sexp (start exact-integer))
(union 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.
}
@defmethod*[(((flash-backward-sexp (start-pos exact-integer)) void))]{
Flashes the parenthesis that opens the sexpression at
@scheme[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].
}
@defmethod*[(((find-up-sexp (start-pos exact-integer)) (union |#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].
@defmethod*[(((find-up-sexp (start-pos exact-integer))
(union #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].
}
@defmethod*[(((up-sexp (start exact-integer)) void))]{
Moves backward out of the S-expression containing the position @scheme[start].
Moves backward out of the S-expression containing the position
@scheme[start].
}
@defmethod*[(((find-down-sexp (start-pos exact-integer)) (union |#f| exact-integer)))]{
@defmethod*[(((find-down-sexp (start-pos exact-integer))
(union #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].
the sexpression that contains @scheme[start-pos]. If there is no
such sexpression, it returns @scheme[#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
@scheme[start].
}
@defmethod*[(((remove-parens-forward (start exact-integer)) void))]{
Removes the parentheses from the S-expression starting after the
position @scheme[start].
}
@defmethod*[(((select-forward-sexp (start exact-integer)) |#t|))]{
Selects the next S-expression, starting at position @scheme[start].
}
@defmethod*[(((select-backward-sexp (start exact-integer)) |#t|))]{
Selects the previous S-expression, starting at position @scheme[start].
Selects the previous S-expression, starting at position
@scheme[start].
}
@defmethod*[(((select-up-sexp (start exact-integer)) |#t|))]{
Selects the region to the enclosing S-expression, starting at position @scheme[start].
Selects the region to the enclosing S-expression, starting at
position @scheme[start].
}
@defmethod*[(((select-down-sexp (start exact-integer)) |#t|))]{
Selects the region to the next contained S-expression, starting at position @scheme[start].
Selects the region to the next contained S-expression, starting at
position @scheme[start].
}
@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 @scheme[start]
with the next S-expression following @scheme[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.
@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.
}
@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].
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.
This method sets the tab size for this text.
}
@defmethod*[(((introduce-let-ans) void))]{
Adds a let around the current s-expression and a printf into the body
of the let.
Adds a let around the current s-expression and a printf into the
body of the let.
}
@defmethod*[(((move-sexp-out) void))]{
Replaces the sexpression surrounding the insertion point with the
sexpression following the insertion point.
}
}
@defmixin[scheme:text-mixin (text:basic<%> mode:host-text<%> color:text<%> text:autocomplete<%>) (scheme:text<%>)]{
@defmixin[scheme:text-mixin
(text:basic<%> mode:host-text<%> color:text<%> text:autocomplete<%>)
(scheme:text<%>)]{
This mixin adds functionality for editing Racket files.
The result of this mixin uses the same initialization arguments as the
mixin's argument.
@defmethod*[#:mode override (((get-word-at (pos positive-exact-integer)) string))]{
Returns the word just before @scheme[pos], which is then used
as the prefix for auto-completion.
@defmethod*[#:mode override
(((get-word-at (pos positive-exact-integer)) string))]{
Returns the word just before @scheme[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.
@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.
}
}
@definterface[scheme:text-mode<%> ()]{
The result of
@scheme[scheme:text-mode-mixin]
implements this interface.
The result of @scheme[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].
@defmethod*[#:mode override (((on-disable-surrogate) void))]{
@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].
Removes the scheme keymap (see also
@scheme[scheme:get-keymap]) and disables any parenthesis
highlighting in the host editor.
@defmethod*[#:mode override (((on-disable-surrogate) void))]{
Removes the scheme keymap (see also @scheme[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 @scheme[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 @scheme[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%
(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.ss" #rx"^scheme:")

View File

@ -107,7 +107,7 @@
moved. A snip may refuse to be moved by returning @scheme[#f] from
@method[snip% release-from-owner].
}
@defmethod*[(((initial-autowrap-bitmap) (union |#f| (instance bitmap%))))]{
@defmethod*[(((initial-autowrap-bitmap) (union #f (instance bitmap%))))]{
The result of this method is used as the initial autowrap
bitmap. Override this method to change the initial
@scheme[bitmap%]. See also
@ -488,13 +488,13 @@
The contents of the two
editor are kept in sync, as modifications
to this object happen.
@defmethod*[(((get-delegate) (union |#f| (instanceof text%))))]{
@defmethod*[(((get-delegate) (union #f (instanceof 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.
}
@defmethod*[(((set-delegate (delegate (union |#f| (instanceof text%)))) void))]{
@defmethod*[(((set-delegate (delegate (union #f (instanceof text%)))) void))]{
This method sets the current delegate.
@ -531,7 +531,17 @@
Creates and returns an instance of
@scheme[text:1-pixel-string-snip%].
}
@defmethod*[#:mode override (((get-extent (dc (instanceof dc<%>)) (x real) (y real) (w (box (union non-negative-real-number |#f|)) |#f|) (h (box (union non-negative-real-number |#f|)) |#f|) (descent (box (union non-negative-real-number |#f|)) |#f|) (space (box (union non-negative-real-number |#f|)) |#f|) (lspace (box (union non-negative-real-number |#f|)) |#f|) (rspace (box (union non-negative-real-number |#f|)) |#f|)) void))]{
@defmethod*[#:mode override
(((get-extent
(dc (instanceof dc<%>))
(x real) (y real)
(w (box (union non-negative-real-number #f)) #f)
(h (box (union non-negative-real-number #f)) #f)
(descent (box (union non-negative-real-number #f)) #f)
(space (box (union non-negative-real-number #f)) #f)
(lspace (box (union non-negative-real-number #f)) #f)
(rspace (box (union non-negative-real-number #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
@ -573,7 +583,7 @@
Creates and returns an instance of
@scheme[text:1-pixel-tab-snip%].
}
@defmethod*[#:mode override (((get-extent (dc (instanceof dc<%>)) (x real) (y real) (w (box (union non-negative-real-number |#f|)) |#f|) (h (box (union non-negative-real-number |#f|)) |#f|) (descent (box (union non-negative-real-number |#f|)) |#f|) (space (box (union non-negative-real-number |#f|)) |#f|) (lspace (box (union non-negative-real-number |#f|)) |#f|) (rspace (box (union non-negative-real-number |#f|)) |#f|)) void))]{
@defmethod*[#:mode override (((get-extent (dc (instanceof dc<%>)) (x real) (y real) (w (box (union non-negative-real-number #f)) #f) (h (box (union non-negative-real-number #f)) #f) (descent (box (union non-negative-real-number #f)) #f) (space (box (union non-negative-real-number #f)) #f) (lspace (box (union non-negative-real-number #f)) #f) (rspace (box (union non-negative-real-number #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

View File

@ -12,10 +12,10 @@
@defmodule[compiler/zo-parse]
@defproc[(zo-parse [in input-port? (current-input-port)]) compilation-top?]{
Parses a port (typically the result of opening a @filepath{.zo} file)
containing bytecode. Beware that the structure types used to represent the
bytecode are subject to frequent changes across Racket versons.
containing bytecode. Beware that the structure types used to
represent the bytecode are subject to frequent changes across Racket
versons.
The parsed bytecode is returned in a @racket[compilation-top]
structure. For a compiled module, the @racket[compilation-top]
@ -37,21 +37,21 @@ stack. For example, execution of an @racket[application] structure
reserves space on the stack for each argument result. Similarly, when
a @racket[let-one] structure (for a simple @racket[let]) is executed,
the value obtained by evaluating the right-hand side expression is
pushed onto the stack, and then the body is evaluated. Local variables
are always accessed as offsets from the current stack position. When a
function is called, its arguments are passed on the stack. A closure
is created by transferring values from the stack to a flat closure
record, and when a closure is applied, the saved values are restored
on the stack (though possibly in a different order and likely in a
more compact layout than when they were captured).
pushed onto the stack, and then the body is evaluated. Local
variables are always accessed as offsets from the current stack
position. When a function is called, its arguments are passed on the
stack. A closure is created by transferring values from the stack to
a flat closure record, and when a closure is applied, the saved values
are restored on the stack (though possibly in a different order and
likely in a more compact layout than when they were captured).
When a sub-expression produces a value, then the stack pointer is
restored to its location from before evaluating the
sub-expression. For example, evaluating the right-hand size for a
@racket[let-one] structure may temporarily push values onto the stack,
but the stack is restored to its pre-@racket[let-one] position before
pushing the resulting value and continuing with the body. In addition,
a tail call resets the stack pointer to the position that follows the
restored to its location from before evaluating the sub-expression.
For example, evaluating the right-hand size for a @racket[let-one]
structure may temporarily push values onto the stack, but the stack is
restored to its pre-@racket[let-one] position before pushing the
resulting value and continuing with the body. In addition, a tail
call resets the stack pointer to the position that follows the
enclosing function's arguments, and then the tail call continues by
pushing onto the stack the arguments for the tail-called function.
@ -77,23 +77,23 @@ the stack) before evaluating expressions that might use them.}
@defstruct+[zo ()]{
A supertype for all zo objects that can appear in compiled code.}
@defstruct+[(compilation-top zo) ([max-let-depth exact-nonnegative-integer?]
@defstruct+[(compilation-top zo)
([max-let-depth exact-nonnegative-integer?]
[prefix prefix?]
[code (or/c form? any/c)])]{
Wraps compiled code. The @racket[max-let-depth] field indicates the
maximum stack depth that @racket[code] creates (not counting the
@racket[prefix] array). The @racket[prefix] field describes top-level
variables, module-level variables, and quoted syntax-objects accessed
by @racket[code]. The @racket[code] field contains executable code; it
is normally a @racket[form], but a literal value is represented as
by @racket[code]. The @racket[code] field contains executable code;
it is normally a @racket[form], but a literal value is represented as
itself.}
@defstruct+[(prefix zo) ([num-lifts exact-nonnegative-integer?]
[toplevels (listof (or/c #f symbol? global-bucket? module-variable?))]
@defstruct+[(prefix zo)
([num-lifts exact-nonnegative-integer?]
[toplevels (listof (or/c #f symbol? global-bucket?
module-variable?))]
[stxs (listof stx?)])]{
Represents a ``prefix'' that is pushed onto the stack to initiate
evaluation. The prefix is an array, where buckets holding the values
for @racket[toplevels] are first, then a bucket for another array if
@ -101,38 +101,29 @@ for @racket[toplevels] are first, then a bucket for another array if
lifted local procedures.
In @racket[toplevels], each element is one of the following:
@itemize[
@item{a @racket[#f], which indicates a dummy variable that is used to
access the enclosing module/namespace at run time;}
@item{a @racket[#f], which indicates a dummy variable that is used
to access the enclosing module/namespace at run time;}
@item{a symbol, which is a reference to a variable defined in the
enclosing module;}
@item{a @racket[global-bucket], which is a top-level variable
(appears only outside of modules); or}
@item{a @racket[global-bucket], which is a top-level variable (appears
only outside of modules); or}
@item{a @racket[module-variable], which indicates a variable imported
from another module.}
]
The variable buckets and syntax objects that are recorded in a prefix
are accessed by @racket[toplevel] and @racket[topsyntax] expression
forms.}
@defstruct+[(global-bucket zo) ([name symbol?])]{
Represents a top-level variable, and used only in a @racket[prefix].}
@defstruct+[(module-variable zo) ([modidx module-path-index?]
@defstruct+[(module-variable zo)
([modidx module-path-index?]
[sym symbol?]
[pos exact-integer?]
[phase (or/c 0 1)])]{
Represents a top-level variable, and used only in a @racket[prefix].
The @racket[pos] may record the variable's offset within its module,
or it can be @racket[-1] if the variable is always located by name.
@ -141,7 +132,6 @@ its module.}
@defstruct+[(stx zo) ([encoded wrapped?])]{
Wraps a syntax object in a @racket[prefix].}
@ -149,17 +139,16 @@ Wraps a syntax object in a @racket[prefix].}
@section{Forms}
@defstruct+[(form zo) ()]{
A supertype for all forms that can appear in compiled code (including
@racket[expr]s), except for literals that are represented as
themselves.}
@defstruct+[(def-values form) ([ids (listof toplevel?)]
@defstruct+[(def-values form)
([ids (listof toplevel?)]
[rhs (or/c expr? seq? any/c)])]{
Represents a @racket[define-values] form. Each element of @racket[ids]
will reference via the prefix either a top-level variable or a local
module variable.
Represents a @racket[define-values] form. Each element of
@racket[ids] will reference via the prefix either a top-level variable
or a local module variable.
After @racket[rhs] is evaluated, the stack is restored to its depth
from before evaluating @racket[rhs].}
@ -169,31 +158,28 @@ from before evaluating @racket[rhs].}
[rhs (or/c expr? seq? any/c)]
[prefix prefix?]
[max-let-depth exact-nonnegative-integer?])]
@defstruct+[(def-for-syntax form) ([ids (listof toplevel?)]
@defstruct+[(def-for-syntax form)
([ids (listof toplevel?)]
[rhs (or/c expr? seq? any/c)]
[prefix prefix?]
[max-let-depth exact-nonnegative-integer?])]
)]{
Represents a @racket[define-syntaxes] or
@racket[define-values-for-syntax] form. The @racket[rhs] expression
has its own @racket[prefix], which is pushed before evaluating
@racket[rhs]; the stack is restored after obtaining the result
values. The @racket[max-let-depth] field indicates the maximum size of
the stack that will be created by @racket[rhs] (not counting
@racket[rhs]; the stack is restored after obtaining the result values.
The @racket[max-let-depth] field indicates the maximum size of the
stack that will be created by @racket[rhs] (not counting
@racket[prefix]).}
@defstruct+[(req form) ([reqs stx?]
[dummy toplevel?])]{
Represents a top-level @racket[#%require] form (but not one in a
@racket[module] form) with a sequence of specifications
@racket[reqs]. The @racket[dummy] variable is used to access to the
top-level namespace.}
@racket[module] form) with a sequence of specifications @racket[reqs].
The @racket[dummy] variable is used to access to the top-level
namespace.}
@defstruct+[(seq form) ([forms (listof (or/c form? any/c))])]{
Represents a @racket[begin] form, either as an expression or at the
top level (though the latter is more commonly a @racket[splice] form).
When a @racket[seq] appears in an expression position, its
@ -202,17 +188,15 @@ When a @racket[seq] appears in an expression position, its
After each form in @racket[forms] is evaluated, the stack is restored
to its depth from before evaluating the form.}
@defstruct+[(splice form) ([forms (listof (or/c form? any/c))])]{
Represents a top-level @racket[begin] form where each evaluation is
wrapped with a continuation prompt.
After each form in @racket[forms] is evaluated, the stack is restored
to its depth from before evaluating the form.}
@defstruct+[(mod form) ([name symbol?]
@defstruct+[(mod form)
([name symbol?]
[srcname symbol?]
[self-modidx module-path-index?]
[prefix prefix?]
@ -223,17 +207,16 @@ to its depth from before evaluating the form.}
(listof module-path-index?)))]
[body (listof (or/c form? any/c))]
[syntax-body (listof (or/c def-syntaxes? def-for-syntax?))]
[unexported (list/c (listof symbol?) (listof symbol?)
[unexported (list/c (listof symbol?)
(listof symbol?)
(listof symbol?))]
[max-let-depth exact-nonnegative-integer?]
[dummy toplevel?]
[lang-info (or/c #f (vector/c module-path? symbol? any/c))]
[internal-context (or/c #f #t stx?)])]{
Represents a @racket[module] declaration. The @racket[body] forms use
@racket[prefix], rather than any prefix in place for the module
declaration itself (and each @racket[syntax-body] has its own
prefix).
declaration itself (and each @racket[syntax-body] has its own prefix).
The @racket[provides] and @racket[requires] lists are each an
association list from phases to exports or imports. In the case of
@ -261,33 +244,33 @@ provides information about the module's implementation language.
The @racket[internal-module-context] value describes the lexical
context of the body of the module. This value is used by
@racket[module->namespace]. A @racket[#f] value means that the context
is unavailable or empty. A @racket[#t] value means that the context is
computed by re-importing all required modules. A syntax-object value
embeds an arbitrary lexical context.}
@racket[module->namespace]. A @racket[#f] value means that the
context is unavailable or empty. A @racket[#t] value means that the
context is computed by re-importing all required modules. A
syntax-object value embeds an arbitrary lexical context.}
@defstruct+[provided ([name symbol?]
@defstruct+[provided
([name symbol?]
[src (or/c module-path-index? #f)]
[src-name symbol?]
[nom-mod (or/c module-path-index? #f)]
[src-phase (or/c 0 1)]
[protected? boolean?]
[insp (or #t #f void?)])]{
Describes an individual provided identifier within a @racket[mod] instance.}
Describes an individual provided identifier within a @racket[mod]
instance.}
@; --------------------------------------------------
@section{Expressions}
@defstruct+[(expr form) ()]{
A supertype for all expression forms that can appear in compiled code,
except for literals that are represented as themselves and some @racket[seq]
structures (which can appear as an expression as long as it contains
only other things that can be expressions).}
except for literals that are represented as themselves and some
@racket[seq] structures (which can appear as an expression as long as
it contains only other things that can be expressions).}
@defstruct+[(lam expr) ([name (or/c symbol? vector?)]
@defstruct+[(lam expr)
([name (or/c symbol? vector?)]
[flags (listof (or/c 'preserves-marks 'is-method 'single-result 'only-rest-arg-not-used))]
[num-params exact-nonnegative-integer?]
[param-types (listof (or/c 'val 'ref 'flonum))]
@ -296,7 +279,6 @@ only other things that can be expressions).}
[closure-types (listof (or/c 'val/ref 'flonum))]
[max-let-depth exact-nonnegative-integer?]
[body (or/c expr? seq? any/c)])]{
Represents a @racket[lambda] form. The @racket[name] field is a name
for debugging purposes. The @racket[num-params] field indicates the
number of arguments accepted by the procedure, not counting a rest
@ -310,8 +292,8 @@ local variable), or @racket['flonum] for a flonum argument. The
captured when evaluating the @racket[lambda] form to create a closure.
The @racket[closure-types] field provides a corresponding list of
types, but no distinction is made between normal values and boxed
values; also, this information is redundant, since it can be inferred by
the bindings referenced though @racket[closure-map].
values; also, this information is redundant, since it can be inferred
by the bindings referenced though @racket[closure-map].
When the function is called, the rest-argument list (if any) is pushed
onto the stack, then the normal arguments in reverse order, then the
@ -324,28 +306,25 @@ created by @racket[body] plus the arguments and closure-captured
values pushed onto the stack. The @racket[body] field is the
expression for the closure's body.}
@defstruct+[(closure expr) ([code lam?] [gen-id symbol?])]{
@defstruct+[(closure expr)
([code lam?] [gen-id symbol?])]{
A @racket[lambda] form with an empty closure, which is a procedure
constant. The procedure constant can appear multiple times in the
graph of expressions for bytecode, and the @racket[code] field can
be a cycle for a recursive constant procedure; the @racket[gen-id]
is different for each such constant.}
graph of expressions for bytecode, and the @racket[code] field can be
a cycle for a recursive constant procedure; the @racket[gen-id] is
different for each such constant.}
@defstruct+[(case-lam expr) ([name (or/c symbol? vector?)]
[clauses (listof lam?)])]{
Represents a @racket[case-lambda] form as a combination of
@racket[lambda] forms that are tried (in order) based on the number of
arguments given.}
@defstruct+[(let-one expr) ([rhs (or/c expr? seq? any/c)]
@defstruct+[(let-one expr)
([rhs (or/c expr? seq? any/c)]
[body (or/c expr? seq? any/c)]
[flonum? boolean?]
[unused? boolean?])]{
Pushes an uninitialized slot onto the stack, evaluates @racket[rhs]
and puts its value into the slot, and then runs @racket[body]. If
@racket[flonum?] is @racket[#t], then @racket[rhs] must produce a
@ -356,25 +335,23 @@ onto the stack (but @racket[rhs] is constrained to produce a single
value).
After @racket[rhs] is evaluated, the stack is restored to its depth
from before evaluating @racket[rhs]. Note that the new slot is created
before evaluating @racket[rhs].}
from before evaluating @racket[rhs]. Note that the new slot is
created before evaluating @racket[rhs].}
@defstruct+[(let-void expr) ([count exact-nonnegative-integer?]
@defstruct+[(let-void expr)
([count exact-nonnegative-integer?]
[boxes? boolean?]
[body (or/c expr? seq? any/c)])]{
Pushes @racket[count] uninitialized slots onto the stack and then runs
@racket[body]. If @racket[boxes?] is @racket[#t], then the slots are
filled with boxes that contain @|undefined-const|.}
@defstruct+[(install-value expr) ([count exact-nonnegative-integer?]
@defstruct+[(install-value expr)
([count exact-nonnegative-integer?]
[pos exact-nonnegative-integer?]
[boxes? boolean?]
[rhs (or/c expr? seq? any/c)]
[body (or/c expr? seq? any/c)])]{
Runs @racket[rhs] to obtain @racket[count] results, and installs them
into existing slots on the stack in order, skipping the first
@racket[pos] stack positions. If @racket[boxes?] is @racket[#t], then
@ -383,24 +360,20 @@ the values are put into existing boxes in the stack slots.
After @racket[rhs] is evaluated, the stack is restored to its depth
from before evaluating @racket[rhs].}
@defstruct+[(let-rec expr) ([procs (listof lam?)]
[body (or/c expr? seq? any/c)])]{
Represents a @racket[letrec] form with @racket[lambda] bindings. It
allocates a closure shell for each @racket[lambda] form in
@racket[procs], installs each onto the stack in previously
allocated slots in reverse order (so that the closure shell for the
last element of @racket[procs] is installed at stack position
@racket[0]), fills out each shell's closure (where each closure
normally references some other just-created closures, which is
possible because the shells have been installed on the stack), and
then evaluates @racket[body].}
@racket[procs], installs each onto the stack in previously allocated
slots in reverse order (so that the closure shell for the last element
of @racket[procs] is installed at stack position @racket[0]), fills
out each shell's closure (where each closure normally references some
other just-created closures, which is possible because the shells have
been installed on the stack), and then evaluates @racket[body].}
@defstruct+[(boxenv expr) ([pos exact-nonnegative-integer?]
@defstruct+[(boxenv expr)
([pos exact-nonnegative-integer?]
[body (or/c expr? seq? any/c)])]{
Skips @racket[pos] elements of the stack, setting the slot afterward
to a new box containing the slot's old value, and then runs
@racket[body]. This form appears when a @racket[lambda] argument is
@ -408,13 +381,12 @@ mutated using @racket[set!] within its body; calling the function
initially pushes the value directly on the stack, and this form boxes
the value so that it can be mutated later.}
@defstruct+[(localref expr) ([unbox? boolean?]
@defstruct+[(localref expr)
([unbox? boolean?]
[pos exact-nonnegative-integer?]
[clear? boolean?]
[other-clears? boolean?]
[flonum? boolean?])]{
Represents a local-variable reference; it accesses the value in the
stack slot after the first @racket[pos] slots. If @racket[unbox?] is
@racket[#t], the stack slot contains a box, and a value is extracted
@ -425,12 +397,11 @@ that can prevent reclamation of the value as garbage). If
the same stack slot may clear after reading. If @racket[flonum?] is
@racket[#t], the slot holds to a flonum value.}
@defstruct+[(toplevel expr) ([depth exact-nonnegative-integer?]
@defstruct+[(toplevel expr)
([depth exact-nonnegative-integer?]
[pos exact-nonnegative-integer?]
[const? boolean?]
[ready? boolean?])]{
Represents a reference to a top-level or imported variable via the
@racket[prefix] array. The @racket[depth] field indicates the number
of stack slots to skip to reach the prefix array, and @racket[pos] is
@ -443,42 +414,38 @@ value might change in the future). If @racket[const?] and
@racket[ready?] are both @racket[#f], then a check is needed to
determine whether the variable is defined.}
@defstruct+[(topsyntax expr) ([depth exact-nonnegative-integer?]
@defstruct+[(topsyntax expr)
([depth exact-nonnegative-integer?]
[pos exact-nonnegative-integer?]
[midpt exact-nonnegative-integer?])]{
Represents a reference to a quoted syntax object via the
@racket[prefix] array. The @racket[depth] field indicates the number
of stack slots to skip to reach the prefix array, and @racket[pos] is
the offset into the array. The @racket[midpt] value is used internally
for lazy calculation of syntax information.}
the offset into the array. The @racket[midpt] value is used
internally for lazy calculation of syntax information.}
@defstruct+[(application expr) ([rator (or/c expr? seq? any/c)]
@defstruct+[(application expr)
([rator (or/c expr? seq? any/c)]
[rands (listof (or/c expr? seq? any/c))])]{
Represents a function call. The @racket[rator] field is the expression
for the function, and @racket[rands] are the argument
Represents a function call. The @racket[rator] field is the
expression for the function, and @racket[rands] are the argument
expressions. Before any of the expressions are evaluated,
@racket[(length rands)] uninitialized stack slots are created (to be
used as temporary space).}
@defstruct+[(branch expr) ([test (or/c expr? seq? any/c)]
@defstruct+[(branch expr)
([test (or/c expr? seq? any/c)]
[then (or/c expr? seq? any/c)]
[else (or/c expr? seq? any/c)])]{
Represents an @racket[if] form.
After @racket[test] is evaluated, the stack is restored to its depth
from before evaluating @racket[test].}
@defstruct+[(with-cont-mark expr) ([key (or/c expr? seq? any/c)]
@defstruct+[(with-cont-mark expr)
([key (or/c expr? seq? any/c)]
[val (or/c expr? seq? any/c)]
[body (or/c expr? seq? any/c)])]{
Represents a @racket[with-continuation-mark] expression.
After each of @racket[key] and @racket[val] is evaluated, the stack is
@ -486,22 +453,18 @@ restored to its depth from before evaluating @racket[key] or
@racket[val].}
@defstruct+[(beg0 expr) ([seq (listof (or/c expr? seq? any/c))])]{
Represents a @racket[begin0] expression.
After each expression in @racket[seq] is evaluated, the stack is
restored to its depth from before evaluating the expression.}
@defstruct+[(varref expr) ([toplevel toplevel?])]{
Represents a @racket[#%variable-reference] form.}
@defstruct+[(assign expr) ([id toplevel?]
@defstruct+[(assign expr)
([id toplevel?]
[rhs (or/c expr? seq? any/c)]
[undef-ok? boolean?])]{
Represents a @racket[set!] expression that assigns to a top-level or
module-level variable. (Assignments to local variables are represented
by @racket[install-value] expressions.)
@ -509,62 +472,57 @@ by @racket[install-value] expressions.)
After @racket[rhs] is evaluated, the stack is restored to its depth
from before evaluating @racket[rhs].}
@defstruct+[(apply-values expr) ([proc (or/c expr? seq? any/c)]
@defstruct+[(apply-values expr)
([proc (or/c expr? seq? any/c)]
[args-expr (or/c expr? seq? any/c)])]{
Represents @racket[(call-with-values (lambda () args-expr) proc)],
which is handled specially by the run-time system.}
@defstruct+[(primval expr) ([id exact-nonnegative-integer?])]{
@defstruct+[(primval expr)
([id exact-nonnegative-integer?])]{
Represents a direct reference to a variable imported from the run-time
kernel.}
@; --------------------------------------------------
@section{Syntax Objects}
@defstruct+[(wrapped zo) ([datum any/c]
@defstruct+[(wrapped zo)
([datum any/c]
[wraps (listof wrap?)]
[certs (or/c certificate? #f)])]{
Represents a syntax object, where @racket[wraps] contain the lexical
information and @racket[certs] is certificate information. When the
@racket[datum] part is itself compound, its pieces are wrapped, too.}
@defstruct+[(certificate zo) ()]{
A supertype for syntax certificates.}
@defstruct+[(certificate:nest certificate) ([nested (listof number? module-path-index? ...)]
@defstruct+[(certificate:nest certificate)
([nested (listof number? module-path-index? ...)]
[map (listof number? module-path-index? ...)])]{
A nested certificate.}
@defstruct+[(certificate:ref certificate) ([val any/c]
@defstruct+[(certificate:ref certificate)
([val any/c]
[map (listof number? module-path-index? ...)])]{
A reference certificate.}
@defstruct+[(certificate:plain certificate) ([map (listof number? module-path-index? ...)])]{
@defstruct+[(certificate:plain certificate)
([map (listof number? module-path-index? ...)])]{
A plain certificate.}
@defstruct+[(wrap zo) ()]{
A supertype for lexical-information elements.}
@defstruct+[(top-level-rename wrap) ([flag boolean?])]{
A top-level renaming.}
@defstruct+[(mark-barrier wrap) ([value symbol?])]{
A mark barrier.}
@defstruct+[(free-id-info zo) ([path0 module-path-index?]
@defstruct+[(free-id-info zo)
([path0 module-path-index?]
[symbol0 symbol?]
[path1 module-path-index?]
[symbol1 symbol?]
@ -574,100 +532,95 @@ A mark barrier.}
[use-current-inspector? boolean?])]{
Information about a free identifier.}
@defstruct+[(lexical-rename wrap) ([has-free-id-info? boolean?]
@defstruct+[(lexical-rename wrap)
([has-free-id-info? boolean?]
[bool2 boolean?]
[alist (listof
[alist
(listof
(cons/c symbol?
(or/c
symbol?
(cons/c
symbol?
(or/c
(cons/c symbol? (or/c symbol? #f))
(or/c symbol?
(cons/c symbol?
(or/c (cons/c symbol? (or/c symbol? #f))
free-id-info?)))))])]{
A local-binding mapping from symbols to binding-set names.}
@defstruct+[(phase-shift wrap) ([amt exact-integer?]
@defstruct+[(phase-shift wrap)
([amt exact-integer?]
[src module-path-index?]
[dest module-path-index?])]{
Shifts module bindings later in the wrap set.}
@defstruct+[(module-rename wrap) ([phase exact-integer?]
@defstruct+[(module-rename wrap)
([phase exact-integer?]
[kind (or/c 'marked 'normal)]
[set-id any/c]
[unmarshals (listof make-all-from-module?)]
[renames (listof module-binding?)]
[mark-renames any/c]
[plus-kern? boolean?])]{
Represents a set of module and import bindings.}
@defstruct+[(all-from-module zo) ([path module-path-index?]
@defstruct+[(all-from-module zo)
([path module-path-index?]
[phase (or/c exact-integer? #f)]
[src-phase (or/c exact-integer? #f)]
[exceptions (listof (or/c symbol? number?))]
[prefix (or/c symbol? #f)])]{
Represents a set of simple imports from one module within a
@racket[module-rename].}
@defstruct+[(module-binding zo) ()]{
A supertype for module bindings.}
@defstruct+[(simple-module-binding module-binding) ([path module-path-index?])]{
@defstruct+[(simple-module-binding module-binding)
([path module-path-index?])]{
Represents a single identifier import within a
@racket[module-rename].}
Represents a single identifier import within
a @racket[module-rename].}
@defstruct+[(phased-module-binding module-binding) ([path module-path-index?]
@defstruct+[(phased-module-binding module-binding)
([path module-path-index?]
[phase exact-integer?]
[export-name any/c]
[nominal-path nominal-path?]
[nominal-export-name any/c])]{
Represents a single identifier import within a
@racket[module-rename].}
Represents a single identifier import within
a @racket[module-rename].}
@defstruct+[(exported-nominal-module-binding module-binding) ([path module-path-index?]
@defstruct+[(exported-nominal-module-binding module-binding)
([path module-path-index?]
[export-name any/c]
[nominal-path nominal-path?]
[nominal-export-name any/c])]{
Represents a single identifier import within a
@racket[module-rename].}
Represents a single identifier import within
a @racket[module-rename].}
@defstruct+[(nominal-module-binding module-binding) ([path module-path-index?]
@defstruct+[(nominal-module-binding module-binding)
([path module-path-index?]
[nominal-path nominal-path?])]{
Represents a single identifier import within a
@racket[module-rename].}
Represents a single identifier import within
a @racket[module-rename].}
@defstruct+[(exported-module-binding module-binding) ([path module-path-index?]
@defstruct+[(exported-module-binding module-binding)
([path module-path-index?]
[export-name any/c])]{
Represents a single identifier import within
a @racket[module-rename].}
Represents a single identifier import within a
@racket[module-rename].}
@defstruct+[(nominal-path zo) ()]{
A supertype for nominal paths.}
@defstruct+[(simple-nominal-path nominal-path) ([value module-path-index?])]{
@defstruct+[(simple-nominal-path nominal-path)
([value module-path-index?])]{
Represents a simple nominal path.}
@defstruct+[(imported-nominal-path nominal-path) ([value module-path-index?]
@defstruct+[(imported-nominal-path nominal-path)
([value module-path-index?]
[import-phase exact-integer?])]{
Represents an imported nominal path.}
@defstruct+[(phased-nominal-path nominal-path) ([value module-path-index?]
@defstruct+[(phased-nominal-path nominal-path)
([value module-path-index?]
[import-phase (or/c false/c exact-integer?)]
[phase exact-integer?])]{
Represents a phased nominal path.}

File diff suppressed because it is too large Load Diff

View File

@ -713,7 +713,10 @@ that the button is not referenced by this frame and thus can be gc'd.
}
@defclass[drracket:unit:definitions-text% (drracket:rep:drs-bindings-keymap-mixin (drracket:unit:program-editor-mixin (scheme:text-mixin text:info%))) (drracket:unit:definitions-text<%>)]{
@defclass[drracket:unit:definitions-text%
(drracket:rep:drs-bindings-keymap-mixin
(drracket:unit:program-editor-mixin (scheme:text-mixin text:info%)))
(drracket:unit:definitions-text<%>)]{
@defconstructor[()]{
Passes all arguments to @scheme[super-init].