feat: 9.5.9

This commit is contained in:
tmtt 2022-07-29 15:12:07 +02:00
parent cb1753732b
commit 35f43a7909
1084 changed files with 558985 additions and 0 deletions

20
csug/bibliography.stex Normal file
View file

@ -0,0 +1,20 @@
% Copyright 2005-2017 Cisco Systems, Inc.
%
% Licensed under the Apache License, Version 2.0 (the "License");
% you may not use this file except in compliance with the License.
% You may obtain a copy of the License at
%
% http://www.apache.org/licenses/LICENSE-2.0
%
% Unless required by applicable law or agreed to in writing, software
% distributed under the License is distributed on an "AS IS" BASIS,
% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
% See the License for the specific language governing permissions and
% limitations under the License.
\ifhtml
\chapter{Bibliography}
\input{csug.bbl}
\else
\bibliographystyle{tspl}
\bibliography{csug}
\fi

594
csug/binding.stex Normal file
View file

@ -0,0 +1,594 @@
% Copyright 2005-2017 Cisco Systems, Inc.
%
% Licensed under the Apache License, Version 2.0 (the "License");
% you may not use this file except in compliance with the License.
% You may obtain a copy of the License at
%
% http://www.apache.org/licenses/LICENSE-2.0
%
% Unless required by applicable law or agreed to in writing, software
% distributed under the License is distributed on an "AS IS" BASIS,
% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
% See the License for the specific language governing permissions and
% limitations under the License.
\chapter{Binding Forms\label{CHPTBINDING}}
This chapter describes {\ChezScheme} extensions to the set of Revised$^6$
Report binding forms.
See Chapter~\ref{TSPL:CHPTBINDING} of {\TSPLFOUR} or the Revised$^6$ Report
for a description of standard binding forms.
\section{Definitions\label{SECTDEFINITIONS}}
A \index{definitions}definition in Revised$^6$ Report Scheme is a
\index{\scheme{define}}\index{variable definition}variable definition,
\index{\scheme{define-syntax}}\index{keyword definition}keyword
definition, or derived definition, i.e., a syntactic extension that
expands into a definition.
In addition, the forms within a
\index{\scheme{begin}}\scheme{begin}
expression appearing after a sequence
of definitions is spliced onto the end of the sequence of definitions
so that definitions at the front of the \scheme{begin} expression
are treated as if they were part of the outer sequence of definitions.
A \index{\scheme{let-syntax}}\scheme{let-syntax} or
\index{\scheme{letrec-syntax}}\scheme{letrec-syntax} form
is treated similarly, so that definitions at the front of the body
are treated as if they were part of the outer sequence of definitions,
albeit scoped where the bindings of the \scheme{let-syntax} or
\scheme{letrec-syntax} form are visible.
{\ChezScheme} extends the set of definitions to include
\index{modules}\index{\scheme{module}}\scheme{module} forms,
\index{\scheme{import}}\scheme{import} forms,
\index{\scheme{import-only}}\scheme{import-only} forms,
\index{\scheme{meta}}\scheme{meta} definitions, and
\index{\scheme{alias}}\scheme{alias} forms, although the
\scheme{module}, \scheme{import}, \scheme{import-only},
\scheme{meta}, and \scheme{alias} keywords are not available
in a library or RNRS top-level program unless the
\scheme{scheme} library is included in the library or
top-level programs imports.
These forms are described in Chapter~\ref{CHPTSYNTAX}.
In Revised$^6$ Report Scheme, definitions can appear at the front of
a \scheme{lambda} or similar body (e.g., a \scheme{let} or \scheme{letrec}
body), at the front of a library body, or intermixed with expressions
within an RNRS top-level program body.
In {\ChezScheme}, definitions may also be used in the
interactive top-level, i.e., they can be intermixed with expressions in
the REPL or in program text to be loaded from a file
via \index{\scheme{load}}\scheme{load} (Section~\ref{SECTMISCCOMPILEEVAL}).
The Revised$^6$ Report does not mandate the existence nor specify the
semantics of an interactive top-level, nor of a \scheme{load}
procedure.
The macro expander uses the same two-pass algorithm for expanding
top-level \scheme{begin} expressions as it uses for a \scheme{lambda},
\scheme{library}, or top-level program body.
(This algorithm is described in Section~\ref{TSPL:SECTSYNTAXDEFINITIONS} of
{\TSPLFOUR}.) As a result,
\schemedisplay
(begin
(define-syntax a (identifier-syntax 3))
(define x a))
\endschemedisplay
and
\schemedisplay
(begin
(define x a)
(define-syntax a (identifier-syntax 3)))
\endschemedisplay
both result in the giving \scheme{x} the value 3,
even though an unbound variable reference to \scheme{a} would result if
the two forms within the latter \scheme{begin} expression were run
independently at top level.
Similarly, the \scheme{begin} form produced by a use of
\schemedisplay
(define-syntax define-constant
(syntax-rules ()
[(_ x e)
(begin
(define t e)
(define-syntax x (identifier-syntax t)))]))
\endschemedisplay
and the \scheme{begin} form produced by a use of
\schemedisplay
(define-syntax define-constant
(syntax-rules ()
[(_ x e)
(begin
(define-syntax x (identifier-syntax t))
(define t e))]))
\endschemedisplay
are equivalent.
The Revised$^6$ Report specifies that internal variable definitions be
treated like \scheme{letrec*}, while earlier reports required internal
variable definitions to be treated like \scheme{letrec}.
By default, {\ChezScheme} implements the Revised$^6$ Report semantics for
internal variable definitions, as for all other things, but this behavior
may be overridden via the \scheme{internal-defines-as-letrec*} parameter.
%----------------------------------------------------------------------------
\entryheader
\formdef{internal-defines-as-letrec*}{\categorythreadparameter}{internal-defines-as-letrec*}
\listlibraries
\endentryheader
\noindent
When this parameter is set to \scheme{#t} (the default), internal variable
definitions are evaluated using \scheme{letrec*} semantics.
It may be set to \scheme{#f} to revert to the \scheme{letrec} semantics
for internal variable definitions, for backward compatibility.
\section{Multiple-value Definitions}
%----------------------------------------------------------------------------
\noskipentryheader
\formdef{define-values}{\categorysyntax}{(define-values \var{formals} \var{expr})}
\listlibraries
\endnoskipentryheader
A \scheme{define-values} form is a definition and can appear anywhere
other definitions can appear.
It is like a \scheme{define} form but permits an arbitrary formals list
(like \scheme{lambda}) on the left-hand side.
It evaluates \var{expr} and binds the variables appearing in \var{formals}
to the resulting values, in the same manner as the formal parameters of a
procedure are bound to its arguments.
\schemedisplay
(let ()
(define-values (x y) (values 1 2))
(list x y)) ;=> (1 2)
(let ()
(define-values (x y . z) (values 1 2 3 4))
(list x y z)) ;=> (1 2 (3 4))
\endschemedisplay
A \scheme{define-values} form expands into a sequence of definitions, the
first for a hidden temporary bound to a data structure holding the values
returned by \var{expr} and the remainder binding each of the formals to
the corresponding value or list of values, extracted from the data
structure via a reference to the temporary.
Because the temporary must be defined before the other variables are
defined, this works for internal \scheme{define-values} forms only if
\scheme{internal-defines-as-letrec*} is set to the default value
\scheme{#t}.
\section{Recursive Bindings}
%----------------------------------------------------------------------------
\noskipentryheader
\formdef{rec}{\categorysyntax}{(rec \var{var} \var{expr})}
\returns value of \var{expr}
\listlibraries
\endnoskipentryheader
\noindent
The syntactic form \scheme{rec} creates a \index{recursive object}recursive object from \var{expr} by
establishing a binding of \var{var} within \var{expr} to the value of \var{expr}.
In essence, it is a special case of \scheme{letrec} for self-recursive objects.
This form is useful for creating recursive objects (especially procedures)
that do not depend on external variables for the recursion, which are
sometimes undesirable because the external bindings can change.
For example, a recursive procedure defined at top level depends on the value
of the top-level variable given as its name.
If the value of this variable should change, the meaning of the procedure
itself would change.
If the procedure is defined instead with \scheme{rec}, its meaning is independent
of the variable to which it is bound.
\schemedisplay
(map (rec sum
(lambda (x)
(if (= x 0)
0
(+ x (sum (- x 1))))))
'(0 1 2 3 4 5)) ;=> (0 1 3 6 10 15)
(define cycle
(rec self
(list (lambda () self))))
(eq? ((car cycle)) cycle) ;=> #t
\endschemedisplay
\noindent
The definition below expands \scheme{rec} in terms of \scheme{letrec}.
\schemedisplay
(define-syntax rec
(syntax-rules ()
[(_ x e) (letrec ((x e)) x)]))
\endschemedisplay
\section{Fluid Bindings}
%----------------------------------------------------------------------------
\noskipentryheader
\formdef{fluid-let}{\categorysyntax}{(fluid-let ((\var{var} \var{expr}) \dots) \var{body_1} \var{body_2} \dots)}
\returns the values of the body \scheme{\var{body_1} \var{body_2} \dots}
\listlibraries
\endentryheader
\noindent
\index{fluid binding}\index{assignments}The syntactic form \scheme{fluid-let}
provides a way to temporarily assign values to a set of variables.
The new values are in effect only during the evaluation of the
body of the \scheme{fluid-let} expression.
The scopes of the variables are not determined by \scheme{fluid-let}; as with
\scheme{set!}, the variables must be bound at top level or by an enclosing
\scheme{lambda} or other binding form.
It is possible, therefore, to control the scope of a variable with
\scheme{lambda} or \scheme{let} while establishing a temporary
value with \scheme{fluid-let}.
Although it is similar in appearance to \scheme{let}, its operation is more
like that of \scheme{set!}.
Each \var{var} is assigned, as with \scheme{set!}, to the value of the
corresponding \var{expr} within the body \scheme{\var{body_1} \var{body_2} \dots}.
Should the body
exit normally or by invoking a continuation made outside of the body
(see \scheme{call/cc}), the values in effect before the bindings were changed
are restored.
Should control return back to the body by the invocation of a continuation
created within the body, the bindings are changed once again to the values
in effect when the body last exited.
Fluid bindings are most useful for
maintaining variables that must be shared by a group of procedures.
Upon entry to the group of procedures, the shared variables are fluidly
bound to a new set of initial values so that on exit the original values
are restored automatically.
In this way, the group of procedures itself can be reentrant; it may call
itself directly or indirectly without affecting the values of its shared
variables.
\index{special bindings (in Lisp)}Fluid bindings are similar to
\emph{special} bindings in Common Lisp~\cite{Steele:common}, except that
(1) there is a single namespace for both lexical and fluid bindings, and
(2) the scope of a fluidly bound variable is not necessarily global.
\schemedisplay
(let ([x 3])
(+ (fluid-let ([x 5])
x)
x)) ;=> 8
(let ([x 'a])
(letrec ([f (lambda (y) (cons x y))])
(fluid-let ([x 'b])
(f 'c)))) ;=> (b . c)
(let ([x 'a])
(call/cc
(lambda (k)
(fluid-let ([x 'b])
(letrec ([f (lambda (y) (k '*))])
(f '*)))))
x) ;=> a
\endschemedisplay
\noindent
\scheme{fluid-let} may be defined in terms of \scheme{dynamic-wind} as follows.
\schemedisplay\label{defn:fluid-let}
(define-syntax fluid-let
(lambda (x)
(syntax-case x ()
[(_ () b1 b2 ...) #'(let () b1 b2 ...)]
[(_ ((x e) ...) b1 b2 ...)
(andmap identifier? #'(x ...))
(with-syntax ([(y ...) (generate-temporaries #'(x ...))])
#'(let ([y e] ...)
(let ([swap (lambda ()
(let ([t x]) (set! x y) (set! y t))
...)])
(dynamic-wind swap (lambda () b1 b2 ...) swap))))])))
\endschemedisplay
\section{Top-Level Bindings\label{SECTBINDINGTOPLEVEL}}
The procedures described in this section allow the direct manipulation
of \index{top-level values}top-level bindings for variables
and keywords.
They are intended primarily to support the definition of interpreters
or compilers for Scheme in Scheme but may be used to access or alter
top-level bindings anywhere within a program whether at top level or not.
%----------------------------------------------------------------------------
\entryheader
\formdef{define-top-level-value}{\categoryprocedure}{(define-top-level-value \var{symbol} \var{obj})}
\formdef{define-top-level-value}{\categoryprocedure}{(define-top-level-value \var{symbol} \var{obj} \var{env})}
\returns unspecified
\listlibraries
\endentryheader
\noindent
\scheme{define-top-level-value} is used to establish a binding
for the variable named by \var{symbol} to the value \var{obj}
in the environment \var{env}.
If \var{env} is not provided, it defaults to the
value of \scheme{interaction-environment}, i.e., the
top-level evaluation environment
(Section~\ref{SECTMISCENVIRONMENTS}).
An exception is raised with condition type \scheme{&assertion} if
\var{env} is not mutable.
A call to \scheme{define-top-level-value} is similar to a top-level
\index{\scheme{define}}\scheme{define} form, except that a call to
\scheme{define-top-level-value} need not occur at top-level and
the variable for which the binding is to be established can be
determined at run time, as can the environment.
\schemedisplay
(begin
(define-top-level-value 'xyz "hi")
xyz) ;=> "hi"
(let ([var 'xyz])
(define-top-level-value var "mom")
(list var xyz)) ;=> (xyz "mom")
\endschemedisplay
%----------------------------------------------------------------------------
\entryheader
\formdef{set-top-level-value!}{\categoryprocedure}{(set-top-level-value! \var{symbol} \var{obj})}
\formdef{set-top-level-value!}{\categoryprocedure}{(set-top-level-value! \var{symbol} \var{obj} \var{env})}
\returns unspecified
\listlibraries
\endentryheader
\noindent
\index{assignments}\scheme{set-top-level-value!} assigns
the variable named by \var{symbol} to the value \var{obj}
in the environment \var{env}.
If \var{env} is not provided, it defaults to the
value of \scheme{interaction-environment}, i.e., the
top-level evaluation environment
(Section~\ref{SECTMISCENVIRONMENTS}).
An exception is raised with condition type \scheme{&assertion} if the
identifier named by \var{symbol} is not defined as a variable in \var{env}
or if the variable or environment is not mutable.
\scheme{set-top-level-value!} is similar to
\index{\scheme{set!}}\scheme{set!} when \scheme{set!}
is used on top-level variables except that the variable to be assigned
can be determined at run time, as can the environment.
\schemedisplay
(let ([v (let ([cons list])
(set-top-level-value! 'cons +)
(cons 3 4))])
(list v (cons 3 4))) ;=> ((3 4) 7)
\endschemedisplay
%----------------------------------------------------------------------------
\entryheader
\formdef{top-level-value}{\categoryprocedure}{(top-level-value \var{symbol})}
\formdef{top-level-value}{\categoryprocedure}{(top-level-value \var{symbol} \var{env})}
\returns the top-level value of the variable named by \var{symbol} in \var{env}
\listlibraries
\endentryheader
\noindent
If \var{env} is not provided, it defaults to the
value of \scheme{interaction-environment}, i.e., the
top-level evaluation environment
(Section~\ref{SECTMISCENVIRONMENTS}).
An exception is raised with condition type \scheme{&assertion} if the
identifier named by \var{symbol} is not defined as a variable in \var{env}.
\scheme{top-level-value} is similar to a top-level variable reference
except that the variable to be referenced can be determined at run time,
as can the environment.
\schemedisplay
(let ([cons +])
(list (cons 3 4)
((top-level-value 'cons) 3 4))) ;=> (7 (3 . 4))
(define e (copy-environment (scheme-environment)))
(define-top-level-value 'pi 3.14 e)
(top-level-value 'pi e) ;=> 3.14
(set-top-level-value! 'pi 3.1416 e)
(top-level-value 'pi e) ;=> 3.1416
\endschemedisplay
%----------------------------------------------------------------------------
\entryheader
\formdef{top-level-bound?}{\categoryprocedure}{(top-level-bound? \var{symbol})}
\formdef{top-level-bound?}{\categoryprocedure}{(top-level-bound? \var{symbol} \var{env})}
\returns \scheme{#t} if \var{symbol} is defined as a variable in \var{env}, \scheme{#f} otherwise
\listlibraries
\endentryheader
\noindent
If \var{env} is not provided, it defaults to the
value of \scheme{interaction-environment}, i.e., the
top-level evaluation environment
(Section~\ref{SECTMISCENVIRONMENTS}).
This predicate is useful in an interpreter to check for the existence of
a top-level binding before requesting the value with
\scheme{top-level-value}.
\schemedisplay
(top-level-bound? 'xyz) ;=> #f
(begin
(define-top-level-value 'xyz 3)
(top-level-bound? 'xyz)) ;=> #t
(define e (copy-environment (interaction-environment)))
(define-top-level-value 'pi 3.14 e)
(top-level-bound? 'pi) ;=> #f
(top-level-bound? 'pi e) ;=> #t
\endschemedisplay
%----------------------------------------------------------------------------
\entryheader
\formdef{top-level-mutable?}{\categoryprocedure}{(top-level-mutable? \var{symbol})}
\formdef{top-level-mutable?}{\categoryprocedure}{(top-level-mutable? \var{symbol} \var{env})}
\returns \scheme{#t} if \var{symbol} is mutable in \var{env}, \scheme{#f} otherwise
\listlibraries
\endentryheader
\noindent
If \var{env} is not provided, it defaults to the
value of \scheme{interaction-environment}, i.e., the
top-level evaluation environment
(Section~\ref{SECTMISCENVIRONMENTS}).
This predicate is useful in an interpreter to check whether a variable
can be assigned before assigning it with
\scheme{set-top-level-value!}.
\schemedisplay
(define xyz 3)
(top-level-mutable? 'xyz) ;=> #t
(set-top-level-value! 'xyz 4)
(top-level-value 'xyz) ;=> 4
(define e (copy-environment (interaction-environment) #f))
(top-level-mutable? 'xyz e) ;=> #f
(set-top-level-value! 'xyz e) ;=> \var{exception: xyz is immutable}
\endschemedisplay
%----------------------------------------------------------------------------
\entryheader
\formdef{define-top-level-syntax}{\categoryprocedure}{(define-top-level-syntax \var{symbol} \var{obj})}
\formdef{define-top-level-syntax}{\categoryprocedure}{(define-top-level-syntax \var{symbol} \var{obj} \var{env})}
\returns unspecified
\listlibraries
\endentryheader
\noindent
\scheme{define-top-level-syntax} is used to establish a top-level binding
for the identifier named by \var{symbol} to the value of \var{obj}
in the environment \var{env}.
The value must be a procedure, the result of a call to
\scheme{make-variable-transformer}, or the result of a call to
\scheme{top-level-syntax}.
If \var{env} is not provided, it defaults to the
value of \scheme{interaction-environment}, i.e., the
top-level evaluation environment
(Section~\ref{SECTMISCENVIRONMENTS}).
An exception is raised with condition type \scheme{&assertion} if
\var{env} is not mutable.
A call to \scheme{define-top-level-syntax} is similar to a top-level
\index{\scheme{define-syntax}}\scheme{define-syntax} form, except that a call to
\scheme{define-top-level-syntax} need not occur at top-level and
the identifier for which the binding is to be established can be
determined at run time, as can the environment.
\schemedisplay
(define-top-level-syntax 'let1
(syntax-rules ()
[(_ x e b1 b2 ...) (let ([x e]) b1 b2 ...)]))
(let1 a 3 (+ a 1)) ;=> 4
\endschemedisplay
\scheme{define-top-level-syntax} can also be used to attach
to an identifier arbitrary compile-time bindings obtained
via \scheme{top-level-syntax}.
%----------------------------------------------------------------------------
\entryheader
\formdef{top-level-syntax}{\categoryprocedure}{(top-level-syntax \var{symbol})}
\formdef{top-level-syntax}{\categoryprocedure}{(top-level-syntax \var{symbol} \var{env})}
\returns unspecified
\listlibraries
\endentryheader
\noindent
\scheme{top-level-syntax} is used to retrieve the transformer, compile-time
value, or other compile-time binding to which
the identifier named by \var{symbol} is bound in the environment \var{env}.
If \var{env} is not provided, it defaults to the
value of \scheme{interaction-environment}, i.e., the
top-level evaluation environment
(Section~\ref{SECTMISCENVIRONMENTS}).
All identifiers bound in an environment have compile-time bindings, including
variables.
An exception is raised with condition type \scheme{&assertion} if the
identifier named by \var{symbol} is not defined as a keyword in \var{env}.
\schemedisplay
(define-top-level-syntax 'also-let (top-level-syntax 'let))
(also-let ([x 3] [y 4]) (+ x y)) ;=> 7
(define foo 17)
(define-top-level-syntax 'also-foo (top-level-syntax 'foo))
also-foo ;=> 17
(set! also-foo 23)
also-foo ;=> 23
foo ;=> 23
\endschemedisplay
The effect of the last example can be had more clearly with \scheme{alias}:
\schemedisplay
(define foo 17)
(alias also-foo foo)
also-foo ;=> 17
(set! also-foo 23)
also-foo ;=> 23
foo ;=> 23
\endschemedisplay
%----------------------------------------------------------------------------
\entryheader
\formdef{top-level-syntax?}{\categoryprocedure}{(top-level-syntax? \var{symbol})}
\formdef{top-level-syntax?}{\categoryprocedure}{(top-level-syntax? \var{symbol} \var{env})}
\returns \scheme{#t} if \var{symbol} is bound as a keyword in \var{env}, \scheme{#f} otherwise
\listlibraries
\endentryheader
\noindent
If \var{env} is not provided, it defaults to the
value of \scheme{interaction-environment}, i.e., the
top-level evaluation environment
(Section~\ref{SECTMISCENVIRONMENTS}).
All identifiers bound in an environment have compile-time bindings, including
variables, so this predicate amounts to a bound check, but is more general
than \scheme{top-level-bound?}, which returns true only for bound variables.
\schemedisplay
(define xyz 'hello)
(top-level-syntax? 'cons) ;=> #t
(top-level-syntax? 'lambda) ;=> #t
(top-level-syntax? 'hello) ;=> #t
(top-level-syntax? 'cons (scheme-environment)) ;=> #t
(top-level-syntax? 'lambda (scheme-environment)) ;=> #t
(top-level-syntax? 'hello (scheme-environment)) ;=> #f
\endschemedisplay

37
csug/canned/about.html Normal file
View file

@ -0,0 +1,37 @@
<html>
<head>
<title>About CSUG9</title>
<link href="csug.css" rel="stylesheet" type="text/css">
</head>
<body>
<p>
The printed version of this book was created with LaTeX from extended
LaTeX sources with the help of a preprocessor written in Scheme.
The preprocessor handles extensions for incorporating arbitrary
verbatim Scheme code and various other features not directly supported
by LaTeX.
</p>
<p>
The HTML version was created from the preprocessed sources for the
printed version by a separate Scheme program that performs a LaTeX to
HTML conversion.
In addition to the extended LaTeX source files, this program takes as
input the .aux and .bbl files produced by a complete LaTeX/BibTeX run
of the document in order to support labels and page references in the
text, summary of forms, and index.
As it runs, the program produces a .haux file containing urls for the
labels, bibliographic entries, and index entries; as with LaTeX, a
second run of the program is needed to achieve proper
cross-referencing.
</p>
<p>
Most of the images and certain mathematical formulas included in the
HTML version were produced with the help of LaTeX, dvips, ghostscript,
and various programs from the netpbm library.
</p>
</body>
</html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB

BIN
csug/canned/cisco-logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.7 KiB

View file

@ -0,0 +1,25 @@
<html>
<head>
<title>Copyright Notice</title>
<link href="csug.css" rel="stylesheet" type="text/css">
</head>
<body>
<p>
<b>&copy; 2005-2015 Cisco Systems, Inc.</b><br>
Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License Version 2.0</a>.<br>
Revised April 2016 for Chez Scheme Version 9.3.4.
</p>
<p>
Cisco and the Cisco logo are trademarks or registered trademarks
of Cisco and/or its affiliates in the U.S. and other countries. To
view a list of Cisco trademarks, go to this URL:
http://www.cisco.com/go/trademarks. Third-party trademarks mentioned
are the property of their respective owners. The use of the word
partner does not imply a partnership relationship between Cisco and
any other company. (1110R)
</p>
</body>
</html>

1
csug/canned/csug.css Symbolic link
View file

@ -0,0 +1 @@
../csug.css

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

BIN
csug/canned/fatfibhtml.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

BIN
csug/canned/profilehtml.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

BIN
csug/canned/profview.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

821
csug/compat.stex Normal file
View file

@ -0,0 +1,821 @@
% Copyright 2005-2017 Cisco Systems, Inc.
%
% Licensed under the Apache License, Version 2.0 (the "License");
% you may not use this file except in compliance with the License.
% You may obtain a copy of the License at
%
% http://www.apache.org/licenses/LICENSE-2.0
%
% Unless required by applicable law or agreed to in writing, software
% distributed under the License is distributed on an "AS IS" BASIS,
% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
% See the License for the specific language governing permissions and
% limitations under the License.
\chapter{Compatibility Features\label{CHPTCOMPAT}}
This chapter describes several items that are included with current
versions of {\ChezScheme} primarily for compatibility with older
versions of the system.
Section~\ref{SECTCOMPATHASHTABLES} describes a hash-table interface
that has since been replaced by the R6RS hashtable interface.
Section~\ref{SECTCOMPATEXTENDSYNTAX}
describes \scheme{extend-syntax} macros.
These features are supported directly by current versions of {\ChezScheme},
but support may be dropped in future versions.
New programs should use the standard mechanisms described
in \emph{The Scheme Programming Language, 4th Edition}~\cite{Dybvig:tspl4}
instead.
Section~\ref{SECTCOMPATSTRUCTURES} describes a mechanism for defining
record-like structures as vectors instead of new unique types.
New programs should use \scheme{define-record}, which is described
in Section~\ref{SECTCSV7RECORDS}, instead.
Section~\ref{SECTCOMPATOTHER}
describes a compatibility file distributed with
{\ChezScheme} that contains definitions for forms and procedures no
longer supported directly by {\ChezScheme}.
% undocumented:
% application-expander not bothering...
% constant-expander not bothering...
% variable-expander not bothering...
% syntax-match? not bothering...
% extend-syntax/code not bothering...
\section{Hash Tables\label{SECTCOMPATHASHTABLES}}
The hash table procedures here are obviated by the new hash table procedures
listed in Section~\ref{SECTMISCHASHTABLES}.
%----------------------------------------------------------------------------
\entryheader
\formdef{make-hash-table}{\categoryprocedure}{(make-hash-table)}
\formdef{make-hash-table}{\categoryprocedure}{(make-hash-table \var{weak?})}
\returns a new hash table
\listlibraries
\endentryheader
If \var{weak?} is provided and is non-false, the hash
table is a weak hash table, which means that it does not protect
keys from the garbage collector.
Keys reclaimed by the garbage collector are removed from the table,
and their associated values are dropped the next time the table
is modified, if not sooner.
%----------------------------------------------------------------------------
\entryheader
\formdef{hash-table?}{\categoryprocedure}{(hash-table? \var{obj})}
\returns \scheme{#t} if \var{obj} is a hash table, otherwise \scheme{#f}
\listlibraries
\endentryheader
%----------------------------------------------------------------------------
\entryheader
\formdef{put-hash-table!}{\categoryprocedure}{(put-hash-table! \var{ht} \var{k} \var{v})}
\returns unspecified
\listlibraries
\endentryheader
\var{ht} must be a hash table.
\var{k} and \var{v} may be any Scheme values.
\scheme{put-hash-table!} associates the value
\var{v} with the key \var{k} in \var{ht}.
%----------------------------------------------------------------------------
\entryheader
\formdef{get-hash-table}{\categoryprocedure}{(get-hash-table \var{ht} \var{k} \var{d})}
\returns see below
\listlibraries
\endentryheader
\scheme{get-hash-table} returns the value
associated with \var{k} in \var{ht}.
If no value is associated with \var{k} in \var{ht},
\scheme{get-hash-table} returns \var{d}.
Key comparisons are performed with \var{eq?}.
Because objects may be moved by the garbage collector, \scheme{get-hash-table}
may need to rehash some objects and therefore cause side effects in the
hash table.
Thus, it is not safe to perform concurrent accesses of the same hash table
from multiple threads using \scheme{get-hash-table}.
%----------------------------------------------------------------------------
\entryheader
\formdef{remove-hash-table!}{\categoryprocedure}{(remove-hash-table! \var{ht} \var{k})}
\returns unspecified
\listlibraries
\endentryheader
\scheme{remove-hash-table!} drops any association
for \var{k} from \var{ht}.
%----------------------------------------------------------------------------
\entryheader
\formdef{hash-table-map}{\categoryprocedure}{(hash-table-map \var{ht} \var{p})}
\returns see below
\listlibraries
\endentryheader
\scheme{hash-table-map} applies \var{p} to each key, value association
in \var{ht}, in no particular order, and returns a list of the resulting
values, again in no particular order.
\var{p} should accept two arguments, a key and a value.
%----------------------------------------------------------------------------
\entryheader
\formdef{hash-table-for-each}{\categoryprocedure}{(hash-table-for-each \var{ht} \var{p})}
\returns unspecified
\listlibraries
\endentryheader
\scheme{hash-table-for-each} applies \var{p} to each key, value
association in \var{ht}, in no particular order.
Unlike \scheme{hash-table-map}, it does not create a list of the values;
instead, it's value is unspecified.
\var{p} should accept two arguments, a key and a value.
\section{Extend-Syntax Macros\label{SECTCOMPATEXTENDSYNTAX}}
This section describes \scheme{extend-syntax}, a powerful yet easy to use
syntactic extension facility based on
\index{pattern matching}pattern matching~\cite{Kohlbecker:phd}.
Syntactic transformations written using
\scheme{extend-syntax} are similar to those written using a
\scheme{define-syntax} with \scheme{syntax-case}, except that the
transformations produced by \scheme{extend-syntax} do not automatically
respect lexical scoping.
It is not typically possible to mix syntactic abstractions written using
\scheme{syntax-case} with those written using \scheme{extend-syntax}
seamlessly; it is generally preferable to use one or the other wherever
possible.
Support for \scheme{extend-syntax} within the \scheme{syntax-case} expander
is provided only as an aid to migrating to \scheme{syntax-case}.
%----------------------------------------------------------------------------
\entryheader
\formdef{extend-syntax}{\categorysyntax}{(extend-syntax (\var{name} \var{key} \dots) (\var{pat} \var{fender} \var{template}) \dots)}
\returns unspecified
\listlibraries
\endentryheader
\noindent
The identifier \var{name} is the name, or syntax keyword, for the
syntactic extension to be defined.
When the system expander processes any list expression whose car is
\var{name}, the syntactic transformation procedure generated by
\scheme{extend-syntax} is invoked on this expression.
The remaining identifiers \scheme{\var{key} \dots} are additional keywords to
be recognized within input expressions during expansion (such as
\scheme{else} in \scheme{cond} or \scheme{case}).
Each clause after the list of keys consists of a pattern \var{pat}, an
optional \index{fenders}\var{fender},
and a \var{template}.
The optional \var{fender} is omitted more often than not.
The \var{pat} specifies the syntax the input expression must have
for the clause to be chosen.
Identifiers within the pattern that are not keywords
(\emph{pattern variables}) are bound to corresponding pieces of the input expression.
If present, the \var{fender} is a Scheme expression that specifies
additional constraints on the input expression (accessed through the
pattern variables) that must be satisfied in order for the clause to
be chosen.
The \var{template} specifies what form the output takes, usually in
terms of the pattern variables.
During expansion, the transformation procedure \scheme{extend-syntax}
generates attempts to match the input expression against each
pattern in the order the clauses are given.
If the input expression matches the pattern, the pattern variables are
bound to the corresponding pieces of the input expression and the
fender for the clause, if any, is evaluated.
If the fender returns a true value, the given expansion is performed.
If input does not match the pattern or if the fender returns a false
value, the transformation procedure tries the next clause.
An exception is raised with condition type \scheme{&assertion} if no clause can be chosen.
Within the pattern,
\index{\scheme{...}~(ellipses)}\index{ellipses (~\scheme{...}~)}\emph{ellipsis}
(\scheme{...}) may be
used to specify zero or more occurrences
of the preceding pattern fragment, or prototype.
Similarly, ellipses may be used in the output to specify the construction
of zero or more expansion prototypes.
In this case, the expansion prototype must contain part of an input pattern
prototype.
The use of patterns, templates, ellipses within patterns and templates,
and fenders is illustrated in the following sequence of examples.
The first example, defining \index{\scheme{rec}}\scheme{rec}, uses a single keyword, a single
clause with no fender, and no ellipses.
\schemedisplay
(extend-syntax (rec)
[(rec id val)
(let ([id #f])
(set! id val)
id)])
\endschemedisplay
The second example, defining \index{\scheme{when}}\scheme{when}, shows
the use of ellipses.
\schemedisplay
(extend-syntax (when)
[(when test exp1 exp2 ...)
(if test (begin exp1 exp2 ...) #f)])
\endschemedisplay
The next example shows the definition of
\index{\scheme{let}}\scheme{let}.
The definition of \scheme{let} shows the use of multiple ellipses, employing
one for the identifier/value pairs and one for the expressions in the body.
It also shows that the prototype need not be a single identifier, and that
pieces of the prototype may be separated from one another in the template.
\schemedisplay
(extend-syntax (let)
[(let ([x e] ...) b1 b2 ...)
((lambda (x ...) b1 b2 ...) e ...)])
\endschemedisplay
The next example shows \index{\scheme{let*}}\scheme{let*}, whose syntax is the same as for
\scheme{let}, but which is defined recursively in terms of \scheme{let} with
two clauses (one for the base case, one for the recursion step) since
it must produce a nested structure.
\schemedisplay
(extend-syntax (let*)
[(let* () b1 b2 ...)
(let () b1 b2 ...)]
[(let* ([x e] more ...) b1 b2 ...)
(let ([x e]) (let* (more ...) b1 b2 ...))])
\endschemedisplay
The first pattern/template pair matches any \scheme{let*} expression with no
identifier/value pairs and maps it into the equivalent \scheme{begin} expression.
This is the base case.
The second pattern/template pair matches any \scheme{let*} expression with one
or more identifier/value pairs and transforms it into a \scheme{let} expression
binding the first pair whose body is a \scheme{let*} expression binding the
remaining pairs.
This is the recursion step, which will eventually lead us to the base case
because we remove one identifier/value pair at each step.
Notice that the second pattern uses the pattern variable \scheme{more} for the
second and later identifier/value pairs; this makes the pattern and template
less cluttered and makes it clear that only the first identifier/value pair
is dealt with explicitly.
The definition for \index{\scheme{and}}\scheme{and} requires three clauses.
The first clause is necessary to recognize \scheme{(and)}, and the second
two define all other \scheme{and} forms recursively.
\schemedisplay
(extend-syntax (and)
[(and) #t]
[(and x) x]
[(and x y ...) (if x (and y ...) #f)])
\endschemedisplay
The definition for \index{\scheme{cond}}\scheme{cond} requires four clauses.
As with \scheme{let*}, \scheme{cond} must be described recursively, partly because
it produces nested \scheme{if} expressions, and partly because one
ellipsis prototype would not be sufficient to describe all possible
\scheme{cond} clauses.
The definition of \scheme{cond} also requires that we specify \scheme{else} as a
keyword, in addition to \scheme{cond}.
Here is the definition:
\schemedisplay
(extend-syntax (cond else)
[(cond) #f]
[(cond (else e1 e2 ...))
(begin e1 e2 ...)]
[(cond (test) more ...)
(or test (cond more ...))]
[(cond (test e1 e2 ...) more ...)
(if test
(begin e1 e2 ...)
(cond more ...))])
\endschemedisplay
\noindent
Two of the clauses are base cases and two are recursion steps.
The first base case is an empty \scheme{cond}.
The value of \scheme{cond} in this case is unspecified, so the choice of
\scheme{#f} is somewhat arbitrary.
The second base case is a \scheme{cond} containing only an \scheme{else} clause;
this is transformed to the equivalent \scheme{begin} expression.
The two recursion steps differ in the number of expressions in the \scheme{cond}
clause.
The value of \scheme{cond} when the first true clause contains only the test
expression is the value of the test.
This is similar to what \scheme{or} does, so we expand the \scheme{cond} clause
into an \scheme{or} expression.
On the other hand, when there are expressions following the test expression,
the value of the last expression is returned, so we use \scheme{if} and
\scheme{begin}.
To be absolutely correct about the syntax of \scheme{let}, we actually
must require that the bound identifiers in the input are symbols.
If we typed something like \scheme{(let ([3 x]) x)} we would not get an
error from \scheme{let} because it does not check to verify that the
objects in the identifier positions are symbols.
Instead, \scheme{lambda} may complain, or perhaps the system evaluator
long after expansion is complete.
This is where \index{fenders}fenders
are useful.
\schemedisplay
(extend-syntax (let)
[(let ([x e] ...) b1 b2 ...)
(andmap symbol? '(x ...))
((lambda (x ...) b1 b2 ...) e ...)])
\endschemedisplay
\noindent
The \index{\scheme{andmap}}\scheme{andmap} of \scheme{symbol?}
over \scheme{'(x ...)} assures that each
bound identifier is a symbol.
A fender is simply a Scheme expression.
Within that expression, any quoted object is first expanded by the same
rules as the template part of the clause.
In this case, \scheme{'(x ...)} is expanded to the list of identifiers from
the identifier/value pairs.
\scheme{extend-syntax} typically handles everything you need it for, but
some syntactic extension definitions require the ability to include the
result of evaluating an arbitrary Scheme expression.
This ability is provided by \scheme{with}.
%----------------------------------------------------------------------------
\entryheader
\formdef{with}{\categorysyntax}{(with ((\var{pat} \var{expr}) \dots) \var{template})}
\returns processed \var{template}
\nolistlibraries
\endentryheader
\noindent
\scheme{with} is valid only within an template inside of \scheme{extend-syntax}.
\scheme{with} patterns are the same as \scheme{extend-syntax} patterns, \scheme{with}
expressions are the same as \scheme{extend-syntax} fenders, and \scheme{with}
templates are the same as \scheme{extend-syntax} templates.
\scheme{with} can be used to introduce new pattern identifiers bound to
expressions produced by arbitrary Scheme expressions within
\scheme{extend-syntax} templates.
That is, \scheme{with} allows an escape from the declarative style of
\scheme{extend-syntax} into the procedural style of full Scheme.
One common use of \scheme{with} is the introduction of a temporary
identifier or list of temporary identifiers into a template.
\scheme{with} is also used to perform complex transformations that might
be clumsy or inefficient if performed within the \scheme{extend-syntax}
framework.
For example, \scheme{or} requires the use of a temporary identifier.
We could define \scheme{or} as follows.
\schemedisplay
(extend-syntax (or)
[(or) #f]
[(or x) x]
[(or x y ...)
(let ([temp x])
(if temp temp (or y ...)))])
\endschemedisplay
\noindent
This would work until we placed an \scheme{or} expression within the scope
of an occurrence of \scheme{temp}, in which case strange things could happen,
since \scheme{extend-syntax} does not respect lexical scoping.
(This is one of the reasons that \scheme{define-syntax} is preferable to
\scheme{extend-syntax}.)
\schemedisplay
(let ([temp #t])
(or #f temp)) ;=> #f
\endschemedisplay
\noindent
One solution is to use
\index{\scheme{gensym}}\scheme{gensym} and \scheme{with} to
create a temporary identifier, as follows.
\schemedisplay
(extend-syntax (or)
[(or) #f]
[(or x) x]
[(or x y ...)
(with ([temp (gensym)])
(let ([temp x])
(if temp temp (or y ...))))])
\endschemedisplay
\noindent
Also, \scheme{with} can be used to combine elements of the input pattern
in ways not possible directly with \scheme{extend-syntax}, such as the
following \scheme{folding-plus} example.
\schemedisplay
(extend-syntax (folding-plus)
[(folding-plus x y)
(and (number? 'x) (number? 'y))
(with ([val (+ 'x 'y)])
val)]
[(folding-plus x y) (+ x y)])
\endschemedisplay
\noindent
\scheme{folding-plus} collapses into the value of \scheme{(+ x y)} if both
\scheme{x} and \scheme{y} are numeric constants.
Otherwise, \scheme{folding-plus} is transformed into \scheme{(+ x y)} for
later evaluation.
The fender checks that the operands are numbers at expansion time, and
the \scheme{with} performs the evaluation.
As with fenders, expansion is performed only within a quoted expressions,
since \scheme{quote} sets the data apart from the remainder of the Scheme
expression.
The example below binds a list of pattern variables to a list of
temporary symbols, taking advantage of the fact that \scheme{with} allows
us to bind patterns to expressions.
This list of temporaries helps us to implement the \scheme{sigma} syntactic
extension.
\scheme{sigma} is similar to \scheme{lambda}, except it assigns the identifiers
in the identifier list instead of creating new bindings.
It may be used to perform a series of assignments in parallel.
\schemedisplay
(extend-syntax (sigma)
[(sigma (x ...) e1 e2 ...)
(with ([(t ...) (map (lambda (x) (gensym)) '(x ...))])
(lambda (t ...)
(set! x t) ...
e1 e2 ...))])
(let ([x 'a] [y 'b])
((sigma (x y) (list x y)) y x)) ;=> (b a)
\endschemedisplay
The final example below uses \scheme{extend-syntax} to implement
\scheme{define-structure}, following a similar example using
\scheme{syntax-case} in Section~\ref{TSPL:SECTSYNTAXEXAMPLES} of
\emph{The Scheme Programming Language, 4th Edition}.
The definition of \scheme{define-structure} makes use of two pattern/template
clauses.
Two clauses are needed to handle the optionality of the second subexpression.
The first clause matches the form without the second subexpression and
merely converts it into the equivalent form with the second subexpression
present, but empty.
The definition also makes heavy use of \index{\scheme{with}}\scheme{with} to evaluate Scheme
expressions at expansion time.
The first four \scheme{with} clauses are used to manufacture the identifiers
that name the automatically defined procedures.
(The procedure \index{\scheme{format}}\scheme{format} is particularly useful here, but it could be
replaced with \scheme{string-append!}, using \scheme{symbol->string} as needed.)
The first two clauses yield single identifiers (for the constructor and
predicate), while the next two yield lists of identifiers (for the field
access and assignment procedures).
The fifth \scheme{with} clause (the final clause in the outer \scheme{with})
is used to count the total length vector needed for each instance of
the structure, which must include room for the name and all of the fields.
The final \scheme{with} clause (the only clause in the inner \scheme{with})
is used to create a list of vector indexes, one for each field (starting at
1, since the structure name occupies position 0).
\schemedisplay
(extend-syntax (define-structure)
[(define-structure (name id1 ...))
(define-structure (name id1 ...) ())]
[(define-structure (name id1 ...) ([id2 val] ...))
(with ([constructor
(string->symbol (format "make-~a" 'name))]
[predicate
(string->symbol (format "~a?" 'name))]
[(access ...)
(map (lambda (x)
(string->symbol
(format "~a-~a" 'name x)))
'(id1 ... id2 ...))]
[(assign ...)
(map (lambda (x)
(string->symbol
(format "set-~a-~a!" 'name x)))
'(id1 ... id2 ...))]
[count (length '(name id1 ... id2 ...))])
(with ([(index ...)
(let f ([i 1])
(if (= i 'count)
'()
(cons i (f (+ i 1)))))])
(begin
(define constructor
(lambda (id1 ...)
(let* ([id2 val] ...)
(vector 'name id1 ... id2 ...))))
(define predicate
(lambda (obj)
(and (vector? obj)
(= (vector-length obj) count)
(eq? (vector-ref obj 0) 'name))))
(define access
(lambda (obj)
(vector-ref obj index)))
...
(define assign
(lambda (obj newval)
(vector-set! obj index newval)))
...)))])
\endschemedisplay
\section{Structures\label{SECTCOMPATSTRUCTURES}}
\index{structures}This section describes a mechanism, similar
to the record-defining mechanisms of Section~\ref{SECTCSV7RECORDS},
that permits the creation of data structures
with fixed sets of named fields.
Unlike record types, structure types are not unique types, but are
instead implemented as vectors.
Specifically, a structure is implemented as a vector whose length is
one more than the number of fields and whose first element contains
the symbolic name of the structure.
The representation of structures as vectors
simplifies reading and printing of structures somewhat as well
as extension of the structure definition facility.
It does, however, have some drawbacks.
One is that structures may be treated as ordinary vectors by mistake in
situations where doing so is inappropriate.
When dealing with both structures and vectors in a program, care must
be taken to look for the more specific structure type before checking
for the more generic vector type, e.g., in a series of \scheme{cond}
clauses.
A similar drawback is that structure instances are easily ``forged,'' either
intentionally or by accident.
It is also impossible to control how structures are printed and read.
Structures are created via \scheme{define-structure}.
Each structure definition defines a constructor
procedure, a type predicate, an access procedure for each of its fields,
and an assignment procedure for each of its fields.
\scheme{define-structure} allows the programmer to control which fields
are arguments to the generated constructor procedure and which fields
are explicitly initialized by the constructor procedure.
\scheme{define-structure} is simple
yet powerful enough for most applications, and it is easily
extended to handle many applications for which it is not sufficient.
The definition of \scheme{define-structure} given at the end of
this section can serve as a starting point for more complicated
variants.
%----------------------------------------------------------------------------
\entryheader
\formdef{define-structure}{\categorysyntax}{(define-structure (\var{name} \var{id_1} \dots) ((\var{id_2} \var{expr}) \dots))}
\returns unspecified
\listlibraries
\endentryheader
\noindent
A \scheme{define-structure} form is a definition and may appear anywhere
and only where other definitions may appear.
\scheme{define-structure} defines a new data structure, \var{name}, and
creates a set of procedures for creating and manipulating instances of
the structure.
The identifiers \scheme{\var{id_1} \dots} and \scheme{\var{id_2} \dots}
name the fields of the data structure.
The following procedures are defined by \scheme{define-structure}:
\begin{itemize}
\item
a constructor procedure whose name is \scheme{make-\var{name}},
\item
a type predicate whose name is \scheme{\var{name}?},
\item
an access procedure whose name is \scheme{\var{name}-\var{field}}
for each field name \scheme{\var{id_1} \dots} and
\scheme{\var{id_2} \dots}, and
\item
an assignment procedure whose name is
\scheme{set-\var{name}-\var{field}!}
for each field name \scheme{\var{id_1} \dots} and \scheme{\var{id_2} \dots}.
\end{itemize}
The fields named by the identifiers \scheme{\var{id_1} \dots} are
initialized by the arguments to the constructor procedure.
The fields named by the identifiers \scheme{\var{id_2} \dots} are initialized
explicitly to the values of the expressions \scheme{\var{expr} \dots}.
Each expression is evaluated within the scope of the identifiers
\scheme{\var{id_1} \dots} (bound to the corresponding field values) and any
of the identifiers \scheme{\var{id_2} \dots} (bound to the corresponding field
values) appearing before it (as if within a \scheme{let*}).
To clarify, the constructor behaves as if defined as
\schemedisplay
(define make-\var{name}
(lambda (\var{id_1} \dots)
(let* ([\var{id_2} \var{expr}] \dots)
\var{body})))
\endschemedisplay
\noindent
where \var{body} builds the structure from the values of the identifiers
\scheme{\var{id_1} \dots} and \scheme{\var{id_2} \dots}.
If no fields other than those initialized by the arguments to the
constructor procedure are needed, the second subexpression,
\scheme{((\var{id_2} \var{expr}) \dots)}, may be omitted.
\index{pares}\index{\scheme{make-pare}}The following simple example
demonstrates how pairs might be defined in Scheme if they did not
already exist.
Both fields are initialized by the arguments to the constructor
procedure.
\schemedisplay
(define-structure (pare car cdr))
(define p (make-pare 'a 'b))
(pare? p) ;=> #t
(pair? p) ;=> #f
(pare? '(a . b)) ;=> #f
(pare-car p) ;=> a
(pare-cdr p) ;=> b
(set-pare-cdr! p (make-pare 'b 'c))
(pare-car (pare-cdr p)) ;=> b
(pare-cdr (pare-cdr p)) ;=> c
\endschemedisplay
The following example defines a handy string data structure, called a
\index{stretch strings}\emph{stretch-string}, that grows as needed.
This example uses a field explicitly initialized to a value that
depends on the value of the constructor argument fields.
\schemedisplay
(define-structure (stretch-string length fill)
([string (make-string length fill)]))
(define stretch-string-ref
(lambda (s i)
(let ([n (stretch-string-length s)])
(when (>= i n) (stretch-stretch-string! s (+ i 1) n))
(string-ref (stretch-string-string s) i))))
(define stretch-string-set!
(lambda (s i c)
(let ([n (stretch-string-length s)])
(when (>= i n) (stretch-stretch-string! s (+ i 1) n))
(string-set! (stretch-string-string s) i c))))
(define stretch-string-fill!
(lambda (s c)
(string-fill! (stretch-string-string s) c)
(set-stretch-string-fill! s c)))
(define stretch-stretch-string!
(lambda (s i n)
(set-stretch-string-length! s i)
(let ([str (stretch-string-string s)]
[fill (stretch-string-fill s)])
(let ([xtra (make-string (- i n) fill)])
(set-stretch-string-string! s
(string-append str xtra))))))
\endschemedisplay
\noindent
As often happens, most of the procedures defined automatically are
used only to define more specialized procedures, in this case the procedures
\scheme{stretch-string-ref} and \scheme{stretch-string-set!}.
\scheme{stretch-string-length} and \scheme{stretch-string-string} are
the only automatically defined procedures that are likely to be
called directly in code that uses stretch strings.
\schemedisplay
(define ss (make-stretch-string 2 #\X))
(stretch-string-string ss) ;=> "XX"
(stretch-string-ref ss 3) ;=> #\X
(stretch-string-length ss) ;=> 4
(stretch-string-string ss) ;=> "XXXX"
(stretch-string-fill! ss #\@)
(stretch-string-string ss) ;=> "@@@@"
(stretch-string-ref ss 5) ;=> #\@
(stretch-string-string ss) ;=> "@@@@@@"
(stretch-string-set! ss 7 #\=)
(stretch-string-length ss) ;=> 8
(stretch-string-string ss) ;=> "@@@@@@@="
\endschemedisplay
Section~\ref{TSPL:SECTSYNTAXEXAMPLES} of {\TSPLFOUR} defines a simplified
variant of \scheme{define-structure} as an example of the use of
\index{\scheme{syntax-case}}\scheme{syntax-case}.
The definition given below implements the complete version.
\scheme{define-structure} expands into a series of definitions for names
generated from the structure name and field names.
The generated identifiers are created with
\index{\scheme{datum->syntax}}\scheme{datum->syntax} to
make the identifiers visible where the \scheme{define-structure}
form appears.
Since a \scheme{define-structure} form expands into a \scheme{begin}
containing definitions, it is itself a definition and can be used
wherever definitions are valid.
\schemedisplay
(define-syntax define-structure
(lambda (x)
(define gen-id
(lambda (template-id . args)
(datum->syntax template-id
(string->symbol
(apply string-append
(map (lambda (x)
(if (string? x)
x
(symbol->string
(syntax->datum x))))
args))))))
(syntax-case x ()
((_ (name field1 ...))
(andmap identifier? #'(name field1 ...))
#'(define-structure (name field1 ...) ()))
((_ (name field1 ...) ((field2 init) ...))
(andmap identifier? #'(name field1 ... field2 ...))
(with-syntax
((constructor (gen-id #'name "make-" #'name))
(predicate (gen-id #'name #'name "?"))
((access ...)
(map (lambda (x) (gen-id x #'name "-" x))
#'(field1 ... field2 ...)))
((assign ...)
(map (lambda (x) (gen-id x "set-" #'name "-" x "!"))
#'(field1 ... field2 ...)))
(structure-length
(+ (length #'(field1 ... field2 ...)) 1))
((index ...)
(let f ([i 1] [ids #'(field1 ... field2 ...)])
(if (null? ids)
'()
(cons i (f (+ i 1) (cdr ids)))))))
#'(begin
(define constructor
(lambda (field1 ...)
(let* ([field2 init] ...)
(vector 'name field1 ... field2 ...))))
(define predicate
(lambda (x)
(and (vector? x)
(#3%fx= (vector-length x) structure-length)
(eq? (vector-ref x 0) 'name))))
(define access (lambda (x) (vector-ref x index)))
...
(define assign
(lambda (x update) (vector-set! x index update)))
...))))))
\endschemedisplay
\section{Compatibility File\label{SECTCOMPATOTHER}}
Current versions of {\ChezScheme} are distributed with a compatibility
file containing definitions of various syntactic forms and procedures
supported by earlier versions of {\ChezScheme} for which support has
since been dropped.
This file, \scheme{compat.ss}, is typically installed in the library
subdirectory of the {\ChezScheme} installation directory.
In some cases, the forms and procedures found in \scheme{compat.ss}
have been dropped because they were infrequently used and easily
written directly in Scheme.
In other cases, the forms and procedures have been rendered obsolete by
improvements in the system.
In such cases, new code should be written to use the newer features,
and older code should be rewritten if possible to use the newer
features as well.

25
csug/contents.stex Normal file
View file

@ -0,0 +1,25 @@
% Copyright 2005-2017 Cisco Systems, Inc.
%
% Licensed under the Apache License, Version 2.0 (the "License");
% you may not use this file except in compliance with the License.
% You may obtain a copy of the License at
%
% http://www.apache.org/licenses/LICENSE-2.0
%
% Unless required by applicable law or agreed to in writing, software
% distributed under the License is distributed on an "AS IS" BASIS,
% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
% See the License for the specific language governing permissions and
% limitations under the License.
\iflatex
\begingroup
\baselineskip=15pt plus 1pt
\normalbaselineskip=\baselineskip
\renewcommand{\baselinestretch}{1.5}
\tableofcontents
\endgroup
\fi
\ifhtml
\begin{contents}
\fi

662
csug/control.stex Normal file
View file

@ -0,0 +1,662 @@
% Copyright 2005-2017 Cisco Systems, Inc.
%
% Licensed under the Apache License, Version 2.0 (the "License");
% you may not use this file except in compliance with the License.
% You may obtain a copy of the License at
%
% http://www.apache.org/licenses/LICENSE-2.0
%
% Unless required by applicable law or agreed to in writing, software
% distributed under the License is distributed on an "AS IS" BASIS,
% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
% See the License for the specific language governing permissions and
% limitations under the License.
\chapter{Control Structures\label{CHPTCONTROL}}
This chapter describes {\ChezScheme} extensions to the set of standard
control structures.
See Chapter~\ref{TSPL:CHPTCONTROL} of {\TSPLFOUR} or the Revised$^6$ Report
on Scheme for a description of standard control structures.
\section{Conditionals}
%----------------------------------------------------------------------------
\entryheader
\formdef{exclusive-cond}{\categorysyntax}{(exclusive-cond \var{clause_1} \var{clause_2} \dots)}
\returns see below
\listlibraries
\endentryheader
\scheme{exclusive-cond} is a version of \scheme{cond}
(Section~\ref{TSPL:SECTCONDITIONALS} of {TSPLFOUR}) that differs
from \scheme{cond} in that the tests embedded within the clauses
are assumed to be exclusive in the sense that if one of the tests
is true, the others are not.
This allows the implementation to reorder clauses when profiling
information is available at expansion time (Section~\ref{SECTMISCPROFILE}).
The \scheme{(\var{test})} form of clause is not supported.
The order chosen when profiling information is available is based
on the relative numbers of times the RHS of each clause is executed,
and \scheme{(\var{test})} has no RHS.
\scheme{(\var{test} => values)} is equivalent, albeit less concise.
%----------------------------------------------------------------------------
\entryheader
\formdef{case}{\categorysyntax}{(case \var{expr_0} \var{clause_1} \var{clause_2} \dots)}
\returns see below
\listlibraries
\endentryheader
\noindent
Each clause but the last must take one of the forms:
\schemedisplay
((\var{key} \dots) \var{expr_1} \var{expr_2} \dots)
(\var{key} \var{expr_1} \var{expr_2} \dots)
\endschemedisplay
\noindent
where each \var{key} is a datum distinct from the other keys.
The last clause may be in the above form or it may be an
\index{\scheme{else}}\scheme{else} clause of the form
\schemedisplay
(else \var{expr_1} \var{expr_2} \dots)
\endschemedisplay
\var{expr_0} is evaluated and the result is compared
(using \scheme{equal?}) against the keys of each clause in order.
If a clause containing a matching key is found, the
expressions \scheme{\var{expr_1} \var{expr_2} \dots} are evaluated in sequence
and the values of the last expression are returned.
If none of the clauses contains a matching key and an \scheme{else} clause
is present, the expressions \scheme{\var{expr_1} \var{expr_2} \dots} of the
\scheme{else} clause are evaluated in sequence and the values of the last
expression are returned.
If none of the clauses contains a matching key and no \scheme{else} clause
is present, the value or values are unspecified.
The Revised$^6$ Report version of \scheme{case} does not support singleton
keys (the second of the first two clause forms above) and uses
\scheme{eqv?} rather than \scheme{equal?} as the comparison procedure.
Both versions are defined in terms of \scheme{exclusive-cond} so that
if profiling information is available at expansion time, the clauses will
be reordered to put those that are most frequently executed first.
\schemedisplay
(let ([ls '(ii iv)])
(case (car ls)
[i 1]
[ii 2]
[iii 3]
[(iiii iv) 4]
[else 'out-of-range])) ;=> 2
(define p
(lambda (x)
(case x
[("abc" "def") 'one]
[((a b c)) 'two]
[else #f])))
(p (string #\d #\e #\f)) ;=> one
(p '(a b c)) ;=> two
\endschemedisplay
%----------------------------------------------------------------------------
\noskipentryheader
\formdef{record-case}{\categorysyntax}{(record-case \var{expr} \var{clause_1} \var{clause_2} \dots)}
\returns see explanation
\listlibraries
\endnoskipentryheader
\noindent
\scheme{record-case} is a restricted form of \scheme{case} that supports the
destructuring of \index{records}\emph{records}, or \index{tagged lists}\emph{tagged lists}.
A record has as its first element a tag that determines what ``type''
of record it is; the remaining elements are the fields of the record.
Each clause but the last must take the form
\schemedisplay
((\var{key} \dots) \var{formals} \var{body_1} \var{body_2} \dots)
\endschemedisplay
\noindent
where each \var{key} is a datum distinct from the other keys.
The last clause may be in the above form or it may be an
\index{\scheme{else}}\scheme{else} clause of the form
\schemedisplay
(else \var{body_1} \var{body_2} \dots)
\endschemedisplay
\var{expr} must evaluate to a pair.
\var{expr} is evaluated and the car of its value is compared
(using \scheme{eqv?}) against the keys of each clause in order.
If a clause containing a matching key is found, the variables in
\var{formals} are bound to the remaining elements
of the list and the expressions
\scheme{\var{body_1} \var{body_2} \dots} are evaluated in sequence.
The value of the last expression is returned.
The effect is identical to the application of
\schemedisplay
(lambda \var{formals} \var{body_1} \var{body_2} \dots)
\endschemedisplay
\noindent
to the cdr of the list.
If none of the clauses contains a matching key and an \scheme{else} clause
is present, the expressions \scheme{\var{body_1} \var{body_2} \dots} of the
\scheme{else} clause are evaluated in sequence and the value of the last
expression is returned.
If none of the clauses contains a matching key and no \scheme{else} clause
is present, the value is unspecified.
\schemedisplay
(define calc
(lambda (x)
(record-case x
[(add) (x y) (+ x y)]
[(sub) (x y) (- x y)]
[(mul) (x y) (* x y)]
[(div) (x y) (/ x y)]
[else (assertion-violationf 'calc "invalid expression ~s" x)])))
(calc '(add 3 4)) ;=> 7
(calc '(div 3 4)) ;=> 3/4
\endschemedisplay
\section{Mapping and Folding}
%----------------------------------------------------------------------------
\noskipentryheader
\formdef{ormap}{\categoryprocedure}{(ormap \var{procedure} \var{list_1} \var{list_2} \dots)}
\returns see explanation
\listlibraries
\endnoskipentryheader
\noindent
\scheme{ormap} is identical to the Revised$^6$ Report \scheme{exists}.
%----------------------------------------------------------------------------
\entryheader
\formdef{andmap}{\categoryprocedure}{(andmap \var{procedure} \var{list_1} \var{list_2} \dots)}
\returns see explanation
\listlibraries
\endentryheader
\noindent
\scheme{andmap} is identical to the Revised$^6$ Report \scheme{for-all}.
\section{Continuations}
{\ChezScheme} supports one-shot continuations as well as the standard
multi-shot continuations obtainable via \scheme{call/cc}.
One-shot continuations are continuations that may be invoked at most
once, whether explicitly or implicitly.
They are obtained with \scheme{call/1cc}.
%----------------------------------------------------------------------------
\entryheader
\formdef{call/1cc}{\categoryprocedure}{(call/1cc \var{procedure})}
\returns see below
\listlibraries
\endentryheader
\noindent
\scheme{call/1cc} obtains its continuation and passes it to \var{procedure},
which should accept one argument.
The continuation itself is represented by a procedure.
This procedure normally takes one argument but may take an arbitrary
number of arguments depending upon whether the context of the call
to \scheme{call/1cc}
expects multiple return values or not.
When this procedure is applied to a value or values, it returns the values
to the continuation of the \scheme{call/1cc} application.
The continuation obtained by \scheme{call/1cc} is a
\index{one-shot continuations}``one-shot continuation.''
A one-shot continuation should not be returned to multiple times, either
by invoking the continuation or returning normally from \var{procedure} more
than once.
A one-shot continuation is ``promoted'' into a normal (multishot)
continuation, however, if it is
still active when a
normal continuation is obtained by \scheme{call/cc}.
After a one-shot continuation is promoted into a multishot continuation,
it behaves exactly as if it had been obtained via \scheme{call/cc}.
This allows \scheme{call/cc} and \scheme{call/1cc} to be used together
transparently in many applications.
One-shot continuations may be more efficient for some applications than
multishot continuations.
See the paper ``Representing control in the presence of one-shot
continuations''~\cite{Bruggeman:oneshots} for more information about
one-shot continuations, including how they are implemented in
{\ChezScheme}.
The following examples highlight the similarities and differences
between one-shot and normal continuations.
\schemedisplay
(define prod
; compute the product of the elements of ls, bugging out
; with no multiplications if a zero element is found
(lambda (ls)
(lambda (k)
(if (null? ls)
1
(if (= (car ls) 0)
(k 0)
(* (car ls) ((prod (cdr ls)) k)))))))
(call/cc (prod '(1 2 3 4))) ;=> 24
(call/1cc (prod '(1 2 3 4))) ;=> 24
(call/cc (prod '(1 2 3 4 0))) ;=> 0
(call/1cc (prod '(1 2 3 4 0))) ;=> 0
(let ([k (call/cc (lambda (x) x))])
(k (lambda (x) 0))) ;=> 0
(let ([k (call/1cc (lambda (x) x))])
(k (lambda (x) 0))) ;=> \var{exception}
\endschemedisplay
%----------------------------------------------------------------------------
\entryheader\label{dynamic-wind}
\formdef{dynamic-wind}{\categoryprocedure}{(dynamic-wind \var{in} \var{body} \var{out})}
\formdef{dynamic-wind}{\categoryprocedure}{(dynamic-wind \var{critical?} \var{in} \var{body} \var{out})}
\returns values resulting from the application of \var{body}
\listlibraries
\endentryheader
The first form is identical to the Revised$^6$ Report \scheme{dynamic-wind}.
When the optional \var{critical?} argument is present and non-false,
the \var{in} thunk is invoked in a critical section along with the code
that records that the body has been entered, and the \var{out} thunk is
invoked in a critical section along with the code that records
that the body has been exited.
Extreme caution must be taken with this form of \scheme{dynamic-wind},
since an error or long-running computation can leave interrupts
and automatic garbage collection disabled.
\section{Engines\label{SECTENGINES}}
\index{engines}Engines are a high-level process abstraction supporting
\index{timed preemption}\emph{timed preemption}~\cite{Dybvig:engines,Haynes:abstracting}.
Engines may be used to simulate \index{multiprocessing}multiprocessing, implement operating
system kernels, and perform \index{nondeterministic computations}nondeterministic computations.
%----------------------------------------------------------------------------
\entryheader
\formdef{make-engine}{\categoryprocedure}{(make-engine \var{thunk})}
\returns an engine
\listlibraries
\endentryheader
An engine is created by passing a thunk (no argument procedure)
to \scheme{make-engine}.
The body of the thunk is the computation to be performed by the engine.
An engine itself is a procedure of three arguments:
\begin{description}
\item[\var{ticks}:]
\index{ticks@\var{ticks}|see{engines}}a positive integer that specifies
the amount of \emph{fuel} to be given
to the engine.
An engine executes until this fuel runs out or until its computation
finishes.
\item[\var{complete}:]
\index{complete@\var{complete}|see{engines}}a procedure of one or more
arguments that
specifies what to do if the computation finishes.
Its arguments are the amount of fuel left over and the
values produced by the computation.
\item[\var{expire}:]
\index{expire@\var{expire}|see{engines}}a procedure of one argument that
specifies what to do if the fuel runs
out before the computation finishes.
Its argument is a new engine capable of continuing the computation
from the point of interruption.
\end{description}
When an engine is applied to its arguments, it sets up a timer
to fire in \var{ticks} time units.
(See \scheme{set-timer} on page~\pageref{desc:set-timer}.)
If the engine computation completes before the timer expires, the
system invokes \var{complete}, passing
it the number of \var{ticks} left over and
the values produced by the computation.
If, on the other hand, the timer goes off before the engine computation
completes, the system creates a new engine from the continuation of
the interrupted computation and passes this engine to \var{expire}.
\var{complete} and \var{expire} are invoked in the continuation
of the engine invocation.
An implementation of engines is given
in Section~\ref{TSPL:SECTEXENGINES}.
of {\TSPLFOUR}.
Do not use the timer interrupt (see \index{\scheme{set-timer}}\scheme{set-timer}) and \index{engines}engines
at the same time, since engines are implemented in terms of the timer.
The following example creates an engine from a trivial computation,
3, and gives the engine 10 ticks.
\schemedisplay
(define eng
(make-engine
(lambda () 3)))
(eng 10
(lambda (ticks value) value)
(lambda (x) x)) ;=> 3
\endschemedisplay
It is often useful to pass \scheme{list} as the \var{complete}
procedure to an engine, causing an engine that completes to return a
list whose first element is the ticks remaining and whose remaining elements
are the values returned by the computation.
\schemedisplay
(define eng
(make-engine
(lambda () 3)))
(eng 10
list
(lambda (x) x)) ;=> (9 3)
\endschemedisplay
\noindent
In the example above, the value is 3 and there are 9 ticks left over,
i.e., it takes one unit of fuel to evaluate 3.
(The fuel amounts given here are for illustration only.
Your mileage may vary.)
Typically, the engine computation does not finish in one try.
\index{\scheme{fibonacci}}The following example displays the use of an engine to
compute the 10th Fibonacci number in steps.
\schemedisplay
(define fibonacci
(lambda (n)
(let fib ([i n])
(cond
[(= i 0) 0]
[(= i 1) 1]
[else (+ (fib (- i 1))
(fib (- i 2)))]))))
(define eng
(make-engine
(lambda ()
(fibonacci 10))))
(eng 50
list
(lambda (new-eng)
(set! eng new-eng)
"expired")) ;=> "expired"
(eng 50
list
(lambda (new-eng)
(set! eng new-eng)
"expired")) ;=> "expired"
(eng 50
list
(lambda (new-eng)
(set! eng new-eng)
"expired")) ;=> "expired"
(eng 50
list
(lambda (new-eng)
(set! eng new-eng)
"expired")) ;=> (21 55)
\endschemedisplay
\noindent
Each time the engine's fuel runs out, the \var{expire} procedure assigns
\scheme{eng} to the new engine.
The entire computation requires four blocks of 50 ticks to complete; of the
last 50 it uses all but 21.
Thus, the total amount of fuel used is 179 ticks.
This leads to the following procedure, \scheme{mileage}, which ``times'' a
computation using engines:
\schemedisplay
(define mileage
(lambda (thunk)
(let loop ([eng (make-engine thunk)] [total-ticks 0])
(eng 50
(lambda (ticks . values)
(+ total-ticks (- 50 ticks)))
(lambda (new-eng)
(loop new-eng
(+ total-ticks 50)))))))
(mileage (lambda () (fibonacci 10))) ;=> 179
\endschemedisplay
\noindent
The choice of 50 for the number of ticks to use each time is
arbitrary, of course.
It might make more sense to pass a much larger number, say 10000,
in order to reduce the number of times the computation is interrupted.
The next procedure is similar to \scheme{mileage}, but it returns a list
of engines, one for each tick it takes to complete the computation.
Each of the engines in the list represents a ``snapshot'' of the
computation, analogous to a single frame of a moving picture.
\scheme{snapshot} might be useful for ``single stepping'' a computation.
\schemedisplay
(define snapshot
(lambda (thunk)
(let again ([eng (make-engine thunk)])
(cons eng
(eng 1 (lambda (t . v) '()) again)))))
\endschemedisplay
\noindent
The recursion embedded in this procedure is rather strange.
The complete procedure performs the base case, returning the empty
list, and the expire procedure performs the recursion.
The next procedure, \index{\scheme{round-robin}}\scheme{round-robin}, could be the basis for a simple
time-sharing \index{operating system}operating system.
\scheme{round-robin} maintains a queue of processes (a list of engines),
cycling through the queue in a \emph{round-robin} fashion, allowing each
process to run for a set amount of time.
\scheme{round-robin} returns a list of the values returned by the engine
computations in the order that the computations complete.
Each computation is assumed to produce exactly one value.
\schemedisplay
(define round-robin
(lambda (engs)
(if (null? engs)
'()
((car engs)
1
(lambda (ticks value)
(cons value (round-robin (cdr engs))))
(lambda (eng)
(round-robin
(append (cdr engs) (list eng))))))))
\endschemedisplay
\noindent
Since the amount of fuel supplied each time, one tick, is constant,
the effect of \scheme{round-robin} is to return a list of the values sorted
from the quickest to complete to the slowest to complete.
Thus, when we call \scheme{round-robin} on a list of engines, each computing
one of the Fibonacci numbers, the output list is sorted with the earlier
Fibonacci numbers first, regardless of the order of the input list.
\schemedisplay
(round-robin
(map (lambda (x)
(make-engine
(lambda ()
(fibonacci x))))
'(4 5 2 8 3 7 6 2))) ;=> (1 1 2 3 5 8 13 21)
\endschemedisplay
More interesting things can happen if the amount of fuel varies
each time through the loop.
\index{nondeterministic computations}In this case, the computation would
be nondeterministic, i.e., the results would vary from call to call.
The following syntactic form, \index{\scheme{por} (parallel-or)}\scheme{por} (parallel-or), returns the
first of its expressions to complete with a true value.
\scheme{por} is implemented with the procedure \scheme{first-true}, which is
similar to \scheme{round-robin} but quits when any of the engines
completes with a true value.
If all of the engines complete, but none with a true value,
\scheme{first-true} (and hence \scheme{por}) returns \scheme{#f}.
Also, although \scheme{first-true} passes a fixed amount of fuel to each
engine, it chooses the next engine to run at random, and is thus
nondeterministic.
\schemedisplay
(define-syntax por
(syntax-rules ()
[(_ x ...)
(first-true
(list (make-engine (lambda () x)) ...))]))
(define first-true
(let ([pick
(lambda (ls)
(list-ref ls (random (length ls))))])
(lambda (engs)
(if (null? engs)
#f
(let ([eng (pick engs)])
(eng 1
(lambda (ticks value)
(or value
(first-true
(remq eng engs))))
(lambda (new-eng)
(first-true
(cons new-eng
(remq eng engs))))))))))
\endschemedisplay
\noindent
The list of engines is maintained with \scheme{pick}, which randomly
chooses an element of the list, and \scheme{remq}, which removes the
chosen engine from the list.
Since \scheme{por} is nondeterministic, subsequent uses with the same
expressions may not return the same values.
\schemedisplay
(por 1 2 3) ;=> 2
(por 1 2 3) ;=> 3
(por 1 2 3) ;=> 2
(por 1 2 3) ;=> 1
\endschemedisplay
\noindent
Furthermore, even if one of the expressions is an infinite loop,
\scheme{por} still finishes as long as one of the other expressions
completes and returns a true value.
\schemedisplay
(por (let loop () (loop)) 2) ;=> 2
\endschemedisplay
\noindent
With \scheme{engine-return} and \scheme{engine-block}, it is possible to
terminate an engine explicitly.
\scheme{engine-return} causes the engine to complete, as if the
computation had finished.
Its arguments are passed to the \var{complete} procedure along with the
number of ticks remaining.
It is essentially a nonlocal exit from the engine.
Similarly, \scheme{engine-block} causes the engine to expire, as if the
timer had run out.
A new engine is made from the continuation of the call to \scheme{engine-block}
and passed to the \var{expire} procedure.
%----------------------------------------------------------------------------
\entryheader
\formdef{engine-block}{\categoryprocedure}{(engine-block)}
\returns does not return
\listlibraries
\endentryheader
\noindent
This causes a running engine to stop, create a new engine capable
of continuing the computation, and pass the new engine to the original
engine's third argument
(the expire procedure).
Any remaining fuel is forfeited.
\schemedisplay
(define eng
(make-engine
(lambda ()
(engine-block)
"completed")))
(eng 100
(lambda (ticks value) value)
(lambda (x)
(set! eng x)
"expired")) ;=> "expired"
(eng 100
(lambda (ticks value) value)
(lambda (x)
(set! eng x)
"expired")) ;=> "completed"
\endschemedisplay
%----------------------------------------------------------------------------
\entryheader
\formdef{engine-return}{\categoryprocedure}{(engine-return \var{obj} \dots)}
\returns does not return
\listlibraries
\endentryheader
\noindent
This causes a running engine to stop and pass control to the
engine's \var{complete} argument.
The first argument passed to the complete procedure is the amount of
fuel remaining, as usual, and
the remaining arguments are the objects \scheme{\var{obj} \dots}
passed to \scheme{engine-return}.
\schemedisplay
(define eng
(make-engine
(lambda ()
(reverse (engine-return 'a 'b 'c)))))
(eng 100
(lambda (ticks . values) values)
(lambda (new-eng) "expired")) ;=> (a b c)
\endschemedisplay

37
csug/copyright.stex Normal file
View file

@ -0,0 +1,37 @@
% Copyright 2005-2018 Cisco Systems, Inc.
%
% Licensed under the Apache License, Version 2.0 (the "License");
% you may not use this file except in compliance with the License.
% You may obtain a copy of the License at
%
% http://www.apache.org/licenses/LICENSE-2.0
%
% Unless required by applicable law or agreed to in writing, software
% distributed under the License is distributed on an "AS IS" BASIS,
% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
% See the License for the specific language governing permissions and
% limitations under the License.
\iflatex
\thispagestyle{empty}
\centerline{}\vfill
\textbf{\copyright~2022 Cisco Systems, Inc.}
Licensed under the Apache License Version 2.0\\
http://www.apache.org/licenses/LICENSE-2.0
% NB: also update corresponding notice in csug.stex
Revised \revisiondate~for Chez Scheme Version 9.5.9.
\medskip\noindent
Cisco and the Cisco logo are trademarks or registered trademarks
of Cisco and/or its affiliates in the U.S. and other countries. To
view a list of Cisco trademarks, go to this URL:
http://www.cisco.com/go/trademarks. Third-party trademarks mentioned
are the property of their respective owners. The use of the word
partner does not imply a partnership relationship between Cisco and
any other company. (1110R)
\vspace{1in}\break
\fi

568
csug/csug.bib Normal file
View file

@ -0,0 +1,568 @@
@string{p:popl83 = {Conference Record of the Tenth Annual {ACM} Symposium
on Principles of Programming Languages}}
@string{p:popl87 = {Conference Record of the Fourteenth Annual {ACM} Symposium
on Principles of Programming Languages}}
@string{p:popl88 = {Conference Record of the Fifteenth Annual {ACM} Symposium
on Principles of Programming Languages}}
@string{p:popl90 = {Conference Record of the Seventeenth Annual {ACM} Symposium
on Principles of Programming Languages}}
@string{p:popl91 = {Conference Record of the Eighteenth Annual {ACM} Symposium
on Principles of Programming Languages}}
@string{p:popl99 = {Conference Record of the 26th Annual {ACM} Symposium
on Principles of Programming Languages}}
@string{p:ppopp90 = {Proceedings of the Second {ACM} {SIGPLAN} Symposium
on Principles and Practice of Parallel Programming}}
@string{p:sigplan86 = {Proceedings of the {SIGPLAN} '86 Symposium
on Compiler Construction}}
@string{p:sigplan87 = {Proceedings of the {SIGPLAN} '87 Symposium
on Interpreters and Interpretive Techniques}}
@string{p:pldi88 = {Proceedings of the {SIGPLAN} '88 Conference
on Programming Language Design and Implementation}}
@string{p:pldi90 = {Proceedings of the {SIGPLAN} '90 Conference
on Programming Language Design and Implementation}}
@string{p:pldi93 = {Proceedings of the {SIGPLAN} '93 Conference
on Programming Language Design and Implementation}}
@string{p:pldi95 = "Proceedings of the ACM SIGPLAN '95 Conference on
Programming Language Design and Implementation"}
@string{p:pldi96 = {Proceedings of the {SIGPLAN} '96 Conference
on Programming Language Design and Implementation}}
@string{p:iccl98 = {Proceedings of the {IEEE Computer Society}
1998 International Conference on Computer Languages}}
@string{p:sehld83 = {Proceedings of the {ACM} Software Engineering Symposium
on High-Level Debugging}}
@string{p:lisp80 = {Conference Record of the 1980 {Lisp} Conference}}
@string{p:lfp84 = {Proceedings of the 1984 {ACM} Conference on {Lisp}
and Functional Programming}}
@string{p:lfp86 = {Proceedings of the 1986 {ACM} Conference on {Lisp}
and Functional Programming}}
@string{p:lfp88 = {Proceedings of the 1988 {ACM} Conference on {Lisp}
and Functional Programming}}
@string{p:lfp90 = {Proceedings of the 1990 {ACM} Conference on {Lisp}
and Functional Programming}}
@string{p:lfp94 = {Proceedings of the 1994 {ACM} Conference on {Lisp}
and Functional Programming}}
@string{p:lics86 = {Proceedings of the Symposium on Logic in Computer Science}}
@string{p:lics88 = {Proceedings of the Third Symposium on Logic
in Computer Science}}
@string{j:cacm = {Communications of the {ACM}}}
@string{j:acm = {Journal of the {ACM}}}
@string{j:ipl = {Information Processing Letters}}
@string{j:cl = {Computer Languages}}
@string{j:lasc = {{Lisp} and Symbolic Computation}}
@string{j:hasc = {{Higher Order} and Symbolic Computation}}
@string{j:sn = {{SIGPLAN} Notices}}
@string{j:lp = {{LISP} Pointers}}
@string{j:tcs = {Theoretical Computer Science}}
@string{j:toplas = {{ACM} Transactions on Programming Languages and Systems}}
@string{elsevier = {Elsevier Science Publishers}}
@string{iucs = {Indiana Computer Science Department}}
@string{LNCS = {Springer-Verlag Lecture Notes in Computer Science}}
@techreport{Sussman:scheme,
author = {Gerald J. Sussman and Guy L. {Steele Jr.}},
title = {{Scheme}: An Interpreter for Extended Lambda Calculus},
year = 1975,
month = may,
number = 349,
type = {MIT AI Memo},
institution = {Massachusetts Institute of Technology}}
@techreport{Steele:scheme,
author = {Guy L. {Steele Jr.} and Gerald J. Sussman},
title = {The Revised Report on {Scheme}, a Dialect of {Lisp}},
year = 1978,
month = jan,
number = 452,
type = {MIT AI Memo},
institution = {Massachusetts Institute of Technology}}
@book{Manis:schematics,
author = {Vincent S. Manis and James J. Little},
title = {The Schematics of Computation},
year = 1995,
publisher = {Prentice Hall}}
@book{Springer:sap,
author = {George Springer and Daniel P. Friedman},
title = {Scheme and the Art of Programming},
year = 1989,
publisher = {MIT Press and McGraw-Hill}}
@book{Friedman:lisper,
author = {Daniel P. Friedman and Matthias Felleisen},
title = {The Little Schemer},
year = 1996,
edition = {fourth},
publisher = {MIT Press}}
@book{Abelson:sicp1ed,
author = {Harold Abelson and Gerald J. Sussman with Julie Sussman},
title = {Structure and Interpretation of Computer Programs},
edition = {first},
year = 1985,
publisher = {MIT Press and McGraw-Hill}}
@book{Abelson:sicp,
author = {Harold Abelson and Gerald J. Sussman with Julie Sussman},
title = {Structure and Interpretation of Computer Programs},
year = 1996,
edition = {second},
publisher = {MIT Press and McGraw-Hill}}
@book{Steele:common,
author = {Guy L. {Steele Jr.}},
title = {{Common} {Lisp}, the Language},
publisher = {Digital Press},
edition = {second},
year = 1990}
@article{Clinger:revised,
author = {William Clinger and
Jonathan Rees and
others},
title = {The Revised$^4$ Report on the Algorithmic Language {Scheme}},
journal = j:lp,
volume = 4,
number = 3,
year = 1991}
@article{Kelsey:r5rs,
author = {Richard Kelsey and William Clinger and
Jonathan Rees and
others},
title = {The Revised$^5$ Report on the Algorithmic Language {Scheme}},
journal = j:hasc,
volume = 11,
number = 1,
year = 1999}
@article{Dybvig:engines,
author = {R. Kent Dybvig and Robert Hieb},
title = {Engines from Continuations},
journal = j:cl,
volume = 14,
number = 2,
pages = {109--123},
year = 1989}
@article{Haynes:obtaining,
author = {Christopher T. Haynes and Daniel P. Friedman and Mitchell Wand},
title = {Obtaining Coroutines with Continuations},
journal = j:cl,
volume = 11,
number = {3/4},
pages = {143--153},
year = 1986}
@article{Haynes:abstracting,
author = {Christopher T. Haynes and Daniel P. Friedman},
title = {Abstracting Timed Preemption with Engines},
journal = j:cl,
volume = 12,
number = 2,
pages = {109--121},
year = 1987}
@inproceedings{Hieb:representing,
author = {Robert Hieb and
R. Kent Dybvig and
Carl Bruggeman},
title = {Representing Control in the Presence of First-class Continuations},
booktitle = p:pldi90,
pages = {66--77},
month = jun,
year = 1990}
@inproceedings{Bruggeman:oneshots,
author = {Carl Bruggeman and Oscar Waddell and R. Kent Dybvig},
title = {Representing Control in the Presence of One-Shot Continuations},
booktitle = p:pldi96,
pages = {99--107},
month = may,
year = 1996
}
@manual{IEEE:1178,
title = {{IEEE} Standard for the {Scheme} Programming Language},
note = {IEEE Std 1178-1990},
organization = {{IEEE} Computer Society},
month = may,
year = 1991}
@book{Kernighan:c,
author = {Brian W. Kernighan and Dennis M. Ritchie},
title = {The {C} Programming Language},
edition = {second},
publisher = {Prentice Hall},
year = 1988}
@article{Naur:revised,
author = {Peter Naur and others},
title = {Revised Report on the Algorithmic Language {ALGOL} 60},
journal = j:cacm,
volume = 6,
number = 1,
pages = {1--17},
month = jan,
year = 1963}
@inproceedings{Daniel:prolog-fft,
author = {Sam M. Daniel},
title = {Efficient recursive {FFT} implementation in {Prolog}},
booktitle = {Proceedings of the Second
International Conference on the Practical Application of Prolog},
pages = {175--185},
year = 1994}
@inproceedings{Wand:continuation-based,
author = {Mitchell Wand},
title = {Continuation-Based Multiprocessing},
booktitle = p:lisp80,
month = aug,
pages = {19--28},
year = 1980}
@article{Robinson:unification,
author = {J. A. Robinson},
title = {A Machine-Oriented Logic based on the Resolution Principle},
journal = j:acm,
volume = 12,
number = 1,
pages = {23--41},
year = 1965}
@techreport{Plaisted:sets,
author = {David A. Plaisted},
title = {Constructs for Sets, Quantifiers, and Rewrite Rules in {Lisp}},
year = 1984,
month = jun,
number = {UIUCDCS-R-84-1176},
institution = {University of Illinois at Urbana-Champaign Department
of Computer Science}}
@book{Clocksin:prolog,
author = {William F. Clocksin and Christopher S. Mellish},
title = {Programming in {Prolog}},
publisher = {Springer-Verlag},
edition = {second},
year = 1984}
@incollection(Friedman:devils,
author = {Daniel P. Friedman and Christopher T. Haynes
and Eugene E. Kohlbecker},
title = {Programming with Continuations},
year = 1984,
booktitle = {Program Transformation and Programming Environments},
editor = {P. Pepper},
publisher = {Springer-Verlag},
pages = {263--274})
@article{Naur:algol,
author = {Peter Naur and others},
title = {Revised Report on the Algorithmic Language {ALGOL} 60},
journal = j:cacm,
volume = 6,
number = 1,
pages = {1--17},
month = jan,
year = 1963}
@inproceedings{Dybvig:guardians,
author = {R. Kent Dybvig and Carl Bruggeman and David Eby},
title = {Guardians in a generation-based garbage collector},
booktitle = p:pldi93,
pages = "207-216",
month = jun,
year = 1993}
@article{Dybvig:lambdastar,
author = {R. Kent Dybvig and Robert Hieb},
title = {A New Approach to Procedures with Variable Arity},
journal = j:lasc,
volume = 3,
number = 3,
pages = {229--244},
month = sep,
year = 1990}
@article{Dybvig:syntactic,
author = {R. Kent Dybvig and Robert Hieb and Carl Bruggeman},
title = {Syntactic Abstraction in {Scheme}},
journal = j:lasc,
volume = 5,
number = 4,
pages = {295--326},
year = 1993}
@inproceedings{Ashley:mvalues,
author = {J. Michael Ashley and R. Kent Dybvig},
title = {An efficient implementation of multiple return values in {Scheme}},
booktitle = p:lfp94,
pages = {140-149},
month = jun,
year = 1994}
@manual{Dybvig:cssm,
author = {R. Kent Dybvig},
title = {{Chez Scheme} System Manual, Rev. 3.0},
organization = {Cadence Research Systems},
address = {Bloomington, Indiana},
month = "December",
year = 1995}
@Book{Briggs:dft,
author = "William Briggs and Van Emden Henson",
title = "The {DFT}: {An} Owner's Manual for the Discrete Fourier Transform",
publisher = "Society for Industrial and Applied Mathematics",
year = "1995",
address = "Philadelphia"}
@book{Dybvig:tspl4,
author = {R. Kent Dybvig},
title = {The Scheme Programming Language},
year = 2009,
edition = {4th},
publisher = {MIT Press}}
@phdthesis{Kohlbecker:phd,
author = {Eugene Kohlbecker},
title = {Syntactic Extensions in the Programming Language {Lisp}},
school = {Indiana University},
address = {Bloomington},
month = aug,
year = 1986}
@article{Dybvig:expansion:jour,
author = {R. Kent Dybvig and Daniel P. Friedman and Christopher T. Haynes},
title = {Expansion-Passing Style: A General Macro Mechanism},
journal = j:lasc,
volume = 1,
number = 1,
pages = {53--75},
year = 1988}
@techreport{Dybvig:destination,
author = {R. Kent Dybvig and Robert Hieb and Tom Butler},
title = {Destination-driven code generation},
institution = iucs,
number = 302,
month = feb,
year = 1990}
@techreport{Dybvig:syntax-case,
author = {R. Kent Dybvig},
title = {Writing hygienic macros in Scheme with syntax-case},
institution = iucs,
number = 356,
month = jun,
year = 1992}
@techreport{Dybvig:sm,
author = {R. Kent Dybvig and David Eby and Carl Bruggeman},
title = {Don't stop the {BiBOP}: Flexible and efficient storage
management for dynamically-typed languages},
institution = iucs,
number = 400,
month = "March",
year = 1994}
@phdthesis{Dybvig:phd,
author = {R. Kent Dybvig},
title = {Three Implementation Models for Scheme},
school = {University of North Carolina},
address = {Chapel Hill},
month = apr,
year = 1987}
@inproceedings{Burger:regalloc,
author = {Robert G. Burger and
Oscar Waddell and
R. Kent Dybvig},
title = {Register Allocation Using Lazy Saves, Eager Restores,
and Greedy Shuffling},
booktitle = p:pldi95,
pages = {130--138},
month = jun,
year = 1995}
@InProceedings{Burger:floatprinting,
author = "Robert G. Burger and R. Kent Dybvig",
title = "Printing Floating-Point Numbers Quickly and Accurately",
booktitle = p:pldi96,
pages = "108--116",
month = may,
year = 1996,
}
@InProceedings{burger:pdrtc,
author = "Robert G. Burger and R. Kent Dybvig",
title = "An Infrastructure for Profile-Driven Dynamic Recompilation",
booktitle = p:iccl98,
pages = "240--251",
month = may,
year = 1998
}
@inproceedings{waddell:modules,
author = {Oscar Waddell and R. Kent Dybvig},
title = {Extending the scope of syntactic abstraction},
booktitle = p:popl99,
pages = "203--213",
month = jan,
year = 1999,
}
@InProceedings{waddell:sas97,
author = "Oscar Waddell and R. Kent Dybvig",
title = "Fast and Effective Procedure Inlining",
booktitle = "Fourth International Symposium on Static Analysis",
year = "1997",
series = lncs,
volume = "1302",
pages = "35--52",
publisher = "Springer-Verlag"
}
@InProceedings{bawden:pepm99,
author = {Alan Bawden},
title = {Quasiquotation in LISP},
booktitle = {O. Danvy, Ed., University of Aarhus, Dept. of Computer Science},
year = {1999},
pages = {88--99}
}
@article{Waddell:fixing-letrec,
author = {Oscar Waddell and Dipanwita Sarkar and R. Kent Dybvig},
title = {Fixing Letrec: A Faithful Yet Efficient Implementation of {Scheme}'s
Recursive Binding Construct},
journal = {Higher-order and symbolic computation},
volume = 18,
number = "3/4",
pages = {299--326},
year = 2005,
texturl = "http://www.cs.indiana.edu/~dyb/pubs/fixing-letrec.pdf",
abstracturl = "http://www.cs.indiana.edu/~dyb/pubs/fixing-letrec-abstract.html",
biburl = "http://www.cs.indiana.edu/~dyb/pubs/fixing-letrec.bib",
annote = {Describes how Chez Scheme handles {\tt letrec} expressions
efficiently and with full enforcement of the revised
report's restriction preventing evaluation of left-hand-side
variable references and assignments before the righ-hand
sides have been evaluated.}}
@inproceedings{Dybvig:hocs,
author = {R. Kent Dybvig},
title = {The Development of {Chez Scheme}},
booktitle = {Proceedings of the Eleventh {ACM SIGPLAN} International
Conference on Functional Programming},
pages = {1--12},
month = sep,
year = 2006,
texturl = "http://www.cs.indiana.edu/~dyb/pubs/hocs.pdf",
biburl = "http://www.cs.indiana.edu/~dyb/pubs/hocs.bib",
annote = {A brief history of Chez Scheme's development}
}
@Misc{r6rs,
author = {Michael Sperber and R. Kent
Dybvig and Matthew Flatt and Anton van Straaten (eds.)},
title = {Revised${}^6$ Report on the Algorithmic Language {Scheme}},
month = "September",
year = 2007,
url = "http://www.r6rs.org/"
}
@Misc{r6rslibs,
author = {Michael Sperber and R. Kent
Dybvig and Matthew Flatt and Anton van Straaten (eds.)},
title = {Revised${}^6$ Report on the Algorithmic Language {Scheme}---Standard Libraries},
month = "September",
year = 2007,
url = "http://www.r6rs.org/"
}
@Misc{r6rsapps,
author = {Michael Sperber and R. Kent
Dybvig and Matthew Flatt and Anton van Straaten (eds.)},
title = {Revised${}^6$ Report on the Algorithmic Language {Scheme}---Non-normative Appendices},
month = "September",
year = 2007,
url = "http://www.r6rs.org/"
}
@inproceedings{adams:equal,
author = {Michael Adams and R. Kent Dybvig},
title = {Efficient Nondestructive Equality Checking for Trees and Graphs},
booktitle = {Proceedings of the 13th {ACM SIGPLAN} International
Conference on Functional Programming},
pages = {179--188},
month = sep,
year = 2008}
@inproceedings{ghuloum:eq-hash-tables,
title={Generation-friendly eq hash tables},
author = {Abdulaziz Ghuloum and R. Kent Dybvig},
booktitle={2007 Workshop on Scheme and Functional Programming},
year = 2007,
url = "http://sfp2007.ift.ulaval.ca/programme.html",
pages={27--35}
}
@inproceedings{Dybvig:mitchfest-threads,
title={A {Scheme} for native threads},
author = {R. Kent Dybvig},
booktitle={Symposium in Honor of Mitchell Wand},
url = "https://web.archive.org/web/20170626072601/http://www.ccs.neu.edu/events/wand-symposium/talks/mitchfest-09-dybvig.pdf",
month = aug,
year = 2009
}
@inproceedings{Ghuloum:fixing-letrec,
title={Fixing letrec (reloaded)},
author = {Abdulaziz Ghuloum and R. Kent Dybvig},
booktitle={2009 Workshop on Scheme and Functional Programming},
url = "http://www.schemeworkshop.org/2009/",
month = aug,
year = 2009,
}
@inproceedings{Ghuloum:libraries,
title = {Implicit phasing for {R6RS} libraries},
author = {Abdulaziz Ghuloum and R. Kent Dybvig},
booktitle = {\it Proceedings of the 12th ACM SIGPLAN International
Conference on Functional Programming},
pages = {303--314},
url = {http://doi.acm.org/10.1145/1291220.1291197},
year = {2007}
}
@phdthesis{ghuloum:phd,
author = {Ghuloum, Abdulaziz},
note = {Adviser-Dybvig, R. Kent},
title = {Implicit phasing for library dependencies},
year = {2008},
isbn = {978-1-109-02767-9},
order_no = {AAI3344623},
publisher = {Indiana University},
address = {Indianapolis, IN, USA},
school = {Indiana University}
}
@inproceedings{Hayes:ephemerons,
author = {Barry Hayes},
title = {Ephemerons: a New Finalization Mechanism},
booktitle = {\it Proceedings of the 12th ACM SIGPLAN
Conference on Object-Oriented Languages, Programming, Systems,
and Applications},
pages = {176--183},
url = {https://doi.org/10.1145/263700.263733},
year = {1997}
}

35
csug/csug.css Normal file
View file

@ -0,0 +1,35 @@
BODY {background-color: #FFFFFF}
a:link, a:active, a:visited { color:#005568; text-decoration:underline }
a:hover { color:white; text-decoration:underline; background:#005568 }
a.plain:link, a.plain:active, a.plain:visited { color:#005568; text-decoration:none }
a.plain:hover { color:white; text-decoration:none; background:#005568 }
a.toc:link, a.toc:active, a.toc:visited {font-family: sans-serif; color:#005568; text-decoration:none}
a.toc:hover {font-family: sans-serif; color:white; text-decoration:none; background:#005568}
a.image:link, a.image:active, a.image:visited, a.image:hover {
color: #005568;
background: #FFFFFF;
}
ul.tocchapter { list-style: none; }
ul.tocsection { list-style: circle; color: #C41230 }
hr.copyright { width: 50% }
input.default { background: #ffffff; color: #000000; vertical-align: middle}
h1, h2, h3, h4 {font-family: sans-serif; color: #005568}
h1 {font-size: 2em}
h2 {margin-top: 30px; font-size: 1.5em}
h3 {margin-top: 30px; font-size: 1.17em}
h1, h2, h3, h4 {font-weight: bold}
.title { font-family: sans-serif; font-weight: bold; font-size: 2.5em; color: #005568; white-space: nowrap}
.formdef { color: #005568 }
table.indent {margin-left: 20px}

155
csug/csug.stex Normal file
View file

@ -0,0 +1,155 @@
% Copyright 2005-2018 Cisco Systems, Inc.
%
% Licensed under the Apache License, Version 2.0 (the "License");
% you may not use this file except in compliance with the License.
% You may obtain a copy of the License at
%
% http://www.apache.org/licenses/LICENSE-2.0
%
% Unless required by applicable law or agreed to in writing, software
% distributed under the License is distributed on an "AS IS" BASIS,
% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
% See the License for the specific language governing permissions and
% limitations under the License.
\documentclass{csug8}
\chapterpicturesfalse
% \let\cleardoublepage=\relax\includeonly{threads}
\usepackage{scheme}
\schemeinit
(case-sensitive #t)
\endschemeinit
\def\revisiondate{April 2022}
% Just don't care about small overflows, most of the time:
\iflatex
\hfuzz=16.0pt
\fi
\iflatex
\usepackage{graphicx}
\usepackage{color}
\definecolor{formdefcolor}{gray}{.8}
\fi
\iflatex
\usepackage{makeidx}
% \ifdraft \usepackage{showidx} \fi
\ifdraft\setlength\overfullrule{5pt}\else\setlength\overfullrule{0pt}\fi
\tolerance=1000
\makeindex
\fi
% also fix Revised date and version in copyright.stex
\ifhtml
\def\copyrightnotice{\raw{<hr class=copyright align=left>
<p>
<a class=plain href="index.html">Chez Scheme Version 9 User's Guide</a><br>
Copyright &copy; 2022 Cisco Systems, Inc.<br>
Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License Version 2.0</a>
(<a class=plain href="canned/copyright.html">full copyright notice.</a>).</br>
Revised} \revisiondate\raw{ for Chez Scheme Version 9.5.9<br>
<a class=plain href="canned/about.html">about this book</a>
</tr></table>
}}
\documenttitle[csug.css]{Chez Scheme Version 9 User's Guide}
\fi
\newcommand{\ChezScheme}{\textsl{Chez~Scheme}}
\newcommand{\PetiteChezScheme}{\textsl{Petite~Chez~Scheme}}
\newcommand{\TSPLFOUR}{\emph{The Scheme Programming Language, 4th Edition}}
\iflatex
\newcommand{\dash}{\raise.5ex\hbox to 1em{\leaders\hrule\hfil}}
\fi
\ifhtml
\newcommand{\dash}{---}
\fi
\iflatex
\font\titlefont=cmbxsl10 at 18pt
\font\subtitlefont=cmbxsl10 at 15pt
\fi
% \iflatex
% \setlength{\pdfpagewidth}{6in}
% \setlength{\pdfpageheight}{9in}
% \fi
\begin{document}
\iflatex
\parskip=4pt
\parindent=0pt
\fi
\frontmatter
\ifhtml
\raw{\raw{<table><tr>
<td><img src="canned/cisco-logo.png"><br></td>
<td style="padding-left: 2em"><span class=title>Chez Scheme Version 9<br>User's Guide</span></td>
</tr></table>}}
\fi
\include{title}
\include{copyright}
\include{contents}
\include{preface}
%
\mainmatter
\include{intro}
\include{use}
\include{debug}
\include{foreign}
\include{binding}
\include{control}
\include{objects}
\include{numeric}
\include{io}
\include{libraries}
\include{syntax}
\include{system}
\include{smgmt}
\include{expeditor}
\include{threads}
\include{compat}
%
\backmatter
\include{bibliography}
\include{summary}
%
\def\indexintrotext{%
This index is a unified index for this book and
\index{The Scheme Programming Language, 4th Edition@\emph{The Scheme Programming Language, 4th Edition}}\emph{The
Scheme Programming Language, 4th Edition} (TSPL4).
Page numbers prefixed by ``t'' refer the latter document.
Italicized page numbers refer to the primary description of a syntactic
form or procedure.}
%
\ifhtml
\chapter{Index}
{\indexintrotext}
All page numbers appearing here refer to the printed version of these
books and also serve as hypertext links to the corresponding locations
in the electronic versions of these books.
\makeindex
\else
\begingroup\tolerance=2000
\printindex
\endgroup
\fi
%
\ifhtml
\end{contents}
\copyrightnotice
\fi
\end{document}

507
csug/csug8.cls Normal file
View file

@ -0,0 +1,507 @@
%%% csug8.cls
%%% Based on tspl4.cls
%%% Copyright (c) 1998 R, Kent Dybvig
%%%
%%% Permission is hereby granted, free of charge, to any person obtaining a
%%% copy of this software and associated documentation files (the "Software"),
%%% to deal in the Software without restriction, including without limitation
%%% the rights to use, copy, modify, merge, publish, distribute, sublicense,
%%% and/or sell copies of the Software, and to permit persons to whom the
%%% Software is furnished to do so, subject to the following conditions:
%%%
%%% The above copyright notice and this permission notice shall be included in
%%% all copies or substantial portions of the Software.
%%%
%%% THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
%%% IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
%%% FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
%%% THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
%%% LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
%%% FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
%%% DEALINGS IN THE SOFTWARE.
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{csug8}[2009/07/12 CSUG8]
\newif\ifdropfolios\dropfoliosfalse
\newif\if@openright
\newif\if@mainmatter \@mainmattertrue
\newif\ifchapterpictures \chapterpicturestrue
\newif\ifdraft\draftfalse
\newcommand{\@ptsize}{}
%%% to support hypertext index entries
\def\hindex#1{\index} % ignore the label here---no links in printed version
\newcommand{\hyperlink}[3][ref]{#3}
\newcommand{\href}[3][ref]{#3}
\newcommand{\hpageref}[3][ref]{#3}
\let\true@ref=\ref\renewcommand{\ref}[2][]{\true@ref{#2}}
\let\true@pageref=\pageref\renewcommand{\pageref}[2][]{\true@pageref{#2}}
\newif\iflatex\latextrue
\newif\ifhtml\htmlfalse
\newlength{\trimwidth}
\newlength{\trimheight}
\newlength{\gutterwidth}
\newlength{\edgewidth}
% paperheight is total height of paper before trimming
% paperwidth is total width of paper before trimming
% trimwidth is amount that will be trimmed on outside (unbound) edge
% trimheight is amount that will be trimmed on both top and bottom
% gutterwidth is margin on the inside (bound) edge
% edgewidth is margin on all the outside (unbound) edges
% text height will be paperheight - 2*trimheight - 2*edgeheight
% text width will be paperwidth - trimwidth - gutterwidth - edgewidth
% inside (bound) margin will be gutterwidth
% outside (unbound) margins will be edgewidth
%%% options
\DeclareOption{crownquarto}
% lulu lies or their converter is broken and we shouldn't include the trim
% {\setlength\paperheight {25.235cm}% % 24.6cm + 2 * .125
% \setlength\paperwidth {19.535cm}% % 18.9cm + .25in
% \setlength\gutterwidth{1.0in}%
% \setlength\edgewidth{1.0in}%
% \setlength\trimwidth{.25in}%
% \setlength\trimheight{.125in}}
{\setlength\paperheight {24.6cm}%
\setlength\paperwidth {18.9cm}%
\setlength\gutterwidth{1.0in}%
\setlength\edgewidth{1.0in}%
\setlength\trimwidth{0in}%
\setlength\trimheight{0in}}
\DeclareOption{tspl4size}
{\setlength\paperheight {9.25in}%
\setlength\paperwidth {7.0in}%
\setlength\gutterwidth{.875in}% % isn't this actually 1in?
\setlength\edgewidth{1.0in}%
\setlength\trimwidth{.125in}%
\setlength\trimheight{.125in}}
\DeclareOption{ninebysix}
{\setlength\paperheight {9.25in}%
\setlength\paperwidth {6.125in}%
\setlength\gutterwidth{.75in}%
\setlength\edgewidth{.75in}%
\setlength\trimwidth{.125in}%
\setlength\trimheight{.125in}}
\DeclareOption{a4paper}
{\setlength\paperheight {297mm}%
\setlength\paperwidth {210mm}}
\DeclareOption{a5paper}
{\setlength\paperheight {210mm}%
\setlength\paperwidth {148mm}}
\DeclareOption{b5paper}
{\setlength\paperheight {250mm}%
\setlength\paperwidth {176mm}}
\DeclareOption{letterpaper}
{\setlength\paperheight {11in}%
\setlength\paperwidth {8.5in}}
\DeclareOption{legalpaper}
{\setlength\paperheight {14in}%
\setlength\paperwidth {8.5in}}
\DeclareOption{executivepaper}
{\setlength\paperheight {10.5in}%
\setlength\paperwidth {7.25in}}
\DeclareOption{landscape}
{\setlength\@tempdima {\paperheight}%
\setlength\paperheight {\paperwidth}%
\setlength\paperwidth {\@tempdima}}
\DeclareOption{10pt}{\renewcommand{\@ptsize}{0}}
\DeclareOption{11pt}{\renewcommand{\@ptsize}{1}}
\DeclareOption{12pt}{\renewcommand{\@ptsize}{2}}
\DeclareOption{oneside}{\@twosidefalse \@mparswitchfalse}
\DeclareOption{twoside}{\@twosidetrue \@mparswitchtrue}
\DeclareOption{draft}{\drafttrue}
\DeclareOption{final}{\draftfalse}
\DeclareOption{titlepage}
{\ClassError{proc}{Option `titlepage' is not supported}{}}
\DeclareOption{notitlepage}{\relax}
\DeclareOption{openright}{\@openrighttrue}
\DeclareOption{openany}{\@openrightfalse}
\DeclareOption{onecolumn}{\relax}
\DeclareOption{twocolumn}
{\ClassError{proc}{Option `twocolumn' is not supported}{}}
\DeclareOption{leqno}{\input{leqno.clo}}
\DeclareOption{fleqn}{\input{fleqn.clo}}
\ExecuteOptions{crownquarto,10pt,twoside,onecolumn,final,openright}
\ProcessOptions
\input{csug81\@ptsize.clo}
\setlength\lineskip{1\p@}
\setlength\normallineskip{1\p@}
\renewcommand{\baselinestretch}{}
% block paragraphs:
\setlength\parskip{4\p@ \@plus \p@}
\setlength\parindent{0\p@}
\@lowpenalty 51
\@medpenalty 151
\@highpenalty 301
\setcounter{topnumber}{2}
\renewcommand{\topfraction}{.7}
\setcounter{bottomnumber}{1}
\renewcommand{\bottomfraction}{.3}
\setcounter{totalnumber}{3}
\renewcommand{\textfraction}{.2}
\renewcommand{\floatpagefraction}{.5}
\setcounter{dbltopnumber}{2}
\renewcommand{\dbltopfraction}{.7}
\renewcommand{\dblfloatpagefraction}{.5}
%%% headers and footers
\if@twoside
\def\ps@headings{%
\let\@oddfoot\@empty\let\@evenfoot\@empty
\def\@evenhead{\thepage\hfil\slshape\leftmark}%
\def\@oddhead{{\slshape\rightmark}\hfil\thepage}%
\def\chaptermark##1{%
\markboth{\if@mainmatter\thechapter.\ \fi##1}%
{\if@mainmatter\thechapter.\ \fi##1}}
\def\sectionmark##1{%
\markright{\thesection.\ ##1}}}
\else
\def\ps@headings{%
\let\@oddfoot\@empty
\def\@oddhead{{\slshape\rightmark}\hfil\thepage}%
\def\chaptermark##1{%
\markright{\if@mainmatter\@chapapp\ \thechapter.\fi\ ##1}}}
\fi
\newcommand*{\chaptermark}[1]{}
\setcounter{secnumdepth}{2} % must be at least two
\newcounter {chapter}
\newcounter {section}[chapter]
\newcounter{exercise}[section]
\renewcommand{\thechapter}{\arabic{chapter}}
\renewcommand{\thesection}{\thechapter.\arabic{section}}
\renewcommand{\theexercise}{\thechapter.\arabic{section}.\arabic{exercise}}
\newcommand{\@chapapp}{\chaptername}
%%% illustrated chapter heads
\newlength{\chframesize}
\setlength{\chframesize}{\textwidth}
\addtolength{\chframesize}{-\fboxrule}
\addtolength{\chframesize}{-\fboxrule}
\newlength{\chpicsize}
\setlength{\chpicsize}{\chframesize}
\addtolength{\chpicsize}{-6pt}
\def\chpic#1{\begingroup%
\fboxsep=3pt
\fbox{\includegraphics[height=\chpicsize]{#1}}\endgroup}
%\def\chpic#1{\begingroup%
% \fboxsep=0pt
% \vbox{\noindent%
% \fbox{\vbox{\hbox to \chframesize{\hfil\vbox to \chframesize{\vfil%
% \includegraphics{#1}\vfil}\hfil}}}}\endgroup}
%\def\picturechapterhead#1{
% \thispagestyle{empty}
% \null\vfill\vfill
% {\LARGE\bfseries\hbox to \textwidth{\hfil CHAPTER \thechapter}}
% \vfill}
\def\picturechapterhead#1{
\thispagestyle{empty}
\vbox to 6pc{\null\vfill
{\Large\hbox to \textwidth{\hfil CHAPTER \thechapter}}
\hbox to \textwidth{\leaders\hrule\hfil}}
\vskip 10pt
{\titlefont\hbox to \textwidth{\hfil#1}}
\vfill\vfill\vfill\noindent
\chpic{pic/ch\thechapter}
\par\eject
\thispagestyle{empty}
\null
\vfill
\noindent
{\it \input{pic/ch\thechapter.tex}}\par\break
\thispagestyle{empty}}
%%% document structure
\newcommand{\frontmatter}{\cleardoublepage
\@mainmatterfalse\pagenumbering{roman}}
\newcommand{\mainmatter}{\cleardoublepage
\@mainmattertrue\pagenumbering{arabic}}
\newcommand{\backmatter}{\if@openright\cleardoublepage\else\clearpage\fi
\@mainmatterfalse}
\def\chapter#1{
\if@openright\cleardoublepage\else\clearpage\fi
\global\@topnum\z@
\if@mainmatter
\refstepcounter{chapter}%
\typeout{\@chapapp\space\thechapter.}%
\addcontentsline{toc}{chapter}%
{\protect\numberline{\thechapter}#1}%
\else
\addcontentsline{toc}{chapter}{#1}%
\fi
\addtocontents{lof}{\protect\addvspace{10\p@}}%
\addtocontents{lot}{\protect\addvspace{10\p@}}%
\chaptermark{#1}%
\if@mainmatter
\ifchapterpictures
\picturechapterhead{#1}%
\else
\plainchapterhead{#1}%
\fi
\else
\plainchapterhead{#1}%
\fi
\@afterindentfalse
\@afterheading}
\def\plainchapterhead#1{%
\ifdropfolios\thispagestyle{plain}\else\thispagestyle{empty}\fi%
\vspace*{50\p@}%
{\parindent \z@ \raggedright \reset@font
\interlinepenalty\@M
\if@mainmatter
\titlefont\makebox[\hsize][l]{\thechapter. #1}\par\nobreak
\else
\titlefont\makebox[\hsize][l]{#1}\par\nobreak
\fi
\vskip 40\p@
}}
\newcommand{\section}{\@startsection{section}{1}{\z@}%
{-3.5ex \@plus -1ex \@minus -.2ex}%
{2.3ex \@plus.2ex}%
{\reset@font\Large\bfseries}}
%%% page layout
\setlength\leftmargini {2.5em}
\setlength\leftmarginii {2.2em}
\setlength\leftmarginiii {1.87em}
\setlength\leftmarginiv {1.7em}
\setlength\leftmarginv {1em}
\setlength\leftmarginvi {1em}
\setlength\leftmargin {\leftmargini}
\setlength \labelsep {.5em}
\setlength \labelwidth{\leftmargini}
\addtolength\labelwidth{-\labelsep}
\@beginparpenalty -\@lowpenalty
\@endparpenalty -\@lowpenalty
\@itempenalty -\@lowpenalty
\renewcommand{\theenumi}{\arabic{enumi}}
\renewcommand{\theenumii}{\alph{enumii}}
\renewcommand{\theenumiii}{\roman{enumiii}}
\renewcommand{\theenumiv}{\Alph{enumiv}}
\newcommand{\labelenumi}{\theenumi.}
\newcommand{\labelenumii}{(\theenumii)}
\newcommand{\labelenumiii}{\theenumiii.}
\newcommand{\labelenumiv}{\theenumiv.}
\renewcommand{\p@enumii}{\theenumi}
\renewcommand{\p@enumiii}{\theenumi(\theenumii)}
\renewcommand{\p@enumiv}{\p@enumiii\theenumiii}
\newcommand{\labelitemi}{$\m@th\bullet$}
\newcommand{\labelitemii}{\normalfont\bfseries --}
\newcommand{\labelitemiii}{$\m@th\ast$}
\newcommand{\labelitemiv}{$\m@th\cdot$}
\setlength\arraycolsep{5\p@}
\setlength\tabcolsep{3\p@}
\setlength\arrayrulewidth{.4\p@}
\setlength\doublerulesep{2\p@}
\setlength\tabbingsep{\labelsep}
\skip\@mpfootins = \skip\footins
\setlength\fboxsep{3\p@}
\setlength\fboxrule{.4\p@}
\DeclareOldFontCommand{\rm}{\normalfont\rmfamily}{\mathrm}
\DeclareOldFontCommand{\sf}{\normalfont\sffamily}{\mathsf}
\DeclareOldFontCommand{\tt}{\normalfont\ttfamily}{\mathtt}
\DeclareOldFontCommand{\bf}{\normalfont\bfseries}{\mathbf}
\DeclareOldFontCommand{\it}{\normalfont\itshape}{\mathit}
\DeclareOldFontCommand{\sl}{\normalfont\slshape}{\@nomath\sl}
\DeclareOldFontCommand{\sc}{\normalfont\scshape}{\@nomath\sc}
\DeclareRobustCommand*{\cal}{\@fontswitch{\relax}{\mathcal}}
\DeclareRobustCommand*{\mit}{\@fontswitch{\relax}{\mathnormal}}
%%% table of contents
\newcommand{\@pnumwidth}{1.55em}
\newcommand{\@tocrmarg} {2.55em}
\newcommand{\@dotsep}{4.5}
\setcounter{tocdepth}{2}
\newcommand*{\l@chapter}[2]{%
\addpenalty{-\@highpenalty}%
\vskip 3pt \@plus4\p@
\setlength\@tempdima{1.5em}%
\begingroup
\parindent \z@ \rightskip \@pnumwidth
\parfillskip -\@pnumwidth
\leavevmode \bfseries
\advance\leftskip\@tempdima
\hskip -\leftskip
#1\nobreak\hfil \nobreak\hbox to\@pnumwidth{\hss #2}\par
\penalty\@highpenalty
\endgroup}
% \newcommand*{\l@section} {\@dottedtocline{1}{1.5em}{2.3em}}
\newcommand*{\l@section}[2]{%
\vskip \z@ \@plus2\p@
{\leftskip 1.5em\relax \rightskip \@tocrmarg \parfillskip -\rightskip
\parindent 1.5em\relax\@afterindenttrue
\interlinepenalty\@M
\leavevmode
\@tempdima 2.3em\relax
\advance\leftskip \@tempdima \null\nobreak\hskip -\leftskip
{#1}\nobreak\hfil \nobreak\hbox to\@pnumwidth{\hss #2}\par}}
\newcommand{\tableofcontents}{%
\if@openright\cleardoublepage\else\clearpage\fi
\ifdropfolios\thispagestyle{plain}\else\thispagestyle{empty}\fi%
\global\@topnum\z@
\chaptermark{\contentsname}%
\plainchapterhead{\contentsname}%
\@starttoc{toc}}
%%% bibliography
\newdimen\bibindent \bibindent=1.5em
\newcommand{\newblock}{}
\newenvironment{thebibliography}[1]
{\chapter{References}
\list{\@biblabel{\arabic{enumiv}}}%
{\settowidth\labelwidth{\@biblabel{#1}}%
\leftmargin\labelwidth
\advance\leftmargin\labelsep
\usecounter{enumiv}%
\let\p@enumiv\@empty
\renewcommand{\theenumiv}{\arabic{enumiv}}}%
\renewcommand{\newblock}{\hskip .11em \@plus.33em \@minus.07em}%
\sloppy\clubpenalty4000\widowpenalty4000%
\sfcode`\.=\@m}
{\def\@noitemerr
{\@latex@warning{Empty `thebibliography' environment}}%
\endlist}
%%% index
\newenvironment{theindex}
{\if@openright\cleardoublepage\else\clearpage\fi
\begingroup\raggedright\schemeindexsize\footnotesize
\columnseprule \z@
\columnsep 35\p@
\twocolumn[\plainchapterhead{\indexname}]%
\addcontentsline{toc}{chapter}{\indexname}%
\chaptermark{\indexname}%
\ifdropfolios\thispagestyle{plain}\else\thispagestyle{empty}\fi\parindent\z@
\indexintrotext\medskip
\parskip\z@ \@plus .3\p@\relax
\let\item\@idxitem}
{\clearpage\endgroup}
\newcommand{\@idxitem} {\par\hangindent 40\p@}
\newcommand{\subitem} {\par\hangindent 40\p@ \hspace*{20\p@}}
\newcommand{\subsubitem}{\par\hangindent 40\p@ \hspace*{30\p@}}
\newcommand{\indexspace}{\par \vskip 10\p@ \@plus5\p@ \@minus3\p@\relax}
%%% latex.ltx redefinitions
%% leave padding page blank (no header)
\def\cleardoublepage{\clearpage\if@twoside \ifodd\c@page\else
{\pagestyle{empty}\hbox{}\newpage\if@twocolumn\hbox{}\newpage\fi}\fi\fi}
%% change section headers to "1.1. foo" instead of "1.1 foo"
\def\@seccntformat#1{\csname the#1\endcsname. }
%% change numbered table of contents lines to "1.1. foo" instead of "1.1 foo"
\def\numberline#1{#1. }
\newenvironment{description}
{\list{}{\labelwidth\z@ \itemindent-\leftmargin
\let\makelabel\descriptionlabel}}
{\endlist}
\newcommand*\descriptionlabel[1]{\hspace\labelsep #1}
\def\itemvdots{\item[] \mbox{\vdots}}
\def\parheader#1 {\medskip\noindent{\bf #1.}~~}
\newenvironment{grammar}
{\begingroup
\def\orbar{\hbox to 2em{\hfil}$\vert$\hbox to .75em{\hfil}}
\def\longis{ $\longrightarrow$\hbox to .75em{\hfil}}
\penalty-100\vskip 6pt plus 1pt\parindent=0pt\interlinepenalty=5000}
{\penalty-200\vskip6pt plus 1pt\endgroup}
\def\bar{$\vert$}
\def\ang#1{$\langle${\small\rm{}#1}$\rangle$}
\def\kstar{\raise.5ex\hbox{\scheme{*}}}
\def\kplus{\raise.5ex\hbox{\scheme{+}}}
% for fft example in examples.stex
\def\W#1{W_{\!\!#1}}
\def\fftcases#1{\left\{\,\vcenter{\m@th\baselineskip=18pt
\ialign{$##\hfil$&\quad##\hfil\crcr#1\crcr}}\right.}
%%% adapted from old tspl macros.tex
%%% argument #1 is the \label{anslab} inserted by tspl4-prep
\def\exercise#1{
\vskip 9pt plus 1pt minus 1pt\refstepcounter{exercise}\noindent
{\bf Exercise \arabic{chapter}.\arabic{section}.\arabic{exercise}.#1~}}
\newcounter{alphacount}
\def\alphalabel{\textit{\alph{alphacount}}.}
\newenvironment{alphalist}
{\begingroup\let\beforeschemedisplay=\relax\let\afterschemedisplay=\relax
\begin{list}{\alphalabel}{\usecounter{alphacount}\itemsep=0pt\parsep=0pt%
\topsep=0pt}}
{\end{list}\endgroup}
\newdimen\formdefwidth\formdefwidth=\textwidth\advance\formdefwidth by -2.5pt
\def\entryheader{\par\penalty-200\vskip15pt plus 6pt\noskipentryheader}
\def\noskipentryheader{\vbox\bgroup\parskip=0pt
\def\formdef##1##2{\par\begingroup\fboxsep=0pt\@@line{\colorbox{formdefcolor}{\hbox to \textwidth{\strut##2\hfil{\small\bf{##1}}}}\hss}\endgroup}
\def\returns{\par\noindent{\small\bf returns:} }
\def\libraries{\par\noindent{\small\bf libraries:} }}
\def\endnoskipentryheader\par{\egroup\nobreak\vskip6pt plus 1pt\relax}
\let\endentryheader=\endnoskipentryheader
\def\categorysyntax{syntax}
\def\categoryprocedure{procedure}
\def\categorythreadparameter{thread parameter}
\def\categoryglobalparameter{global parameter}
\def\categorymodule{module}
\def\categoryftype{ftype}
\newwrite\forms
\openout\forms=\jobname.rfm
% \formsummary{sort key}{type}{form}{label}
\def\formsummary{\begingroup\@sanitize\addsummary}
\def\addsummary#1#2#3#4{\endgroup
\edef\formhead{\write\forms}%
\edef\formentry{{"#1" \string\sfentry{#3}{#2}{\string\pageref{#4}}}}%
\expandafter\formhead\formentry}
\def\sfentry#1#2#3{\par
\hbox to \hsize{%
\hbox to 24pc{#1\ \hfil}%
\hbox to 5pc{#2\ \hfil}%
\hfil #3}}
\newenvironment{thesummary}
{\begingroup\schemesummarysize\small\bigskip
\sfentry{{\slshape Form}}{{\slshape Category}}{{\slshape Page}}
\kern3pt\hrule\kern3pt}
{\endgroup}
\newwrite\answers
\openout\answers=\jobname.ans
\def\answer{\begingroup\@sanitize\addanswer}
\long\def\addanswer#1#2{\endgroup
\edef\anshead{\write\answers}%
\edef\ansentry{{\string\ansentry{#1}{#2}}}%
\expandafter\anshead\ansentry}
\def\theanswers{\begingroup
\long\def\ansentry##1##2{\par\vskip 9pt plus 3pt minus 1pt\noindent\textbf{Exercise~\ref{##2}.~}(page~\pageref{##2})\par\nobreak\vspace{6pt}##1}
\immediate\closeout\answers
\input \jobname.ans
\endgroup}
%%% final set up
\newcommand{\contentsname}{Contents}
\newcommand{\bibname}{References}
\newcommand{\indexname}{Index}
\newcommand{\chaptername}{Chapter}
\newcommand{\today}{\ifcase\month\or
January\or February\or March\or April\or May\or June\or
July\or August\or September\or October\or November\or December\fi
\space\number\day, \number\year}
\setlength\columnsep{10\p@}
\setlength\columnseprule{0\p@}
\pagestyle{headings}
\pagenumbering{arabic}
\if@twoside\else\raggedbottom\fi
\endinput

191
csug/csug8.hcls Normal file
View file

@ -0,0 +1,191 @@
%%% csug8.hcls
%%% Based on tspl4.hcls
%%% Copyright (c) 1998 R, Kent Dybvig
%%%
%%% Permission is hereby granted, free of charge, to any person obtaining a
%%% copy of this software and associated documentation files (the "Software"),
%%% to deal in the Software without restriction, including without limitation
%%% the rights to use, copy, modify, merge, publish, distribute, sublicense,
%%% and/or sell copies of the Software, and to permit persons to whom the
%%% Software is furnished to do so, subject to the following conditions:
%%%
%%% The above copyright notice and this permission notice shall be included in
%%% all copies or substantial portions of the Software.
%%%
%%% THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
%%% IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
%%% FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
%%% THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
%%% LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
%%% FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
%%% DEALINGS IN THE SOFTWARE.
\newif\iflatex\latexfalse
\newif\ifhtml\htmltrue
\newif\ifdraft\draftfalse % define to prevent confusion in tspl.stex
%%% \frontmatter, \mainmatter, \backmatter
\newif\ifmainmatter \mainmattertrue
\newcommand{\frontmatter}{\mainmatterfalse}
\newcommand{\mainmatter}{\setcounter{chapter}{0}\mainmattertrue}
\newcommand{\backmatter}{\mainmatterfalse}
\newif\ifchapterpictures\chapterpicturestrue
% we \let\label=\nolable within toc entries to avoid inserting
% labels that belong with the labeled entity, not the toc
\def\nolabel#1{}
%%% \chapter
\newcounter{chapter}
\def\chpic#1#2{\raw{<img src="canned/#1">}\\\emph{#2}}
\newcommand{\chapter}[1]{
\endchapter
\begingroup\renewcommand{\label}[1]{}\openhtmlfile{#1}\endgroup
\ifmainmatter
\refstepcounter{chapter}
\edef\templabel{\genlab}\label{\templabel}
\ifchapterpictures
\input{hebert/new/ch\thechapter}
\fi
\raw{<h1>}Chapter \thechapter. #1\raw{</h1>}
\begin{divertoutput}[0]
\raw{<li>}\textbf{\hpageref[toc]{\templabel}{Chapter \thechapter. {\let\label=\nolabel #1}}}
\raw{<ul class=tocsection>}
\end{divertoutput}
\renewcommand{\endchapter}{\begin{divertoutput}[0]
\raw{</ul><p>}
\end{divertoutput}
\copyrightnotice
\closehtmlfile\renewcommand{\endchapter}{}}
\else
\edef\templabel{\genlab}\label{\templabel}
\raw{<h1>}#1\raw{</h1>}
\begin{divertoutput}[0]
\raw{<li>}\textbf{\hpageref[toc]{\templabel}{{\let\label=\nolabel #1}}}\raw{<p>}
\end{divertoutput}
\renewcommand{\endchapter}{\copyrightnotice
\closehtmlfile\renewcommand{\endchapter}{}}
\fi
}
\newcommand{\endchapter}{}
\newcommand{\copyrightnotice}{}
%%% \section
\newcounter{section}[chapter]
\renewcommand{\thesection}{\thechapter.\arabic{section}}
\newcommand{\section}[1]{
\raw{<h3>}\refstepcounter{section}\edef\templabel{\genlab}%
\label{\templabel}Section \thesection. #1\raw{</h3>}
\begin{divertoutput}[0]
\raw{<li>}\textbf{\hpageref[toc]{\templabel}{Section \thesection. {\let\label=\nolabel #1}}}
\end{divertoutput}
}
%%% \subsection
\newcounter{subsection}[section]
\renewcommand{\thesubsection}{\thesection.\arabic{subsection}}
\newcommand{\subsection}[1]{
\raw{<h4>}Subsection \refstepcounter{subsection}\thesubsection. #1\raw{</h4>}
}
%%% \exercise
\newcounter{exercise}[section]
\renewcommand{\theexercise}{\thesection.\arabic{exercise}}
\newcommand{\exercise}{
\raw{<h4>}Exercise \refstepcounter{exercise}\theexercise\raw{</h4>}
}
%%% alphalist
\newcounter{alphalist}
\def\alphalist{\begingroup\setcounter{alphalist}{0}
\def\endalphalistitem{}%
\renewcommand{\item}{\endalphalistitem
\def\endalphalistiem{\raw{</td></tr>}}%
\stepcounter{alphalist}%
\raw{<tr valign=top><td>}\textit{~~\alph{alphalist}}.\raw{</td><td>}}
\raw{<table>}}
\def\endalphalist{\endalphalistitem\raw{</table>}\endgroup}
%%% define our own (compact) description environment
\def\description{\begingroup
\renewcommand{\item}[1][]{\raw{<dt>}##1\raw{<dd>}}\raw{<dl compact>}}
\def\enddescription{\raw{</dl>}\endgroup}
%%% table of contents
% do \endchapter as a favor to \chapter
\newenvironment{contents}
{\raw{<h1>}Table of Contents\raw{</h1>}\raw{<ul class=tocchapter>}}
{\endchapter\raw{</ul>}}
%%% summary of forms
\def\sfentry#1#2#3{\raw{<tr><td nowrap>}#1\raw{</td>}%
\raw{<td>}#2\raw{</td>}%
\raw{<td align=right>}#3\raw{</td></tr>}}%
\newenvironment{thesummary}
{\raw{<table>}%
\raw{<tr><th align=left>Form</th><th align=left>Category</th>}%
\raw{<th align=right>Page</th></tr><tr><td colspan=3><hr></td></tr>}}
{\raw{</table>}}
%%% index
\newcommand{\see}[2]{\emph{see} #1}
\newenvironment{theindex}
{\begingroup\newcommand{\itemindent}{\raw{<tt>&nbsp;&nbsp;&nbsp;</tt>}}
\def\indexbreak{\def\indexbreak{\raw{<br>}}}
\renewcommand{\item}{\indexbreak}
\newcommand{\subitem}{\raw{<br>}\itemindent}
\newcommand{\subsubitem}{\raw{<br>}\itemindent\itemindent}}
{\par\endgroup}
%%% answers
\def\answer#1#2{}
\def\ansentry#1#2{\par\bigskip\noindent\textbf{Exercise~\ref{#2}.~}(page~\pageref{#2})\\ #1}
\def\theanswers{\begingroup
\ifhtml\begingroup\def\hardspaces{}\fi
\input{\jobname.ans}
\ifhtml\endgroup\fi
\endgroup}
%%%% TSPL/CSSM specific
\def\longcode{}
\def\noskip{}
\def\copyright{&copy;}
\def\itemvdots{\vdots}
\def\parheader#1 {\medskip\noindent{\bf #1.}~~}
%%% grammar support
\newenvironment{grammar}
{\begingroup
\def\orbar{\raw{</td><td align=center>|</td><td nowrap>}}
\def\longis{\raw{</td><td align=center>}$\longrightarrow$\raw{</td><td nowrap>}}
\def\\{\raw{</td></tr><tr><td nowrap>}}
\raw{<table><tr><td nowrap>}}
{\raw{</td></tr></table>}\endgroup}
\def\bar{\raw{|}}
\def\kplus{\raw{<sup>+</sup>}}
\def\kstar{\raw{*}}
\def\ang#1{\raw{&lt;}#1\raw{&gt;}}
\def\entryheader{\noskipentryheader}
\def\noskipentryheader{\def\entrybreak{\def\entrybreak{\raw{<br>}}}}
\def\endentryheader{\endnoskipentryheader}
\def\endnoskipentryheader{\par}
\def\formdef#1#2{\entrybreak\raw{<span class=formdef>}{\bf #1}: #2\raw{</span>}}
\def\formsummary#1#2#3#4{}
\def\returns{\\\textbf{returns: }}
\def\libraries{\\\textbf{libraries: }}
\def\categorysyntax{syntax}
\def\categoryprocedure{procedure}
\def\categorythreadparameter{thread parameter}
\def\categoryglobalparameter{global parameter}
\def\categorymodule{module}
\def\categoryftype{ftype}
%%% hyperlink support
\newcommand{\hyperlink}[3][]{\raw{<a #1 href=#2>}#3\raw{</a>}}

119
csug/csug810.clo Normal file
View file

@ -0,0 +1,119 @@
\ProvidesFile{tspl10.clo}[1995/06/18 v0.1]
\renewcommand{\normalsize}{%
\@setfontsize\normalsize\@xpt{12pt plus .5pt}%
\abovedisplayskip 6\p@ \@plus.6\p@
\abovedisplayshortskip \z@
\belowdisplayshortskip 3\p@ \@plus.3\p@
\belowdisplayskip \abovedisplayskip
\let\@listi\@listI}
\normalsize
\newcommand{\small}{%
\@setfontsize\small\@ixpt{11pt plus .5pt}%
\abovedisplayskip 5\p@ \@plus.5\p@ \@minus4\p@
\abovedisplayshortskip \z@
\belowdisplayshortskip 2.5\p@ \@plus.25\p@
\def\@listi{\leftmargin\leftmargini
\topsep 3\p@ \@plus.3\p@
\parsep 3\p@ \@plus.3\p@
\itemsep \z@}%
\belowdisplayskip \abovedisplayskip
}
\newcommand{\footnotesize}{%
\@setfontsize\footnotesize\@viiipt{9.5}%
\abovedisplayskip 6\p@ \@plus2\p@ \@minus4\p@
\abovedisplayshortskip \z@ \@plus\p@
\belowdisplayshortskip 3\p@ \@plus\p@ \@minus2\p@
\def\@listi{\leftmargin\leftmargini
\topsep 3\p@ \@plus.3\p@
\parsep 3\p@ \@plus.3\p@
\itemsep \z@}%
\belowdisplayskip \abovedisplayskip
}
\newcommand{\scriptsize}{\@setfontsize\scriptsize\@viipt\@viiipt}
\newcommand{\tiny}{\@setfontsize\tiny\@vpt\@vipt}
\newcommand{\large}{\@setfontsize\large\@xiipt{14}}
\newcommand{\Large}{\@setfontsize\Large\@xivpt{18}}
\newcommand{\LARGE}{\@setfontsize\LARGE\@xviipt{22}}
\newcommand{\huge}{\@setfontsize\huge\@xxpt{25}}
\newcommand{\Huge}{\@setfontsize\Huge\@xxvpt{30}}
\setlength\parindent{15\p@}
\setlength\headheight{12\p@}
\setlength\headsep {.25in}
\setlength\topskip {10\p@}
\setlength\footskip{.35in}
\setlength\maxdepth{.5\topskip}
\setlength\@maxdepth\maxdepth
\if@twoside % see notes on heights, widths, and margins in cls file
\setlength\oddsidemargin {\gutterwidth}
\addtolength\oddsidemargin {-1.0in} % default hoffset
\setlength\evensidemargin {\edgewidth}
\addtolength\evensidemargin {\trimwidth}
\addtolength\evensidemargin {-1.0in} % default hoffset
\setlength\textwidth {\paperwidth}
\addtolength\textwidth {-\trimwidth}
\addtolength\textwidth {-\gutterwidth}
\addtolength\textwidth {-\edgewidth}
\setlength\textheight {\paperheight}
\addtolength\textheight {-2\trimheight}
\addtolength\textheight {-2\edgewidth}
\else
\figurethisoutlaterifneeded
\fi
\ifdim \marginparwidth >2in
\setlength\marginparwidth{2in}
\fi
\@settopoint\oddsidemargin
\@settopoint\evensidemargin
\@settopoint\marginparwidth
\setlength\marginparsep{7\p@}
\setlength\marginparpush{5\p@}
\setlength\topmargin{\paperheight}
\addtolength\topmargin{-2in}
\addtolength\topmargin{-\headheight}
\addtolength\topmargin{-\headsep}
\addtolength\topmargin{-\textheight}
\addtolength\topmargin{-\footskip} % this might be wrong!
\addtolength\topmargin{-.5\topmargin}
\@settopoint\topmargin
\setlength\footnotesep{6.65\p@}
\setlength{\skip\footins}{9\p@ \@plus 4\p@ \@minus 2\p@}
\setlength\floatsep {12\p@ \@plus 2\p@ \@minus 2\p@}
\setlength\textfloatsep{20\p@ \@plus 2\p@ \@minus 4\p@}
\setlength\intextsep {12\p@ \@plus 2\p@ \@minus 2\p@}
\setlength\dblfloatsep {12\p@ \@plus 2\p@ \@minus 2\p@}
\setlength\dbltextfloatsep{20\p@ \@plus 2\p@ \@minus 4\p@}
\setlength\@fptop{0\p@ \@plus 1fil}
\setlength\@fpsep{8\p@ \@plus 2fil}
\setlength\@fpbot{0\p@ \@plus 1fil}
\setlength\@dblfptop{0\p@ \@plus 1fil}
\setlength\@dblfpsep{8\p@ \@plus 2fil}
\setlength\@dblfpbot{0\p@ \@plus 1fil}
\setlength\partopsep{2\p@ \@plus 1\p@ \@minus 1\p@}
\def\@listI{\leftmargin\leftmargini
\parsep 3\p@ \@plus.3\p@
\topsep 3\p@ \@plus.3\p@
\itemsep \z@}
\let\@listi\@listI
\@listi
\def\@listii {\leftmargin\leftmarginii
\labelwidth\leftmarginii
\advance\labelwidth-\labelsep
\topsep 3\p@ \@plus.3\p@
\parsep 3\p@ \@plus.3\p@
\itemsep \z@}
\def\@listiii{\leftmargin\leftmarginiii
\labelwidth\leftmarginiii
\advance\labelwidth-\labelsep
\topsep 2\p@ \@plus.2\p@
\parsep 2\p@ \@plus.2\p@
\itemsep \z@}
\def\@listiv {\leftmargin\leftmarginiv
\labelwidth\leftmarginiv
\advance\labelwidth-\labelsep}
\def\@listv {\leftmargin\leftmarginv
\labelwidth\leftmarginv
\advance\labelwidth-\labelsep}
\def\@listvi {\leftmargin\leftmarginvi
\labelwidth\leftmarginvi
\advance\labelwidth-\labelsep}
\endinput

1571
csug/debug.stex Normal file

File diff suppressed because it is too large Load diff

24
csug/docond.ss Normal file
View file

@ -0,0 +1,24 @@
(define docond-ht (make-eq-hashtable))
(hashtable-set! docond-ht '&condition '())
(define (docond expr)
(syntax-case expr (define-condition-type)
[(define-condition-type &name &parent make-name name?
(field-name field-accessor) ...)
(let ([pfields (hashtable-ref docond-ht #'&parent #f)])
(unless pfields (error 'docond "unrecognized parent ~s" #'&parent))
(printf "\\formdef{~s}{\\categorysyntax}{~s}\n" #'&name #'&name)
(let ([fields (append pfields #'(field-name ...))])
(printf "\\formdef{~s}{\\categoryprocedure}{(~s~{ \\var{~s}~})}\n"
#'make-name #'make-name fields)
(hashtable-set! docond-ht #'&name fields))
(printf "\\returns a condition of type \\scheme{~s}\n" #'&name)
(printf "\\formdef{~s}{\\categoryprocedure}{(~s \\var{obj})}\n" #'name? #'name?)
(printf "\\returns \\scheme{#t} if \\var{obj} is a condition of type \\scheme{~s}, \\scheme{#f} otherwise\n"
#'&name)
(for-each
(lambda (field get-field)
(printf "\\formdef{~s}{\\categoryprocedure}{(~s \\var{condition})}\n" get-field get-field)
(printf "\\returns the contents of \\var{condition}'s \\scheme{~s} field\n" field))
#'(field-name ...)
#'(field-accessor ...))
(printf "\\listlibraries\n"))]))

683
csug/expeditor.stex Normal file
View file

@ -0,0 +1,683 @@
% Copyright 2005-2017 Cisco Systems, Inc.
%
% Licensed under the Apache License, Version 2.0 (the "License");
% you may not use this file except in compliance with the License.
% You may obtain a copy of the License at
%
% http://www.apache.org/licenses/LICENSE-2.0
%
% Unless required by applicable law or agreed to in writing, software
% distributed under the License is distributed on an "AS IS" BASIS,
% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
% See the License for the specific language governing permissions and
% limitations under the License.
\chapter{Expression Editor\label{CHPTEXPEDITOR}}
When the expression editor (expeditor) is enabled as described in
Section~\ref{SECTUSEEXPEDITOR}, it allows the user to edit expressions
entered into the system and move backwards and forwards through
a history of entered expressions.
This chapter describes a set of parameters that may be used to
control various aspects of the expression editor's behavior
(Section~\ref{SECTEXPEDITORPARAMS}),
a procedure for binding key sequences to editing commands
(Section~\ref{SECTEXPEDITORKEYBINDING}),
the built-in editing commands
(Section~\ref{SECTEXPEDITOREDITCMDS}), and mechanisms for creating new
editing commands (Section~\ref{SECTEXPEDITORNEWCMDS}).
These mechanisms are available through the \scheme{expression-editor} module.
%----------------------------------------------------------------------------
\entryheader
\formdef{expression-editor}{\categorymodule}{expression-editor}
\listlibraries
\endentryheader
The \scheme{expression-editor} module exports a set of bindings for
parameters and other procedures that can be used to modify how the
expression editor interacts with the user, including the particular keys
used to invoke the various editing commands.
\medskip
Basic use of the expression editor is described in Section~\ref{SECTUSEEXPEDITOR}.
\xdef\cntl#1{\scheme{^#1}}
\section{Expression Editor Parameters\label{SECTEXPEDITORPARAMS}}
%----------------------------------------------------------------------------
\noskipentryheader
\formdef{ee-auto-indent}{\categoryglobalparameter}{ee-auto-indent}
\nolistlibraries
\endnoskipentryheader
The value of \scheme{ee-auto-indent} is a boolean value that determines
whether the expression editor indents expressions as they are entered.
Its default value is \scheme{#t}.
%----------------------------------------------------------------------------
\entryheader
\formdef{ee-standard-indent}{\categoryglobalparameter}{ee-standard-indent}
\nolistlibraries
\endentryheader
The value of \scheme{ee-standard-indent} is a nonnegative fixnum
value that determines the amount (in single spaces) by which each
expression is indented relative to the enclosing expression, if
not aligned otherwise by one of the indenter's other heuristics,
when \scheme{ee-auto-indent} is true or when one of the indentation
commands is invoked explicitly.
It's default value is \scheme{2}.
%----------------------------------------------------------------------------
\entryheader
\formdef{ee-auto-paren-balance}{\categoryglobalparameter}{ee-auto-paren-balance}
\nolistlibraries
\endentryheader
The value of \scheme{ee-auto-paren-balance} is a boolean value that determines
whether the expression editor automatically corrects a close
parenthesis or bracket, when typed, to match the corresponding open
parenthesis or bracket, if any.
Its default value is \scheme{#t}.
%----------------------------------------------------------------------------
\entryheader
\formdef{ee-flash-parens}{\categoryglobalparameter}{ee-flash-parens}
\nolistlibraries
\endentryheader
The value of \scheme{ee-flash-parens} is a boolean value that determines
whether the expression editor briefly moves the cursor when an open
or close parenthesis or bracket is typed to the
matching close or open parenthesis or bracket (if any).
Its default value is \scheme{#t}.
%----------------------------------------------------------------------------
\entryheader
\formdef{ee-paren-flash-delay}{\categoryglobalparameter}{ee-paren-flash-delay}
\nolistlibraries
\endentryheader
The value of \scheme{ee-paren-flash-delay} is a nonnegative fixnum
value that determines the amount of time (in milliseconds) that the
expression editor pauses when the cursor is moved to the matching
parenthesis or bracket, if any, when a parenthesis or bracket is
entered.
The value is ignored if the \scheme{ee-flash-parens} is false.
Its default value is \scheme{100}.
%----------------------------------------------------------------------------
\entryheader
\formdef{ee-default-repeat}{\categoryglobalparameter}{ee-default-repeat}
\nolistlibraries
\endentryheader
The value of \scheme{ee-default-repeat} is a nonnegative fixnum
value that determines the number of times the next command is
repeated after the \scheme{ee-command-repeat} editing command
(bound to \scheme{Esc-^U} by default) is used and \emph{not}
followed by a sequence of digits.
It's default value is \scheme{4}.
%----------------------------------------------------------------------------
\entryheader
\formdef{ee-noisy}{\categoryglobalparameter}{ee-noisy}
\nolistlibraries
\endentryheader
The value of \scheme{ee-noisy} is a boolean value that determines
whether the expression editor emits a beep (bell) when an error
occurs, such as an attempt to find the matching delimiter for a
non-delimiter character.
Its default value is \scheme{#f}.
%----------------------------------------------------------------------------
\entryheader
\formdef{ee-history-limit}{\categoryglobalparameter}{ee-history-limit}
\nolistlibraries
\endentryheader
The value of \scheme{ee-history-limit} is a nonnegative fixnum value
that determines the number of history entries retained by the
expression editor during and across sessions.
Only the last \scheme{(ee-history-limit)} entries are retained.
% Its default value is \scheme{100}.
%----------------------------------------------------------------------------
\entryheader
\formdef{ee-common-identifiers}{\categoryglobalparameter}{ee-common-identifiers}
\nolistlibraries
\endentryheader
The value of \scheme{ee-common-identifiers} is list of symbols that
are considered common enough that they should appear early when
one of the incremental identifier-completion editing commands is
invoked.
Its default value contains a few dozen entries.
They are all more than a few characters long (under the theory that
users will most likely type short ones out fully) and all would
appear later than they likely should when incremental
identifier-completion is used.
\section{Key Binding\label{SECTEXPEDITORKEYBINDING}}
Key bindings are established via \scheme{ee-bind-key}.
The default key bindings are described in Section~\ref{SECTEXPEDITOREDITCMDS}.
%----------------------------------------------------------------------------
\entryheader
\formdef{ee-bind-key}{\categoryprocedure}{(ee-bind-key \var{key} \var{procedure})}
\nolistlibraries
\returns unspecified
\endentryheader
The \scheme{ee-bind-key} procedure is used to add to or change the
set of key bindings recognized by the expression editor.
The \var{key} must be a character or string; if it is a string, it
must have the following form.
\begin{grammar}
\ang{key-string}\longis \scheme{"}\ang{key-char}\kplus\scheme{"}
\end{grammar}
where
\begin{grammar}
\ang{key-char}\longis \scheme{\\e} (specifying an escape character)\\
\orbar \scheme{^\var{x}} (specifying control-\var{x})\\
\orbar \scheme{\\^} (specifying caret)\\
\orbar \scheme{\\\\} (specifying back slash)\\
\orbar \scheme{plain char} (any character other than \scheme{\} or \scheme{^})
\end{grammar}
Note that each double-backslash in the syntax actually denotes just
one backslash in the string.
For example, the \var{key} \scheme{"\\eX"} represents the two-character
sequence Escape-x, i.e., the ``escape'' key followed by the (capital)
``X'' key.
Similarly, they \var{key} \scheme{"\\e^X"} represents the two-character
sequence Escape-Control-x, i.e., the ``escape'' key followed by
Control-X.
Character keys and string keys consisting of a single plain character
always represent a single keystroke.
The \var{procedure} argument should normally be one of the built-in editing
commands described below.
It is also possible to define new editing commands with
\index{\scheme{ee-string-macro}}\scheme{ee-string-macro}
and \index{\scheme{ee-compose}}\scheme{ee-compose}.
\section{Editing Commands\label{SECTEXPEDITOREDITCMDS}}
\xdef\editproc#1#2{\medskip {\bf command:} \index{\scheme{#1}}\scheme{#1}\\
{\bf key(s):} #2\par{}}
\xdef\endeditproc{\par{}}
\def\ECgroup#1 {\medskip\noindent{\bf #1}\par}
The editing commands are grouped into sections according to usage.
Each is listed along with the default character sequence or sequences by
which it may be invoked.
\ECgroup{Insertion commands}
\editproc{ee-insert-self}{most printing characters}
Inserts the entered character into the entry.
\endeditproc
\editproc{ee-insert-paren}{\scheme{(}, \scheme{)}, \scheme{[}, \scheme{]}}
Inserts the entered parenthesis or bracket into the entry.
If the parameter
\index{\scheme{ee-auto-paren-balance}}\scheme{ee-auto-paren-balance} is
true, the editor corrects close delimiters if necessary to balance
existing open delimiters, when a matching open delimiter can be found.
If the parameter \index{\scheme{ee-flash-parens}}\scheme{ee-flash-parens}
is true, the editor briefly moves the cursor to the matching delimiter, if
one can be found, pausing for an amount of time controlled by the
parameter \index{\scheme{ee-paren-flash-delay}}\scheme{ee-paren-flash-delay}.
If the matching delimiter is not presently displayed, the cursor is flashed
to the upper-left or lower-left corner of the displayed portion of the
entry, as appropriate.
The behavior of this command is undefined if used for something other
than a parenthesis or bracket.
\endeditproc
\editproc{ee-newline}{none}
Inserts a newline at the cursor position, moves to the next line, and
indents that line if the parameter
\index{\scheme{ee-auto-indent}}\scheme{ee-auto-indent} is true.
Does nothing if the entry is empty.
See also \scheme{ee-newline/accept}.
\endeditproc
\editproc{ee-open-line}{\cntl{O}}
Inserts a newline at the cursor position and indents the next line,
but does not move to the next line.
\endeditproc
\editproc{ee-yank-kill-buffer}{\cntl{Y}}
Inserts the contents of the kill buffer, which is set by the deletion
commands described below.
\endeditproc
\editproc{ee-yank-selection}{\cntl{V}}
Inserts the contents of the window system's current selection or paste
buffer.
When running in a shell window under X Windows, this command requires that
the DISPLAY environment variable be set to the appropriate display.
\endeditproc
% The following is no longer true, since auto-indent is disabled when
% the characters are coming fast enough that they are likely happening
% as the result of a paste operation.
%
% While it may be possible to insert the contents of the current selection
% or paste buffer via some other means, e.g., via the mouse or some
% OS-specific key combination, this command is preferable whenever the
% parameter \index{\scheme{ee-auto-indent}}\scheme{ee-auto-indent} is true
% for multi-line input that is already indented.
\ECgroup{Cursor movement commands}
\editproc{ee-backward-char}{leftarrow, \cntl{B}}
Moves the cursor left one character.
\endeditproc
\editproc{ee-forward-char}{rightarrow, \cntl{F}}
Moves the cursor right one character.
\endeditproc
\editproc{ee-next-line}{downarrow, \cntl{N}}
Moves the cursor down one line (and to the left if necessary so that
the cursor does not sit beyond the last possible position).
If the cursor is at the end of the current entry, and the current
entry has not been modified, this command behaves like
\index{\scheme{ee-history-fwd}}\scheme{ee-history-fwd}.
\endeditproc
\editproc{ee-previous-line}{uparrow, \cntl{P}}
Moves the cursor up one line (and to the left if necessary so that
the cursor does not sit beyond the last possible position).
If the cursor is at the top of the current entry, and the current
entry has not been modified, this command behaves like
\index{\scheme{ee-history-bwd}}\scheme{ee-history-bwd}.
\endeditproc
\editproc{ee-beginning-of-line}{home, \cntl{A}}
Moves the cursor to the first character of the current line.
\endeditproc
\editproc{ee-end-of-line}{end, \cntl{E}}
Moves the cursor to the right of the last character of the current line.
\endeditproc
\editproc{ee-beginning-of-entry}{escape-\scheme{<}}
Moves the cursor to the first character of the entry.
\endeditproc
\editproc{ee-end-of-entry}{escape-\scheme{>}}
Moves the cursor to the right of the last character of the entry.
\endeditproc
\editproc{ee-goto-matching-delimiter}{escape-\scheme{]}}
Moves the cursor to the matching delimiter.
Has no effect if the character under the cursor is not a parenthesis
or bracket or if no matching delimiter can be found.
\endeditproc
\editproc{ee-flash-matching-delimiter}{\cntl{]}}
Moves the cursor briefly to the matching delimiter, if
one can be found, pausing for an amount of time controlled by the
parameter \index{\scheme{ee-paren-flash-delay}}\scheme{ee-paren-flash-delay}.
If the matching delimiter is not presently displayed, the cursor is flashed
to the upper-left or lower-left corner of the displayed portion of the
entry, as appropriate.
\endeditproc
\editproc{ee-exchange-point-and-mark}{\cntl{X}-\cntl{X}}
Moves the cursor to the mark and leaves the mark at the old cursor
position.
(The mark can be set with \scheme{ee-set-mark}.)
\endeditproc
\editproc{ee-forward-sexp}{escape-\cntl{F}}
Moves the cursor to the start of the next expression.
\endeditproc
\editproc{ee-backward-sexp}{escape-\cntl{B}}
Moves the cursor to the start of the preceding expression.
\endeditproc
\editproc{ee-forward-word}{escape-f, escape-\scheme{F}}
Moves the cursor to the end of the next word.
\endeditproc
\editproc{ee-backward-word}{escape-b, escape-\scheme{B}}
Moves the cursor to the start of the preceding word.
\endeditproc
\editproc{ee-forward-page}{pagedown, \cntl{X}-\scheme{]}}
Moves the cursor down one screen page.
\endeditproc
\editproc{ee-backward-page}{pageup, \cntl{X}-\scheme{[}}
Moves the cursor up one screen page.
\endeditproc
\ECgroup{Deletion commands}
\editproc{ee-delete-char}{delete}
Deletes the character under the cursor.
See also \scheme{ee-eof/delete-char}.
\endeditproc
\editproc{ee-backward-delete-char}{backspace (rubout), \cntl{H}}
Deletes the character to the left of the cursor.
\endeditproc
\editproc{ee-delete-line}{\cntl{U}}
Deletes the contents of the current line, leaving behind an empty line.
When used on the first line of a multiline entry of which only the first line
is displayed, i.e., immediately after history movement, \scheme{ee-delete-line}
deletes the contents of the entire entry, like \scheme{ee-delete-entry}
(described below).
\endeditproc
\editproc{ee-delete-to-eol}{\cntl{K}, escape-\scheme{K}}
If the cursor is at the end of a line, joins the line with the next
line, otherwise deletes from the cursor position to the end of the line.
\endeditproc
\editproc{ee-delete-between-point-and-mark}{\cntl{W}}
Deletes text between the current cursor position and the mark.
(The mark can be set with \scheme{ee-set-mark}.)
\endeditproc
\editproc{ee-delete-entry}{\cntl{G}}
Deletes the contents of the current entry.
\endeditproc
\editproc{ee-reset-entry}{\cntl{C}}
Deletes the contents of the current entry and moves to the end of the
history.
\endeditproc
\editproc{ee-delete-sexp}{escape-\cntl{K}, escape-delete}
Deletes the expression that starts under the cursor, or if
no expression starts under the cursor, deletes up to the next
expression.
\endeditproc
\editproc{ee-backward-delete-sexp}{escape-backspace (escape-rubout), escape-\cntl{H}}
Deletes the expression to the left of the cursor.
\endeditproc
\ECgroup{Identifier/filename completion commands}
These commands perform either identifier or filename completion.
Identifier completion is performed outside of a string constant, and filename
completion is performed within a string constant.
(In determining whether the cursor is within a string constant, the
expression editor looks only at the current line and so can be fooled
by string constants that span multiple lines.)
\editproc{ee-id-completion}{none}
Inserts the common prefix of possible completions of the identifier or
filename immediately to the left of the cursor.
Identifier completion is based on the identifiers
defined in the interaction environment.
When there is exactly one possible completion, the common prefix is the
completion.
This command has no effect if no filename or identifier prefix is
immediately the left of the cursor or if the possible completions have
no common prefix.
If run twice in succession, a list of possible completions is displayed.
See also
\index{\scheme{ee-id-completion/indent}}\scheme{ee-id-completion/indent}.
\endeditproc
\editproc{ee-next-id-completion}{\cntl{R}}
Inserts one of the possible completions of the identifier or filename
immediately to the left of the cursor.
Identifier completion is based on the identifiers
defined in the interaction environment.
If run twice or more in succession, this command cycles through all of
the possible completions.
The order is determined by the following heuristics: appearing first
are identifiers whose names appear in the list value of the parameter
\index{\scheme{ee-common-identifiers}}\scheme{ee-common-identifiers};
appearing second are identifiers bound in the interaction environment
but not bound in the scheme-environment (i.e., identifiers defined by
the user), and appearing last are those in the scheme environment.
Within the set of matches appearing in the \scheme{ee-common-identifiers}
list, those listed earliest are shown first; the order is alphabetical
within the other two sets.
See also
\index{\scheme{ee-next-id-completion/indent}}\scheme{ee-next-id-completion/indent}.
\endeditproc
\ECgroup{History movement commands}
\index{\scheme{--eehistory} command-line-option}%
The expression editor maintains a history of entries during each session.
It also saves the history across sessions unless this behavior is
disabled via the command-line argument ``\scheme{--eehistory off}.''
When moving from one history entry to another, only the first line of each
multi-line entry is displayed.
The redisplay command (which \cntl{L} is bound to by default) can be used
to display the entire entry.
It is also possible to move down one line at a time to expose just part of
the rest of the entry.
\editproc{ee-history-bwd}{escape-uparrow, escape-\cntl{P}}
Moves to the preceding history entry
if the current entry is empty or has not been modified;
otherwise, has no effect.
See also \scheme{ee-previous-line}.
\endeditproc
\editproc{ee-history-fwd}{escape-downarrow, escape-\cntl{N}}
Moves to the next history entry
if the current entry is empty or has not been modified;
otherwise, has no effect.
See also \scheme{ee-next-line}.
\endeditproc
\editproc{ee-history-bwd-prefix}{escape-\scheme{p}}
Moves to the closest previous history entry, if any, that starts with
the sequence of characters that makes up the current entry.
May be used multiple times to search for same prefix.
\endeditproc
\editproc{ee-history-fwd-prefix}{escape-\scheme{n}}
Moves to the closest following history entry, if any, that starts with
the sequence of characters that makes up the current entry.
May be used multiple times to search for same prefix.
\endeditproc
\editproc{ee-history-bwd-contains}{escape-\scheme{P}}
Moves to the closest previous history entry, if any, that contains within
it the sequence of characters that makes up the current entry.
May be used multiple times to search for same content.
\endeditproc
\editproc{ee-history-fwd-contains}{escape-\scheme{N}}
Moves to the closest following history entry, if any, that contains within
it the sequence of characters that makes up the current entry.
May be used multiple times to search for same content.
\endeditproc
\ECgroup{Indentation commands}
\editproc{ee-indent}{escape-tab}
Re-indents the current line.
See also \scheme{ee-next-id-completion/indent}.
\endeditproc
\editproc{ee-indent-all}{escape-\scheme{q}, escape-\scheme{Q}, escape-\cntl{Q}}
Re-indents each line of the entire entry.
\endeditproc
\ECgroup{Miscellaneous commands}
\editproc{ee-accept}{\cntl{J}}
Causes the expression editor to invoke the Scheme reader on the contents
of the entry.
If the read is successful, the expression is returned to the waiter;
otherwise, an error message is printed, the entry redisplayed, and the
cursor left (if possible) at the start of the invalid subform.
See also \scheme{ee-newline/accept}.
\endeditproc
\editproc{ee-eof}{none}
Causes end-of-file to be returned from the expression editor,
which in turn causes the waiter to exit.
Ignored unless entry is empty.
See also \scheme{ee-eof/delete-char}.
\endeditproc
\editproc{ee-redisplay}{\cntl{L}}
Redisplays the current expression.
If run twice in succession, clears the screen and redisplays the
expression at the top of the screen.
\endeditproc
\editproc{ee-suspend-process}{\cntl{Z}}
Suspends the current process in shells that support job control.
\endeditproc
\editproc{ee-set-mark}{\cntl{@}, \cntl{}space}
Sets the mark to the current cursor position.
\endeditproc
\editproc{ee-command-repeat}{escape-\cntl{U}}
Repeats the next command $n$ times.
If the next character typed is a digit, $n$ is determined by reading
up the sequence of the digits typed and treating it as a decimal
number.
Otherwise, $n$ is the value of the parameter
\index{\scheme{ee-default-repeat}}\scheme{ee-default-repeat}.
\endeditproc
\ECgroup{Combination commands}
\editproc{ee-newline/accept}{enter, \cntl{M}}
Behaves like \scheme{ee-accept} if run at the end (not including
whitespace) of an entry that starts with a balanced expression;
otherwise, behaves like \scheme{ee-newline}.
\endeditproc
\editproc{ee-id-completion/indent}{tab}
Behaves like \scheme{ee-id-completion} if an identifier (outside
a string constant) or filename (within a string constant) appears
just to the left of the cursor and the last character of that
identifier or filename was just entered;
otherwise, behaves like \scheme{ee-indent}.
If an existing identifier or filename, i.e., not one just typed, appears to the left
of the cursor, the first use of this command behaves like
\scheme{ee-newline}, the second consecutive use behaves like
\scheme{ee-id-completion}, and the third behaves like a second consecutive
use of \scheme{ee-id-completion}.
\endeditproc
\editproc{ee-next-id-completion/indent}{none}
Behaves like \scheme{ee-next-id-completion} if an identifier (outside
a string constant) or filename (within a string constant)
appears just to the left of the cursor and the last character of that
identifier or identifier was just entered;
otherwise, behaves like \scheme{ee-indent}.
\endeditproc
\editproc{ee-eof/delete-char}{\cntl{D}}
Behaves like \scheme{ee-delete-char} if the entry is nonempty;
otherwise, behaves like \scheme{ee-eof}.
If the entry is nonempty and this command is run twice or more in
succession, it does nothing once the entry becomes empty.
This is to prevent accidental exit from the waiter in cases where
the command is run repeatedly (perhaps with the help of a keyboard's
auto-repeat feature) to delete all of the characters in an entry.
\endeditproc
\section{Creating New Editing Commands\label{SECTEXPEDITORNEWCMDS}}
%----------------------------------------------------------------------------
\noskipentryheader
\formdef{ee-string-macro}{\categoryprocedure}{(ee-string-macro \var{string})}
\nolistlibraries
\returns a new editing command
\endnoskipentryheader
The new editing command produced inserts \var{string} before the current
cursor position.
Two string macros are predefined:
\begin{tabular}{ll}
\scheme{(ee-string-macro "(define ")} & ~~escape-d\\
\scheme{(ee-string-macro "(lambda ")} & ~~escape-l
\end{tabular}
%----------------------------------------------------------------------------
\entryheader
\formdef{ee-compose}{\categoryprocedure}{(ee-compose \var{ecmd} \dots)}
\nolistlibraries
\returns a new editing command
\endentryheader
Each \var{ecmd} must be an editing command.
The new editing command runs each of the editing commands
\scheme{\var{ecmd} \dots} in sequence.
% this is of limited utility until we provide some
% inspection procedures, like point-pos and end-of-line?
For example, the following expression binds \cntl{X}-p to an editing
command that behaves like \scheme{ee-history-bwd-prefix} but leaves the
cursor at the end of the expression rather than at the end of the first
line, causing the entire entry to be displayed.
\schemedisplay
(let ()
(import expression-editor)
(ee-bind-key "^Xp"
(ee-compose ee-history-bwd ee-end-of-entry)))
\endschemedisplay
A command such as \scheme{ee-id-completion} that performs a different
action when run twice in succession will not recognize that it has been
run twice in succession if run as part of a composite command.

3873
csug/foreign.stex Normal file

File diff suppressed because it is too large Load diff

63
csug/gifs/Makefile Normal file
View file

@ -0,0 +1,63 @@
gifs = ghostRightarrow.gif
# ch1.gif ch2.gif ch3.gif ch4.gif ch5.gif ch6.gif ch7.gif ch8.gif ch9.gif\
# ch10.gif ch11.gif ch12.gif
density=-r90x90
.SUFFIXES:
.SUFFIXES: .tex .gif .eps
# translate ps file to ppm, crop to minimum background, and translate ppm
# to gif with white (background) transparent
#
.tex.gif:
echo | latex $* &&\
dvips -f < $*.dvi |\
gs -q -dNOPAUSE -dSAFER -sDEVICE=ppmraw -sOutputFile=-\
${density} - |\
pnmcrop |\
ppmtogif -transparent white > $*.gif
rm -f $*.dvi $*.log *.aux
test -f $*.gif && chmod 644 $*.gif
# translate ps file to gif w/o transparent white background
.eps.gif:
cat $*.eps |\
gs -q -dNOPAUSE -dSAFER -sDEVICE=ppmraw -sOutputFile=-\
${density} - |\
pnmcrop |\
ppmtogif > $*.gif
rm -f $*.dvi $*.log *.aux
test -f $*.gif && chmod 644 $*.gif
all: ${gifs}
# make ghostRightarrow.gif a completely transparent version of Rightarrow.ps
#
# translate ps to gif as above but w/o making white transparent, map black
# to white, convert to ppm, and convert back to gif with white transparent
#
# could skip intermediate conversion to gif if we could map black to white
# with some ppm tool
#
# it seems like should be able to replace last three steps with
# giftrans -g '#000000=#ffffff' -t '#ffffff'
# or at least
# giftrans -g '#000000=#ffffff' | giftrans -t '#ffffff'
# but giftrans changes only the first white color it sees, not all
#
ghostRightarrow.gif: Rightarrow.tex
echo | latex Rightarrow &&\
dvips -f < Rightarrow.dvi |\
gs -q -dNOPAUSE -dSAFER -sDEVICE=ppmraw -sOutputFile=-\
${density} - |\
pnmcrop |\
ppmtogif |\
giftrans -g '#000000=#ffffff' |\
giftopnm |\
ppmtogif -transparent white > $*.gif
rm -f Rightarrow.dvi Rightarrow.log Rightarrow.aux
test -f $*.gif && chmod 644 $*.gif
clean: ; rm -f *.gif Make.out

5
csug/gifs/Rightarrow.tex Normal file
View file

@ -0,0 +1,5 @@
\documentclass[12pt]{article}
\begin{document}
\pagestyle{empty}
$\Rightarrow$
\end{document}

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 B

433
csug/intro.stex Normal file
View file

@ -0,0 +1,433 @@
% Copyright 2005-2017 Cisco Systems, Inc.
%
% Licensed under the Apache License, Version 2.0 (the "License");
% you may not use this file except in compliance with the License.
% You may obtain a copy of the License at
%
% http://www.apache.org/licenses/LICENSE-2.0
%
% Unless required by applicable law or agreed to in writing, software
% distributed under the License is distributed on an "AS IS" BASIS,
% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
% See the License for the specific language governing permissions and
% limitations under the License.
\chapter{Introduction}
This book describes {\ChezScheme} extensions to the Revised$^6$
Report on Scheme~\cite{r6rs} (R6RS).
It contains as well a concise summary of standard and {\ChezScheme} forms
and procedures, which gives the syntax of each form and the number and
types of arguments accepted by each procedure.
Details on standard R6RS features can be found in
\index{The Scheme Programming Language, 4th Edition@\emph{The Scheme Programming Language, 4th Edition}}\hyperlink{http://www.scheme.com/tspl4/}{\emph{The
Scheme Programming Language, 4th Edition}} (TSPL4)~\cite{Dybvig:tspl4} or
the Revised$^6$ Report on Scheme.
\emph{The Scheme Programming Language, 4th Edition} also contains an
extensive introduction to the Scheme language and numerous short and
extended examples.
Most of this document also applies equally to \index{PetiteChezScheme@\PetiteChezScheme}{\PetiteChezScheme},
which is fully compatible with the complete {\ChezScheme} system but uses
a high-speed interpreter in place of {\ChezScheme}'s
incremental native-code compiler.
Programs written for {\ChezScheme} run unchanged in
{\PetiteChezScheme} as long as they do not require the
compiler to be invoked.
In fact, {\PetiteChezScheme} is built from the same sources as
{\ChezScheme}, with all but the compiler sources included.
A detailed discussion of the impact of this distinction appears in
Section~\ref{SECTUSEAPPLICATIONS}.
The remainder of this chapter covers
{\ChezScheme} extensions to Scheme syntax (Section~\ref{SECTINTROSYNTAX}),
notational conventions used in this book (Section~\ref{SECTINTRONOTATION}),
the use of parameters for system customization (Section~\ref{SECTINTROPARAMETERS}),
and where to look for more information on
{\ChezScheme} (Section~\ref{SECTINTROMOREINFO}).
Chapter~\ref{CHPTUSE} describes how one uses {\ChezScheme}
for program development, scripting, and application delivery, plus
how to get the compiler to generate the most efficient code
possible.
Chapter~\ref{CHPTDEBUG} describes debugging and object inspection
facilities.
Chapter~\ref{CHPTFOREIGN} documents facilities for interacting with
separate processes or code written in other languages.
Chapter~\ref{CHPTBINDING} describes binding forms.
Chapter~\ref{CHPTCONTROL} documents control structures.
Chapter~\ref{CHPTOBJECTS} documents operations on nonnumeric objects,
while Chapter~\ref{CHPTNUMERIC} documents various numeric operations,
including efficient type-specific operations.
Chapter~\ref{CHPTIO} describes input/output operations and
generic ports, which allow the definition of ports with arbitrary
input/output semantics.
Chapter~\ref{CHPTLIBRARIES} discusses how R6RS libraries and top-level
programs are loaded into {\ChezScheme} along with various features for
controlling and tracking the loading process.
Chapter~\ref{CHPTSYNTAX} describes syntactic extension and modules.
Chapter~\ref{CHPTSYSTEM} describes system operations, such as operations
for interacting with the operating system and customizing
{\ChezScheme}'s user interface.
Chapter~\ref{CHPTSMGMT} describes how to invoke and control the storage
management system and documents guardians and weak pairs.
Chapter~\ref{CHPTEXPEDITOR} describes {\ChezScheme}'s expression
editor and how it can be customized.
Chapter~\ref{CHPTTHREADS} documents the procedures and syntactic forms
that comprise the interface to {\ChezScheme}'s native thread system.
Finally, Chapter~\ref{CHPTCOMPAT} describes various compatibility features.
The back of this book contains a bibliography,
the summary of forms, and an index.
The page numbers appearing in the summary of forms and
the italicized page numbers appearing in the index indicate the
locations in the text where forms and procedures are formally defined.
The summary of forms and index includes entries from TSPL4, so that
they cover the entire set of {\ChezScheme} features.
A TSPL4 entry is marked by a ``t'' prefix on the page number.
Online versions and errata for this book and for TSPL4 can be found at
\hyperlink{http://www.scheme.com}{www.scheme.com}.
% Printed versions of this book may be obtained from
% \hyperlink{http://www.lulu.com/product/paperback/chez-scheme-version-9-users-guide/6516800}{www.lulu.com}.
\bigskip\noindent
\emph{Acknowledgments:}
Michael Adams, Mike Ashley, Carl Bruggeman, Bob Burger, Sam
Daniel, George Davidson, Matthew Flatt, Aziz Ghuloum, Bob Hieb, Andy Keep, and Oscar Waddell have
contributed substantially to the development of {\ChezScheme}.
{\ChezScheme}'s expression editor is based on a command-line editor for
Scheme developed from 1989 through 1994 by C.~David Boyer.
File compression is performed with the use of the lz4 compression
library developed by Yann Collet or the zlib compression library
developed by Jean-loup Gailly and Mark Adler.
Implementations of the list and vector sorting routines are based on
Olin Shiver's opportunistic merge-sort algorithm and implementation.
Michael Lenaghan provided a number of corrections for earlier drafts
of this book.
Many of the features documented in this book were suggested by
current {\ChezScheme} users, and numerous comments from users have also
led to improvements in the text.
Additional suggestions for improvements to {\ChezScheme} and to this
book are welcome.
\section{Chez Scheme Syntax\label{SECTINTROSYNTAX}}
{\ChezScheme} extends Scheme's syntax both at the object (datum) level
and at the level of syntactic forms.
At the object level, {\ChezScheme} supports additional representations for
symbols that contain nonstandard characters,
nondecimal numbers expressed in floating-point
and scientific notation, vectors with explicit lengths,
shared and cyclic structures, records, boxes, and more.
These extensions are described below.
Form-level extensions are described throughout the book and summarized
in the Summary of Forms, which also appears in the back of this book.
{\ChezScheme} extends the syntax of identifiers in several ways.
First, the sequence of characters making up an identifier's name may
start with digits, periods, plus signs, and minus
signs as long as the sequence cannot be parsed as a number.
For example, \scheme{0abc}, \scheme{+++}, and \scheme{..} are all
valid identifiers in {\ChezScheme}.
Second, the single-character sequences \scheme{\schlbrace} and
\scheme{\schrbrace} are identifiers.
Third, identifiers containing arbitrary characters may be printed by
escaping them with \scheme{\} or with \scheme{|}.
\scheme{\} is used to escape a single character (except 'x', since
\scheme{\x} marks the start of a hex scalar value),
whereas \scheme{|} is used
to escape the group of characters that follow it up through the
matching \scheme{|}.
For example, \scheme{\||\|} is an identifier with a two-character
name consisting of the character \scheme{|} followed by the
character \scheme{\}, and \scheme{|hit me!|} is an identifier whose name
contains a space.
In addition, gensyms (page~\ref{desc:gensym}) are printed with
\index{\scheme{#\schlbrace} (gensym prefix)}\scheme{#\schlbrace} and
\scheme{\schrbrace} brackets that enclose both the ``pretty'' and ``unique''
names, e.g., \scheme{#\schlbrace\raw{{}}g1426 e5g1c94g642dssw-a\schrbrace}.
They may also be printed using the pretty name only with the prefix
\index{\scheme{#:} (gensym prefix)}\scheme{#:}, e.g.,
\scheme{#:g1426}.
Arbitrary radixes from two through 36 may be specified with the prefix
\index{#r (radix prefix)@\scheme{#\var{n}r} (radix prefix)}\scheme{#\var{n}r},
where \var{n} is the radix.
Case is not significant, so \scheme{#\var{n}R} may be used as well.
Digit values from 10 through 35 are specified as either lower- or upper-case
alphabetic characters, just as for hexadecimal numbers.
For example, \scheme{#36rZZ} is $35\times36+35$, or $1295$.
{\ChezScheme} also permits nondecimal numbers
to be printed in floating-point or scientific notation.
For example, \scheme{#o1.4} is equivalent to \scheme{1.5}, and
\scheme{#b1e10} is equivalent to \scheme{4.0}.
Digits take precedence over exponent specifiers, so that
\scheme{#x1e20} is simply the four-digit hexadecimal number equivalent
to \scheme{7712}.
In addition to the standard named characters
\index{\scheme{#\alarm}}\scheme{#\alarm},
\index{\scheme{#\backspace}}\scheme{#\backspace},
\index{\scheme{#\delete}}\scheme{#\delete},
\index{\scheme{#\esc}}\scheme{#\esc},
\index{\scheme{#\linefeed}}\scheme{#\linefeed},
\index{\scheme{#\newline}}\scheme{#\newline},
\index{\scheme{#\page}}\scheme{#\page},
\index{\scheme{#\return}}\scheme{#\return},
\index{\scheme{#\space}}\scheme{#\space},
and
\index{\scheme{#\tab}}\scheme{#\tab},
{\ChezScheme} recognizes
\index{\scheme{#\bel}}\scheme{#\bel},
\index{\scheme{#\ls}}\scheme{#\ls},
\index{\scheme{#\nel}}\scheme{#\nel},
\index{\scheme{#\nul}}\scheme{#\nul},
\index{\scheme{#\rubout}}\scheme{#\rubout},
and
\index{\scheme{#\vt}}\scheme{#\vt} (or \scheme{#\vtab}).
Characters whose scalar values are less than 256 may also be printed with
an octal syntax consisting of the prefix \scheme{#\} followed by a three
octal-digit sequence.
For example, \scheme{#\000} is equivalent to \scheme{#\nul}.
{\ChezScheme}'s fxvectors, or fixnum vectors, are printed like vectors
but with the prefix \scheme{#vfx(} in place of \scheme{#(}.
Vectors, bytevectors, and fxvectors may be printed with an explicit length
prefix, and when the explicit length prefix is specified, duplicate
trailing elements may be omitted.
For example,
\index{\scheme{#(} (vector prefix)}\scheme{#(a b c)} may be printed as
\index{#( (vector prefix)@\scheme{#\var{n}(} (vector prefix)}\scheme{#3(a b c)},
and a vector of length 100 containing all zeros may be printed as
\scheme{#100(0)}.
{\ChezScheme}'s boxes are printed with a
\index{\scheme{#&} (box prefix)}\scheme{#&} prefix, e.g.,
\scheme{#&17} is a box containing the integer \scheme{17}.
Records are printed with the syntax
\index{\scheme{#[} (record prefix)}\scheme{#[\var{type-name} \var{field} \dots]},
where the symbol \var{type-name} is the name of the record
type and \scheme{\var{field} \dots} are the printed
representations for the contents of the fields of the record.
Shared and cyclic structure may be printed using the graph mark and
reference prefixes
\index{#= (graph mark)@\scheme{#\var{n}=} (graph mark)}\scheme{#\var{n}=}
and
\index{## (graph reference)@\scheme{#\var{n}#} (graph reference)}\scheme{#\var{n}#}.
\scheme{#\var{n}=} is used to mark an item in the input, and
\scheme{#\var{n}#} is used to refer to the item marked \var{n}.
For example, \scheme{'(#1=(a) . #1#)} is a pair whose car and cdr
contain the same list, and \scheme{#0=(a . #0#)} is a cyclic
list, i.e., its cdr is itself.
A \scheme{$primitive} form (see page~\pageref{desc:hash-primitive}) may
be abbreviated in the same manner as a \scheme{quote} form, using the
\index{#% ($primitive)@\scheme{#%} (\scheme{$primitive})}\scheme{#%} prefix.
For example,
\scheme{#%car} is equivalent to \scheme{($primitive car)},
\scheme{#2%car} to \scheme{($primitive 2 car)}, and
\scheme{#3%car} to \scheme{($primitive 3 car)}.
{\ChezScheme}'s end-of-file object is printed \scheme{#!eof}.
If the end-of-file object appears outside of any datum within a file
being loaded, \scheme{load} will treat it as if it were a true
end of file and stop loading at that point.
Inserting \scheme{#!eof} into the middle of a file can thus be handy
when tracking down a load-time error.
Broken pointers in weak pairs (see page~\pageref{desc:weak-cons}) are
represented by the \emph{broken weak pointer} object, which is
printed \scheme{#!bwp}.
In addition to the standard delimiters (whitespace, open and close
parentheses, open and close brackets, double quotes, semi-colon,
and \scheme{#}), {\ChezScheme} also treats as delimiters
open and close braces, single quote, backward quote, and comma.
Finally, {\ChezScheme} accepts \index{\scheme{#true}}\scheme{#true} and
\index{\scheme{#false}}\scheme{#false} as alternative spellings of the booleans
\scheme{#t} and \scheme{#f}. Like the external representation of numbers, case
is not significant; for example, \scheme{#T}, \scheme{#True} and \scheme{#TRUE}
are all equivalent.
The {\ChezScheme} lexical extensions described above are disabled in an
input stream after an \scheme{#!r6rs} comment directive has been seen,
unless a \scheme{#!chezscheme} comment directive has been seen since.
Each library loaded implicitly via \scheme{import} and each RNRS top-level
program loaded via the \scheme{--program} command-line option, the
\scheme{scheme-script} command, or the \scheme{load-program} procedure is
treated as if it begins implicitly with an \scheme{#!r6rs} comment directive.
The case of symbol and character names is normally significant,
as required by the Revised$^6$ Report.
Names are folded, as if by \scheme{string-foldcase}, following a
\scheme{#!fold-case} comment directive in the same input stream
unless a \scheme{#!no-fold-case} has been seen since.
Names are also folded if neither directive has been seen and the
parameter \scheme{case-sensitive} has been set to \scheme{#f}.
The printer invoked by \scheme{write}, \scheme{put-datum},
\scheme{pretty-print}, and the \scheme{format} \scheme{~s}
option always prints standard Revised$^6$ Report objects
using the standard syntax, unless a different behavior is
requested via the setting of one of the print parameters.
For example, it prints symbols in the extended identifier syntax
of Chez Scheme described above using hex scalar value escapes,
unless the parameter
\index{\scheme{print-extended-identifiers}}\scheme{print-extended-identifiers} is set to
true.
Similarly, it does not print the explicit length or suppress
duplicate trailing elements unless the parameter
\index{\scheme{print-vector-length}}\scheme{print-vector-length} is set to
true.
\section{Notational Conventions\label{SECTINTRONOTATION}}
This book follows essentially the same notational conventions as
\emph{The Scheme Programming Language, 4th Edition}.
These conventions are repeated below, with notes specific to
{\ChezScheme}.
When the value produced by a procedure or syntactic form is said to
be \index{unspecified}\emph{unspecified}, the form or procedure may
return any number of values, each of which may be any Scheme
object.
{\ChezScheme} usually returns a single, unique
\index{void object}\emph{void} object
(see \index{\scheme{void}}\scheme{void}) whenever
the result is unspecified; avoid counting on this behavior, however,
especially if your program may be ported to another Scheme implementation.
Printing of the void object is suppressed by {\ChezScheme}'s waiter
(read-evaluate-print loop).
% following borrowed from TSPL4
\index{exceptions}This book uses the words ``must'' and ``should'' to
describe program requirements, such as the requirement to provide an index
that is less than the length of the vector in a call to
\scheme{vector-ref}.
If the word ``must'' is used, it means that the requirement is enforced
by the implementation, i.e., an exception is raised, usually with
condition type \scheme{&assertion}.
If the word ``should'' is used, an exception may or may not be raised,
and if not, the behavior of the program is undefined.
\index{syntax violation}The phrase ``syntax violation'' is used to
describe a situation in which a program is malformed.
Syntax violations are detected prior to program execution.
When a syntax violation is detected, an exception of type \scheme{&syntax}
is raised and the program is not executed.
Scheme objects are displayed in a \scheme{typewriter} typeface just
as they are to be typed at the keyboard.
This includes identifiers, constant objects, parenthesized Scheme
expressions, and whole programs.
An \emph{italic} typeface is used to set off syntax variables in
the descriptions of syntactic forms and arguments in the descriptions of
procedures.
Italics are also used to set off technical terms the first time they
appear.
The first letter of an identifier that is not ordinarily capitalized
is not capitalized when it appears at the beginning of a sentence.
The same is true for syntax variables written in italics.
In the description of a syntactic form or procedure, a pattern shows
the syntactic form or the application of the procedure.
The syntax keyword or procedure name is given in typewriter font,
as are parentheses.
The remaining pieces of the syntax or arguments are shown in italics,
using names that imply the types of the expressions or arguments expected
by the syntactic form or procedure.
Ellipses are used to specify
zero or more occurrences of a subexpression or argument.
\section{Parameters\label{SECTINTROPARAMETERS}}
\index{parameters}All {\ChezScheme} system customization is done via
\emph{parameters}.
A parameter is a procedure that encapsulates a hidden state variable.
When invoked without arguments, a parameter returns the value of
the encapsulated variable.
When invoked with one argument, the parameter changes the value
of the variable to the value of its argument.
A parameter may raise an exception if its argument is not appropriate,
or it may filter the argument in some way.
New parameters may be created and used by programs running in
{\ChezScheme}.
Parameters are used rather than global variables for program customization
for two reasons:
First, unintentional redefinition of a customization variable can cause
unexpected problems, whereas unintentional redefinition of a
parameter simply makes the parameter inaccessible.
For example, a program that defines \scheme{*print-level*} for its own
purposes in early releases of {\ChezScheme} would have unexpected
effects on the printing of Scheme objects, whereas a program that
defines \index{\scheme{print-level}}\scheme{print-level} for its own
purposes simply loses the ability to alter the printer's behavior.
Of course, a program that invokes \scheme{print-level} by accident can
still affect the system in unintended ways, but such an occurrence is
less likely, and can only happen in an incorrect program.
Second, invalid values for parameters can be detected and rejected
immediately when the ``assignment'' is made, rather than at the point
where the first use occurs, when it is too late to recover and
reinstate the old value.
For example, an assignment of \scheme{*print-level*} to $-1$ would not
have been caught until the first call to \scheme{write} or
\scheme{pretty-print}, whereas an attempted assignment of $-1$ to the
parameter \scheme{print-level}, i.e., \scheme{(print-level -1)}, is
flagged as an error immediately, before the change is actually made.
Built-in system parameters are described in different sections
throughout this book and are listed along with other syntactic
forms and procedures in the Summary of Forms in the
back of this book.
Parameters marked ``thread parameters'' have per-thread values in threaded
versions of {\ChezScheme}, while the values of parameters marked ``global
parameters'' are shared by all threads.
Nonthreaded versions of {\ChezScheme} do not distinguish between
thread and global parameters.
See Sections~\ref{SECTPARAMETERS} and~\ref{SECTTHREADPARAMETERS} for
more information on creating and manipulating parameters.
\section{More Information\label{SECTINTROMOREINFO}}
The articles and technical reports listed below document various
features of {\ChezScheme} and its implementation:
\begin{itemize}
\item syntactic abstraction~\cite{Dybvig:expansion:jour,Dybvig:syntax-case,Dybvig:syntactic},
\item modules~\cite{waddell:modules},
\item libraries~\cite{Ghuloum:libraries},
\item storage management~\cite{Dybvig:guardians,Dybvig:sm},
\item threads~\cite{Dybvig:mitchfest-threads},
\item multiple return values~\cite{Ashley:mvalues},
\item optional arguments~\cite{Dybvig:lambdastar},
\item continuations~\cite{Dybvig:phd,Hieb:representing,Bruggeman:oneshots},
\item eq? hashtables~\cite{ghuloum:eq-hash-tables},
\item internal definitions, \scheme{letrec}, and \scheme{letrec*}~\cite{Waddell:fixing-letrec,Ghuloum:fixing-letrec},
\item \scheme{equal?}~\cite{adams:equal},
\item engines~\cite{Dybvig:engines},
\item floating-point printing~\cite{Burger:floatprinting},
\item code generation~\cite{Dybvig:destination},
\item register allocation~\cite{Burger:regalloc},
\item procedure inlining~\cite{waddell:sas97},
\item profiling~\cite{Burger:pdrtc},
and
\item history of the implementation~\cite{Dybvig:hocs}.
\end{itemize}
\noindent
Links to abstracts and electronic versions of these publications are
available at the url
\hyperlink{http://www.cs.indiana.edu/chezscheme/pubs/}{http://www.cs.indiana.edu/chezscheme/pubs/}.
% Additional resources,
% online versions of this book and of The Scheme Programming Language,
% 4th Edition, and links to various Scheme resources are available at
% \hyperlink{http://www.scheme.com}{www.scheme.com}.

4338
csug/io.stex Normal file

File diff suppressed because it is too large Load diff

1219
csug/libraries.stex Normal file

File diff suppressed because it is too large Load diff

25
csug/math/Makefile Normal file
View file

@ -0,0 +1,25 @@
include mathfiles
density=-r90x90
.SUFFIXES:
.SUFFIXES: .tex .gif
# translate ps file to ppm, crop to minimum background, and translate ppm
# to gif with white (background) transparent
#
.tex.gif:
echo | latex $* &&\
dvips -f < $*.dvi |\
gs -q -dNOPAUSE -dSAFER -sDEVICE=ppmraw -sOutputFile=-\
${density} - |\
pnmcrop |\
ppmtogif -transparent white > $*.gif
rm -f $*.dvi $*.log $*.aux
test -f $*.gif && chmod 644 $*.gif
all: ${gifs}
${gifs}: mathmacros
clean: ; rm -f *.gif Make.out

17
csug/math/mathmacros Normal file
View file

@ -0,0 +1,17 @@
\catcode`@=11 % borrow the private macros of PLAIN (with care)
\def\W#1{W_{\!\!#1}}
\def\fftcases#1{\left\{\,\vcenter{\m@th\baselineskip=18pt
\ialign{$##\hfil$&\quad##\hfil\crcr#1\crcr}}\right.}
\input epsf
\setlength\fboxrule{.4\p@}
\newlength{\chpicsize}
\setlength{\chpicsize}{30pc}
\addtolength{\chpicsize}{-\fboxrule}
\addtolength{\chpicsize}{-\fboxrule}
\def\chpic#1{\begingroup%
\def\epsfsize##1##2{##1}
\fboxsep=0pt
\vbox{\noindent%
\fbox{\vbox{\hbox to \chpicsize{\hfil\vbox to \chpicsize{\vfil%
\epsfbox{#1}\vfil}\hfil}}}}\endgroup}

2
csug/myfile.ss Normal file
View file

@ -0,0 +1,2 @@
(+ 3 4)
"hello"

1697
csug/numeric.stex Normal file

File diff suppressed because it is too large Load diff

3892
csug/objects.stex Normal file

File diff suppressed because it is too large Load diff

14
csug/oop.stex Normal file
View file

@ -0,0 +1,14 @@
% Copyright 2005-2017 Cisco Systems, Inc.
%
% Licensed under the Apache License, Version 2.0 (the "License");
% you may not use this file except in compliance with the License.
% You may obtain a copy of the License at
%
% http://www.apache.org/licenses/LICENSE-2.0
%
% Unless required by applicable law or agreed to in writing, software
% distributed under the License is distributed on an "AS IS" BASIS,
% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
% See the License for the specific language governing permissions and
% limitations under the License.
% uncomment Thread System Oop Interface section in threads.stex

86
csug/preface.stex Normal file
View file

@ -0,0 +1,86 @@
% Copyright 2005-2017 Cisco Systems, Inc.
%
% Licensed under the Apache License, Version 2.0 (the "License");
% you may not use this file except in compliance with the License.
% You may obtain a copy of the License at
%
% http://www.apache.org/licenses/LICENSE-2.0
%
% Unless required by applicable law or agreed to in writing, software
% distributed under the License is distributed on an "AS IS" BASIS,
% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
% See the License for the specific language governing permissions and
% limitations under the License.
\chapter{Preface}
{\ChezScheme} is both a general-purpose programming language and
an implementation of that language, with supporting tools and
documentation.
As a superset of the language described in the Revised$^6$ Report
on Scheme (R6RS), {\ChezScheme} supports all standard features of
Scheme, including first-class procedures, proper treatment of tail
calls, continuations, user-defined records, libraries, exceptions,
and hygienic macro expansion.
{\ChezScheme} supports numerous non-R6RS features.
A few of these are local and top-level modules,
local import, foreign datatypes and procedures, nonblocking I/O,
an interactive top-level, compile-time values and properties,
pretty-printing, and formatted output.
The implementation includes a compiler that generates native code
for each processor upon which it runs along with a run-time system
that provides automatic storage management, foreign-language
interfaces, source-level debugging, profiling support, and an
extensive run-time library.
The threaded versions of {\ChezScheme} support native threads, allowing
Scheme programs to take advantage of multiprocessor or multiple-core
systems.
Nonthreaded versions are also available and are faster for
single-threaded applications.
Both 32-bit and 64-bit versions are available for some platforms.
The 64-bit versions support larger heaps, while the 32-bit versions
are faster for some applications.
{\ChezScheme}'s interactive programming system includes an expression
editor that, like many shells, supports command-line editing, a history
mechanism, and command completion.
Unlike most shells that support command-line editing, the expression
editor properly supports multiline expressions.
{\ChezScheme} is intended to be as reliable and efficient as possible,
with reliability taking precedence over efficiency if necessary.
Reliability means behaving as designed and documented.
While a {\ChezScheme} program can always fail to work properly
because of a bug in the program, it should never fail because of a
bug in the {\ChezScheme} implementation.
Efficiency means performing at a high level, consuming minimal CPU
time and memory.
Performance should be balanced across features, across run time and
compile time, and across programs and data of different sizes.
These principles guide {\ChezScheme} language and tool design as
well as choice of implementation technique; for example, a language
feature or debugging hook might not exist in {\ChezScheme} because
its presence would reduce reliability, efficiency, or both.
The compiler has been rewritten for Version~9 and generates
substantially faster code than the earlier compiler at the cost of
greater compile time.
This is the primary difference between Versions~8 and~9.
This book (CSUG) is a companion to \emph{The Scheme Programming
Language, 4th Edition} (TSPL4).
TSPL4 serves as an introduction to and reference for R6RS, while
CSUG describes {\ChezScheme} features and tools that are not part
of R6RS.
For the reader's convenience, the summary of forms and index at the back
of this book contain entries from both books, with each entry from TSPL4
marked with a ``t'' in front of its page number.
In the online version, the page numbers given in the summary of forms and
index double as direct links into one of the documents or the other.
Additional documentation for {\ChezScheme} includes release notes, a
manual page, and a number of published papers and articles that describe
various aspects of the system's design and implementation.
Thank you for using {\ChezScheme}.

62
csug/priminfo.ss Normal file
View file

@ -0,0 +1,62 @@
;;; priminfo.ss
;;; Copyright 2005-2017 Cisco Systems, Inc.
;;;
;;; Licensed under the Apache License, Version 2.0 (the "License");
;;; you may not use this file except in compliance with the License.
;;; You may obtain a copy of the License at
;;;
;;; http://www.apache.org/licenses/LICENSE-2.0
;;;
;;; Unless required by applicable law or agreed to in writing, software
;;; distributed under the License is distributed on an "AS IS" BASIS,
;;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
;;; See the License for the specific language governing permissions and
;;; limitations under the License.
(module priminfo (primvec get-libraries)
(define prim-db (make-eq-hashtable))
(define primvec
(lambda ()
(hashtable-keys prim-db)))
(define get-libraries
(lambda (name)
(or (eq-hashtable-ref prim-db name #f)
(errorf #f "unknown primitive ~s" name))))
(define put-priminfo!
(lambda (prim lib*)
(when (eq-hashtable-contains? prim-db prim)
(warning 'define-symbol-type "extra entry for ~s" prim))
(eq-hashtable-set! prim-db prim lib*)))
(define-syntax define-symbol-flags*
(lambda (x)
(syntax-case x (libraries)
[(k ([libraries lib ...] [flags flag ...] ignore ...) entry ...)
(or (memq 'system (datum (flag ...)))
(memq 'system-keyword (datum (flag ...))))
#'(void)]
[(k ([libraries] ignore ...) entry ...)
#'(k ([libraries (chezscheme)] ignore ...) entry ...)]
[(_ ([libraries lib ...] ignore ...) entry ...)
(if (syntax-case #'(lib ...) (rnrs)
[((rnrs x ...) y ...) #t]
[_ #f])
#'(void)
(let ()
(define do-entry
(lambda (x)
(syntax-case x ()
[((prefix prim) ignore ...)
(and (identifier? #'prefix) (identifier? #'prim))
#'(put-priminfo! 'prim '(lib ...))]
[(prim ignore ...)
(identifier? #'prim)
#'(put-priminfo! 'prim '(lib ...))])))
#`(begin #,@(map do-entry #'(entry ...)))))])))
(include "../s/primdata.ss")
)

33
csug/scheme.hsty Normal file
View file

@ -0,0 +1,33 @@
\def\transerr#1{\raw{<i>}}
\def\transin#1{\raw{<font color="##ff0000">}}
\def\transout#1{\raw{<font color="##0000ff">}}
\def\endtranserr#1{\raw{</i>}}
\def\endtransin#1{\raw{</font>}}
\def\endtransout#1{\raw{</font>}}
\def\schemeblankline{{\\\\}}
\def\schemelinestart{}
%%% handle numbered lines in scheme.sty and scheme.hsty
%%% ---have scheme-prep produce only \schemelinestart
% following is probably broken until we have tables, I suspect.
% Actually, the right way to fix this may be to use CSS
\def\schemelinestartnumbered#1{\raw{<table><tr width=20><td>}#1\raw{</td></tr></table>}}
\def\scheme#1{{\tt #1}}
\def\longcode\schemedisplay{\schemedisplay}
\def\noskip\schemedisplay{\schemedisplay}
\def\schemedisplay{\par\begingroup\tt\hardspaces}
\def\endschemedisplay{\endgroup\par}
\def\schemeindent{}
\def\schatsign{\raw{@}}
\def\schbackslash{\raw{\}}
\def\schcarat{\raw{^}}
\def\schdot{\raw{.}}
\def\schlbrace{\raw{&##123;}}
\def\schrbrace{\raw{&##125;}}
\def\schtilde{\raw{~}}
\def\schunderscore{\raw{_}}
\def\becomes{$\rightarrow$}
\def\is{$\Rightarrow$}
\def\si{\raw{<img src="gifs/ghostRightarrow.gif">}}
\def\var#1{\emph{#1}}

89
csug/scheme.sty Normal file
View file

@ -0,0 +1,89 @@
\usepackage{color}
\def\transerr#1{\begingroup\slshape}
\def\transin#1{\begingroup\color{red}}
\def\transout#1{\begingroup\color{blue}}
\def\traceout#1{\begingroup\color{blue}}
\def\endtranserr#1{\endgroup}
\def\endtransin#1{\endgroup}
\def\endtransout#1{\endgroup}
\def\endtraceout#1{\endgroup}
% this didn't work --- screwed up indentation:
\long\def\showinteraction#1#2{\begin{minipage}[t]{4.375in}#1\end{minipage}\hfill\fbox{\begin{minipage}[t]{2in}#2\end{minipage}}}
% so I resorted to this:
\def\startrepl{\begin{minipage}[t]{4.3in}} % was 4.375 and 2 when interactionwindow = 28
\def\endrepl{\end{minipage}}
\def\startinteraction{\begin{minipage}[t]{2.2in}\vrule\begin{minipage}[t]{2.2in}\hrule\schemeindent=2pt}
\def\endinteraction{\hrule\end{minipage}\vrule\end{minipage}}
\font\ninefivett=cmtt9 at 9.5pt
\newskip\ttglue
\ttglue=.5em plus .25em minus .15em
\font\tinyvar=cmti7
\font\smallvar=cmti9
\font\summarysizevar=cmti9
\font\indexsizevar=cmti8
\font\normalvar=cmti10 at 11pt
\def\schemelarge{%
\def\schemelarger{\fontsize{14}{16}}%
\def\schemesmaller{\fontsize{10}{12}}%
\def\tt{\fontsize{12}{14}\ttfamily}%
\def\var##1{{\normalvar##1\/}}}
\def\schemenormal{%
\def\schemelarger{\fontsize{12}{14}}%
\def\schemesmaller{\fontsize{8}{9}}%
\def\tt{\fontsize{10pt}{11pt}\ttfamily\ninefivett}%
\def\var##1{{\smallvar##1\/}}}
\def\schemesmall{%
\def\schemelarger{\fontsize{10}{12}}%
\def\schemesmaller{\fontsize{6}{7}}%
\def\tt{\fontsize{8}{9}\ttfamily}%
\def\var##1{{\smallvar##1\/}}}
\def\schemesummarysize{%
\def\schemelarger{\fontsize{10}{12}}%
\def\schemesmaller{\fontsize{6}{7}}%
\def\tt{\fontsize{8}{9}\ttfamily}%
\def\var##1{{\summarysizevar##1\/}}}
\def\schemeindexsize{%
\def\schemelarger{\fontsize{10}{12}}%
\def\schemesmaller{\fontsize{6}{7}}%
\def\tt{\fontsize{7}{8}\ttfamily}%
\def\var##1{{\indexsizevar##1\/}}}
\schemenormal
\newskip\schemeindent
\schemeindent=0pt
{\obeyspaces\global\let =\ }
\def\schtilde{\raisebox{-.5ex}{\hbox{\char`\~}}}
\def\schdot{.}
\def\schcarat{\char`\^}
\def\schbackslash{\char`\\}
\def\schatsign{\char`\@}
\def\schunderscore{\char`\_}
\def\schlbrace{\char`\{}
\def\schrbrace{\char`\}}
\def\scheme#1{\mbox{\tt\frenchspacing\spaceskip=\ttglue#1}}
\def\schemeblankline{\par\penalty-100\vskip .7\baselineskip}
\def\schemelinestart{{\leavevmode\hbox{\hskip \schemeindent\relax}}}
%%% handle numbered lines in scheme.sty and scheme.hsty
%%% ---have scheme-prep produce only \schemelinestart
\def\schemelinestartnumbered#1{{\leavevmode\hbox{\hbox to 1em {\hfil{\rm #1}} \hskip .5\schemeindent\relax}}}
\def\noskip\schemedisplay{\begingroup%
\parindent=0pt%
\parskip=0pt%
\def\becomes{\hbox to 2em{\hfil$\rightarrow$\hfil}}%
\def\is{\hbox to 2em{\hfil$\Rightarrow$\hfil}}%
\def\si{\hbox to 2em{\hfil}}%
\interlinepenalty=2000%
\tt\obeyspaces\frenchspacing}
\def\schemedisplay{\beforeschemedisplay\noskip\schemedisplay}
\def\longcode\schemedisplay{\penalty-200\vskip 8pt plus 4pt%
\kern3pt\hrule\kern5pt\nobreak\noskip\schemedisplay}
\def\endschemedisplay{\par\endgroup\afterschemedisplay}
\def\var#1{{\normalsize\textrm{\textit{#1}}}}
\def\raw#1{#1}
\def\beforeschemedisplay{\penalty-100\vskip\parskip\vskip5pt}
\def\afterschemedisplay{\penalty-200\vskip5pt}

1
csug/setup.ss Normal file
View file

@ -0,0 +1 @@
(reset-handler abort)

966
csug/smgmt.stex Normal file
View file

@ -0,0 +1,966 @@
% Copyright 2005-2017 Cisco Systems, Inc.
%
% Licensed under the Apache License, Version 2.0 (the "License");
% you may not use this file except in compliance with the License.
% You may obtain a copy of the License at
%
% http://www.apache.org/licenses/LICENSE-2.0
%
% Unless required by applicable law or agreed to in writing, software
% distributed under the License is distributed on an "AS IS" BASIS,
% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
% See the License for the specific language governing permissions and
% limitations under the License.
\chapter{Storage Management\label{CHPTSMGMT}}
This chapter describes aspects of the storage management system and
procedures that may be used to control its operation.
\section{Garbage Collection\label{SECTSMGMTGC}}
Scheme objects such as pairs, strings, procedures, and user-defined
records are never explicitly deallocated by a Scheme program.
Instead, the \index{storage management}storage management system
automatically reclaims the
storage associated with an object once it proves the object is no longer
accessible.
In order to reclaim this storage, {\ChezScheme} employs a
\index{garbage collector}garbage
collector which runs periodically as a program runs.
Starting from a set of known \emph{roots}, e.g., the machine registers,
the garbage collector locates all accessible objects,
copies them (in most cases) in order to eliminate fragmentation
between accessible objects, and reclaims storage occupied by
inaccessible objects.
Collections are triggered automatically by the default collect-request
handler, which is invoked via a collect-request interrupt that occurs
after approximately $n$ bytes of storage have been allocated, where $n$ is
the value of the parameter
\index{\scheme{collect-trip-bytes}}\scheme{collect-trip-bytes}.
The default collect-request handler causes a collection by calling the
procedure \index{\scheme{collect}}\scheme{collect} without arguments.
The collect-request handler can be redefined by changing the value of the
parameter
\index{\scheme{collect-request-handler}}\scheme{collect-request-handler}.
A program can also cause a collection to occur between collect-request
interrupts by calling \scheme{collect} directly either without or with
arguments.
{\ChezScheme}'s collector is a \emph{generation-based} collector.
It segregates objects based on their age (roughly speaking, the
number of collections survived) and collects older objects less
frequently than younger objects.
Since younger objects tend to become inaccessible more quickly than
older objects, the result is that most collections take little
time.
The system also maintains a
\index{static generation}\emph{static} generation from
which storage is never reclaimed.
Objects are placed into the static generation only
when a heap is compacted (see
\index{\scheme{Scompact_heap}}\scheme{Scompact_heap} in
Section~\ref{SECTFOREIGNCLIB}) or when an explicitly specified
target-generation is the symbol \scheme{static}.
This is primarily useful after an application's permanent code and data
structures have been loaded and initialized, to reduce the overhead of
subsequent collections.
Nonstatic generations are numbered starting at zero for the youngest
generation up through the current value of
\index{\scheme{collect-maximum-generation}}\scheme{collect-maximum-generation}.
The storage manager places newly allocated objects into generation 0.
When \scheme{collect} is invoked without arguments, generation 0
objects that survive collection move to generation 1, generation 1
objects that survive move to generation 2, and so on, except that
objects are never moved past the maximum nonstatic generation.
Objects in the maximum nonstatic generation are collected back into
the maximum nonstatic generation.
While generation 0 is collected during each collection, older
generations are collected less frequently.
An internal counter, gc-trip, is maintained to control when each
generation is collected.
Each time \scheme{collect} is called without arguments (as from the default
collect-request handler), gc-trip is incremented by one, and the set of
generations to be collected is determined from the current value of
gc-trip and the value of
\index{\scheme{collect-generation-radix}}\scheme{collect-generation-radix}:
with a collect-generation radix of $r$, the maximum collected generation
is the highest numbered generation $g$ for which gc-trip is a
multiple of $r^g$.
If \scheme{collect-generation-radix} is set to 4, the system thus
collects generation 0 every time, generation 1 every 4 times,
generation 2 every 16 times, and so on.
When \scheme{collect} is invoked with arguments, the generations to be
collected and their target generations are determined by the arguments.
In addition, the first argument \var{cg} affects the value of gc-trip;
that is, gc-trip is advanced to the next $r^{cg}$ boundary, but
not past the next $r^{cg+1}$ boundary, where $r$ is the
value of \scheme{collect-generation-radix}.
It is possible to make substantial adjustments in the collector's behavior
by setting the parameters described in this section.
It is even possible to completely override the collector's default strategy for
determining when each generation is collected by redefining the
collect-request handler to call \scheme{collect} with arguments.
For example, the programmer can redefine the handler to treat the
maximum nonstatic generation as a static generation over a long
period of time by calling \scheme{collect} with arguments that
prevent the maximum nonstatic generation from being collected during
that period of time.
Additional information on {\ChezScheme}'s collector can be found in the
report ``Don't stop the {BiBOP}: Flexible and efficient
storage management for dynamically typed languages''~\cite{Dybvig:sm}.
%----------------------------------------------------------------------------
\entryheader
\formdef{collect}{\categoryprocedure}{(collect)}
\formdef{collect}{\categoryprocedure}{(collect \var{cg})}
\formdef{collect}{\categoryprocedure}{(collect \var{cg} \var{max-tg})}
\formdef{collect}{\categoryprocedure}{(collect \var{cg} \var{min-tg} \var{max-tg})}
\returns unspecified
\listlibraries
\endentryheader
\noindent
This procedure causes the storage manager to perform a garbage
collection.
\scheme{collect} is invoked periodically without arguments by the
default collect-request handler, but it may also be called explicitly,
e.g., from a custom collect-request handler, between phases of a
computation when collection is most likely to be successful, or
before timing a computation.
In the threaded versions of {\ChezScheme}, the thread that invokes
\scheme{collect} must be the only active thread.
When called without arguments, the system determines automatically
which generations to collect and the target generation for each
collected generation as described in the lead-in to this section.
When called with arguments, the system collects all and only objects
in generations less than or equal to \var{cg} (the maximum collected
generation) into the target generation or generations determined
by \var{min-tg} (the minimum target generation) and \var{max-tg}
(the maximum target generation).
Specifically, the target generation for any object in a collected
generation \var{g} is
$\mbox{min}(\mbox{max}(\mbox{\emph{g}}+1,\mbox{\emph{min-tg}}),\mbox{\emph{max-tg}})$, where
\scheme{static} is taken to have the value one greater
than the maximum nonstatic generation.
If present, \var{cg} must be a nonnegative fixnum no greater than
the maximum nonstatic generation, i.e., the current value of the
parameter \scheme{collect-maximum-generation}.
If present, \var{max-tg} must be a nonnegative fixnum or the symbol
\scheme{static} and either equal to \var{cg} or one greater than
\var{cg}, again treating \scheme{static} as having the value one
greater than the maximum nonstatic generation.
If \var{max-tg} is not present (but \var{cg} is), it defaults to
\var{cg} if \var{cg} is equal to the maximum target generation and
to one more than \var{cg} otherwise.
If present, \var{min-tg} must be a nonnegative fixnum or the symbol
\scheme{static} and no greater than \var{max-tg}, again treating
\scheme{static} as having the value one greater than the maximum
nonstatic generation.
Unless \var{max-cg} is the same as \var{cg}, \var{min-tg} must also
be greater than \var{cg}.
If \var{min-tg} is not present (but \var{cg} is), it defaults to
the same value as \var{max-tg}.
%----------------------------------------------------------------------------
\entryheader
\formdef{collect-rendezvous}{\categoryprocedure}{(collect-rendezvous)}
\returns unspecified
\listlibraries
\endentryheader
\noindent
Requests a garbage collection in the same way as when the system
determines that a collection should occur. All running threads are
coordinated so that one of them calls the collect-request handler, while
the other threads pause until the handler returns.
Note that if the collect-request handler (see
\scheme{collect-request-handler}) does not call \scheme{collect}, then
\scheme{collect-rendezvous} does not actually perform a garbage
collection.
%----------------------------------------------------------------------------
\entryheader
\formdef{collect-notify}{\categoryglobalparameter}{collect-notify}
\listlibraries
\endentryheader
\noindent
If \scheme{collect-notify} is set to a true value, the collector prints
a message whenever a collection is run.
\scheme{collect-notify} is set to \scheme{#f} by default.
%----------------------------------------------------------------------------
\entryheader
\formdef{collect-trip-bytes}{\categoryglobalparameter}{collect-trip-bytes}
\listlibraries
\endentryheader
\noindent
This parameter determines the approximate amount of storage that is
allowed to be allocated between garbage collections.
Its value must be a positive fixnum.
{\ChezScheme} allocates memory internally in large chunks and
subdivides these chunks via inline operations for efficiency.
The storage manager determines whether to request a collection only
once per large chunk allocated.
Furthermore, some time may elapse between when a collection is
requested by the storage manager and when the collect request is
honored, especially if interrupts are temporarily disabled via
\index{\scheme{with-interrupts-disabled}}\scheme{with-interrupts-disabled}
or \index{\scheme{disable-interrupts}}\scheme{disable-interrupts}.
Thus, \scheme{collect-trip-bytes} is an approximate measure only.
%----------------------------------------------------------------------------
\entryheader
\formdef{collect-generation-radix}{\categoryglobalparameter}{collect-generation-radix}
\listlibraries
\endentryheader
\noindent
This parameter determines how often each generation is collected
when \scheme{collect} is invoked without arguments, as by the default
collect-request handler.
Its value must be a positive fixnum.
Generations are collected once every $r^g$ times a collection occurs,
where $r$ is the
value of \scheme{collect-generation-radix} and $g$ is the generation
number.
Setting \scheme{collect-generation-radix} to one forces all generations
to be collected each time a collection occurs.
Setting \scheme{collect-generation-radix} to a very large number
effectively delays collection of older generations indefinitely.
%----------------------------------------------------------------------------
\entryheader
\formdef{collect-maximum-generation}{\categoryglobalparameter}{collect-maximum-generation}
\listlibraries
\endentryheader
This parameter determines the maximum nonstatic generation, hence the
total number of generations, currently in use.
Its value is an exact integer in the range 1 through 254.
When set to 1, only two nonstatic generations are used; when set to 2,
three nonstatic generations are used, and so on.
When set to 254, 255 nonstatic generations are used, plus the single
static generation for a total of 256 generations.
Increasing the number of generations effectively decreases how often old
objects are collected, potentially decreasing collection overhead but
potentially increasing the number of inaccessible objects retained in the
system and thus the total amount of memory required.
%----------------------------------------------------------------------------
\entryheader
\formdef{collect-request-handler}{\categoryglobalparameter}{collect-request-handler}
\listlibraries
\endentryheader
\noindent
The value of \scheme{collect-request-handler} must be a procedure.
The procedure is invoked without arguments whenever the
system determines that a collection should occur, i.e., some time after
an amount of storage determined by the parameter
\scheme{collect-trip-bytes} has been allocated since the last
collection.
By default, \scheme{collect-request-handler} simply invokes
\scheme{collect} without arguments.
Automatic collection may be disabled by setting
\scheme{collect-request-handler} to a procedure that does nothing,
e.g.:
\schemedisplay
(collect-request-handler void)
\endschemedisplay
Collection can also be temporarily disabled using
\scheme{critical-section}, which prevents any interrupts from
being handled.
In the threaded versions of {\ChezScheme}, the collect-request
handler is invoked by a single thread with all other threads
temporarily suspended.
%----------------------------------------------------------------------------
\entryheader
\formdef{release-minimum-generation}{\categoryglobalparameter}{release-minimum-generation}
\listlibraries
\endentryheader
This parameter's value must be between 0 and the value of
\scheme{collect-maximum-generation}, inclusive, and defaults to the
value of \scheme{collect-maximum-generation}.
As new data is allocated and collections occur, the storage-management
system automatically requests additional virtual memory address space
from the operating system.
Correspondingly, in the event the heap shrinks significantly, the system
attempts to return some of the virtual-memory previously obtained from
the operating system back to the operating system.
By default, the system attempts to do so only after a collection that
targets the maximum nonstatic generation.
The system can be asked to do so after collections
targeting younger generations as well by altering the value
\scheme{release-minimum-generation} to something less than the value
of \scheme{collect-maximum-generation}.
When the generation to which the parameter is set, or any older
generation, is the target generation of a collection, the storage
management system attempts to return unneeded virtual memory to the
operating system following the collection.
When \scheme{collect-maximum-generation} is set to a new value \var{g},
\scheme{release-minimum-generation} is implicitly set to \var{g} as well
if (a) the two parameters have the same value before the change, or (b)
\scheme{release-minimum-generation} has a value greater than \var{g}.
%----------------------------------------------------------------------------
\entryheader
\formdef{heap-reserve-ratio}{\categoryglobalparameter}{heap-reserve-ratio}
\listlibraries
\endentryheader
This parameter determines the approximate amount of memory reserved (not
returned to the O/S as described in the entry for \scheme{release-minimum-generation})
in proportion to the amount currently occupied, excluding areas
of memory that have been made static.
Its value must be an inexact nonnegative flonum value; if set to an exact
real value, the exact value is converted to an inexact value.
The default value, 1.0, reserves one page of memory for each currently
occupied nonstatic page.
Setting it to a smaller value may result in a smaller average virtual
memory footprint, while setting it to a larger value may result in fewer
calls into the operating system to request and free memory space.
\section{Weak Pairs, Ephemeron Pairs, and Guardians\label{SECTGUARDWEAKPAIRS}}
\index{weak pairs}\index{weak pointers}\emph{Weak pairs} allow programs
to maintain \emph{weak pointers} to objects.
A weak pointer to an object does not prevent the object from being
reclaimed by the storage management system, but it does remain valid as
long as the object is otherwise accessible in the system.
\index{ephemeron pairs}\emph{Ephemeron pairs} are like weak pairs, but
ephemeron pairs combine two pointers where the second is retained only
as long as the first is retained.
\index{guardians}\emph{Guardians}
allow programs to protect objects from deallocation
by the garbage collector and to determine when the objects would
otherwise have been deallocated.
Weak pairs, ephemeron pairs, and guardians allow programs to retain
information about objects in separate data structures (such as hash
tables) without concern that maintaining this information will cause
the objects to remain indefinitely in the system. Ephemeron pairs
allow such data structures to retain key--value combinations
where a value may refer to its key, but the combination
can be reclaimed if neither must be saved otherwise.
In addition, guardians allow objects to be saved from deallocation
indefinitely so that they can be reused or so that clean-up or other
actions can be performed using the data stored within the objects.
The implementation of guardians and weak pairs used by {\ChezScheme}
is described in~\cite{Dybvig:guardians}. Ephemerons are described
in~\cite{Hayes:ephemerons}, but the implementation in {\ChezScheme}
avoids quadratic-time worst-case behavior.
%----------------------------------------------------------------------------
\entryheader\label{desc:weak-cons}
\formdef{weak-cons}{\categoryprocedure}{(weak-cons \var{obj_1} \var{obj_2})}
\returns a new weak pair
\listlibraries
\endentryheader
\noindent
\var{obj_1} becomes the car and \var{obj_2} becomes the cdr of the
new pair.
Weak pairs are indistinguishable from ordinary pairs in all but two ways:
\begin{itemize}
\item weak pairs can be distinguished from pairs using the
\scheme{weak-pair?} predicate, and
\item weak pairs maintain a weak pointer to the object in the
car of the pair.
\end{itemize}
\noindent
The weak pointer in the car of a weak pair is just like a normal
pointer as long as the object to which it points is accessible through
a normal (nonweak) pointer somewhere in the system.
If at some point the garbage collector recognizes that there are no
nonweak pointers to the object, however, it replaces each weak pointer
to the object with the ``broken weak-pointer'' object, \scheme{#!bwp},
and discards the object.
The cdr field of a weak pair is \emph{not} a weak pointer, so
weak pairs may be used to form lists of weakly held objects.
These lists may be manipulated using ordinary list-processing
operations such as \scheme{length}, \scheme{map}, and \scheme{assv}.
(Procedures like \scheme{map} that produce list structure always
produce lists formed from nonweak pairs, however, even when their input
lists are formed from weak pairs.)
Weak pairs may be altered using \scheme{set-car!} and \scheme{set-cdr!}; after
a \scheme{set-car!} the car field contains a weak pointer to the new
object in place of the old object.
Weak pairs are especially useful for building association pairs
in association lists or hash tables.
Weak pairs are printed in the same manner as ordinary pairs; there
is no reader syntax for weak pairs.
As a result, weak pairs become normal pairs when they are written
and then read.
\schemedisplay
(define x (cons 'a 'b))
(define p (weak-cons x '()))
(car p) ;=> (a . b)
(define x (cons 'a 'b))
(define p (weak-cons x '()))
(set! x '*)
(collect)
(car p) ;=> #!bwp
\endschemedisplay
\noindent
The latter example above may in fact return \scheme{(a . b)} if a
garbage collection promoting the pair into an older generation occurs
prior to the assignment of \scheme{x} to \scheme{*}.
It may be necessary to force an older generation collection to allow
the object to be reclaimed.
The storage management system guarantees only that the object
will be reclaimed eventually once all nonweak pointers to it are
dropped, but makes no guarantees about when this will occur.
%----------------------------------------------------------------------------
\entryheader
\formdef{weak-pair?}{\categoryprocedure}{(weak-pair? \var{obj})}
\returns \scheme{#t} if obj is a weak pair, \scheme{#f} otherwise
\listlibraries
\endentryheader
\schemedisplay
(weak-pair? (weak-cons 'a 'b)) ;=> #t
(weak-pair? (cons 'a 'b)) ;=> #f
(weak-pair? "oops") ;=> #f
\endschemedisplay
%----------------------------------------------------------------------------
\entryheader\label{desc:ephemeron-cons}
\formdef{ephemeron-cons}{\categoryprocedure}{(ephemeron-cons \var{obj_1} \var{obj_2})}
\returns a new ephemeron pair
\listlibraries
\endentryheader
\noindent
\var{obj_1} becomes the car and \var{obj_2} becomes the cdr of the
new pair.
Ephemeron pairs are indistinguishable from ordinary pairs in all but two ways:
\begin{itemize}
\item ephemeron pairs can be distinguished from pairs using the
\scheme{ephemeron-pair?} predicate, and
\item ephemeron pairs maintain a weak pointer to the object in the
car of the pair, and the cdr of the pair is preserved only as long
as the car of the pair is preserved.
\end{itemize}
\noindent
An ephemeron pair behaves like a weak pair, but the cdr is treated
specially in addition to the car: the cdr of an ephemeron is set to
\scheme{#!bwp} at the same time that the car is set to \scheme{#!bwp}.
Since the car and cdr fields are set to \scheme{#!bwp} at the same
time, then the fact that the car object may be referenced through the
cdr object does not by itself imply that car must be preserved (unlike
a weak pair); instead, the car must be saved for some reason
independent of the cdr object.
Like weak pairs and other pairs, ephemeron pairs may be altered using
\scheme{set-car!} and \scheme{set-cdr!}, and ephemeron pairs are
printed in the same manner as ordinary pairs; there is no reader
syntax for ephemeron pairs.
\schemedisplay
(define x (cons 'a 'b))
(define p (ephemeron-cons x x))
(car p) ;=> (a . b)
(cdr p) ;=> (a . b)
(define x (cons 'a 'b))
(define p (ephemeron-cons x x))
(set! x '*)
(collect)
(car p) ;=> #!bwp
(cdr p) ;=> #!bwp
(define x (cons 'a 'b))
(define p (weak-cons x x)) ; \var{not an ephemeron pair}
(set! x '*)
(collect)
(car p) ;=> (a . b)
(cdr p) ;=> (a . b)
\endschemedisplay
\noindent
As with weak pairs, the last two expressions of the middle example
above may in fact return \scheme{(a . b)} if a garbage collection
promoting the pair into an older generation occurs prior to the
assignment of \scheme{x} to \scheme{*}. In the last example above,
however, the results of the last two expressions will always be
\scheme{(a . b)}, because the cdr of a weak pair holds a non-weak
reference, and that non-weak reference prevents the car field from becoming
\scheme{#!bwp}.
%----------------------------------------------------------------------------
\entryheader
\formdef{ephemeron-pair?}{\categoryprocedure}{(ephemeron-pair? \var{obj})}
\returns \scheme{#t} if obj is a ephemeron pair, \scheme{#f} otherwise
\listlibraries
\endentryheader
\schemedisplay
(ephemeron-pair? (ephemeron-cons 'a 'b)) ;=> #t
(ephemeron-pair? (cons 'a 'b)) ;=> #f
(ephemeron-pair? (weak-cons 'a 'b)) ;=> #f
(ephemeron-pair? "oops") ;=> #f
\endschemedisplay
%----------------------------------------------------------------------------
\entryheader
\formdef{bwp-object?}{\categoryprocedure}{(bwp-object? \var{obj})}
\returns \scheme{#t} if obj is the broken weak-pair object, \scheme{#f} otherwise
\listlibraries
\endentryheader
\schemedisplay
(bwp-object? #!bwp) ;=> #t
(bwp-object? 'bwp) ;=> #f
(define x (cons 'a 'b))
(define p (weak-cons x '()))
(set! x '*)
(collect (collect-maximum-generation))
(car p) ;=> #!bwp
(bwp-object? (car p)) ;=> #t
\endschemedisplay
%----------------------------------------------------------------------------
\entryheader
\formdef{make-guardian}{\categoryprocedure}{(make-guardian)}
\returns a new guardian
\listlibraries
\endentryheader
\noindent
Guardians are represented by procedures that encapsulate groups of
objects registered for preservation.
When a guardian is created, the group of registered objects is empty.
An object is registered with a guardian by passing the object as an
argument to the guardian:
\schemedisplay
(define G (make-guardian))
(define x (cons 'aaa 'bbb))
x ;=> (aaa . bbb)
(G x)
\endschemedisplay
It is also possible to specify a ``representative'' object when
registering an object.
Continuing the above example:
\schemedisplay
(define y (cons 'ccc 'ddd))
y ;=> (ccc . ddd)
(G y 'rep)
\endschemedisplay
The group of registered objects associated with a guardian is logically
subdivided into two disjoint subgroups: a subgroup referred to
as ``accessible'' objects, and one referred to ``inaccessible'' objects.
Inaccessible objects are objects that have been proven to be
inaccessible (except through the guardian mechanism itself or through
the car field of a weak or ephemeron pair), and
accessible objects are objects that have not been proven so.
The word ``proven'' is important here: it may be that some objects in
the accessible group are indeed inaccessible but
that this has not yet been proven.
This proof may not be made in some cases until long after the object
actually becomes inaccessible (in the current implementation, until a
garbage collection of the generation containing the object occurs).
Objects registered with a guardian are initially placed in the accessible
group and are moved into the inaccessible group at some point after they
become inaccessible.
Objects in the inaccessible group are retrieved by invoking the guardian
without arguments.
If there are no objects in the inaccessible group, the guardian returns
\scheme{#f}.
Continuing the above example:
\schemedisplay
(G) ;=> #f
(set! x #f)
(set! y #f)
(collect)
(G) ;=> (aaa . bbb) ; \var{this might come out second}
(G) ;=> rep ; \var{and this first}
(G) ;=> #f
\endschemedisplay
\noindent
The initial call to \scheme{G} returns \scheme{#f}, since the pairs bound
to \scheme{x} and \scheme{y} are the
only object registered with \scheme{G}, and the pairs are still accessible
through those bindings.
When \scheme{collect} is called, the objects shift into the inaccessible group.
The two calls to \scheme{G} therefore return the pair previously bound to
\scheme{x} and the representative of the pair previously bound to \scheme{y},
though perhaps in the other order from the one shown.
(As noted above for weak pairs, the call to collect may not actually be
sufficient to prove the object inaccessible, if the object has
migrated into an older generation.)
Although an object registered without a representative and returned from
a guardian has been proven otherwise
inaccessible (except possibly via the car field of a weak or ephemeron pair), it has
not yet been reclaimed by the storage management system and will not be
reclaimed until after the last nonweak pointer to it within or outside
of the guardian system has been dropped.
In fact, objects that have been retrieved from a guardian have no
special status in this or in any other regard.
This feature circumvents the problems that might otherwise arise with
shared or cyclic structure.
A shared or cyclic structure consisting of inaccessible objects is
preserved in its entirety, and each piece registered for preservation
with any guardian is placed in the inaccessible set for that guardian.
The programmer then has complete control over the order in which pieces
of the structure are processed.
An object may be registered with a guardian more than once, in which
case it will be retrievable more than once:
\schemedisplay
(define G (make-guardian))
(define x (cons 'aaa 'bbb))
(G x)
(G x)
(set! x #f)
(collect)
(G) ;=> (aaa . bbb)
(G) ;=> (aaa . bbb)
\endschemedisplay
\noindent
It may also be registered with more than one guardian, and guardians
themselves can be registered with other guardians.
An object that has been registered with a guardian without a
representative and placed in
the car field of a weak or ephemeron pair remains in the car field of the
weak or ephemeron pair until after it has been returned from the guardian and
dropped by the program or until the guardian itself is dropped.
\schemedisplay
(define G (make-guardian))
(define x (cons 'aaa 'bbb))
(define p (weak-cons x '()))
(G x)
(set! x #f)
(collect)
(set! y (G))
y ;=> (aaa . bbb)
(car p) ;=> (aaa . bbb)
(set! y #f)
(collect 1)
(car p) ;=> #!bwp
\endschemedisplay
\noindent
(The first collector call above would
promote the object at least into generation~1, requiring the second
collector call to be a generation~1 collection.
This can also be forced by invoking \scheme{collect} several times.)
On the other hand, if a representative (other than the object itself)
is specified, the guarded object is dropped from the car field of the
weak or ephemeron pair at the same time as the representative becomes available
from the guardian.
\schemedisplay
(define G (make-guardian))
(define x (cons 'aaa 'bbb))
(define p (weak-cons x '()))
(G x 'rep)
(set! x #f)
(collect)
(G) ;=> rep
(car p) ;=> #!bwp
\endschemedisplay
The following example illustrates that the object is deallocated and
the car field of the weak pair set to \scheme{#!bwp} when the guardian
itself is dropped:
\schemedisplay
(define G (make-guardian))
(define x (cons 'aaa 'bbb))
(define p (weak-cons x '()))
(G x)
(set! x #f)
(set! G #f)
(collect)
(car p) ;=> #!bwp
\endschemedisplay
The example below demonstrates how guardians might be used to
deallocate external storage, such as storage managed by the C library
``malloc'' and ``free'' operations.
\schemedisplay
(define malloc
(let ([malloc-guardian (make-guardian)])
(lambda (size)
; first free any storage that has been dropped. to avoid long
; delays, it might be better to deallocate no more than, say,
; ten objects for each one allocated
(let f ()
(let ([x (malloc-guardian)])
(when x
(do-free x)
(f))))
; then allocate and register the new storage
(let ([x (do-malloc size)])
(malloc-guardian x)
x))))
\endschemedisplay
\noindent
\scheme{do-malloc} must return a Scheme object ``header'' encapsulating a pointer to the
external storage (perhaps as an unsigned integer), and all access to the
external storage must be made through this header.
In particular, care must be taken that no pointers to the external storage
exist outside of Scheme after the corresponding header has been
dropped.
\scheme{do-free} must deallocate the external storage using the encapsulated
pointer.
Both primitives can be defined in terms of \scheme{foreign-alloc}
and \scheme{foreign-free} or the C-library ``malloc'' and ``free''
operators, imported as foreign procedures. (See
Chapter~\ref{CHPTFOREIGN}.)
If it is undesirable to wait until \scheme{malloc} is called to free dropped
storage previously allocated by \scheme{malloc}, a collect-request handler
can be used instead to check for and free dropped storage, as shown below.
\schemedisplay
(define malloc)
(let ([malloc-guardian (make-guardian)])
(set! malloc
(lambda (size)
; allocate and register the new storage
(let ([x (do-malloc size)])
(malloc-guardian x)
x)))
(collect-request-handler
(lambda ()
; first, invoke the collector
(collect)
; then free any storage that has been dropped
(let f ()
(let ([x (malloc-guardian)])
(when x
(do-free x)
(f)))))))
\endschemedisplay
%% for testing:
% (define do-malloc (lambda (x) (list x)))
% (define do-free (lambda (x) (printf "freeing ~s~%" (car x))))
% (define a (malloc 1))
% (malloc 10)
% (let f () (cons f f) (f))
With a bit of refactoring, it would be possible to register
the encapsulated foreign address as a representative with
each header, in which \scheme{do-free} would take just the
foreign address as an argument.
This would allow the header to be dropped from the Scheme
heap as soon as it becomes inaccessible.
Guardians can also be created via
\index{\scheme{ftype-guardian}}\scheme{ftype-guardian}, which
supports reference counting of foreign objects.
%----------------------------------------------------------------------------
\entryheader
\formdef{guardian?}{\categoryprocedure}{(guardian? \var{obj})}
\returns \scheme{#t} if obj is a guardian, \scheme{#f} otherwise
\listlibraries
\endentryheader
\schemedisplay
(guardian? (make-guardian)) ;=> #t
(guardian? (ftype-guardian iptr)) ;=> #t
(guardian? (lambda x x)) ;=> #f
(guardian? "oops") ;=> #f
\endschemedisplay
%----------------------------------------------------------------------------
\entryheader
\formdef{unregister-guardian}{\categoryprocedure}{(unregister-guardian \var{guardian})}
\returns see below
\listlibraries
\endentryheader
\noindent
\scheme{unregister-guardian} unregisters the
as-yet unresurrected objects currently registered with the guardian,
with one caveat.
The caveat, which applies only to threaded versions of {\ChezScheme},
is that objects registered with the guardian by other threads since
the last garbage collection might not be unregistered.
To ensure that all objects are unregistered in a multithreaded
application, a single thread can be used both to register and
unregister objects.
Alternatively, an application can arrange to define a
\index{\scheme{collect-request-handler}}collect-request
handler that calls \scheme{unregister-guardian} after it calls
\scheme{collect}.
In any case, \scheme{unregister-guardian} returns a list containing each object
(or its representative, if specified) that it unregisters, with
duplicates as appropriate if the same object is registered more
than once with the guardian.
Objects already resurrected but not yet retrieved from the guardian
are not included in the list but remain retrievable from the
guardian.
In the current implementation, \scheme{unregister-guardian} takes time proportional
to the number of unresurrected objects currently registered with
all guardians rather than those registered just with
the corresponding guardian.
The example below assumes no collections occur except for those resulting from
explicit calls to \scheme{collect}.
\schemedisplay
(define g (make-guardian))
(define x (cons 'a 'b))
(define y (cons 'c 'd))
(g x)
(g x)
(g y)
(g y)
(set! y #f)
(collect 0 0)
(unregister-guardian g) ;=> ((a . b) (a . b))
(g) ;=> (c . d)
(g) ;=> (c . d)
(g) ;=> #f
\endschemedisplay
\scheme{unregister-guardian} can also be used to unregister ftype
pointers registered with guardians created by
\index{\scheme{ftype-guardian}}\scheme{ftype-guardian}
(Section~\ref{SECTTHREADFTYPEGUARDIANS}).
\section{Locking Objects\label{SECTSMGMTLOCKING}}
All pointers from C variables or data structures to Scheme objects
should generally be discarded before entry (or reentry) into Scheme.
When this guideline cannot be followed, the object may be
\emph{locked} via \scheme{lock-object} or via the equivalent
C library procedure \index{\scheme{Slock_object}}\scheme{Slock_object}
(Section~\ref{SECTFOREIGNCLIB}).
%----------------------------------------------------------------------------
\entryheader
\formdef{lock-object}{\categoryprocedure}{(lock-object \var{obj})}
\returns unspecified
\listlibraries
\endentryheader
\noindent
Locking an object prevents the storage manager from reclaiming or
relocating the object.
Locking should be used sparingly, as it introduces memory fragmentation
and increases storage management overhead.
Locking can also lead to accidental retention of storage if objects
are not unlocked.
Objects may be unlocked via \scheme{unlock-object} or the equivalent
C library procedure
\index{\scheme{Sunlock_object}}\scheme{Sunlock_object}.
Locking immediate values, such as fixnums, booleans, and characters,
or objects that have been made static is unnecessary but harmless.
%----------------------------------------------------------------------------
\entryheader
\formdef{unlock-object}{\categoryprocedure}{(unlock-object \var{obj})}
\returns unspecified
\listlibraries
\endentryheader
\noindent
An object may be locked more than once by successive calls to
\scheme{lock-object}, \scheme{Slock_object}, or both, in which case it must
be unlocked by an equal number of calls to
\scheme{unlock-object} or \scheme{Sunlock_object} before it is
truly unlocked.
An object contained within a locked object, such as an object in the
car of a locked pair, need not also be locked unless a separate C
pointer to the object exists.
That is, if the inner object is accessed only via an indirection of the
outer object, it should be left unlocked so that the collector is free
to relocate it during collection.
Unlocking immediate values, such as fixnums, booleans, and characters,
or objects that have been made static is unnecessary and ineffective but harmless.
%----------------------------------------------------------------------------
\entryheader
\formdef{locked-object?}{\categoryprocedure}{(locked-object? \var{obj})}
\returns \scheme{#t} if \var{obj} is locked, immediate, or static
\listlibraries
\endentryheader
\noindent
This predicate returns true if \var{obj} cannot be relocated or reclaimed
by the collector, including immediate values, such as fixnums,
booleans, and characters, and objects that have been made static.

65
csug/summary.ss Normal file
View file

@ -0,0 +1,65 @@
(define read-string
(lambda (ip)
(unless (eqv? (read-char ip) #\")
(error 'read-string "no starting double-quote"))
(list->string
(let f ()
(let ([c (read-char ip)])
(cond
[(eqv? c #\") '()]
[(or (eqv? c #\newline) (eof-object? c))
(error 'read-string "no ending double-quote")]
[else (cons c (f))]))))))
(define readrol
(lambda (ip)
(let ([c (read-char ip)])
(if (eq? c #\newline)
'()
(cons c (readrol ip))))))
(define read-line
(lambda (ip)
(if (eof-object? (peek-char ip))
(peek-char ip)
(let ([x (read-string ip)])
(cons x (readrol ip))))))
(define summary-read
(lambda (ip)
(do ([ls '() (cons line ls)]
[line (read-line ip) (read-line ip)])
((eof-object? line) (reverse! ls)))))
(define summary-sort
(lambda (x)
(sort! (lambda (x y) (string<? (car x) (car y))) x)))
(define write-list
(lambda (ls op)
(unless (null? ls)
(write-char (car ls) op)
(write-list (cdr ls) op))))
(define summary-print
(lambda (x op)
(for-each
(lambda (x) (write-list (cdr x) op) (newline op))
x)))
(define summary-make
(lambda (root)
(parameterize ((reset-handler abort))
(let ([ip (open-input-file (format "~a.rfm" root))]
[op (open-output-file (format "~a.sfm" root) 'replace)])
(dynamic-wind
(lambda () #f)
(lambda ()
(fprintf op "\\begin{thesummary}~%")
(summary-print
(summary-sort (summary-read ip))
op)
(fprintf op "\\end{thesummary}~%"))
(lambda ()
(close-input-port ip)
(close-output-port op)))))))

38
csug/summary.stex Normal file
View file

@ -0,0 +1,38 @@
% Copyright 2005-2017 Cisco Systems, Inc.
%
% Licensed under the Apache License, Version 2.0 (the "License");
% you may not use this file except in compliance with the License.
% You may obtain a copy of the License at
%
% http://www.apache.org/licenses/LICENSE-2.0
%
% Unless required by applicable law or agreed to in writing, software
% distributed under the License is distributed on an "AS IS" BASIS,
% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
% See the License for the specific language governing permissions and
% limitations under the License.
\chapter{Summary of Forms\label{CHPTFORMSUMMARY}}
The table that follows summarizes the syntactic forms and procedures
described in this book along with standard Scheme syntactic forms and
procedures.
It shows each item's category and the page number where it is defined.
Page numbers prefixed by ``t'' refer to
\index{The Scheme Programming Language, 4th Edition@\emph{The Scheme Programming Language, 4th Edition}}\emph{The
Scheme Programming Language, 4th Edition} (TSPL4).
\ifhtml
All page numbers appearing here refer to the printed version of these
books and also serve as hypertext links to the corresponding locations
in the electronic versions of these books.
\fi
% abbreviate to fit
\def\categorythreadparameter{thread param}
\def\categoryglobalparameter{global param}
\begingroup
\input{csug.sfm}
\endgroup

2173
csug/syntax.stex Normal file

File diff suppressed because it is too large Load diff

5343
csug/system.stex Normal file

File diff suppressed because it is too large Load diff

967
csug/threads.stex Normal file
View file

@ -0,0 +1,967 @@
% Copyright 2005-2017 Cisco Systems, Inc.
%
% Licensed under the Apache License, Version 2.0 (the "License");
% you may not use this file except in compliance with the License.
% You may obtain a copy of the License at
%
% http://www.apache.org/licenses/LICENSE-2.0
%
% Unless required by applicable law or agreed to in writing, software
% distributed under the License is distributed on an "AS IS" BASIS,
% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
% See the License for the specific language governing permissions and
% limitations under the License.
\chapter{Thread System\label{CHPTTHREADS}}
\index{threads}This chapter describes the \emph{Chez Scheme} thread-system procedures
and syntactic forms.
With the exception of locks, locked increment, and locked decrement,
the features of the thread system are implemented on top of the Posix
thread system (pthreads) on non-Windows-based system and directly using
the Windows API on Windows-based systems.
Consult the appropriate documentation on your system for basic details
of thread creation and interaction.
Most primitive Scheme procedures are \index{thread-safe primitives}\emph{thread-safe}, meaning
that they can be called concurrently from multiple threads.
This includes allocation operations like \var{cons} and \scheme{make-string},
accessors like \scheme{car} and \scheme{vector-ref},
numeric operators like \scheme{+} and \scheme{sqrt}, and nondestructive
higher-level primitive operators like \scheme{append} and \scheme{map}.
Simple mutation operators, like \scheme{set-car!}, \scheme{vector-set!},
and record field mutators are thread-safe.
Likewise, assignments to local variables, including assignments to
(unexported) library and top-level program variables are thread-safe.
Other destructive operators are thread safe only if they are used to
operate on different objects from those being read or modified by other
threads.
For example, assignments to global variables are thread-safe only as
long as one thread does not assign the same variable another thread
references or assigns.
Similarly, \scheme{putprop} can be called in one thread while another
concurrently calls \scheme{putprop} or \scheme{getprop} if the symbols
whose property lists are being modified or accessed differ.
In this context, most I/O operations should be considered destructive,
since they might modify a port's internal structure; see also
Section~\ref{SECTTHREADSBUFFEREDIO} for information on buffered ports.
Use of operators that are not thread-safe without proper synchronization
can corrupt the objects upon which they operate.
This corruption can lead to incorrect behavior, memory faults, and even
unrecoverable errors that cause the system to abort.
The compiler and interpreter are thread-safe to the extent that user code
evaluated during the compilation and evaluation process is thread-safe or
properly synchronized.
Thus, two or more threads
can call any of the compiler or interpreter entry points, i.e.,
\scheme{compile}, \scheme{compile-file}, \scheme{compile-program}, \scheme{compile-script},
\scheme{compile-port}, or \scheme{interpret} at the same time.
Naturally, the object-file targets of two file compilation operations that
run at the same time should be different.
The same is true for \scheme{eval} and \scheme{load} as long as
the default evaluator is used or is set explicitly to \scheme{compile},
\scheme{interpret}, or some other thread-safe evaluator.
One restriction should be observed when one of multiple threads creates or
loads compiled code, however, which is that only that thread or
subsequently created children, or children of subsequently created
children, etc., should run the code.
This is because multiple-processor systems upon which threaded code may
run might not guarantee that the data and instruction caches are
synchronized across processors.
\section{Thread Creation}
%----------------------------------------------------------------------------
\noskipentryheader
\formdef{fork-thread}{\categoryprocedure}{(fork-thread \var{thunk})}
\returns a thread object
\listlibraries
\endnoskipentryheader
\noindent
\var{thunk} must be a procedure that accepts zero arguments.
\scheme{fork-thread} invokes \var{thunk} in a new thread and returns
a thread object.
Nothing can be done with the thread object returned by
\scheme{fork-thread}, other than to print it.
Threads created by foreign code using some means other than
\scheme{fork-thread} must call \scheme{Sactivate_thread}
(Section~\ref{SECTFOREIGNCLIB}) before touching any Scheme data
or calling any Scheme procedures.
%----------------------------------------------------------------------------
\entryheader
\formdef{thread?}{\categoryprocedure}{(thread? \var{obj})}
\returns \scheme{#t} if \var{obj} is a thread object, \scheme{#f} otherwise
\listlibraries
\endentryheader
%----------------------------------------------------------------------------
\entryheader
\formdef{get-thread-id}{\categoryprocedure}{(get-thread-id)}
\returns the thread id of the current thread
\listlibraries
\endentryheader
The thread id is a thread number assigned by thread id, and has no
relationship to the process id returned by
\index{\scheme{get-process-id}}\scheme{get-process-id}, which is the same
in all threads.
\section{Mutexes}
%----------------------------------------------------------------------------
\noskipentryheader
\formdef{make-mutex}{\categoryprocedure}{(make-mutex)}
\formdef{make-mutex}{\categoryprocedure}{(make-mutex \var{name})}
\returns a new mutex object
\listlibraries
\endnoskipentryheader
\noindent
\var{name}, if supplied, must be a symbol which identifies the mutex, or
\scheme{#f} for no name. The name is printed every time the mutex is
printed, which is useful for debugging.
%----------------------------------------------------------------------------
\entryheader
\formdef{mutex?}{\categoryprocedure}{(mutex? \var{obj})}
\returns \scheme{#t} if \var{obj} is a mutex, \scheme{#f} otherwise
\listlibraries
\endentryheader
%----------------------------------------------------------------------------
\entryheader
\formdef{mutex-acquire}{\categoryprocedure}{(mutex-acquire \var{mutex})}
\formdef{mutex-acquire}{\categoryprocedure}{(mutex-acquire \var{mutex} \var{block?})}
\returns see below
\listlibraries
\endentryheader
\noindent
\var{mutex} must be a mutex.
\var{mutex-acquire} acquires the mutex identified by \var{mutex}.
The optional boolean argument \var{block?} defaults to
\scheme{#t} and specifies whether the thread should block
waiting for the mutex.
If \var{block?} is omitted or is true, the thread
blocks until the mutex has been acquired, and an unspecified
value is returned.
If \scheme{block?} is false and the mutex currently belongs
to a different thread, the current thread does not block.
Instead, \scheme{mutex-acquire} returns
immediately with the value \scheme{#f} to
indicate that the mutex is not available.
If \var{block?} is false and the mutex is successfully
acquired, \scheme{mutex-acquire} returns \scheme{#t}.
Mutexes are \emph{recursive} in Posix threads terminology, which
means that the calling thread can use \scheme{mutex-acquire} to
(re)acquire a mutex it already has.
In this case, an equal number of \scheme{mutex-release} calls
is necessary to release the mutex.
%----------------------------------------------------------------------------
\entryheader
\formdef{mutex-release}{\categoryprocedure}{(mutex-release \var{mutex})}
\returns unspecified
\listlibraries
\endentryheader
\noindent
\var{mutex} must be a mutex.
\scheme{mutex-release} releases the mutex identified by \var{mutex}.
Unpredictable behavior results if the mutex is not owned by the
calling thread.
%----------------------------------------------------------------------------
\entryheader
\formdef{with-mutex}{\categorysyntax}{(with-mutex \var{mutex} \var{body_1} \var{body_2} \dots)}
\returns the values of the body \scheme{\var{body_1} \var{body_2} \dots}
\listlibraries
\endentryheader
\noindent
\scheme{with-mutex} evaluates the expression \var{mutex}, which must
evaluate to a mutex, acquires the mutex, evaluates the body
\scheme{\var{body_1} \var{body_2} \dots}, and releases the mutex.
The mutex is released whether the body returns normally or
via a control operation (that is, throw to a continuation, perhaps because
of an error) that results in
a nonlocal exit from the \scheme{with-mutex} form.
If control subsequently returns to the body via a
continuation invocation, the mutex is reacquired.
Using \scheme{with-mutex} is generally more convenient and safer than using
\scheme{mutex-acquire} and \scheme{mutex-release} directly.
%----------------------------------------------------------------------------
\entryheader
\formdef{mutex-name}{\categoryprocedure}{(mutex-name \var{mutex})}
\returns the name associated with \var{mutex}, if any; otherwise \scheme{#f}
\listlibraries
\endentryheader
\noindent
\var{mutex} must be a mutex.
\section{Conditions}
%----------------------------------------------------------------------------
\noskipentryheader
\formdef{make-condition}{\categoryprocedure}{(make-condition)}
\formdef{make-condition}{\categoryprocedure}{(make-condition \var{name})}
\returns a new condition object
\listlibraries
\endnoskipentryheader
\noindent
\var{name}, if supplied, must be a symbol which identifies the condition
object, or \scheme{#f} for no name. The name is printed every time the
condition is printed, which is useful for debugging.
%----------------------------------------------------------------------------
\entryheader
\formdef{thread-condition?}{\categoryprocedure}{(thread-condition? \var{obj})}
\returns \scheme{#t} if \var{obj} is a condition object, \scheme{#f} otherwise
\listlibraries
\endentryheader
%----------------------------------------------------------------------------
\entryheader
\formdef{condition-wait}{\categoryprocedure}{(condition-wait \var{cond} \var{mutex})}
\formdef{condition-wait}{\categoryprocedure}{(condition-wait \var{cond} \var{mutex} \var{timeout})}
\returns \scheme{#t} if the calling thread was awakened by the condition, \scheme{#f} if the calling thread timed out waiting
\listlibraries
\endentryheader
\noindent
\var{cond} must be a condition object, and
\var{mutex} must be a mutex.
The optional argument \var{timeout} is a time record of type
\scheme{time-duration} or \scheme{time-utc}, or \scheme{#f} for no
timeout. It defaults to \scheme{#f}.
\scheme{condition-wait} waits up to the specified \var{timeout} for
the condition identified by the condition object \var{cond}.
The calling thread must have acquired the mutex identified by the mutex
\var{mutex} at the time \scheme{condition-wait} is
called.
\var{mutex} is released as a side effect of the call to
\scheme{condition-wait}.
When a thread is later released from the condition variable by one of
the procedures described below or the timeout expires, \var{mutex} is
reacquired and \scheme{condition-wait} returns.
%----------------------------------------------------------------------------
\entryheader
\formdef{condition-signal}{\categoryprocedure}{(condition-signal \var{cond})}
\returns unspecified
\listlibraries
\endentryheader
\noindent
\var{cond} must be a condition object.
\scheme{condition-signal} releases one of the threads waiting for the
condition identified by \var{cond}.
%----------------------------------------------------------------------------
\entryheader
\formdef{condition-broadcast}{\categoryprocedure}{(condition-broadcast \var{cond})}
\returns unspecified
\listlibraries
\endentryheader
\noindent
\var{cond} must be a condition object.
\scheme{condition-broadcast} releases all of the threads waiting for the
condition identified by \var{cond}.
%----------------------------------------------------------------------------
\entryheader
\formdef{condition-name}{\categoryprocedure}{(condition-name \var{condition})}
\returns the name associated with \var{condition}, if any; otherwise \scheme{#f}
\listlibraries
\endentryheader
\noindent
\var{condition} must be a condition.
\section{Locks\label{SECTTHREADLOCKS}}
\index{locks}%
Locks are more primitive but more flexible and efficient than mutexes
and can be used in situations where the added mutex functionality
is not needed or desired.
They can also be used independently of the thread system
(including in nonthreaded versions of {\ChezScheme})
to synchronize operations running in separate Scheme processes
as long as the lock is allocated in memory shared by the processes.
A lock is simply a word-sized integer, i.e., an \scheme{iptr} or
\scheme{uptr} foreign type (Section~\ref{SECTFOREIGNDATA}) with the native
endianness of the target machine, possibly part of a larger structure
defined using \scheme{define-ftype} (page~\pageref{defn:define-ftype}).
It must be explicitly allocated in memory that resides outside the Scheme
heap and, when appropriate, explicitly deallocated.
When just threads are involved (i.e., when multiple processes are not
involved), the memory can be allocated via \scheme{foreign-alloc}.
When multiple processes are involved, the lock should be allocated in
some area shared by the processes that will interact with the lock.
Once initialized using \scheme{ftype-init-lock!}, a process or thread
can attempt to lock the lock via \scheme{ftype-lock!} or \scheme{ftype-spin-lock!}.
Once the lock has been locked and before it is unlocked, further
attempts to lock the lock fail, even by the process or thread that
most recently locked it.
Locks can be unlocked, via \scheme{ftype-unlock!}, by any process or thread,
not just by the process or thread that most recently locked the lock.
The lock mechanism provides little structure, and mistakes
in allocation and use can lead to memory faults, deadlocks,
and other problems.
Thus, it is usually advisable to use locks only as part of a
higher-level abstraction that ensures locks are used in a
disciplined manner.
\schemedisplay
(define lock
(make-ftype-pointer uptr
(foreign-alloc (ftype-sizeof uptr))))
(ftype-init-lock! uptr () lock)
(ftype-lock! uptr () lock) ;=> #t
(ftype-lock! uptr () lock) ;=> #f
(ftype-unlock! uptr () lock)
(ftype-spin-lock! uptr () lock)
(ftype-lock! uptr () lock) ;=> #f
(ftype-unlock! uptr () lock)
\endschemedisplay
\entryheader
\formdef{ftype-init-lock!}{\categorysyntax}{(ftype-init-lock! \var{ftype-name} (\var{a} ...) \var{fptr-expr})}
\formdef{ftype-init-lock!}{\categorysyntax}{(ftype-init-lock! \var{ftype-name} (\var{a} ...) \var{fptr-expr} \var{index})}
\returns unspecified
\formdef{ftype-lock!}{\categorysyntax}{(ftype-lock! \var{ftype-name} (\var{a} ...) \var{fptr-expr})}
\formdef{ftype-lock!}{\categorysyntax}{(ftype-lock! \var{ftype-name} (\var{a} ...) \var{fptr-expr} \var{index})}
\returns \scheme{#t} if the lock is not already locked, \scheme{#f} otherwise
\formdef{ftype-spin-lock!}{\categorysyntax}{(ftype-spin-lock! \var{ftype-name} (\var{a} ...) \var{fptr-expr})}
\formdef{ftype-spin-lock!}{\categorysyntax}{(ftype-spin-lock! \var{ftype-name} (\var{a} ...) \var{fptr-expr} \var{index})}
\returns unspecified
\formdef{ftype-unlock!}{\categorysyntax}{(ftype-unlock! \var{ftype-name} (\var{a} ...) \var{fptr-expr})}
\formdef{ftype-unlock!}{\categorysyntax}{(ftype-unlock! \var{ftype-name} (\var{a} ...) \var{fptr-expr} \var{index})}
\returns unspecified
\listlibraries
\endentryheader
Each of these has a syntax like and behaves similarly to
\scheme{ftype-set!} (page~\pageref{defn:ftype-set!}), though with an implicit
\var{val-expr}.
In particular, the restrictions on and handling of \var{fptr-expr}
and the accessors \scheme{\var{a} \dots} is similar, with one important
restriction: the field specified by the last accessor, upon which
the form operates, must be a word-size integer, i.e., an
\scheme{iptr}, \scheme{uptr}, or the equivalent, with the native
endianness.
\scheme{ftype-init-lock!} should be used to initialize the lock prior
to the use of any of the other operators; if this is not done, the
behavior of the other operators is undefined.
\scheme{ftype-lock!} can be used to lock the lock.
If it finds the lock unlocked at the time of the operation, it locks
the lock and returns \scheme{#t}; if it finds the lock already locked,
it returns \scheme{#f} without changing the lock.
\scheme{ftype-spin-lock!} can also be used to lock the lock.
If it finds the lock unlocked at the time of the operation, it locks the
lock and returns; if it finds the lock already locked, it waits until
the lock is unlocked, then locks the lock and returns.
If no other thread or process unlocks the lock, the operation does
not return and cannot be interrupted by normal means, including by the
storage manager for the purpose of initiating a garbage collection.
There are also no guarantees of fairness, so a process might hang
indefinitely even if other processes are actively locking and unlocking
the lock.
\scheme{ftype-unlock!} is used to unlock a lock.
If it finds the lock locked, it unlocks the lock and returns.
Otherwise, it returns without changing the lock.
\section{Locked increment and decrement\label{SECTTHREADLOCKEDINCRDECR}}
The locked operations described here can be used when just an atomic
increment or decrement is required.
\entryheader
\formdef{ftype-locked-incr!}{\categorysyntax}{(ftype-locked-incr! \var{ftype-name} (\var{a} ...) \var{fptr-expr})}
\formdef{ftype-locked-incr!}{\categorysyntax}{(ftype-locked-incr! \var{ftype-name} (\var{a} ...) \var{fptr-expr} \var{index})}
\returns \scheme{#t} if the updated value is 0, \scheme{#f} otherwise
\formdef{ftype-locked-decr!}{\categorysyntax}{(ftype-locked-decr! \var{ftype-name} (\var{a} ...) \var{fptr-expr})}
\formdef{ftype-locked-decr!}{\categorysyntax}{(ftype-locked-decr! \var{ftype-name} (\var{a} ...) \var{fptr-expr} \var{index})}
\returns \scheme{#t} if the updated value is 0, \scheme{#f} otherwise
\listlibraries
\endentryheader
Each of these has a syntax like and behaves similarly to
\scheme{ftype-set!} (page~\pageref{defn:ftype-set!}), though with an implicit
\var{val-expr}.
In particular, the restrictions on and handling of \var{fptr-expr}
and the accessors \scheme{\var{a} \dots} is similar, with one important
restriction: the field specified by the last accessor, upon which
the form operates, must be a word-size integer, i.e., an
\scheme{iptr}, \scheme{uptr}, or the equivalent, with the native
endianness.
\scheme{ftype-locked-incr!} atomically reads the value of the specified
field, adds $1$ to the value, and writes the new value back into the
field.
Similarly, \scheme{ftype-locked-decr!} atomically reads the value of
the specified field, subtracts $1$ from the value, and writes the new
value back into the field.
Both return \scheme{#t} if the new value is 0, otherwise \scheme{#f}.
\section{Reference counting with ftype guardians\label{SECTTHREADFTYPEGUARDIANS}}
\index{\scheme{ftype-guardian}}%
Applications that manage memory outside the Scheme heap can leverage
the Scheme storage management system to help perform reference
counting via \emph{ftype guardians}.
In a reference-counted memory management system, each object holds
a count of pointers to it.
The count is incremented when a new pointer is created and decremented
when a pointer is dropped.
When the count reaches zero, the object is no longer needed and the
memory it formerly occupied can be made available for some other
purpose.
Ftype guardians are similar to guardians created by
\index{\scheme{make-guardian}}\scheme{make-guardian}
(Section~\ref{SECTGUARDWEAKPAIRS}).
The \index{\scheme{guardian?}}\scheme{guardian?} procedure returns
true for both, and the
\index{\scheme{unregister-guardian}}\scheme{unregister-guardian}
procedure can be used to unregister objects registered with either.
\entryheader
\formdef{ftype-guardian}{\categorysyntax}{(ftype-guardian \var{ftype-name})}
\returns a new ftype guardian
\listlibraries
\endentryheader
\var{ftype-name} must name an ftype.
The first base field of the ftype (or one of the first base fields
in the case of unions) must be a word-sized integer (iptr or uptr)
with native endianness.
This field is assumed to hold a reference count.
The return value is a new ftype guardian \var{g}, with which
ftype-pointers of type \var{ftype-name} (or some subtype of
\var{ftype-name}) can be registered.
An ftype pointer is registered with \var{g} by invoking \var{g}
with the ftype pointer as an argument.
An ftype guardian does not automatically protect from collection
the ftype pointers registered with it, as a normal guardian would
do.
Instead, for each registered ftype pointer that becomes inaccessible
via normal (non-weak, non-guardian pointers), the guardian decrements
the reference count of the object to which the ftype pointer points.
If the resulting reference-count value is zero, the ftype pointer
is preserved and can be retrieved from the guardian.
If the resulting reference-count value is non-zero, however, the
ftype pointer is not preserved.
Objects retrieved from an ftype guardian (by calling it without
arguments) are guaranteed to have zero reference counts, assuming
reference counts are maintained properly by code outside the
collector.
The collector decrements the reference count using the equivalent
of \index{\scheme{ftype-locked-decr!}}\scheme{ftype-locked-decr!}
to support systems in which non-Scheme objects are stored in memory
shared by multiple processes.
In such systems, programs should themselves use
\index{\scheme{ftype-locked-incr!}}\scheme{ftype-locked-incr!} and
\scheme{ftype-locked-decr!} or non-Scheme equivalents (e.g., the C
\index{\scheme{LOCKED_INCR}}\scheme{LOCKED_INCR} and
\index{\scheme{LOCKED_INCR}}\scheme{LOCKED_DECR} macros in scheme.h,
which are described in Section~\ref{SECTFOREIGNCLIB}) to maintain
reference counts.
The following example defines a simple ftype and an allocator for
objects of that ftype that frees any objects of that ftype that were
previously allocated and no longer accessible.
\schemedisplay
(module (A make-A free-dropped-As)
(define-ftype A
(struct
[refcount uptr]
[data int]))
(define g (ftype-guardian A))
(define free-dropped-As
(lambda ()
(let ([a (g)])
(when a
(printf "freeing ~s\n" (ftype-ref A (data) a))
(foreign-free (ftype-pointer-address a))
(free-dropped-As)))))
(define make-A
(lambda (n)
(free-dropped-As)
(let ([a (make-ftype-pointer A (foreign-alloc (ftype-sizeof A)))])
(ftype-set! A (refcount) a 1)
(ftype-set! A (data) a n)
(g a)
a))))
\endschemedisplay
We can test this by allocating, dropping, and immediately collecting
ftype pointers to A.
\schemedisplay
> (do ([i 10 (fx- i 1)])
((fx= i 0))
(make-A i)
(collect))
freeing 10
freeing 9
freeing 8
freeing 7
freeing 6
freeing 5
freeing 4
freeing 3
freeing 2
> (free-dropped-As)
freeing 1
\endschemedisplay
Objects guarded by an ftype guardian might contain pointers to other
objects whose reference counts should also be incremented upon
allocation of the containing object and decremented upon freeing
of the containing object.
\section{Thread Parameters\label{SECTTHREADPARAMETERS}}
%----------------------------------------------------------------------------
\noskipentryheader
\formdef{make-thread-parameter}{\categoryprocedure}{(make-thread-parameter \var{object})}
\formdef{make-thread-parameter}{\categoryprocedure}{(make-thread-parameter \var{object} \var{procedure})}
\returns a new thread parameter
\listlibraries
\endnoskipentryheader
\noindent
See Section~\ref{SECTPARAMETERS} for a general
discussion of parameters and the use of the optional second argument.
When a thread parameter is created, a separate location is set aside
in each current and future thread to hold the value of the parameter's
internal state variable.
(This location may be eliminated by the storage manager when the
parameter becomes inaccessible.)
Changes to the thread parameter in one thread are not seen by any
other thread.
When a new thread is created (see \scheme{fork-thread}),
the current value (not location) of each
thread parameter is inherited from the forking thread by the new thread.
Similarly, when a thread created by some other means is activated for the
first time (see \scheme{Sactivate_thread} in
Section~\ref{SECTFOREIGNCLIB}), the current value (not location) of each
thread parameter is inherited from the main (original) thread by the new
thread.
Most built-in parameters are thread parameters, but some are global.
All are marked as global or thread where they are defined.
There is no distinction between built-in global and thread parameters
in the nonthreaded versions of the system.
\section{Buffered I/O\label{SECTTHREADSBUFFEREDIO}}
Chez Scheme buffers file I/O operations for efficiency, but buffered
I/O is not thread safe.
Two threads that write to or read from the same buffered port concurrently
can corrupt the port, resulting in buffer overruns and, ultimately,
invalid memory references.
Buffering on binary output ports can be disabled when opened with
buffer-mode \scheme{none}.
Buffering on input ports cannot be completely disabled, however, due to
the need to support lookahead, and buffering on textual ports, even
textual output ports, cannot be disabled completely because the
transcoders that convert between characters and bytes sometimes
require some lookahead.
Two threads should thus \emph{never} read from or write to the same port
concurrently, except in the special case of a binary output port
opened buffer-mode \scheme{none}.
Alternatives include appointing one thread to perform all I/O for a
given port and providing a per-thread generic-port wrapper that
forwards requests to the port only after acquiring a mutex.
The initial console and current input and output ports are thread-safe,
as are transcript ports, so it is safe for multiple threads to print error
and/or debugging messages to the console.
The output may be interleaved, even within the same line, but the port
will not become corrupted.
Thread safety for these ports is accomplished at the high cost of
acquiring a mutex for each I/O operation.
\section{Example: Bounded Queues}
The following code, taken from the article
``A Scheme for native threads~\cite{Dybvig:mitchfest-threads},''
implements a bounded queue using many of the
thread-system features.
A bounded queue has a fixed number of available slots.
Attempting to enqueue when the queue is full causes the calling thread
to block.
Attempting to dequeue from an empty queue causes the calling thread
to block.
%%% from thread article
\schemedisplay
(define-record-type bq
(fields
(immutable data)
(mutable head)
(mutable tail)
(immutable mutex)
(immutable ready)
(immutable room))
(protocol
(lambda (new)
(lambda (bound)
(new (make-vector bound) 0 0 (make-mutex)
(make-condition) (make-condition))))))
(define dequeue!
(lambda (q)
(with-mutex (bq-mutex q)
(let loop ()
(let ([head (bq-head q)])
(cond
[(= head (bq-tail q))
(condition-wait (bq-ready q) (bq-mutex q))
(loop)]
[else
(bq-head-set! q (incr q head))
(condition-signal (bq-room q))
(vector-ref (bq-data q) head)]))))))
(define enqueue!
(lambda (item q)
(with-mutex (bq-mutex q)
(let loop ()
(let* ([tail (bq-tail q)] [tail^ (incr q tail)])
(cond
[(= tail^ (bq-head q))
(condition-wait (bq-room q) (bq-mutex q))
(loop)]
[else
(vector-set! (bq-data q) tail item)
(bq-tail-set! q tail^)
(condition-signal (bq-ready q))]))))))
(define incr
(lambda (q i)
(modulo (+ i 1) (vector-length (bq-data q)))))
\endschemedisplay
\noindent
The code below demonstrates the use of the bounded queue abstraction
with a set of threads that act as consumers and producers of the
data in the queue.
\schemedisplay
(define job-queue)
(define die? #f)
(define make-job
(let ([count 0])
(define fib
(lambda (n)
(if (< n 2)
n
(+ (fib (- n 2)) (fib (- n 1))))))
(lambda (n)
(set! count (+ count 1))
(printf "Adding job #~s = (lambda () (fib ~s))\n" count n)
(cons count (lambda () (fib n))))))
(define make-producer
(lambda (n)
(rec producer
(lambda ()
(printf "producer ~s posting a job\n" n)
(enqueue! (make-job (+ 20 (random 10))) job-queue)
(if die?
(printf "producer ~s dying\n" n)
(producer))))))
(define make-consumer
(lambda (n)
(rec consumer
(lambda ()
(printf "consumer ~s looking for a job~%" n)
(let ([job (dequeue! job-queue)])
(if die?
(printf "consumer ~s dying\n" n)
(begin
(printf "consumer ~s executing job #~s~%" n (car job))
(printf "consumer ~s computed: ~s~%" n ((cdr job)))
(consumer))))))))
(define (bq-test np nc)
(set! job-queue (make-bq (max nc np)))
(do ([np np (- np 1)])
((<= np 0))
(fork-thread (make-producer np)))
(do ([nc nc (- nc 1)])
((<= nc 0))
(fork-thread (make-consumer nc))))
\endschemedisplay
\noindent
Here are a possible first several lines of output from a sample run of the example program.
\schemedisplay
> (begin
(bq-test 3 4)
(system "sleep 3")
(set! die? #t))
producer 3 posting a job
Adding job #1 = (lambda () (fib 29))
producer 3 posting a job
Adding job #2 = (lambda () (fib 26))
producer 3 posting a job
Adding job #3 = (lambda () (fib 22))
producer 3 posting a job
Adding job #4 = (lambda () (fib 21))
producer 2 posting a job
Adding job #5 = (lambda () (fib 29))
producer 1 posting a job
Adding job #6 = (lambda () (fib 29))
consumer 4 looking for a job
producer 3 posting a job
Adding job #7 = (lambda () (fib 24))
consumer 4 executing job #1
consumer 3 looking for a job
producer 2 posting a job
Adding job #8 = (lambda () (fib 26))
consumer 3 executing job #2
consumer 3 computed: 121393
consumer 3 looking for a job
producer 1 posting a job
Adding job #9 = (lambda () (fib 26))
...
\endschemedisplay
Additional examples, including definitions of suspendable threads and
threads that automatically terminate when they become inaccessible, are
given in ``A Scheme for native threads~\cite{Dybvig:mitchfest-threads}.''
% \section{Thread System OOP Interface}
%
% The thread system OOP interface consists of one new form,
% \scheme{define-threaded-class}.
% This form provides a high-level interface for acquiring mutexes
% and waiting for conditions.
% A \scheme{define-threaded-class} form has the following general
% syntax:
%
% \schemedisplay
% (define-threaded-class (\var{name} \var{fmls}) (\var{parent} \var{expr} \dots)
% (state [\var{ivar} \var{init}] \dots)
% (init \var{expr} \dots)
% (conditions
% [\var{cname} \var{pred}]
% \dots)
% (methods
% [locked \var{mname} \var{mfmls} \var{body}]
% \dots))
% \endschemedisplay
%
% \noindent
% Each of the labeled sections (\scheme{state}, \scheme{init},
% \scheme{conditions}, and \scheme{methods}) is optional, as is
% the \scheme{locked} keyword.
% The \scheme{locked} keyword may be applied to all, none, or
% some of the methods in a threaded-class definition.
%
% The \scheme{conditions} subform and the \scheme{locked} keyword are
% extensions to the \scheme{define-class} syntax.
% If no \scheme{conditions} subform is given and no \scheme{locked} keywords are
% present, \scheme{define-threaded-class} is identical to
% \scheme{define-class}, both in syntax and semantics.
%
% If any methods are annotated with the \scheme{locked} keyword, a
% mutex is associated with each instance of the class, and those
% methods automatically acquire and release the mutex as if the
% body were wrapped in a \scheme{with-mutex} form.
% The following definition of a \scheme{stack} class demonstrates
% the \scheme{locked} keyword.
%
% \schemedisplay
% (define-threaded-class (<stack>) (<base>)
% (state [pdl '()])
% (methods
% [locked push (v)
% (set! pdl (cons v pdl))]
% [locked pop (default)
% (if (null? pdl)
% default
% (let ([v (car pdl)])
% (set! pdl (cdr pdl))
% v))]))
% \endschemedisplay
%
% \noindent
% The \scheme{push} method adds an item to the top of the stack.
% The \scheme{pop} method removes an item from the top of the
% stack and returns it, unless the stack is empty, in which case
% it returns the default value passed in by the caller.
%
% This may seem like an unnecessarily complex version of \scheme{pop}.
% A simpler and more familiar approach would be to provide an
% \scheme{empty?} method for determining if the contains any items
% and to remove this test form \scheme{pop} as follows.
%
% \schemedisplay
% (define-threaded-class (<simpler-stack>) (<base>)
% (state [pdl '()])
% (methods
% [empty (v) (null? pdl)]
% [locked push (v)
% (set! pdl (cons v pdl))]
% [locked pop ()
% (let ([v (car pdl)])
% (set! pdl (cdr pdl))
% v)]))
% \endschemedisplay
%
% \noindent
% Because it does not update the stack, \scheme{empty?} need not be
% locked.
% Unfortunately, \scheme{empty?} is not useful in a threaded environment,
% because another thread may pop the stack in between the time
% \scheme{empty?} and \scheme{pop} are called.
% In general, the entire operation to be performed, including
% any questions to be asked and any mutations to
% be performed, must be encapsulated within a single locked
% method.
%
% It is possible to have a useful method that need not be locked.
% The following version of \scheme{<stack>} maintains a count of
% objects pushed onto the stack over time, and the
% \scheme{count} method is used to retrieve this count.
%
% \schemedisplay
% (define-threaded-class (<stack>) (<base>)
% (state [pdl '()] [count 0])
% (methods
% [count () count]
% [locked push (v)
% (set! count (+ count 1))
% (set! pdl (cons v pdl))]
% [locked pop (default)
% (if (null? pdl)
% default
% (let ([v (car pdl)])
% (set! pdl (cdr pdl))
% v))]))
% \endschemedisplay
%
% \noindent
% Although \scheme{count} may be out of date as soon as the caller
% receives it, the value returned is guaranteed to be a valid
% count at some time after the method call is made and before the
% method call returns.
%
% A condition variable
% is associated with each instance of the class.
% for each \scheme{(\var{cname} \var{pred})} pair in the
% \scheme{conditions} subform.
% The identifiers \scheme{\var{cname} \dots} name the associated
% conditions within the methods of the class.
% The predicate \var{pred} associated with a condition is an
% expression that should evaluate to a true value if and only
% if the condition is considered satisfied.
% The predicate expression may refer to the instance variables
% of the class.
%
% A method waits for a condition to be satisfied using the
% \scheme{require} form, which is valid only within the locked
% methods of the class.
%
% \schemedisplay
% (require \var{cname} \var{body})
% \endschemedisplay
%
% \noindent
% When a thread evaluates a \scheme{require} form, it evaluates
% the predicate associated with \var{cname}.
% If the predicate returns a true value, the thread proceeds to
% evaluate \var{body}.
% If the predicate returns false, it waits for the associated
% condition variable, as if with an explicit call to condition wait,
% Upon being released from the condition variable (by a signal
% or broadcast from another thread), the thread loops back to
% check the predicate again.
% Control thus does not reach the body of the \scheme{require}
% form until the predicate evaluates to a true value.
%
% Waiting threads may be released from a condition by applying
% either \scheme{condition-signal} or \scheme{condition-broadcast}
% to the value of the corresponding \var{cname}.
% %%% [Question: must the signaling thread be locked?]
%
% Here is a \scheme{<bq>} test that redefines the bounded queue.
% Compare this with the earlier definitions of the \scheme{<bq>},
% \scheme{enqueue!}, and \scheme{dequeue!}.
%
% \schemedisplay
% (define-threaded-class (<bq> i) (<base>)
% (state [i i] [vec (make-vector i)])
% (conditions
% [ready (not (= i (vector-length vec)))]
% [room (not (= i 0))])
% (methods
% [locked enqueue! (item)
% (require room
% (set! i (- i 1))
% (vector-set! vec i item)
% (condition-signal ready))]
% [locked dequeue! ()
% (require ready
% (let ([item (vector-ref vec i)])
% (set! i (+ i 1))
% (condition-signal room)
% item))]))
% \endschemedisplay
%
%

37
csug/title.stex Normal file
View file

@ -0,0 +1,37 @@
% Copyright 2005-2017 Cisco Systems, Inc.
%
% Licensed under the Apache License, Version 2.0 (the "License");
% you may not use this file except in compliance with the License.
% You may obtain a copy of the License at
%
% http://www.apache.org/licenses/LICENSE-2.0
%
% Unless required by applicable law or agreed to in writing, software
% distributed under the License is distributed on an "AS IS" BASIS,
% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
% See the License for the specific language governing permissions and
% limitations under the License.
\iflatex
\thispagestyle{empty}
\leftline{}
\vskip 6pc
{\titlefont\hbox to \textwidth{Chez Scheme Version 9\hfil}}
\vskip 10pt
{\titlefont\hbox to \textwidth{User's Guide\hfil}}
% \vskip 9pc
\vfill\vfill
\begingroup\large
\begin{flushright}
\includegraphics[width=1.25in]{canned/cisco-logo-large}\\[10pt]
Cisco Systems, Inc.\\
www.cisco.com
\end{flushright}
\endgroup
\pagebreak
\fi

1101
csug/tspl.bst Normal file

File diff suppressed because it is too large Load diff

131
csug/tspl4-prep.stex Normal file
View file

@ -0,0 +1,131 @@
%%% tspl4-prep.stex
%%% Copyright (c) 1998 R, Kent Dybvig
%%%
%%% Permission is hereby granted, free of charge, to any person obtaining a
%%% copy of this software and associated documentation files (the "Software"),
%%% to deal in the Software without restriction, including without limitation
%%% the rights to use, copy, modify, merge, publish, distribute, sublicense,
%%% and/or sell copies of the Software, and to permit persons to whom the
%%% Software is furnished to do so, subject to the following conditions:
%%%
%%% The above copyright notice and this permission notice shall be included in
%%% all copies or substantial portions of the Software.
%%%
%%% THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
%%% IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
%%% FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
%%% THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
%%% LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
%%% FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
%%% DEALINGS IN THE SOFTWARE.
\schemeinit
(define false #f)
(define true #t)
(define names '())
(define listlibraries-seen? false)
\endschemeinit
\xdef\entryheader{\schemeinit
(unless (null? names) (errorf 'entryheader "name list is not empty ~s" names))
(set! listlibraries-seen? false)
\endschemeinit%
\xedef\entrylab{\genlab}\raw{\entryheader}\label{\entrylab}}
\xdef\noskipentryheader{\schemeinit
(unless (null? names) (errorf 'entryheader "name list is not empty ~s" names))
(set! listlibraries-seen? false)
\endschemeinit%
\xedef\entrylab{\genlab}\raw{\noskipentryheader}\label{\entrylab}}
\xdef\endentryheader{\schemeinit
(unless listlibraries-seen? (errorf 'endentryheader "no \\listlibraries seen"))
(unless (null? names) (errorf 'endentryheader "name list is not empty ~s" names))
\endschemeinit%
\raw{\endentryheader
}}
% \formdef{primitive name}{\categorytype}{form}
\xdef\formdef#1#2#3{\schemeinit
(set! names (cons "#1" names))\endschemeinit%
\hindex{\entrylab}{\scheme{#1}|emph}%
\raw{\formdef}{#2}{\scheme{#3}}%
\formsummary{\raw{#1}}{#2}{\scheme{#3}}{\entrylab}}
% \xformdef{sort key}{index entry}{type}{form}
\xdef\xformdef#1#2#3#4{\hindex{\entrylab}{#2|emph}%
\raw{\formdef}{#3}{\scheme{#4}}%
\formsummary{\raw{#1}}{#3}{\scheme{#4}}{\entrylab}}
% \suppress\formdef{primitive name}{\categorytype}{form}
\xdef\suppress\formdef#1#2#3{\schemeinit
(set! names (cons "#1" names))(set! listlibraries-seen? false)\endschemeinit%
\hindex{\entrylab}{\scheme{#1}|emph}%
\formsummary{\raw{#1}}{#2}{\scheme{#3}}{\entrylab}}
\xdef\conditionformdef#1{\generated
(docond '#1)\endgenerated\xdef\showit{This condition type might be defined as follows.
\schemedisplay
#1
\endschemedisplay}}
\xdef\libraryexport#1{\schemeinit
(set! names (cons "#1" names))\endschemeinit}
\xdef\exercise{\xedef\anslab{\genlab}\raw{\exercise}{\label{\anslab}}}
\xdef\answer#1{\raw{\answer}{#1}{\anslab}}
\schemeinit
(module (list-libraries)
(define libht (make-eq-hashtable))
(define (list-libraries)
(define (getlibs x)
(or (hashtable-ref libht (string->symbol x) #f)
(errorf 'list-libraries "no libraries for ~a defined" x)))
(when (null? names) (errorf 'list-libraries "name list is empty"))
(let ([libs (getlibs (car names))])
(for-each
(lambda (name)
(unless (equal? (getlibs name) libs)
(errorf 'list-libraries "libs ~s for ~a don't match libs ~s for ~a" libs (car names) (getlibs name) name)))
(cdr names))
(with-output-to-file "libslisted"
(lambda () (for-each (lambda (x) (printf "~a\n" x)) names))
'append)
(let f ([libs libs] [sep " "])
(unless (null? libs)
(printf "~a\\scheme{~a}" sep (car libs))
(f (cdr libs) ", ")))))
(call-with-output-file "libsrecorded"
(lambda (op)
(include "priminfo.ss")
(import priminfo)
(define (record-libs name libs)
(unless (null? libs)
(when (hashtable-ref libht name #f)
(errorf 'record-libs "libs already defined for ~s" name))
(fprintf op "~a\n" name)
(hashtable-set! libht name
(sort (lambda (x y)
(or (> (length x) (length y))
(and (= (length x) (length y))
(ormap (lambda (x y)
(string<? (symbol->string x) (symbol->string y)))
x y))))
libs))))
(vector-for-each
(lambda (prim) (record-libs prim (get-libraries prim)))
(primvec)))
'replace))
\endschemeinit
\xdef\listlibraries{\raw{\libraries}\generated
(list-libraries)(set! names '())(set! listlibraries-seen? true)
\endgenerated
}
\xdef\nolistlibraries{\generated
(set! names '())(set! listlibraries-seen? true)
\endgenerated
}

20
csug/tspl4/answers.aux Normal file
View file

@ -0,0 +1,20 @@
\relax
\@writefile{toc}{\contentsline {chapter}{Answers to Selected Exercises}{435}}
\@writefile{lof}{\addvspace {10\p@ }}
\@writefile{lot}{\addvspace {10\p@ }}
\newlabel{listapply}{{2}{437}}
\newlabel{cdrapply}{{4}{437}}
\@setckpt{answers}{
\setcounter{page}{454}
\setcounter{equation}{0}
\setcounter{enumi}{8}
\setcounter{enumii}{0}
\setcounter{enumiii}{0}
\setcounter{enumiv}{32}
\setcounter{footnote}{0}
\setcounter{mpfootnote}{0}
\setcounter{chapter}{12}
\setcounter{section}{11}
\setcounter{exercise}{7}
\setcounter{alphacount}{6}
}

View file

@ -0,0 +1,52 @@
\relax
\bibstyle{tspl}
\bibdata{tspl}
\bibcite{adams:equal}{1}
\bibcite{ashley:mvalues}{2}
\bibcite{bawden:pepm99}{3}
\bibcite{Briggs:dft}{4}
\bibcite{Burger:floatprinting}{5}
\bibcite{Clocksin:prolog}{6}
\bibcite{Daniel:prolog-fft}{7}
\bibcite{UnicodeUAX29}{8}
\bibcite{Dybvig:csug8}{9}
\bibcite{Dybvig:engines}{10}
\bibcite{Dybvig:lambdastar}{11}
\bibcite{Dybvig:syntactic}{12}
\bibcite{Friedman:lisper}{13}
\@writefile{toc}{\contentsline {chapter}{References}{431}}
\@writefile{lof}{\addvspace {10\p@ }}
\@writefile{lot}{\addvspace {10\p@ }}
\bibcite{Friedman:devils}{14}
\bibcite{Haynes:abstracting}{15}
\bibcite{Haynes:obtaining}{16}
\bibcite{Hieb:representing}{17}
\bibcite{IEEE:1178}{18}
\bibcite{Kernighan:C}{19}
\bibcite{RFC4122}{20}
\bibcite{Naur:algol}{21}
\bibcite{Plaisted:sets}{22}
\bibcite{Robinson:unification}{23}
\bibcite{r6rs}{24}
\bibcite{r6rsapps}{25}
\bibcite{r6rslibs}{26}
\bibcite{Steele:common}{27}
\bibcite{Steele:scheme}{28}
\bibcite{Sussman-Steele:HOSC98}{29}
\bibcite{Unicode}{30}
\bibcite{waddell:fixing-letrec}{31}
\bibcite{Wand:HOSC99}{32}
\@setckpt{bibliography}{
\setcounter{page}{434}
\setcounter{equation}{0}
\setcounter{enumi}{3}
\setcounter{enumii}{0}
\setcounter{enumiii}{0}
\setcounter{enumiv}{32}
\setcounter{footnote}{0}
\setcounter{mpfootnote}{0}
\setcounter{chapter}{12}
\setcounter{section}{11}
\setcounter{exercise}{7}
\setcounter{alphacount}{3}
}

73
csug/tspl4/binding.aux Normal file
View file

@ -0,0 +1,73 @@
\relax
\@writefile{toc}{\contentsline {chapter}{\numberline {4}Procedures and Variable Bindings}{89}}
\@writefile{lof}{\addvspace {10\p@ }}
\@writefile{lot}{\addvspace {10\p@ }}
\newlabel{CHPTBINDING}{{4}{89}}
\newlabel{./binding:s0}{{4}{91}}
\newlabel{./binding:s1}{{4}{91}}
\newlabel{SECTVARREF}{{4.1}{91}}
\@writefile{toc}{\contentsline {section}{\numberline {4.1}Variable References}{91}}
\newlabel{./binding:s2}{{4.1}{91}}
\newlabel{SECTLAMBDA}{{4.2}{92}}
\@writefile{toc}{\contentsline {section}{\numberline {4.2}Lambda}{92}}
\newlabel{./binding:s3}{{4.2}{92}}
\newlabel{./binding:s4}{{4.2}{92}}
\newlabel{./binding:s5}{{4.2}{92}}
\newlabel{./binding:s6}{{4.2}{92}}
\newlabel{./binding:s7}{{4.2}{92}}
\newlabel{./binding:s8}{{4.2}{92}}
\newlabel{SECTOPTARGS}{{4.3}{93}}
\@writefile{toc}{\contentsline {section}{\numberline {4.3}Case-Lambda}{93}}
\newlabel{./binding:s9}{{4.3}{93}}
\newlabel{./binding:s10}{{4.3}{93}}
\citation{Dybvig:lambdastar}
\newlabel{./binding:s11}{{4.3}{94}}
\newlabel{./binding:s12}{{4.3}{94}}
\newlabel{./binding:s13}{{4.3}{94}}
\newlabel{./binding:s14}{{4.3}{94}}
\newlabel{./binding:s15}{{4.3}{95}}
\newlabel{SECTLOCALBINDING}{{4.4}{95}}
\@writefile{toc}{\contentsline {section}{\numberline {4.4}Local Binding}{95}}
\newlabel{./binding:s16}{{4.4}{95}}
\newlabel{./binding:s17}{{4.4}{95}}
\newlabel{./binding:s18}{{4.4}{96}}
\newlabel{./binding:s19}{{4.4}{96}}
\newlabel{defn:let*}{{4.4}{97}}
\newlabel{./binding:s20}{{4.4}{97}}
\newlabel{./binding:s21}{{4.4}{97}}
\citation{waddell:fixing-letrec}
\newlabel{./binding:s22}{{4.4}{98}}
\newlabel{desc:letrec*}{{4.4}{98}}
\newlabel{SECTLETVALUES}{{4.5}{99}}
\@writefile{toc}{\contentsline {section}{\numberline {4.5}Multiple Values}{99}}
\newlabel{./binding:s23}{{4.5}{99}}
\newlabel{desc:let-values}{{4.5}{99}}
\newlabel{SECTDEFINITIONS}{{4.6}{100}}
\@writefile{toc}{\contentsline {section}{\numberline {4.6}Variable Definitions}{100}}
\newlabel{./binding:s24}{{4.6}{100}}
\newlabel{./binding:s25}{{4.6}{100}}
\newlabel{./binding:s26}{{4.6}{101}}
\newlabel{multi-define-syntax}{{4.6}{101}}
\newlabel{./binding:s27}{{4.6}{101}}
\newlabel{SECTASSIGNMENTS}{{4.7}{102}}
\@writefile{toc}{\contentsline {section}{\numberline {4.7}Assignment}{102}}
\newlabel{./binding:s28}{{4.7}{102}}
\newlabel{./binding:s29}{{4.7}{102}}
\newlabel{./binding:s30}{{4.7}{102}}
\newlabel{./binding:s31}{{4.7}{102}}
\newlabel{./binding:s32}{{4.7}{102}}
\newlabel{./binding:s33}{{4.7}{102}}
\@setckpt{binding}{
\setcounter{page}{104}
\setcounter{equation}{0}
\setcounter{enumi}{6}
\setcounter{enumii}{0}
\setcounter{enumiii}{0}
\setcounter{enumiv}{0}
\setcounter{footnote}{0}
\setcounter{mpfootnote}{0}
\setcounter{chapter}{4}
\setcounter{section}{7}
\setcounter{exercise}{0}
\setcounter{alphacount}{6}
}

15
csug/tspl4/contents.aux Normal file
View file

@ -0,0 +1,15 @@
\relax
\@setckpt{contents}{
\setcounter{page}{9}
\setcounter{equation}{0}
\setcounter{enumi}{0}
\setcounter{enumii}{0}
\setcounter{enumiii}{0}
\setcounter{enumiv}{0}
\setcounter{footnote}{0}
\setcounter{mpfootnote}{0}
\setcounter{chapter}{0}
\setcounter{section}{0}
\setcounter{exercise}{0}
\setcounter{alphacount}{0}
}

130
csug/tspl4/control.aux Normal file
View file

@ -0,0 +1,130 @@
\relax
\@writefile{toc}{\contentsline {chapter}{\numberline {5}Control Operations}{105}}
\@writefile{lof}{\addvspace {10\p@ }}
\@writefile{lot}{\addvspace {10\p@ }}
\newlabel{CHPTCONTROL}{{5}{105}}
\newlabel{./control:s0}{{5}{107}}
\newlabel{SECTAPPLICATION}{{5.1}{107}}
\@writefile{toc}{\contentsline {section}{\numberline {5.1}Procedure Application}{107}}
\newlabel{./control:s1}{{5.1}{107}}
\newlabel{./control:s2}{{5.1}{107}}
\newlabel{./control:s3}{{5.1}{107}}
\newlabel{desc:apply}{{5.1}{107}}
\newlabel{SECTSEQUENCING}{{5.2}{108}}
\@writefile{toc}{\contentsline {section}{\numberline {5.2}Sequencing}{108}}
\newlabel{./control:s4}{{5.2}{108}}
\newlabel{./control:s5}{{5.2}{108}}
\newlabel{./control:s6}{{5.2}{108}}
\newlabel{./control:s7}{{5.2}{109}}
\newlabel{SECTCONDITIONALS}{{5.3}{109}}
\@writefile{toc}{\contentsline {section}{\numberline {5.3}Conditionals}{109}}
\newlabel{./control:s8}{{5.3}{109}}
\newlabel{./control:s9}{{5.3}{109}}
\newlabel{./control:s10}{{5.3}{110}}
\newlabel{./control:s11}{{5.3}{110}}
\newlabel{./control:s12}{{5.3}{110}}
\newlabel{./control:s13}{{5.3}{111}}
\newlabel{./control:s14}{{5.3}{111}}
\newlabel{./control:s15}{{5.3}{111}}
\newlabel{./control:s16}{{5.3}{112}}
\newlabel{./control:s17}{{5.3}{112}}
\newlabel{./control:s18}{{5.3}{113}}
\newlabel{./control:s19}{{5.3}{113}}
\newlabel{SECTRECURSION}{{5.4}{114}}
\@writefile{toc}{\contentsline {section}{\numberline {5.4}Recursion and Iteration}{114}}
\newlabel{./control:s20}{{5.4}{114}}
\newlabel{./control:s21}{{5.4}{114}}
\newlabel{./control:s22}{{5.4}{114}}
\newlabel{./control:s23}{{5.4}{114}}
\newlabel{./control:s24}{{5.4}{115}}
\newlabel{./control:s25}{{5.4}{115}}
\newlabel{./control:s26}{{5.4}{115}}
\newlabel{./control:s27}{{5.4}{116}}
\newlabel{./control:s28}{{5.4}{116}}
\newlabel{./control:s29}{{5.4}{116}}
\@writefile{toc}{\contentsline {section}{\numberline {5.5}Mapping and Folding}{117}}
\newlabel{./control:s30}{{5.5}{117}}
\newlabel{./control:s31}{{5.5}{117}}
\newlabel{./control:s32}{{5.5}{117}}
\newlabel{./control:s33}{{5.5}{118}}
\newlabel{desc:for-each}{{5.5}{118}}
\newlabel{./control:s34}{{5.5}{118}}
\newlabel{./control:s35}{{5.5}{118}}
\newlabel{./control:s36}{{5.5}{119}}
\newlabel{./control:s37}{{5.5}{119}}
\newlabel{./control:s38}{{5.5}{120}}
\newlabel{./control:s39}{{5.5}{120}}
\newlabel{./control:s40}{{5.5}{120}}
\newlabel{./control:s41}{{5.5}{121}}
\newlabel{./control:s42}{{5.5}{121}}
\newlabel{./control:s43}{{5.5}{121}}
\newlabel{./control:s44}{{5.5}{121}}
\newlabel{./control:s45}{{5.5}{121}}
\newlabel{./control:s46}{{5.5}{121}}
\newlabel{./control:s47}{{5.5}{122}}
\newlabel{./control:s48}{{5.5}{122}}
\newlabel{./control:s49}{{5.5}{122}}
\newlabel{./control:s50}{{5.5}{122}}
\newlabel{./control:s51}{{5.5}{122}}
\newlabel{./control:s52}{{5.5}{122}}
\newlabel{SECTCONTINUATIONS}{{5.6}{122}}
\@writefile{toc}{\contentsline {section}{\numberline {5.6}Continuations}{122}}
\newlabel{./control:s53}{{5.6}{122}}
\citation{Friedman:devils}
\citation{Sussman-Steele:HOSC98}
\citation{Haynes:obtaining}
\citation{Dybvig:engines}
\citation{Wand:HOSC99}
\citation{Hieb:representing}
\newlabel{./control:s54}{{5.6}{123}}
\newlabel{./control:s55}{{5.6}{123}}
\newlabel{./control:s56}{{5.6}{124}}
\newlabel{desc:dynamic-wind}{{5.6}{124}}
\newlabel{./control:s57}{{5.6}{124}}
\newlabel{./control:s58}{{5.6}{124}}
\newlabel{./control:s59}{{5.6}{124}}
\newlabel{./control:s60}{{5.6}{124}}
\newlabel{./control:s61}{{5.6}{125}}
\newlabel{./control:s62}{{5.6}{126}}
\newlabel{./control:s63}{{5.6}{127}}
\newlabel{SECTDELAYED}{{5.7}{127}}
\@writefile{toc}{\contentsline {section}{\numberline {5.7}Delayed Evaluation}{127}}
\newlabel{./control:s64}{{5.7}{127}}
\newlabel{./control:s65}{{5.7}{128}}
\newlabel{./control:s66}{{5.7}{128}}
\newlabel{./control:s67}{{5.7}{129}}
\newlabel{SECTMRVS}{{5.8}{130}}
\@writefile{toc}{\contentsline {section}{\numberline {5.8}Multiple Values}{130}}
\newlabel{./control:s68}{{5.8}{130}}
\newlabel{./control:s69}{{5.8}{130}}
\newlabel{./control:s70}{{5.8}{131}}
\newlabel{./control:s71}{{5.8}{131}}
\newlabel{./control:s72}{{5.8}{131}}
\newlabel{./control:s73}{{5.8}{132}}
\newlabel{./control:s74}{{5.8}{132}}
\newlabel{./control:s75}{{5.8}{132}}
\newlabel{./control:s76}{{5.8}{133}}
\newlabel{./control:s77}{{5.8}{133}}
\newlabel{./control:s78}{{5.8}{134}}
\newlabel{./control:s79}{{5.8}{134}}
\newlabel{defn:call-with-port}{{5.8}{135}}
\citation{ashley:mvalues}
\newlabel{SECTEVAL}{{5.9}{136}}
\@writefile{toc}{\contentsline {section}{\numberline {5.9}Eval}{136}}
\newlabel{./control:s80}{{5.9}{136}}
\newlabel{./control:s81}{{5.9}{137}}
\newlabel{./control:s82}{{5.9}{137}}
\@setckpt{control}{
\setcounter{page}{138}
\setcounter{equation}{0}
\setcounter{enumi}{6}
\setcounter{enumii}{0}
\setcounter{enumiii}{0}
\setcounter{enumiv}{0}
\setcounter{footnote}{0}
\setcounter{mpfootnote}{0}
\setcounter{chapter}{5}
\setcounter{section}{9}
\setcounter{exercise}{0}
\setcounter{alphacount}{6}
}

15
csug/tspl4/copyright.aux Normal file
View file

@ -0,0 +1,15 @@
\relax
\@setckpt{copyright}{
\setcounter{page}{5}
\setcounter{equation}{0}
\setcounter{enumi}{0}
\setcounter{enumii}{0}
\setcounter{enumiii}{0}
\setcounter{enumiv}{0}
\setcounter{footnote}{0}
\setcounter{mpfootnote}{0}
\setcounter{chapter}{0}
\setcounter{section}{0}
\setcounter{exercise}{0}
\setcounter{alphacount}{0}
}

165
csug/tspl4/examples.aux Normal file
View file

@ -0,0 +1,165 @@
\relax
\@writefile{toc}{\contentsline {chapter}{\numberline {12}Extended Examples}{379}}
\@writefile{lof}{\addvspace {10\p@ }}
\@writefile{lot}{\addvspace {10\p@ }}
\newlabel{CHPTEXAMPLES}{{12}{379}}
\citation{Kernighan:C}
\newlabel{./examples:s0}{{12}{381}}
\newlabel{SECTEXMATMUL}{{12.1}{381}}
\@writefile{toc}{\contentsline {section}{\numberline {12.1}Matrix and Vector Multiplication}{381}}
\newlabel{./examples:s1}{{12.1}{381}}
\newlabel{./examples:s2}{{12.1}{382}}
\newlabel{./examples:s3}{{12.1}{383}}
\newlabel{./examples:s4}{{12.1.1}{386}}
\newlabel{./examples:s5}{{12.1.2}{386}}
\newlabel{exercise:reliable}{{12.1.2}{386}}
\newlabel{./examples:s6}{{12.1.3}{386}}
\newlabel{./examples:s7}{{12.1.4}{386}}
\newlabel{./examples:s8}{{12.1.5}{386}}
\newlabel{SECTEXSORTMERGE}{{12.2}{387}}
\@writefile{toc}{\contentsline {section}{\numberline {12.2}Sorting}{387}}
\newlabel{./examples:s9}{{12.2}{387}}
\newlabel{./examples:s10}{{12.2}{387}}
\newlabel{./examples:s11}{{12.2}{387}}
\newlabel{./examples:s12}{{12.2.1}{388}}
\newlabel{./examples:s13}{{12.2.2}{388}}
\newlabel{./examples:s14}{{12.2.3}{388}}
\citation{Plaisted:sets}
\newlabel{SECTEXSETS}{{12.3}{389}}
\@writefile{toc}{\contentsline {section}{\numberline {12.3}A Set Constructor}{389}}
\newlabel{./examples:s15}{{12.3}{389}}
\newlabel{./examples:s16}{{12.3}{389}}
\newlabel{./examples:s17}{{12.3}{389}}
\newlabel{./examples:s18}{{12.3}{389}}
\citation{Kernighan:C}
\newlabel{./examples:s19}{{12.3.1}{392}}
\newlabel{./examples:s20}{{12.3.2}{392}}
\newlabel{./examples:s21}{{12.3.2}{392}}
\newlabel{./examples:s22}{{12.3.3}{392}}
\newlabel{SECTEXWORDFREQ}{{12.4}{393}}
\@writefile{toc}{\contentsline {section}{\numberline {12.4}Word Frequency Counting}{393}}
\newlabel{./examples:s23}{{12.4}{393}}
\newlabel{./examples:s24}{{12.4}{393}}
\citation{r6rsapps}
\newlabel{./examples:s25}{{12.4.1}{396}}
\newlabel{./examples:s26}{{12.4.2}{396}}
\newlabel{./examples:s27}{{12.4.3}{396}}
\newlabel{./examples:s28}{{12.4.4}{396}}
\newlabel{./examples:s29}{{12.4.5}{396}}
\newlabel{./examples:s30}{{12.4.6}{397}}
\newlabel{SECTEXPRINTER}{{12.5}{397}}
\@writefile{toc}{\contentsline {section}{\numberline {12.5}Scheme Printer}{397}}
\newlabel{./examples:s31}{{12.5}{397}}
\newlabel{./examples:s32}{{12.5}{397}}
\newlabel{./examples:s33}{{12.5}{397}}
\newlabel{./examples:s34}{{12.5.1}{400}}
\newlabel{./examples:s35}{{12.5.2}{400}}
\newlabel{EXOBJTOSTR}{{12.5.2}{400}}
\newlabel{./examples:s36}{{12.5.3}{400}}
\newlabel{SECTEXPRINTF}{{12.6}{401}}
\@writefile{toc}{\contentsline {section}{\numberline {12.6}Formatted Output}{401}}
\newlabel{./examples:s37}{{12.6}{401}}
\newlabel{./examples:s38}{{12.6}{401}}
\newlabel{./examples:s39}{{12.6}{401}}
\newlabel{./examples:s40}{{12.6.1}{402}}
\newlabel{./examples:s41}{{12.6.2}{402}}
\newlabel{./examples:s42}{{12.6.3}{403}}
\newlabel{./examples:s43}{{12.6.4}{403}}
\newlabel{./examples:s44}{{12.6.5}{403}}
\newlabel{./examples:s45}{{12.6.6}{403}}
\newlabel{SECTEXINTERPRET}{{12.7}{404}}
\@writefile{toc}{\contentsline {section}{\numberline {12.7}A Meta-Circular Interpreter for Scheme}{404}}
\newlabel{./examples:s46}{{12.7}{404}}
\newlabel{./examples:s47}{{12.7}{404}}
\newlabel{./examples:s48}{{12.7}{404}}
\newlabel{./examples:s49}{{12.7}{404}}
\newlabel{./examples:s50}{{12.7}{404}}
\newlabel{./examples:s51}{{12.7}{404}}
\newlabel{./examples:s52}{{12.7.1}{407}}
\newlabel{./examples:s53}{{12.7.2}{407}}
\newlabel{./examples:s54}{{12.7.3}{407}}
\newlabel{./examples:s55}{{12.7.4}{407}}
\newlabel{./examples:s56}{{12.7.5}{407}}
\newlabel{./examples:s57}{{12.7.5}{407}}
\newlabel{./examples:s58}{{12.7.5}{408}}
\newlabel{./examples:s59}{{12.7.5}{408}}
\newlabel{SECTEXOBJECTS}{{12.8}{408}}
\@writefile{toc}{\contentsline {section}{\numberline {12.8}Defining Abstract Objects}{408}}
\newlabel{./examples:s60}{{12.8}{408}}
\newlabel{./examples:s61}{{12.8}{408}}
\newlabel{./examples:s62}{{12.8}{408}}
\newlabel{./examples:s63}{{12.8}{408}}
\citation{Briggs:dft}
\newlabel{./examples:s64}{{12.8.1}{412}}
\newlabel{./examples:s65}{{12.8.2}{412}}
\newlabel{./examples:s66}{{12.8.3}{412}}
\newlabel{./examples:s67}{{12.8.3}{412}}
\newlabel{./examples:s68}{{12.8.4}{412}}
\newlabel{SECTEXFFT}{{12.9}{412}}
\@writefile{toc}{\contentsline {section}{\numberline {12.9}Fast Fourier Transform}{412}}
\newlabel{./examples:s69}{{12.9}{412}}
\newlabel{./examples:s70}{{12.9}{412}}
\citation{Daniel:prolog-fft}
\citation{Daniel:prolog-fft}
\newlabel{./examples:s71}{{12.9.1}{416}}
\citation{Robinson:unification}
\citation{Clocksin:prolog}
\newlabel{./examples:s72}{{12.9.2}{417}}
\newlabel{./examples:s73}{{12.9.3}{417}}
\newlabel{./examples:s74}{{12.9.4}{417}}
\newlabel{./examples:s75}{{12.9.5}{417}}
\newlabel{SECTEXUNIFY}{{12.10}{417}}
\@writefile{toc}{\contentsline {section}{\numberline {12.10}A Unification Algorithm}{417}}
\newlabel{./examples:s76}{{12.10}{417}}
\newlabel{./examples:s77}{{12.10}{418}}
\newlabel{./examples:s78}{{12.10}{418}}
\citation{Dybvig:engines}
\citation{Haynes:abstracting}
\newlabel{./examples:s79}{{12.10.1}{420}}
\newlabel{./examples:s80}{{12.10.2}{420}}
\newlabel{./examples:s81}{{12.10.3}{420}}
\newlabel{SECTEXENGINES}{{12.11}{421}}
\@writefile{toc}{\contentsline {section}{\numberline {12.11}Multitasking with Engines}{421}}
\newlabel{./examples:s82}{{12.11}{421}}
\newlabel{./examples:s83}{{12.11}{421}}
\newlabel{./examples:s84}{{12.11}{421}}
\newlabel{./examples:s85}{{12.11}{421}}
\newlabel{./examples:s86}{{12.11}{421}}
\newlabel{./examples:s87}{{12.11}{421}}
\newlabel{./examples:s88}{{12.11}{421}}
\newlabel{./examples:s89}{{1}{421}}
\newlabel{./examples:s90}{{2}{421}}
\newlabel{./examples:s91}{{3}{421}}
\newlabel{./examples:s92}{{12.11}{422}}
\newlabel{./examples:s93}{{12.11}{423}}
\newlabel{./examples:s94}{{12.11}{423}}
\newlabel{./examples:s95}{{12.11}{424}}
\newlabel{./examples:s96}{{12.11}{424}}
\newlabel{./examples:s97}{{12.11}{425}}
\newlabel{./examples:s98}{{12.11}{425}}
\newlabel{./examples:s99}{{12.11}{426}}
\newlabel{./examples:s100}{{12.11}{426}}
\newlabel{./examples:s101}{{12.11.1}{428}}
\newlabel{./examples:s102}{{12.11.2}{428}}
\citation{Dybvig:engines}
\newlabel{./examples:s103}{{12.11.3}{429}}
\newlabel{./examples:s104}{{12.11.4}{429}}
\newlabel{./examples:s105}{{12.11.5}{429}}
\newlabel{./examples:s106}{{12.11.5}{429}}
\newlabel{./examples:s107}{{12.11.6}{429}}
\newlabel{./examples:s108}{{12.11.7}{429}}
\newlabel{./examples:s109}{{12.11.7}{429}}
\@setckpt{examples}{
\setcounter{page}{430}
\setcounter{equation}{0}
\setcounter{enumi}{3}
\setcounter{enumii}{0}
\setcounter{enumiii}{0}
\setcounter{enumiv}{0}
\setcounter{footnote}{0}
\setcounter{mpfootnote}{0}
\setcounter{chapter}{12}
\setcounter{section}{11}
\setcounter{exercise}{7}
\setcounter{alphacount}{3}
}

69
csug/tspl4/exceptions.aux Normal file
View file

@ -0,0 +1,69 @@
\relax
\@writefile{toc}{\contentsline {chapter}{\numberline {11}Exceptions and Conditions}{355}}
\@writefile{lof}{\addvspace {10\p@ }}
\@writefile{lot}{\addvspace {10\p@ }}
\newlabel{CHPTEXCEPTIONS}{{11}{355}}
\newlabel{./exceptions:s0}{{11}{357}}
\newlabel{./exceptions:s1}{{11}{357}}
\newlabel{./exceptions:s2}{{11}{357}}
\@writefile{toc}{\contentsline {section}{\numberline {11.1}Raising and Handling Exceptions}{357}}
\newlabel{./exceptions:s3}{{11.1}{357}}
\newlabel{./exceptions:s4}{{11.1}{358}}
\newlabel{./exceptions:s5}{{11.1}{359}}
\newlabel{./exceptions:s6}{{11.1}{359}}
\newlabel{./exceptions:s7}{{11.1}{360}}
\newlabel{./exceptions:s8}{{11.1}{361}}
\@writefile{toc}{\contentsline {section}{\numberline {11.2}Defining Condition Types}{361}}
\newlabel{./exceptions:s9}{{11.2}{361}}
\newlabel{./exceptions:s10}{{11.2}{361}}
\newlabel{./exceptions:s11}{{11.2}{362}}
\newlabel{./exceptions:s12}{{11.2}{362}}
\newlabel{./exceptions:s13}{{11.2}{362}}
\newlabel{./exceptions:s14}{{11.2}{362}}
\newlabel{./exceptions:s15}{{11.2}{362}}
\newlabel{./exceptions:s16}{{11.2}{363}}
\newlabel{./exceptions:s17}{{11.2}{364}}
\newlabel{./exceptions:s18}{{11.2}{365}}
\newlabel{SECTEXCCONDTYPES}{{11.3}{366}}
\@writefile{toc}{\contentsline {section}{\numberline {11.3}Standard Condition Types}{366}}
\newlabel{./exceptions:s19}{{11.3}{366}}
\newlabel{./exceptions:s20}{{11.3}{366}}
\newlabel{./exceptions:s21}{{11.3}{366}}
\newlabel{./exceptions:s22}{{11.3}{367}}
\newlabel{./exceptions:s23}{{11.3}{367}}
\newlabel{./exceptions:s24}{{11.3}{368}}
\newlabel{./exceptions:s25}{{11.3}{368}}
\newlabel{./exceptions:s26}{{11.3}{369}}
\newlabel{./exceptions:s27}{{11.3}{369}}
\newlabel{./exceptions:s28}{{11.3}{369}}
\newlabel{./exceptions:s29}{{11.3}{370}}
\newlabel{./exceptions:s30}{{11.3}{370}}
\newlabel{./exceptions:s31}{{11.3}{371}}
\newlabel{./exceptions:s32}{{11.3}{371}}
\newlabel{./exceptions:s33}{{11.3}{372}}
\newlabel{./exceptions:s34}{{11.3}{372}}
\newlabel{./exceptions:s35}{{11.3}{372}}
\newlabel{./exceptions:s36}{{11.3}{373}}
\newlabel{./exceptions:s37}{{11.3}{373}}
\newlabel{./exceptions:s38}{{11.3}{374}}
\newlabel{./exceptions:s39}{{11.3}{374}}
\newlabel{./exceptions:s40}{{11.3}{374}}
\newlabel{./exceptions:s41}{{11.3}{375}}
\newlabel{./exceptions:s42}{{11.3}{375}}
\newlabel{./exceptions:s43}{{11.3}{376}}
\newlabel{./exceptions:s44}{{11.3}{376}}
\newlabel{./exceptions:s45}{{11.3}{377}}
\@setckpt{exceptions}{
\setcounter{page}{378}
\setcounter{equation}{0}
\setcounter{enumi}{6}
\setcounter{enumii}{0}
\setcounter{enumiii}{0}
\setcounter{enumiv}{0}
\setcounter{footnote}{0}
\setcounter{mpfootnote}{0}
\setcounter{chapter}{11}
\setcounter{section}{3}
\setcounter{exercise}{0}
\setcounter{alphacount}{6}
}

132
csug/tspl4/further.aux Normal file
View file

@ -0,0 +1,132 @@
\relax
\@writefile{toc}{\contentsline {chapter}{\numberline {3}Going Further}{57}}
\@writefile{lof}{\addvspace {10\p@ }}
\@writefile{lot}{\addvspace {10\p@ }}
\newlabel{CHPTGOINGFURTHER}{{3}{57}}
\newlabel{SECTGFSYNTAX}{{3.1}{59}}
\@writefile{toc}{\contentsline {section}{\numberline {3.1}Syntactic Extension}{59}}
\newlabel{./further:s0}{{3.1}{59}}
\newlabel{./further:s1}{{3.1}{59}}
\newlabel{./further:s2}{{3.1}{59}}
\newlabel{./further:s3}{{3.1}{59}}
\newlabel{./further:s4}{{3.1}{59}}
\newlabel{./further:s5}{{3.1}{59}}
\newlabel{./further:s6}{{3.1}{59}}
\newlabel{./further:s7}{{3.1}{59}}
\newlabel{./further:s8}{{3.1}{59}}
\newlabel{./further:s9}{{3.1}{60}}
\newlabel{./further:s10}{{3.1}{60}}
\newlabel{./further:s11}{{3.1}{60}}
\newlabel{./further:s12}{{3.1}{60}}
\newlabel{./further:s13}{{3.1}{61}}
\newlabel{./further:s14}{{3.1}{61}}
\newlabel{./further:s15}{{3.1}{61}}
\newlabel{./further:s16}{{3.1}{61}}
\newlabel{./further:s17}{{3.1}{61}}
\newlabel{./further:s18}{{3.1}{61}}
\newlabel{./further:s19}{{3.1}{61}}
\newlabel{./further:s20}{{3.1}{61}}
\newlabel{./further:s21}{{3.1}{61}}
\newlabel{./further:s22}{{3.1}{62}}
\newlabel{defn:and}{{3.1}{62}}
\newlabel{./further:s23}{{3.1}{63}}
\newlabel{defn:or}{{3.1}{63}}
\newlabel{./further:s24}{{3.1}{63}}
\newlabel{./further:s25}{{3.1.1}{64}}
\newlabel{./further:s26}{{3.1.2}{64}}
\newlabel{./further:s27}{{3.1.3}{64}}
\newlabel{./further:s28}{{3.1.3}{64}}
\newlabel{./further:s29}{{3.1.4}{64}}
\newlabel{./further:s30}{{3.1.4}{64}}
\newlabel{./further:s31}{{3.1.4}{64}}
\newlabel{SECTGFMORERECURSION}{{3.2}{65}}
\@writefile{toc}{\contentsline {section}{\numberline {3.2}More Recursion}{65}}
\newlabel{./further:s32}{{3.2}{65}}
\newlabel{./further:s33}{{3.2}{65}}
\newlabel{./further:s34}{{3.2}{65}}
\newlabel{./further:s35}{{3.2}{65}}
\newlabel{./further:s36}{{3.2}{66}}
\newlabel{./further:s37}{{3.2}{66}}
\newlabel{./further:s38}{{3.2}{66}}
\newlabel{defn:even?/odd?}{{3.2}{66}}
\newlabel{./further:s39}{{3.2}{66}}
\newlabel{./further:s40}{{3.2}{66}}
\newlabel{defn:list?}{{3.2}{67}}
\newlabel{./further:s41}{{3.2}{67}}
\newlabel{./further:s42}{{3.2}{67}}
\newlabel{./further:s43}{{3.2}{68}}
\newlabel{./further:s44}{{3.2}{68}}
\newlabel{./further:s45}{{3.2}{68}}
\newlabel{./further:s46}{{3.2}{68}}
\newlabel{fibonacci}{{3.2}{69}}
\newlabel{./further:s47}{{3.2}{69}}
\newlabel{./further:s48}{{3.2}{69}}
\newlabel{./further:s49}{{3.2}{70}}
\newlabel{./further:s50}{{3.2}{71}}
\newlabel{./further:s51}{{3.2}{71}}
\newlabel{./further:s52}{{3.2.1}{72}}
\newlabel{./further:s53}{{3.2.2}{72}}
\newlabel{./further:s54}{{3.2.2}{72}}
\newlabel{./further:s55}{{3.2.3}{72}}
\newlabel{./further:s56}{{3.2.4}{72}}
\newlabel{./further:s57}{{3.2.5}{73}}
\newlabel{./further:s58}{{3.2.6}{73}}
\newlabel{ex:incorrect-or}{{3.2.6}{73}}
\newlabel{./further:s59}{{3.2.7}{73}}
\newlabel{./further:s60}{{3.2.7}{73}}
\newlabel{SECTGFCONTINUATIONS}{{3.3}{73}}
\@writefile{toc}{\contentsline {section}{\numberline {3.3}Continuations}{73}}
\newlabel{./further:s61}{{3.3}{73}}
\newlabel{./further:s62}{{3.3}{74}}
\newlabel{./further:s63}{{3.3}{74}}
\newlabel{defn:product-call/cc}{{3.3}{75}}
\newlabel{./further:s64}{{3.3}{75}}
\newlabel{./further:s65}{{3.3}{75}}
\newlabel{retry}{{3.3}{75}}
\newlabel{./further:s66}{{3.3.1}{77}}
\newlabel{./further:s67}{{3.3.2}{77}}
\newlabel{./further:s68}{{3.3.3}{77}}
\newlabel{./further:s69}{{3.3.4}{77}}
\newlabel{./further:s70}{{3.3.5}{77}}
\newlabel{SECTGFCPS}{{3.4}{78}}
\@writefile{toc}{\contentsline {section}{\numberline {3.4}Continuation Passing Style}{78}}
\newlabel{./further:s71}{{3.4}{78}}
\newlabel{./further:s72}{{3.4}{78}}
\newlabel{./further:s73}{{3.4}{79}}
\newlabel{./further:s74}{{3.4}{80}}
\newlabel{./further:s75}{{3.4.1}{80}}
\newlabel{./further:s76}{{3.4.1}{80}}
\newlabel{./further:s77}{{3.4.2}{80}}
\newlabel{./further:s78}{{3.4.2}{80}}
\newlabel{./further:s79}{{3.4.3}{80}}
\newlabel{SECTGFINTERNAL}{{3.5}{81}}
\@writefile{toc}{\contentsline {section}{\numberline {3.5}Internal Definitions}{81}}
\newlabel{./further:s80}{{3.5}{81}}
\newlabel{./further:s81}{{3.5}{81}}
\newlabel{./further:s82}{{3.5}{81}}
\newlabel{./further:s83}{{3.5}{81}}
\newlabel{./further:s84}{{3.5}{81}}
\newlabel{./further:s85}{{3.5}{81}}
\newlabel{./further:s86}{{3.5.1}{85}}
\newlabel{./further:s87}{{3.5.2}{85}}
\newlabel{./further:s88}{{3.5.3}{85}}
\newlabel{./further:s89}{{3.5.4}{85}}
\newlabel{SECTGFLIBRARIES}{{3.6}{85}}
\@writefile{toc}{\contentsline {section}{\numberline {3.6}Libraries}{85}}
\newlabel{./further:s90}{{3.6.1}{87}}
\newlabel{./further:s91}{{3.6.2}{87}}
\newlabel{./further:s92}{{3.6.3}{87}}
\@setckpt{further}{
\setcounter{page}{89}
\setcounter{equation}{0}
\setcounter{enumi}{6}
\setcounter{enumii}{0}
\setcounter{enumiii}{0}
\setcounter{enumiv}{0}
\setcounter{footnote}{0}
\setcounter{mpfootnote}{0}
\setcounter{chapter}{3}
\setcounter{section}{6}
\setcounter{exercise}{3}
\setcounter{alphacount}{6}
}

53
csug/tspl4/grammar.aux Normal file
View file

@ -0,0 +1,53 @@
\relax
\citation{Unicode}
\@writefile{toc}{\contentsline {chapter}{Formal Syntax}{455}}
\@writefile{lof}{\addvspace {10\p@ }}
\@writefile{lot}{\addvspace {10\p@ }}
\newlabel{APPENDIXFORMALSYNTAX}{{12.11.7}{455}}
\newlabel{./grammar:s0}{{12.11.7}{455}}
\newlabel{./grammar:s1}{{12.11.7}{455}}
\newlabel{./grammar:s2}{{12.11.7}{455}}
\newlabel{./grammar:s3}{{12.11.7}{455}}
\newlabel{./grammar:s4}{{12.11.7}{455}}
\newlabel{./grammar:s5}{{12.11.7}{455}}
\newlabel{./grammar:s6}{{12.11.7}{455}}
\newlabel{./grammar:s7}{{12.11.7}{455}}
\newlabel{./grammar:s8}{{12.11.7}{455}}
\newlabel{./grammar:s9}{{12.11.7}{455}}
\newlabel{./grammar:s10}{{12.11.7}{455}}
\newlabel{./grammar:s11}{{12.11.7}{455}}
\newlabel{./grammar:s12}{{12.11.7}{456}}
\newlabel{grammar:datums}{{12.11.7}{456}}
\newlabel{./grammar:s13}{{12.11.7}{456}}
\newlabel{grammar:booleans}{{12.11.7}{457}}
\newlabel{./grammar:s14}{{12.11.7}{457}}
\newlabel{grammar:characters}{{12.11.7}{457}}
\newlabel{./grammar:s15}{{12.11.7}{457}}
\newlabel{grammar:strings}{{12.11.7}{458}}
\newlabel{./grammar:s16}{{12.11.7}{458}}
\newlabel{grammar:symbols}{{12.11.7}{458}}
\newlabel{./grammar:s17}{{12.11.7}{458}}
\newlabel{grammar:numbers}{{12.11.7}{459}}
\newlabel{./grammar:s18}{{12.11.7}{459}}
\newlabel{grammar:lists}{{12.11.7}{460}}
\newlabel{./grammar:s19}{{12.11.7}{460}}
\newlabel{./grammar:s20}{{12.11.7}{460}}
\newlabel{./grammar:s21}{{12.11.7}{460}}
\newlabel{grammar:vectors}{{12.11.7}{461}}
\newlabel{./grammar:s22}{{12.11.7}{461}}
\newlabel{grammar:bytevectors}{{12.11.7}{461}}
\newlabel{./grammar:s23}{{12.11.7}{461}}
\@setckpt{grammar}{
\setcounter{page}{462}
\setcounter{equation}{0}
\setcounter{enumi}{8}
\setcounter{enumii}{0}
\setcounter{enumiii}{0}
\setcounter{enumiv}{32}
\setcounter{footnote}{0}
\setcounter{mpfootnote}{0}
\setcounter{chapter}{12}
\setcounter{section}{11}
\setcounter{exercise}{7}
\setcounter{alphacount}{6}
}

85
csug/tspl4/intro.aux Normal file
View file

@ -0,0 +1,85 @@
\relax
\@writefile{toc}{\contentsline {chapter}{\numberline {1}Introduction}{1}}
\@writefile{lof}{\addvspace {10\p@ }}
\@writefile{lot}{\addvspace {10\p@ }}
\newlabel{CHPTINTRO}{{1}{1}}
\citation{r6rs}
\newlabel{./intro:s0}{{1}{3}}
\newlabel{./intro:s1}{{1}{3}}
\newlabel{./intro:s2}{{1}{3}}
\newlabel{./intro:s3}{{1}{3}}
\newlabel{./intro:s4}{{1}{3}}
\newlabel{./intro:s5}{{1}{4}}
\newlabel{./intro:s6}{{1}{4}}
\newlabel{./intro:s7}{{1}{4}}
\newlabel{./intro:s8}{{1}{4}}
\newlabel{./intro:s9}{{1}{4}}
\newlabel{./intro:s10}{{1}{4}}
\newlabel{./intro:s11}{{1}{4}}
\newlabel{./intro:s12}{{1}{4}}
\newlabel{./intro:s13}{{1}{4}}
\newlabel{./intro:s14}{{1}{4}}
\newlabel{./intro:s15}{{1}{4}}
\newlabel{./intro:s16}{{1}{5}}
\newlabel{./intro:s17}{{1}{5}}
\newlabel{./intro:s18}{{1}{5}}
\newlabel{./intro:s19}{{1}{5}}
\newlabel{./intro:s20}{{1}{5}}
\newlabel{./intro:s21}{{1}{5}}
\newlabel{./intro:s22}{{1}{5}}
\newlabel{./intro:s23}{{1}{5}}
\newlabel{./intro:s24}{{1}{5}}
\newlabel{./intro:s25}{{1}{5}}
\citation{Naur:algol}
\citation{Steele:common}
\newlabel{./intro:s26}{{1}{6}}
\newlabel{./intro:s27}{{1}{6}}
\newlabel{./intro:s28}{{1}{6}}
\newlabel{SECTINTROSYNTAX}{{1.1}{6}}
\@writefile{toc}{\contentsline {section}{\numberline {1.1}Scheme Syntax}{6}}
\newlabel{./intro:s29}{{1.1}{6}}
\newlabel{./intro:s30}{{1.1}{6}}
\newlabel{./intro:s31}{{1.1}{7}}
\newlabel{./intro:s32}{{1.1}{7}}
\newlabel{./intro:s33}{{1.1}{7}}
\newlabel{./intro:s34}{{1.1}{7}}
\newlabel{./intro:s35}{{1.1}{7}}
\newlabel{./intro:s36}{{1.1}{7}}
\newlabel{./intro:s37}{{1.1}{7}}
\newlabel{./intro:s38}{{1.1}{7}}
\newlabel{./intro:s39}{{1.1}{7}}
\newlabel{./intro:s40}{{1.1}{7}}
\newlabel{./intro:s41}{{1.1}{7}}
\newlabel{./intro:s42}{{1.1}{7}}
\newlabel{./intro:s43}{{1.1}{7}}
\newlabel{./intro:s44}{{1.1}{7}}
\newlabel{SECTINTRONAMING}{{1.2}{8}}
\@writefile{toc}{\contentsline {section}{\numberline {1.2}Scheme Naming Conventions}{8}}
\newlabel{./intro:s45}{{1.2}{8}}
\newlabel{./intro:s46}{{1.2}{8}}
\newlabel{./intro:s47}{{1.2}{8}}
\newlabel{./intro:s48}{{1.2}{8}}
\newlabel{./intro:s49}{{1.2}{8}}
\newlabel{./intro:s50}{{1.2}{8}}
\newlabel{./intro:s51}{{1.2}{8}}
\newlabel{./intro:s52}{{1.2}{8}}
\newlabel{SECTINTRONOTATION}{{1.3}{9}}
\@writefile{toc}{\contentsline {section}{\numberline {1.3}Typographical and Notational Conventions}{9}}
\newlabel{./intro:s53}{{1.3}{9}}
\newlabel{./intro:s54}{{1.3}{9}}
\newlabel{./intro:s55}{{1.3}{9}}
\newlabel{./intro:s56}{{1.3}{9}}
\@setckpt{intro}{
\setcounter{page}{11}
\setcounter{equation}{0}
\setcounter{enumi}{0}
\setcounter{enumii}{0}
\setcounter{enumiii}{0}
\setcounter{enumiv}{0}
\setcounter{footnote}{0}
\setcounter{mpfootnote}{0}
\setcounter{chapter}{1}
\setcounter{section}{3}
\setcounter{exercise}{0}
\setcounter{alphacount}{0}
}

141
csug/tspl4/io.aux Normal file
View file

@ -0,0 +1,141 @@
\relax
\@writefile{toc}{\contentsline {chapter}{\numberline {7}Input and Output}{255}}
\@writefile{lof}{\addvspace {10\p@ }}
\@writefile{lot}{\addvspace {10\p@ }}
\newlabel{CHPTIO}{{7}{255}}
\newlabel{./io:s0}{{7}{257}}
\newlabel{./io:s1}{{7}{257}}
\newlabel{./io:s2}{{7}{257}}
\newlabel{./io:s3}{{7}{257}}
\newlabel{./io:s4}{{7}{257}}
\newlabel{./io:s5}{{7}{257}}
\newlabel{./io:s6}{{7}{257}}
\newlabel{./io:s7}{{7}{257}}
\newlabel{./io:s8}{{7}{257}}
\newlabel{./io:s9}{{7}{257}}
\newlabel{./io:s10}{{7}{257}}
\newlabel{./io:s11}{{7}{257}}
\newlabel{./io:s12}{{7}{257}}
\newlabel{./io:s13}{{7}{257}}
\newlabel{./io:s14}{{7}{257}}
\newlabel{./io:s15}{{7}{258}}
\newlabel{./io:s16}{{7}{258}}
\newlabel{./io:s17}{{7}{258}}
\newlabel{./io:s18}{{7}{258}}
\newlabel{SECTTRANSCODERS}{{7.1}{258}}
\@writefile{toc}{\contentsline {section}{\numberline {7.1}Transcoders}{258}}
\newlabel{./io:s19}{{7.1}{259}}
\newlabel{./io:s20}{{7.1}{259}}
\newlabel{./io:s21}{{7.1}{259}}
\newlabel{./io:s22}{{7.1}{259}}
\newlabel{./io:s23}{{7.1}{259}}
\newlabel{./io:s24}{{7.1}{260}}
\newlabel{./io:s25}{{7.1}{260}}
\newlabel{SECTOPENINGFILES}{{7.2}{260}}
\@writefile{toc}{\contentsline {section}{\numberline {7.2}Opening Files}{260}}
\citation{Dybvig:csug8}
\newlabel{./io:s26}{{7.2}{261}}
\newlabel{./io:s27}{{7.2}{261}}
\newlabel{./io:s28}{{7.2}{262}}
\newlabel{./io:s29}{{7.2}{262}}
\newlabel{./io:s30}{{7.2}{262}}
\newlabel{./io:s31}{{7.2}{263}}
\newlabel{SECTSTANDARDPORTS}{{7.3}{263}}
\@writefile{toc}{\contentsline {section}{\numberline {7.3}Standard Ports}{263}}
\newlabel{./io:s32}{{7.3}{263}}
\newlabel{./io:s33}{{7.3}{264}}
\newlabel{SECTSTRINGPORTS}{{7.4}{264}}
\@writefile{toc}{\contentsline {section}{\numberline {7.4}String and Bytevector Ports}{264}}
\newlabel{./io:s34}{{7.4}{264}}
\newlabel{./io:s35}{{7.4}{265}}
\newlabel{./io:s36}{{7.4}{265}}
\newlabel{./io:s37}{{7.4}{266}}
\newlabel{./io:s38}{{7.4}{266}}
\newlabel{./io:s39}{{7.4}{267}}
\newlabel{./io:s40}{{7.4}{267}}
\newlabel{SECTCUSTOMPORTS}{{7.5}{267}}
\@writefile{toc}{\contentsline {section}{\numberline {7.5}Opening Custom Ports}{267}}
\newlabel{./io:s41}{{7.5}{267}}
\newlabel{./io:s42}{{7.5}{268}}
\newlabel{SECTPORTOPERATIONS}{{7.6}{270}}
\@writefile{toc}{\contentsline {section}{\numberline {7.6}Port Operations}{270}}
\newlabel{./io:s43}{{7.6}{270}}
\newlabel{./io:s44}{{7.6}{270}}
\newlabel{./io:s45}{{7.6}{270}}
\newlabel{./io:s46}{{7.6}{270}}
\newlabel{./io:s47}{{7.6}{271}}
\newlabel{./io:s48}{{7.6}{271}}
\newlabel{./io:s49}{{7.6}{271}}
\newlabel{./io:s50}{{7.6}{272}}
\newlabel{./io:s51}{{7.6}{272}}
\newlabel{desc:call-with-port}{{7.6}{272}}
\newlabel{./io:s52}{{7.6}{273}}
\newlabel{SECTINPUT}{{7.7}{273}}
\@writefile{toc}{\contentsline {section}{\numberline {7.7}Input Operations}{273}}
\newlabel{./io:s53}{{7.7}{273}}
\newlabel{./io:s54}{{7.7}{273}}
\newlabel{./io:s55}{{7.7}{274}}
\newlabel{./io:s56}{{7.7}{274}}
\newlabel{./io:s57}{{7.7}{274}}
\newlabel{./io:s58}{{7.7}{274}}
\newlabel{./io:s59}{{7.7}{275}}
\newlabel{./io:s60}{{7.7}{275}}
\newlabel{./io:s61}{{7.7}{275}}
\newlabel{./io:s62}{{7.7}{275}}
\newlabel{./io:s63}{{7.7}{276}}
\newlabel{./io:s64}{{7.7}{276}}
\newlabel{backdoor-string-fill}{{7.7}{276}}
\newlabel{./io:s65}{{7.7}{277}}
\newlabel{./io:s66}{{7.7}{277}}
\newlabel{./io:s67}{{7.7}{278}}
\newlabel{./io:s68}{{7.7}{278}}
\newlabel{SECTOUTPUT}{{7.8}{278}}
\@writefile{toc}{\contentsline {section}{\numberline {7.8}Output Operations}{278}}
\newlabel{./io:s69}{{7.8}{278}}
\newlabel{./io:s70}{{7.8}{279}}
\newlabel{./io:s71}{{7.8}{279}}
\newlabel{./io:s72}{{7.8}{279}}
\newlabel{./io:s73}{{7.8}{279}}
\newlabel{./io:s74}{{7.8}{280}}
\newlabel{SECTCONVENIENCE}{{7.9}{280}}
\@writefile{toc}{\contentsline {section}{\numberline {7.9}Convenience I/O}{280}}
\newlabel{./io:s75}{{7.9}{280}}
\newlabel{./io:s76}{{7.9}{281}}
\newlabel{./io:s77}{{7.9}{281}}
\newlabel{./io:s78}{{7.9}{282}}
\newlabel{./io:s79}{{7.9}{283}}
\newlabel{./io:s80}{{7.9}{283}}
\newlabel{./io:s81}{{7.9}{284}}
\newlabel{./io:s82}{{7.9}{284}}
\newlabel{./io:s83}{{7.9}{284}}
\newlabel{./io:s84}{{7.9}{284}}
\newlabel{./io:s85}{{7.9}{285}}
\newlabel{./io:s86}{{7.9}{285}}
\newlabel{./io:s87}{{7.9}{285}}
\newlabel{./io:s88}{{7.9}{285}}
\newlabel{SECTFILESYSTEM}{{7.10}{286}}
\@writefile{toc}{\contentsline {section}{\numberline {7.10}Filesystem Operations}{286}}
\newlabel{./io:s89}{{7.10}{286}}
\newlabel{./io:s90}{{7.10}{286}}
\newlabel{SECTBSCONVS}{{7.11}{286}}
\@writefile{toc}{\contentsline {section}{\numberline {7.11}Bytevector/String Conversions}{286}}
\newlabel{./io:s91}{{7.11}{286}}
\newlabel{./io:s92}{{7.11}{287}}
\newlabel{./io:s93}{{7.11}{287}}
\newlabel{./io:s94}{{7.11}{287}}
\newlabel{./io:s95}{{7.11}{287}}
\newlabel{./io:s96}{{7.11}{288}}
\@setckpt{io}{
\setcounter{page}{289}
\setcounter{equation}{0}
\setcounter{enumi}{6}
\setcounter{enumii}{0}
\setcounter{enumiii}{0}
\setcounter{enumiv}{0}
\setcounter{footnote}{0}
\setcounter{mpfootnote}{0}
\setcounter{chapter}{7}
\setcounter{section}{11}
\setcounter{exercise}{0}
\setcounter{alphacount}{6}
}

49
csug/tspl4/libraries.aux Normal file
View file

@ -0,0 +1,49 @@
\relax
\@writefile{toc}{\contentsline {chapter}{\numberline {10}Libraries and Top-Level Programs}{341}}
\@writefile{lof}{\addvspace {10\p@ }}
\@writefile{lot}{\addvspace {10\p@ }}
\newlabel{CHPTLIBRARIES}{{10}{341}}
\citation{r6rs}
\citation{r6rs}
\citation{r6rslibs}
\newlabel{./libraries:s0}{{10}{343}}
\newlabel{./libraries:s1}{{10}{343}}
\@writefile{toc}{\contentsline {section}{\numberline {10.1}Standard Libraries}{343}}
\@writefile{toc}{\contentsline {section}{\numberline {10.2}Defining New Libraries}{344}}
\newlabel{./libraries:s2}{{10.2}{344}}
\newlabel{./libraries:s3}{{10.2}{345}}
\newlabel{./libraries:s4}{{10.2}{345}}
\newlabel{./libraries:s5}{{10.2}{345}}
\newlabel{desc:import}{{10.2}{345}}
\newlabel{./libraries:s6}{{10.2}{345}}
\newlabel{./libraries:s7}{{10.2}{345}}
\newlabel{export-level}{{10.2}{345}}
\newlabel{./libraries:s8}{{10.2}{346}}
\newlabel{./libraries:s9}{{10.2}{346}}
\newlabel{./libraries:s10}{{10.2}{346}}
\newlabel{./libraries:s11}{{10.2}{346}}
\newlabel{./libraries:s12}{{10.2}{346}}
\newlabel{./libraries:s13}{{10.2}{347}}
\newlabel{./libraries:s14}{{10.2}{348}}
\newlabel{./libraries:s15}{{10.2}{349}}
\newlabel{./libraries:s16}{{10.2}{349}}
\newlabel{SECTLIBPROGRAMS}{{10.3}{350}}
\@writefile{toc}{\contentsline {section}{\numberline {10.3}Top-Level Programs}{350}}
\newlabel{./libraries:s17}{{10.3}{350}}
\newlabel{./libraries:s18}{{10.3}{350}}
\newlabel{SECTLIBEXAMPLES}{{10.4}{350}}
\@writefile{toc}{\contentsline {section}{\numberline {10.4}Examples}{350}}
\@setckpt{libraries}{
\setcounter{page}{355}
\setcounter{equation}{0}
\setcounter{enumi}{6}
\setcounter{enumii}{0}
\setcounter{enumiii}{0}
\setcounter{enumiv}{0}
\setcounter{footnote}{0}
\setcounter{mpfootnote}{0}
\setcounter{chapter}{10}
\setcounter{section}{4}
\setcounter{exercise}{0}
\setcounter{alphacount}{6}
}

360
csug/tspl4/objects.aux Normal file
View file

@ -0,0 +1,360 @@
\relax
\@writefile{toc}{\contentsline {chapter}{\numberline {6}Operations on Objects}{139}}
\@writefile{lof}{\addvspace {10\p@ }}
\@writefile{lot}{\addvspace {10\p@ }}
\newlabel{CHPTOBJECTS}{{6}{139}}
\newlabel{./objects:s0}{{6}{141}}
\newlabel{SECTQUOTING}{{6.1}{141}}
\@writefile{toc}{\contentsline {section}{\numberline {6.1}Constants and Quotation}{141}}
\newlabel{./objects:s1}{{6.1}{141}}
\newlabel{./objects:s2}{{6.1}{141}}
\newlabel{./objects:s3}{{6.1}{141}}
\newlabel{./objects:s4}{{6.1}{141}}
\newlabel{./objects:s5}{{6.1}{142}}
\citation{bawden:pepm99}
\newlabel{SECTGENERIC}{{6.2}{143}}
\@writefile{toc}{\contentsline {section}{\numberline {6.2}Generic Equivalence and Type Predicates}{143}}
\newlabel{./objects:s6}{{6.2}{143}}
\newlabel{./objects:s7}{{6.2}{143}}
\newlabel{./objects:s8}{{6.2}{143}}
\newlabel{./objects:s9}{{6.2}{143}}
\newlabel{./objects:s10}{{6.2}{143}}
\newlabel{./objects:s11}{{6.2}{144}}
\newlabel{./objects:s12}{{6.2}{146}}
\citation{r6rs}
\citation{adams:equal}
\newlabel{./objects:s13}{{6.2}{148}}
\newlabel{./objects:s14}{{6.2}{150}}
\newlabel{./objects:s15}{{6.2}{151}}
\newlabel{./objects:s16}{{6.2}{151}}
\newlabel{./objects:s17}{{6.2}{151}}
\newlabel{./objects:s18}{{6.2}{153}}
\newlabel{./objects:s19}{{6.2}{154}}
\newlabel{./objects:s20}{{6.2}{154}}
\newlabel{./objects:s21}{{6.2}{154}}
\newlabel{./objects:s22}{{6.2}{154}}
\newlabel{./objects:s23}{{6.2}{155}}
\newlabel{./objects:s24}{{6.2}{155}}
\newlabel{./objects:s25}{{6.2}{155}}
\newlabel{SECTPAIRS}{{6.3}{155}}
\@writefile{toc}{\contentsline {section}{\numberline {6.3}Lists and Pairs}{155}}
\newlabel{./objects:s26}{{6.3}{155}}
\newlabel{./objects:s27}{{6.3}{155}}
\newlabel{./objects:s28}{{6.3}{155}}
\newlabel{./objects:s29}{{6.3}{155}}
\newlabel{./objects:s30}{{6.3}{155}}
\newlabel{./objects:s31}{{6.3}{155}}
\newlabel{./objects:s32}{{6.3}{155}}
\newlabel{./objects:s33}{{6.3}{155}}
\newlabel{./objects:s34}{{6.3}{155}}
\newlabel{./objects:s35}{{6.3}{155}}
\newlabel{./objects:s36}{{6.3}{156}}
\newlabel{./objects:s37}{{6.3}{156}}
\newlabel{./objects:s38}{{6.3}{156}}
\newlabel{./objects:s39}{{6.3}{156}}
\newlabel{./objects:s40}{{6.3}{157}}
\newlabel{./objects:s41}{{6.3}{157}}
\newlabel{./objects:s42}{{6.3}{157}}
\newlabel{./objects:s43}{{6.3}{158}}
\newlabel{./objects:s44}{{6.3}{158}}
\newlabel{./objects:s45}{{6.3}{158}}
\newlabel{./objects:s46}{{6.3}{159}}
\newlabel{./objects:s47}{{6.3}{159}}
\newlabel{defn:list-ref}{{6.3}{160}}
\newlabel{./objects:s48}{{6.3}{160}}
\newlabel{defn:list-tail}{{6.3}{160}}
\newlabel{./objects:s49}{{6.3}{160}}
\newlabel{./objects:s50}{{6.3}{161}}
\newlabel{./objects:s51}{{6.3}{161}}
\newlabel{./objects:s52}{{6.3}{163}}
\newlabel{./objects:s53}{{6.3}{163}}
\newlabel{./objects:s54}{{6.3}{163}}
\newlabel{./objects:s55}{{6.3}{164}}
\newlabel{./objects:s56}{{6.3}{164}}
\newlabel{./objects:s57}{{6.3}{165}}
\newlabel{./objects:s58}{{6.3}{165}}
\newlabel{page:assq}{{6.3}{165}}
\newlabel{./objects:s59}{{6.3}{165}}
\newlabel{./objects:s60}{{6.3}{166}}
\newlabel{./objects:s61}{{6.3}{166}}
\newlabel{./objects:s62}{{6.3}{167}}
\newlabel{SECTNUMBERS}{{6.4}{167}}
\@writefile{toc}{\contentsline {section}{\numberline {6.4}Numbers}{167}}
\newlabel{./objects:s63}{{6.4}{167}}
\newlabel{./objects:s64}{{6.4}{167}}
\newlabel{./objects:s65}{{6.4}{167}}
\newlabel{./objects:s66}{{6.4}{167}}
\newlabel{./objects:s67}{{6.4}{167}}
\newlabel{./objects:s68}{{6.4}{167}}
\newlabel{./objects:s69}{{6.4}{167}}
\newlabel{./objects:s70}{{6.4}{167}}
\newlabel{./objects:s71}{{6.4}{167}}
\newlabel{./objects:s72}{{6.4}{167}}
\newlabel{./objects:s73}{{6.4}{167}}
\newlabel{./objects:s74}{{6.4}{167}}
\newlabel{./objects:s75}{{6.4}{167}}
\newlabel{./objects:s76}{{6.4}{167}}
\newlabel{./objects:s77}{{6.4}{167}}
\newlabel{./objects:s78}{{6.4}{169}}
\newlabel{./objects:s79}{{6.4}{169}}
\newlabel{./objects:s80}{{6.4}{169}}
\newlabel{./objects:s81}{{6.4}{169}}
\newlabel{./objects:s82}{{6.4}{169}}
\newlabel{./objects:s83}{{6.4}{169}}
\newlabel{./objects:s84}{{6.4}{169}}
\newlabel{./objects:s85}{{6.4}{169}}
\newlabel{./objects:s86}{{6.4}{170}}
\newlabel{./objects:s87}{{6.4}{170}}
\newlabel{./objects:s88}{{6.4}{170}}
\newlabel{./objects:s89}{{6.4}{171}}
\newlabel{./objects:s90}{{6.4}{172}}
\newlabel{./objects:s91}{{6.4}{172}}
\newlabel{./objects:s92}{{6.4}{172}}
\newlabel{./objects:s93}{{6.4}{173}}
\newlabel{./objects:s94}{{6.4}{173}}
\newlabel{./objects:s95}{{6.4}{173}}
\newlabel{./objects:s96}{{6.4}{174}}
\newlabel{./objects:s97}{{6.4}{174}}
\newlabel{./objects:s98}{{6.4}{175}}
\newlabel{./objects:s99}{{6.4}{175}}
\newlabel{./objects:s100}{{6.4}{176}}
\newlabel{./objects:s101}{{6.4}{177}}
\newlabel{./objects:s102}{{6.4}{177}}
\newlabel{./objects:s103}{{6.4}{177}}
\newlabel{./objects:s104}{{6.4}{178}}
\newlabel{./objects:s105}{{6.4}{178}}
\newlabel{page:abs}{{6.4}{178}}
\newlabel{./objects:s106}{{6.4}{178}}
\newlabel{./objects:s107}{{6.4}{178}}
\newlabel{./objects:s108}{{6.4}{178}}
\newlabel{./objects:s109}{{6.4}{179}}
\newlabel{page:gcd}{{6.4}{179}}
\newlabel{./objects:s110}{{6.4}{179}}
\newlabel{./objects:s111}{{6.4}{179}}
\newlabel{./objects:s112}{{6.4}{180}}
\newlabel{./objects:s113}{{6.4}{180}}
\newlabel{./objects:s114}{{6.4}{180}}
\newlabel{./objects:s115}{{6.4}{180}}
\newlabel{./objects:s116}{{6.4}{181}}
\newlabel{./objects:s117}{{6.4}{181}}
\newlabel{./objects:s118}{{6.4}{181}}
\newlabel{./objects:s119}{{6.4}{181}}
\newlabel{./objects:s120}{{6.4}{182}}
\newlabel{./objects:s121}{{6.4}{182}}
\newlabel{./objects:s122}{{6.4}{182}}
\newlabel{./objects:s123}{{6.4}{183}}
\newlabel{./objects:s124}{{6.4}{183}}
\newlabel{./objects:s125}{{6.4}{183}}
\newlabel{page:magnitude}{{6.4}{183}}
\newlabel{./objects:s126}{{6.4}{183}}
\newlabel{./objects:s127}{{6.4}{183}}
\newlabel{./objects:s128}{{6.4}{184}}
\newlabel{./objects:s129}{{6.4}{184}}
\newlabel{./objects:s130}{{6.4}{184}}
\newlabel{./objects:s131}{{6.4}{185}}
\newlabel{./objects:s132}{{6.4}{185}}
\newlabel{./objects:s133}{{6.4}{185}}
\newlabel{./objects:s134}{{6.4}{186}}
\newlabel{./objects:s135}{{6.4}{186}}
\newlabel{./objects:s136}{{6.4}{187}}
\newlabel{./objects:s137}{{6.4}{187}}
\newlabel{./objects:s138}{{6.4}{187}}
\newlabel{./objects:s139}{{6.4}{188}}
\newlabel{./objects:s140}{{6.4}{188}}
\newlabel{./objects:s141}{{6.4}{189}}
\newlabel{./objects:s142}{{6.4}{189}}
\newlabel{./objects:s143}{{6.4}{189}}
\newlabel{./objects:s144}{{6.4}{190}}
\newlabel{./objects:s145}{{6.4}{190}}
\newlabel{./objects:s146}{{6.4}{191}}
\newlabel{./objects:s147}{{6.4}{191}}
\newlabel{./objects:s148}{{6.4}{191}}
\citation{Burger:floatprinting}
\newlabel{SECTFIXNUMS}{{6.5}{192}}
\@writefile{toc}{\contentsline {section}{\numberline {6.5}Fixnums}{192}}
\newlabel{./objects:s149}{{6.5}{192}}
\newlabel{./objects:s150}{{6.5}{193}}
\newlabel{./objects:s151}{{6.5}{193}}
\newlabel{./objects:s152}{{6.5}{193}}
\newlabel{./objects:s153}{{6.5}{193}}
\newlabel{./objects:s154}{{6.5}{194}}
\newlabel{./objects:s155}{{6.5}{194}}
\newlabel{./objects:s156}{{6.5}{195}}
\newlabel{./objects:s157}{{6.5}{195}}
\newlabel{./objects:s158}{{6.5}{195}}
\newlabel{./objects:s159}{{6.5}{195}}
\newlabel{./objects:s160}{{6.5}{196}}
\newlabel{./objects:s161}{{6.5}{196}}
\newlabel{./objects:s162}{{6.5}{197}}
\newlabel{./objects:s163}{{6.5}{197}}
\newlabel{./objects:s164}{{6.5}{198}}
\newlabel{./objects:s165}{{6.5}{198}}
\newlabel{./objects:s166}{{6.5}{198}}
\newlabel{./objects:s167}{{6.5}{199}}
\newlabel{./objects:s168}{{6.5}{199}}
\newlabel{./objects:s169}{{6.5}{200}}
\newlabel{./objects:s170}{{6.5}{200}}
\newlabel{./objects:s171}{{6.5}{200}}
\newlabel{./objects:s172}{{6.5}{201}}
\newlabel{./objects:s173}{{6.5}{201}}
\newlabel{./objects:s174}{{6.5}{201}}
\newlabel{./objects:s175}{{6.5}{202}}
\newlabel{SECTFLONUMS}{{6.6}{202}}
\@writefile{toc}{\contentsline {section}{\numberline {6.6}Flonums}{202}}
\newlabel{./objects:s176}{{6.6}{202}}
\newlabel{./objects:s177}{{6.6}{203}}
\newlabel{./objects:s178}{{6.6}{203}}
\newlabel{./objects:s179}{{6.6}{204}}
\newlabel{./objects:s180}{{6.6}{204}}
\newlabel{./objects:s181}{{6.6}{205}}
\newlabel{./objects:s182}{{6.6}{205}}
\newlabel{./objects:s183}{{6.6}{205}}
\newlabel{./objects:s184}{{6.6}{206}}
\newlabel{./objects:s185}{{6.6}{206}}
\newlabel{./objects:s186}{{6.6}{207}}
\newlabel{./objects:s187}{{6.6}{207}}
\newlabel{./objects:s188}{{6.6}{207}}
\newlabel{./objects:s189}{{6.6}{208}}
\newlabel{./objects:s190}{{6.6}{208}}
\newlabel{./objects:s191}{{6.6}{209}}
\newlabel{./objects:s192}{{6.6}{209}}
\newlabel{./objects:s193}{{6.6}{209}}
\newlabel{./objects:s194}{{6.6}{210}}
\newlabel{./objects:s195}{{6.6}{210}}
\newlabel{./objects:s196}{{6.6}{210}}
\newlabel{./objects:s197}{{6.6}{210}}
\newlabel{./objects:s198}{{6.6}{211}}
\newlabel{SECTCHARACTERS}{{6.7}{211}}
\@writefile{toc}{\contentsline {section}{\numberline {6.7}Characters}{211}}
\newlabel{./objects:s199}{{6.7}{211}}
\newlabel{./objects:s200}{{6.7}{211}}
\newlabel{./objects:s201}{{6.7}{212}}
\newlabel{./objects:s202}{{6.7}{212}}
\newlabel{./objects:s203}{{6.7}{213}}
\newlabel{./objects:s204}{{6.7}{213}}
\newlabel{./objects:s205}{{6.7}{214}}
\newlabel{./objects:s206}{{6.7}{214}}
\newlabel{./objects:s207}{{6.7}{214}}
\newlabel{./objects:s208}{{6.7}{214}}
\newlabel{./objects:s209}{{6.7}{215}}
\newlabel{./objects:s210}{{6.7}{215}}
\newlabel{./objects:s211}{{6.7}{215}}
\newlabel{SECTSTRINGS}{{6.8}{216}}
\@writefile{toc}{\contentsline {section}{\numberline {6.8}Strings}{216}}
\newlabel{./objects:s212}{{6.8}{216}}
\newlabel{./objects:s213}{{6.8}{216}}
\newlabel{./objects:s214}{{6.8}{216}}
\newlabel{./objects:s215}{{6.8}{216}}
\newlabel{./objects:s216}{{6.8}{217}}
\newlabel{./objects:s217}{{6.8}{218}}
\newlabel{./objects:s218}{{6.8}{218}}
\newlabel{./objects:s219}{{6.8}{218}}
\newlabel{./objects:s220}{{6.8}{218}}
\newlabel{./objects:s221}{{6.8}{219}}
\newlabel{./objects:s222}{{6.8}{219}}
\newlabel{./objects:s223}{{6.8}{219}}
\newlabel{./objects:s224}{{6.8}{220}}
\newlabel{./objects:s225}{{6.8}{220}}
\citation{UnicodeUAX29}
\newlabel{./objects:s226}{{6.8}{221}}
\newlabel{./objects:s227}{{6.8}{222}}
\newlabel{./objects:s228}{{6.8}{222}}
\newlabel{./objects:s229}{{6.8}{223}}
\newlabel{SECTVECTORS}{{6.9}{223}}
\@writefile{toc}{\contentsline {section}{\numberline {6.9}Vectors}{223}}
\newlabel{./objects:s230}{{6.9}{223}}
\newlabel{./objects:s231}{{6.9}{224}}
\newlabel{./objects:s232}{{6.9}{224}}
\newlabel{./objects:s233}{{6.9}{224}}
\newlabel{./objects:s234}{{6.9}{224}}
\newlabel{./objects:s235}{{6.9}{225}}
\newlabel{./objects:s236}{{6.9}{225}}
\newlabel{./objects:s237}{{6.9}{225}}
\newlabel{./objects:s238}{{6.9}{226}}
\newlabel{./objects:s239}{{6.9}{226}}
\newlabel{SECTBYTEVECTORS}{{6.10}{227}}
\@writefile{toc}{\contentsline {section}{\numberline {6.10}Bytevectors}{227}}
\newlabel{./objects:s240}{{6.10}{228}}
\newlabel{./objects:s241}{{6.10}{228}}
\newlabel{./objects:s242}{{6.10}{228}}
\newlabel{./objects:s243}{{6.10}{229}}
\newlabel{./objects:s244}{{6.10}{229}}
\newlabel{./objects:s245}{{6.10}{229}}
\newlabel{./objects:s246}{{6.10}{229}}
\newlabel{./objects:s247}{{6.10}{230}}
\newlabel{./objects:s248}{{6.10}{230}}
\newlabel{./objects:s249}{{6.10}{231}}
\newlabel{./objects:s250}{{6.10}{231}}
\newlabel{./objects:s251}{{6.10}{231}}
\newlabel{./objects:s252}{{6.10}{232}}
\newlabel{./objects:s253}{{6.10}{232}}
\newlabel{./objects:s254}{{6.10}{232}}
\newlabel{./objects:s255}{{6.10}{233}}
\newlabel{./objects:s256}{{6.10}{235}}
\newlabel{./objects:s257}{{6.10}{236}}
\newlabel{./objects:s258}{{6.10}{237}}
\newlabel{./objects:s259}{{6.10}{238}}
\newlabel{./objects:s260}{{6.10}{238}}
\newlabel{./objects:s261}{{6.10}{239}}
\newlabel{./objects:s262}{{6.10}{239}}
\newlabel{./objects:s263}{{6.10}{239}}
\newlabel{./objects:s264}{{6.10}{240}}
\newlabel{./objects:s265}{{6.10}{240}}
\newlabel{SECTSYMBOLS}{{6.11}{241}}
\@writefile{toc}{\contentsline {section}{\numberline {6.11}Symbols}{241}}
\newlabel{./objects:s266}{{6.11}{241}}
\newlabel{./objects:s267}{{6.11}{241}}
\newlabel{./objects:s268}{{6.11}{242}}
\newlabel{./objects:s269}{{6.11}{242}}
\newlabel{./objects:s270}{{6.11}{242}}
\newlabel{SECTMISCBOOLEANS}{{6.12}{243}}
\@writefile{toc}{\contentsline {section}{\numberline {6.12}Booleans}{243}}
\newlabel{./objects:s271}{{6.12}{243}}
\newlabel{SECTHASHTABLES}{{6.13}{243}}
\@writefile{toc}{\contentsline {section}{\numberline {6.13}Hashtables}{243}}
\newlabel{./objects:s272}{{6.13}{243}}
\newlabel{./objects:s273}{{6.13}{243}}
\newlabel{./objects:s274}{{6.13}{243}}
\newlabel{./objects:s275}{{6.13}{244}}
\newlabel{./objects:s276}{{6.13}{244}}
\newlabel{./objects:s277}{{6.13}{245}}
\newlabel{./objects:s278}{{6.13}{245}}
\newlabel{./objects:s279}{{6.13}{245}}
\newlabel{./objects:s280}{{6.13}{246}}
\newlabel{./objects:s281}{{6.13}{246}}
\newlabel{./objects:s282}{{6.13}{246}}
\newlabel{./objects:s283}{{6.13}{247}}
\newlabel{./objects:s284}{{6.13}{248}}
\newlabel{./objects:s285}{{6.13}{248}}
\newlabel{./objects:s286}{{6.13}{248}}
\newlabel{./objects:s287}{{6.13}{249}}
\newlabel{./objects:s288}{{6.13}{249}}
\newlabel{./objects:s289}{{6.13}{250}}
\newlabel{SECTENUMERATIONS}{{6.14}{250}}
\@writefile{toc}{\contentsline {section}{\numberline {6.14}Enumerations}{250}}
\newlabel{./objects:s290}{{6.14}{250}}
\newlabel{./objects:s291}{{6.14}{251}}
\newlabel{./objects:s292}{{6.14}{251}}
\newlabel{./objects:s293}{{6.14}{252}}
\newlabel{./objects:s294}{{6.14}{252}}
\newlabel{./objects:s295}{{6.14}{252}}
\newlabel{./objects:s296}{{6.14}{252}}
\newlabel{./objects:s297}{{6.14}{253}}
\newlabel{./objects:s298}{{6.14}{253}}
\newlabel{./objects:s299}{{6.14}{254}}
\newlabel{./objects:s300}{{6.14}{254}}
\newlabel{./objects:s301}{{6.14}{254}}
\@setckpt{objects}{
\setcounter{page}{255}
\setcounter{equation}{0}
\setcounter{enumi}{6}
\setcounter{enumii}{0}
\setcounter{enumiii}{0}
\setcounter{enumiv}{0}
\setcounter{footnote}{0}
\setcounter{mpfootnote}{0}
\setcounter{chapter}{6}
\setcounter{section}{14}
\setcounter{exercise}{0}
\setcounter{alphacount}{6}
}

1418
csug/tspl4/out.hidx Normal file

File diff suppressed because it is too large Load diff

29
csug/tspl4/preface.aux Normal file
View file

@ -0,0 +1,29 @@
\relax
\citation{Steele:scheme}
\citation{Sussman-Steele:HOSC98}
\citation{Friedman:lisper}
\citation{IEEE:1178}
\citation{r6rs}
\citation{Dybvig:csug8}
\@writefile{toc}{\contentsline {chapter}{Preface}{ix}}
\@writefile{lof}{\addvspace {10\p@ }}
\@writefile{lot}{\addvspace {10\p@ }}
\newlabel{./preface:s0}{{}{ix}}
\newlabel{./preface:s1}{{}{ix}}
\newlabel{./preface:s2}{{}{ix}}
\newlabel{./preface:s3}{{}{ix}}
\newlabel{./preface:s4}{{}{ix}}
\@setckpt{preface}{
\setcounter{page}{13}
\setcounter{equation}{0}
\setcounter{enumi}{0}
\setcounter{enumii}{0}
\setcounter{enumiii}{0}
\setcounter{enumiv}{0}
\setcounter{footnote}{0}
\setcounter{mpfootnote}{0}
\setcounter{chapter}{0}
\setcounter{section}{0}
\setcounter{exercise}{0}
\setcounter{alphacount}{0}
}

73
csug/tspl4/records.aux Normal file
View file

@ -0,0 +1,73 @@
\relax
\@writefile{toc}{\contentsline {chapter}{\numberline {9}Records}{321}}
\@writefile{lof}{\addvspace {10\p@ }}
\@writefile{lot}{\addvspace {10\p@ }}
\newlabel{CHPTRECORDS}{{9}{321}}
\newlabel{./records:s0}{{9}{323}}
\newlabel{./records:s1}{{9}{323}}
\newlabel{./records:s2}{{9}{323}}
\newlabel{SECTRECORDDEFINITION}{{9.1}{323}}
\@writefile{toc}{\contentsline {section}{\numberline {9.1}Defining Records}{323}}
\newlabel{./records:s3}{{9.1}{324}}
\newlabel{./records:s4}{{9.1}{324}}
\newlabel{./records:s5}{{9.1}{324}}
\citation{RFC4122}
\newlabel{./records:s6}{{9.1}{325}}
\newlabel{page:record-uid}{{9.1}{325}}
\newlabel{./records:s7}{{9.1}{325}}
\newlabel{./records:s8}{{9.1}{325}}
\newlabel{./records:s9}{{9.1}{325}}
\newlabel{./records:s10}{{9.1}{325}}
\newlabel{page:parent-type}{{9.1}{325}}
\newlabel{./records:s11}{{9.1}{326}}
\newlabel{page:protocols}{{9.1}{326}}
\newlabel{./records:s12}{{9.1}{327}}
\newlabel{./records:s13}{{9.1}{328}}
\newlabel{./records:s14}{{9.1}{330}}
\newlabel{page:sealed}{{9.1}{330}}
\newlabel{./records:s15}{{9.1}{330}}
\newlabel{page:opaque}{{9.1}{330}}
\newlabel{./records:s16}{{9.1}{331}}
\newlabel{SECTRECORDPROCEDURAL}{{9.2}{331}}
\@writefile{toc}{\contentsline {section}{\numberline {9.2}Procedural Interface}{331}}
\newlabel{./records:s17}{{9.2}{331}}
\newlabel{./records:s18}{{9.2}{331}}
\newlabel{./records:s19}{{9.2}{331}}
\newlabel{./records:s20}{{9.2}{331}}
\newlabel{./records:s21}{{9.2}{331}}
\newlabel{./records:s22}{{9.2}{331}}
\newlabel{./records:s23}{{9.2}{332}}
\newlabel{./records:s24}{{9.2}{332}}
\newlabel{./records:s25}{{9.2}{332}}
\newlabel{./records:s26}{{9.2}{332}}
\newlabel{./records:s27}{{9.2}{332}}
\newlabel{./records:s28}{{9.2}{333}}
\newlabel{./records:s29}{{9.2}{333}}
\newlabel{./records:s30}{{9.2}{333}}
\newlabel{./records:s31}{{9.2}{334}}
\newlabel{./records:s32}{{9.2}{334}}
\newlabel{SECTRECORDINSPECTION}{{9.3}{335}}
\@writefile{toc}{\contentsline {section}{\numberline {9.3}Inspection}{335}}
\newlabel{./records:s33}{{9.3}{336}}
\newlabel{./records:s34}{{9.3}{336}}
\newlabel{./records:s35}{{9.3}{336}}
\newlabel{./records:s36}{{9.3}{336}}
\newlabel{./records:s37}{{9.3}{337}}
\newlabel{./records:s38}{{9.3}{337}}
\newlabel{./records:s39}{{9.3}{338}}
\newlabel{./records:s40}{{9.3}{338}}
\newlabel{./records:s41}{{9.3}{338}}
\@setckpt{records}{
\setcounter{page}{340}
\setcounter{equation}{0}
\setcounter{enumi}{6}
\setcounter{enumii}{0}
\setcounter{enumiii}{0}
\setcounter{enumiv}{0}
\setcounter{footnote}{0}
\setcounter{mpfootnote}{0}
\setcounter{chapter}{9}
\setcounter{section}{3}
\setcounter{exercise}{0}
\setcounter{alphacount}{6}
}

249
csug/tspl4/start.aux Normal file
View file

@ -0,0 +1,249 @@
\relax
\@writefile{toc}{\contentsline {chapter}{\numberline {2}Getting Started}{11}}
\@writefile{lof}{\addvspace {10\p@ }}
\@writefile{lot}{\addvspace {10\p@ }}
\newlabel{CHPTGETTINGSTARTED}{{2}{11}}
\newlabel{SECTGSINTERACTING}{{2.1}{13}}
\@writefile{toc}{\contentsline {section}{\numberline {2.1}Interacting with Scheme}{13}}
\newlabel{./start:s0}{{2.1}{13}}
\newlabel{./start:s1}{{2.1}{14}}
\newlabel{./start:s2}{{2.1}{14}}
\newlabel{./start:s3}{{2.1}{15}}
\newlabel{./start:s4}{{2.1}{15}}
\newlabel{SECTGSSIMPLE}{{2.2}{16}}
\@writefile{toc}{\contentsline {section}{\numberline {2.2}Simple Expressions}{16}}
\newlabel{./start:s5}{{2.2}{16}}
\newlabel{./start:s6}{{2.2}{16}}
\newlabel{./start:s7}{{2.2}{16}}
\newlabel{./start:s8}{{2.2}{16}}
\newlabel{./start:s9}{{2.2}{16}}
\newlabel{./start:s10}{{2.2}{16}}
\newlabel{./start:s11}{{2.2}{16}}
\newlabel{./start:s12}{{2.2}{16}}
\newlabel{./start:s13}{{2.2}{17}}
\newlabel{./start:s14}{{2.2}{17}}
\newlabel{./start:s15}{{2.2}{17}}
\newlabel{./start:s16}{{2.2}{17}}
\newlabel{./start:s17}{{2.2}{18}}
\newlabel{./start:s18}{{2.2}{18}}
\newlabel{./start:s19}{{2.2}{18}}
\newlabel{./start:s20}{{2.2}{18}}
\newlabel{./start:s21}{{2.2}{18}}
\newlabel{./start:s22}{{2.2}{18}}
\newlabel{./start:s23}{{2.2}{19}}
\newlabel{./start:s24}{{2.2}{19}}
\newlabel{./start:s25}{{2.2}{19}}
\newlabel{./start:s26}{{2.2}{19}}
\newlabel{./start:s27}{{2.2}{19}}
\newlabel{./start:s28}{{2.2}{19}}
\newlabel{./start:s29}{{2.2}{19}}
\newlabel{./start:s30}{{2.2}{19}}
\newlabel{./start:s31}{{2.2}{19}}
\newlabel{./start:s32}{{2.2}{20}}
\newlabel{./start:s33}{{2.2}{20}}
\newlabel{./start:s34}{{2.2.1}{20}}
\newlabel{./start:s35}{{2.2.2}{20}}
\newlabel{./start:s36}{{2.2.3}{20}}
\newlabel{EXEXPRVALUE}{{2.2.3}{20}}
\newlabel{./start:s37}{{2.2.4}{21}}
\newlabel{./start:s38}{{2.2.5}{21}}
\newlabel{./start:s39}{{2.2.6}{21}}
\newlabel{./start:s40}{{2.2.7}{21}}
\newlabel{./start:s41}{{2.2.8}{21}}
\newlabel{SECTGSEVALUATING}{{2.3}{21}}
\@writefile{toc}{\contentsline {section}{\numberline {2.3}Evaluating Scheme Expressions}{21}}
\newlabel{./start:s42}{{2.3}{21}}
\newlabel{./start:s43}{{2.3}{21}}
\newlabel{./start:s44}{{2.3}{22}}
\newlabel{./start:s45}{{2.3}{22}}
\newlabel{./start:s46}{{2.3}{22}}
\newlabel{./start:s47}{{2.3}{22}}
\newlabel{./start:s48}{{2.3}{22}}
\newlabel{./start:s49}{{2.3.1}{23}}
\newlabel{SECTGSIDENTIFIERS}{{2.4}{23}}
\@writefile{toc}{\contentsline {section}{\numberline {2.4}Variables and Let Expressions}{23}}
\newlabel{./start:s50}{{2.4}{23}}
\newlabel{./start:s51}{{2.4}{23}}
\newlabel{./start:s52}{{2.4}{23}}
\newlabel{./start:s53}{{2.4}{23}}
\newlabel{./start:s54}{{2.4}{25}}
\newlabel{./start:s55}{{2.4}{25}}
\newlabel{./start:s56}{{2.4}{25}}
\newlabel{./start:s57}{{2.4.1}{25}}
\newlabel{./start:s58}{{2.4.2}{25}}
\newlabel{./start:s59}{{2.4.3}{26}}
\newlabel{SECTGSLAMBDA}{{2.5}{26}}
\@writefile{toc}{\contentsline {section}{\numberline {2.5}Lambda Expressions}{26}}
\newlabel{./start:s60}{{2.5}{26}}
\newlabel{./start:s61}{{2.5}{26}}
\newlabel{./start:s62}{{2.5}{26}}
\newlabel{./start:s63}{{2.5}{27}}
\newlabel{./start:s64}{{2.5}{27}}
\newlabel{./start:s65}{{2.5}{27}}
\newlabel{./start:s66}{{2.5}{27}}
\newlabel{./start:s67}{{2.5}{28}}
\newlabel{./start:s68}{{2.5}{28}}
\newlabel{./start:s69}{{2.5}{28}}
\newlabel{./start:s70}{{2.5}{29}}
\newlabel{./start:s71}{{2.5}{29}}
\newlabel{./start:s72}{{2.5.1}{30}}
\newlabel{./start:s73}{{2.5.2}{30}}
\newlabel{./start:s74}{{2.5.3}{30}}
\newlabel{./start:s75}{{2.5.3}{30}}
\newlabel{SECTGSTOPLEVEL}{{2.6}{30}}
\@writefile{toc}{\contentsline {section}{\numberline {2.6}Top-Level Definitions}{30}}
\newlabel{./start:s76}{{2.6}{30}}
\newlabel{./start:s77}{{2.6}{30}}
\newlabel{./start:s78}{{2.6}{30}}
\newlabel{./start:s79}{{2.6}{30}}
\newlabel{./start:s80}{{2.6}{31}}
\newlabel{./start:s81}{{2.6}{31}}
\newlabel{defn:list}{{2.6}{31}}
\newlabel{./start:s82}{{2.6}{31}}
\newlabel{./start:s83}{{2.6}{31}}
\newlabel{./start:s84}{{2.6}{31}}
\newlabel{./start:s85}{{2.6}{32}}
\newlabel{./start:s86}{{2.6}{32}}
\newlabel{./start:s87}{{2.6}{33}}
\newlabel{./start:s88}{{2.6}{33}}
\newlabel{./start:s89}{{2.6}{33}}
\newlabel{./start:s90}{{2.6}{33}}
\newlabel{./start:s91}{{2.6.1}{34}}
\newlabel{./start:s92}{{2.6.2}{34}}
\newlabel{./start:s93}{{2.6.2}{34}}
\newlabel{./start:s94}{{2.6.2}{34}}
\newlabel{./start:s95}{{2.6.2}{34}}
\newlabel{./start:s96}{{2.6.3}{34}}
\newlabel{./start:s97}{{2.6.3}{34}}
\newlabel{SECTGSCONDITIONALS}{{2.7}{34}}
\@writefile{toc}{\contentsline {section}{\numberline {2.7}Conditional Expressions}{34}}
\newlabel{./start:s98}{{2.7}{34}}
\newlabel{./start:s99}{{2.7}{35}}
\newlabel{./start:s100}{{2.7}{36}}
\newlabel{./start:s101}{{2.7}{36}}
\newlabel{./start:s102}{{2.7}{36}}
\newlabel{./start:s103}{{2.7}{36}}
\newlabel{./start:s104}{{2.7}{36}}
\newlabel{./start:s105}{{2.7}{36}}
\newlabel{./start:s106}{{2.7}{36}}
\newlabel{./start:s107}{{2.7}{36}}
\newlabel{./start:s108}{{2.7}{37}}
\newlabel{./start:s109}{{2.7}{37}}
\newlabel{./start:s110}{{2.7}{37}}
\newlabel{./start:s111}{{2.7}{37}}
\newlabel{./start:s112}{{2.7}{37}}
\newlabel{./start:s113}{{2.7}{37}}
\newlabel{./start:s114}{{2.7}{38}}
\newlabel{./start:s115}{{2.7}{38}}
\newlabel{./start:s116}{{2.7}{38}}
\newlabel{./start:s117}{{2.7}{38}}
\newlabel{./start:s118}{{2.7}{38}}
\newlabel{./start:s119}{{2.7}{38}}
\newlabel{./start:s120}{{2.7}{38}}
\newlabel{./start:s121}{{2.7}{38}}
\newlabel{./start:s122}{{2.7}{38}}
\newlabel{./start:s123}{{2.7}{39}}
\newlabel{./start:s124}{{2.7}{39}}
\newlabel{./start:s125}{{2.7}{39}}
\newlabel{./start:s126}{{2.7.1}{41}}
\newlabel{./start:s127}{{2.7.1}{41}}
\newlabel{./start:s128}{{2.7.2}{41}}
\newlabel{EXSHORTER1}{{2.7.2}{41}}
\newlabel{./start:s129}{{2.7.2}{41}}
\newlabel{SECTGSRECURSION}{{2.8}{41}}
\@writefile{toc}{\contentsline {section}{\numberline {2.8}Simple Recursion}{41}}
\newlabel{./start:s130}{{2.8}{41}}
\newlabel{./start:s131}{{2.8}{41}}
\newlabel{./start:s132}{{2.8}{41}}
\newlabel{./start:s133}{{2.8}{41}}
\newlabel{./start:s134}{{2.8}{41}}
\newlabel{./start:s135}{{2.8}{41}}
\newlabel{./start:s136}{{2.8}{42}}
\newlabel{defn:simplelength}{{2.8}{42}}
\newlabel{./start:s137}{{2.8}{42}}
\newlabel{./start:s138}{{2.8}{42}}
\newlabel{./start:s139}{{2.8}{42}}
\newlabel{./start:s140}{{2.8}{43}}
\newlabel{./start:s141}{{2.8}{43}}
\newlabel{./start:s142}{{2.8}{44}}
\newlabel{./start:s143}{{2.8}{44}}
\newlabel{./start:s144}{{2.8}{44}}
\newlabel{./start:s145}{{2.8}{45}}
\newlabel{./start:s146}{{2.8}{45}}
\newlabel{./start:s147}{{2.8}{45}}
\newlabel{./start:s148}{{2.8}{46}}
\newlabel{defn:map1}{{2.8}{46}}
\newlabel{./start:s149}{{2.8.1}{46}}
\newlabel{./start:s150}{{2.8.2}{46}}
\newlabel{./start:s151}{{2.8.2}{46}}
\newlabel{./start:s152}{{2.8.3}{46}}
\newlabel{./start:s153}{{2.8.3}{46}}
\newlabel{./start:s154}{{2.8.4}{47}}
\newlabel{./start:s155}{{2.8.5}{47}}
\newlabel{./start:s156}{{2.8.5}{47}}
\newlabel{./start:s157}{{2.8.5}{47}}
\newlabel{./start:s158}{{2.8.6}{47}}
\newlabel{EXEVENODD}{{2.8.6}{47}}
\newlabel{./start:s159}{{2.8.6}{47}}
\newlabel{./start:s160}{{2.8.6}{47}}
\newlabel{./start:s161}{{2.8.7}{47}}
\newlabel{./start:s162}{{2.8.7}{47}}
\newlabel{SECTGSASSIGNMENT}{{2.9}{47}}
\@writefile{toc}{\contentsline {section}{\numberline {2.9}Assignment}{47}}
\newlabel{./start:s163}{{2.9}{47}}
\newlabel{./start:s164}{{2.9}{47}}
\newlabel{./start:s165}{{2.9}{47}}
\newlabel{./start:s166}{{2.9}{48}}
\newlabel{./start:s167}{{2.9}{49}}
\newlabel{./start:s168}{{2.9}{50}}
\newlabel{./start:s169}{{2.9}{50}}
\newlabel{./start:s170}{{2.9}{50}}
\newlabel{./start:s171}{{2.9}{51}}
\newlabel{./start:s172}{{2.9}{51}}
\newlabel{./start:s173}{{2.9}{51}}
\newlabel{./start:s174}{{2.9}{51}}
\newlabel{./start:s175}{{2.9}{51}}
\newlabel{./start:s176}{{2.9}{52}}
\newlabel{./start:s177}{{2.9}{52}}
\newlabel{./start:s178}{{2.9}{52}}
\newlabel{./start:s179}{{2.9}{53}}
\newlabel{queue-datatype}{{2.9}{53}}
\newlabel{./start:s180}{{2.9}{53}}
\newlabel{./start:s181}{{2.9}{53}}
\newlabel{./start:s182}{{2.9}{54}}
\newlabel{./start:s183}{{2.9}{54}}
\newlabel{./start:s184}{{2.9}{54}}
\newlabel{./start:s185}{{2.9}{54}}
\newlabel{./start:s186}{{2.9.1}{54}}
\newlabel{./start:s187}{{2.9.1}{54}}
\newlabel{./start:s188}{{2.9.2}{55}}
\newlabel{./start:s189}{{2.9.2}{55}}
\newlabel{./start:s190}{{2.9.2}{55}}
\newlabel{./start:s191}{{2.9.3}{55}}
\newlabel{EXSTACKREFANDSET}{{2.9.3}{55}}
\newlabel{./start:s192}{{2.9.4}{55}}
\newlabel{./start:s193}{{2.9.4}{55}}
\newlabel{./start:s194}{{2.9.5}{56}}
\newlabel{./start:s195}{{2.9.6}{56}}
\newlabel{./start:s196}{{2.9.7}{56}}
\newlabel{./start:s197}{{2.9.7}{56}}
\newlabel{./start:s198}{{2.9.7}{56}}
\newlabel{./start:s199}{{2.9.8}{56}}
\newlabel{EXLIST?}{{2.9.8}{56}}
\newlabel{./start:s200}{{2.9.8}{56}}
\newlabel{./start:s201}{{2.9.8}{56}}
\newlabel{./start:s202}{{2.9.8}{56}}
\@setckpt{start}{
\setcounter{page}{57}
\setcounter{equation}{0}
\setcounter{enumi}{0}
\setcounter{enumii}{0}
\setcounter{enumiii}{0}
\setcounter{enumiv}{0}
\setcounter{footnote}{0}
\setcounter{mpfootnote}{0}
\setcounter{chapter}{2}
\setcounter{section}{9}
\setcounter{exercise}{8}
\setcounter{alphacount}{6}
}

18
csug/tspl4/summary.aux Normal file
View file

@ -0,0 +1,18 @@
\relax
\@writefile{toc}{\contentsline {chapter}{Summary of Forms}{463}}
\@writefile{lof}{\addvspace {10\p@ }}
\@writefile{lot}{\addvspace {10\p@ }}
\@setckpt{summary}{
\setcounter{page}{481}
\setcounter{equation}{0}
\setcounter{enumi}{8}
\setcounter{enumii}{0}
\setcounter{enumiii}{0}
\setcounter{enumiv}{32}
\setcounter{footnote}{0}
\setcounter{mpfootnote}{0}
\setcounter{chapter}{12}
\setcounter{section}{11}
\setcounter{exercise}{7}
\setcounter{alphacount}{6}
}

115
csug/tspl4/syntax.aux Normal file
View file

@ -0,0 +1,115 @@
\relax
\@writefile{toc}{\contentsline {chapter}{\numberline {8}Syntactic Extension}{289}}
\@writefile{lof}{\addvspace {10\p@ }}
\@writefile{lot}{\addvspace {10\p@ }}
\newlabel{CHPTSYNTAX}{{8}{289}}
\citation{Dybvig:syntactic}
\citation{Dybvig:csug8}
\newlabel{./syntax:s0}{{8}{291}}
\newlabel{./syntax:s1}{{8}{291}}
\newlabel{./syntax:s2}{{8}{291}}
\newlabel{./syntax:s3}{{8}{291}}
\newlabel{./syntax:s4}{{8}{291}}
\newlabel{./syntax:s5}{{8}{291}}
\newlabel{./syntax:s6}{{8}{291}}
\newlabel{./syntax:s7}{{8}{291}}
\newlabel{./syntax:s8}{{8}{291}}
\newlabel{./syntax:s9}{{8}{291}}
\newlabel{./syntax:s10}{{8}{291}}
\newlabel{SECTSYNTAXDEFINITIONS}{{8.1}{291}}
\@writefile{toc}{\contentsline {section}{\numberline {8.1}Keyword Bindings}{291}}
\newlabel{./syntax:s11}{{8.1}{291}}
\newlabel{./syntax:s12}{{8.1}{292}}
\newlabel{body-expansion}{{8.1}{292}}
\newlabel{./syntax:s13}{{8.1}{293}}
\newlabel{letsyntaximplicitbegin}{{8.1}{293}}
\newlabel{SECTSYNTAXRULES}{{8.2}{294}}
\@writefile{toc}{\contentsline {section}{\numberline {8.2}Syntax-Rules Transformers}{294}}
\newlabel{./syntax:s14}{{8.2}{294}}
\newlabel{./syntax:s15}{{8.2}{294}}
\newlabel{./syntax:s16}{{8.2}{294}}
\newlabel{./syntax:s17}{{8.2}{294}}
\newlabel{./syntax:s18}{{8.2}{294}}
\newlabel{./syntax:s19}{{8.2}{294}}
\newlabel{./syntax:s20}{{8.2}{294}}
\newlabel{./syntax:s21}{{8.2}{294}}
\newlabel{./syntax:s22}{{8.2}{294}}
\newlabel{patterns}{{8.2}{294}}
\newlabel{./syntax:s23}{{8.2}{295}}
\newlabel{./syntax:s24}{{8.2}{296}}
\newlabel{./syntax:s25}{{8.2}{296}}
\newlabel{./syntax:s26}{{8.2}{297}}
\newlabel{./syntax:s27}{{8.2}{297}}
\newlabel{./syntax:s28}{{8.2}{298}}
\newlabel{SECTSYNTAXCASE}{{8.3}{298}}
\@writefile{toc}{\contentsline {section}{\numberline {8.3}Syntax-Case Transformers}{298}}
\newlabel{./syntax:s29}{{8.3}{298}}
\newlabel{./syntax:s30}{{8.3}{299}}
\newlabel{./syntax:s31}{{8.3}{299}}
\newlabel{./syntax:s32}{{8.3}{299}}
\newlabel{./syntax:s33}{{8.3}{300}}
\newlabel{./syntax:s34}{{8.3}{300}}
\newlabel{./syntax:s35}{{8.3}{301}}
\newlabel{./syntax:s36}{{8.3}{301}}
\newlabel{./syntax:s37}{{8.3}{302}}
\newlabel{./syntax:s38}{{8.3}{304}}
\newlabel{./syntax:s39}{{8.3}{304}}
\newlabel{defn:cond}{{8.3}{305}}
\newlabel{./syntax:s40}{{8.3}{305}}
\citation{bawden:pepm99}
\newlabel{./syntax:s41}{{8.3}{306}}
\newlabel{defn:case}{{8.3}{306}}
\newlabel{./syntax:s42}{{8.3}{306}}
\newlabel{desc:make-variable-transformer}{{8.3}{306}}
\newlabel{./syntax:s43}{{8.3}{307}}
\newlabel{defn:identifier-syntax}{{8.3}{307}}
\newlabel{./syntax:s44}{{8.3}{308}}
\newlabel{./syntax:s45}{{8.3}{308}}
\newlabel{./syntax:s46}{{8.3}{308}}
\newlabel{./syntax:s47}{{8.3}{308}}
\newlabel{./syntax:s48}{{8.3}{309}}
\newlabel{./syntax:s49}{{8.3}{310}}
\newlabel{./syntax:s50}{{8.3}{310}}
\newlabel{defn:letrec}{{8.3}{310}}
\newlabel{fullletvalues}{{8.3}{310}}
\newlabel{./syntax:s51}{{8.3}{310}}
\newlabel{SECTSYNTAXEXAMPLES}{{8.4}{311}}
\@writefile{toc}{\contentsline {section}{\numberline {8.4}Examples}{311}}
\newlabel{./syntax:s52}{{8.4}{311}}
\newlabel{defn:let}{{8.4}{312}}
\newlabel{./syntax:s53}{{8.4}{312}}
\newlabel{defn:do}{{8.4}{313}}
\newlabel{./syntax:s54}{{8.4}{313}}
\newlabel{./syntax:s55}{{8.4}{313}}
\newlabel{./syntax:s56}{{8.4}{314}}
\newlabel{./syntax:s57}{{8.4}{314}}
\newlabel{./syntax:s58}{{8.4}{315}}
\newlabel{./syntax:s59}{{8.4}{315}}
\newlabel{./syntax:s60}{{8.4}{315}}
\newlabel{./syntax:s61}{{8.4}{315}}
\citation{Dybvig:csug8}
\newlabel{./syntax:s62}{{8.4}{316}}
\newlabel{./syntax:s63}{{8.4}{316}}
\newlabel{./syntax:s64}{{8.4}{317}}
\newlabel{./syntax:s65}{{8.4}{317}}
\newlabel{./syntax:s66}{{8.4}{317}}
\newlabel{./syntax:s67}{{8.4}{317}}
\newlabel{defn:method}{{8.4}{317}}
\newlabel{./syntax:s68}{{8.4}{317}}
\newlabel{./syntax:s69}{{8.4}{318}}
\newlabel{./syntax:s70}{{8.4}{318}}
\newlabel{./syntax:s71}{{8.4}{320}}
\@setckpt{syntax}{
\setcounter{page}{321}
\setcounter{equation}{0}
\setcounter{enumi}{6}
\setcounter{enumii}{0}
\setcounter{enumiii}{0}
\setcounter{enumiv}{0}
\setcounter{footnote}{0}
\setcounter{mpfootnote}{0}
\setcounter{chapter}{8}
\setcounter{section}{4}
\setcounter{exercise}{0}
\setcounter{alphacount}{6}
}

15
csug/tspl4/title.aux Normal file
View file

@ -0,0 +1,15 @@
\relax
\@setckpt{title}{
\setcounter{page}{4}
\setcounter{equation}{0}
\setcounter{enumi}{0}
\setcounter{enumii}{0}
\setcounter{enumiii}{0}
\setcounter{enumiv}{0}
\setcounter{footnote}{0}
\setcounter{mpfootnote}{0}
\setcounter{chapter}{0}
\setcounter{section}{0}
\setcounter{exercise}{0}
\setcounter{alphacount}{0}
}

22
csug/tspl4/tspl.aux Normal file
View file

@ -0,0 +1,22 @@
\relax
\@input{title.aux}
\@input{copyright.aux}
\@input{contents.aux}
\@input{preface.aux}
\@input{intro.aux}
\@input{start.aux}
\@input{further.aux}
\@input{binding.aux}
\@input{control.aux}
\@input{objects.aux}
\@input{io.aux}
\@input{syntax.aux}
\@input{records.aux}
\@input{libraries.aux}
\@input{exceptions.aux}
\@input{examples.aux}
\@input{bibliography.aux}
\@input{answers.aux}
\@input{grammar.aux}
\@input{summary.aux}
\@writefile{toc}{\contentsline {chapter}{Index}{481}}

4422
csug/tspl4/tspl.haux Normal file

File diff suppressed because it is too large Load diff

1416
csug/tspl4/tspl.idx Normal file

File diff suppressed because it is too large Load diff

773
csug/tspl4/tspl.rfm Normal file
View file

@ -0,0 +1,773 @@
"variable reference" \sfentry{\scheme{\var{variable}}}{\categorysyntax}{\pageref{./binding:s2}}
"lambda" \sfentry{\scheme{(lambda~\var{formals}~\var{body$_1$}~\var{body$_2$}~{\dots})}}{\categorysyntax}{\pageref{./binding:s3}}
"case-lambda" \sfentry{\scheme{(case-lambda~\var{clause}~{\dots})}}{\categorysyntax}{\pageref{./binding:s13}}
"let" \sfentry{\scheme{(let~((\var{var}~\var{expr})~{\dots})~\var{body$_1$}~\var{body$_2$}~{\dots})}}{\categorysyntax}{\pageref{./binding:s16}}
"let*" \sfentry{\scheme{(let*~((\var{var}~\var{expr})~{\dots})~\var{body$_1$}~\var{body$_2$}~{\dots})}}{\categorysyntax}{\pageref{./binding:s18}}
"letrec" \sfentry{\scheme{(letrec~((\var{var}~\var{expr})~{\dots})~\var{body$_1$}~\var{body$_2$}~{\dots})}}{\categorysyntax}{\pageref{./binding:s20}}
"letrec*" \sfentry{\scheme{(letrec*~((\var{var}~\var{expr})~{\dots})~\var{body$_1$}~\var{body$_2$}~{\dots})}}{\categorysyntax}{\pageref{./binding:s22}}
"let-values" \sfentry{\scheme{(let-values~((\var{formals}~\var{expr})~{\dots})~\var{body$_1$}~\var{body$_2$}~{\dots})}}{\categorysyntax}{\pageref{./binding:s23}}
"let*-values" \sfentry{\scheme{(let*-values~((\var{formals}~\var{expr})~{\dots})~\var{body$_1$}~\var{body$_2$}~{\dots})}}{\categorysyntax}{\pageref{./binding:s23}}
"define" \sfentry{\scheme{(define~\var{var}~\var{expr})}}{\categorysyntax}{\pageref{./binding:s24}}
"define" \sfentry{\scheme{(define~\var{var})}}{\categorysyntax}{\pageref{./binding:s24}}
"define" \sfentry{\scheme{(define~(\var{var$_0$}~\var{var$_1$}~{\dots})~\var{body$_1$}~\var{body$_2$}~{\dots})}}{\categorysyntax}{\pageref{./binding:s24}}
"define" \sfentry{\scheme{(define~(\var{var$_0$}~{\schdot}~\var{var$_r$})~\var{body$_1$}~\var{body$_2$}~{\dots})}}{\categorysyntax}{\pageref{./binding:s24}}
"define" \sfentry{\scheme{(define~(\var{var$_0$}~\var{var$_1$}~\var{var$_2$}~{\dots}~{\schdot}~\var{var$_r$})~\var{body$_1$}~\var{body$_2$}~{\dots})}}{\categorysyntax}{\pageref{./binding:s24}}
"set!" \sfentry{\scheme{(set!~\var{var}~\var{expr})}}{\categorysyntax}{\pageref{./binding:s28}}
"procedure application" \sfentry{\scheme{(\var{expr$_0$}~\var{expr$_1$}~{\dots})}}{\categorysyntax}{\pageref{./control:s1}}
"apply" \sfentry{\scheme{(apply~\var{procedure}~\var{obj}~{\dots}~\var{list})}}{\categoryprocedure}{\pageref{./control:s3}}
"begin" \sfentry{\scheme{(begin~\var{expr$_1$}~\var{expr$_2$}~{\dots})}}{\categorysyntax}{\pageref{./control:s4}}
"if" \sfentry{\scheme{(if~\var{test}~\var{consequent}~\var{alternative})}}{\categorysyntax}{\pageref{./control:s8}}
"if" \sfentry{\scheme{(if~\var{test}~\var{consequent})}}{\categorysyntax}{\pageref{./control:s8}}
"not" \sfentry{\scheme{(not~\var{obj})}}{\categoryprocedure}{\pageref{./control:s10}}
"and" \sfentry{\scheme{(and~\var{expr}~{\dots})}}{\categorysyntax}{\pageref{./control:s11}}
"or" \sfentry{\scheme{(or~\var{expr}~{\dots})}}{\categorysyntax}{\pageref{./control:s12}}
"cond" \sfentry{\scheme{(cond~\var{clause$_1$}~\var{clause$_2$}~{\dots})}}{\categorysyntax}{\pageref{./control:s13}}
"else" \sfentry{\scheme{else}}{\categorysyntax}{\pageref{./control:s16}}
"!E=>" \sfentry{\scheme{=>}}{\categorysyntax}{\pageref{./control:s16}}
"when" \sfentry{\scheme{(when~\var{test-expr}~\var{expr$_1$}~\var{expr$_2$}~{\dots})}}{\categorysyntax}{\pageref{./control:s17}}
"unless" \sfentry{\scheme{(unless~\var{test-expr}~\var{expr$_1$}~\var{expr$_2$}~{\dots})}}{\categorysyntax}{\pageref{./control:s17}}
"case" \sfentry{\scheme{(case~\var{expr$_0$}~\var{clause$_1$}~\var{clause$_2$}~{\dots})}}{\categorysyntax}{\pageref{./control:s18}}
"let" \sfentry{\scheme{(let~\var{name}~((\var{var}~\var{expr})~{\dots})~\var{body$_1$}~\var{body$_2$}~{\dots})}}{\categorysyntax}{\pageref{./control:s20}}
"do" \sfentry{\scheme{(do~((\var{var}~\var{init}~\var{update})~{\dots})~(\var{test}~\var{result}~{\dots})~\var{expr}~{\dots})}}{\categorysyntax}{\pageref{./control:s25}}
"map" \sfentry{\scheme{(map~\var{procedure}~\var{list$_1$}~\var{list$_2$}~{\dots})}}{\categoryprocedure}{\pageref{./control:s30}}
"for-each" \sfentry{\scheme{(for-each~\var{procedure}~\var{list$_1$}~\var{list$_2$}~{\dots})}}{\categoryprocedure}{\pageref{./control:s33}}
"exists" \sfentry{\scheme{(exists~\var{procedure}~\var{list$_1$}~\var{list$_2$}~{\dots})}}{\categoryprocedure}{\pageref{./control:s36}}
"for-all" \sfentry{\scheme{(for-all~\var{procedure}~\var{list$_1$}~\var{list$_2$}~{\dots})}}{\categoryprocedure}{\pageref{./control:s37}}
"fold-left" \sfentry{\scheme{(fold-left~\var{procedure}~\var{obj}~\var{list$_1$}~\var{list$_2$}~{\dots})}}{\categoryprocedure}{\pageref{./control:s38}}
"fold-right" \sfentry{\scheme{(fold-right~\var{procedure}~\var{obj}~\var{list$_1$}~\var{list$_2$}~{\dots})}}{\categoryprocedure}{\pageref{./control:s41}}
"vector-map" \sfentry{\scheme{(vector-map~\var{procedure}~\var{vector$_1$}~\var{vector$_1$}~{\dots})}}{\categoryprocedure}{\pageref{./control:s44}}
"vector-for-each" \sfentry{\scheme{(vector-for-each~\var{procedure}~\var{vector$_1$}~\var{vector$_2$}~{\dots})}}{\categoryprocedure}{\pageref{./control:s47}}
"string-for-each" \sfentry{\scheme{(string-for-each~\var{procedure}~\var{string$_1$}~\var{string$_2$}~{\dots})}}{\categoryprocedure}{\pageref{./control:s50}}
"call/cc" \sfentry{\scheme{(call/cc~\var{procedure})}}{\categoryprocedure}{\pageref{./control:s54}}
"call-with-current-continuation" \sfentry{\scheme{(call-with-current-continuation~\var{procedure})}}{\categoryprocedure}{\pageref{./control:s54}}
"dynamic-wind" \sfentry{\scheme{(dynamic-wind~\var{in}~\var{body}~\var{out})}}{\categoryprocedure}{\pageref{./control:s56}}
"delay" \sfentry{\scheme{(delay~\var{expr})}}{\categorysyntax}{\pageref{./control:s65}}
"force" \sfentry{\scheme{(force~\var{promise})}}{\categoryprocedure}{\pageref{./control:s65}}
"values" \sfentry{\scheme{(values~\var{obj}~{\dots})}}{\categoryprocedure}{\pageref{./control:s70}}
"call-with-values" \sfentry{\scheme{(call-with-values~\var{producer}~\var{consumer})}}{\categoryprocedure}{\pageref{./control:s71}}
"eval" \sfentry{\scheme{(eval~\var{obj}~\var{environment})}}{\categoryprocedure}{\pageref{./control:s80}}
"environment" \sfentry{\scheme{(environment~\var{import-spec}~{\dots})}}{\categoryprocedure}{\pageref{./control:s81}}
"null-environment" \sfentry{\scheme{(null-environment~\var{version})}}{\categoryprocedure}{\pageref{./control:s82}}
"scheme-report-environment" \sfentry{\scheme{(scheme-report-environment~\var{version})}}{\categoryprocedure}{\pageref{./control:s82}}
"constant" \sfentry{\scheme{\var{constant}}}{\categorysyntax}{\pageref{./objects:s1}}
"quote (~'~)" \sfentry{\scheme{(quote~\var{obj})}}{\categorysyntax}{\pageref{./objects:s2}}
"!A' (quote)" \sfentry{\scheme{'\var{obj}}}{\categorysyntax}{\pageref{./objects:s2}}
"quasiquote (~`~)" \sfentry{\scheme{(quasiquote~\var{obj}~{\dots})}}{\categorysyntax}{\pageref{./objects:s5}}
"!B` (quasiquote)" \sfentry{\scheme{`\var{obj}}}{\categorysyntax}{\pageref{./objects:s5}}
"unquote (~,~)" \sfentry{\scheme{(unquote~\var{obj}~{\dots})}}{\categorysyntax}{\pageref{./objects:s5}}
"!C, (unquote)" \sfentry{\scheme{,\var{obj}}}{\categorysyntax}{\pageref{./objects:s5}}
"unquote-splicing (~,@~)" \sfentry{\scheme{(unquote-splicing~\var{obj}~{\dots})}}{\categorysyntax}{\pageref{./objects:s5}}
"!D,@ (unquote-splicing)" \sfentry{\scheme{,{\schatsign}\var{obj}}}{\categorysyntax}{\pageref{./objects:s5}}
"eq?" \sfentry{\scheme{(eq?~\var{obj$_1$}~\var{obj$_2$})}}{\categoryprocedure}{\pageref{./objects:s10}}
"eqv?" \sfentry{\scheme{(eqv?~\var{obj$_1$}~\var{obj$_2$})}}{\categoryprocedure}{\pageref{./objects:s12}}
"equal?" \sfentry{\scheme{(equal?~\var{obj$_1$}~\var{obj$_2$})}}{\categoryprocedure}{\pageref{./objects:s13}}
"boolean?" \sfentry{\scheme{(boolean?~\var{obj})}}{\categoryprocedure}{\pageref{./objects:s14}}
"null?" \sfentry{\scheme{(null?~\var{obj})}}{\categoryprocedure}{\pageref{./objects:s15}}
"pair?" \sfentry{\scheme{(pair?~\var{obj})}}{\categoryprocedure}{\pageref{./objects:s16}}
"number?" \sfentry{\scheme{(number?~\var{obj})}}{\categoryprocedure}{\pageref{./objects:s17}}
"complex?" \sfentry{\scheme{(complex?~\var{obj})}}{\categoryprocedure}{\pageref{./objects:s17}}
"real?" \sfentry{\scheme{(real?~\var{obj})}}{\categoryprocedure}{\pageref{./objects:s17}}
"rational?" \sfentry{\scheme{(rational?~\var{obj})}}{\categoryprocedure}{\pageref{./objects:s17}}
"integer?" \sfentry{\scheme{(integer?~\var{obj})}}{\categoryprocedure}{\pageref{./objects:s17}}
"real-valued?" \sfentry{\scheme{(real-valued?~\var{obj})}}{\categoryprocedure}{\pageref{./objects:s18}}
"rational-valued?" \sfentry{\scheme{(rational-valued?~\var{obj})}}{\categoryprocedure}{\pageref{./objects:s18}}
"integer-valued?" \sfentry{\scheme{(integer-valued?~\var{obj})}}{\categoryprocedure}{\pageref{./objects:s18}}
"char?" \sfentry{\scheme{(char?~\var{obj})}}{\categoryprocedure}{\pageref{./objects:s19}}
"string?" \sfentry{\scheme{(string?~\var{obj})}}{\categoryprocedure}{\pageref{./objects:s20}}
"vector?" \sfentry{\scheme{(vector?~\var{obj})}}{\categoryprocedure}{\pageref{./objects:s21}}
"symbol?" \sfentry{\scheme{(symbol?~\var{obj})}}{\categoryprocedure}{\pageref{./objects:s22}}
"procedure?" \sfentry{\scheme{(procedure?~\var{obj})}}{\categoryprocedure}{\pageref{./objects:s23}}
"bytevector?" \sfentry{\scheme{(bytevector?~\var{obj})}}{\categoryprocedure}{\pageref{./objects:s24}}
"hashtable?" \sfentry{\scheme{(hashtable?~\var{obj})}}{\categoryprocedure}{\pageref{./objects:s25}}
"cons" \sfentry{\scheme{(cons~\var{obj$_1$}~\var{obj$_2$})}}{\categoryprocedure}{\pageref{./objects:s37}}
"car" \sfentry{\scheme{(car~\var{pair})}}{\categoryprocedure}{\pageref{./objects:s38}}
"cdr" \sfentry{\scheme{(cdr~\var{pair})}}{\categoryprocedure}{\pageref{./objects:s39}}
"set-car!" \sfentry{\scheme{(set-car!~\var{pair}~\var{obj})}}{\categoryprocedure}{\pageref{./objects:s40}}
"set-cdr!" \sfentry{\scheme{(set-cdr!~\var{pair}~\var{obj})}}{\categoryprocedure}{\pageref{./objects:s41}}
"caar" \sfentry{\scheme{(caar~\var{pair})}}{\categoryprocedure}{\pageref{./objects:s42}}
"cadr" \sfentry{\scheme{(cadr~\var{pair})}}{\categoryprocedure}{\pageref{./objects:s42}}
"cdar" \sfentry{\scheme{(cdar~\var{pair})}}{\categoryprocedure}{\pageref{./objects:s42}}
"cddr" \sfentry{\scheme{(cddr~\var{pair})}}{\categoryprocedure}{\pageref{./objects:s42}}
"caaar" \sfentry{\scheme{(caaar~\var{pair})}}{\categoryprocedure}{\pageref{./objects:s42}}
"caadr" \sfentry{\scheme{(caadr~\var{pair})}}{\categoryprocedure}{\pageref{./objects:s42}}
"cadar" \sfentry{\scheme{(cadar~\var{pair})}}{\categoryprocedure}{\pageref{./objects:s42}}
"caddr" \sfentry{\scheme{(caddr~\var{pair})}}{\categoryprocedure}{\pageref{./objects:s42}}
"cdaar" \sfentry{\scheme{(cdaar~\var{pair})}}{\categoryprocedure}{\pageref{./objects:s42}}
"cdadr" \sfentry{\scheme{(cdadr~\var{pair})}}{\categoryprocedure}{\pageref{./objects:s42}}
"cddar" \sfentry{\scheme{(cddar~\var{pair})}}{\categoryprocedure}{\pageref{./objects:s42}}
"cdddr" \sfentry{\scheme{(cdddr~\var{pair})}}{\categoryprocedure}{\pageref{./objects:s42}}
"caaaar" \sfentry{\scheme{(caaaar~\var{pair})}}{\categoryprocedure}{\pageref{./objects:s42}}
"caaadr" \sfentry{\scheme{(caaadr~\var{pair})}}{\categoryprocedure}{\pageref{./objects:s42}}
"caadar" \sfentry{\scheme{(caadar~\var{pair})}}{\categoryprocedure}{\pageref{./objects:s42}}
"caaddr" \sfentry{\scheme{(caaddr~\var{pair})}}{\categoryprocedure}{\pageref{./objects:s42}}
"cadaar" \sfentry{\scheme{(cadaar~\var{pair})}}{\categoryprocedure}{\pageref{./objects:s42}}
"cadadr" \sfentry{\scheme{(cadadr~\var{pair})}}{\categoryprocedure}{\pageref{./objects:s42}}
"caddar" \sfentry{\scheme{(caddar~\var{pair})}}{\categoryprocedure}{\pageref{./objects:s42}}
"cadddr" \sfentry{\scheme{(cadddr~\var{pair})}}{\categoryprocedure}{\pageref{./objects:s42}}
"cdaaar" \sfentry{\scheme{(cdaaar~\var{pair})}}{\categoryprocedure}{\pageref{./objects:s42}}
"cdaadr" \sfentry{\scheme{(cdaadr~\var{pair})}}{\categoryprocedure}{\pageref{./objects:s42}}
"cdadar" \sfentry{\scheme{(cdadar~\var{pair})}}{\categoryprocedure}{\pageref{./objects:s42}}
"cdaddr" \sfentry{\scheme{(cdaddr~\var{pair})}}{\categoryprocedure}{\pageref{./objects:s42}}
"cddaar" \sfentry{\scheme{(cddaar~\var{pair})}}{\categoryprocedure}{\pageref{./objects:s42}}
"cddadr" \sfentry{\scheme{(cddadr~\var{pair})}}{\categoryprocedure}{\pageref{./objects:s42}}
"cdddar" \sfentry{\scheme{(cdddar~\var{pair})}}{\categoryprocedure}{\pageref{./objects:s42}}
"cddddr" \sfentry{\scheme{(cddddr~\var{pair})}}{\categoryprocedure}{\pageref{./objects:s42}}
"list" \sfentry{\scheme{(list~\var{obj}~{\dots})}}{\categoryprocedure}{\pageref{./objects:s43}}
"cons*" \sfentry{\scheme{(cons*~\var{obj}~{\dots}~\var{final-obj})}}{\categoryprocedure}{\pageref{./objects:s44}}
"list?" \sfentry{\scheme{(list?~\var{obj})}}{\categoryprocedure}{\pageref{./objects:s45}}
"length" \sfentry{\scheme{(length~\var{list})}}{\categoryprocedure}{\pageref{./objects:s46}}
"list-ref" \sfentry{\scheme{(list-ref~\var{list}~\var{n})}}{\categoryprocedure}{\pageref{./objects:s47}}
"list-tail" \sfentry{\scheme{(list-tail~\var{list}~\var{n})}}{\categoryprocedure}{\pageref{./objects:s48}}
"append" \sfentry{\scheme{(append)}}{\categoryprocedure}{\pageref{./objects:s49}}
"append" \sfentry{\scheme{(append~\var{list}~{\dots}~\var{obj})}}{\categoryprocedure}{\pageref{./objects:s49}}
"reverse" \sfentry{\scheme{(reverse~\var{list})}}{\categoryprocedure}{\pageref{./objects:s50}}
"memq" \sfentry{\scheme{(memq~\var{obj}~\var{list})}}{\categoryprocedure}{\pageref{./objects:s51}}
"memv" \sfentry{\scheme{(memv~\var{obj}~\var{list})}}{\categoryprocedure}{\pageref{./objects:s51}}
"member" \sfentry{\scheme{(member~\var{obj}~\var{list})}}{\categoryprocedure}{\pageref{./objects:s51}}
"memp" \sfentry{\scheme{(memp~\var{procedure}~\var{list})}}{\categoryprocedure}{\pageref{./objects:s52}}
"remq" \sfentry{\scheme{(remq~\var{obj}~\var{list})}}{\categoryprocedure}{\pageref{./objects:s53}}
"remv" \sfentry{\scheme{(remv~\var{obj}~\var{list})}}{\categoryprocedure}{\pageref{./objects:s53}}
"remove" \sfentry{\scheme{(remove~\var{obj}~\var{list})}}{\categoryprocedure}{\pageref{./objects:s53}}
"remp" \sfentry{\scheme{(remp~\var{procedure}~\var{list})}}{\categoryprocedure}{\pageref{./objects:s54}}
"filter" \sfentry{\scheme{(filter~\var{procedure}~\var{list})}}{\categoryprocedure}{\pageref{./objects:s55}}
"partition" \sfentry{\scheme{(partition~\var{procedure}~\var{list})}}{\categoryprocedure}{\pageref{./objects:s56}}
"find" \sfentry{\scheme{(find~\var{procedure}~\var{list})}}{\categoryprocedure}{\pageref{./objects:s57}}
"assq" \sfentry{\scheme{(assq~\var{obj}~\var{alist})}}{\categoryprocedure}{\pageref{./objects:s58}}
"assv" \sfentry{\scheme{(assv~\var{obj}~\var{alist})}}{\categoryprocedure}{\pageref{./objects:s58}}
"assoc" \sfentry{\scheme{(assoc~\var{obj}~\var{alist})}}{\categoryprocedure}{\pageref{./objects:s58}}
"assp" \sfentry{\scheme{(assp~\var{procedure}~\var{alist})}}{\categoryprocedure}{\pageref{./objects:s60}}
"list-sort" \sfentry{\scheme{(list-sort~\var{predicate}~\var{list})}}{\categoryprocedure}{\pageref{./objects:s62}}
"exact?" \sfentry{\scheme{(exact?~\var{num})}}{\categoryprocedure}{\pageref{./objects:s86}}
"inexact?" \sfentry{\scheme{(inexact?~\var{num})}}{\categoryprocedure}{\pageref{./objects:s87}}
"=" \sfentry{\scheme{(=~\var{num$_1$}~\var{num$_2$}~\var{num$_3$}~{\dots})}}{\categoryprocedure}{\pageref{./objects:s88}}
"<" \sfentry{\scheme{(<~\var{real$_1$}~\var{real$_2$}~\var{real$_3$}~{\dots})}}{\categoryprocedure}{\pageref{./objects:s88}}
">" \sfentry{\scheme{(>~\var{real$_1$}~\var{real$_2$}~\var{real$_3$}~{\dots})}}{\categoryprocedure}{\pageref{./objects:s88}}
"<=" \sfentry{\scheme{(<=~\var{real$_1$}~\var{real$_2$}~\var{real$_3$}~{\dots})}}{\categoryprocedure}{\pageref{./objects:s88}}
">=" \sfentry{\scheme{(>=~\var{real$_1$}~\var{real$_2$}~\var{real$_3$}~{\dots})}}{\categoryprocedure}{\pageref{./objects:s88}}
"+" \sfentry{\scheme{(+~\var{num}~{\dots})}}{\categoryprocedure}{\pageref{./objects:s89}}
"-" \sfentry{\scheme{(-~\var{num})}}{\categoryprocedure}{\pageref{./objects:s90}}
"-" \sfentry{\scheme{(-~\var{num$_1$}~\var{num$_2$}~\var{num$_3$}~{\dots})}}{\categoryprocedure}{\pageref{./objects:s90}}
"*" \sfentry{\scheme{(*~\var{num}~{\dots})}}{\categoryprocedure}{\pageref{./objects:s91}}
"/" \sfentry{\scheme{(/~\var{num})}}{\categoryprocedure}{\pageref{./objects:s92}}
"/" \sfentry{\scheme{(/~\var{num$_1$}~\var{num$_2$}~\var{num$_3$}~{\dots})}}{\categoryprocedure}{\pageref{./objects:s92}}
"zero?" \sfentry{\scheme{(zero?~\var{num})}}{\categoryprocedure}{\pageref{./objects:s93}}
"positive?" \sfentry{\scheme{(positive?~\var{real})}}{\categoryprocedure}{\pageref{./objects:s94}}
"negative?" \sfentry{\scheme{(negative?~\var{real})}}{\categoryprocedure}{\pageref{./objects:s95}}
"even?" \sfentry{\scheme{(even?~\var{int})}}{\categoryprocedure}{\pageref{./objects:s96}}
"odd?" \sfentry{\scheme{(odd?~\var{int})}}{\categoryprocedure}{\pageref{./objects:s96}}
"finite?" \sfentry{\scheme{(finite?~\var{real})}}{\categoryprocedure}{\pageref{./objects:s97}}
"infinite?" \sfentry{\scheme{(infinite?~\var{real})}}{\categoryprocedure}{\pageref{./objects:s97}}
"nan?" \sfentry{\scheme{(nan?~\var{real})}}{\categoryprocedure}{\pageref{./objects:s97}}
"quotient" \sfentry{\scheme{(quotient~\var{int$_1$}~\var{int$_2$})}}{\categoryprocedure}{\pageref{./objects:s98}}
"remainder" \sfentry{\scheme{(remainder~\var{int$_1$}~\var{int$_2$})}}{\categoryprocedure}{\pageref{./objects:s98}}
"modulo" \sfentry{\scheme{(modulo~\var{int$_1$}~\var{int$_2$})}}{\categoryprocedure}{\pageref{./objects:s98}}
"div" \sfentry{\scheme{(div~\var{x$_1$}~\var{x$_2$})}}{\categoryprocedure}{\pageref{./objects:s99}}
"mod" \sfentry{\scheme{(mod~\var{x$_1$}~\var{x$_2$})}}{\categoryprocedure}{\pageref{./objects:s99}}
"div-and-mod" \sfentry{\scheme{(div-and-mod~\var{x$_1$}~\var{x$_2$})}}{\categoryprocedure}{\pageref{./objects:s99}}
"div0" \sfentry{\scheme{(div0~\var{x$_1$}~\var{x$_2$})}}{\categoryprocedure}{\pageref{./objects:s100}}
"mod0" \sfentry{\scheme{(mod0~\var{x$_1$}~\var{x$_2$})}}{\categoryprocedure}{\pageref{./objects:s100}}
"div0-and-mod0" \sfentry{\scheme{(div0-and-mod0~\var{x$_1$}~\var{x$_2$})}}{\categoryprocedure}{\pageref{./objects:s100}}
"truncate" \sfentry{\scheme{(truncate~\var{real})}}{\categoryprocedure}{\pageref{./objects:s101}}
"floor" \sfentry{\scheme{(floor~\var{real})}}{\categoryprocedure}{\pageref{./objects:s102}}
"ceiling" \sfentry{\scheme{(ceiling~\var{real})}}{\categoryprocedure}{\pageref{./objects:s103}}
"round" \sfentry{\scheme{(round~\var{real})}}{\categoryprocedure}{\pageref{./objects:s104}}
"abs" \sfentry{\scheme{(abs~\var{real})}}{\categoryprocedure}{\pageref{./objects:s105}}
"max" \sfentry{\scheme{(max~\var{real$_1$}~\var{real$_2$}~{\dots})}}{\categoryprocedure}{\pageref{./objects:s107}}
"min" \sfentry{\scheme{(min~\var{real$_1$}~\var{real$_2$}~{\dots})}}{\categoryprocedure}{\pageref{./objects:s108}}
"gcd" \sfentry{\scheme{(gcd~\var{int}~{\dots})}}{\categoryprocedure}{\pageref{./objects:s109}}
"lcm" \sfentry{\scheme{(lcm~\var{int}~{\dots})}}{\categoryprocedure}{\pageref{./objects:s110}}
"expt" \sfentry{\scheme{(expt~\var{num$_1$}~\var{num$_2$})}}{\categoryprocedure}{\pageref{./objects:s111}}
"inexact" \sfentry{\scheme{(inexact~\var{num})}}{\categoryprocedure}{\pageref{./objects:s112}}
"exact" \sfentry{\scheme{(exact~\var{num})}}{\categoryprocedure}{\pageref{./objects:s114}}
"exact->inexact" \sfentry{\scheme{(exact->inexact~\var{num})}}{\categoryprocedure}{\pageref{./objects:s116}}
"inexact->exact" \sfentry{\scheme{(inexact->exact~\var{num})}}{\categoryprocedure}{\pageref{./objects:s116}}
"rationalize" \sfentry{\scheme{(rationalize~\var{real$_1$}~\var{real$_2$})}}{\categoryprocedure}{\pageref{./objects:s117}}
"numerator" \sfentry{\scheme{(numerator~\var{rat})}}{\categoryprocedure}{\pageref{./objects:s118}}
"denominator" \sfentry{\scheme{(denominator~\var{rat})}}{\categoryprocedure}{\pageref{./objects:s119}}
"real-part" \sfentry{\scheme{(real-part~\var{num})}}{\categoryprocedure}{\pageref{./objects:s120}}
"imag-part" \sfentry{\scheme{(imag-part~\var{num})}}{\categoryprocedure}{\pageref{./objects:s121}}
"make-rectangular" \sfentry{\scheme{(make-rectangular~\var{real$_1$}~\var{real$_2$})}}{\categoryprocedure}{\pageref{./objects:s122}}
"make-polar" \sfentry{\scheme{(make-polar~\var{real$_1$}~\var{real$_2$})}}{\categoryprocedure}{\pageref{./objects:s123}}
"angle" \sfentry{\scheme{(angle~\var{num})}}{\categoryprocedure}{\pageref{./objects:s124}}
"magnitude" \sfentry{\scheme{(magnitude~\var{num})}}{\categoryprocedure}{\pageref{./objects:s125}}
"sqrt" \sfentry{\scheme{(sqrt~\var{num})}}{\categoryprocedure}{\pageref{./objects:s127}}
"exact-integer-sqrt" \sfentry{\scheme{(exact-integer-sqrt~\var{n})}}{\categoryprocedure}{\pageref{./objects:s128}}
"exp" \sfentry{\scheme{(exp~\var{num})}}{\categoryprocedure}{\pageref{./objects:s129}}
"log" \sfentry{\scheme{(log~\var{num})}}{\categoryprocedure}{\pageref{./objects:s130}}
"log" \sfentry{\scheme{(log~\var{num$_1$}~\var{num$_2$})}}{\categoryprocedure}{\pageref{./objects:s130}}
"sin" \sfentry{\scheme{(sin~\var{num})}}{\categoryprocedure}{\pageref{./objects:s131}}
"cos" \sfentry{\scheme{(cos~\var{num})}}{\categoryprocedure}{\pageref{./objects:s131}}
"tan" \sfentry{\scheme{(tan~\var{num})}}{\categoryprocedure}{\pageref{./objects:s131}}
"asin" \sfentry{\scheme{(asin~\var{num})}}{\categoryprocedure}{\pageref{./objects:s132}}
"acos" \sfentry{\scheme{(acos~\var{num})}}{\categoryprocedure}{\pageref{./objects:s132}}
"atan" \sfentry{\scheme{(atan~\var{num})}}{\categoryprocedure}{\pageref{./objects:s133}}
"atan" \sfentry{\scheme{(atan~\var{real$_1$}~\var{real$_2$})}}{\categoryprocedure}{\pageref{./objects:s133}}
"bitwise-not" \sfentry{\scheme{(bitwise-not~\var{exint})}}{\categoryprocedure}{\pageref{./objects:s134}}
"bitwise-and" \sfentry{\scheme{(bitwise-and~\var{exint}~{\dots})}}{\categoryprocedure}{\pageref{./objects:s134}}
"bitwise-ior" \sfentry{\scheme{(bitwise-ior~\var{exint}~{\dots})}}{\categoryprocedure}{\pageref{./objects:s134}}
"bitwise-xor" \sfentry{\scheme{(bitwise-xor~\var{exint}~{\dots})}}{\categoryprocedure}{\pageref{./objects:s134}}
"bitwise-if" \sfentry{\scheme{(bitwise-if~\var{exint$_1$}~\var{exint$_2$}~\var{exint$_3$})}}{\categoryprocedure}{\pageref{./objects:s135}}
"bitwise-bit-count" \sfentry{\scheme{(bitwise-bit-count~\var{exint})}}{\categoryprocedure}{\pageref{./objects:s136}}
"bitwise-length" \sfentry{\scheme{(bitwise-length~\var{exint})}}{\categoryprocedure}{\pageref{./objects:s137}}
"bitwise-first-bit-set" \sfentry{\scheme{(bitwise-first-bit-set~\var{exint})}}{\categoryprocedure}{\pageref{./objects:s138}}
"bitwise-bit-set?" \sfentry{\scheme{(bitwise-bit-set?~\var{exint$_1$}~\var{exint$_2$})}}{\categoryprocedure}{\pageref{./objects:s139}}
"bitwise-copy-bit" \sfentry{\scheme{(bitwise-copy-bit~\var{exint$_1$}~\var{exint$_2$}~\var{exint$_3$})}}{\categoryprocedure}{\pageref{./objects:s140}}
"bitwise-bit-field" \sfentry{\scheme{(bitwise-bit-field~\var{exint$_1$}~\var{exint$_2$}~\var{exint$_3$})}}{\categoryprocedure}{\pageref{./objects:s141}}
"bitwise-copy-bit-field" \sfentry{\scheme{(bitwise-copy-bit-field~\var{exint$_1$}~\var{exint$_2$}~\var{exint$_3$}~\var{exint$_4$})}}{\categoryprocedure}{\pageref{./objects:s142}}
"bitwise-arithmetic-shift-right" \sfentry{\scheme{(bitwise-arithmetic-shift-right~\var{exint$_1$}~\var{exint$_2$})}}{\categoryprocedure}{\pageref{./objects:s143}}
"bitwise-arithmetic-shift-left" \sfentry{\scheme{(bitwise-arithmetic-shift-left~\var{exint$_1$}~\var{exint$_2$})}}{\categoryprocedure}{\pageref{./objects:s143}}
"bitwise-arithmetic-shift" \sfentry{\scheme{(bitwise-arithmetic-shift~\var{exint$_1$}~\var{exint$_2$})}}{\categoryprocedure}{\pageref{./objects:s144}}
"bitwise-rotate-bit-field" \sfentry{\scheme{(bitwise-rotate-bit-field~\var{exint$_1$}~\var{exint$_2$}~\var{exint$_3$}~\var{exint$_4$})}}{\categoryprocedure}{\pageref{./objects:s145}}
"bitwise-reverse-bit-field" \sfentry{\scheme{(bitwise-reverse-bit-field~\var{exint$_1$}~\var{exint$_2$}~\var{exint$_3$})}}{\categoryprocedure}{\pageref{./objects:s146}}
"string->number" \sfentry{\scheme{(string->number~\var{string})}}{\categoryprocedure}{\pageref{./objects:s147}}
"string->number" \sfentry{\scheme{(string->number~\var{string}~\var{radix})}}{\categoryprocedure}{\pageref{./objects:s147}}
"number->string" \sfentry{\scheme{(number->string~\var{num})}}{\categoryprocedure}{\pageref{./objects:s148}}
"number->string" \sfentry{\scheme{(number->string~\var{num}~\var{radix})}}{\categoryprocedure}{\pageref{./objects:s148}}
"number->string" \sfentry{\scheme{(number->string~\var{num}~\var{radix}~\var{precision})}}{\categoryprocedure}{\pageref{./objects:s148}}
"fixnum?" \sfentry{\scheme{(fixnum?~\var{obj})}}{\categoryprocedure}{\pageref{./objects:s150}}
"least-fixnum" \sfentry{\scheme{(least-fixnum)}}{\categoryprocedure}{\pageref{./objects:s151}}
"greatest-fixnum" \sfentry{\scheme{(greatest-fixnum)}}{\categoryprocedure}{\pageref{./objects:s151}}
"fixnum-width" \sfentry{\scheme{(fixnum-width)}}{\categoryprocedure}{\pageref{./objects:s152}}
"fx=?" \sfentry{\scheme{(fx=?~\var{fx$_1$}~\var{fx$_2$}~\var{fx$_3$}~{\dots})}}{\categoryprocedure}{\pageref{./objects:s153}}
"fx<?" \sfentry{\scheme{(fx<?~\var{fx$_1$}~\var{fx$_2$}~\var{fx$_3$}~{\dots})}}{\categoryprocedure}{\pageref{./objects:s153}}
"fx>?" \sfentry{\scheme{(fx>?~\var{fx$_1$}~\var{fx$_2$}~\var{fx$_3$}~{\dots})}}{\categoryprocedure}{\pageref{./objects:s153}}
"fx<=?" \sfentry{\scheme{(fx<=?~\var{fx$_1$}~\var{fx$_2$}~\var{fx$_3$}~{\dots})}}{\categoryprocedure}{\pageref{./objects:s153}}
"fx>=?" \sfentry{\scheme{(fx>=?~\var{fx$_1$}~\var{fx$_2$}~\var{fx$_3$}~{\dots})}}{\categoryprocedure}{\pageref{./objects:s153}}
"fxzero?" \sfentry{\scheme{(fxzero?~\var{fx})}}{\categoryprocedure}{\pageref{./objects:s154}}
"fxpositive?" \sfentry{\scheme{(fxpositive?~\var{fx})}}{\categoryprocedure}{\pageref{./objects:s154}}
"fxnegative?" \sfentry{\scheme{(fxnegative?~\var{fx})}}{\categoryprocedure}{\pageref{./objects:s154}}
"fxeven?" \sfentry{\scheme{(fxeven?~\var{fx})}}{\categoryprocedure}{\pageref{./objects:s155}}
"fxodd?" \sfentry{\scheme{(fxodd?~\var{fx})}}{\categoryprocedure}{\pageref{./objects:s155}}
"fxmin" \sfentry{\scheme{(fxmin~\var{fx$_1$}~\var{fx$_2$}~{\dots})}}{\categoryprocedure}{\pageref{./objects:s156}}
"fxmax" \sfentry{\scheme{(fxmax~\var{fx$_1$}~\var{fx$_2$}~{\dots})}}{\categoryprocedure}{\pageref{./objects:s156}}
"fx+" \sfentry{\scheme{(fx+~\var{fx$_1$}~\var{fx$_2$})}}{\categoryprocedure}{\pageref{./objects:s157}}
"fx-" \sfentry{\scheme{(fx-~\var{fx})}}{\categoryprocedure}{\pageref{./objects:s158}}
"fx-" \sfentry{\scheme{(fx-~\var{fx$_1$}~\var{fx$_2$})}}{\categoryprocedure}{\pageref{./objects:s158}}
"fx*" \sfentry{\scheme{(fx*~\var{fx$_1$}~\var{fx$_2$})}}{\categoryprocedure}{\pageref{./objects:s159}}
"fxdiv" \sfentry{\scheme{(fxdiv~\var{fx$_1$}~\var{fx$_2$})}}{\categoryprocedure}{\pageref{./objects:s160}}
"fxmod" \sfentry{\scheme{(fxmod~\var{fx$_1$}~\var{fx$_2$})}}{\categoryprocedure}{\pageref{./objects:s160}}
"fxdiv-and-mod" \sfentry{\scheme{(fxdiv-and-mod~\var{fx$_1$}~\var{fx$_2$})}}{\categoryprocedure}{\pageref{./objects:s160}}
"fxdiv0" \sfentry{\scheme{(fxdiv0~\var{fx$_1$}~\var{fx$_2$})}}{\categoryprocedure}{\pageref{./objects:s161}}
"fxmod0" \sfentry{\scheme{(fxmod0~\var{fx$_1$}~\var{fx$_2$})}}{\categoryprocedure}{\pageref{./objects:s161}}
"fxdiv0-and-mod0" \sfentry{\scheme{(fxdiv0-and-mod0~\var{fx$_1$}~\var{fx$_2$})}}{\categoryprocedure}{\pageref{./objects:s161}}
"fx+/carry" \sfentry{\scheme{(fx+/carry~\var{fx$_1$}~\var{fx$_2$}~\var{fx$_3$})}}{\categoryprocedure}{\pageref{./objects:s162}}
"fx-/carry" \sfentry{\scheme{(fx-/carry~\var{fx$_1$}~\var{fx$_2$}~\var{fx$_3$})}}{\categoryprocedure}{\pageref{./objects:s162}}
"fx*/carry" \sfentry{\scheme{(fx*/carry~\var{fx$_1$}~\var{fx$_2$}~\var{fx$_3$})}}{\categoryprocedure}{\pageref{./objects:s162}}
"fxnot" \sfentry{\scheme{(fxnot~\var{fx})}}{\categoryprocedure}{\pageref{./objects:s163}}
"fxand" \sfentry{\scheme{(fxand~\var{fx}~{\dots})}}{\categoryprocedure}{\pageref{./objects:s163}}
"fxior" \sfentry{\scheme{(fxior~\var{fx}~{\dots})}}{\categoryprocedure}{\pageref{./objects:s163}}
"fxxor" \sfentry{\scheme{(fxxor~\var{fx}~{\dots})}}{\categoryprocedure}{\pageref{./objects:s163}}
"fxif" \sfentry{\scheme{(fxif~\var{fx$_1$}~\var{fx$_2$}~\var{fx$_3$})}}{\categoryprocedure}{\pageref{./objects:s164}}
"fxbit-count" \sfentry{\scheme{(fxbit-count~\var{fx})}}{\categoryprocedure}{\pageref{./objects:s165}}
"fxlength" \sfentry{\scheme{(fxlength~\var{fx})}}{\categoryprocedure}{\pageref{./objects:s166}}
"fxfirst-bit-set" \sfentry{\scheme{(fxfirst-bit-set~\var{fx})}}{\categoryprocedure}{\pageref{./objects:s167}}
"fxbit-set?" \sfentry{\scheme{(fxbit-set?~\var{fx$_1$}~\var{fx$_2$})}}{\categoryprocedure}{\pageref{./objects:s168}}
"fxcopy-bit" \sfentry{\scheme{(fxcopy-bit~\var{fx$_1$}~\var{fx$_2$}~\var{fx$_3$})}}{\categoryprocedure}{\pageref{./objects:s169}}
"fxbit-field" \sfentry{\scheme{(fxbit-field~\var{fx$_1$}~\var{fx$_2$}~\var{fx$_3$})}}{\categoryprocedure}{\pageref{./objects:s170}}
"fxcopy-bit-field" \sfentry{\scheme{(fxcopy-bit-field~\var{fx$_1$}~\var{fx$_2$}~\var{fx$_3$}~\var{fx$_4$})}}{\categoryprocedure}{\pageref{./objects:s171}}
"fxarithmetic-shift-right" \sfentry{\scheme{(fxarithmetic-shift-right~\var{fx$_1$}~\var{fx$_2$})}}{\categoryprocedure}{\pageref{./objects:s172}}
"fxarithmetic-shift-left" \sfentry{\scheme{(fxarithmetic-shift-left~\var{fx$_1$}~\var{fx$_2$})}}{\categoryprocedure}{\pageref{./objects:s172}}
"fxarithmetic-shift" \sfentry{\scheme{(fxarithmetic-shift~\var{fx$_1$}~\var{fx$_2$})}}{\categoryprocedure}{\pageref{./objects:s173}}
"fxrotate-bit-field" \sfentry{\scheme{(fxrotate-bit-field~\var{fx$_1$}~\var{fx$_2$}~\var{fx$_3$}~\var{fx$_4$})}}{\categoryprocedure}{\pageref{./objects:s174}}
"fxreverse-bit-field" \sfentry{\scheme{(fxreverse-bit-field~\var{fx$_1$}~\var{fx$_2$}~\var{fx$_3$})}}{\categoryprocedure}{\pageref{./objects:s175}}
"flonum?" \sfentry{\scheme{(flonum?~\var{obj})}}{\categoryprocedure}{\pageref{./objects:s177}}
"fl=?" \sfentry{\scheme{(fl=?~\var{fl$_1$}~\var{fl$_2$}~\var{fl$_3$}~{\dots})}}{\categoryprocedure}{\pageref{./objects:s178}}
"fl<?" \sfentry{\scheme{(fl<?~\var{fl$_1$}~\var{fl$_2$}~\var{fl$_3$}~{\dots})}}{\categoryprocedure}{\pageref{./objects:s178}}
"fl>?" \sfentry{\scheme{(fl>?~\var{fl$_1$}~\var{fl$_2$}~\var{fl$_3$}~{\dots})}}{\categoryprocedure}{\pageref{./objects:s178}}
"fl<=?" \sfentry{\scheme{(fl<=?~\var{fl$_1$}~\var{fl$_2$}~\var{fl$_3$}~{\dots})}}{\categoryprocedure}{\pageref{./objects:s178}}
"fl>=?" \sfentry{\scheme{(fl>=?~\var{fl$_1$}~\var{fl$_2$}~\var{fl$_3$}~{\dots})}}{\categoryprocedure}{\pageref{./objects:s178}}
"flzero?" \sfentry{\scheme{(flzero?~\var{fl})}}{\categoryprocedure}{\pageref{./objects:s179}}
"flpositive?" \sfentry{\scheme{(flpositive?~\var{fl})}}{\categoryprocedure}{\pageref{./objects:s179}}
"flnegative?" \sfentry{\scheme{(flnegative?~\var{fl})}}{\categoryprocedure}{\pageref{./objects:s179}}
"flinteger?" \sfentry{\scheme{(flinteger?~\var{fl})}}{\categoryprocedure}{\pageref{./objects:s180}}
"flfinite?" \sfentry{\scheme{(flfinite?~\var{fl})}}{\categoryprocedure}{\pageref{./objects:s181}}
"flinfinite?" \sfentry{\scheme{(flinfinite?~\var{fl})}}{\categoryprocedure}{\pageref{./objects:s181}}
"flnan?" \sfentry{\scheme{(flnan?~\var{fl})}}{\categoryprocedure}{\pageref{./objects:s181}}
"fleven?" \sfentry{\scheme{(fleven?~\var{fl-int})}}{\categoryprocedure}{\pageref{./objects:s182}}
"flodd?" \sfentry{\scheme{(flodd?~\var{fl-int})}}{\categoryprocedure}{\pageref{./objects:s182}}
"flmin" \sfentry{\scheme{(flmin~\var{fl$_1$}~\var{fl$_2$}~{\dots})}}{\categoryprocedure}{\pageref{./objects:s183}}
"flmax" \sfentry{\scheme{(flmax~\var{fl$_1$}~\var{fl$_2$}~{\dots})}}{\categoryprocedure}{\pageref{./objects:s183}}
"fl+" \sfentry{\scheme{(fl+~\var{fl}~{\dots})}}{\categoryprocedure}{\pageref{./objects:s184}}
"fl-" \sfentry{\scheme{(fl-~\var{fl})}}{\categoryprocedure}{\pageref{./objects:s185}}
"fl-" \sfentry{\scheme{(fl-~\var{fl$_1$}~\var{fl$_2$}~\var{fl$_3$}~{\dots})}}{\categoryprocedure}{\pageref{./objects:s185}}
"fl*" \sfentry{\scheme{(fl*~\var{fl}~{\dots})}}{\categoryprocedure}{\pageref{./objects:s186}}
"fl/" \sfentry{\scheme{(fl/~\var{fl})}}{\categoryprocedure}{\pageref{./objects:s187}}
"fl/" \sfentry{\scheme{(fl/~\var{fl$_1$}~\var{fl$_2$}~\var{fl$_3$}~{\dots})}}{\categoryprocedure}{\pageref{./objects:s187}}
"fldiv" \sfentry{\scheme{(fldiv~\var{fl$_1$}~\var{fl$_2$})}}{\categoryprocedure}{\pageref{./objects:s188}}
"flmod" \sfentry{\scheme{(flmod~\var{fl$_1$}~\var{fl$_2$})}}{\categoryprocedure}{\pageref{./objects:s188}}
"fldiv-and-mod" \sfentry{\scheme{(fldiv-and-mod~\var{fl$_1$}~\var{fl$_2$})}}{\categoryprocedure}{\pageref{./objects:s188}}
"fldiv0" \sfentry{\scheme{(fldiv0~\var{fl$_1$}~\var{fl$_2$})}}{\categoryprocedure}{\pageref{./objects:s189}}
"flmod0" \sfentry{\scheme{(flmod0~\var{fl$_1$}~\var{fl$_2$})}}{\categoryprocedure}{\pageref{./objects:s189}}
"fldiv0-and-mod0" \sfentry{\scheme{(fldiv0-and-mod0~\var{fl$_1$}~\var{fl$_2$})}}{\categoryprocedure}{\pageref{./objects:s189}}
"flround" \sfentry{\scheme{(flround~\var{fl})}}{\categoryprocedure}{\pageref{./objects:s190}}
"fltruncate" \sfentry{\scheme{(fltruncate~\var{fl})}}{\categoryprocedure}{\pageref{./objects:s190}}
"flfloor" \sfentry{\scheme{(flfloor~\var{fl})}}{\categoryprocedure}{\pageref{./objects:s190}}
"flceiling" \sfentry{\scheme{(flceiling~\var{fl})}}{\categoryprocedure}{\pageref{./objects:s190}}
"flnumerator" \sfentry{\scheme{(flnumerator~\var{fl})}}{\categoryprocedure}{\pageref{./objects:s191}}
"fldenominator" \sfentry{\scheme{(fldenominator~\var{fl})}}{\categoryprocedure}{\pageref{./objects:s191}}
"flabs" \sfentry{\scheme{(flabs~\var{fl})}}{\categoryprocedure}{\pageref{./objects:s192}}
"flexp" \sfentry{\scheme{(flexp~\var{fl})}}{\categoryprocedure}{\pageref{./objects:s193}}
"fllog" \sfentry{\scheme{(fllog~\var{fl})}}{\categoryprocedure}{\pageref{./objects:s193}}
"fllog" \sfentry{\scheme{(fllog~\var{fl$_1$}~\var{fl$_2$})}}{\categoryprocedure}{\pageref{./objects:s193}}
"flsin" \sfentry{\scheme{(flsin~\var{fl})}}{\categoryprocedure}{\pageref{./objects:s194}}
"flcos" \sfentry{\scheme{(flcos~\var{fl})}}{\categoryprocedure}{\pageref{./objects:s194}}
"fltan" \sfentry{\scheme{(fltan~\var{fl})}}{\categoryprocedure}{\pageref{./objects:s194}}
"flasin" \sfentry{\scheme{(flasin~\var{fl})}}{\categoryprocedure}{\pageref{./objects:s195}}
"flacos" \sfentry{\scheme{(flacos~\var{fl})}}{\categoryprocedure}{\pageref{./objects:s195}}
"flatan" \sfentry{\scheme{(flatan~\var{fl})}}{\categoryprocedure}{\pageref{./objects:s195}}
"flatan" \sfentry{\scheme{(flatan~\var{fl$_1$}~\var{fl$_2$})}}{\categoryprocedure}{\pageref{./objects:s195}}
"flsqrt" \sfentry{\scheme{(flsqrt~\var{fl})}}{\categoryprocedure}{\pageref{./objects:s196}}
"flexpt" \sfentry{\scheme{(flexpt~\var{fl$_1$}~\var{fl$_2$})}}{\categoryprocedure}{\pageref{./objects:s197}}
"fixnum->flonum" \sfentry{\scheme{(fixnum->flonum~\var{fx})}}{\categoryprocedure}{\pageref{./objects:s198}}
"real->flonum" \sfentry{\scheme{(real->flonum~\var{real})}}{\categoryprocedure}{\pageref{./objects:s198}}
"char=?" \sfentry{\scheme{(char=?~\var{char$_1$}~\var{char$_2$}~\var{char$_3$}~{\dots})}}{\categoryprocedure}{\pageref{./objects:s201}}
"char<?" \sfentry{\scheme{(char<?~\var{char$_1$}~\var{char$_2$}~\var{char$_3$}~{\dots})}}{\categoryprocedure}{\pageref{./objects:s201}}
"char>?" \sfentry{\scheme{(char>?~\var{char$_1$}~\var{char$_2$}~\var{char$_3$}~{\dots})}}{\categoryprocedure}{\pageref{./objects:s201}}
"char<=?" \sfentry{\scheme{(char<=?~\var{char$_1$}~\var{char$_2$}~\var{char$_3$}~{\dots})}}{\categoryprocedure}{\pageref{./objects:s201}}
"char>=?" \sfentry{\scheme{(char>=?~\var{char$_1$}~\var{char$_2$}~\var{char$_3$}~{\dots})}}{\categoryprocedure}{\pageref{./objects:s201}}
"char-ci=?" \sfentry{\scheme{(char-ci=?~\var{char$_1$}~\var{char$_2$}~\var{char$_3$}~{\dots})}}{\categoryprocedure}{\pageref{./objects:s202}}
"char-ci<?" \sfentry{\scheme{(char-ci<?~\var{char$_1$}~\var{char$_2$}~\var{char$_3$}~{\dots})}}{\categoryprocedure}{\pageref{./objects:s202}}
"char-ci>?" \sfentry{\scheme{(char-ci>?~\var{char$_1$}~\var{char$_2$}~\var{char$_3$}~{\dots})}}{\categoryprocedure}{\pageref{./objects:s202}}
"char-ci<=?" \sfentry{\scheme{(char-ci<=?~\var{char$_1$}~\var{char$_2$}~\var{char$_3$}~{\dots})}}{\categoryprocedure}{\pageref{./objects:s202}}
"char-ci>=?" \sfentry{\scheme{(char-ci>=?~\var{char$_1$}~\var{char$_2$}~\var{char$_3$}~{\dots})}}{\categoryprocedure}{\pageref{./objects:s202}}
"char-alphabetic?" \sfentry{\scheme{(char-alphabetic?~\var{char})}}{\categoryprocedure}{\pageref{./objects:s203}}
"char-numeric?" \sfentry{\scheme{(char-numeric?~\var{char})}}{\categoryprocedure}{\pageref{./objects:s203}}
"char-whitespace?" \sfentry{\scheme{(char-whitespace?~\var{char})}}{\categoryprocedure}{\pageref{./objects:s203}}
"char-lower-case?" \sfentry{\scheme{(char-lower-case?~\var{char})}}{\categoryprocedure}{\pageref{./objects:s204}}
"char-upper-case?" \sfentry{\scheme{(char-upper-case?~\var{char})}}{\categoryprocedure}{\pageref{./objects:s204}}
"char-title-case?" \sfentry{\scheme{(char-title-case?~\var{char})}}{\categoryprocedure}{\pageref{./objects:s204}}
"char-general-category" \sfentry{\scheme{(char-general-category~\var{char})}}{\categoryprocedure}{\pageref{./objects:s205}}
"char-upcase" \sfentry{\scheme{(char-upcase~\var{char})}}{\categoryprocedure}{\pageref{./objects:s206}}
"char-downcase" \sfentry{\scheme{(char-downcase~\var{char})}}{\categoryprocedure}{\pageref{./objects:s207}}
"char-titlecase" \sfentry{\scheme{(char-titlecase~\var{char})}}{\categoryprocedure}{\pageref{./objects:s208}}
"char-foldcase" \sfentry{\scheme{(char-foldcase~\var{char})}}{\categoryprocedure}{\pageref{./objects:s209}}
"char->integer" \sfentry{\scheme{(char->integer~\var{char})}}{\categoryprocedure}{\pageref{./objects:s210}}
"integer->char" \sfentry{\scheme{(integer->char~\var{n})}}{\categoryprocedure}{\pageref{./objects:s211}}
"string=?" \sfentry{\scheme{(string=?~\var{string$_1$}~\var{string$_2$}~\var{string$_3$}~{\dots})}}{\categoryprocedure}{\pageref{./objects:s215}}
"string<?" \sfentry{\scheme{(string<?~\var{string$_1$}~\var{string$_2$}~\var{string$_3$}~{\dots})}}{\categoryprocedure}{\pageref{./objects:s215}}
"string>?" \sfentry{\scheme{(string>?~\var{string$_1$}~\var{string$_2$}~\var{string$_3$}~{\dots})}}{\categoryprocedure}{\pageref{./objects:s215}}
"string<=?" \sfentry{\scheme{(string<=?~\var{string$_1$}~\var{string$_2$}~\var{string$_3$}~{\dots})}}{\categoryprocedure}{\pageref{./objects:s215}}
"string>=?" \sfentry{\scheme{(string>=?~\var{string$_1$}~\var{string$_2$}~\var{string$_3$}~{\dots})}}{\categoryprocedure}{\pageref{./objects:s215}}
"string-ci=?" \sfentry{\scheme{(string-ci=?~\var{string$_1$}~\var{string$_2$}~\var{string$_3$}~{\dots})}}{\categoryprocedure}{\pageref{./objects:s216}}
"string-ci<?" \sfentry{\scheme{(string-ci<?~\var{string$_1$}~\var{string$_2$}~\var{string$_3$}~{\dots})}}{\categoryprocedure}{\pageref{./objects:s216}}
"string-ci>?" \sfentry{\scheme{(string-ci>?~\var{string$_1$}~\var{string$_2$}~\var{string$_3$}~{\dots})}}{\categoryprocedure}{\pageref{./objects:s216}}
"string-ci<=?" \sfentry{\scheme{(string-ci<=?~\var{string$_1$}~\var{string$_2$}~\var{string$_3$}~{\dots})}}{\categoryprocedure}{\pageref{./objects:s216}}
"string-ci>=?" \sfentry{\scheme{(string-ci>=?~\var{string$_1$}~\var{string$_2$}~\var{string$_3$}~{\dots})}}{\categoryprocedure}{\pageref{./objects:s216}}
"string" \sfentry{\scheme{(string~\var{char}~{\dots})}}{\categoryprocedure}{\pageref{./objects:s217}}
"make-string" \sfentry{\scheme{(make-string~\var{n})}}{\categoryprocedure}{\pageref{./objects:s218}}
"make-string" \sfentry{\scheme{(make-string~\var{n}~\var{char})}}{\categoryprocedure}{\pageref{./objects:s218}}
"string-length" \sfentry{\scheme{(string-length~\var{string})}}{\categoryprocedure}{\pageref{./objects:s219}}
"string-ref" \sfentry{\scheme{(string-ref~\var{string}~\var{n})}}{\categoryprocedure}{\pageref{./objects:s220}}
"string-set!" \sfentry{\scheme{(string-set!~\var{string}~\var{n}~\var{char})}}{\categoryprocedure}{\pageref{./objects:s221}}
"string-copy" \sfentry{\scheme{(string-copy~\var{string})}}{\categoryprocedure}{\pageref{./objects:s222}}
"string-append" \sfentry{\scheme{(string-append~\var{string}~{\dots})}}{\categoryprocedure}{\pageref{./objects:s223}}
"substring" \sfentry{\scheme{(substring~\var{string}~\var{start}~\var{end})}}{\categoryprocedure}{\pageref{./objects:s224}}
"string-fill!" \sfentry{\scheme{(string-fill!~\var{string}~\var{char})}}{\categoryprocedure}{\pageref{./objects:s225}}
"string-upcase" \sfentry{\scheme{(string-upcase~\var{string})}}{\categoryprocedure}{\pageref{./objects:s226}}
"string-downcase" \sfentry{\scheme{(string-downcase~\var{string})}}{\categoryprocedure}{\pageref{./objects:s226}}
"string-foldcase" \sfentry{\scheme{(string-foldcase~\var{string})}}{\categoryprocedure}{\pageref{./objects:s226}}
"string-titlecase" \sfentry{\scheme{(string-titlecase~\var{string})}}{\categoryprocedure}{\pageref{./objects:s226}}
"string-normalize-nfd" \sfentry{\scheme{(string-normalize-nfd~\var{string})}}{\categoryprocedure}{\pageref{./objects:s227}}
"string-normalize-nfkd" \sfentry{\scheme{(string-normalize-nfkd~\var{string})}}{\categoryprocedure}{\pageref{./objects:s227}}
"string-normalize-nfc" \sfentry{\scheme{(string-normalize-nfc~\var{string})}}{\categoryprocedure}{\pageref{./objects:s227}}
"string-normalize-nfkc" \sfentry{\scheme{(string-normalize-nfkc~\var{string})}}{\categoryprocedure}{\pageref{./objects:s227}}
"string->list" \sfentry{\scheme{(string->list~\var{string})}}{\categoryprocedure}{\pageref{./objects:s228}}
"list->string" \sfentry{\scheme{(list->string~\var{list})}}{\categoryprocedure}{\pageref{./objects:s229}}
"vector" \sfentry{\scheme{(vector~\var{obj}~{\dots})}}{\categoryprocedure}{\pageref{./objects:s231}}
"make-vector" \sfentry{\scheme{(make-vector~\var{n})}}{\categoryprocedure}{\pageref{./objects:s232}}
"make-vector" \sfentry{\scheme{(make-vector~\var{n}~\var{obj})}}{\categoryprocedure}{\pageref{./objects:s232}}
"vector-length" \sfentry{\scheme{(vector-length~\var{vector})}}{\categoryprocedure}{\pageref{./objects:s233}}
"vector-ref" \sfentry{\scheme{(vector-ref~\var{vector}~\var{n})}}{\categoryprocedure}{\pageref{./objects:s234}}
"vector-set!" \sfentry{\scheme{(vector-set!~\var{vector}~\var{n}~\var{obj})}}{\categoryprocedure}{\pageref{./objects:s235}}
"vector-fill!" \sfentry{\scheme{(vector-fill!~\var{vector}~\var{obj})}}{\categoryprocedure}{\pageref{./objects:s236}}
"vector->list" \sfentry{\scheme{(vector->list~\var{vector})}}{\categoryprocedure}{\pageref{./objects:s237}}
"list->vector" \sfentry{\scheme{(list->vector~\var{list})}}{\categoryprocedure}{\pageref{./objects:s238}}
"vector-sort" \sfentry{\scheme{(vector-sort~\var{predicate}~\var{vector})}}{\categoryprocedure}{\pageref{./objects:s239}}
"vector-sort!" \sfentry{\scheme{(vector-sort!~\var{predicate}~\var{vector})}}{\categoryprocedure}{\pageref{./objects:s239}}
"endianness" \sfentry{\scheme{(endianness~\var{symbol})}}{\categorysyntax}{\pageref{./objects:s240}}
"native-endianness" \sfentry{\scheme{(native-endianness)}}{\categoryprocedure}{\pageref{./objects:s241}}
"make-bytevector" \sfentry{\scheme{(make-bytevector~\var{n})}}{\categoryprocedure}{\pageref{./objects:s242}}
"make-bytevector" \sfentry{\scheme{(make-bytevector~\var{n}~\var{fill})}}{\categoryprocedure}{\pageref{./objects:s242}}
"bytevector-length" \sfentry{\scheme{(bytevector-length~\var{bytevector})}}{\categoryprocedure}{\pageref{./objects:s243}}
"bytevector=?" \sfentry{\scheme{(bytevector=?~\var{bytevector$_1$}~\var{bytevector$_2$})}}{\categoryprocedure}{\pageref{./objects:s244}}
"bytevector-fill!" \sfentry{\scheme{(bytevector-fill!~\var{bytevector}~\var{fill})}}{\categoryprocedure}{\pageref{./objects:s245}}
"bytevector-copy" \sfentry{\scheme{(bytevector-copy~\var{bytevector})}}{\categoryprocedure}{\pageref{./objects:s246}}
"bytevector-copy!" \sfentry{\scheme{(bytevector-copy!~\var{src}~\var{src-start}~\var{dst}~\var{dst-start}~\var{n})}}{\categoryprocedure}{\pageref{./objects:s247}}
"bytevector-u8-ref" \sfentry{\scheme{(bytevector-u8-ref~\var{bytevector}~\var{n})}}{\categoryprocedure}{\pageref{./objects:s248}}
"bytevector-s8-ref" \sfentry{\scheme{(bytevector-s8-ref~\var{bytevector}~\var{n})}}{\categoryprocedure}{\pageref{./objects:s249}}
"bytevector-u8-set!" \sfentry{\scheme{(bytevector-u8-set!~\var{bytevector}~\var{n}~\var{u8})}}{\categoryprocedure}{\pageref{./objects:s250}}
"bytevector-s8-set!" \sfentry{\scheme{(bytevector-s8-set!~\var{bytevector}~\var{n}~\var{s8})}}{\categoryprocedure}{\pageref{./objects:s251}}
"bytevector->u8-list" \sfentry{\scheme{(bytevector->u8-list~\var{bytevector})}}{\categoryprocedure}{\pageref{./objects:s252}}
"u8-list->bytevector" \sfentry{\scheme{(u8-list->bytevector~\var{list})}}{\categoryprocedure}{\pageref{./objects:s253}}
"bytevector-u16-native-ref" \sfentry{\scheme{(bytevector-u16-native-ref~\var{bytevector}~\var{n})}}{\categoryprocedure}{\pageref{./objects:s254}}
"bytevector-s16-native-ref" \sfentry{\scheme{(bytevector-s16-native-ref~\var{bytevector}~\var{n})}}{\categoryprocedure}{\pageref{./objects:s254}}
"bytevector-u32-native-ref" \sfentry{\scheme{(bytevector-u32-native-ref~\var{bytevector}~\var{n})}}{\categoryprocedure}{\pageref{./objects:s254}}
"bytevector-s32-native-ref" \sfentry{\scheme{(bytevector-s32-native-ref~\var{bytevector}~\var{n})}}{\categoryprocedure}{\pageref{./objects:s254}}
"bytevector-u64-native-ref" \sfentry{\scheme{(bytevector-u64-native-ref~\var{bytevector}~\var{n})}}{\categoryprocedure}{\pageref{./objects:s254}}
"bytevector-s64-native-ref" \sfentry{\scheme{(bytevector-s64-native-ref~\var{bytevector}~\var{n})}}{\categoryprocedure}{\pageref{./objects:s254}}
"bytevector-u16-native-set!" \sfentry{\scheme{(bytevector-u16-native-set!~\var{bytevector}~\var{n}~\var{u16})}}{\categoryprocedure}{\pageref{./objects:s255}}
"bytevector-s16-native-set!" \sfentry{\scheme{(bytevector-s16-native-set!~\var{bytevector}~\var{n}~\var{s16})}}{\categoryprocedure}{\pageref{./objects:s255}}
"bytevector-u32-native-set!" \sfentry{\scheme{(bytevector-u32-native-set!~\var{bytevector}~\var{n}~\var{u32})}}{\categoryprocedure}{\pageref{./objects:s255}}
"bytevector-s32-native-set!" \sfentry{\scheme{(bytevector-s32-native-set!~\var{bytevector}~\var{n}~\var{s32})}}{\categoryprocedure}{\pageref{./objects:s255}}
"bytevector-u64-native-set!" \sfentry{\scheme{(bytevector-u64-native-set!~\var{bytevector}~\var{n}~\var{u64})}}{\categoryprocedure}{\pageref{./objects:s255}}
"bytevector-s64-native-set!" \sfentry{\scheme{(bytevector-s64-native-set!~\var{bytevector}~\var{n}~\var{s64})}}{\categoryprocedure}{\pageref{./objects:s255}}
"bytevector-u16-ref" \sfentry{\scheme{(bytevector-u16-ref~\var{bytevector}~\var{n}~\var{eness})}}{\categoryprocedure}{\pageref{./objects:s256}}
"bytevector-s16-ref" \sfentry{\scheme{(bytevector-s16-ref~\var{bytevector}~\var{n}~\var{eness})}}{\categoryprocedure}{\pageref{./objects:s256}}
"bytevector-u32-ref" \sfentry{\scheme{(bytevector-u32-ref~\var{bytevector}~\var{n}~\var{eness})}}{\categoryprocedure}{\pageref{./objects:s256}}
"bytevector-s32-ref" \sfentry{\scheme{(bytevector-s32-ref~\var{bytevector}~\var{n}~\var{eness})}}{\categoryprocedure}{\pageref{./objects:s256}}
"bytevector-u64-ref" \sfentry{\scheme{(bytevector-u64-ref~\var{bytevector}~\var{n}~\var{eness})}}{\categoryprocedure}{\pageref{./objects:s256}}
"bytevector-s64-ref" \sfentry{\scheme{(bytevector-s64-ref~\var{bytevector}~\var{n}~\var{eness})}}{\categoryprocedure}{\pageref{./objects:s256}}
"bytevector-u16-set!" \sfentry{\scheme{(bytevector-u16-set!~\var{bytevector}~\var{n}~\var{u16}~\var{eness})}}{\categoryprocedure}{\pageref{./objects:s257}}
"bytevector-s16-set!" \sfentry{\scheme{(bytevector-s16-set!~\var{bytevector}~\var{n}~\var{s16}~\var{eness})}}{\categoryprocedure}{\pageref{./objects:s257}}
"bytevector-u32-set!" \sfentry{\scheme{(bytevector-u32-set!~\var{bytevector}~\var{n}~\var{u32}~\var{eness})}}{\categoryprocedure}{\pageref{./objects:s257}}
"bytevector-s32-set!" \sfentry{\scheme{(bytevector-s32-set!~\var{bytevector}~\var{n}~\var{s32}~\var{eness})}}{\categoryprocedure}{\pageref{./objects:s257}}
"bytevector-u64-set!" \sfentry{\scheme{(bytevector-u64-set!~\var{bytevector}~\var{n}~\var{u64}~\var{eness})}}{\categoryprocedure}{\pageref{./objects:s257}}
"bytevector-s64-set!" \sfentry{\scheme{(bytevector-s64-set!~\var{bytevector}~\var{n}~\var{s64}~\var{eness})}}{\categoryprocedure}{\pageref{./objects:s257}}
"bytevector-uint-ref" \sfentry{\scheme{(bytevector-uint-ref~\var{bytevector}~\var{n}~\var{eness}~\var{size})}}{\categoryprocedure}{\pageref{./objects:s258}}
"bytevector-sint-ref" \sfentry{\scheme{(bytevector-sint-ref~\var{bytevector}~\var{n}~\var{eness}~\var{size})}}{\categoryprocedure}{\pageref{./objects:s258}}
"bytevector-uint-set!" \sfentry{\scheme{(bytevector-uint-set!~\var{bytevector}~\var{n}~\var{uint}~\var{eness}~\var{size})}}{\categoryprocedure}{\pageref{./objects:s259}}
"bytevector-sint-set!" \sfentry{\scheme{(bytevector-sint-set!~\var{bytevector}~\var{n}~\var{sint}~\var{eness}~\var{size})}}{\categoryprocedure}{\pageref{./objects:s259}}
"bytevector->uint-list" \sfentry{\scheme{(bytevector->uint-list~\var{bytevector}~\var{eness}~\var{size})}}{\categoryprocedure}{\pageref{./objects:s260}}
"bytevector->sint-list" \sfentry{\scheme{(bytevector->sint-list~\var{bytevector}~\var{eness}~\var{size})}}{\categoryprocedure}{\pageref{./objects:s260}}
"uint-list->bytevector" \sfentry{\scheme{(uint-list->bytevector~\var{list}~\var{eness}~\var{size})}}{\categoryprocedure}{\pageref{./objects:s261}}
"sint-list->bytevector" \sfentry{\scheme{(sint-list->bytevector~\var{list}~\var{eness}~\var{size})}}{\categoryprocedure}{\pageref{./objects:s261}}
"bytevector-ieee-single-native-ref" \sfentry{\scheme{(bytevector-ieee-single-native-ref~\var{bytevector}~\var{n})}}{\categoryprocedure}{\pageref{./objects:s262}}
"bytevector-ieee-double-native-ref" \sfentry{\scheme{(bytevector-ieee-double-native-ref~\var{bytevector}~\var{n})}}{\categoryprocedure}{\pageref{./objects:s262}}
"bytevector-ieee-single-native-set!" \sfentry{\scheme{(bytevector-ieee-single-native-set!~\var{bytevector}~\var{n}~\var{x})}}{\categoryprocedure}{\pageref{./objects:s263}}
"bytevector-ieee-double-native-set!" \sfentry{\scheme{(bytevector-ieee-double-native-set!~\var{bytevector}~\var{n}~\var{x})}}{\categoryprocedure}{\pageref{./objects:s263}}
"bytevector-ieee-single-ref" \sfentry{\scheme{(bytevector-ieee-single-ref~\var{bytevector}~\var{n}~\var{eness})}}{\categoryprocedure}{\pageref{./objects:s264}}
"bytevector-ieee-double-ref" \sfentry{\scheme{(bytevector-ieee-double-ref~\var{bytevector}~\var{n}~\var{eness})}}{\categoryprocedure}{\pageref{./objects:s264}}
"bytevector-ieee-single-set!" \sfentry{\scheme{(bytevector-ieee-single-set!~\var{bytevector}~\var{n}~\var{x}~\var{eness})}}{\categoryprocedure}{\pageref{./objects:s265}}
"bytevector-ieee-double-set!" \sfentry{\scheme{(bytevector-ieee-double-set!~\var{bytevector}~\var{n}~\var{x}~\var{eness})}}{\categoryprocedure}{\pageref{./objects:s265}}
"symbol=?" \sfentry{\scheme{(symbol=?~\var{symbol$_1$}~\var{symbol$_2$})}}{\categoryprocedure}{\pageref{./objects:s268}}
"string->symbol" \sfentry{\scheme{(string->symbol~\var{string})}}{\categoryprocedure}{\pageref{./objects:s269}}
"symbol->string" \sfentry{\scheme{(symbol->string~\var{symbol})}}{\categoryprocedure}{\pageref{./objects:s270}}
"boolean=?" \sfentry{\scheme{(boolean=?~\var{boolean$_1$}~\var{boolean$_2$})}}{\categoryprocedure}{\pageref{./objects:s271}}
"make-eq-hashtable" \sfentry{\scheme{(make-eq-hashtable)}}{\categoryprocedure}{\pageref{./objects:s274}}
"make-eq-hashtable" \sfentry{\scheme{(make-eq-hashtable~\var{size})}}{\categoryprocedure}{\pageref{./objects:s274}}
"make-eqv-hashtable" \sfentry{\scheme{(make-eqv-hashtable)}}{\categoryprocedure}{\pageref{./objects:s275}}
"make-eqv-hashtable" \sfentry{\scheme{(make-eqv-hashtable~\var{size})}}{\categoryprocedure}{\pageref{./objects:s275}}
"make-hashtable" \sfentry{\scheme{(make-hashtable~\var{hash}~\var{equiv?})}}{\categoryprocedure}{\pageref{./objects:s276}}
"make-hashtable" \sfentry{\scheme{(make-hashtable~\var{hash}~\var{equiv?}~\var{size})}}{\categoryprocedure}{\pageref{./objects:s276}}
"hashtable-mutable?" \sfentry{\scheme{(hashtable-mutable?~\var{hashtable})}}{\categoryprocedure}{\pageref{./objects:s277}}
"hashtable-hash-function" \sfentry{\scheme{(hashtable-hash-function~\var{hashtable})}}{\categoryprocedure}{\pageref{./objects:s278}}
"hashtable-equivalence-function" \sfentry{\scheme{(hashtable-equivalence-function~\var{hashtable})}}{\categoryprocedure}{\pageref{./objects:s278}}
"equal-hash" \sfentry{\scheme{(equal-hash~\var{obj})}}{\categoryprocedure}{\pageref{./objects:s279}}
"string-hash" \sfentry{\scheme{(string-hash~\var{string})}}{\categoryprocedure}{\pageref{./objects:s279}}
"string-ci-hash" \sfentry{\scheme{(string-ci-hash~\var{string})}}{\categoryprocedure}{\pageref{./objects:s279}}
"symbol-hash" \sfentry{\scheme{(symbol-hash~\var{symbol})}}{\categoryprocedure}{\pageref{./objects:s279}}
"hashtable-set!" \sfentry{\scheme{(hashtable-set!~\var{hashtable}~\var{key}~\var{obj})}}{\categoryprocedure}{\pageref{./objects:s280}}
"hashtable-ref" \sfentry{\scheme{(hashtable-ref~\var{hashtable}~\var{key}~\var{default})}}{\categoryprocedure}{\pageref{./objects:s281}}
"hashtable-contains?" \sfentry{\scheme{(hashtable-contains?~\var{hashtable}~\var{key})}}{\categoryprocedure}{\pageref{./objects:s282}}
"hashtable-update!" \sfentry{\scheme{(hashtable-update!~\var{hashtable}~\var{key}~\var{procedure}~\var{default})}}{\categoryprocedure}{\pageref{./objects:s283}}
"hashtable-delete!" \sfentry{\scheme{(hashtable-delete!~\var{hashtable}~\var{key})}}{\categoryprocedure}{\pageref{./objects:s284}}
"hashtable-size" \sfentry{\scheme{(hashtable-size~\var{hashtable})}}{\categoryprocedure}{\pageref{./objects:s285}}
"hashtable-copy" \sfentry{\scheme{(hashtable-copy~\var{hashtable})}}{\categoryprocedure}{\pageref{./objects:s286}}
"hashtable-copy" \sfentry{\scheme{(hashtable-copy~\var{hashtable}~\var{mutable?})}}{\categoryprocedure}{\pageref{./objects:s286}}
"hashtable-clear!" \sfentry{\scheme{(hashtable-clear!~\var{hashtable})}}{\categoryprocedure}{\pageref{./objects:s287}}
"hashtable-clear!" \sfentry{\scheme{(hashtable-clear!~\var{hashtable}~\var{size})}}{\categoryprocedure}{\pageref{./objects:s287}}
"hashtable-keys" \sfentry{\scheme{(hashtable-keys~\var{hashtable})}}{\categoryprocedure}{\pageref{./objects:s288}}
"hashtable-entries" \sfentry{\scheme{(hashtable-entries~\var{hashtable})}}{\categoryprocedure}{\pageref{./objects:s289}}
"define-enumeration" \sfentry{\scheme{(define-enumeration~\var{name}~(\var{symbol}~{\dots})~\var{constructor})}}{\categorysyntax}{\pageref{./objects:s290}}
"make-enumeration" \sfentry{\scheme{(make-enumeration~\var{symbol-list})}}{\categoryprocedure}{\pageref{./objects:s291}}
"enum-set-constructor" \sfentry{\scheme{(enum-set-constructor~\var{enum-set})}}{\categoryprocedure}{\pageref{./objects:s292}}
"enum-set-universe" \sfentry{\scheme{(enum-set-universe~\var{enum-set})}}{\categoryprocedure}{\pageref{./objects:s293}}
"enum-set->list" \sfentry{\scheme{(enum-set->list~\var{enum-set})}}{\categoryprocedure}{\pageref{./objects:s294}}
"enum-set-subset?" \sfentry{\scheme{(enum-set-subset?~\var{enum-set$_1$}~\var{enum-set$_2$})}}{\categoryprocedure}{\pageref{./objects:s295}}
"enum-set=?" \sfentry{\scheme{(enum-set=?~\var{enum-set$_1$}~\var{enum-set$_2$})}}{\categoryprocedure}{\pageref{./objects:s296}}
"enum-set-member?" \sfentry{\scheme{(enum-set-member?~\var{symbol}~\var{enum-set})}}{\categoryprocedure}{\pageref{./objects:s297}}
"enum-set-union" \sfentry{\scheme{(enum-set-union~\var{enum-set$_1$}~\var{enum-set$_2$})}}{\categoryprocedure}{\pageref{./objects:s298}}
"enum-set-intersection" \sfentry{\scheme{(enum-set-intersection~\var{enum-set$_1$}~\var{enum-set$_2$})}}{\categoryprocedure}{\pageref{./objects:s298}}
"enum-set-difference" \sfentry{\scheme{(enum-set-difference~\var{enum-set$_1$}~\var{enum-set$_2$})}}{\categoryprocedure}{\pageref{./objects:s298}}
"enum-set-complement" \sfentry{\scheme{(enum-set-complement~\var{enum-set})}}{\categoryprocedure}{\pageref{./objects:s299}}
"enum-set-projection" \sfentry{\scheme{(enum-set-projection~\var{enum-set$_1$}~\var{enum-set$_2$})}}{\categoryprocedure}{\pageref{./objects:s300}}
"enum-set-indexer" \sfentry{\scheme{(enum-set-indexer~\var{enum-set})}}{\categoryprocedure}{\pageref{./objects:s301}}
"make-transcoder" \sfentry{\scheme{(make-transcoder~\var{codec})}}{\categoryprocedure}{\pageref{./io:s19}}
"make-transcoder" \sfentry{\scheme{(make-transcoder~\var{codec}~\var{eol-style})}}{\categoryprocedure}{\pageref{./io:s19}}
"make-transcoder" \sfentry{\scheme{(make-transcoder~\var{codec}~\var{eol-style}~\var{error-handling-mode})}}{\categoryprocedure}{\pageref{./io:s19}}
"transcoder-codec" \sfentry{\scheme{(transcoder-codec~\var{transcoder})}}{\categoryprocedure}{\pageref{./io:s20}}
"transcoder-eol-style" \sfentry{\scheme{(transcoder-eol-style~\var{transcoder})}}{\categoryprocedure}{\pageref{./io:s20}}
"transcoder-error-handling-mode" \sfentry{\scheme{(transcoder-error-handling-mode~\var{transcoder})}}{\categoryprocedure}{\pageref{./io:s20}}
"native-transcoder" \sfentry{\scheme{(native-transcoder)}}{\categoryprocedure}{\pageref{./io:s21}}
"latin-1-codec" \sfentry{\scheme{(latin-1-codec)}}{\categoryprocedure}{\pageref{./io:s22}}
"utf-8-codec" \sfentry{\scheme{(utf-8-codec)}}{\categoryprocedure}{\pageref{./io:s22}}
"utf-16-codec" \sfentry{\scheme{(utf-16-codec)}}{\categoryprocedure}{\pageref{./io:s22}}
"eol-style" \sfentry{\scheme{(eol-style~\var{symbol})}}{\categorysyntax}{\pageref{./io:s23}}
"native-eol-style" \sfentry{\scheme{(native-eol-style)}}{\categoryprocedure}{\pageref{./io:s24}}
"error-handling-mode" \sfentry{\scheme{(error-handling-mode~\var{symbol})}}{\categorysyntax}{\pageref{./io:s25}}
"file-options" \sfentry{\scheme{(file-options~\var{symbol}~{\dots})}}{\categorysyntax}{\pageref{./io:s26}}
"buffer-mode" \sfentry{\scheme{(buffer-mode~\var{symbol})}}{\categorysyntax}{\pageref{./io:s27}}
"buffer-mode?" \sfentry{\scheme{(buffer-mode?~\var{obj})}}{\categorysyntax}{\pageref{./io:s28}}
"open-file-input-port" \sfentry{\scheme{(open-file-input-port~\var{path})}}{\categoryprocedure}{\pageref{./io:s29}}
"open-file-input-port" \sfentry{\scheme{(open-file-input-port~\var{path}~\var{options})}}{\categoryprocedure}{\pageref{./io:s29}}
"open-file-input-port" \sfentry{\scheme{(open-file-input-port~\var{path}~\var{options}~\var{b-mode})}}{\categoryprocedure}{\pageref{./io:s29}}
"open-file-input-port" \sfentry{\scheme{(open-file-input-port~\var{path}~\var{options}~\var{b-mode}~\var{?transcoder})}}{\categoryprocedure}{\pageref{./io:s29}}
"open-file-output-port" \sfentry{\scheme{(open-file-output-port~\var{path})}}{\categoryprocedure}{\pageref{./io:s30}}
"open-file-output-port" \sfentry{\scheme{(open-file-output-port~\var{path}~\var{options})}}{\categoryprocedure}{\pageref{./io:s30}}
"open-file-output-port" \sfentry{\scheme{(open-file-output-port~\var{path}~\var{options}~\var{b-mode})}}{\categoryprocedure}{\pageref{./io:s30}}
"open-file-output-port" \sfentry{\scheme{(open-file-output-port~\var{path}~\var{options}~\var{b-mode}~\var{?transcoder})}}{\categoryprocedure}{\pageref{./io:s30}}
"open-file-input/output-port" \sfentry{\scheme{(open-file-input/output-port~\var{path})}}{\categoryprocedure}{\pageref{./io:s31}}
"open-file-input/output-port" \sfentry{\scheme{(open-file-input/output-port~\var{path}~\var{options})}}{\categoryprocedure}{\pageref{./io:s31}}
"open-file-input/output-port" \sfentry{\scheme{(open-file-input/output-port~\var{path}~\var{options}~\var{b-mode})}}{\categoryprocedure}{\pageref{./io:s31}}
"open-file-input/output-port" \sfentry{\scheme{(open-file-input/output-port~\var{path}~\var{options}~\var{b-mode}~\var{?transcoder})}}{\categoryprocedure}{\pageref{./io:s31}}
"current-input-port" \sfentry{\scheme{(current-input-port)}}{\categoryprocedure}{\pageref{./io:s32}}
"current-output-port" \sfentry{\scheme{(current-output-port)}}{\categoryprocedure}{\pageref{./io:s32}}
"current-error-port" \sfentry{\scheme{(current-error-port)}}{\categoryprocedure}{\pageref{./io:s32}}
"standard-input-port" \sfentry{\scheme{(standard-input-port)}}{\categoryprocedure}{\pageref{./io:s33}}
"standard-output-port" \sfentry{\scheme{(standard-output-port)}}{\categoryprocedure}{\pageref{./io:s33}}
"standard-error-port" \sfentry{\scheme{(standard-error-port)}}{\categoryprocedure}{\pageref{./io:s33}}
"open-bytevector-input-port" \sfentry{\scheme{(open-bytevector-input-port~\var{bytevector})}}{\categoryprocedure}{\pageref{./io:s34}}
"open-bytevector-input-port" \sfentry{\scheme{(open-bytevector-input-port~\var{bytevector}~\var{?transcoder})}}{\categoryprocedure}{\pageref{./io:s34}}
"open-string-input-port" \sfentry{\scheme{(open-string-input-port~\var{string})}}{\categoryprocedure}{\pageref{./io:s35}}
"open-bytevector-output-port" \sfentry{\scheme{(open-bytevector-output-port)}}{\categoryprocedure}{\pageref{./io:s36}}
"open-bytevector-output-port" \sfentry{\scheme{(open-bytevector-output-port~\var{?transcoder})}}{\categoryprocedure}{\pageref{./io:s36}}
"open-string-output-port" \sfentry{\scheme{(open-string-output-port)}}{\categoryprocedure}{\pageref{./io:s37}}
"call-with-bytevector-output-port" \sfentry{\scheme{(call-with-bytevector-output-port~\var{procedure})}}{\categoryprocedure}{\pageref{./io:s38}}
"call-with-bytevector-output-port" \sfentry{\scheme{(call-with-bytevector-output-port~\var{procedure}~\var{?transcoder})}}{\categoryprocedure}{\pageref{./io:s38}}
"call-with-string-output-port" \sfentry{\scheme{(call-with-string-output-port~\var{procedure})}}{\categoryprocedure}{\pageref{./io:s39}}
"make-custom-binary-input-port" \sfentry{\scheme{(make-custom-binary-input-port~\var{id}~\var{r!}~\var{gp}~\var{sp!}~\var{close})}}{\categoryprocedure}{\pageref{./io:s41}}
"make-custom-binary-output-port" \sfentry{\scheme{(make-custom-binary-output-port~\var{id}~\var{w!}~\var{gp}~\var{sp!}~\var{close})}}{\categoryprocedure}{\pageref{./io:s41}}
"make-custom-binary-input/output-port" \sfentry{\scheme{(make-custom-binary-input/output-port~\var{id}~\var{r!}~\var{w!}~\var{gp}~\var{sp!}~\var{close})}}{\categoryprocedure}{\pageref{./io:s41}}
"make-custom-textual-input-port" \sfentry{\scheme{(make-custom-textual-input-port~\var{id}~\var{r!}~\var{gp}~\var{sp!}~\var{close})}}{\categoryprocedure}{\pageref{./io:s42}}
"make-custom-textual-output-port" \sfentry{\scheme{(make-custom-textual-output-port~\var{id}~\var{w!}~\var{gp}~\var{sp!}~\var{close})}}{\categoryprocedure}{\pageref{./io:s42}}
"make-custom-textual-input/output-port" \sfentry{\scheme{(make-custom-textual-input/output-port~\var{id}~\var{r!}~\var{w!}~\var{gp}~\var{sp!}~\var{close})}}{\categoryprocedure}{\pageref{./io:s42}}
"port?" \sfentry{\scheme{(port?~\var{obj})}}{\categoryprocedure}{\pageref{./io:s43}}
"input-port?" \sfentry{\scheme{(input-port?~\var{obj})}}{\categoryprocedure}{\pageref{./io:s44}}
"output-port?" \sfentry{\scheme{(output-port?~\var{obj})}}{\categoryprocedure}{\pageref{./io:s44}}
"binary-port?" \sfentry{\scheme{(binary-port?~\var{obj})}}{\categoryprocedure}{\pageref{./io:s45}}
"textual-port?" \sfentry{\scheme{(textual-port?~\var{obj})}}{\categoryprocedure}{\pageref{./io:s45}}
"close-port" \sfentry{\scheme{(close-port~\var{port})}}{\categoryprocedure}{\pageref{./io:s46}}
"transcoded-port" \sfentry{\scheme{(transcoded-port~\var{binary-port}~\var{transcoder})}}{\categoryprocedure}{\pageref{./io:s47}}
"port-transcoder" \sfentry{\scheme{(port-transcoder~\var{port})}}{\categoryprocedure}{\pageref{./io:s48}}
"port-position" \sfentry{\scheme{(port-position~\var{port})}}{\categoryprocedure}{\pageref{./io:s49}}
"port-has-port-position?" \sfentry{\scheme{(port-has-port-position?~\var{port})}}{\categoryprocedure}{\pageref{./io:s49}}
"set-port-position!" \sfentry{\scheme{(set-port-position!~\var{port}~\var{pos})}}{\categoryprocedure}{\pageref{./io:s50}}
"port-has-set-port-position!?" \sfentry{\scheme{(port-has-set-port-position!?~\var{port})}}{\categoryprocedure}{\pageref{./io:s50}}
"call-with-port" \sfentry{\scheme{(call-with-port~\var{port}~\var{procedure})}}{\categoryprocedure}{\pageref{./io:s51}}
"output-port-buffer-mode" \sfentry{\scheme{(output-port-buffer-mode~\var{port})}}{\categoryprocedure}{\pageref{./io:s52}}
"eof-object?" \sfentry{\scheme{(eof-object?~\var{obj})}}{\categoryprocedure}{\pageref{./io:s53}}
"eof-object" \sfentry{\scheme{(eof-object)}}{\categoryprocedure}{\pageref{./io:s54}}
"get-u8" \sfentry{\scheme{(get-u8~\var{binary-input-port})}}{\categoryprocedure}{\pageref{./io:s55}}
"lookahead-u8" \sfentry{\scheme{(lookahead-u8~\var{binary-input-port})}}{\categoryprocedure}{\pageref{./io:s56}}
"get-bytevector-n" \sfentry{\scheme{(get-bytevector-n~\var{binary-input-port}~\var{n})}}{\categoryprocedure}{\pageref{./io:s57}}
"get-bytevector-n!" \sfentry{\scheme{(get-bytevector-n!~\var{binary-input-port}~\var{bytevector}~\var{start}~\var{n})}}{\categoryprocedure}{\pageref{./io:s58}}
"get-bytevector-some" \sfentry{\scheme{(get-bytevector-some~\var{binary-input-port})}}{\categoryprocedure}{\pageref{./io:s59}}
"get-bytevector-all" \sfentry{\scheme{(get-bytevector-all~\var{binary-input-port})}}{\categoryprocedure}{\pageref{./io:s60}}
"get-char" \sfentry{\scheme{(get-char~\var{textual-input-port})}}{\categoryprocedure}{\pageref{./io:s61}}
"lookahead-char" \sfentry{\scheme{(lookahead-char~\var{textual-input-port})}}{\categoryprocedure}{\pageref{./io:s62}}
"get-string-n" \sfentry{\scheme{(get-string-n~\var{textual-input-port}~\var{n})}}{\categoryprocedure}{\pageref{./io:s63}}
"get-string-n!" \sfentry{\scheme{(get-string-n!~\var{textual-input-port}~\var{string}~\var{start}~\var{n})}}{\categoryprocedure}{\pageref{./io:s64}}
"get-string-all" \sfentry{\scheme{(get-string-all~\var{textual-input-port})}}{\categoryprocedure}{\pageref{./io:s65}}
"get-line" \sfentry{\scheme{(get-line~\var{textual-input-port})}}{\categoryprocedure}{\pageref{./io:s66}}
"get-datum" \sfentry{\scheme{(get-datum~\var{textual-input-port})}}{\categoryprocedure}{\pageref{./io:s67}}
"port-eof?" \sfentry{\scheme{(port-eof?~\var{input-port})}}{\categoryprocedure}{\pageref{./io:s68}}
"put-u8" \sfentry{\scheme{(put-u8~\var{binary-output-port}~\var{octet})}}{\categoryprocedure}{\pageref{./io:s69}}
"put-bytevector" \sfentry{\scheme{(put-bytevector~\var{binary-output-port}~\var{bytevector})}}{\categoryprocedure}{\pageref{./io:s70}}
"put-bytevector" \sfentry{\scheme{(put-bytevector~\var{binary-output-port}~\var{bytevector}~\var{start})}}{\categoryprocedure}{\pageref{./io:s70}}
"put-bytevector" \sfentry{\scheme{(put-bytevector~\var{binary-output-port}~\var{bytevector}~\var{start}~\var{n})}}{\categoryprocedure}{\pageref{./io:s70}}
"put-char" \sfentry{\scheme{(put-char~\var{textual-output-port}~\var{char})}}{\categoryprocedure}{\pageref{./io:s71}}
"put-string" \sfentry{\scheme{(put-string~\var{textual-output-port}~\var{string})}}{\categoryprocedure}{\pageref{./io:s72}}
"put-string" \sfentry{\scheme{(put-string~\var{textual-output-port}~\var{string}~\var{start})}}{\categoryprocedure}{\pageref{./io:s72}}
"put-string" \sfentry{\scheme{(put-string~\var{textual-output-port}~\var{string}~\var{start}~\var{n})}}{\categoryprocedure}{\pageref{./io:s72}}
"put-datum" \sfentry{\scheme{(put-datum~\var{textual-output-port}~\var{obj})}}{\categoryprocedure}{\pageref{./io:s73}}
"flush-output-port" \sfentry{\scheme{(flush-output-port~\var{output-port})}}{\categoryprocedure}{\pageref{./io:s74}}
"open-input-file" \sfentry{\scheme{(open-input-file~\var{path})}}{\categoryprocedure}{\pageref{./io:s75}}
"open-output-file" \sfentry{\scheme{(open-output-file~\var{path})}}{\categoryprocedure}{\pageref{./io:s76}}
"call-with-input-file" \sfentry{\scheme{(call-with-input-file~\var{path}~\var{procedure})}}{\categoryprocedure}{\pageref{./io:s77}}
"call-with-output-file" \sfentry{\scheme{(call-with-output-file~\var{path}~\var{procedure})}}{\categoryprocedure}{\pageref{./io:s78}}
"with-input-from-file" \sfentry{\scheme{(with-input-from-file~\var{path}~\var{thunk})}}{\categoryprocedure}{\pageref{./io:s79}}
"with-output-to-file" \sfentry{\scheme{(with-output-to-file~\var{path}~\var{thunk})}}{\categoryprocedure}{\pageref{./io:s80}}
"read" \sfentry{\scheme{(read)}}{\categoryprocedure}{\pageref{./io:s81}}
"read" \sfentry{\scheme{(read~\var{textual-input-port})}}{\categoryprocedure}{\pageref{./io:s81}}
"read-char" \sfentry{\scheme{(read-char)}}{\categoryprocedure}{\pageref{./io:s82}}
"read-char" \sfentry{\scheme{(read-char~\var{textual-input-port})}}{\categoryprocedure}{\pageref{./io:s82}}
"peek-char" \sfentry{\scheme{(peek-char)}}{\categoryprocedure}{\pageref{./io:s83}}
"peek-char" \sfentry{\scheme{(peek-char~\var{textual-input-port})}}{\categoryprocedure}{\pageref{./io:s83}}
"write" \sfentry{\scheme{(write~\var{obj})}}{\categoryprocedure}{\pageref{./io:s84}}
"write" \sfentry{\scheme{(write~\var{obj}~\var{textual-output-port})}}{\categoryprocedure}{\pageref{./io:s84}}
"display" \sfentry{\scheme{(display~\var{obj})}}{\categoryprocedure}{\pageref{./io:s85}}
"display" \sfentry{\scheme{(display~\var{obj}~\var{textual-output-port})}}{\categoryprocedure}{\pageref{./io:s85}}
"write-char" \sfentry{\scheme{(write-char~\var{char})}}{\categoryprocedure}{\pageref{./io:s86}}
"write-char" \sfentry{\scheme{(write-char~\var{char}~\var{textual-output-port})}}{\categoryprocedure}{\pageref{./io:s86}}
"newline" \sfentry{\scheme{(newline)}}{\categoryprocedure}{\pageref{./io:s87}}
"newline" \sfentry{\scheme{(newline~\var{textual-output-port})}}{\categoryprocedure}{\pageref{./io:s87}}
"close-input-port" \sfentry{\scheme{(close-input-port~\var{input-port})}}{\categoryprocedure}{\pageref{./io:s88}}
"close-output-port" \sfentry{\scheme{(close-output-port~\var{output-port})}}{\categoryprocedure}{\pageref{./io:s88}}
"file-exists?" \sfentry{\scheme{(file-exists?~\var{path})}}{\categoryprocedure}{\pageref{./io:s89}}
"delete-file" \sfentry{\scheme{(delete-file~\var{path})}}{\categoryprocedure}{\pageref{./io:s90}}
"bytevector->string" \sfentry{\scheme{(bytevector->string~\var{bytevector}~\var{transcoder})}}{\categoryprocedure}{\pageref{./io:s91}}
"string->bytevector" \sfentry{\scheme{(string->bytevector~\var{string}~\var{transcoder})}}{\categoryprocedure}{\pageref{./io:s92}}
"string->utf8" \sfentry{\scheme{(string->utf8~\var{string})}}{\categoryprocedure}{\pageref{./io:s93}}
"string->utf16" \sfentry{\scheme{(string->utf16~\var{string})}}{\categoryprocedure}{\pageref{./io:s94}}
"string->utf16" \sfentry{\scheme{(string->utf16~\var{string}~\var{endianness})}}{\categoryprocedure}{\pageref{./io:s94}}
"string->utf32" \sfentry{\scheme{(string->utf32~\var{string})}}{\categoryprocedure}{\pageref{./io:s94}}
"string->utf32" \sfentry{\scheme{(string->utf32~\var{string}~\var{endianness})}}{\categoryprocedure}{\pageref{./io:s94}}
"utf8->string" \sfentry{\scheme{(utf8->string~\var{bytevector})}}{\categoryprocedure}{\pageref{./io:s95}}
"utf16->string" \sfentry{\scheme{(utf16->string~\var{bytevector}~\var{endianness})}}{\categoryprocedure}{\pageref{./io:s96}}
"utf16->string" \sfentry{\scheme{(utf16->string~\var{bytevector}~\var{endianness}~\var{endianness-mandatory?})}}{\categoryprocedure}{\pageref{./io:s96}}
"utf32->string" \sfentry{\scheme{(utf32->string~\var{bytevector}~\var{endianness})}}{\categoryprocedure}{\pageref{./io:s96}}
"utf32->string" \sfentry{\scheme{(utf32->string~\var{bytevector}~\var{endianness}~\var{endianness-mandatory?})}}{\categoryprocedure}{\pageref{./io:s96}}
"define-syntax" \sfentry{\scheme{(define-syntax~\var{keyword}~\var{expr})}}{\categorysyntax}{\pageref{./syntax:s12}}
"let-syntax" \sfentry{\scheme{(let-syntax~((\var{keyword}~\var{expr})~{\dots})~\var{form$_1$}~\var{form$_2$}~{\dots})}}{\categorysyntax}{\pageref{./syntax:s13}}
"letrec-syntax" \sfentry{\scheme{(letrec-syntax~((\var{keyword}~\var{expr})~{\dots})~\var{form$_1$}~\var{form$_2$}~{\dots})}}{\categorysyntax}{\pageref{./syntax:s13}}
"syntax-rules" \sfentry{\scheme{(syntax-rules~(\var{literal}~{\dots})~\var{clause}~{\dots})}}{\categorysyntax}{\pageref{./syntax:s14}}
"!F_ (underscore)" \sfentry{\scheme{{\schunderscore}}}{\categorysyntax}{\pageref{./syntax:s26}}
"!G... (ellipsis)" \sfentry{\scheme{{\schdot}{\schdot}{\schdot}}}{\categorysyntax}{\pageref{./syntax:s26}}
"identifier-syntax" \sfentry{\scheme{(identifier-syntax~\var{tmpl})}}{\categorysyntax}{\pageref{./syntax:s27}}
"identifier-syntax" \sfentry{\scheme{(identifier-syntax~(\var{id$_1$}~\var{tmpl$_1$})~((set!~\var{id$_2$}~\var{e$_2$})~\var{tmpl$_2$}))}}{\categorysyntax}{\pageref{./syntax:s27}}
"syntax-case" \sfentry{\scheme{(syntax-case~\var{expr}~(\var{literal}~{\dots})~\var{clause}~{\dots})}}{\categorysyntax}{\pageref{./syntax:s30}}
"syntax (~#'~)" \sfentry{\scheme{(syntax~\var{template})}}{\categorysyntax}{\pageref{./syntax:s33}}
"!H#' (syntax)" \sfentry{\scheme{\#'\var{template}}}{\categorysyntax}{\pageref{./syntax:s33}}
"identifier?" \sfentry{\scheme{(identifier?~\var{obj})}}{\categoryprocedure}{\pageref{./syntax:s35}}
"free-identifier=?" \sfentry{\scheme{(free-identifier=?~\var{identifier$_1$}~\var{identifier$_2$})}}{\categoryprocedure}{\pageref{./syntax:s37}}
"bound-identifier=?" \sfentry{\scheme{(bound-identifier=?~\var{identifier$_1$}~\var{identifier$_2$})}}{\categoryprocedure}{\pageref{./syntax:s37}}
"with-syntax" \sfentry{\scheme{(with-syntax~((\var{pattern}~\var{expr})~{\dots})~\var{body$_1$}~\var{body$_2$}~{\dots})}}{\categorysyntax}{\pageref{./syntax:s38}}
"quasisyntax (~#`~)" \sfentry{\scheme{(quasisyntax~\var{template}~{\dots})}}{\categorysyntax}{\pageref{./syntax:s40}}
"!I#` (quasisyntax)" \sfentry{\scheme{\#`\var{template}}}{\categorysyntax}{\pageref{./syntax:s40}}
"unsyntax (~#,~)" \sfentry{\scheme{(unsyntax~\var{template}~{\dots})}}{\categorysyntax}{\pageref{./syntax:s40}}
"!J#, (unsyntax)" \sfentry{\scheme{\#,\var{template}}}{\categorysyntax}{\pageref{./syntax:s40}}
"unsyntax-splicing (~#,@~)" \sfentry{\scheme{(unsyntax-splicing~\var{template}~{\dots})}}{\categorysyntax}{\pageref{./syntax:s40}}
"!K#,@ (unsyntax-splicing)" \sfentry{\scheme{\#,{\schatsign}\var{template}}}{\categorysyntax}{\pageref{./syntax:s40}}
"make-variable-transformer" \sfentry{\scheme{(make-variable-transformer~\var{procedure})}}{\categoryprocedure}{\pageref{./syntax:s42}}
"syntax->datum" \sfentry{\scheme{(syntax->datum~\var{obj})}}{\categoryprocedure}{\pageref{./syntax:s44}}
"datum->syntax" \sfentry{\scheme{(datum->syntax~\var{template-identifier}~\var{obj})}}{\categoryprocedure}{\pageref{./syntax:s45}}
"generate-temporaries" \sfentry{\scheme{(generate-temporaries~\var{list})}}{\categoryprocedure}{\pageref{./syntax:s49}}
"define-record-type" \sfentry{\scheme{(define-record-type~\var{record-name}~\var{clause}~{\dots})}}{\categorysyntax}{\pageref{./records:s13}}
"define-record-type" \sfentry{\scheme{(define-record-type~(\var{record-name}~\var{constructor}~\var{pred})~\var{clause}~{\dots})}}{\categorysyntax}{\pageref{./records:s13}}
"fields" \sfentry{\scheme{fields}}{\categorysyntax}{\pageref{./records:s16}}
"mutable" \sfentry{\scheme{mutable}}{\categorysyntax}{\pageref{./records:s16}}
"immutable" \sfentry{\scheme{immutable}}{\categorysyntax}{\pageref{./records:s16}}
"parent" \sfentry{\scheme{parent}}{\categorysyntax}{\pageref{./records:s16}}
"protocol" \sfentry{\scheme{protocol}}{\categorysyntax}{\pageref{./records:s16}}
"sealed" \sfentry{\scheme{sealed}}{\categorysyntax}{\pageref{./records:s16}}
"opaque" \sfentry{\scheme{opaque}}{\categorysyntax}{\pageref{./records:s16}}
"nongenerative" \sfentry{\scheme{nongenerative}}{\categorysyntax}{\pageref{./records:s16}}
"parent-rtd" \sfentry{\scheme{parent-rtd}}{\categorysyntax}{\pageref{./records:s16}}
"make-record-type-descriptor" \sfentry{\scheme{(make-record-type-descriptor~\var{name}~\var{parent}~\var{uid}~\var{s?}~\var{o?}~\var{fields})}}{\categoryprocedure}{\pageref{./records:s20}}
"record-type-descriptor?" \sfentry{\scheme{(record-type-descriptor?~\var{obj})}}{\categoryprocedure}{\pageref{./records:s23}}
"make-record-constructor-descriptor" \sfentry{\scheme{(make-record-constructor-descriptor~\var{rtd}~\var{parent-rcd}~\var{protocol})}}{\categoryprocedure}{\pageref{./records:s24}}
"record-type-descriptor" \sfentry{\scheme{(record-type-descriptor~\var{record-name})}}{\categorysyntax}{\pageref{./records:s28}}
"record-constructor-descriptor" \sfentry{\scheme{(record-constructor-descriptor~\var{record-name})}}{\categorysyntax}{\pageref{./records:s28}}
"record-constructor" \sfentry{\scheme{(record-constructor~\var{rcd})}}{\categoryprocedure}{\pageref{./records:s29}}
"record-predicate" \sfentry{\scheme{(record-predicate~\var{rtd})}}{\categoryprocedure}{\pageref{./records:s30}}
"record-accessor" \sfentry{\scheme{(record-accessor~\var{rtd}~\var{idx})}}{\categoryprocedure}{\pageref{./records:s31}}
"record-mutator" \sfentry{\scheme{(record-mutator~\var{rtd}~\var{idx})}}{\categoryprocedure}{\pageref{./records:s32}}
"record-type-name" \sfentry{\scheme{(record-type-name~\var{rtd})}}{\categoryprocedure}{\pageref{./records:s34}}
"record-type-parent" \sfentry{\scheme{(record-type-parent~\var{rtd})}}{\categoryprocedure}{\pageref{./records:s35}}
"record-type-uid" \sfentry{\scheme{(record-type-uid~\var{rtd})}}{\categoryprocedure}{\pageref{./records:s36}}
"record-type-generative?" \sfentry{\scheme{(record-type-generative?~\var{rtd})}}{\categoryprocedure}{\pageref{./records:s37}}
"record-type-sealed?" \sfentry{\scheme{(record-type-sealed?~\var{rtd})}}{\categoryprocedure}{\pageref{./records:s37}}
"record-type-opaque?" \sfentry{\scheme{(record-type-opaque?~\var{rtd})}}{\categoryprocedure}{\pageref{./records:s37}}
"record-type-field-names" \sfentry{\scheme{(record-type-field-names~\var{rtd})}}{\categoryprocedure}{\pageref{./records:s38}}
"record-field-mutable?" \sfentry{\scheme{(record-field-mutable?~\var{rtd}~\var{idx})}}{\categoryprocedure}{\pageref{./records:s39}}
"record?" \sfentry{\scheme{(record?~\var{obj})}}{\categoryprocedure}{\pageref{./records:s40}}
"record-rtd" \sfentry{\scheme{(record-rtd~\var{record})}}{\categoryprocedure}{\pageref{./records:s41}}
"command-line" \sfentry{\scheme{(command-line)}}{\categoryprocedure}{\pageref{./libraries:s17}}
"exit" \sfentry{\scheme{(exit)}}{\categoryprocedure}{\pageref{./libraries:s18}}
"exit" \sfentry{\scheme{(exit~\var{obj})}}{\categoryprocedure}{\pageref{./libraries:s18}}
"raise" \sfentry{\scheme{(raise~\var{obj})}}{\categoryprocedure}{\pageref{./exceptions:s3}}
"raise-continuable" \sfentry{\scheme{(raise-continuable~\var{obj})}}{\categoryprocedure}{\pageref{./exceptions:s3}}
"error" \sfentry{\scheme{(error~\var{who}~\var{msg}~\var{irritant}~{\dots})}}{\categoryprocedure}{\pageref{./exceptions:s4}}
"assertion-violation" \sfentry{\scheme{(assertion-violation~\var{who}~\var{msg}~\var{irritant}~{\dots})}}{\categoryprocedure}{\pageref{./exceptions:s4}}
"assert" \sfentry{\scheme{(assert~\var{expression})}}{\categorysyntax}{\pageref{./exceptions:s5}}
"syntax-violation" \sfentry{\scheme{(syntax-violation~\var{who}~\var{msg}~\var{form})}}{\categoryprocedure}{\pageref{./exceptions:s6}}
"syntax-violation" \sfentry{\scheme{(syntax-violation~\var{who}~\var{msg}~\var{form}~\var{subform})}}{\categoryprocedure}{\pageref{./exceptions:s6}}
"with-exception-handler" \sfentry{\scheme{(with-exception-handler~\var{procedure}~\var{thunk})}}{\categoryprocedure}{\pageref{./exceptions:s7}}
"guard" \sfentry{\scheme{(guard~(\var{var}~\var{clause$_1$}~\var{clause$_2$}~{\dots})~\var{b1}~\var{b2}~{\dots})}}{\categorysyntax}{\pageref{./exceptions:s8}}
"&condition" \sfentry{\scheme{\&condition}}{\categorysyntax}{\pageref{./exceptions:s13}}
"condition?" \sfentry{\scheme{(condition?~\var{obj})}}{\categoryprocedure}{\pageref{./exceptions:s14}}
"condition" \sfentry{\scheme{(condition~\var{condition}~{\dots})}}{\categoryprocedure}{\pageref{./exceptions:s15}}
"simple-conditions" \sfentry{\scheme{(simple-conditions~\var{condition})}}{\categoryprocedure}{\pageref{./exceptions:s16}}
"define-condition-type" \sfentry{\scheme{(define-condition-type~\var{name}~\var{parent}~\var{constructor}~\var{pred}~\var{field}~{\dots})}}{\categorysyntax}{\pageref{./exceptions:s17}}
"condition-predicate" \sfentry{\scheme{(condition-predicate~\var{rtd})}}{\categoryprocedure}{\pageref{./exceptions:s18}}
"condition-accessor" \sfentry{\scheme{(condition-accessor~\var{rtd}~\var{procedure})}}{\categoryprocedure}{\pageref{./exceptions:s18}}
"&serious" \sfentry{\scheme{\&serious}}{\categorysyntax}{\pageref{./exceptions:s19}}
"make-serious-condition" \sfentry{\scheme{(make-serious-condition)}}{\categoryprocedure}{\pageref{./exceptions:s19}}
"serious-condition?" \sfentry{\scheme{(serious-condition?~\var{obj})}}{\categoryprocedure}{\pageref{./exceptions:s19}}
"&violation" \sfentry{\scheme{\&violation}}{\categorysyntax}{\pageref{./exceptions:s20}}
"make-violation" \sfentry{\scheme{(make-violation)}}{\categoryprocedure}{\pageref{./exceptions:s20}}
"violation?" \sfentry{\scheme{(violation?~\var{obj})}}{\categoryprocedure}{\pageref{./exceptions:s20}}
"&assertion" \sfentry{\scheme{\&assertion}}{\categorysyntax}{\pageref{./exceptions:s21}}
"make-assertion-violation" \sfentry{\scheme{(make-assertion-violation)}}{\categoryprocedure}{\pageref{./exceptions:s21}}
"assertion-violation?" \sfentry{\scheme{(assertion-violation?~\var{obj})}}{\categoryprocedure}{\pageref{./exceptions:s21}}
"&error" \sfentry{\scheme{\&error}}{\categorysyntax}{\pageref{./exceptions:s22}}
"make-error" \sfentry{\scheme{(make-error)}}{\categoryprocedure}{\pageref{./exceptions:s22}}
"error?" \sfentry{\scheme{(error?~\var{obj})}}{\categoryprocedure}{\pageref{./exceptions:s22}}
"&warning" \sfentry{\scheme{\&warning}}{\categorysyntax}{\pageref{./exceptions:s23}}
"make-warning" \sfentry{\scheme{(make-warning)}}{\categoryprocedure}{\pageref{./exceptions:s23}}
"warning?" \sfentry{\scheme{(warning?~\var{obj})}}{\categoryprocedure}{\pageref{./exceptions:s23}}
"&message" \sfentry{\scheme{\&message}}{\categorysyntax}{\pageref{./exceptions:s24}}
"make-message-condition" \sfentry{\scheme{(make-message-condition~\var{message})}}{\categoryprocedure}{\pageref{./exceptions:s24}}
"message-condition?" \sfentry{\scheme{(message-condition?~\var{obj})}}{\categoryprocedure}{\pageref{./exceptions:s24}}
"condition-message" \sfentry{\scheme{(condition-message~\var{condition})}}{\categoryprocedure}{\pageref{./exceptions:s24}}
"&irritants" \sfentry{\scheme{\&irritants}}{\categorysyntax}{\pageref{./exceptions:s25}}
"make-irritants-condition" \sfentry{\scheme{(make-irritants-condition~\var{irritants})}}{\categoryprocedure}{\pageref{./exceptions:s25}}
"irritants-condition?" \sfentry{\scheme{(irritants-condition?~\var{obj})}}{\categoryprocedure}{\pageref{./exceptions:s25}}
"condition-irritants" \sfentry{\scheme{(condition-irritants~\var{condition})}}{\categoryprocedure}{\pageref{./exceptions:s25}}
"&who" \sfentry{\scheme{\&who}}{\categorysyntax}{\pageref{./exceptions:s26}}
"make-who-condition" \sfentry{\scheme{(make-who-condition~\var{who})}}{\categoryprocedure}{\pageref{./exceptions:s26}}
"who-condition?" \sfentry{\scheme{(who-condition?~\var{obj})}}{\categoryprocedure}{\pageref{./exceptions:s26}}
"condition-who" \sfentry{\scheme{(condition-who~\var{condition})}}{\categoryprocedure}{\pageref{./exceptions:s26}}
"&non-continuable" \sfentry{\scheme{\&non-continuable}}{\categorysyntax}{\pageref{./exceptions:s27}}
"make-non-continuable-violation" \sfentry{\scheme{(make-non-continuable-violation)}}{\categoryprocedure}{\pageref{./exceptions:s27}}
"non-continuable-violation?" \sfentry{\scheme{(non-continuable-violation?~\var{obj})}}{\categoryprocedure}{\pageref{./exceptions:s27}}
"&implementation-restriction" \sfentry{\scheme{\&implementation-restriction}}{\categorysyntax}{\pageref{./exceptions:s28}}
"make-implementation-restriction-violation" \sfentry{\scheme{(make-implementation-restriction-violation)}}{\categoryprocedure}{\pageref{./exceptions:s28}}
"implementation-restriction-violation?" \sfentry{\scheme{(implementation-restriction-violation?~\var{obj})}}{\categoryprocedure}{\pageref{./exceptions:s28}}
"&lexical" \sfentry{\scheme{\&lexical}}{\categorysyntax}{\pageref{./exceptions:s29}}
"make-lexical-violation" \sfentry{\scheme{(make-lexical-violation)}}{\categoryprocedure}{\pageref{./exceptions:s29}}
"lexical-violation?" \sfentry{\scheme{(lexical-violation?~\var{obj})}}{\categoryprocedure}{\pageref{./exceptions:s29}}
"&syntax" \sfentry{\scheme{\&syntax}}{\categorysyntax}{\pageref{./exceptions:s30}}
"make-syntax-violation" \sfentry{\scheme{(make-syntax-violation~\var{form}~\var{subform})}}{\categoryprocedure}{\pageref{./exceptions:s30}}
"syntax-violation?" \sfentry{\scheme{(syntax-violation?~\var{obj})}}{\categoryprocedure}{\pageref{./exceptions:s30}}
"syntax-violation-form" \sfentry{\scheme{(syntax-violation-form~\var{condition})}}{\categoryprocedure}{\pageref{./exceptions:s30}}
"syntax-violation-subform" \sfentry{\scheme{(syntax-violation-subform~\var{condition})}}{\categoryprocedure}{\pageref{./exceptions:s30}}
"&undefined" \sfentry{\scheme{\&undefined}}{\categorysyntax}{\pageref{./exceptions:s31}}
"make-undefined-violation" \sfentry{\scheme{(make-undefined-violation)}}{\categoryprocedure}{\pageref{./exceptions:s31}}
"undefined-violation?" \sfentry{\scheme{(undefined-violation?~\var{obj})}}{\categoryprocedure}{\pageref{./exceptions:s31}}
"&i/o" \sfentry{\scheme{\&i/o}}{\categorysyntax}{\pageref{./exceptions:s32}}
"make-i/o-error" \sfentry{\scheme{(make-i/o-error)}}{\categoryprocedure}{\pageref{./exceptions:s32}}
"i/o-error?" \sfentry{\scheme{(i/o-error?~\var{obj})}}{\categoryprocedure}{\pageref{./exceptions:s32}}
"&i/o-read" \sfentry{\scheme{\&i/o-read}}{\categorysyntax}{\pageref{./exceptions:s33}}
"make-i/o-read-error" \sfentry{\scheme{(make-i/o-read-error)}}{\categoryprocedure}{\pageref{./exceptions:s33}}
"i/o-read-error?" \sfentry{\scheme{(i/o-read-error?~\var{obj})}}{\categoryprocedure}{\pageref{./exceptions:s33}}
"&i/o-write" \sfentry{\scheme{\&i/o-write}}{\categorysyntax}{\pageref{./exceptions:s34}}
"make-i/o-write-error" \sfentry{\scheme{(make-i/o-write-error)}}{\categoryprocedure}{\pageref{./exceptions:s34}}
"i/o-write-error?" \sfentry{\scheme{(i/o-write-error?~\var{obj})}}{\categoryprocedure}{\pageref{./exceptions:s34}}
"&i/o-invalid-position" \sfentry{\scheme{\&i/o-invalid-position}}{\categorysyntax}{\pageref{./exceptions:s35}}
"make-i/o-invalid-position-error" \sfentry{\scheme{(make-i/o-invalid-position-error~\var{position})}}{\categoryprocedure}{\pageref{./exceptions:s35}}
"i/o-invalid-position-error?" \sfentry{\scheme{(i/o-invalid-position-error?~\var{obj})}}{\categoryprocedure}{\pageref{./exceptions:s35}}
"i/o-error-position" \sfentry{\scheme{(i/o-error-position~\var{condition})}}{\categoryprocedure}{\pageref{./exceptions:s35}}
"&i/o-filename" \sfentry{\scheme{\&i/o-filename}}{\categorysyntax}{\pageref{./exceptions:s36}}
"make-i/o-filename-error" \sfentry{\scheme{(make-i/o-filename-error~\var{filename})}}{\categoryprocedure}{\pageref{./exceptions:s36}}
"i/o-filename-error?" \sfentry{\scheme{(i/o-filename-error?~\var{obj})}}{\categoryprocedure}{\pageref{./exceptions:s36}}
"i/o-error-filename" \sfentry{\scheme{(i/o-error-filename~\var{condition})}}{\categoryprocedure}{\pageref{./exceptions:s36}}
"&i/o-file-protection" \sfentry{\scheme{\&i/o-file-protection}}{\categorysyntax}{\pageref{./exceptions:s37}}
"make-i/o-file-protection-error" \sfentry{\scheme{(make-i/o-file-protection-error~\var{filename})}}{\categoryprocedure}{\pageref{./exceptions:s37}}
"i/o-file-protection-error?" \sfentry{\scheme{(i/o-file-protection-error?~\var{obj})}}{\categoryprocedure}{\pageref{./exceptions:s37}}
"&i/o-file-is-read-only" \sfentry{\scheme{\&i/o-file-is-read-only}}{\categorysyntax}{\pageref{./exceptions:s38}}
"make-i/o-file-is-read-only-error" \sfentry{\scheme{(make-i/o-file-is-read-only-error~\var{filename})}}{\categoryprocedure}{\pageref{./exceptions:s38}}
"i/o-file-is-read-only-error?" \sfentry{\scheme{(i/o-file-is-read-only-error?~\var{obj})}}{\categoryprocedure}{\pageref{./exceptions:s38}}
"&i/o-file-already-exists" \sfentry{\scheme{\&i/o-file-already-exists}}{\categorysyntax}{\pageref{./exceptions:s39}}
"make-i/o-file-already-exists-error" \sfentry{\scheme{(make-i/o-file-already-exists-error~\var{filename})}}{\categoryprocedure}{\pageref{./exceptions:s39}}
"i/o-file-already-exists-error?" \sfentry{\scheme{(i/o-file-already-exists-error?~\var{obj})}}{\categoryprocedure}{\pageref{./exceptions:s39}}
"&i/o-file-does-not-exist" \sfentry{\scheme{\&i/o-file-does-not-exist}}{\categorysyntax}{\pageref{./exceptions:s40}}
"make-i/o-file-does-not-exist-error" \sfentry{\scheme{(make-i/o-file-does-not-exist-error~\var{filename})}}{\categoryprocedure}{\pageref{./exceptions:s40}}
"i/o-file-does-not-exist-error?" \sfentry{\scheme{(i/o-file-does-not-exist-error?~\var{obj})}}{\categoryprocedure}{\pageref{./exceptions:s40}}
"&i/o-port" \sfentry{\scheme{\&i/o-port}}{\categorysyntax}{\pageref{./exceptions:s41}}
"make-i/o-port-error" \sfentry{\scheme{(make-i/o-port-error~\var{pobj})}}{\categoryprocedure}{\pageref{./exceptions:s41}}
"i/o-port-error?" \sfentry{\scheme{(i/o-port-error?~\var{obj})}}{\categoryprocedure}{\pageref{./exceptions:s41}}
"i/o-error-port" \sfentry{\scheme{(i/o-error-port~\var{condition})}}{\categoryprocedure}{\pageref{./exceptions:s41}}
"&i/o-decoding" \sfentry{\scheme{\&i/o-decoding}}{\categorysyntax}{\pageref{./exceptions:s42}}
"make-i/o-decoding-error" \sfentry{\scheme{(make-i/o-decoding-error~\var{pobj})}}{\categoryprocedure}{\pageref{./exceptions:s42}}
"i/o-decoding-error?" \sfentry{\scheme{(i/o-decoding-error?~\var{obj})}}{\categoryprocedure}{\pageref{./exceptions:s42}}
"&i/o-encoding" \sfentry{\scheme{\&i/o-encoding}}{\categorysyntax}{\pageref{./exceptions:s43}}
"make-i/o-encoding-error" \sfentry{\scheme{(make-i/o-encoding-error~\var{pobj}~\var{cobj})}}{\categoryprocedure}{\pageref{./exceptions:s43}}
"i/o-encoding-error?" \sfentry{\scheme{(i/o-encoding-error?~\var{obj})}}{\categoryprocedure}{\pageref{./exceptions:s43}}
"i/o-encoding-error-char" \sfentry{\scheme{(i/o-encoding-error-char~\var{condition})}}{\categoryprocedure}{\pageref{./exceptions:s43}}
"&no-infinities" \sfentry{\scheme{\&no-infinities}}{\categorysyntax}{\pageref{./exceptions:s44}}
"make-no-infinities-violation" \sfentry{\scheme{(make-no-infinities-violation)}}{\categoryprocedure}{\pageref{./exceptions:s44}}
"no-infinities-violation?" \sfentry{\scheme{(no-infinities-violation?~\var{obj})}}{\categoryprocedure}{\pageref{./exceptions:s44}}
"&no-nans" \sfentry{\scheme{\&no-nans}}{\categorysyntax}{\pageref{./exceptions:s45}}
"make-no-nans-violation" \sfentry{\scheme{(make-no-nans-violation)}}{\categoryprocedure}{\pageref{./exceptions:s45}}
"no-nans-violation?" \sfentry{\scheme{(no-nans-violation?~\var{obj})}}{\categoryprocedure}{\pageref{./exceptions:s45}}

1861
csug/use.stex Normal file

File diff suppressed because it is too large Load diff