rackety misc docs
This commit is contained in:
parent
e5a259bdf0
commit
eb15dceb34
|
@ -5,7 +5,7 @@
|
|||
compiler/cffi
|
||||
mzlib/include))
|
||||
|
||||
@(define mzc (exec "mzc"))
|
||||
@(define ctool (exec "raco ctool"))
|
||||
@(define cpp tt)
|
||||
@(define inside @other-manual['(lib "scribblings/inside/inside.scrbl")])
|
||||
|
||||
|
@ -23,53 +23,53 @@
|
|||
@(define (argtype scm desc c . cases)
|
||||
(item (apply lines
|
||||
scm
|
||||
@elem{Scheme range: @|desc|}
|
||||
@elem{Racket range: @|desc|}
|
||||
@elem{C type: @|c|}
|
||||
cases)))
|
||||
|
||||
@(define (toC . content)
|
||||
(apply elem "Scheme to C conversion: " content))
|
||||
@(define (toScheme . content)
|
||||
(apply elem "C to Scheme conversion: " content))
|
||||
(apply elem "Racket to C conversion: " content))
|
||||
@(define (toRacket . content)
|
||||
(apply elem "C to Racket conversion: " content))
|
||||
@(define tosObvious
|
||||
(elem "conversions: (obvious and precise)"))
|
||||
@(define goesto 'rarr)
|
||||
|
||||
|
||||
|
||||
@title{@scheme[c-lambda]: C FFI via @exec{mzc}}
|
||||
@title{@scheme[c-lambda]: C FFI via @exec{raco ctool}}
|
||||
|
||||
@defmodule[compiler/cffi]{
|
||||
|
||||
The @schememodname[compiler/cffi] module relies on a C compiler to
|
||||
statically construct an interface to C code through directives
|
||||
embedded in a Scheme program. The library implements a subset of
|
||||
embedded in a Racket program. The library implements a subset of
|
||||
@as-index{Gambit-C}'s foreign-function interface @cite["Feeley98"].}
|
||||
|
||||
The @schememodname[scheme/foreign] library is a better interface for
|
||||
The @racketmodname[ffi/unsafe] library is a better interface for
|
||||
most tasks; see @other-manual['(lib
|
||||
"scribblings/foreign/foreign.scrbl")] for more information on
|
||||
@schememodname[scheme/foreign]. See also @|inside|, which describes
|
||||
PLT Scheme's C-level API for extending the run-time system.
|
||||
@racketmodname[ffi/unsafe]. See also @|inside|, which describes
|
||||
Racket's C-level API for extending the run-time system.
|
||||
|
||||
The @schememodname[compiler/cffi] library defines three forms:
|
||||
@scheme[c-lambda], @scheme[c-declare], and @scheme[c-include]. When
|
||||
interpreted directly or compiled to byte code, @scheme[c-lambda]
|
||||
produces a function that always raises @scheme[exn:fail], and
|
||||
@scheme[c-declare] and @scheme[c-include] raise
|
||||
@scheme[exn:fail]. When compiled by @exec{mzc --extension}, the forms
|
||||
provide access to C. Thus, @schememodname[compiler/cffi] is normally
|
||||
required by a module to be compiled via @|mzc|. In addition, the
|
||||
@|mzc| compiler implicitly imports @schememodname[compiler/cffi] into
|
||||
the top-level environment for non-@scheme[module] compilation.
|
||||
The @racketmodname[compiler/cffi] library defines three forms:
|
||||
@racket[c-lambda], @racket[c-declare], and @racket[c-include]. When
|
||||
interpreted directly or compiled to byte code, @racket[c-lambda]
|
||||
produces a function that always raises @racket[exn:fail], and
|
||||
@racket[c-declare] and @racket[c-include] raise
|
||||
@racket[exn:fail]. When compiled by @exec{raco ctool --extension}, the forms
|
||||
provide access to C. Thus, @racketmodname[compiler/cffi] is normally
|
||||
required by a module to be compiled via @|ctool|. In addition, the
|
||||
@|ctool| compiler implicitly imports @racketmodname[compiler/cffi] into
|
||||
the top-level environment for non-@racket[module] compilation.
|
||||
|
||||
The @scheme[c-lambda] form creates a Scheme procedure whose body is
|
||||
The @racket[c-lambda] form creates a Racket procedure whose body is
|
||||
implemented in C. Instead of declaring argument names, a
|
||||
@scheme[c-lambda] form declares argument types, as well as a return
|
||||
@racket[c-lambda] form declares argument types, as well as a return
|
||||
type. The implementation can be simply the name of a C function, as in
|
||||
the following definition of @scheme[fmod]:
|
||||
the following definition of @racket[fmod]:
|
||||
|
||||
@schemeblock[
|
||||
@racketblock[
|
||||
(define fmod (c-lambda (double double) double "fmod"))
|
||||
]
|
||||
|
||||
|
@ -78,199 +78,199 @@ of a function, where the arguments are bound to @cpp{___arg1} (three
|
|||
underscores), etc., and the result is installed into @cpp{___result}
|
||||
(three underscores):
|
||||
|
||||
@schemeblock[
|
||||
@racketblock[
|
||||
(define machine-string->float
|
||||
(c-lambda (char-string) float
|
||||
"___result = *(float *)___arg1;"))
|
||||
]
|
||||
|
||||
The @scheme[c-lambda] form provides only limited conversions between C
|
||||
and Scheme data. For example, the following function does not reliably
|
||||
The @racket[c-lambda] form provides only limited conversions between C
|
||||
and Racket data. For example, the following function does not reliably
|
||||
produce a string of four characters:
|
||||
|
||||
@schemeblock[
|
||||
@racketblock[
|
||||
(define broken-machine-float->string
|
||||
(c-lambda (float) char-string
|
||||
"char b[5]; *(float *)b = ___arg1; b[4] = 0; ___result = b;"))
|
||||
]
|
||||
|
||||
because the representation of a @cpp{float} can contain null bytes,
|
||||
which terminate the string. However, the full MzScheme API, which is
|
||||
which terminate the string. However, the full Racket API, which is
|
||||
described in @|inside|, can be used in a function body:
|
||||
|
||||
@schemeblock[
|
||||
@racketblock[
|
||||
(define machine-float->string
|
||||
(c-lambda (float) scheme-object
|
||||
(c-lambda (float) racket-object
|
||||
"char b[4];"
|
||||
"*(float *)b = ___arg1;"
|
||||
"___result = scheme_make_sized_byte_string(b, 4, 1);"))
|
||||
"___result = racket_make_sized_byte_string(b, 4, 1);"))
|
||||
]
|
||||
|
||||
The @scheme[c-declare] form declares arbitrary C code to appear after
|
||||
The @racket[c-declare] form declares arbitrary C code to appear after
|
||||
@filepath{escheme.h} or @filepath{scheme.h} is included, but before
|
||||
any other code in the compilation environment of the declaration. It
|
||||
is often used to declare C header file inclusions. For example, a
|
||||
proper definition of @scheme[fmod] needs the @filepath{math.h} header
|
||||
proper definition of @racket[fmod] needs the @filepath{math.h} header
|
||||
file:
|
||||
|
||||
@schemeblock[
|
||||
@racketblock[
|
||||
(c-declare "#include <math.h>")
|
||||
(define fmod (c-lambda (double double) double "fmod"))
|
||||
]
|
||||
|
||||
The @scheme[c-declare] form can also be used to define helper C
|
||||
functions to be called through @scheme[c-lambda].
|
||||
The @racket[c-declare] form can also be used to define helper C
|
||||
functions to be called through @racket[c-lambda].
|
||||
|
||||
The @scheme[c-include] form expands to a @scheme[c-declare] form using
|
||||
the content of a specified file. Use @scheme[(c-include _file)] instead
|
||||
of @scheme[(c-declare "#include file")] when it's easier to
|
||||
have MzScheme resolve the file path than to have the C compiler
|
||||
The @racket[c-include] form expands to a @racket[c-declare] form using
|
||||
the content of a specified file. Use @racket[(c-include _file)] instead
|
||||
of @racket[(c-declare "#include file")] when it's easier to
|
||||
have Racket resolve the file path than to have the C compiler
|
||||
resolve it.
|
||||
|
||||
The @filepath{plt/collects/mzscheme/examples} directory in the PLT
|
||||
The @filepath{collects/mzscheme/examples} directory in the Racket
|
||||
distribution contains additional examples.
|
||||
|
||||
When compiling for MzScheme3m (see @|inside|), C code inserted by
|
||||
@scheme[c-lambda], @scheme[c-declare], and @scheme[c-include] will be
|
||||
transformed in the same was as @|mzc|'s @DFlag{xform} mode (which may
|
||||
or may not be enough to make the code work correctly in MzScheme3m;
|
||||
When compiling for Racket 3m (see @|inside|), C code inserted by
|
||||
@racket[c-lambda], @racket[c-declare], and @racket[c-include] will be
|
||||
transformed in the same was as @|ctool|'s @DFlag{xform} mode (which may
|
||||
or may not be enough to make the code work correctly in Racket 3m;
|
||||
see @|inside| for more information).
|
||||
|
||||
|
||||
@defform[(c-lambda (argument-type ...) return-type impl-string ...+)]{
|
||||
|
||||
Creates a Scheme procedure whose body is implemented in C. The
|
||||
Creates a Racket procedure whose body is implemented in C. The
|
||||
procedure takes as many arguments as the supplied
|
||||
@scheme[argument-type]s, and it returns one value. If
|
||||
@scheme[return-type] is @schemeidfont{void}, the procedure's result is
|
||||
always void. The @scheme[impl-string] is either the name of a C
|
||||
@racket[argument-type]s, and it returns one value. If
|
||||
@racket[return-type] is @racketidfont{void}, the procedure's result is
|
||||
always void. The @racket[impl-string] is either the name of a C
|
||||
function (or macro) or the body of a C function.
|
||||
|
||||
If a single @scheme[impl-string] is provided, and if it is a
|
||||
If a single @racket[impl-string] is provided, and if it is a
|
||||
string containing only alphanumeric characters and @litchar{_},
|
||||
then the created Scheme procedure passes all of its arguments to
|
||||
then the created Racket procedure passes all of its arguments to
|
||||
the named C function (or macro) and returns the function's
|
||||
result. Each argument to the Scheme procedure is converted
|
||||
according to the corresponding @scheme[argument-type] (as
|
||||
result. Each argument to the Racket procedure is converted
|
||||
according to the corresponding @racket[argument-type] (as
|
||||
described below) to produce an argument to the C function. Unless
|
||||
@scheme[return-type] is @schemeidfont{void}, the C function's result is
|
||||
converted according to @scheme[return-type] for the Scheme
|
||||
@racket[return-type] is @racketidfont{void}, the C function's result is
|
||||
converted according to @racket[return-type] for the Racket
|
||||
procedure's result.
|
||||
|
||||
If more than @scheme[impl-string] is provided, or if it contains more
|
||||
If more than @racket[impl-string] is provided, or if it contains more
|
||||
than alphanumeric characters and @litchar{_}, then the concatenated
|
||||
@scheme[impl-string]s must contain C code to implement the function
|
||||
@racket[impl-string]s must contain C code to implement the function
|
||||
body. The converted arguments for the function will be in variables
|
||||
@cpp{___arg1}, @cpp{___arg2}, ... (with three underscores in each
|
||||
name) in the context where the @scheme[impl-string]s are placed for
|
||||
compilation. Unless @scheme[return-type] is @schemeidfont{void}, the
|
||||
@scheme[impl-string]s code should assign a result to the variable
|
||||
name) in the context where the @racket[impl-string]s are placed for
|
||||
compilation. Unless @racket[return-type] is @racketidfont{void}, the
|
||||
@racket[impl-string]s code should assign a result to the variable
|
||||
@cpp{___result} (three underscores), which will be declared but not
|
||||
initialized. The @scheme[impl-string]s code should not return
|
||||
initialized. The @racket[impl-string]s code should not return
|
||||
explicitly; control should always reach the end of the body. If the
|
||||
@scheme[impl-string]s code defines the pre-processor macro
|
||||
@racket[impl-string]s code defines the pre-processor macro
|
||||
@cpp{___AT_END} (with three leading underscores), then the macro's
|
||||
value should be C code to execute after the value @cpp{___result} is
|
||||
converted to a Scheme result, but before the result is returned, all
|
||||
converted to a Racket result, but before the result is returned, all
|
||||
in the same block; defining @cpp{___AT_END} is primarily useful for
|
||||
deallocating a string in @cpp{___result} that has been copied by
|
||||
conversion. The @scheme[impl-string]s code will start on a new line at
|
||||
conversion. The @racket[impl-string]s code will start on a new line at
|
||||
the beginning of a block in its compilation context, and
|
||||
@cpp{___AT_END} will be undefined after the code.
|
||||
|
||||
In addition to @cpp{___arg1}, etc., the variable @cpp{argc} is bound
|
||||
in @scheme[impl-string]s to the number of arguments supplied to
|
||||
the function, and @cpp{argv} is bound to a @cpp{Scheme_Object*} array
|
||||
of length @cpp{argc} containing the function arguments as Scheme
|
||||
in @racket[impl-string]s to the number of arguments supplied to
|
||||
the function, and @cpp{argv} is bound to a @cpp{Racket_Object*} array
|
||||
of length @cpp{argc} containing the function arguments as Racket
|
||||
values. The @cpp{argv} and @cpp{argc} variables are mainly useful for
|
||||
error reporting (e.g., with @cpp{scheme_wrong_type}).
|
||||
error reporting (e.g., with @cpp{racket_wrong_type}).
|
||||
|
||||
Each @scheme[argument-type] must be one of the following, which are
|
||||
Each @racket[argument-type] must be one of the following, which are
|
||||
recognized symbolically:
|
||||
|
||||
@itemize[
|
||||
|
||||
@argtype[@scheme[bool] "any value" @cpp{int}
|
||||
@toC{@scheme[#f] @|goesto| 0, anything else @|goesto| 1}
|
||||
@toScheme{0 @|goesto| @scheme[#f], anything else @|goesto| @scheme[#t]}]
|
||||
@argtype[@racket[bool] "any value" @cpp{int}
|
||||
@toC{@racket[#f] @|goesto| 0, anything else @|goesto| 1}
|
||||
@toRacket{0 @|goesto| @racket[#f], anything else @|goesto| @racket[#t]}]
|
||||
|
||||
@argtype[@scheme[char] "character" @cpp{char}
|
||||
@argtype[@racket[char] "character" @cpp{char}
|
||||
@toC{character's Latin-1 value cast to signed byte}
|
||||
@toScheme{Latin-1 value from unsigned cast mapped to character}]
|
||||
@toRacket{Latin-1 value from unsigned cast mapped to character}]
|
||||
|
||||
@argtype[@scheme[unsigned-char] "character" @cpp{unsigned char}
|
||||
@argtype[@racket[unsigned-char] "character" @cpp{unsigned char}
|
||||
@toC{character's Latin-1 value}
|
||||
@toScheme{Latin-1 value mapped to character}]
|
||||
@toRacket{Latin-1 value mapped to character}]
|
||||
|
||||
@argtype[@scheme[signed-char] "character" @cpp{signed char}
|
||||
@argtype[@racket[signed-char] "character" @cpp{signed char}
|
||||
@toC{character's Latin-1 value cast to signed byte}
|
||||
@toScheme{Latin-1 value from unsigned cast mapped to character}]
|
||||
@toRacket{Latin-1 value from unsigned cast mapped to character}]
|
||||
|
||||
@argtype[@scheme[int] @elem{exact integer that fits into an @cpp{int}} @cpp{int}
|
||||
@argtype[@racket[int] @elem{exact integer that fits into an @cpp{int}} @cpp{int}
|
||||
@tosObvious]
|
||||
|
||||
@argtype[@scheme[unsigned-int] @elem{exact integer that fits into an @cpp{unsigned int}} @cpp{unsigned int}
|
||||
@argtype[@racket[unsigned-int] @elem{exact integer that fits into an @cpp{unsigned int}} @cpp{unsigned int}
|
||||
@tosObvious]
|
||||
|
||||
@argtype[@scheme[long] @elem{exact integer that fits into a @cpp{long}} @cpp{long}
|
||||
@argtype[@racket[long] @elem{exact integer that fits into a @cpp{long}} @cpp{long}
|
||||
@tosObvious]
|
||||
|
||||
@argtype[@scheme[unsigned-long] @elem{exact integer that fits into an @cpp{unsigned long}} @cpp{unsigned long}
|
||||
@argtype[@racket[unsigned-long] @elem{exact integer that fits into an @cpp{unsigned long}} @cpp{unsigned long}
|
||||
@tosObvious]
|
||||
|
||||
@argtype[@scheme[short] @elem{exact integer that fits into a @cpp{short}} @cpp{short}
|
||||
@argtype[@racket[short] @elem{exact integer that fits into a @cpp{short}} @cpp{short}
|
||||
@tosObvious]
|
||||
|
||||
@argtype[@scheme[unsigned-short] @elem{exact integer that fits into an @cpp{unsigned short}} @cpp{unsigned short}
|
||||
@argtype[@racket[unsigned-short] @elem{exact integer that fits into an @cpp{unsigned short}} @cpp{unsigned short}
|
||||
@tosObvious]
|
||||
|
||||
@argtype[@scheme[float] "real number" @cpp{float}
|
||||
@argtype[@racket[float] "real number" @cpp{float}
|
||||
@toC{number converted to inexact and cast to @cpp{float}}
|
||||
@toScheme{cast to @cpp{double} and encapsulated as an inexact number}]
|
||||
@toRacket{cast to @cpp{double} and encapsulated as an inexact number}]
|
||||
|
||||
@argtype[@scheme[double] "real number" @cpp{double}
|
||||
@argtype[@racket[double] "real number" @cpp{double}
|
||||
@toC{number converted to inexact}
|
||||
@toScheme{encapsulated as an inexact number}]
|
||||
@toRacket{encapsulated as an inexact number}]
|
||||
|
||||
@argtype[@scheme[char-string] @elem{byte string or @scheme[#f]} @cpp{char*}
|
||||
@toC{string @|goesto| contained byte-array pointer, @scheme[#f] @|goesto| @cpp{NULL}}
|
||||
@toScheme{@cpp{NULL} @|goesto| @scheme[#f], anything else @|goesto| new byte string created by copying the string}]
|
||||
@argtype[@racket[char-string] @elem{byte string or @racket[#f]} @cpp{char*}
|
||||
@toC{string @|goesto| contained byte-array pointer, @racket[#f] @|goesto| @cpp{NULL}}
|
||||
@toRacket{@cpp{NULL} @|goesto| @racket[#f], anything else @|goesto| new byte string created by copying the string}]
|
||||
|
||||
@argtype[@scheme[nonnull-char-string] "byte string" @cpp{char*}
|
||||
@argtype[@racket[nonnull-char-string] "byte string" @cpp{char*}
|
||||
@toC{byte string's contained byte-array pointer}
|
||||
@toScheme{new byte string created by copying the string}]
|
||||
@toRacket{new byte string created by copying the string}]
|
||||
|
||||
@argtype[@scheme[scheme-object] "any value" @cpp{Scheme_Object*}
|
||||
@argtype[@racket[racket-object] "any value" @cpp{Racket_Object*}
|
||||
@toC{no conversion}
|
||||
@toScheme{no conversion}]
|
||||
@toRacket{no conversion}]
|
||||
|
||||
@argtype[@scheme[(pointer _bstr)] @elem{an opaque c-pointer value, identified as type @scheme[bstr], or @scheme[#f]} @cpp{@scheme[_bstr]*}
|
||||
@toC{@scheme[#f] @|goesto| @cpp{NULL}, c-pointer @|goesto| contained pointer cast to @cpp{@scheme[_bstr]*}}
|
||||
@toScheme{@cpp{NULL} @|goesto| @scheme[#f], anything else @|goesto| new c-pointer containing the pointer
|
||||
and identified as type @scheme[_bstr]}]
|
||||
@argtype[@racket[(pointer _bstr)] @elem{an opaque c-pointer value, identified as type @racket[bstr], or @racket[#f]} @cpp{@racket[_bstr]*}
|
||||
@toC{@racket[#f] @|goesto| @cpp{NULL}, c-pointer @|goesto| contained pointer cast to @cpp{@racket[_bstr]*}}
|
||||
@toRacket{@cpp{NULL} @|goesto| @racket[#f], anything else @|goesto| new c-pointer containing the pointer
|
||||
and identified as type @racket[_bstr]}]
|
||||
|
||||
]
|
||||
|
||||
The @scheme[return-type] must be @schemeidfont{void} or one of the
|
||||
@scheme[arg-type] keywords.}
|
||||
The @racket[return-type] must be @racketidfont{void} or one of the
|
||||
@racket[arg-type] keywords.}
|
||||
|
||||
@defform[(c-declare code-string)]{
|
||||
|
||||
Declares arbitrary C code to appear after @filepath{escheme.h} or
|
||||
@filepath{scheme.h} is included, but before any other code in the
|
||||
compilation environment of the declaration. A @scheme[c-declare] form
|
||||
compilation environment of the declaration. A @racket[c-declare] form
|
||||
can appear only at the top-level or within a module's top-level
|
||||
sequence.
|
||||
|
||||
The @scheme[code] code will appear on a new line in the file for C
|
||||
compilation. Multiple @scheme[c-include] declarations are concatenated
|
||||
The @racket[code] code will appear on a new line in the file for C
|
||||
compilation. Multiple @racket[c-include] declarations are concatenated
|
||||
(with newlines) in order to produces a sequence of declarations.}
|
||||
|
||||
@defform[(c-include path-spec)]{
|
||||
|
||||
Expands to a use of @scheme[c-declare] with the content of
|
||||
@scheme[path-spec]. The @scheme[path-spec] has the same form as for
|
||||
@schememodname[mzlib/include]'s @scheme[include].}
|
||||
Expands to a use of @racket[c-declare] with the content of
|
||||
@racket[path-spec]. The @racket[path-spec] has the same form as for
|
||||
@racketmodname[mzlib/include]'s @racket[include].}
|
||||
|
||||
@(bibliography
|
||||
(bib-entry
|
||||
|
|
|
@ -35,7 +35,7 @@ Compiles the given input file (C source) to the given output file (a
|
|||
compiled-object file). The @scheme[quiet?] argument indicates whether
|
||||
command should be echoed to the current output port. The
|
||||
@scheme[include-dirs] argument is a list of directories to search for
|
||||
include files; the PLT Scheme installation's @filepath{include}
|
||||
include files; the Racket installation's @filepath{include}
|
||||
directories are added automatically.}
|
||||
|
||||
|
||||
|
@ -358,20 +358,20 @@ Appends the platform-standard dynamic-extension file suffix to
|
|||
(program any/c #f))
|
||||
(or/c path? false/c)]{
|
||||
|
||||
Strips the Scheme file suffix from @scheme[s] and returns a stripped
|
||||
Strips the Racket file suffix from @scheme[s] and returns a stripped
|
||||
path. Unlike the other functions below, when @scheme[program] is not
|
||||
@scheme[#f], then any suffix (including no suffix) is allowed. If
|
||||
@scheme[s] is not a Scheme file and @scheme[program] is @scheme[#f],
|
||||
@scheme[s] is not a Racket file and @scheme[program] is @scheme[#f],
|
||||
@scheme[#f] is returned.}
|
||||
|
||||
@defproc[(extract-base-filename/c (s path-string?)
|
||||
(program any/c #f))
|
||||
(or/c path? false/c)]{
|
||||
|
||||
Strips the Scheme file suffix from @scheme[s] and
|
||||
returns a stripped path. If @scheme[s] is not a Scheme file name and
|
||||
Strips the Racket file suffix from @scheme[s] and
|
||||
returns a stripped path. If @scheme[s] is not a Racket file name and
|
||||
@scheme[program] is a symbol, and error is signaled. If @scheme[s] is
|
||||
not a Scheme file and @scheme[program] is @scheme[#f], @scheme[#f] is
|
||||
not a Racket file and @scheme[program] is @scheme[#f], @scheme[#f] is
|
||||
returned.}
|
||||
|
||||
@defproc[(extract-base-filename/kp (s path-string?) (program any/c #f)) (or/c path? false/c)]{
|
||||
|
|
|
@ -10,9 +10,9 @@
|
|||
@title[#:tag "top"]{@bold{Errortrace}: Debugging and Profiling}
|
||||
|
||||
@bold{Errortrace} is a stack-trace-on-exceptions, profiler, and
|
||||
coverage tool for MzScheme. It is not a complete debugger; DrScheme
|
||||
coverage tool for Racket. It is not a complete debugger; DrRacket
|
||||
provides more. Meanwhile, using Errortrace might be better than
|
||||
MzScheme's limited stack-trace reporting.
|
||||
Racket's limited stack-trace reporting.
|
||||
|
||||
@table-of-contents[]
|
||||
|
||||
|
@ -29,19 +29,19 @@ Then,
|
|||
@itemize[
|
||||
@item{If your program has a module file @nonterm{prog}, run it with
|
||||
|
||||
@commandline{mzscheme -l errortrace -t @nonterm{prog}}}
|
||||
@commandline{racket -l errortrace -t @nonterm{prog}}}
|
||||
|
||||
@item{If you program is a non-module top-level sequence of
|
||||
definitions and expressions, you can instead add
|
||||
@schemeblock[(require errortrace)]
|
||||
to the beginning of the program or start MzScheme with the @Flag{l} option before the
|
||||
to the beginning of the program or start Racket with the @Flag{l} option before the
|
||||
arguments to load your program:
|
||||
@commandline{mzscheme -l errortrace ...}}
|
||||
@commandline{racket -l errortrace ...}}
|
||||
|
||||
@item{If you have no main program and you want to use
|
||||
MzScheme interactively, include the @Flag{i} flag
|
||||
Racket interactively, include the @Flag{i} flag
|
||||
before @Flag{l}:
|
||||
@commandline{mzscheme -i -l errortrace}}
|
||||
@commandline{racket -i -l errortrace}}
|
||||
]
|
||||
|
||||
After starting @schememodname[errortrace] in one of these ways, when an
|
||||
|
@ -64,7 +64,7 @@ handler or the error display handler.
|
|||
|
||||
Invoking the
|
||||
@schememodname[errortrace] module sets the compilation
|
||||
handler to instrument Scheme source code. It also sets the error
|
||||
handler to instrument Racket source code. It also sets the error
|
||||
display handler to report source information for an exception, and it
|
||||
sets the @scheme[use-compiled-file-paths] parameter to trigger the use
|
||||
of Errortrace-specific @filepath{.zo} files.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#lang scribble/doc
|
||||
@(require "common.ss")
|
||||
|
||||
@title{@bold{File}: PLT File Format Libraries}
|
||||
@title{@bold{File}: Racket File Format Libraries}
|
||||
|
||||
@table-of-contents[]
|
||||
|
||||
|
|
|
@ -17,8 +17,8 @@
|
|||
@author["Greg Cooper"]
|
||||
|
||||
The @schememodname[frtime] language supports declarative construction of
|
||||
reactive systems in a syntax very similar to that of MzScheme. To
|
||||
interact with FrTime, select FrTime from the "Choose Language" menu.
|
||||
reactive systems in a syntax very similar to that of Racket. To
|
||||
interact with FrTime, select @onscreen{FrTime} from the @onscreen{Choose Language} menu.
|
||||
You can also make FrTime the language for a module:
|
||||
|
||||
@schemeblock[
|
||||
|
@ -144,7 +144,7 @@ anything else.}
|
|||
any]{provides a mechanism for applying ordinary Scheme primitives to
|
||||
behaviors. If any of the @scheme[val]s are behaviors, returns a
|
||||
behavior whose current value is always equal to @scheme[(proc
|
||||
(value-now arg) ...)]. In FrTime, many MzScheme primitives are
|
||||
(value-now arg) ...)]. In FrTime, many Racket primitives are
|
||||
implicitly lifted.}
|
||||
|
||||
The following forms allow importation of lifted procedures that aren't
|
||||
|
|
|
@ -215,7 +215,7 @@ For @scheme[fern1], you will probably want to point the turtle up
|
|||
before running this one, with something like:
|
||||
|
||||
@schemeblock[
|
||||
@scheme[(turn/radians (- (/ pi 2)))]
|
||||
(turn/radians (- (/ pi 2)))
|
||||
]
|
||||
|
||||
For @scheme[fern2], you may need to backup a little.}
|
||||
|
|
|
@ -63,8 +63,9 @@ Student language for @|htdp|; see @htdp-ref["advanced"].
|
|||
@defmodule[lang/plt-pretty-big-text]
|
||||
|
||||
The @schememodname[lang/plt-pretty-big-text] module is similar to the
|
||||
@italic{HtDP} Advanced Student language, but with more of PLT Scheme's
|
||||
libraries. It provides the bindings of @schememodname[mzscheme],
|
||||
@italic{HtDP} Advanced Student language, but with more of Racket's
|
||||
libraries in legacy form. It provides the bindings of
|
||||
@schememodname[mzscheme],
|
||||
@schememodname[mzlib/etc], @schememodname[mzlib/file],
|
||||
@schememodname[mzlib/list], @schememodname[mzlib/class],
|
||||
@schememodname[mzlib/unit], @schememodname[mzlib/include],
|
||||
|
@ -82,7 +83,7 @@ libraries. It provides the bindings of @schememodname[mzscheme],
|
|||
The @schememodname[lang/plt-pretty-big] module extends
|
||||
@scheme[lang/plt-pretty-big-text] with @schememodname[scheme/gui/base]
|
||||
and @schememodname[lang/imageeq]. This language corresponds to the
|
||||
@onscreen{Pretty Big Scheme} legacy language in DrScheme.
|
||||
@onscreen{Pretty Big} legacy language in DrRacket.
|
||||
|
||||
@; ----------------------------------------------------------------------
|
||||
|
||||
|
|
|
@ -34,13 +34,13 @@
|
|||
|
||||
@(require scribble/manual)
|
||||
|
||||
@title{@bold{Lazy Scheme}}
|
||||
@title{@bold{Lazy Racket}}
|
||||
|
||||
@author["Eli Barzilay"]
|
||||
|
||||
@defmodulelang[lazy]
|
||||
|
||||
Lazy Scheme is available as both a language level and a module that
|
||||
Lazy Racket is available as both a language level and a module that
|
||||
can be used to write lazy code. To write lazy code, simply use
|
||||
@schememodname[lazy] as your module's language:
|
||||
|
||||
|
|
|
@ -16,9 +16,9 @@
|
|||
|
||||
@title{@bold{Make}: Dependency Manager}
|
||||
|
||||
The @schememodname[make] library provides a Scheme version of the
|
||||
The @schememodname[make] library provides a Racket version of the
|
||||
popular @exec{make} utility. Its syntax is intended to imitate the
|
||||
syntax of @exec{make}, only in Scheme.
|
||||
syntax of @exec{make}, only in Racket.
|
||||
|
||||
@table-of-contents[]
|
||||
|
||||
|
@ -26,7 +26,7 @@ syntax of @exec{make}, only in Scheme.
|
|||
|
||||
@section[#:tag "overview"]{Overview}
|
||||
|
||||
@margin-note{If you want to build Scheme modules with automatic
|
||||
@margin-note{If you want to build Racket modules with automatic
|
||||
dependency tracking, just use @exec{raco make} as described in
|
||||
@|raco-manual|.}
|
||||
|
||||
|
@ -77,10 +77,10 @@ utility uses existing programs to build your project --- each rule has
|
|||
a shell command line.
|
||||
|
||||
The @schememodname[make] library provides similar functionality,
|
||||
except that the description is in Scheme, and the steps that are
|
||||
needed to build target files are implemented as Scheme functions.
|
||||
except that the description is in Racket, and the steps that are
|
||||
needed to build target files are implemented as Racket functions.
|
||||
|
||||
Here's a Scheme program that is equivalent to the above:
|
||||
Here's a Racket program that is equivalent to the above:
|
||||
|
||||
@schemeblock[
|
||||
(require make)
|
||||
|
@ -258,7 +258,7 @@ function helps with a few:
|
|||
@item{taming to some degree the differing conventions of Unix and
|
||||
Windows, }
|
||||
|
||||
@item{setting up suitable dependencies on PLT Scheme headers, and}
|
||||
@item{setting up suitable dependencies on Racket headers, and}
|
||||
|
||||
@item{using a pre-compiled binary when a @filepath{precompiled}
|
||||
directory is present.}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
@title[#:tag "com" #:style 'toc]{COM}
|
||||
|
||||
MysterX allows scripting of most COM components from Scheme. A COM
|
||||
MysterX allows scripting of most COM components from Racket. A COM
|
||||
component can be scripted in MysterX if it supports OLE Automation via
|
||||
the @tt{IDispatch} interface, and if it publishes type information
|
||||
using the @tt{ITypeInfo} interface.
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
Goodman's @italic{Dynamic HTML} will have more complete information.
|
||||
|
||||
Many of the @scheme[mx-element%] methods have two variants, a
|
||||
version that takes or returns Scheme data, and another
|
||||
version that takes or returns Racket data, and another
|
||||
@schemeidfont{-native} version that takes or returns a string. For
|
||||
methods that return values of element properties, we assume two
|
||||
characteristics, which we do not mention in the methods'
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
@title[#:tag "methprop"]{COM Methods and Properties}
|
||||
|
||||
MysterX allows scripting of most COM components from Scheme. A COM
|
||||
MysterX allows scripting of most COM components from Racket. A COM
|
||||
component can be scripted in MysterX if it supports OLE Automation
|
||||
via the @tt{IDispatch} interface, and if it publishes type
|
||||
information using the @tt{ITypeInfo} interface.
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
#lang scribble/doc
|
||||
@(require "common.ss")
|
||||
|
||||
@title{@bold{MysterX}: Using Windows COM Objects in Scheme}
|
||||
@title{@bold{MysterX}: Using Windows COM Objects in Racket}
|
||||
|
||||
@author["Paul Steckler"]
|
||||
|
||||
@bold{MysterX} is a toolkit for building Windows applications from
|
||||
@as-index{ActiveX} and COM components, using Scheme as glue code.
|
||||
@as-index{ActiveX} and COM components, using Racket as glue code.
|
||||
Dynamic HTML (DHTML) is used for component presentation and
|
||||
event-handling.
|
||||
|
||||
|
|
|
@ -12,11 +12,11 @@ Recent versions of Windows come with DCOM; DCOM packages for Windows
|
|||
|
||||
Two Windows DLLs support low-level operations in MysterX:
|
||||
@filepath{myspage.dll} and @filepath{myssink.dll}. Both are installed
|
||||
in the registry (using @exec{regsvr32.exe}) when Setup PLT runs the
|
||||
MysterX post-installer. If you move the location of your PLT
|
||||
installation, you may need to re-run Setup PLT to make MysterX
|
||||
work. Neither of these DLLs is specific to a PLT Scheme version, so
|
||||
it's ok for one version of PLT Scheme to use the DLLs registered by
|
||||
in the registry (using @exec{regsvr32.exe}) when @exec{raco setup} runs the
|
||||
MysterX post-installer. If you move the location of your Racket
|
||||
installation, you may need to re-run @exec{raco setup} to make MysterX
|
||||
work. Neither of these DLLs is specific to a Racket version, so
|
||||
it's ok for one version of Racket to use the DLLs registered by
|
||||
another.
|
||||
|
||||
@margin-note{Prior to version 369.4, @filepath{myssink.dll} was
|
||||
|
@ -77,7 +77,7 @@ class system, you may also need
|
|||
]
|
||||
|
||||
Several MysterX procedures take HTML strings as input. The
|
||||
@schememodname[xml] library provides procedures that convert Scheme
|
||||
@schememodname[xml] library provides procedures that convert Racket
|
||||
syntax into XML strings. You may find using these procedures useful
|
||||
in creating HTML strings for use by MysterX.
|
||||
|
||||
|
|
|
@ -9,20 +9,20 @@
|
|||
(list @elem{@(tt name) COM @|what|})
|
||||
(apply tt proto)))
|
||||
|
||||
@title{@bold{MzCOM}: Scheme as a Windows COM Object}
|
||||
@title{@bold{MzCOM}: Racket as a Windows COM Object}
|
||||
|
||||
@author["Paul Steckler"]
|
||||
|
||||
@exec{MzCOM.exe} is a Windows COM (i.e., Component Object Model) class
|
||||
wrapper for PLT Scheme.
|
||||
wrapper for Racket.
|
||||
|
||||
During normal installation of MzCOM, the executable is registered as a
|
||||
COM object automatically. If you move the PLT Scheme installation
|
||||
COM object automatically. If you move the Racket installation
|
||||
folder, re-register @exec{MzCOM.exe} with
|
||||
|
||||
@commandline{mzcom.exe /RegServer}
|
||||
|
||||
The @exec{MzCOM.exe} executable find DLLs and PLT Scheme library
|
||||
The @exec{MzCOM.exe} executable find DLLs and Racket library
|
||||
collections relative to its own path.
|
||||
|
||||
@; ----------------------------------------------------------------------
|
||||
|
@ -61,11 +61,11 @@ From Visual C++:
|
|||
where @tt{<version>} is the version number. You'll need the
|
||||
definition of @tt{IID_IMzObj} (see @secref["guids"]). The header file
|
||||
@filepath{mzcom.h} is generated as @filepath{src\worksp\mzcom\} when
|
||||
building from the PLT Scheme source distribution. The above C/C++ code
|
||||
building from the Racket source distribution. The above C/C++ code
|
||||
is for illustration; your actual code should check return values, of
|
||||
course.
|
||||
|
||||
Using @schememodname[mysterx] to manipulate COM objects within Scheme,
|
||||
Using @schememodname[mysterx] to manipulate COM objects within Racket,
|
||||
you can load MzCOM with either
|
||||
|
||||
@schemeblock[
|
||||
|
@ -84,7 +84,7 @@ methods may be called directly or by using OLE Automation.
|
|||
|
||||
@section[#:tag "guids"]{GUIDs}
|
||||
|
||||
When compiled from the PLT Scheme source distibrution, the directory
|
||||
When compiled from the Racket source distibrution, the directory
|
||||
@filepath{src\worksp\mzcom\} contains the file @filepath{MzCOM_i.c}
|
||||
that contains GUIDs for MzCOM. Those GUIDs are as follows:
|
||||
|
||||
|
@ -122,15 +122,15 @@ MzCOM support three COM methods:
|
|||
Takes and returns @tt{BSTR}s (BASIC strings). The returned
|
||||
value is the result of evaluating the input expression,
|
||||
formatted as a string. The input string may contain several
|
||||
S-expressions. The embedded PLT Scheme updates its environment
|
||||
S-expressions. The embedded Racket updates its environment
|
||||
with each evaluation. Therefore, it is possible to define
|
||||
procedures in a call to @tt{Eval}, and use the procedures in
|
||||
subsequent calls.}
|
||||
|
||||
@item{@com-index["Reset" "method"]{Reset :: void Reset(void)}
|
||||
|
||||
Resets the Scheme environment to the initial environment.
|
||||
Also, the custodian for the primary Scheme thread is invoked,
|
||||
Resets the Racket environment to the initial environment.
|
||||
Also, the custodian for the primary Racket thread is invoked,
|
||||
shutting all its managed values.}
|
||||
]
|
||||
|
||||
|
@ -155,8 +155,8 @@ means to obtain COM error information.
|
|||
|
||||
@section{Evaluation thread}
|
||||
|
||||
The PLT Scheme evaluator runs in a Win32 thread created when MzCOM is
|
||||
loaded. If an expression kills the primary MzScheme thread, as in
|
||||
The Racket evaluator runs in a Win32 thread created when MzCOM is
|
||||
loaded. If an expression kills the primary Racket thread, as in
|
||||
|
||||
@schemeblock[
|
||||
(kill-thread (current-thread))
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
#lang scribble/doc
|
||||
@(require "common.ss")
|
||||
|
||||
@title{@bold{MzLib}: Legacy PLT Libraries}
|
||||
@title{@bold{MzLib}: Legacy Racket Libraries}
|
||||
|
||||
The @filepath{mzlib} collection contains wrappers and libraries for
|
||||
compatibility with older versions of PLT Scheme. In many ways, the
|
||||
compatibility with older versions of Racket. In many ways, the
|
||||
libraries of the @filepath{mzlib} collection go with the
|
||||
@schememodname[mzscheme] legacy language. Newer variants of many
|
||||
libraries reside in the @filepath{scheme} collection.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#lang scribble/doc
|
||||
@(require "common.ss")
|
||||
|
||||
@title{@bold{Net}: PLT Networking Libraries}
|
||||
@title{@bold{Net}: Racket Networking Libraries}
|
||||
|
||||
@table-of-contents[]
|
||||
|
||||
|
|
|
@ -9,15 +9,15 @@
|
|||
@defmodule[openssl]
|
||||
|
||||
The @schememodname[openssl] library provides glue for the OpenSSL
|
||||
library with the Scheme port system. It provides functions nearly
|
||||
identically to the standard TCP subsystem in PLT Scheme, plus a
|
||||
library with the Racket port system. It provides functions nearly
|
||||
identically to the standard TCP subsystem in Racket, plus a
|
||||
generic @scheme[ports->ssl-ports] interface.
|
||||
|
||||
To use this library, you will need OpenSSL installed on your machine,
|
||||
but
|
||||
|
||||
@itemize[
|
||||
@item{for Windows, the PLT Scheme distribution for Windows includes
|
||||
@item{for Windows, the Racket distribution for Windows includes
|
||||
the necessary DLLs.}
|
||||
|
||||
@item{for Mac OS X, version 10.2 and later provides the necessary
|
||||
|
@ -344,8 +344,8 @@ collection for testing purposes where the peer identifies itself using
|
|||
For Windows, @schememodname[openssl] relies on @filepath{libeay32.dll}
|
||||
and @filepath{ssleay32.dll}, where the DLLs are located in the same
|
||||
place as @filepath{libmzsch@nonterm{vers}.dll} (where @nonterm{vers}
|
||||
is either @tt{xxxxxxx} or a mangling of PLT Scheme's version
|
||||
number). The DLLs are distributed as part of PLT Scheme.
|
||||
is either @tt{xxxxxxx} or a mangling of Racket's version
|
||||
number). The DLLs are distributed as part of Racket.
|
||||
|
||||
For Unix variants, @schememodname[openssl] relies on
|
||||
@filepath{libcryto.so} and @filepath{libssl.so}, which must be
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
@schememodname[scriblib/gui-eval] library support example
|
||||
evaluations with results that are @schememodname[slideshow] picts.}
|
||||
|
||||
The trick is that @schememodname[scheme/gui] is not generally
|
||||
The trick is that @schememodname[racket/gui] is not generally
|
||||
available when rendering documentation, because it requires a GUI
|
||||
context. The picture output is rendered to an image file when the
|
||||
@envvar{MREVAL} environment variable is set, so run the enclosing
|
||||
|
@ -27,5 +27,5 @@ generated image.
|
|||
|
||||
Like @scheme[interaction], etc., but actually evaluating the forms
|
||||
only when the @envvar{MREVAL} environment variable is set, and then in
|
||||
an evaluator that is initialized with @schememodname[scheme/gui/base]
|
||||
an evaluator that is initialized with @schememodname[racket/gui/base]
|
||||
and @schememodname[slideshow]. }
|
||||
|
|
|
@ -11,7 +11,7 @@ libraries. The @schememodname[sgl] libraries to not address
|
|||
system-level concerns, such as the attachment of GL rendering contexts
|
||||
to displays. Instead, the libraries should work with any Racket
|
||||
extension that provides GL with access to the system (such as a
|
||||
binding for @tt{glx}). Notably, the @schememodname[scheme/gui/base]
|
||||
binding for @tt{glx}). Notably, the @schememodname[racket/gui/base]
|
||||
library provides support for rendering contexts via the
|
||||
@scheme[canvas%] class and its @method[canvas% with-gl-context]
|
||||
method.
|
||||
|
|
|
@ -57,7 +57,7 @@ Implementation} (a.k.a. @deftech{SRFI}) process allows individual
|
|||
members of the Scheme community to propose libraries and extensions to
|
||||
be supported by multiple Scheme implementations.
|
||||
|
||||
PLT Scheme is distributed with implementations of many SRFIs, most of
|
||||
Racket is distributed with implementations of many SRFIs, most of
|
||||
which can be implemented as libraries. To import the bindings of SRFI
|
||||
@math{n}, use
|
||||
|
||||
|
@ -65,9 +65,9 @@ which can be implemented as libraries. To import the bindings of SRFI
|
|||
(require @#,elem{@schemeidfont{srfi/}@math{n}})
|
||||
]
|
||||
|
||||
This document lists the SRFIs that are supported by PLT Scheme and
|
||||
This document lists the SRFIs that are supported by Racket and
|
||||
provides a link to the original SRFI specification (which is also
|
||||
distributed as part of PLT Scheme's documentation).
|
||||
distributed as part of Racket's documentation).
|
||||
|
||||
@table-of-contents[]
|
||||
|
||||
|
@ -565,7 +565,7 @@ are also available from @schememodname[scheme/foreign].
|
|||
)]
|
||||
|
||||
Take care NOT to confuse the internal date structure with the
|
||||
PLT Scheme @scheme[date]; they are not the same, and all procedures
|
||||
Racket @scheme[date]; they are not the same, and all procedures
|
||||
from the SRFI library expect the former.
|
||||
|
||||
@; ----------------------------------------
|
||||
|
@ -651,7 +651,7 @@ from the SRFI library expect the former.
|
|||
|
||||
@srfi[30]{Nested Multi-line Comments}
|
||||
|
||||
This SRFI's syntax is part of PLT Scheme's default reader.
|
||||
This SRFI's syntax is part of Racket's default reader.
|
||||
|
||||
@; ----------------------------------------
|
||||
|
||||
|
@ -684,7 +684,7 @@ This SRFI's syntax is part of PLT Scheme's default reader.
|
|||
(read-with-shared-structure #f "read-with-shared-structure")
|
||||
)]
|
||||
|
||||
This SRFI's syntax is part of PLT Scheme's default reader and printer.
|
||||
This SRFI's syntax is part of Racket's default reader and printer.
|
||||
|
||||
@; ----------------------------------------
|
||||
|
||||
|
@ -919,7 +919,7 @@ Returns @scheme[#t] if @scheme[v] is a promise, @scheme[#f] otherwise.}
|
|||
|
||||
Original specification: @link["../srfi-std/srfi-62.html"]{SRFI 62}
|
||||
|
||||
This SRFI's syntax is part of PLT Scheme's default reader (no
|
||||
This SRFI's syntax is part of Racket's default reader (no
|
||||
@scheme[require] is needed).
|
||||
|
||||
@; ----------------------------------------
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
@defmodulelang[swindle]
|
||||
|
||||
Swindle extends PLT Scheme with many additional features. The main
|
||||
Swindle extends Racket with many additional features. The main
|
||||
feature that started this project is a CLOS-like object system based
|
||||
on Tiny-CLOS from Xerox, but there is a lot more.
|
||||
|
||||
|
@ -32,7 +32,7 @@ only a subset of the system is needed.
|
|||
simple ones like @scheme[inc!], and @scheme[push!]. (Available
|
||||
separately using @scheme[swindle/setf], where the names
|
||||
@scheme[setf!] and @scheme[psetf!] are used to avoid changing the
|
||||
Scheme form)}
|
||||
Racket form)}
|
||||
|
||||
@item{Easy macro-defining macros --- simple @scheme[syntax-rules] macros with
|
||||
@scheme[defsubst], and a generic @scheme[defmacro] utility, all with a local
|
||||
|
@ -57,7 +57,7 @@ only a subset of the system is needed.
|
|||
stand-alone methods, method-combination, and some MOP extensions.
|
||||
(Available without syntax bindings in @scheme[swindle/tiny-clos])}
|
||||
|
||||
@item{Good integration with the Scheme implementation: primitive
|
||||
@item{Good integration with the Racket implementation: primitive
|
||||
values have corresponding Swindle classes, and struct types can also
|
||||
be used as type specializers. A Swindle class will be made when
|
||||
needed, and it will reflect the struct hierarchy. In addition,
|
||||
|
@ -81,7 +81,7 @@ only a subset of the system is needed.
|
|||
@item{A language that can easily create HTML, where the result is
|
||||
human-editable. (@scheme[swindle/html])}
|
||||
|
||||
@item{Customizable syntax: easy to add customized languages to DrScheme.
|
||||
@item{Customizable syntax: easy to add customized languages to DrRacket.
|
||||
(@scheme[custom])}
|
||||
|
||||
]
|
||||
|
@ -133,8 +133,8 @@ whole Swindle environment.
|
|||
Compilation definitions.}
|
||||
|
||||
@item{@scheme[swindle/tool] (module) ---
|
||||
Setup for Swindle in DrScheme: makes some languages available in
|
||||
DrScheme, including custom Swindle-based languages.}
|
||||
Setup for Swindle in DrRacket: makes some languages available in
|
||||
DrRacket, including custom Swindle-based languages.}
|
||||
|
||||
@item{@scheme[swindle/custom] (module) ---
|
||||
A sample file that demonstrates how to create a Swindle-based
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
@defform[(kernel-syntax-case stx-expr trans?-expr clause ...)]{
|
||||
|
||||
A syntactic form like @scheme[syntax-case*], except that the literals
|
||||
are built-in as the names of the primitive PLT Scheme forms as
|
||||
are built-in as the names of the primitive Racket forms as
|
||||
exported by @schememodname[scheme/base]; see @secref[#:doc refman
|
||||
"fully-expanded"].
|
||||
|
||||
|
@ -37,7 +37,7 @@ is @scheme[mzscheme], since the binding of @mzscheme-if from
|
|||
|
||||
A syntactic form like @scheme[kernel-syntax-case], except that it
|
||||
takes an additional list of extra literals that are in addition to the
|
||||
primitive PLT Scheme forms.}
|
||||
primitive Racket forms.}
|
||||
|
||||
|
||||
@defform[(kernel-syntax-case/phase stx-expr phase-expr clause ...)]{
|
||||
|
@ -56,8 +56,8 @@ level, as indicated by @scheme[phase-expr].}
|
|||
@defproc[(kernel-form-identifier-list) (listof identifier?)]{
|
||||
|
||||
Returns a list of identifiers that are bound normally,
|
||||
@scheme[for-syntax], and @scheme[for-template] to the primitive PLT
|
||||
Scheme forms for expressions, internal-definition positions, and
|
||||
@scheme[for-syntax], and @scheme[for-template] to the primitive
|
||||
Racket forms for expressions, internal-definition positions, and
|
||||
module-level and top-level positions. This function is useful for
|
||||
generating a list of stopping points to provide to
|
||||
@scheme[local-expand].
|
||||
|
|
|
@ -18,7 +18,7 @@ values.}
|
|||
|
||||
Inspects @scheme[stx] to check whether evaluating it will declare a
|
||||
module named @scheme[expected-module-sym]---at least if @scheme[module] is bound
|
||||
in the top-level to MzScheme's @scheme[module]. The syntax object @scheme[stx] can
|
||||
in the top-level to Racket's @scheme[module]. The syntax object @scheme[stx] can
|
||||
contain a compiled expression. Also, @scheme[stx] can be an end-of-file, on
|
||||
the grounds that @scheme[read-syntax] can produce an end-of-file.
|
||||
|
||||
|
|
|
@ -151,7 +151,7 @@ identifiers used by the @scheme[reader-option]s.
|
|||
@item{@scheme[#:info] specifies an implementation of reflective
|
||||
information that is used by external tools to manipulate the
|
||||
@emph{source} of modules in the language @scheme[_something]. For
|
||||
example, DrScheme uses information from @scheme[#:info] to
|
||||
example, DrRacket uses information from @scheme[#:info] to
|
||||
determine the style of syntax coloring that it should use for
|
||||
editing a module's source.
|
||||
|
||||
|
@ -178,7 +178,7 @@ identifiers used by the @scheme[reader-option]s.
|
|||
key, for which it returns @scheme[language-module]; it returns
|
||||
the given default value for any other key.
|
||||
|
||||
In the case of the DrScheme syntax-coloring example, DrScheme
|
||||
In the case of the DrRacket syntax-coloring example, DrRacket
|
||||
supplies @scheme['color-lexer] as the symbol argument, and it
|
||||
supplies @scheme[#f] as the default. The default-filtering
|
||||
argument (i.e., the third argument to the @scheme[#:info]
|
||||
|
@ -189,7 +189,7 @@ identifiers used by the @scheme[reader-option]s.
|
|||
reflective information that is used by external tools to
|
||||
manipulate the module in the language @scheme[_something] in
|
||||
its @emph{expanded}, @emph{compiled} or @emph{declared} form
|
||||
(as opposed to source). For example, when MzScheme starts a
|
||||
(as opposed to source). For example, when Racket starts a
|
||||
program, it uses information attached to the main module to
|
||||
initialize the run-time environment.
|
||||
|
||||
|
@ -219,8 +219,8 @@ identifiers used by the @scheme[reader-option]s.
|
|||
@scheme[language-data] are bound, the same as for
|
||||
@scheme[#:info].
|
||||
|
||||
In the case of the MzScheme run-time configuration example,
|
||||
MzScheme uses the @scheme[#:language-info] vector to obtain a
|
||||
In the case of the Racket run-time configuration example,
|
||||
Racket uses the @scheme[#:language-info] vector to obtain a
|
||||
function, and then it passes @scheme['configure-runtime] to the
|
||||
function to obtain information about configuring the runtime
|
||||
environment. See also @secref[#:doc refman "configure-runtime"].}
|
||||
|
|
|
@ -47,9 +47,9 @@ the same name (as extracted by @scheme[syntax-e]) and @scheme[a-id]
|
|||
has no binding other than at the top level.
|
||||
|
||||
This procedure is useful in conjunction with @scheme[syntax-case*] to
|
||||
match procedure names that are normally bound by MzScheme. For
|
||||
match procedure names that are normally bound by Racket. For
|
||||
example, the @scheme[include] macro uses this procedure to recognize
|
||||
@scheme[build-path]; using @scheme[free-identifier=?] would not work
|
||||
well outside of @scheme[module], since the top-level
|
||||
@scheme[build-path] is a distinct variable from the MzScheme export
|
||||
@scheme[build-path] is a distinct variable from the @schememodname[racket/base] export
|
||||
(though it's bound to the same procedure, initially).}
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
|
||||
@defmodule[test-engine/scheme-tests]
|
||||
|
||||
This module provides test forms for use in Scheme programs, as well
|
||||
This module provides test forms for use in Racket programs, as well
|
||||
as parameters to configure the behavior of test reports.
|
||||
|
||||
Each check form may only occur at the top-level; results are collected
|
||||
|
|
|
@ -18,8 +18,8 @@ depth of the continuation.
|
|||
@item{Throw away @filepath{.zo} versions of your source}
|
||||
@item{Prefix your program with
|
||||
@schemeblock[(require trace)]
|
||||
perhaps by starting @exec{mzscheme} with
|
||||
@commandline{mzscheme -l trace ...}
|
||||
perhaps by starting @exec{racket} with
|
||||
@commandline{racket -l trace ...}
|
||||
before arguments to load your program.}
|
||||
@item{Run your program}
|
||||
]
|
||||
|
@ -40,7 +40,7 @@ parameter.
|
|||
|
||||
@defmodule[trace]{Invoking the
|
||||
@schememodname[trace] module sets the evaluation handler
|
||||
(via @scheme[current-eval]) to instrument Scheme source code.}
|
||||
(via @scheme[current-eval]) to instrument Racket source code.}
|
||||
|
||||
NOTE: @schememodname[trace] has no effect on code loaded as
|
||||
compiled byte code (i.e., from a @filepath{.zo} file) or native code
|
||||
|
|
|
@ -10,10 +10,10 @@
|
|||
|
||||
@(define (selflink s) (link s (tt s)))
|
||||
|
||||
@title{@bold{Version}: PLT Version Checking}
|
||||
@title{@bold{Version}: Racket Version Checking}
|
||||
|
||||
The version collection contains several version-related pieces that
|
||||
are used by PLT Scheme. See also @scheme[version] from
|
||||
are used by Racket. See also @scheme[version] from
|
||||
@schememodname[scheme/base].
|
||||
|
||||
@; ----------------------------------------------------------------------
|
||||
|
@ -25,7 +25,7 @@ are used by PLT Scheme. See also @scheme[version] from
|
|||
@defthing[patchlevel exact-nonnegative-integer?]{
|
||||
|
||||
Indicates the current installed patch level, which is normally zero,
|
||||
but may be updated by patches to DrScheme.}
|
||||
but may be updated by patches to DrRacket.}
|
||||
|
||||
@; ----------------------------------------
|
||||
|
||||
|
@ -72,20 +72,20 @@ indicates the current state of the curent installation:
|
|||
|
||||
@; ----------------------------------------------------------------------
|
||||
|
||||
@section{DrScheme Version Tool}
|
||||
@section{DrRacket Version Tool}
|
||||
|
||||
@defmodule[version/tool]
|
||||
|
||||
The @scheme[version/tool] library implements a DrScheme tool that
|
||||
The @scheme[version/tool] library implements a DrRacket tool that
|
||||
|
||||
@itemize[
|
||||
|
||||
@item{makes the patchlevel display as a version @tt{p}@nonterm{N}
|
||||
suffix in DrScheme (though the base verion reported by
|
||||
suffix in DrRacket (though the base verion reported by
|
||||
@scheme[(version)] is not changed);}
|
||||
|
||||
@item{if enabled by the user, periodically checks whether a
|
||||
new PLT Scheme distribution is available for download.}
|
||||
new Racket distribution is available for download.}
|
||||
|
||||
]
|
||||
|
||||
|
@ -97,11 +97,11 @@ The @scheme[version/tool] library implements a DrScheme tool that
|
|||
|
||||
The @schememodname[version/utils] library provides a few of convenient
|
||||
utilities for dealing with version strings. Unless explicitly noted,
|
||||
these functions do not handle legacy versions of PLT Scheme.}
|
||||
these functions do not handle legacy versions of Racket.}
|
||||
|
||||
@defproc[(valid-version? [str string?]) boolean?]{
|
||||
|
||||
Returns @scheme[#t] if @scheme[str] is a valid PLT Scheme version
|
||||
Returns @scheme[#t] if @scheme[str] is a valid Racket version
|
||||
string, @scheme[#f] otherwise.}
|
||||
|
||||
@defproc[(version->list [str valid-version?])
|
||||
|
@ -131,7 +131,7 @@ alpha version. @scheme[str] is assumed to be a valid version.}
|
|||
|
||||
Converts the version string into an integer. For version
|
||||
@scheme["X.YY.ZZZ.WWW"], the result will be @schemevalfont{XYYZZZWWW}.
|
||||
This function works also for legacy PLT Scheme versions, by
|
||||
This function works also for legacy Racket versions, by
|
||||
translating @scheme["XYY.ZZZ"] to @schemevalfont{XYYZZZ000}. The
|
||||
resulting integer can thefore be used to conveniently compare any two
|
||||
(valid) version strings. If the version string is invalid the
|
||||
|
|
Loading…
Reference in New Issue
Block a user