rackety framework and tools docs
This commit is contained in:
parent
6cfc0b481d
commit
6563ef6812
|
@ -61,12 +61,11 @@ all of the names in the tools library, for use defining keybindings
|
|||
These buttons are ``opt out'', meaning that if the language doesn't explicitly ask to not
|
||||
have this button (or all such buttons), the button will appear.
|
||||
|
||||
@section-index["drscheme:opt-out-toolbar-buttons"]
|
||||
See @racket[read-language] for more details on how language's specify how to opt out.
|
||||
DrRacket will invoke the @tt{get-info} proc from @racket[read-language] with
|
||||
@tt{'drscheme:opt-out-toolbar-buttons}. If the result is a list of symbols, the
|
||||
@indexed-scheme['drscheme:opt-out-toolbar-buttons]. If the result is a list of symbols, the
|
||||
listed symbols are opted out. If the result is @racket[#f], all buttons are opted
|
||||
out. The default is the empty list, meaning that all opt-out buttons appear..
|
||||
out. The default is the empty list, meaning that all opt-out buttons appear.
|
||||
})
|
||||
|
||||
(proc-doc/names
|
||||
|
|
|
@ -247,7 +247,7 @@
|
|||
(-> void?)
|
||||
()
|
||||
@{Adds a preferences panel for configuring options related to
|
||||
Scheme.})
|
||||
Racket.})
|
||||
|
||||
(proc-doc/names
|
||||
preferences:add-to-warnings-checkbox-panel
|
||||
|
@ -261,7 +261,7 @@
|
|||
(((is-a?/c vertical-panel%) . -> . void?) . -> . void?)
|
||||
(proc)
|
||||
@{Saves @scheme[proc] until the preferences panel is created, when it
|
||||
is called with the Scheme preferences panel to add new children to
|
||||
is called with the Racket preferences panel to add new children to
|
||||
the panel.})
|
||||
|
||||
(proc-doc/names
|
||||
|
@ -1343,14 +1343,14 @@
|
|||
scheme:get-keymap
|
||||
(-> (is-a?/c keymap%))
|
||||
()
|
||||
@{Returns a keymap with binding suitable for Scheme.})
|
||||
@{Returns a keymap with binding suitable for Racket.})
|
||||
|
||||
(proc-doc/names
|
||||
scheme:add-coloring-preferences-panel
|
||||
(-> any)
|
||||
()
|
||||
@{
|
||||
Installs the ``Scheme'' preferences panel in the ``Syntax Coloring''
|
||||
Installs the ``Racket'' preferences panel in the ``Syntax Coloring''
|
||||
section.})
|
||||
|
||||
(proc-doc/names
|
||||
|
@ -1359,7 +1359,7 @@
|
|||
()
|
||||
@{Returns
|
||||
a table mapping from symbols
|
||||
(naming the categories that the online colorer uses for Scheme mode coloring) to their colors.
|
||||
(naming the categories that the online colorer uses for Racket mode coloring) to their colors.
|
||||
|
||||
These symbols are suitable for input to
|
||||
@scheme[scheme:short-sym->pref-name] and
|
||||
|
@ -1373,7 +1373,7 @@
|
|||
()
|
||||
@{Returns
|
||||
a table mapping from symbols
|
||||
(naming the categories that the online colorer uses for Scheme mode coloring) to their colors when
|
||||
(naming the categories that the online colorer uses for Racket mode coloring) to their colors when
|
||||
the user chooses the white-on-black mode in the preferences dialog.
|
||||
|
||||
See also @scheme[scheme:get-color-prefs-table].})
|
||||
|
@ -1399,7 +1399,7 @@
|
|||
(-> (is-a?/c editor-wordbreak-map%))
|
||||
()
|
||||
@{This method returns a @scheme[editor-wordbreak-map%] that is suitable
|
||||
for Scheme.})
|
||||
for Racket.})
|
||||
|
||||
(proc-doc/names
|
||||
scheme:init-wordbreak-map
|
||||
|
@ -1411,7 +1411,7 @@
|
|||
scheme:setup-keymap
|
||||
((is-a?/c keymap%) . -> . void?)
|
||||
(keymap)
|
||||
@{Initializes @scheme[keymap] with Scheme-mode keybindings.})
|
||||
@{Initializes @scheme[keymap] with Racket-mode keybindings.})
|
||||
|
||||
(proc-doc/names
|
||||
editor:set-default-font-color
|
||||
|
|
|
@ -77,7 +77,7 @@ the names documented in this library.
|
|||
The module @schememodname[redex/reduction-semantics]
|
||||
provides only the non-GUI portions of what is described in
|
||||
this manual (everything except the last two sections),
|
||||
making it suitable for use with @tt{mzscheme} scripts.
|
||||
making it suitable for use with @tt{racket} scripts.
|
||||
|
||||
@table-of-contents[]
|
||||
|
||||
|
@ -109,20 +109,20 @@ in the grammar are terminals.
|
|||
real
|
||||
string
|
||||
variable
|
||||
(variable-except <id> ...)
|
||||
(variable-prefix <id>)
|
||||
(variable-except id ...)
|
||||
(variable-prefix id)
|
||||
variable-not-otherwise-mentioned
|
||||
hole
|
||||
symbol
|
||||
(name <id> <pattern>)
|
||||
(in-hole <pattern> <pattern>)
|
||||
(hide-hole <pattern>)
|
||||
(side-condition <pattern> guard)
|
||||
(cross <id>)
|
||||
(name id pattern)
|
||||
(in-hole pattern pattern)
|
||||
(hide-hole pattern)
|
||||
(side-condition pattern guard)
|
||||
(cross id)
|
||||
(<pattern-sequence> ...)
|
||||
<scheme-constant>]
|
||||
racket-constant]
|
||||
[pattern-sequence
|
||||
<pattern>
|
||||
pattern
|
||||
(code:line ... (code:comment "literal ellipsis"))
|
||||
..._id])
|
||||
|
||||
|
@ -262,9 +262,9 @@ there via @tt{_} pattersn) are bound using @scheme[term-let] in the
|
|||
guard.
|
||||
}
|
||||
|
||||
@item{The @tt{(@defpattech[cross] symbol)} @pattern is used for the compatible
|
||||
@item{The @scheme[(@defpattech[cross] id)] @pattern is used for the compatible
|
||||
closure functions. If the language contains a non-terminal with the
|
||||
same name as @scheme[symbol], the @pattern @scheme[(cross symbol)] matches the
|
||||
same name as @scheme[symbol], the @pattern @scheme[(cross id)] matches the
|
||||
context that corresponds to the compatible closure of that
|
||||
non-terminal.
|
||||
}
|
||||
|
@ -395,7 +395,7 @@ all non-GUI portions of Redex) and also exported by
|
|||
@schememodname[redex] (which includes all of Redex).
|
||||
|
||||
Object language expressions in Redex are written using
|
||||
@scheme[term]. It is similar to Scheme's @scheme[quote] (in
|
||||
@scheme[term]. It is similar to Racket's @scheme[quote] (in
|
||||
many cases it is identical) in that it constructs lists as
|
||||
the visible representation of terms.
|
||||
|
||||
|
@ -405,14 +405,14 @@ stands for repetition unless otherwise indicated):
|
|||
@(schemegrammar* #:literals (in-hole hole unquote unquote-splicing)
|
||||
[term identifier
|
||||
(term-sequence ...)
|
||||
,scheme-expression
|
||||
,racket-expression
|
||||
(in-hole term term)
|
||||
hole
|
||||
#t #f
|
||||
string]
|
||||
[term-sequence
|
||||
term
|
||||
,@scheme-expression
|
||||
,@racket-expression
|
||||
(code:line ... (code:comment "literal ellipsis"))])
|
||||
|
||||
@itemize[
|
||||
|
@ -425,15 +425,15 @@ corresponding symbol, unless the identifier is bound by
|
|||
@item{A term written @scheme[(_term-sequence ...)] constructs a list of
|
||||
the terms constructed by the sequence elements.}
|
||||
|
||||
@item{A term written @scheme[,_scheme-expression] evaluates the
|
||||
@scheme[scheme-expression] and substitutes its value into the term at
|
||||
@item{A term written @scheme[,_racket-expression] evaluates the
|
||||
@scheme[_racket-expression] and substitutes its value into the term at
|
||||
that point.}
|
||||
|
||||
@item{A term written @scheme[,@_scheme-expression] evaluates the
|
||||
@scheme[scheme-expression], which must produce a list. It then splices
|
||||
@item{A term written @scheme[,@_racket-expression] evaluates the
|
||||
@scheme[_racket-expression], which must produce a list. It then splices
|
||||
the contents of the list into the expression at that point in the sequence.}
|
||||
|
||||
@item{A term written @scheme[(in-hole @|tttterm| @|tttterm|)]
|
||||
@item{A term written @scheme[(in-hole @#,|tttterm| @#,|tttterm|)]
|
||||
is the dual to the @pattern @scheme[in-hole] -- it accepts
|
||||
a context and an expression and uses @scheme[plug] to combine
|
||||
them.}
|
||||
|
@ -681,9 +681,9 @@ all non-GUI portions of Redex) and also exported by
|
|||
[reduction-case (--> @#,ttpattern @#,tttterm extras ...)]
|
||||
[extras name
|
||||
(fresh fresh-clause ...)
|
||||
(side-condition scheme-expression)
|
||||
(side-condition racket-expression)
|
||||
(where tl-pat @#,tttterm)
|
||||
(side-condition/hidden scheme-expression)
|
||||
(side-condition/hidden racket-expression)
|
||||
(where/hidden tl-pat @#,tttterm)]
|
||||
[fresh-clause var ((var1 ...) (var2 ...))]
|
||||
[tl-pat identifier (tl-pat-ele ...)]
|
||||
|
@ -722,7 +722,7 @@ bound by the left-hand side of the rule.
|
|||
All side-conditions provided with @scheme[side-condition] and
|
||||
@scheme[hidden-side-condition] are collected with @scheme[and] and
|
||||
used as guards on the case being matched. The argument to each
|
||||
side-condition should be a Scheme expression, and the pattern
|
||||
side-condition should be a Racket expression, and the pattern
|
||||
variables in the @|ttpattern| are bound in that expression. A
|
||||
@scheme[side-condition/hidden] form is the same as
|
||||
@scheme[side-condition], except that the side condition is not
|
||||
|
@ -901,8 +901,8 @@ all non-GUI portions of Redex) and also exported by
|
|||
...)
|
||||
([contract (code:line)
|
||||
(code:line id : @#,ttpattern ... -> @#,ttpattern)]
|
||||
[extras (side-condition scheme-expression)
|
||||
(side-condition/hidden scheme-expression)
|
||||
[extras (side-condition racket-expression)
|
||||
(side-condition/hidden racket-expression)
|
||||
(where tl-pat @#,tttterm)
|
||||
(where/hidden tl-pat @#,tttterm)]
|
||||
[tl-pat identifier (tl-pat-ele ...)]
|
||||
|
@ -1451,9 +1451,9 @@ filled in for the remaining colors.
|
|||
|
||||
The @scheme[scheme-colors?] argument, if @scheme[#t] causes
|
||||
@scheme[traces] to color the contents of each of the windows according
|
||||
to DrScheme's Scheme mode color Scheme. If it is @scheme[#f],
|
||||
to DrRacket's Racket mode color scheme. If it is @scheme[#f],
|
||||
@scheme[traces] just uses black for the color scheme.
|
||||
In addition, Scheme-mode parenthesis highlighting is
|
||||
In addition, Racket-mode parenthesis highlighting is
|
||||
enabled when @scheme[scheme-colors?]
|
||||
is @scheme[#t] and not when it is @scheme[#f].
|
||||
|
||||
|
@ -1698,7 +1698,7 @@ Slideshow (see
|
|||
|
||||
This section documents two classes of operations, one for
|
||||
direct use of creating postscript figures for use in papers
|
||||
and for use in DrScheme to easily adjust the typesetting:
|
||||
and for use in DrRacket to easily adjust the typesetting:
|
||||
@scheme[render-term],
|
||||
@scheme[render-language],
|
||||
@scheme[render-reduction-relation],
|
||||
|
@ -1808,7 +1808,7 @@ other tools that combine picts together.
|
|||
|
||||
If provided with one argument, @scheme[render-metafunction]
|
||||
produces a pict that renders properly in the definitions
|
||||
window in DrScheme. If given two arguments, it writes
|
||||
window in DrRacket. If given two arguments, it writes
|
||||
postscript into the file named by @scheme[filename] (which
|
||||
may be either a string or bytes).
|
||||
|
||||
|
@ -2071,12 +2071,12 @@ single reduction relation.
|
|||
@deftech{Removing the pink background from PLT Redex rendered picts and ps files}
|
||||
|
||||
When reduction rules, a metafunction, or a grammar contains
|
||||
unquoted Scheme code or side-conditions, they are rendered
|
||||
unquoted Racket code or side-conditions, they are rendered
|
||||
with a pink background as a guide to help find them and
|
||||
provide alternative typesettings for them. In general, a
|
||||
good goal for a PLT Redex program that you intend to typeset
|
||||
is to only include such things when they correspond to
|
||||
standard mathematical operations, and the Scheme code is an
|
||||
standard mathematical operations, and the Racket code is an
|
||||
implementation of those operations.
|
||||
|
||||
To replace the pink code, use:
|
||||
|
@ -2174,7 +2174,7 @@ explanation of logical-space):
|
|||
@defproc[(lw? (v any/c)) boolean?]{}
|
||||
@defidform[lw]{}]]{
|
||||
|
||||
The lw data structure corresponds represents a pattern or a Scheme
|
||||
The lw data structure corresponds represents a pattern or a Racket
|
||||
expression that is to be typeset. The functions listed above
|
||||
construct @scheme[lw] structs, select fields out of them, and
|
||||
recognize them. The @scheme[lw] binding can be used with
|
||||
|
|
|
@ -487,7 +487,7 @@
|
|||
(let ([i (cadr (syntax->list c))])
|
||||
(set! src-col (or (syntax-column i) src-col))
|
||||
(hash-set! next-col-map src-col dest-col)
|
||||
((loop init-line! (+ quote-depth quote-delta) expr? #f) i))))]
|
||||
((loop init-line! (max 0 (+ quote-depth quote-delta)) expr? #f) i))))]
|
||||
[(and (pair? (syntax-e c))
|
||||
(or (not expr?)
|
||||
(positive? quote-depth)
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
@defclass[comment-box:snip% editor-snip:decorated% (readable-snip<%>)]{
|
||||
This snip implements the comment boxes that you see in
|
||||
DrScheme.
|
||||
DrRacket.
|
||||
|
||||
@defmethod*[#:mode override (((make-editor) (is-a?/c text%)))]{
|
||||
|
||||
|
|
|
@ -79,7 +79,7 @@
|
|||
Typically, this method is called when the frame
|
||||
containing the editor is closed, but in some cases an
|
||||
editor is considered ``closed'' before the frame it is
|
||||
in is closed (eg, when a tab in DrScheme is closed), and
|
||||
in is closed (e.g., when a tab in DrRacket is closed), and
|
||||
thus @method[editor:basic<%> on-close] will be called at that point.
|
||||
|
||||
|
||||
|
|
|
@ -161,7 +161,7 @@
|
|||
Calls
|
||||
@scheme[exit:on-exit]
|
||||
and then queues a callback
|
||||
to call MzScheme's @scheme[exit]
|
||||
to call Racket's @scheme[exit]
|
||||
function. If that returns, it
|
||||
calls
|
||||
@scheme[exit:set-exiting]
|
||||
|
|
|
@ -1,85 +1,85 @@
|
|||
#lang scribble/doc
|
||||
|
||||
@(require (for-label framework scheme/gui))
|
||||
@(require (for-label framework racket/gui))
|
||||
@(require scribble/manual)
|
||||
|
||||
@title{@bold{Framework}: PLT GUI Application Framework}
|
||||
@title{@bold{Framework}: Racket GUI Application Framework}
|
||||
@(defmodule framework)
|
||||
|
||||
@author["Robert Bruce Findler" "Matthew Flatt"]
|
||||
|
||||
The framework provides a number of mixins, classes and
|
||||
functions designed to help you build a complete application
|
||||
program on top of the @scheme[scheme/gui] library.
|
||||
program on top of the @racket[racket/gui] library.
|
||||
|
||||
@itemize[
|
||||
@item{@bold{Entire Framework}
|
||||
|
||||
@itemize[
|
||||
|
||||
@item{@scheme[(require @#,schememodname[framework])]
|
||||
@item{@racket[(require @#,racketmodname[framework])]
|
||||
|
||||
This library provides all of the definitions and syntax
|
||||
described in this manual.
|
||||
}
|
||||
@item{@scheme[(require framework/framework-sig)]
|
||||
@item{@racket[(require framework/framework-sig)]
|
||||
|
||||
This library provides the signature definitions:
|
||||
@scheme[framework^], and
|
||||
@scheme[framework-class^].
|
||||
The @scheme[framework^] signature contains all of the
|
||||
@racket[framework^], and
|
||||
@racket[framework-class^].
|
||||
The @racket[framework^] signature contains all of the
|
||||
names of the procedures described in this manual, except
|
||||
those that begin with @scheme[test:] and
|
||||
@scheme[gui-utils:]. The @scheme[framework-class^]
|
||||
those that begin with @racket[test:] and
|
||||
@racket[gui-utils:]. The @racket[framework-class^]
|
||||
signature contains all of the classes defined in this
|
||||
manual.
|
||||
}
|
||||
@item{@scheme[(require framework/framework-unit)]
|
||||
@item{@racket[(require framework/framework-unit)]
|
||||
|
||||
This library provides one
|
||||
@scheme[unit/sig]: @scheme[framework@]. It exports the signature
|
||||
@scheme[framework^]. It imports the @scheme[mred^] signature.
|
||||
@racket[unit/sig]: @racket[framework@]. It exports the signature
|
||||
@racket[framework^]. It imports the @racket[mred^] signature.
|
||||
|
||||
}
|
||||
]}
|
||||
@item{
|
||||
@bold{Test Suite Engine}
|
||||
|
||||
@scheme[(require @#,schememodname[framework/test])]
|
||||
@racket[(require @#,racketmodname[framework/test])]
|
||||
|
||||
This library provides all of the definitions beginning with
|
||||
@scheme[test:] described in this manual.
|
||||
@racket[test:] described in this manual.
|
||||
}
|
||||
@item{ @bold{GUI Utilities}
|
||||
@scheme[(require @#,schememodname[framework/gui-utils])]
|
||||
@racket[(require @#,racketmodname[framework/gui-utils])]
|
||||
|
||||
This libraries provides all of the definitions beginning
|
||||
with @scheme[gui-utils:] described in this manual.
|
||||
with @racket[gui-utils:] described in this manual.
|
||||
}
|
||||
@item{ @bold{Preferences}
|
||||
@scheme[(require @#,schememodname[framework/preferences])]
|
||||
@racket[(require @#,racketmodname[framework/preferences])]
|
||||
|
||||
This library provides a subset of the names of the
|
||||
@tt{framework.ss} library, namely those for
|
||||
manipulating preference settings and is designed to be
|
||||
used from mzscheme.
|
||||
used from @exec{racket}.
|
||||
|
||||
The precise set of exported names is:
|
||||
@scheme[preferences:snapshot?],
|
||||
@scheme[preferences:restore-prefs-snapshot],
|
||||
@scheme[preferences:get-prefs-snapshot],
|
||||
@scheme[exn:make-unknown-preference],
|
||||
@scheme[exn:unknown-preference?],
|
||||
@scheme[preferences:low-level-put-preferences],
|
||||
@scheme[preferences:get],
|
||||
@scheme[preferences:set],
|
||||
@scheme[preferences:add-callback],
|
||||
@scheme[preferences:set-default],
|
||||
@scheme[preferences:set-un/marshall], and
|
||||
@scheme[preferences:restore-defaults].
|
||||
@racket[preferences:snapshot?],
|
||||
@racket[preferences:restore-prefs-snapshot],
|
||||
@racket[preferences:get-prefs-snapshot],
|
||||
@racket[exn:make-unknown-preference],
|
||||
@racket[exn:unknown-preference?],
|
||||
@racket[preferences:low-level-put-preferences],
|
||||
@racket[preferences:get],
|
||||
@racket[preferences:set],
|
||||
@racket[preferences:add-callback],
|
||||
@racket[preferences:set-default],
|
||||
@racket[preferences:set-un/marshall], and
|
||||
@racket[preferences:restore-defaults].
|
||||
}
|
||||
@item{@bold{Decorated Editor Snip}
|
||||
@scheme[(require framework/decorated-editor-snip)]
|
||||
@racket[(require framework/decorated-editor-snip)]
|
||||
|
||||
This library is here for backwards compatibility. The
|
||||
functionality in it has moved into the framework proper, in
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
@(require scribble/manual scribble/extract)
|
||||
@(require (for-label framework))
|
||||
@(require (for-label scheme/gui))
|
||||
@title{Scheme}
|
||||
@title{Racket}
|
||||
|
||||
@definterface[scheme:sexp-snip<%> ()]{
|
||||
@defmethod*[(((get-saved-snips) (listof snip%)))]{
|
||||
|
@ -35,7 +35,7 @@
|
|||
}
|
||||
}
|
||||
@definterface[scheme:text<%> (text:basic<%> mode:host-text<%> color:text<%>)]{
|
||||
Texts matching this interface support Scheme mode operations.
|
||||
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
|
||||
|
@ -225,7 +225,7 @@
|
|||
}
|
||||
}
|
||||
@defmixin[scheme:text-mixin (text:basic<%> mode:host-text<%> color:text<%> text:autocomplete<%>) (scheme:text<%>)]{
|
||||
This mixin adds functionality for editing Scheme files.
|
||||
This mixin adds functionality for editing Racket files.
|
||||
|
||||
The result of this mixin uses the same initialization arguments as the
|
||||
mixin's argument.
|
||||
|
@ -241,7 +241,7 @@
|
|||
implements this interface.
|
||||
}
|
||||
@defmixin[scheme:text-mode-mixin (color:text-mode<%> mode:surrogate-text<%>) (scheme:text-mode<%>)]{
|
||||
This mixin adds Scheme mode functionality
|
||||
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
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
The framework provides several new primitive functions that simulate
|
||||
user actions, which may be used to test applications. You use these
|
||||
primitives and combine them just as regular MzScheme functions. For
|
||||
primitives and combine them just as regular Racket functions. For
|
||||
example,
|
||||
@schemeblock[
|
||||
(test:keystroke #\A)
|
||||
|
|
|
@ -121,7 +121,7 @@
|
|||
|
||||
The result of this method is a symbol that identifies this
|
||||
editor and that is used as the port-name of a port that is
|
||||
read from this editor if this editor is used in DrScheme.
|
||||
read from this editor if this editor is used in DrRacket.
|
||||
See also
|
||||
@method[text:basic<%> port-name-matches?].
|
||||
}
|
||||
|
@ -345,7 +345,7 @@
|
|||
hits are coalesced into a single search results when
|
||||
bubbles are drawn. This means, for example, that searching
|
||||
for a space in a file with 80,000 spaces (as one file in
|
||||
the PLT Scheme code base has) is still tractable, since
|
||||
the Racket code base has) is still tractable, since
|
||||
many of those spaces will be next to each other and thus
|
||||
there will be far fewer bubbles (the file in question has
|
||||
only 20,000 such bubbles).
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
@defclass[drracket:frame:name-message% canvas% ()]{
|
||||
|
||||
This class implements the little filename button in the top-right hand
|
||||
side of drscheme's frame.
|
||||
side of DrRacket's frame.
|
||||
|
||||
|
||||
|
||||
|
@ -40,7 +40,7 @@ Provides an implementation of
|
|||
|
||||
@defmixin[drracket:frame:basics-mixin (frame:standard-menus<%>) (drracket:frame:basics<%>)]{
|
||||
|
||||
Use this mixin to establish some common menu items across various DrScheme windows.
|
||||
Use this mixin to establish some common menu items across various DrRacket windows.
|
||||
|
||||
|
||||
|
||||
|
@ -88,7 +88,7 @@ adds a
|
|||
[evt (is-a?/c control-event%)])
|
||||
void?]{
|
||||
|
||||
Opens a new, empty DrScheme window.
|
||||
Opens a new, empty DrRacket window.
|
||||
|
||||
|
||||
}
|
||||
|
@ -127,7 +127,7 @@ Returns the empty string.
|
|||
@methspec{
|
||||
|
||||
Each string in the result of this method is added as a menu
|
||||
item to DrScheme's ``Related Web Sites'' menu item. The
|
||||
item to DrRacket's ``Related Web Sites'' menu item. The
|
||||
first string is the name of the menu item and the second
|
||||
string is a url that, when the menu item is chosen, is sent
|
||||
to the user's browser.
|
||||
|
@ -145,7 +145,7 @@ Defaultly returns the empty list.
|
|||
[evt (is-a?/c control-event%)])
|
||||
void?]{
|
||||
|
||||
Opens an about box for DrScheme.
|
||||
Opens an about box for DrRacket.
|
||||
|
||||
|
||||
}
|
||||
|
@ -154,7 +154,7 @@ Opens an about box for DrScheme.
|
|||
(help-menu:about-string)
|
||||
string?]{
|
||||
|
||||
Returns the string @scheme["DrScheme"].
|
||||
Returns the string @scheme["DrRacket"].
|
||||
|
||||
|
||||
}
|
||||
|
@ -163,7 +163,7 @@ Returns the string @scheme["DrScheme"].
|
|||
(help-menu:before-about [help-menu (is-a?/c menu%)])
|
||||
void?]{
|
||||
|
||||
Adds the Help Desk menu item and the Welcome to DrScheme menu item.
|
||||
Adds the Help Desk menu item and the Welcome to DrRacket menu item.
|
||||
}
|
||||
|
||||
@defmethod[#:mode override
|
||||
|
@ -243,7 +243,7 @@ that evaluation is taking place in the user's program.
|
|||
|
||||
This method is intended to be overridden. It's job is to
|
||||
update the @scheme["View"] menu to match the state of the
|
||||
visible windows. In the case of the standard DrScheme
|
||||
visible windows. In the case of the standard DrRacket
|
||||
window, it change the menu items to reflect the visibility of
|
||||
the definitions and interaction @scheme[editor-canvas%]s.
|
||||
|
||||
|
|
|
@ -152,8 +152,8 @@ The settings in this structure reflect the settings show in
|
|||
the language configuration dialog for languages constructed
|
||||
with this mixin. The first controls the input for the
|
||||
language. The rest specify printing controls for the
|
||||
language. The style @scheme['write] is the default style,
|
||||
used in the MzScheme REPL. The sharing field determines if
|
||||
language. The style @scheme['print] is the default style,
|
||||
as normally used in the Racket REPL. The sharing field determines if
|
||||
cycles and sharing in values are displayed when the value is
|
||||
rendered. The insert newlines field determines if values in
|
||||
the repl are formatted with @scheme[write] style-line
|
||||
|
@ -323,7 +323,7 @@ Returns @scheme[#t].
|
|||
@definterface[drracket:language:module-based-language<%> ()]{
|
||||
|
||||
This interface is for languages that can be implemented
|
||||
with MzScheme @scheme[module]s.
|
||||
with Racket @scheme[module]s.
|
||||
|
||||
Use the
|
||||
@scheme[drracket:language:module-based-language->language-mixin]
|
||||
|
@ -476,8 +476,8 @@ This method is the same as
|
|||
@defmethod[(use-mred-launcher)
|
||||
boolean?]{
|
||||
This method is called when an executable is created to
|
||||
determine if the executable should use the mred or the
|
||||
mzscheme binary.
|
||||
determine if the executable should use the GRacket or the
|
||||
Racket binary.
|
||||
|
||||
}
|
||||
|
||||
|
@ -488,7 +488,7 @@ mzscheme binary.
|
|||
The result of this method controls how the module is
|
||||
attached to the user's namespace. If
|
||||
the method returns @scheme[#t],
|
||||
the mzscheme primitive
|
||||
the Racket primitive
|
||||
@scheme[namespace-require/copy]
|
||||
is used and if it returns @scheme[#f],
|
||||
@scheme[namespace-require]
|
||||
|
@ -565,10 +565,10 @@ to install the result of
|
|||
@definterface[drracket:language:language<%> ()]{
|
||||
|
||||
Implementations of this interface are languages that
|
||||
DrScheme supports.
|
||||
DrRacket supports.
|
||||
|
||||
See @secref["adding-languages"] for an overview of
|
||||
adding languages to DrScheme.
|
||||
adding languages to DrRacket.
|
||||
|
||||
|
||||
|
||||
|
@ -698,7 +698,7 @@ and
|
|||
|
||||
This method is called on the user's main eventspace thread, and without
|
||||
a prompt or other control delimiter. It must return without raising an
|
||||
error, or else the DrScheme window will be wedged.
|
||||
error, or else the DrRacket window will be wedged.
|
||||
}
|
||||
|
||||
@defmethod[(front-end/interaction [port input-port]
|
||||
|
@ -717,7 +717,7 @@ See also
|
|||
@defmethod[(get-comment-character)
|
||||
(values string? char?)]{
|
||||
Returns text to be used for the ``Insert Large Letters''
|
||||
menu item in DrScheme. The first result is a prefix to be
|
||||
menu item in DrRacket. The first result is a prefix to be
|
||||
placed at the beginning of each line and the second result
|
||||
is a character to be used for each pixel in the letters.
|
||||
|
||||
|
@ -727,7 +727,7 @@ is a character to be used for each pixel in the letters.
|
|||
string?]{
|
||||
Returns the name of the language, as shown in the REPL when
|
||||
executing programs in the language and in the bottom left of
|
||||
the drscheme window.
|
||||
the DrRacket window.
|
||||
|
||||
}
|
||||
|
||||
|
@ -738,7 +738,7 @@ This method is used in a manner analogous to
|
|||
|
||||
Each element in the list indicates how the names at that
|
||||
point in dialog will be sorted. Names with lower numbers
|
||||
appear first. If two languages are added to DrScheme with
|
||||
appear first. If two languages are added to DrRacket with
|
||||
the same strings (as given by the
|
||||
@method[drracket:language:language<%> get-language-position] method) the corresponding numbers returned by this method
|
||||
must be the same. Additionally, no two languages can have the
|
||||
|
@ -800,8 +800,8 @@ This method is only called when
|
|||
It is expected to return a string that contains N lines,
|
||||
where N is the result of calling
|
||||
@method[drracket:language:language<%> get-metadata-lines]. The string is prefixed to the buffer before the file is
|
||||
saved by DrScheme, and removed from the buffer after it is
|
||||
opened in DrScheme.
|
||||
saved by DrRacket, and removed from the buffer after it is
|
||||
opened in DrRacket.
|
||||
|
||||
The string is expect to be a prefix to the file that sets up
|
||||
a reader for files in this language, using @tt{#reader}.
|
||||
|
@ -856,7 +856,7 @@ The result of this method is used when saving or loading files.
|
|||
|
||||
If the result is a sexp, saved files get a prefix inserted
|
||||
at the beginning (the prefix is determined by calling
|
||||
@method[drracket:language:language<%> get-metadata]). When the file is then loaded, DrScheme recognizes this
|
||||
@method[drracket:language:language<%> get-metadata]). When the file is then loaded, DrRacket recognizes this
|
||||
prefix and sets the language back to match the saved file.
|
||||
|
||||
See also
|
||||
|
@ -870,7 +870,7 @@ See also
|
|||
@defmethod[(get-style-delta)
|
||||
(or/c #f (is-a?/c style-delta%) (listof (list/c (is-a?/c style-delta%) number? number?)))]{
|
||||
The style delta that this method returns is used in the
|
||||
language dialog and the DrScheme REPL when the language's
|
||||
language dialog and the DrRacket REPL when the language's
|
||||
name is printed.
|
||||
|
||||
When it is @scheme[#f], no styling is used.
|
||||
|
@ -883,7 +883,7 @@ the name.
|
|||
}
|
||||
|
||||
@defmethod[(extra-repl-information [settings settings] [port output-port?]) void?]{
|
||||
This method is called on the DrScheme eventspace main thread to insert extra
|
||||
This method is called on the DrRacket eventspace main thread to insert extra
|
||||
information into the REPL to reflect the state of the program.
|
||||
|
||||
It is used, for example, to print out the ``Teachpack'' lines in the HtDP languages.
|
||||
|
@ -893,7 +893,7 @@ the name.
|
|||
|
||||
@defmethod[(marshall-settings [settings settings])
|
||||
writable]{
|
||||
Translates an instance of the settings type into a scheme
|
||||
Translates an instance of the settings type into a Racket
|
||||
object that can be written out to disk.
|
||||
|
||||
}
|
||||
|
@ -904,7 +904,7 @@ object that can be written out to disk.
|
|||
This method is only called when
|
||||
@method[drracket:language:language<%> get-reader-module] returns an sexp.
|
||||
|
||||
When a file is opened in DrScheme, if this language's
|
||||
When a file is opened in DrRacket, if this language's
|
||||
@method[drracket:language:language<%> get-reader-module] returns an sexp, the prefix of the file
|
||||
(the first N lines, where N is the number
|
||||
returned by
|
||||
|
@ -921,27 +921,27 @@ the settings for this language.
|
|||
@defmethod[(on-execute [settings settings]
|
||||
[run-in-user-thread ((-> any) -> any)])
|
||||
any]{
|
||||
The @scheme[on-execute] method is called on DrScheme's
|
||||
The @scheme[on-execute] method is called on DrRacket's
|
||||
eventspace's main thread before any evaluation happens
|
||||
when the Run button is clicked. It is also called when
|
||||
a new DrScheme tab (or window) is created to initialize
|
||||
a new DrRacket tab (or window) is created to initialize
|
||||
the empty interactions window.
|
||||
|
||||
Use this method to initialize MzScheme's
|
||||
Use this method to initialize Racket's
|
||||
@secref[#:doc '(lib "scribblings/reference/reference.scrbl") "parameters"]
|
||||
for the user. When
|
||||
this function is called, the user's thread has already been
|
||||
created, as has its custodian. These parameters have been
|
||||
changed from the defaults in MzScheme:
|
||||
changed from the defaults in Racket:
|
||||
@itemize[
|
||||
@item{@scheme[current-custodian] is set to a new custodian.}
|
||||
@item{@scheme[current-namespace] has been set to a newly
|
||||
created empty namespace.This namespace has the following modules
|
||||
copied (with @scheme[namespace-attach-module])
|
||||
from DrScheme's original namespace:
|
||||
from DrRacket's original namespace:
|
||||
@itemize[
|
||||
@item{@scheme['mzscheme]}
|
||||
@item{@scheme['(lib "mred.ss" "mred")]}
|
||||
@item{@scheme['mred]}
|
||||
]}
|
||||
@item{
|
||||
@scheme[read-curly-brace-as-paren]
|
||||
|
@ -980,16 +980,16 @@ changed from the defaults in MzScheme:
|
|||
@scheme[current-output-port], and
|
||||
@scheme[current-error-port].}
|
||||
@item{The
|
||||
@scheme[event-dispatch-handler] is set so that DrScheme can perform some initial setup and
|
||||
@scheme[event-dispatch-handler] is set so that DrRacket can perform some initial setup and
|
||||
close down around the user's code.}
|
||||
@item{The
|
||||
@scheme[current-directory] and
|
||||
@scheme[current-load-relative-directory]
|
||||
are set to the directory where the definitions file is
|
||||
saved, or if it isn't saved, to the initial directory where
|
||||
DrScheme started up.}
|
||||
DrRacket started up.}
|
||||
@item{The snip-class-list, returned by
|
||||
@scheme[get-the-snip-class-list] is initialized with all of the snipclasses in DrScheme's eventspace's snip-class-list.}
|
||||
@scheme[get-the-snip-class-list] is initialized with all of the snipclasses in DrRacket's eventspace's snip-class-list.}
|
||||
|
||||
@item{
|
||||
The
|
||||
|
@ -1004,10 +1004,10 @@ that error message into the definitions window.}
|
|||
|
||||
The @scheme[run-in-user-thread] arguments accepts thunks and
|
||||
runs them on the user's eventspace's main thread. These
|
||||
thunks must not raise an exceptions (or drscheme itself will
|
||||
thunks must not raise an exceptions (or DrRacket itself will
|
||||
get stuck). In addition, the output ports are not yet
|
||||
functioning, so print outs should be directed to the
|
||||
original drscheme output port, if necessary.
|
||||
original DrRacket output port, if necessary.
|
||||
|
||||
}
|
||||
|
||||
|
@ -1049,7 +1049,7 @@ See also
|
|||
|
||||
@defmethod[(unmarshall-settings [input writable])
|
||||
(or/c settings false/c)]{
|
||||
Translates a Scheme value into a settings, returning
|
||||
Translates a Racket value into a settings, returning
|
||||
@scheme[#f] if that is not possible.
|
||||
|
||||
}}
|
||||
|
|
|
@ -2,14 +2,13 @@
|
|||
@(require "common.ss")
|
||||
|
||||
@(tools-title "module-language-tools")
|
||||
@section-index["drscheme:toolbar-buttons"]
|
||||
|
||||
If the result of @scheme[read-language] for a language is a function,
|
||||
DrScheme will query it to determine if there are any new toolbar
|
||||
DrRacket will query it to determine if there are any new toolbar
|
||||
buttons to be used when editing files in this language (when
|
||||
DrScheme's language is set to the Module language).
|
||||
DrRacket's language is set to the Module language).
|
||||
|
||||
Specifically, DrScheme will pass @scheme['drscheme:toolbar-buttons]
|
||||
Specifically, DrRacket will pass @indexed-scheme['drscheme:toolbar-buttons]
|
||||
to the function and expect back a value matching this contract:
|
||||
@schemeblock[(listof (list/c string?
|
||||
(is-a?/c bitmap%)
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
|
||||
@definterface[drracket:language:module-language<%> ()]{
|
||||
|
||||
The only language that implements this interface is DrScheme's ``Use the language declared in the source'' language,
|
||||
i.e., the ``Module'' language.
|
||||
The only language that implements this interface is DrRacket's ``Use
|
||||
the language declared in the source'' language.
|
||||
|
||||
@defmethod[(get-users-language-name) string]{
|
||||
Returns the name of the language that is declared in the source, as a string.
|
||||
|
|
|
@ -9,8 +9,8 @@
|
|||
|
||||
@defclass[drracket:rep:text% scheme:text% (drracket:rep:text<%>)]{
|
||||
|
||||
This class implements a read-eval-print loop for DrScheme. User
|
||||
submitted evaluations in DrScheme are evaluated asynchronously, in an
|
||||
This class implements a read-eval-print loop for DrRacket. User
|
||||
submitted evaluations in DrRacket are evaluated asynchronously, in an
|
||||
eventspace created for the user. No evaluations carried out by this
|
||||
class affect the implementation that uses it.
|
||||
|
||||
|
@ -52,7 +52,7 @@ are just ignored.
|
|||
@methspec{
|
||||
|
||||
Use this function to evaluate code or run actions that should mimic
|
||||
the user's interactions. For example, DrScheme uses this function to
|
||||
the user's interactions. For example, DrRacket uses this function to
|
||||
evaluate expressions in the definitions window and expressions
|
||||
submitted at the prompt.
|
||||
|
||||
|
@ -102,18 +102,18 @@ The @scheme[complete-program?] argument determines if the
|
|||
@method[drracket:language:language<%> front-end/interaction] method.
|
||||
When evaluation finishes, it calls @scheme[cleanup] on the user's main thread.
|
||||
|
||||
This method must be called from the drscheme main thread.
|
||||
This method must be called from the DrRacket main thread.
|
||||
}
|
||||
|
||||
@defmethod[#:mode augment (after-many-evals) any]{
|
||||
Called from the drscheme main thread after
|
||||
Called from the DrRacket main thread after
|
||||
@method[drracket:rep:text% evaluate-from-port] finishes (no matter
|
||||
how it finishes).
|
||||
}
|
||||
|
||||
@defmethod[#:mode augment (on-execute [run-on-user-thread (-> any)]) any]{
|
||||
|
||||
Called from the drscheme thread after the language's
|
||||
Called from the DrRacket thread after the language's
|
||||
@method[drracket:language:language<%> on-execute]
|
||||
method has been invoked, and after the
|
||||
special values have been setup (the ones registered
|
||||
|
@ -220,7 +220,7 @@ See also
|
|||
@defmethod[(initialize-console)
|
||||
void?]{
|
||||
|
||||
This inserts the ``Welcome to DrScheme'' message into the interactions
|
||||
This inserts the ``Welcome to DrRacket'' message into the interactions
|
||||
buffer, calls
|
||||
@method[drracket:rep:text% reset-console],
|
||||
@method[drracket:rep:text% insert-prompt], and
|
||||
|
@ -263,7 +263,7 @@ Calls the super method.
|
|||
void?]{
|
||||
@methspec{
|
||||
|
||||
This method queues thunks for drscheme's eventspace in a
|
||||
This method queues thunks for DrRacket's eventspace in a
|
||||
special output-related queue.
|
||||
}}
|
||||
|
||||
|
@ -306,7 +306,7 @@ Calls @scheme[f], after switching to the user's thread.
|
|||
void?]{
|
||||
Shuts down the user's program and all windows. Reclaims any
|
||||
resources the program allocated. It is expected to be
|
||||
called from DrScheme's main eventspace thread.
|
||||
called from DrRacket's main eventspace thread.
|
||||
|
||||
}
|
||||
|
||||
|
@ -316,7 +316,7 @@ This waits for all pending IO in the rep to finish
|
|||
and then returns.
|
||||
|
||||
This method must only be called from the main thread in
|
||||
DrScheme's eventspace
|
||||
DrRacket's eventspace
|
||||
|
||||
}
|
||||
|
||||
|
@ -333,7 +333,7 @@ in the user's eventspace
|
|||
|
||||
@defmixin[drracket:rep:drs-bindings-keymap-mixin (editor:keymap<%>) ()]{
|
||||
|
||||
This mixin adds some drscheme-specific keybindings to the
|
||||
This mixin adds some DrRacket-specific keybindings to the
|
||||
editor it is mixed onto.
|
||||
|
||||
|
||||
|
@ -343,7 +343,7 @@ editor it is mixed onto.
|
|||
(listof (is-a?/c keymap%))]{
|
||||
|
||||
Calls the super method and adds in a keymap with the
|
||||
drscheme-specific keybindings:
|
||||
DrRacket-specific keybindings:
|
||||
|
||||
@itemize[
|
||||
@item{f5 - Run}
|
||||
|
@ -375,7 +375,7 @@ process the program.
|
|||
Tools that annotate the program text should augment this
|
||||
method to clear their own annotations on the program text.
|
||||
|
||||
DrScheme calls this method before a program is run (via the
|
||||
DrRacket calls this method before a program is run (via the
|
||||
Run button).
|
||||
|
||||
}
|
||||
|
|
|
@ -5,26 +5,27 @@
|
|||
(for-label drscheme/tool-lib)
|
||||
(for-label scheme/unit scheme/contract scheme/class)
|
||||
(for-label scheme/base)
|
||||
(for-label framework/framework))
|
||||
(for-label framework/framework)
|
||||
(for-label drscheme/syncheck-drracket-button))
|
||||
|
||||
(define (File x) @tt[x])
|
||||
(define (FileFirst x) @tt[x]) ;; indexing missing
|
||||
|
||||
(define (item/cap x . ys)
|
||||
(apply item (bold (format "~a" x)) ": " ys)) ;; indexing missing
|
||||
(define-syntax-rule (item/cap x . ys)
|
||||
(item (indexed-scheme x) ": " . ys)) ;; indexing missing
|
||||
)
|
||||
|
||||
@title{@bold{Plugins}: Extending DrScheme}
|
||||
@title{@bold{Plugins}: Extending DrRacket}
|
||||
|
||||
@author["Robert Bruce Findler"]
|
||||
|
||||
@(defmodule drscheme/tool-lib)
|
||||
|
||||
This manual describes DrScheme's tools interface. It assumes
|
||||
This manual describes DrRacket's tools interface. It assumes
|
||||
familiarity with
|
||||
PLT Scheme, as described in
|
||||
Racket, as described in
|
||||
@(other-manual '(lib "scribblings/guide/guide.scrbl")),
|
||||
DrScheme, as described in
|
||||
DrRacket, as described in
|
||||
@(other-manual '(lib "scribblings/drracket/drracket.scrbl")),
|
||||
and the Framework, as described in
|
||||
@(other-manual '(lib "scribblings/framework/framework.scrbl")).
|
||||
|
@ -45,47 +46,47 @@ Christian Queinnec,
|
|||
PLT at large, and many others for
|
||||
their feedback and help.
|
||||
|
||||
@section[#:tag "implementing-tools"]{Implementing DrScheme Tools}
|
||||
@section[#:tag "implementing-tools"]{Implementing DrRacket Tools}
|
||||
|
||||
Tools are designed for major extensions in DrScheme's
|
||||
Tools are designed for major extensions in DrRacket's
|
||||
functionality. To extend the appearance
|
||||
or the functionality the DrScheme window (say, to annotate
|
||||
programs in certain ways, to add buttons to the DrScheme
|
||||
frame or to add additional languages to DrScheme) use a
|
||||
or the functionality the DrRacket window (say, to annotate
|
||||
programs in certain ways, to add buttons to the DrRacket
|
||||
frame or to add additional languages to DrRacket) use a
|
||||
tool. The Macro Stepper, the Syntax Checker, the Stepper,
|
||||
and the teaching languages are all implemented as tools.
|
||||
|
||||
When DrScheme starts up, it looks for tools by reading
|
||||
fields in the @File{info.ss} file of each collection and the
|
||||
When DrRacket starts up, it looks for tools by reading
|
||||
fields in the @File{info.rkt} file of each collection and the
|
||||
newest version of each PLaneT package installed on the
|
||||
system. (Technically, DrScheme looks in a cache of the
|
||||
info.ss files contents created by setup-plt. Be sure to
|
||||
system. (Technically, DrRacket looks in a cache of the
|
||||
@filepath{info.rkt} files contents created by setup-plt. Be sure to
|
||||
re-run setup-plt if you change the contents of
|
||||
the @File{info.ss} files). DrScheme checks for these
|
||||
the @File{info.rkt} files). DrRacket checks for these
|
||||
fields:
|
||||
@itemize[
|
||||
@item/cap['tools]{
|
||||
@item/cap[tools]{
|
||||
@scheme[(listof (listof string[subcollection-name]))]
|
||||
}
|
||||
@item/cap['tool-names]{@scheme[(listof (union #f string))]}
|
||||
@item/cap['tool-icons]{
|
||||
@item/cap[tool-names]{@scheme[(listof (union #f string))]}
|
||||
@item/cap[tool-icons]{
|
||||
@schemeblock[
|
||||
(listof (union #f
|
||||
string[relative-pathname]
|
||||
(cons string[filename]
|
||||
(listof string[collection-name]))))]
|
||||
}
|
||||
@item/cap['tool-urls]{
|
||||
@item/cap[tool-urls]{
|
||||
@scheme[(listof (union #f string[url]))]
|
||||
}]
|
||||
|
||||
The @scheme[tools] field names a list of tools in this
|
||||
collection. Each tool is specified as a collection path,
|
||||
relative to the collection where the @File{info.ss} file
|
||||
relative to the collection where the @File{info.rkt} file
|
||||
resides. As an example, if there is only one tool named
|
||||
@File{tool.ss}, this suffices:
|
||||
@File{tool.rkt}, this suffices:
|
||||
@schemeblock[
|
||||
(define tools (list (list "tool.ss")))
|
||||
(define tools (list (list "tool.rkt")))
|
||||
]
|
||||
If the @scheme[tool-icons] or @scheme[tool-names] fields are
|
||||
present, they must be the same length as @scheme[tools]. The
|
||||
|
@ -98,7 +99,7 @@ the same as the arguments to @scheme[lib], inside
|
|||
|
||||
This bitmap and the name show up in the about box, Help
|
||||
Desk's bug report form, and the splash screen as the tool is
|
||||
loaded at DrScheme's startup.
|
||||
loaded at DrRacket's startup.
|
||||
|
||||
@index{phase1}
|
||||
@index{phase2}
|
||||
|
@ -106,7 +107,7 @@ Each of @scheme[tools] files must contain a module that
|
|||
@scheme[provide]s @scheme[tool@], which must be bound to a
|
||||
@scheme[unit]. The unit
|
||||
must import the @scheme[drracket:tool^] signature, which is
|
||||
provided by the @FileFirst{tool.ss} library in the
|
||||
provided by the @FileFirst{tool.rkt} library in the
|
||||
@scheme[drscheme] collection. The @scheme[drracket:tool^]
|
||||
signature contains all of the names listed in this manual.
|
||||
The unit must export the @scheme[drracket:tool-exports^]
|
||||
|
@ -119,7 +120,7 @@ the @tt{phase1} functions are called and then all of the
|
|||
@tt{phase2} functions are called. Certain primitives can
|
||||
only be called during the dynamic extent of those calls.
|
||||
|
||||
This mechanism is designed to support DrScheme's
|
||||
This mechanism is designed to support DrRacket's
|
||||
@scheme[drracket:language:language<%>] extension
|
||||
capabilities. That is, this mechanism enables two tools to
|
||||
cooperate via new capabilities of languages. The first phase
|
||||
|
@ -148,18 +149,18 @@ Phase 2 functions:
|
|||
|
||||
If the tool raises an error as it is loaded, invoked, or as
|
||||
the @scheme[phase1] or @scheme[phase2] thunks are called,
|
||||
DrScheme catches the error and displays a message box. Then,
|
||||
DrScheme continues to start up, without the tool.
|
||||
DrRacket catches the error and displays a message box. Then,
|
||||
DrRacket continues to start up, without the tool.
|
||||
|
||||
For example, if the @File{info.ss} file in a collection
|
||||
For example, if the @File{info.rkt} file in a collection
|
||||
contains:
|
||||
@schememod[
|
||||
setup/infotab
|
||||
(define name "Tool Name")
|
||||
(define tools (list (list "tool.ss")))
|
||||
(define tools (list (list "tool.rkt")))
|
||||
]
|
||||
then the same collection would be expected to contain a
|
||||
@File{tool.ss} file. It might contain something like this:
|
||||
@File{tool.rkt} file. It might contain something like this:
|
||||
@schememod[
|
||||
scheme/gui
|
||||
(require drscheme/tool)
|
||||
|
@ -178,103 +179,98 @@ This tool just opens a few windows to indicate that it has
|
|||
been loaded and that the @scheme[phase1] and @scheme[phase2]
|
||||
functions have been called.
|
||||
|
||||
@section[#:tag "adding-languages"]{Adding Languages to DrScheme}
|
||||
@index{adding languages to DrScheme}
|
||||
@section[#:tag "adding-languages"]{Adding Languages to DrRacket}
|
||||
@index{adding languages to DrRacket}
|
||||
|
||||
@subsection{Adding Module-based Languages to DrScheme}
|
||||
@subsection{Adding Module-based Languages to DrRacket}
|
||||
If a language can be implemented as a module
|
||||
(see @scheme[module] for details)
|
||||
and the standard language settings are
|
||||
sufficient, simply create an
|
||||
@File{info.ss} file in the collection
|
||||
@File{info.rkt} file in the collection
|
||||
where the module is saved. Include these
|
||||
definitions:
|
||||
@itemize[
|
||||
@item/cap['drscheme-language-modules]{
|
||||
@index{drscheme-language-modules} This must be bound to a
|
||||
@item/cap[drscheme-language-modules]{
|
||||
This must be bound to a
|
||||
list of collection path specifications or strings, one for
|
||||
each language in the collection. Each collection path
|
||||
specification is the quoted form of what might appear as
|
||||
an argument to @scheme[require], using the
|
||||
@tt{lib} argument (but without the @tt{lib}). The
|
||||
strings represent relative paths starting at the directory
|
||||
containing the @File{info.ss} file. They are interpreted
|
||||
containing the @File{info.rkt} file. They are interpreted
|
||||
like string arguments to @scheme[require].
|
||||
}
|
||||
@item/cap['drscheme-language-positions]{
|
||||
@index{drscheme-language-positions}
|
||||
@item/cap[drscheme-language-positions]{
|
||||
This must be bound to a
|
||||
list of language positions. Each language position
|
||||
corresponds to the position of the language in language
|
||||
dialog. Each language position is a list of strings whose
|
||||
length must be at least two.
|
||||
}
|
||||
@item/cap['drscheme-language-numbers]{
|
||||
@index{drscheme-language-numbers}
|
||||
@item/cap[drscheme-language-numbers]{
|
||||
This is optional. If
|
||||
present, it must be a list of a list of numbers. Each list
|
||||
corresponds to a single language from this collection.
|
||||
Each number indicates a sorting order in the language
|
||||
dialog for the corresponding string in
|
||||
@bold{drscheme-language-positions}. If absent, it defaults
|
||||
@racket[drscheme-language-positions]. If absent, it defaults
|
||||
to a list of zeros that has the same length as
|
||||
@bold{drscheme-language-positions}. This will rarely be correct.
|
||||
@racket[drscheme-language-positions]. This will rarely be correct.
|
||||
}
|
||||
|
||||
@item/cap['drscheme-language-one-line-summaries]{
|
||||
@index{drscheme-language-one-line-summaries}
|
||||
@item/cap[drscheme-language-one-line-summaries]{
|
||||
This is
|
||||
optional. If present, it must be a list of strings. Each
|
||||
string is displayed at the bottom of the language dialog
|
||||
when the corresponding language is selected.
|
||||
}
|
||||
@item/cap['drscheme-language-urls]{
|
||||
@index{drscheme-language-urls}
|
||||
@item/cap[drscheme-language-urls]{
|
||||
This is
|
||||
optional. If present, it must be a list whose elements are
|
||||
either strings or @scheme[#f].
|
||||
Clicking the corresponding language's name in
|
||||
the interactions window opens a web browser to the url.
|
||||
}
|
||||
@item/cap['drscheme-language-readers]{
|
||||
@index{drscheme-language-readers}
|
||||
@item/cap[drscheme-language-readers]{
|
||||
This is optional. If
|
||||
present, it must be bound to a quoted list of module
|
||||
specifications (that is, a quoted version of the argument
|
||||
to @scheme[require]). Each
|
||||
specification must be a module that exports a function
|
||||
named @scheme[read-syntax]. Each of these
|
||||
@scheme[read-syntax] functions must match MzScheme's
|
||||
@scheme[read-syntax] functions must match Racket's
|
||||
@scheme[read-syntax] primitive's contract, but may
|
||||
read different concrete syntax.
|
||||
|
||||
If the module specification is a plain string, it
|
||||
represents a relative path starting at the directory
|
||||
containing the @File{info.ss} file. It is interpreted
|
||||
containing the @File{info.rkt} file. It is interpreted
|
||||
like the string arguments to @scheme[require].
|
||||
}]
|
||||
The lists must have the same length.
|
||||
|
||||
As an example, the @italic{Essentials of Programming Languages}
|
||||
language specification's @File{info.ss} looks like this:
|
||||
language specification's @File{info.rkt} used to look like this:
|
||||
@schememod[
|
||||
setup/infotab
|
||||
(require string-constants)
|
||||
(define name "EoPL Support")
|
||||
(define drscheme-language-modules
|
||||
(list "eopl-lang.ss"))
|
||||
(list "eopl-lang.rkt"))
|
||||
(define drscheme-language-positions
|
||||
(list (list (string-constant teaching-languages)
|
||||
"Essentials of Programming Languages")))
|
||||
]
|
||||
This @File{info.ss} file indicates that there is a single
|
||||
This @File{info.rkt} file indicates that there is a single
|
||||
language in this collection. The module that implements the
|
||||
language is the @File{eopl-lang.ss} file in the same directory as
|
||||
the @File{info.ss} file. Additionally, the language dialog will contain
|
||||
language is the @File{eopl-lang.rkt} file in the same directory as
|
||||
the @File{info.rkt} file. Additionally, the language dialog will contain
|
||||
@tt{Essentials of Programming Languages} as a potential
|
||||
language. The use of the string constant
|
||||
@scheme[teaching-languages] ensures that EoPL's language is
|
||||
placed properly in foreign language versions of DrScheme.
|
||||
placed properly in foreign language versions of DrRacket.
|
||||
|
||||
For collections that define multiple (related) languages, if
|
||||
the language-positions contain multiple strings, the
|
||||
|
@ -290,14 +286,14 @@ and
|
|||
the two languages will be grouped together in the language
|
||||
dialog.
|
||||
|
||||
@subsection{Adding Arbitrary Languages to DrScheme}
|
||||
@subsection{Adding Arbitrary Languages to DrRacket}
|
||||
With some additional work, any language that can be compiled
|
||||
to PLT Scheme is supported by the tools interface,
|
||||
to Racket is supported by the tools interface,
|
||||
not just those that use standard configurations and
|
||||
@scheme[module].
|
||||
|
||||
Each language is a class that implement the
|
||||
@scheme[drracket:language:language<%>] interface. DrScheme also
|
||||
@scheme[drracket:language:language<%>] interface. DrRacket also
|
||||
provides two simpler interfaces:
|
||||
@scheme[drracket:language:module-based-language<%>] and
|
||||
@scheme[drracket:language:simple-module-based-language<%>],
|
||||
|
@ -311,7 +307,7 @@ Each language is a class that implement the
|
|||
Once you have an implementation of the
|
||||
@scheme[drracket:language:language^] interface, call
|
||||
@scheme[drracket:language-configuration:add-language] to add the language
|
||||
to DrScheme.
|
||||
to DrRacket.
|
||||
|
||||
Each language comes with its own type, called
|
||||
@tt{settings}. This can be any type the language
|
||||
|
@ -320,7 +316,7 @@ designer chooses, but to aid documentation, we call it
|
|||
contain parameters of the language, such as case
|
||||
sensitivity, etc. The implementor of the language provides a
|
||||
GUI so the user can configure the settings and all of the
|
||||
language's operations accept a setting. DrScheme maintains
|
||||
language's operations accept a setting. DrRacket maintains
|
||||
the current settings for each language.
|
||||
|
||||
@subsection{Language Extensions}
|
||||
|
@ -376,16 +372,16 @@ To help test your tool, use the
|
|||
@seclink["environment-variables" #:doc '(lib "scribblings/drracket/drracket.scrbl")]{@tt{PLTONLYTOOL}}
|
||||
environment variable to load it in isolation.
|
||||
|
||||
@section{Creating New Kinds of DrScheme Frames}
|
||||
@section{Creating New Kinds of DrRacket Frames}
|
||||
|
||||
Each frame in DrScheme has certain menus and functionality,
|
||||
Each frame in DrRacket has certain menus and functionality,
|
||||
most of which is achieved by using the framework.
|
||||
Additionally, there is one mixin that DrScheme provides to
|
||||
Additionally, there is one mixin that DrRacket provides to
|
||||
augment that. It is @scheme[drracket:frame:basics-mixin].
|
||||
Be sure to mix it into any new frame class that you add to
|
||||
DrScheme.
|
||||
DrRacket.
|
||||
|
||||
@section{Extending the Existing DrScheme Classes}
|
||||
@section{Extending the Existing DrRacket Classes}
|
||||
|
||||
Each of the names:
|
||||
@itemize[
|
||||
|
@ -419,12 +415,12 @@ extends the interactions text class with a method named @tt{method1}.
|
|||
|
||||
Macro-expanding a program may involve arbitrary computation
|
||||
and requires the setup of the correct language. To aid this,
|
||||
DrScheme's tool interface provides
|
||||
DrRacket's tool interface provides
|
||||
@scheme[drracket:eval:expand-program] to help. Use
|
||||
this method to extract the fully expanded program text in a
|
||||
particular language.
|
||||
|
||||
Because expanding the user's program may require DrScheme to
|
||||
Because expanding the user's program may require DrRacket to
|
||||
evaluate arbitrary code that the user wrote, tools that
|
||||
expand the user's program should also allow the user to break
|
||||
the expansion. To help with this, the tools interfaces
|
||||
|
@ -441,7 +437,7 @@ to disable your tool and calling them
|
|||
to ensure that only one expansion is happening
|
||||
at a time.
|
||||
|
||||
Finally, DrScheme provides the
|
||||
Finally, DrRacket provides the
|
||||
@method[drracket:rep:context<%> set-breakables]
|
||||
method. This method controls what behavior the Break button
|
||||
has.
|
||||
|
@ -450,21 +446,21 @@ has.
|
|||
@index{modes}
|
||||
@index{scheme mode}
|
||||
|
||||
DrScheme provides support for multiple editor modes. Tools
|
||||
DrRacket provides support for multiple editor modes. Tools
|
||||
register modes via
|
||||
@scheme[drracket:modes:add-mode]. Each mode is
|
||||
visible in the @onscreen{Modes} submenu of the @onscreen{Edit}
|
||||
menu. Initially, DrScheme only supports two modes: scheme
|
||||
menu. Initially, DrRacket only supports two modes: Racket
|
||||
mode and text mode.
|
||||
|
||||
DrScheme automatically selects a mode for each open
|
||||
DrRacket automatically selects a mode for each open
|
||||
file based on the file's extension. If the file ends with
|
||||
@File{.txt}, DrScheme uses text mode. Otherwise, DrScheme
|
||||
uses Scheme mode.
|
||||
@File{.txt}, DrRacket uses text mode. Otherwise, DrRacket
|
||||
uses Racket mode.
|
||||
|
||||
@section{Language-specific capabilities}
|
||||
|
||||
Drscheme's capability interface provides a mechanism for
|
||||
DrRacket's capability interface provides a mechanism for
|
||||
tools to allow languages to hide their GUI interface, if the
|
||||
tool does not apply to the language. Tools register
|
||||
capabilities keyed with symbols via.
|
||||
|
@ -472,15 +468,14 @@ capabilities keyed with symbols via.
|
|||
registered, a tool can query a language, via the
|
||||
@method[drracket:language:language<%> capability-value]
|
||||
method. The result from this method controls whether or not
|
||||
the tool shows this part of the GUI for DrScheme.
|
||||
the tool shows this part of the GUI for DrRacket.
|
||||
|
||||
See @scheme[drracket:language:register-capability]
|
||||
for a list of the capabilities registered by default.
|
||||
|
||||
@section{Check Syntax}
|
||||
|
||||
Check Syntax is a part of the DrScheme collection, but is implemented via the tools api, i.e.,
|
||||
not taking any advantage of
|
||||
Check Syntax is a part of the DrRacket collection, but is implemented via the tools API.
|
||||
|
||||
@defmodule[drscheme/syncheck-drracket-button]
|
||||
|
||||
|
@ -494,20 +489,16 @@ not taking any advantage of
|
|||
This is meant to be used with the @scheme['drscheme:toolbar-buttons]
|
||||
argument to the info proc returned
|
||||
from @scheme[read-language].
|
||||
}
|
||||
toolbar-buttons]
|
||||
argument to the info proc returned
|
||||
from @scheme[read-language].
|
||||
}
|
||||
|
||||
@defidform[syncheck:button-callback]{
|
||||
This is defined with @scheme[define-local-member-name] and
|
||||
is bound to a method of no arguments of the DrScheme frame that runs Check
|
||||
is bound to a method of no arguments of the DrRacket frame that runs Check
|
||||
Syntax.
|
||||
}
|
||||
|
||||
@defthing[syncheck-bitmap (is-a?/c bitmap%)]{
|
||||
The bitmap in the Check Syntax button on the DrScheme frame.
|
||||
The bitmap in the Check Syntax button on the DrRacket frame.
|
||||
}
|
||||
|
||||
@include-section["get-slash-extend.scrbl"]
|
||||
|
|
|
@ -44,7 +44,7 @@ Enables the Run button, and the Run menu item and unlocks
|
|||
|
||||
@defmethod[(get-defs)
|
||||
(is-a?/c drracket:unit:definitions-text<%>)]{
|
||||
This text is initially the top half of the drscheme window and
|
||||
This text is initially the top half of the DrRacket window and
|
||||
contains the users program.
|
||||
|
||||
This text defaults to a @scheme[text%]
|
||||
|
@ -58,7 +58,7 @@ object, but if you change
|
|||
(or/c string? false/c)]{
|
||||
|
||||
This is the directory that the file is saved in, or the
|
||||
directory DrScheme started up in, if the file has not been
|
||||
directory DrRacket started up in, if the file has not been
|
||||
saved.
|
||||
|
||||
|
||||
|
@ -80,7 +80,7 @@ Returns the frame that this tab is inside.
|
|||
|
||||
@defmethod[(get-ints)
|
||||
(is-a?/c drracket:rep:text%)]{
|
||||
This text is initially the bottom half of the drscheme window and
|
||||
This text is initially the bottom half of the DrRacket window and
|
||||
contains the users interactions with the REPL.
|
||||
|
||||
This text defaults to a @scheme[drracket:rep:text%]
|
||||
|
@ -100,7 +100,7 @@ Indicates if this tab is the currently active tab.
|
|||
boolean?]{
|
||||
|
||||
Indicates if the running message in the bottom right of
|
||||
drscheme's frame should be ``running'' or ``not running''
|
||||
DrRacket's frame should be ``running'' or ``not running''
|
||||
when this frame is active.
|
||||
|
||||
|
||||
|
@ -202,7 +202,7 @@ Passes all arguments to @scheme[super-init].
|
|||
|
||||
@defclass[drracket:unit:frame% (drracket:frame:basics-mixin (drracket:frame:mixin frame:searchable%)) (drracket:unit:frame<%>)]{
|
||||
|
||||
This frame inserts the Scheme and Language menus into the menu bar as it is initialized.
|
||||
This frame inserts the @onscreen{Racket} and @onscreen{Language} menus into the menu bar as it is initialized.
|
||||
|
||||
|
||||
|
||||
|
@ -246,7 +246,7 @@ Breaks the user's evaluation started by the Run button
|
|||
void?]{
|
||||
|
||||
Loads this file into this already created frame. In normal
|
||||
DrScheme use, this method is only called if this is the
|
||||
DrRacket use, this method is only called if this is the
|
||||
first frame opened and no editing has occurred. It should be
|
||||
safe to call this at anytime, however.
|
||||
|
||||
|
@ -353,7 +353,7 @@ Returns the break button. Mostly used for test suites.
|
|||
|
||||
@defmethod[(get-button-panel)
|
||||
(is-a?/c horizontal-panel%)]{
|
||||
This panel goes along the top of the drscheme window and has buttons
|
||||
This panel goes along the top of the DrRacket window and has buttons
|
||||
for important actions the user frequently executes.
|
||||
|
||||
A tool can add a button to this panel to make some new functionality
|
||||
|
@ -390,7 +390,7 @@ Returns the result of
|
|||
@methspec{
|
||||
|
||||
This method is provided so that tools can add
|
||||
@scheme[area-container<%>]s to the drscheme frame. Override this method so that it
|
||||
@scheme[area-container<%>]s to the DrRacket frame. Override this method so that it
|
||||
returns a child of the super-classes's result and insert new
|
||||
children in between.
|
||||
|
||||
|
@ -475,7 +475,7 @@ Calls the super method.
|
|||
void?]{
|
||||
|
||||
Updates the preferences for the window width and height
|
||||
so next time a drscheme window is opened, it will be this
|
||||
so next time a DrRacket window is opened, it will be this
|
||||
width and height.
|
||||
|
||||
|
||||
|
@ -518,7 +518,7 @@ This method is called by the
|
|||
@defmethod[(update-save-message [name string?])
|
||||
void?]{
|
||||
|
||||
Updates the save message on the drscheme frame. This method is called by
|
||||
Updates the save message on the DrRacket frame. This method is called by
|
||||
the
|
||||
@method[drracket:unit:definitions-text% set-filename] method.
|
||||
|
||||
|
@ -540,7 +540,7 @@ items based on the contents of the windows.
|
|||
|
||||
@defmethod[(get-language-menu) (is-a?/c menu%)]{ Returns the
|
||||
language-specific menu. This menu is called the
|
||||
@onscreen{Scheme} menu in the Scheme language but is, in general,
|
||||
@onscreen{Racket} menu in the Racket language but is, in general,
|
||||
controlled by the @scheme['drscheme:language-menu-title]
|
||||
capability (see @scheme[drracket:language:register-capability]
|
||||
for details on capabilities).
|
||||
|
@ -598,7 +598,7 @@ Returns the currently active tab.
|
|||
(is-a?/c drracket:unit:definitions-canvas%)]{
|
||||
|
||||
This canvas is the canvas containing the
|
||||
@method[drracket:unit:frame<%> get-definitions-text]. It is initially the top half of the drscheme window.
|
||||
@method[drracket:unit:frame<%> get-definitions-text]. It is initially the top half of the DrRacket window.
|
||||
|
||||
This canvas defaults to a @scheme[drracket:unit:definitions-canvas%]
|
||||
object, but if you change the
|
||||
|
@ -629,7 +629,7 @@ Returns the Insert menu.
|
|||
(instanceof (derivedfrom drracket:unit:interactions-canvas%))]{
|
||||
|
||||
This canvas is the canvas containing the
|
||||
@method[drracket:unit:frame<%> get-interactions-text]. It is initially the bottom half of the drscheme window.
|
||||
@method[drracket:unit:frame<%> get-interactions-text]. It is initially the bottom half of the DrRacket window.
|
||||
|
||||
This canvas defaults to a @scheme[drracket:unit:interactions-canvas%]
|
||||
object, but if you use the
|
||||
|
@ -761,9 +761,9 @@ Called when the next settings changes. See also
|
|||
|
||||
@defmethod[(begin-metadata-changes)
|
||||
void?]{
|
||||
Augment this method to be notified when DrScheme is changing
|
||||
Augment this method to be notified when DrRacket is changing
|
||||
the buffer to insert metadata. The metadata is only inserted
|
||||
during saving, so tools that track changes to DrScheme will
|
||||
during saving, so tools that track changes to DrRacket will
|
||||
need to ignore changes that occur after this method is
|
||||
called, and before
|
||||
@method[drracket:unit:definitions-text<%> end-metadata-changes] is called.
|
||||
|
@ -789,7 +789,7 @@ the calls cannot be nested).
|
|||
@defmethod[(get-next-settings)
|
||||
language-settings]{
|
||||
This method returns the language-settings that will be used
|
||||
when the user next clicks Run in this DrScheme window.
|
||||
when the user next clicks Run in this DrRacket window.
|
||||
|
||||
}
|
||||
|
||||
|
@ -822,7 +822,7 @@ source field of an exception record) matches this editor.
|
|||
void?]{
|
||||
@methspec{
|
||||
|
||||
This method, when called, puts this drscheme window in a
|
||||
This method, when called, puts this DrRacket window in a
|
||||
state such that interactions submitted to the REPL will
|
||||
trigger a yellow warning message. The state is reset when
|
||||
the program is next Run.
|
||||
|
|
Loading…
Reference in New Issue
Block a user