@iftex
@finalout
@end iftex
-@comment $Id: scheme.texinfo,v 1.119 2002/12/30 03:36:42 cph Exp $
+@comment $Id: scheme.texinfo,v 1.120 2003/02/14 19:22:43 cph Exp $
@comment %**start of header (This is for running Texinfo on a region.)
@setfilename scheme.info
-@settitle MIT Scheme Reference
+@settitle MIT/GNU Scheme Reference
@comment %**end of header (This is for running Texinfo on a region.)
@setchapternewpage odd
@syncodeindex vr fn
@dircategory Programming Languages
@direntry
-* MIT Scheme Ref: (mit-scheme-ref). MIT Scheme Reference Manual
+* MIT/GNU Scheme Ref: (mit-scheme-ref). MIT/GNU Scheme Reference Manual
@end direntry
@tex
@end tex
@ifinfo
-This file documents the MIT Scheme system.
+This file documents the MIT/GNU Scheme system.
Copyright @copyright{} 1988-2002 Massachusetts Institute of Technology
@end ifinfo
@titlepage
-@title{MIT Scheme Reference Manual}
+@title{MIT/GNU Scheme Reference Manual}
@subtitle Edition 1.98
@subtitle for Scheme Release 7.7.2
-@subtitle 28 December 2002
+@subtitle 14 February 2003
@author by Chris Hanson
@author the MIT Scheme Team
@author and a cast of thousands
@ifinfo
Scheme is the UnCommon Lisp. This Info file is the programmer reference
-document for the MIT implementation of Scheme. It describes the
-facilities available for developing programs in MIT Scheme, and the
+document for the MIT/GNU implementation of Scheme. It describes the
+facilities available for developing programs in MIT/GNU Scheme, and the
``public'' parts of the implementation.
@end ifinfo
@chapter Overview
@cindex runtime system
-This manual is a detailed description of the MIT Scheme runtime system.
+This manual is a detailed description of the MIT/GNU Scheme runtime system.
It is intended to be a reference document for programmers. It does not
describe how to run Scheme or how to interact with it --- that is the
-subject of the @cite{MIT Scheme User's Manual}.
+subject of the @cite{MIT/GNU Scheme User's Manual}.
This chapter summarizes the semantics of Scheme, briefly describes the
-MIT Scheme programming environment, and explains the syntactic and
+MIT/GNU Scheme programming environment, and explains the syntactic and
lexical conventions of the language. Subsequent chapters describe
special forms, numerous data abstractions, and facilities for input and
output.
Clinger, Jonathan Rees, et al.@:, or by @sc{ieee} Std.@: 1178-1990,
@cite{IEEE Standard for the Scheme Programming Language} (in fact,
several parts of this document are copied from the @cite{Revised
-Report}). MIT Scheme is an extension of standard Scheme.
+Report}). MIT/GNU Scheme is an extension of standard Scheme.
These are the significant semantic characteristics of the Scheme
language:
@cindex entry format
@cindex format, entry
-Each description of an MIT Scheme variable, special form, or
+Each description of an MIT/GNU Scheme variable, special form, or
procedure begins with one or more header lines in this format:
@deffn @var{category} @var{template}
@cindex initial environment (defn)
@cindex environment, initial (defn)
-MIT Scheme provides an @dfn{initial environment} that contains all
+MIT/GNU Scheme provides an @dfn{initial environment} that contains all
of the variable bindings described in this manual. Most environments
are ultimately extensions of this initial environment. In Scheme, the
environment in which your programs execute is actually a child
conditional tests, all values count as true except for @code{#f}, which
counts as false (@pxref{Conditionals}).
-Implementation note: In MIT Scheme, @code{#f} and the empty list are the
+Implementation note: In MIT/GNU Scheme, @code{#f} and the empty list are the
same object, and the printed representation of @code{#f} is always
-@samp{()}. As this contradicts the Scheme standard, MIT Scheme will be
+@samp{()}. As this contradicts the Scheme standard, MIT/GNU Scheme will be
changed to make @code{#f} and the empty list different objects.
@node External Representations, Disjointness of Types, True and False, Scheme Concepts
@code{symbol->string} are then the immutable objects, while all objects
created by other procedures are mutable. It is an error to attempt to
store a new value into a location that is denoted by an immutable
-object. Note that the MIT Scheme compiler takes advantage of this
+object. Note that the MIT/GNU Scheme compiler takes advantage of this
property to share constants, but that these constants are not immutable.
Instead, two constants that are @code{equal?} may be @code{eq?} in
compiled code.
@end itemize
Scheme accepts most of the identifiers that other programming languages
-allow. MIT Scheme allows all of the identifiers that standard
+allow. MIT/GNU Scheme allows all of the identifiers that standard
Scheme does, plus many more.
-MIT Scheme defines a potential identifier to be a sequence of
+MIT/GNU Scheme defines a potential identifier to be a sequence of
non-delimiter characters that does not begin with either of the
characters @samp{#} or @samp{,}. Any such sequence of characters that
is not a syntactically valid number (@pxref{Numbers}) is considered to
@cindex #| as external representation
An alternative form of comment (sometimes called an @dfn{extended
comment}) begins with the characters @samp{#|} and ends with the
-characters @samp{|#}. This alternative form is an MIT Scheme extension.
+characters @samp{|#}. This alternative form is an MIT/GNU Scheme extension.
As with ordinary comments, all of the characters in an extended comment,
including the leading @samp{#|} and trailing @samp{|#}, are treated as
whitespace. Comments of this form may extend over multiple lines, and
@item #|
This character sequence introduces an extended comment. The comment is
-terminated by the sequence @samp{|#}. This notation is an MIT Scheme
+terminated by the sequence @samp{|#}. This notation is an MIT/GNU Scheme
extension.
@item #!
constants. Currently there are only two of these, @code{#!optional} and
@code{#!rest}, both of which are used in the @code{lambda} special form
to mark certain parameters as being ``optional'' or ``rest'' parameters.
-This notation is an MIT Scheme extension.
+This notation is an MIT/GNU Scheme extension.
@findex #!optional
@findex #!rest
@findex lambda
@item #*
This character sequence introduces a bit string (@pxref{Bit Strings}).
-This notation is an MIT Scheme extension.
+This notation is an MIT/GNU Scheme extension.
@item #[
This character sequence is used to denote objects that do not have a
readable external representation (@pxref{Custom Output}). A close
bracket, @samp{]}, terminates the object's notation. This notation is
-an MIT Scheme extension.
+an MIT/GNU Scheme extension.
@item #@@
This character sequence is a convenient shorthand used to refer to
objects by their hash number (@pxref{Custom Output}). This notation is
-an MIT Scheme extension.
+an MIT/GNU Scheme extension.
@item #=
@itemx ##
These character sequences introduce a notation used to show circular
structures in printed output, or to denote them in input. The notation
-works much like that in Common Lisp, and is an MIT Scheme extension.
+works much like that in Common Lisp, and is an MIT/GNU Scheme extension.
@end table
@node Expressions, , Lexical Conventions, Overview
a local syntactic-keyword definition may shadow a variable binding.
The following list contains all of the syntactic keywords that are
-defined when MIT Scheme is initialized:
+defined when MIT/GNU Scheme is initialized:
@multitable @columnfractions .33 .33 .33
@item access
Specially recognized keywords divide the @var{formals} parameters into
these three classes. The keywords used here are @samp{#!optional},
@samp{.}, and @samp{#!rest}. Note that only @samp{.} is defined by
-standard Scheme --- the other keywords are MIT Scheme extensions.
+standard Scheme --- the other keywords are MIT/GNU Scheme extensions.
@samp{#!rest} has the same meaning as @samp{.} in @var{formals}.
The use of these keywords is best explained by means of examples. The
parameter but the @dfn{name} of the resulting procedure; thus
@var{formals} must have at least one required parameter. This name has
no semantic meaning, but is included in the external representation of
-the procedure, making it useful for debugging. In MIT Scheme,
+the procedure, making it useful for debugging. In MIT/GNU Scheme,
@code{lambda} is implemented as @code{named-lambda}, with a special name
that means ``unnamed''.
returned. Each binding of a @var{variable} has the @var{expression}s as
its region.
-MIT Scheme allows any of the @var{init}s to be omitted, in which
+MIT/GNU Scheme allows any of the @var{init}s to be omitted, in which
case the corresponding @var{variable}s are unassigned.
@cindex lambda, implicit in let
entire @code{letrec} expression as its region, making it possible to
define mutually recursive procedures.
-MIT Scheme allows any of the @var{init}s to be omitted, in which
+MIT/GNU Scheme allows any of the @var{init}s to be omitted, in which
case the corresponding @var{variable}s are unassigned.
@example
by the rules of lexical scoping) of its corresponding @var{variable}.
@cindex unassigned variable, and dynamic bindings
-MIT Scheme allows any of the @var{init}s to be omitted, in which
+MIT/GNU Scheme allows any of the @var{init}s to be omitted, in which
case the corresponding @var{variable}s are temporarily unassigned.
An error of type @code{condition-type:unbound-variable} is signalled if
@deffn {special form} let name ((@var{variable} @var{init}) @dots{}) expression expression @dots{}
@cindex named let (defn)
-MIT Scheme permits a variant on the syntax of @code{let} called
+MIT/GNU Scheme permits a variant on the syntax of @code{let} called
``named @code{let}'' which provides a more general looping construct
than @code{do}, and may also be used to express recursions.
@var{name}.
@cindex unassigned variable, and named let
-MIT Scheme allows any of the @var{init}s to be omitted, in which
+MIT/GNU Scheme allows any of the @var{init}s to be omitted, in which
case the corresponding @var{variable}s are unassigned.
Note: the following expressions are equivalent:
evaluated from left to right and the value of the last @var{expression}
is returned as the value of the @code{do} expression. If no
@var{expression}s are present, then the value of the @code{do}
-expression is unspecified in standard Scheme; in MIT Scheme, the
+expression is unspecified in standard Scheme; in MIT/GNU Scheme, the
value of @var{test} is returned.
@cindex region of variable binding, do
@section Structure Definitions
This section provides examples and describes the options and syntax of
-@code{define-structure}, an MIT Scheme macro that is very similar to
+@code{define-structure}, an MIT/GNU Scheme macro that is very similar to
@code{defstruct} in Common Lisp. The differences between them are
summarized at the end of this section. For more information, see
Steele's Common Lisp book.
@end example
@end deffn
-The essential differences between MIT Scheme's @code{define-structure}
+The essential differences between MIT/GNU Scheme's @code{define-structure}
and Common Lisp's @code{defstruct} are:
@itemize @bullet
By default, named structures are tagged with a unique object of some
kind. In Common Lisp, the structures are tagged with symbols. This
depends on the Common Lisp package system to help generate unique tags;
-MIT Scheme has no such way to generate unique symbols.
+MIT/GNU Scheme has no such way to generate unique symbols.
@item
The @code{named} option may optionally take an argument, which is
primitive expression is called the @dfn{transformer} of the macro.
@cindex anonymous syntactic keyword
-MIT Scheme also supports @dfn{anonymous syntactic keywords}. This means
-that it's not necessary to binding a macro transformer to a syntactic
+MIT/GNU Scheme also supports @dfn{anonymous syntactic keywords}. This means
+that it's not necessary to bind a macro transformer to a syntactic
keyword before it is used. Instead, any macro-transformer expression
can appear as the first element of a form, and the form will be expanded
by the transformer.
entire block in which it appears. However, the @var{keyword} may only
be used after it has been defined.
-MIT Scheme permits @code{define-syntax} to appear both at top level and
+MIT/GNU Scheme permits @code{define-syntax} to appear both at top level and
within @code{lambda} bodies. The Revised^4 Report permits only
top-level uses of @code{define-syntax}.
@node Pattern Language, Syntactic Closures, Syntactic Binding Constructs, Macros
@subsection Pattern Language
-MIT Scheme supports a high-level pattern language for specifying macro
+MIT/GNU Scheme supports a high-level pattern language for specifying macro
transformers. This pattern language is defined by the Revised^4 Report
and is portable to other conforming Scheme implementations. To use the
pattern language, specify a @var{transformer-spec} as a
@subsection Syntactic Closures
@cindex syntactic closures
-MIT Scheme's syntax-transformation engine is an implementation of
+MIT/GNU Scheme's syntax-transformation engine is an implementation of
@dfn{syntactic closures}, a mechanism invented by Alan Bawden and
Jonathan Rees. The main feature of the syntactic-closures mechanism is
its simplicity and its close relationship to the environment models
@cindex explicit renaming
@dfn{Explicit renaming} is an alternative facility for defining macro
-transformers. In the MIT Scheme implementation, explicit-renaming
+transformers. In the MIT/GNU Scheme implementation, explicit-renaming
transformers are implemented as an abstraction layer on top of syntactic
closures. An explicit-renaming macro transformer is defined by an
instance of the @code{er-macro-transformer} keyword:
@cindex SRFI syntax
Several special forms have been introduced to support some of the
@uref{http://srfi.schemers.org/,Scheme Requests for Implementation}
-(@acronym{SRFI}). Note that MIT Scheme has for some time supported
+(@acronym{SRFI}). Note that MIT/GNU Scheme has for some time supported
@uref{http://srfi.schemers.org/srfi-23/srfi-23.html,@acronym{SRFI} 23}
(error-reporting mechanism) and
@uref{http://srfi.schemers.org/srfi-30/srfi-30.html,@acronym{SRFI} 30}
error will be signaled at macro-expansion time if this feature is not
present.
-Note that MIT Scheme allows @code{cond-expand} in any context where a
+Note that MIT/GNU Scheme allows @code{cond-expand} in any context where a
special form is allowed. This is an extension of the semantics defined
by @acronym{SRFI 0}, which only allows @code{cond-expand} at top level.
@end deffn
of subtypes (@pxref{Numerical types}), but they must implement a
coherent subset consistent with both the purposes of the implementation
and the spirit of the Scheme language. For example, an implementation
-in which all numbers are real may still be quite useful.@footnote{MIT
+in which all numbers are real may still be quite useful.@footnote{MIT/GNU
Scheme implements the whole tower of numerical types. It has
unlimited-precision exact integers and exact rationals. Flonums are
used to implement all inexact reals; on machines that support @sc{ieee}
precision as the most precise flonum format available.
Although Scheme allows a variety of written notations for numbers, any
-particular implementation may support only some of them.@footnote{MIT
+particular implementation may support only some of them.@footnote{MIT/GNU
Scheme implements all of the written notations for numbers.} For
example, an implementation in which all numbers are real need not
support the rectangular and polar notations for complex numbers. If an
predicate is true of a number then all higher type predicates are also
true of that number. Consequently, if a type predicate is false of a
number, then all lower type predicates are also false of that
-number.@footnote{In MIT Scheme the @code{rational?} procedure is the
+number.@footnote{In MIT/GNU Scheme the @code{rational?} procedure is the
same as @code{real?}, and the @code{complex?} procedure is the same as
@code{number?}.}
numbers of mixed exactness, and the numerical value of the result cannot
be represented as an inexact number without loss of accuracy, then the
procedure may report a violation of an implementation
-restriction.@footnote{MIT Scheme signals an error of type
+restriction.@footnote{MIT/GNU Scheme signals an error of type
@code{condition-type:bad-range-argument} in this case.}
@findex condition-type:bad-range-argument
@end deffn
value returned is the inexact number that is numerically closest to the
argument. If an exact argument has no reasonably close inexact
equivalent, then a violation of an implementation restriction may be
-reported; MIT Scheme signals an error of type
+reported; MIT/GNU Scheme signals an error of type
@code{condition-type:bad-range-argument} in this case.
@findex condition-type:bad-range-argument
value returned is the exact number that is numerically closest to the
argument. If an inexact argument has no reasonably close exact
equivalent, then a violation of an implementation restriction may be
-reported; in MIT Scheme this case does not occur because all inexact
+reported; in MIT/GNU Scheme this case does not occur because all inexact
numbers are representable as exact numbers.
These procedures implement the natural one-to-one correspondence between
@cindex fixnum (defn)
A @dfn{fixnum} is an exact integer that is small enough to fit in a
-machine word. In MIT Scheme, fixnums are typically 24 or 26 bits,
+machine word. In MIT/GNU Scheme, fixnums are typically 24 or 26 bits,
depending on the machine; it is reasonable to assume that fixnums are at
least 24 bits. Fixnums are signed; they are encoded using 2's
complement.
@cindex flonum (defn)
A @dfn{flonum} is an inexact real number that is implemented as a
-floating-point number. In MIT Scheme, all inexact real numbers are
+floating-point number. In MIT/GNU Scheme, all inexact real numbers are
flonums. For this reason, constants such as @code{0.} and @code{2.3}
are guaranteed to be flonums.
@cindex pseudo-random number
@cindex number, pseudo-random
-MIT Scheme provides a facility for generating pseudo-random numbers.
+MIT/GNU Scheme provides a facility for generating pseudo-random numbers.
The current implementation is a ``subtract-with-carry'' random-number
generator, based on the algorithm from @cite{A New Class of Random
Number Generators}, George Marsaglia and Arif Zaman, @cite{The Annals of
Characters are objects that represent printed characters, such as
letters and digits.@footnote{Some of the details in this section depend
on the fact that the underlying operating system uses the
-@acronym{ASCII} character set. This may change when someone ports MIT
+@acronym{ASCII} character set. This may change when someone ports MIT/GNU
Scheme to a non-@acronym{ASCII} operating system.}
@menu
@cindex standard character
@cindex character, standard
@findex char-standard?
-In addition, MIT Scheme orders those characters that satisfy
+In addition, MIT/GNU Scheme orders those characters that satisfy
@code{char-standard?} the same way that @acronym{ISO-8859-1} does.
Characters are ordered by first comparing their bucky bits part and then
@cindex code, of character (defn)
@cindex bucky bit, of character (defn)
@cindex ASCII character
-An MIT Scheme character consists of a @dfn{code} part and a @dfn{bucky
-bits} part. The MIT Scheme set of characters can represent more
+An MIT/GNU Scheme character consists of a @dfn{code} part and a @dfn{bucky
+bits} part. The MIT/GNU Scheme set of characters can represent more
characters than @acronym{ASCII} can; it includes characters with Super,
Hyper, and Top bucky bits, as well as Control and Meta. Every
-@acronym{ASCII} character corresponds to some MIT Scheme character, but not
+@acronym{ASCII} character corresponds to some MIT/GNU Scheme character, but not
vice versa.@footnote{Note that the Control bucky bit is different from
the @acronym{ASCII} control key. This means that @code{#\SOH} (@acronym{ASCII}
ctrl-A) is different from @code{#\C-A}. In fact, the Control bucky bit
is completely orthogonal to the @acronym{ASCII} control key, making possible
such characters as @code{#\C-SOH}.}
-MIT Scheme uses a 16-bit character code with 5 bucky bits. Normally,
+MIT/GNU Scheme uses a 16-bit character code with 5 bucky bits. Normally,
Scheme uses the least significant 8 bits of the character code to
contain the @acronym{ISO-8859-1} representation for the character. The
representation is expanded in order to allow for the use of
@findex char-ascii?
@findex char->ascii
-In MIT Scheme, if @code{(char-ascii? @var{char})} is true, then
+In MIT/GNU Scheme, if @code{(char-ascii? @var{char})} is true, then
@example
(eqv? (char->ascii @var{char}) (char->integer @var{char}))
@node ISO-8859-1 Characters, Character Sets, Internal Representation of Characters, Characters
@section ISO-8859-1 Characters
-MIT Scheme internally uses @acronym{ISO-8859-1} codes for
+MIT/GNU Scheme internally uses @acronym{ISO-8859-1} codes for
@acronym{I/O}, and stores character objects in a fashion that makes it
convenient to convert between @acronym{ISO-8859-1} codes and
characters. Also, character strings are implemented as byte vectors
@cindex character set
@cindex set, of characters
-MIT Scheme's character-set abstraction is used to represent groups of
+MIT/GNU Scheme's character-set abstraction is used to represent groups of
characters, such as the letters or digits. Character sets may contain
only @acronym{ISO-8859-1} characters; in the future this may be changed
to allow the full range of characters.
@section Unicode
@cindex Unicode
-MIT Scheme provides rudimentary support for Unicode characters. In an
-ideal world, Unicode would be the base character set for MIT Scheme,
+MIT/GNU Scheme provides rudimentary support for Unicode characters. In an
+ideal world, Unicode would be the base character set for MIT/GNU Scheme,
but this implementation predates the invention of Unicode. And
converting an application of this size is a considerable undertaking.
So for the time being, the base character set is @acronym{ISO-8859-1}
@cindex string, character (defn)
@findex char-ascii?
A @dfn{string} is a mutable sequence of characters. In the current
-implementation of MIT Scheme, the elements of a string must all
-satisfy the predicate @code{char-ascii?}; if someone ports MIT
+implementation of MIT/GNU Scheme, the elements of a string must all
+satisfy the predicate @code{char-ascii?}; if someone ports MIT/GNU
Scheme to a non-@acronym{ASCII} operating system this requirement will
change.
@findex #\newline
@findex #\page
The effect of a backslash that doesn't precede a double quote or
-backslash is unspecified in standard Scheme, but MIT Scheme specifies
+backslash is unspecified in standard Scheme, but MIT/GNU Scheme specifies
the effect for three other characters: @code{\t}, @code{\n}, and
@code{\f}. These escape sequences are respectively translated into the
following characters: @code{#\tab}, @code{#\newline}, and @code{#\page}.
@node Regular Expressions, Modification of Strings, Matching Strings, Strings
@section Regular Expressions
-MIT Scheme provides support for using regular expressions to search and
+MIT/GNU Scheme provides support for using regular expressions to search and
match strings. This manual does not define regular expressions; instead
see @ref{Regexps, , Syntax of Regular Expressions, emacs, The Emacs
Editor}.
-In addition to providing standard regular-expression support, MIT
+In addition to providing standard regular-expression support, MIT/GNU
Scheme also provides the @acronym{REXP} abstraction. This is an
alternative way to write regular expressions that is easier to read
and understand than the standard notation. Regular expressions
@subsection REXP abstraction
@cindex REXP abstraction
-In addition to providing standard regular-expression support, MIT
+In addition to providing standard regular-expression support, MIT/GNU
Scheme also provides the @acronym{REXP} abstraction. This is an
alternative way to write regular expressions that is easier to read
and understand than the standard notation. Regular expressions
@cindex length, of string
@cindex maximum length, of string (defn)
-MIT Scheme allows the length of a string to be dynamically adjusted in a
+MIT/GNU Scheme allows the length of a string to be dynamically adjusted in a
limited way. When a new string is allocated, by whatever method, it has
a specific length. At the time of allocation, it is also given a
@dfn{maximum length}, which is guaranteed to be at least as large as the
@cindex vector, byte
@findex string-ref
-MIT Scheme implements strings as packed vectors of 8-bit
+MIT/GNU Scheme implements strings as packed vectors of 8-bit
@acronym{ISO-8859-1} bytes. Most of the string operations, such as
@code{string-ref}, coerce these 8-bit codes into character objects.
However, some lower-level operations are made available for use.
Note that the external representation of bit strings uses a bit ordering
that is the reverse of the representation for bit strings in Common
-Lisp. It is likely that MIT Scheme's representation will be
+Lisp. It is likely that MIT/GNU Scheme's representation will be
changed in the future, to be compatible with Common Lisp. For the time
being this representation should be considered a convenience for viewing
bit strings rather than a means of entering them as data.
@end group
@end example
-All of the bit-string procedures are MIT Scheme extensions.
+All of the bit-string procedures are MIT/GNU Scheme extensions.
@menu
* Construction of Bit Strings::
@cindex property list, of symbol
@cindex disembodied property list
@findex read
-MIT Scheme provides two types of symbols: @dfn{interned} and
+MIT/GNU Scheme provides two types of symbols: @dfn{interned} and
@dfn{uninterned}. Interned symbols are far more common than uninterned
symbols, and there are more ways to create them. Interned symbols have
an external representation that is recognized by the procedure
@dfn{property lists}. Because of this, uninterned symbols were often
used merely for their property lists --- sometimes an uninterned symbol
used this way was referred to as a @dfn{disembodied property list}. In
-MIT Scheme, symbols do not have property lists, or any other components
+MIT/GNU Scheme, symbols do not have property lists, or any other components
besides their names. There is a different data structure similar to
disembodied property lists: one-dimensional tables (@pxref{1D Tables}).
-For these reasons, uninterned symbols are not very useful in MIT Scheme.
+For these reasons, uninterned symbols are not very useful in MIT/GNU Scheme.
In fact, their primary purpose is to simplify the generation of unique
variable names in programs that generate Scheme code.}
@cindex alphabetic case, of interned symbol
@findex write
The names of interned symbols are not distinguished by their alphabetic
-case. Because of this, MIT Scheme converts all alphabetic
+case. Because of this, MIT/GNU Scheme converts all alphabetic
characters in the name of an interned symbol to a specific case (lower
case) when the symbol is created. When the name of an interned symbol
is referenced (using @code{symbol->string}) or written (using
symbols created by the procedures @code{string->symbol} and
@code{intern}; they can create symbols for which this write/read
invariance may not hold because the symbols' names contain special
-characters or letters in the non-standard case.@footnote{MIT Scheme
+characters or letters in the non-standard case.@footnote{MIT/GNU Scheme
reserves a specific set of interned symbols for its own use. If you use
these reserved symbols it is possible that you could break specific
pieces of software that depend on them. The reserved symbols all have
@node Records, Promises, Cells, Miscellaneous Datatypes
@section Records
-MIT Scheme provides a @dfn{record} abstraction, which is a simple and
+MIT/GNU Scheme provides a @dfn{record} abstraction, which is a simple and
flexible mechanism for building structures with named components.
Records can be defined and accessed using the procedures defined in this
section. A less flexible but more concise way to manipulate records is
represented by @var{record-type}. The returned value is @code{equal?}
to the @var{field-names} argument given in the call to
@code{make-record-type} that created the type represented by
-@var{record-type}.@footnote{In MIT Scheme, the returned list is always
+@var{record-type}.@footnote{In MIT/GNU Scheme, the returned list is always
newly allocated.}
@end deffn
Various extensions to this semantics of @code{delay} and @code{force}
are supported in some implementations (none of these are currently
-supported in MIT Scheme):
+supported in MIT/GNU Scheme):
@itemize @bullet
@item
@section Streams
@cindex stream (defn)
-In addition to promises, MIT Scheme supports a higher-level abstraction
+In addition to promises, MIT/GNU Scheme supports a higher-level abstraction
called @dfn{streams}. Streams are similar to lists, except that the
tail of a stream is not computed until it is referred to.
This allows streams to be used to represent infinitely long lists.
@node Associations, Procedures, Miscellaneous Datatypes, Top
@chapter Associations
-MIT Scheme provides several mechanisms for associating objects with
+MIT/GNU Scheme provides several mechanisms for associating objects with
one another. Each of these mechanisms creates a link between one or
more objects, called @dfn{keys}, and some other object, called a
@dfn{datum}. Beyond this common idea, however, each of the mechanisms
@item
@cindex property list
-@dfn{The association table} is MIT Scheme's equivalent to the
+@dfn{The association table} is MIT/GNU Scheme's equivalent to the
@dfn{property lists} of Lisp. It has the advantages that the keys may
be any type of object and that it does not prevent the keys from being
reclaimed by the garbage collector. However, two linear-time lookups
@cindex table, association (defn)
@cindex property list
@findex eq?
-MIT Scheme provides a generalization of the property-list mechanism
+MIT/GNU Scheme provides a generalization of the property-list mechanism
found in most other implementations of Lisp: a global two-dimensional
@dfn{association table}. This table is indexed by two keys, called
@var{x-key} and @var{y-key} in the following procedure descriptions.
@cindex hash table
Hash tables are a fast, powerful mechanism for storing large numbers of
-associations. MIT Scheme's hash tables feature automatic resizing,
+associations. MIT/GNU Scheme's hash tables feature automatic resizing,
customizable growth parameters, and customizable hash procedures.
The average times for the insertion, deletion, and lookup operations on
@cindex object hashing
@cindex hashing, of object
-The MIT Scheme object-hashing facility provides a mechanism for
+The MIT/GNU Scheme object-hashing facility provides a mechanism for
generating a unique hash number for an arbitrary object. This hash
number, unlike an object's address, is unchanged by garbage collection.
The object-hashing facility is useful in conjunction with hash tables,
is quadratic unless the alists are sorted.
@end itemize
-MIT Scheme provides an implementation of @dfn{red-black} trees. The
+MIT/GNU Scheme provides an implementation of @dfn{red-black} trees. The
red-black tree-balancing algorithm provides generally good performance
because it doesn't try to keep the tree very closely balanced. At any
given node in the tree, one side of the node can be twice as high as the
@cindex weight-balanced binary trees
Balanced binary trees are a useful data structure for maintaining large
sets of ordered objects or sets of associations whose keys are ordered.
-MIT Scheme has a comprehensive implementation of weight-balanced binary
+MIT/GNU Scheme has a comprehensive implementation of weight-balanced binary
trees which has several advantages over the other data structures for
large aggregates:
(@pxref{Definitions}). Also there are special built-in procedures,
called @dfn{primitive procedures}, such as @code{car}; these procedures
are not written in Scheme but in the language used to implement the
-Scheme system. MIT Scheme also provides @dfn{application hooks}, which
+Scheme system. MIT/GNU Scheme also provides @dfn{application hooks}, which
support the construction of data structures that act like procedures.
@cindex procedure, type
@cindex interpreted, procedure type
@cindex compiled, procedure type
@cindex external representation, for procedure
-In MIT Scheme, the written representation of a procedure tells you
+In MIT/GNU Scheme, the written representation of a procedure tells you
the type of the procedure (compiled, interpreted, or primitive):
@example
@node Environment Operations, Environment Variables, Environments, Environments
@section Environment Operations
-Environments are first-class objects in MIT Scheme. An environment
+Environments are first-class objects in MIT/GNU Scheme. An environment
consists of some bindings and possibly a parent environment, from which
other bindings are inherited. The operations in this section reveal the
frame-like structure of environments by permitting you to examine the
is partly a safety measure: if you enter a definition that happens to
have the same name as a critical system procedure, your definition will
be visible only to the procedures you define in the
-@code{user-initial-environment}; the MIT Scheme system procedures, which
+@code{user-initial-environment}; the MIT/GNU Scheme system procedures, which
are defined in @code{system-global-environment}, will continue to see
the original definition.
@end defvr
@findex condition-type:file-operation-error
@cindex appending, to output file
-The optional argument @var{append?} is an MIT Scheme extension. If
+The optional argument @var{append?} is an MIT/GNU Scheme extension. If
@var{append?} is given and not @code{#f}, the file is opened in
@dfn{append} mode. In this mode, the contents of the file are not
overwritten; instead any characters written to the file are appended to
@code{with-input-from-file} and @code{with-output-to-file} return the
value yielded by @var{thunk}. If an escape procedure is used to escape
from the continuation of these procedures, their behavior is
-implementation-dependent; in that situation MIT Scheme leaves the files
+implementation-dependent; in that situation MIT/GNU Scheme leaves the files
open.
@end deffn
@var{input-port} to point to the following character. If no more
characters are available, an end-of-file object is returned.
-In MIT Scheme, if @var{input-port} is an interactive input port and no
+In MIT/GNU Scheme, if @var{input-port} is an interactive input port and no
characters are immediately available, @code{read-char} will hang waiting
for input, even if the port is in non-blocking mode.
@end deffn
interactive port will hang waiting for input whenever a call to
@code{read-char} would have hung.}
-In MIT Scheme, if @var{input-port} is an interactive input port and no
+In MIT/GNU Scheme, if @var{input-port} is an interactive input port and no
characters are immediately available, @code{peek-char} will hang waiting
for input, even if the port is in non-blocking mode.
@end deffn
@comment **** begin CLTL ****
The procedure @code{format} is very useful for producing nicely
-formatted text, producing good-looking messages, and so on. MIT
+formatted text, producing good-looking messages, and so on. MIT/GNU
Scheme's implementation of @code{format} is similar to that of Common
Lisp, except that Common Lisp defines many more
directives.@footnote{This description of @code{format} is adapted from
@node Custom Output, Prompting, Format, Input/Output
@section Custom Output
-MIT Scheme provides hooks for specifying that certain kinds of objects
+MIT/GNU Scheme provides hooks for specifying that certain kinds of objects
have special written representations. There are no restrictions on the
written representations, but only a few kinds of objects may have custom
representation specified for them, specifically: records
@cindex XML parser
@cindex parser, XML
-MIT Scheme provides a simple non-validating @acronym{XML} parser.
+MIT/GNU Scheme provides a simple non-validating @acronym{XML} parser.
This parser is mostly conformant, with the exception that it doesn't
support @acronym{UTF-16}. The parser also does not support external
document type declarations (@acronym{DTD}s). The output of the parser
@cindex Operating-System Interface
The Scheme standard provides a simple mechanism for reading and writing
-files: file ports. MIT Scheme provides additional tools for
+files: file ports. MIT/GNU Scheme provides additional tools for
dealing with other aspects of the operating system:
@itemize @bullet
@comment **** begin CLTL ****
@cindex file name
-MIT Scheme programs need to use names to designate files. The main
+MIT/GNU Scheme programs need to use names to designate files. The main
difficulty in dealing with names of files is that different file systems
have different naming formats for files. For example, here is a table
of several file systems (actually, operating systems that provide file
It would be impossible for each program that deals with file names to
know about each different file name format that exists; a new operating
system to which Scheme was ported might use a format different from any
-of its predecessors. Therefore, MIT Scheme provides @emph{two} ways to
+of its predecessors. Therefore, MIT/GNU Scheme provides @emph{two} ways to
represent file names: @dfn{filenames} (also called @dfn{namestrings}),
which are strings in the implementation-dependent form customary for the
file system, and @dfn{pathnames}, which are special abstract data
terms by using pathnames.
@cindex host, in filename
-In order to allow MIT Scheme programs to operate in a network
+In order to allow MIT/GNU Scheme programs to operate in a network
environment that may have more than one kind of file system, the
pathname facility allows a file name to specify which file system is to
be used. In this context, each file system is called a @dfn{host}, in
@subsection Filenames and Pathnames
Pathname objects are usually created by parsing filenames (character
-strings) into component parts. MIT Scheme provides operations that
+strings) into component parts. MIT/GNU Scheme provides operations that
convert filenames into pathnames and vice versa.
@deffn procedure ->pathname object
The optional arguments are used to determine what syntax should be used
for parsing the string. In general this is only really useful if your
-implementation of MIT Scheme supports more than one file system,
+implementation of MIT/GNU Scheme supports more than one file system,
otherwise you would use @code{->pathname}. If given, @var{host} must be
a host object or @code{#f}, and @var{defaults} must be a pathname.
@var{Host} specifies the syntax used to parse the string. If @var{host}
and PC file systems.
(The following note does not refer to any file system currently
-supported by MIT Scheme, but is included for completeness.) In file
+supported by MIT/GNU Scheme, but is included for completeness.) In file
systems that do not have ``hierarchical'' structure, a specified
directory component will always be a list whose first element is
@code{absolute}. If the system does not support directories other than
@deffn procedure system-library-pathname pathname
@cindex library, system pathname
-Locates @var{pathname} in MIT Scheme's system library directory. An
+Locates @var{pathname} in MIT/GNU Scheme's system library directory. An
error of type @code{condition-type:file-operation-error} is signalled if
@var{pathname} cannot be located on the library search path.
@findex condition-type:file-operation-error
@deffn procedure system-library-directory-pathname pathname
@cindex library, system pathname
-Locates the pathname of an MIT Scheme system library directory. An
+Locates the pathname of an MIT/GNU Scheme system library directory. An
error of type @code{condition-type:file-operation-error} is signalled if
@var{pathname} cannot be located on the library search path.
@cindex directory, current working (defn)
@cindex current working directory (defn)
@cindex working directory (see current working directory)
-When MIT Scheme is started, the @dfn{current working directory} (or
+When MIT/GNU Scheme is started, the @dfn{current working directory} (or
simply, @dfn{working directory}) is initialized in an operating-system
dependent manner; usually, it is the directory in which Scheme was
invoked. The working directory can be determined from within Scheme by
@node Date and Time, Machine Time, Directory Reader, Operating-System Interface
@section Date and Time
-MIT Scheme provides a simple set of procedures for manipulating date
+MIT/GNU Scheme provides a simple set of procedures for manipulating date
and time information. There are four time representations, each of
which serves a different purpose. Each representation may be
converted to any of the others.
@cindex subprocess
@cindex synchronous subprocess
-MIT Scheme provides the ability to run and control subprocesses. This
+MIT/GNU Scheme provides the ability to run and control subprocesses. This
support is divided into two parts: a low-level set of primitives that
maps onto the underlying operating system's process-control primitives,
and a high-level set of procedures for starting a subprocess and running
@section TCP Sockets
@cindex socket
-MIT Scheme provides access to @dfn{sockets}, which are a mechanism for
+MIT/GNU Scheme provides access to @dfn{sockets}, which are a mechanism for
inter-process communication. @sc{tcp} stream sockets are supported,
which communicate between computers over a @sc{tcp/ip} network.
@sc{tcp} sockets are supported on all operating systems.
The next few procedures provide access to the @dfn{domain name service}
(@acronym{DNS}), which maintains associations between internet host
names such as @code{"www.swiss.ai.mit.edu"} and @acronym{IP} addresses,
-such as @code{18.23.0.16}. In MIT Scheme, we represent an internet host
+such as @code{18.23.0.16}. In MIT/GNU Scheme, we represent an internet host
name as a string, and an @acronym{IP} address as a byte vector of length
4 (byte vectors are just character strings that are accessed using
@code{vector-8b-ref} rather than @code{string-ref}). The bytes in an
@end deffn
@deffn procedure get-host-name
-Returns the string that identifies the computer that MIT Scheme is
+Returns the string that identifies the computer that MIT/GNU Scheme is
running on. Usually this is an unqualified internet host name, i.e.@:
the host name without the domain suffix:
@end deffn
@deffn procedure os/hostname
-Returns the canonical internet host name of the computer that MIT Scheme
+Returns the canonical internet host name of the computer that MIT/GNU Scheme
is running on. So, in contrast to the example for @code{get-host-name}:
@example
@chapter Error System
@findex error
-The MIT Scheme error system provides a uniform mechanism for the
+The MIT/GNU Scheme error system provides a uniform mechanism for the
signalling of errors and other exceptional conditions. The simplest and
most generally useful procedures in the error system are:
first. Finally, if no handlers apply (or all return in a normal
manner), @code{signal-condition} returns an unspecified value.
-@emph{Note:} unlike many other systems, the MIT Scheme runtime library
+@emph{Note:} unlike many other systems, the MIT/GNU Scheme runtime library
does @emph{not} establish handlers of any kind. (However, the Edwin
text editor uses condition handlers extensively.) Thus, calls to
@code{signal-condition} will return to the caller unless there are user
@node Taxonomy, , Condition Types, Error System
@section Condition-Type Taxonomy
-The MIT Scheme error system provides a rich set of predefined condition
+The MIT/GNU Scheme error system provides a rich set of predefined condition
types. These are organized into a forest through taxonomic links
providing the relationships for ``specializes'' and ``generalizes''.
The chart appearing below shows these relationships by indenting all the
@chapter Graphics
@cindex graphics
-MIT Scheme has a simple two-dimensional line-graphics interface
+MIT/GNU Scheme has a simple two-dimensional line-graphics interface
that is suitable for many graphics applications. In particular it is
often used for plotting data points from experiments. The interface is
generic in that it can support different types of graphics devices in a
@cindex X graphics
@cindex X window system
-MIT Scheme supports graphics in the X window system (version 11).
+MIT/GNU Scheme supports graphics in the X window system (version 11).
Arbitrary numbers of displays may be opened, and arbitrary numbers of
graphics windows may be created for each display. A variety of
operations is available to manipulate various aspects of the windows, to
@section Win32 Graphics
@cindex Win32 graphics
-MIT Scheme supports graphics on Microsoft Windows 95, Windows 98, and
+MIT/GNU Scheme supports graphics on Microsoft Windows 95, Windows 98, and
Windows NT. In addition to the usual operations, there are operations
to control the size, position and colors of a graphics window. Win32
devices support images, which are implemented as device independent
@section OS/2 Graphics
@cindex OS/2 graphics
-MIT Scheme supports graphics under the OS/2 Presentation Manager in
+MIT/GNU Scheme supports graphics under the OS/2 Presentation Manager in
OS/2 version 2.1 and later. The OS/2 graphics device type is
implemented as a top level window. In addition to the usual operations,
there are operations to control the size, position, and colors of a
@ifinfo
The Win32 implementation is still in a state of development. It is
-expected that changes will be necessary when MIT Scheme is ported to
+expected that changes will be necessary when MIT/GNU Scheme is ported to
Windows NT on the DEC Alpha architecture. In particular, the
current system is not arranged in a way that adequately distinguishes
between issues that are a consequence of the NT operating system and
The Win32 implementation is still in a state of development. It is
-expected that changes will be necessary when MIT Scheme is ported to
+expected that changes will be necessary when MIT/GNU Scheme is ported to
Windows NT on the DEC Alpha architecture. In particular, the
current system is not arranged in a way that adequately distinguishes
between issues that are a consequence of the NT operating system and
@iftex
@finalout
@end iftex
-@comment $Id: user.texinfo,v 1.101 2002/12/30 06:08:30 cph Exp $
+@comment $Id: user.texinfo,v 1.102 2003/02/14 19:22:43 cph Exp $
@comment %**start of header (This is for running Texinfo on a region.)
@setfilename user.info
-@settitle MIT Scheme User's Manual
+@settitle MIT/GNU Scheme User's Manual
@comment %**end of header (This is for running Texinfo on a region.)
@setchapternewpage odd
@dircategory Programming Languages
@direntry
-* MIT Scheme User: (mit-scheme-user). MIT Scheme User's Manual
+* MIT/GNU Scheme User: (mit-scheme-user). MIT/GNU Scheme User's Manual
@end direntry
@ifinfo
-This file documents the use of MIT Scheme.
+This file documents the use of MIT/GNU Scheme.
-Copyright @copyright{} 1991-2002 Massachusetts Institute of Technology
+Copyright @copyright{} 1991,1993,1999,2000,2001,2002 Massachusetts Institute of Technology
+Copyright @copyright{} 2003 Massachusetts Institute of Technology
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version
@end ifinfo
@titlepage
-@title{MIT Scheme User's Manual}
+@title{MIT/GNU Scheme User's Manual}
@subtitle Edition 1.90
@subtitle for Scheme Release 7.7.2
@subtitle 29 December 2002
@page
@vskip 0pt plus 1filll
-Copyright @copyright{} 1991-2002 Massachusetts Institute of Technology
+Copyright @copyright{} 1991,1993,1999,2000,2001,2002 Massachusetts Institute of Technology
+Copyright @copyright{} 2003 Massachusetts Institute of Technology
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version
@ifinfo
Scheme is the UnCommon Lisp. This Info file is the user's guide for the
-MIT implementation of Scheme. It describes how to install and
-run MIT Scheme, how to execute and compile Scheme programs,
-and how to use Scheme with Edwin and GNU Emacs.
+MIT/GNU implementation of Scheme. It describes how to install and run
+MIT/GNU Scheme, how to execute and compile Scheme programs, and how to
+use Scheme with Edwin and GNU Emacs.
@end ifinfo
@menu
@node Introduction, Installation, Top, Top
@unnumbered Introduction
-This document describes how to install and use MIT Scheme, the
+This document describes how to install and use MIT/GNU Scheme, the
UnCommon Lisp. It gives installation instructions for all of the
platforms that we support; complete documentation of the command-line
options and environment variables that control how Scheme works; and
@cindex Windows
@cindex PC
This document discusses many operating-system specific features of the
-MIT Scheme implementation. In order to simplify the discussion, we use
+MIT/GNU Scheme implementation. In order to simplify the discussion, we use
abbreviations to refer to some operating systems. When the text uses
the term @dfn{unix}, this means any of the unix systems that we support,
including GNU/Linux, *BSD, HP-UX, Ultrix, NeXT, and SunOS. The term
The primary distribution site for this software is
@example
-@uref{http://www.nongnu.org/mit-scheme/}
+@uref{http://www.gnu.org/mit-scheme/}
@end example
@noindent
To report bugs, use the bug-reporting tool at
@example
-@uref{http://savannah.nongnu.org/projects/mit-scheme/}
+@uref{http://savannah.gnu.org/projects/mit-scheme/}
@end example
@noindent
@node Installation, Running Scheme, Introduction, Top
@chapter Installation
-This chapter describes how to install MIT Scheme release 7.7.
+This chapter describes how to install MIT/GNU Scheme release 7.7.
The release is supported under several different operating systems:
unix, OS/2, and Windows. Read the section detailing the installation
for the operating system that you are using.
We will use as an example the installation for GNU/Linux. The
installation for other unix systems is similar.
-MIT Scheme is distributed as a compressed `tar' file. The tar
+MIT/GNU Scheme is distributed as a compressed `tar' file. The tar
file contains two directories, called @file{bin} and @file{lib}. The
@file{bin} directory contains two executable files, @command{scheme} and
@command{bchscheme}. The @file{lib} directory contains one
@end example
@item
-You should now be able to run MIT Scheme. @xref{Running
+You should now be able to run MIT/GNU Scheme. @xref{Running
Scheme}, for more information.
@end itemize
@node Windows Installation, OS/2 Installation, Unix Installation, Installation
@section Windows Installation
-This section describes how to install MIT Scheme on Windows
+This section describes how to install MIT/GNU Scheme on Windows
95, Windows 98, Windows Me, Windows NT 4.0, Windows 2000, or Windows XP.
The software should also work on older versions of Windows NT, but we
haven't tested it there.
-MIT Scheme is distributed as a self-installing executable.
+MIT/GNU Scheme is distributed as a self-installing executable.
Installation of the software is straightforward. Simply execute the
downloaded file and answer the installer's questions. The installer
-will allow you to choose the directory in which MIT Scheme is
+will allow you to choose the directory in which MIT/GNU Scheme is
to be installed, and the name of the folder in which the shortcuts are
to be placed.
To uninstall the software, open up the @samp{Control Panel}, run
-@samp{Add/Remove Programs}, and double-click on @samp{MIT Scheme 7.7}.
+@samp{Add/Remove Programs}, and double-click on @samp{MIT/GNU Scheme 7.7}.
@node OS/2 Installation, Optional Configuration, Windows Installation, Installation
@section OS/2 Installation
-This section describes how to install MIT Scheme on a machine
-running OS/2 2.1 or later. This release of MIT Scheme has
+This section describes how to install MIT/GNU Scheme on a machine
+running OS/2 2.1 or later. This release of MIT/GNU Scheme has
been tested only on OS/2 Warp 4.0. It was compiled using IBM Visual Age
C++ version 3.0 and the OS/2 Toolkit version 4.0.
@node Running Scheme, Using Scheme, Installation, Top
@chapter Running Scheme
-This chapter describes how to run MIT Scheme. It also
-describes how you can customize the behavior of MIT Scheme
+This chapter describes how to run MIT/GNU Scheme. It also
+describes how you can customize the behavior of MIT/GNU Scheme
using command-line options and environment variables.
@menu
@node Basics of Starting Scheme, Customizing Scheme, Running Scheme, Running Scheme
@section Basics of Starting Scheme
-Under unix and OS/2, MIT Scheme is invoked by typing
+Under unix and OS/2, MIT/GNU Scheme is invoked by typing
@example
scheme
@noindent
at your operating system's command interpreter. Under Windows,
-MIT Scheme is invoked by double-clicking on a shortcut. In
+MIT/GNU Scheme is invoked by double-clicking on a shortcut. In
either case, Scheme will load itself and print something like this:
@example
@pindex scheme
@pindex bchscheme
-MIT Scheme uses a two-space copying garbage collector for
+MIT/GNU Scheme uses a two-space copying garbage collector for
reclaiming storage in the heap. There are two versions of Scheme which
handle garbage collection differently. The standard Scheme, called
@command{scheme} under unix and @command{scheme.exe} on the PC, has two
Once the storage is allocated for the constant space and the heap,
Scheme will dynamically adjust the proportion of the total that is used
for constant space; the stack and extra microcode storage is not
-included in this adjustment. Previous versions of MIT Scheme
+included in this adjustment. Previous versions of MIT/GNU Scheme
needed to be told the amount of constant space that was required when
loading bands with the @option{--band} option. Dynamic adjustment of
the heap and constant space avoids this problem.
warning message when Scheme starts. If you want to define your own
command-line options, see @ref{Custom Command-line Options}.
-Note that MIT Scheme supports only @dfn{long} options, that
+Note that MIT/GNU Scheme supports only @dfn{long} options, that
is, options specified by verbose names, as opposed to @dfn{short}
options, which are specified by single characters. As of release 7.7.2,
all options start with two hyphens, for compatibility with GNU
given, a normal load is performed instead. This option may not be used
together with the @option{--compiler}, @option{--edwin}, or
@option{--band} options. This option is useful only for maintenance and
-development of the MIT Scheme runtime system.
+development of the MIT/GNU Scheme runtime system.
@end table
@noindent
@node Custom Command-line Options, Environment Variables, Command-Line Options, Running Scheme
@section Custom Command-line Options
-MIT Scheme provides a mechanism for you to define your own
+MIT/GNU Scheme provides a mechanism for you to define your own
command-line options. This is done by registering handlers to identify
particular named options and to process them when Scheme starts.
Unfortunately, because of the way this mechanism is implemented, you
Scheme refers to many environment variables. This section lists these
variables and describes how each is used. The environment variables are
-organized according to the parts of MIT Scheme that they
+organized according to the parts of MIT/GNU Scheme that they
affect.
Environment variables that affect the microcode must be defined before
@nvindex MITSCHEME_GEOMETRY
@cindex window position
Four integers separated by commas or spaces that specify the placement
-and size of the MIT Scheme window as a
+and size of the MIT/GNU Scheme window as a
@var{left},@var{top},@var{width},@var{height} quadruple. The units are
screen pixels, and @samp{-1} means allow the system to choose this
parameter. E.g.@: @samp{-1,-1,500,300} places a 500 by 300 pixel window
@node Starting Scheme from Microsoft Windows, Leaving Scheme, Environment Variables, Running Scheme
@section Starting Scheme from Microsoft Windows
-The Microsoft Windows version of MIT Scheme runs as a
+The Microsoft Windows version of MIT/GNU Scheme runs as a
graphics-based application. Scheme is normally started using shortcuts;
the installer automatically generates several different predefined
shortcuts for your convenience.
SCode have pathname type @code{"bin"}. Native-code binaries have
pathname type @code{"com"}. (See the description of
@code{pathname-type} in @ref{Components of Pathnames, Pathname Type,
-Components of Pathnames, scheme, MIT Scheme Reference Manual}.)
+Components of Pathnames, scheme, MIT/GNU Scheme Reference Manual}.)
@end deffn
@defvr {variable+} load-noisily?
All pathnames are interpreted relative to a working directory, which is
initialized when Scheme is started. The working directory can be
obtained by calling the procedure @code{pwd} or modified by calling the
-procedure @code{cd}; @pxref{Working Directory, , , scheme, MIT
+procedure @code{cd}; @pxref{Working Directory, , , scheme, MIT/GNU
Scheme Reference Manual}. Files may be loaded when Scheme first starts;
see the @option{--load} command-line option for details.
compression of compiled-code debugging information.
@item format
-The @code{format} procedure. @xref{Format, , , scheme, MIT Scheme
+The @code{format} procedure. @xref{Format, , , scheme, MIT/GNU Scheme
Reference Manual}.
@item gdbm
files @file{runtime/gdbm.scm} and @file{microcode/prgdbm.c}.
@item hash-table
-The hash-table data type. @xref{Hash Tables, , , scheme, MIT Scheme
+The hash-table data type. @xref{Hash Tables, , , scheme, MIT/GNU Scheme
Reference Manual}.
@item ordered-vector
Undocumented; see the source file @file{runtime/ordvec.scm}.
@item rb-tree
-The red-black tree data type. @xref{Red-Black Trees, , , scheme, MIT
-Scheme Reference Manual}.
+The red-black tree data type. @xref{Red-Black Trees, , , scheme,
+MIT/GNU Scheme Reference Manual}.
@item regular-expression
Support to search and match strings for regular expressions.
-@xref{Regular Expressions, , , scheme, MIT Scheme Reference Manual}.
+@xref{Regular Expressions, , , scheme, MIT/GNU Scheme Reference Manual}.
@item stepper
Support to step through the evaluation of Scheme expressions.
@item synchronous-subprocess
Support to run synchronous subprocesses. @xref{Subprocesses, , ,
-scheme, MIT Scheme Reference Manual}.
+scheme, MIT/GNU Scheme Reference Manual}.
@item wt-tree
The weight-balanced tree data type. @xref{Weight-Balanced Trees, , ,
-scheme, MIT Scheme Reference Manual}.
+scheme, MIT/GNU Scheme Reference Manual}.
@end table
@end deffn
@section Garbage Collection
This section describes procedures that control garbage collection.
-@xref{Memory Usage}, for a discussion of how MIT Scheme uses
+@xref{Memory Usage}, for a discussion of how MIT/GNU Scheme uses
memory.
@deffn {procedure+} gc-flip [safety-margin]
@c
@c Note: The scoping of @code{ignore-reference-traps} and
@c @code{ignore-assignment-traps} differs between version of the
-@c compiler. MIT Scheme version 8.0 (Liar version 5.0) has
+@c compiler. MIT/GNU Scheme version 8.0 (Liar version 5.0) has
@c true block scoping, thus the declaration takes effect only within the
@c procedure or @code{let} in which the declaration occurs. This makes
@c it possible to control individual variable references, for example:
@cindex fixnum (defn)
A @dfn{fixnum} is an exact integer that is small enough to fit in a
-machine word. In MIT Scheme, fixnums are 26 bits on 32-bit
+machine word. In MIT/GNU Scheme, fixnums are 26 bits on 32-bit
machines, and 56 bits on 64-bit machines; it is reasonable to assume
that fixnums are at least 24 bits. Fixnums are signed; they are encoded
using 2's complement.
care should be exercised: if used improperly, these operations can
return incorrect answers, or even malformed objects that confuse the
garbage collector. For a listing of all fixnum operations, see
-@ref{Fixnum Operations, , , scheme, MIT Scheme Reference Manual}.
+@ref{Fixnum Operations, , , scheme, MIT/GNU Scheme Reference Manual}.
A fruitful area for inserting fixnum operations is in the index
operations in tight loops.
One of the main disadvantages of generic arithmetic is that not all
kinds of number fit in a machine register. Flonums have to be
@dfn{boxed} because a 64-bit @acronym{IEEE} floating-point number (the
-representation that MIT Scheme uses) does not fit in a regular
+representation that MIT/GNU Scheme uses) does not fit in a regular
machine word. This is true even on 64-bit architectures because some
extra bits are needed to distinguish floating-point numbers from other
objects like pairs and strings. Values are boxed by storing them in a
@c @end group
@c @end example
@c
-@c This approach is effective only for MIT Scheme version 8.0
+@c This approach is effective only for MIT/GNU Scheme version 8.0
@c and later. Earlier versions do not do this kind of type analysis.
@subsubheading Flonum vectors
@cindex continuation Browser
@cindex browser, Continuation
@findex debug
-There are two debuggers available with MIT Scheme. One of
+There are two debuggers available with MIT/GNU Scheme. One of
them runs under Edwin, and is described in that section of this document
(@pxref{Edwin Debugger}). The other is command-line oriented, does not
require Edwin, and is described here.
@cindex Debugger command x
@cindex Debugger command y
The @kbd{m}, @kbd{x}, and @kbd{y} commands are for Scheme wizards. They
-are used to debug the MIT Scheme implementation. If you want
+are used to debug the MIT/GNU Scheme implementation. If you want
to find out what they do, read the source code.
@item Miscellaneous commands
@deffn {procedure+} pp object [output-port [as-code?]]
The @code{pp} procedure is described in @ref{Output Procedures, , ,
-scheme, MIT Scheme Reference Manual}. However, since this is a very
+scheme, MIT/GNU Scheme Reference Manual}. However, since this is a very
useful debugging tool, we also mention it here. @code{pp} provides two
very useful functions:
@chapter GNU Emacs Interface
There is an interface library, called @file{xscheme}, distributed with
-MIT Scheme and GNU Emacs, which facilitates running
+MIT/GNU Scheme and GNU Emacs, which facilitates running
Scheme as a subprocess of Emacs. If you wish to use this interface,
please install the version of @file{xscheme.el} that comes with
-MIT Scheme, as it is guaranteed to be correct for your version
+MIT/GNU Scheme, as it is guaranteed to be correct for your version
of Scheme.
This interface works under unix only, because it requires unix signals
@node Edwin, Release Notes, GNU Emacs Interface, Top
@chapter Edwin
-This chapter describes how to start Edwin, the MIT Scheme text
+This chapter describes how to start Edwin, the MIT/GNU Scheme text
editor. Edwin is very similar to GNU Emacs---you should refer
to the GNU Emacs manual for information about Edwin's commands
and key bindings---except that Edwin's extension language is
-MIT Scheme, while GNU Emacs extensions are written
+MIT/GNU Scheme, while GNU Emacs extensions are written
in Emacs Lisp. This manual does not discuss customization of Edwin.
@menu
As you might expect, Edwin has special support for editing and
evaluating Scheme code. This section describes @dfn{Scheme Mode}, the
-appropriate mode for editing MIT Scheme programs.
+appropriate mode for editing MIT/GNU Scheme programs.
Scheme mode is normally entered automatically by visiting a file whose
file name ends in @samp{.scm}. You can also mark a file as Scheme code
@node Release Notes, GNU Free Documentation License, Edwin, Top
@appendix Release Notes
-The previous full release of MIT Scheme was version 7.5.17.
+The previous full release of MIT/GNU Scheme was version 7.6.1.
This section describes changes that have occurred since that time. For
more detailed information, see the @file{ChangeLog} files in the source
code.
-Note that MIT Scheme still conforms to the @cite{Revised^4
+Note that MIT/GNU Scheme still conforms to the @cite{Revised^4
Report on the Algorithmic Language Scheme}, but not to the
@cite{Revised^5 Report on The Algorithmic Language Scheme}.
-@menu
-* Recent Changes::
-* Older Changes::
-@end menu
-
-@node Recent Changes, Older Changes, Release Notes, Release Notes
-@appendixsec Recent Changes
-
-These are the changes since release 7.6.0:
+These are the changes since release 7.7.0:
@itemize @bullet
@item
call @code{load-option} prior to use of hash tables. For upwards
compatibility, calling @samp{(load-option 'hash-table)} is still
permitted but does nothing.
-
-@item
-Release 7.6.1 provides a workaround for a bug on some @acronym{AMD}
-Athlon processors (specifically, models 1, 3, and 4). This bug causes
-those processors to incorrectly execute certain kinds of self-modifying
-code, including that used by MIT Scheme.
-
-Release 7.6.1 also fixes a problem that caused the *PARSER and
-@acronym{XML} subsystems not to load correctly on Windows and OS/2
-systems.
-@end itemize
-
-@node Older Changes, , Recent Changes, Release Notes
-@appendixsec Older Changes
-
-These are the changes that occurred between releases 7.6.0 and 7.5.17:
-
-@itemize @bullet
-@item
-The variable-reference machinery has been completely redesigned. The
-new design provides two new features: (1) a procedure
-@code{link-variables} that can link two variable bindings with
-different names (previously @code{environment-link-name} could only
-link bindings with the same name); (2) a new procedure
-@code{unbind-variable} that can remove a variable binding. Both of
-these operations work only on ``top-level'' environments; they don't
-work on environments created by invoking compiled procedures.
-
-@strong{This is an incompatible change to the compiled-code
-representation. All programs must be recompiled.}
-
-@item
-The ``packaging'' subsystem has been redesigned to make it more
-flexible. The new design takes advantage of the improved
-variable-linking mechanism to allow packages to export bindings using
-names different from their internal names. Also, each package now
-maintains an in-memory data structure that should (in principal) allow
-it to be uninstalled or reinstalled. This subsystem is still
-evolving; expect further changes in the future.
-
-This subsystem is now included in the released binaries; it can be
-loaded by @samp{(load-option 'cref)}.
-
-@item
-Compiled-code debugging information is now keyed to prevent using the
-wrong debugging info when examining compiled code. This means that
-in-memory data structures have an identifying key that is matched
-against a corresponding key in the debugging-info file. The debugging
-info is used only when the keys match.
-
-@item
-MIT Scheme now has a non-validating @acronym{XML} parser that
-is mostly conformant (except that it doesn't support @acronym{UTF-16}).
-
-@item
-There is very limited support for @acronym{UTF-8}. At present this is
-only used by the @acronym{XML} parser.
-
-@item
-All string and character procedures now operate on
-@acronym{ISO-8859-1} rather than @acronym{US-ASCII} as the base
-character set. This isn't real internationalization support, but at
-least it broadens the character support slightly. This involved
-changing a number of procedures that were formerly written in C and
-are now written in Scheme, which may have a performance impact on some
-uses.
-
-@item
-The procedure @code{length} now detects circularities in its argument
-and signals an error.
-
-@item
-A new @code{rexp} facility provides a more readable syntax for
-specifying regular expressions. This syntax can be compiled into the
-usual syntax.
-
-@item
-There is a new @dfn{parser buffer} abstraction that supports the
-building of parsers with backtracking. An associated high-level
-parser description language allows parsers to be described in a
-@acronym{BNF}-like language that is compiled into efficient Scheme
-code.
-
-@item
-A new procedure @code{flo:finite?} returns @samp{#f} for infinite or
-@samp{NaN} flonums and @samp{#t} for all others.
-
-@item
-The signal-handling code for GNU/Linux systems has been
-changed to take advantage of additional information identifying the
-types of arithmetic exceptions. This allows more accurate error
-messages to be generated.
-
-@item
-The following procedure names were changed:
-
-@multitable @columnfractions .5 .5
-@item Old name
-@tab New name
-@item @code{list-transform-positive}
-@tab @code{keep-matching-items}
-@item @code{list-transform-negative}
-@tab @code{delete-matching-items}
-@item @code{list-search-positive}
-@tab @code{find-matching-item}
-@end multitable
-
-@noindent
-and the following new procedures were implemented:
-@code{keep-matching-items!} and @code{delete-matching-items!}.
-
-@item
-@acronym{IMAIL} now supports commands to sort folders according to
-various criteria. The design is similar to that of Rmail.
-
-@item
-@acronym{IMAIL} has been re-engineered to improve performance on very
-large folders. There is now a disk cache for each @acronym{IMAP}
-folder, to eliminate unnecessary network delays. Also, the summary
-buffer previously used a quadratic algorithm to associate lines in the
-summary with messages in the folder; it now uses a linear algorithm.
-
-@item
-A new @acronym{IMAIL} command @code{imail-file-message} appends the
-text of a message to a file more or less as it appears in the buffer.
-This is intended to allow collecting messages into a file in a
-human-readable format.
-
-@item
-@acronym{IMAIL} used to determine the type of file folders by their
-file names; now it examines the file contents instead. When creating
-a new file folder, it prompts for the type.
@end itemize
@node GNU Free Documentation License, Environment-variable Index, Release Notes, Top