This is mit-scheme-ref.info, produced by makeinfo version 6.5 from
scheme.texinfo.

This manual documents MIT/GNU Scheme 10.1.8.

   Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018,
2019 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 1.2 or any later version published by the Free Software
     Foundation; with no Invariant Sections, with no Front-Cover Texts
     and no Back-Cover Texts.  A copy of the license is included in the
     section entitled "GNU Free Documentation License."
INFO-DIR-SECTION Programming Languages
START-INFO-DIR-ENTRY
* MIT/GNU Scheme Reference: (mit-scheme-ref).
                                Reference Manual
END-INFO-DIR-ENTRY


File: mit-scheme-ref.info,  Node: Parser-language Macros,  Prev: *Parser,  Up: Parser Language

14.14.3 Parser-language Macros
------------------------------

The parser and matcher languages provide a macro facility so that common
patterns can be abstracted.  The macro facility allows new expression
types to be independently defined in the two languages.  The macros are
defined in hierarchically organized tables, so that different
applications can have private macro bindings.

 -- special form: define-*matcher-macro formals expression
 -- special form: define-*parser-macro formals expression
     These special forms are used to define macros in the matcher and
     parser language, respectively.  FORMALS is like the FORMALS list of
     a 'define' special form, and EXPRESSION is a Scheme expression.

     If FORMALS is a list (or improper list) of symbols, the first
     symbol in the list is the name of the macro, and the remaining
     symbols are interpreted as the FORMALS of a lambda expression.  A
     lambda expression is formed by combining the latter FORMALS with
     the EXPRESSION, and this lambda expression, when evaluated, becomes
     the "expander".  The defined macro accepts the same number of
     operands as the expander.  A macro instance is expanded by applying
     the expander to the list of operands; the result of the application
     is interpreted as a replacement expression for the macro instance.

     If FORMALS is a symbol, it is the name of the macro.  In this case,
     the expander is a procedure of no arguments whose body is
     EXPRESSION.  When the FORMALS symbol appears by itself as an
     expression in the language, the expander is called with no
     arguments, and the result is interpreted as a replacement
     expression for the symbol.

 -- procedure: define-*matcher-expander identifier expander
 -- procedure: define-*parser-expander identifier expander
     These procedures provide a procedural interface to the
     macro-definition mechanism.  IDENTIFIER must be a symbol, and
     EXPANDER must be an expander procedure, as defined above.
     Instances of the 'define-*matcher-macro' and 'define-*parser-macro'
     special forms expand into calls to these procedures.

   The remaining procedures define the interface to the parser-macros
table abstraction.  Each parser-macro table has a separate binding space
for macros in the matcher and parser languages.  However, the table
inherits bindings from one specified table; it's not possible to inherit
matcher-language bindings from one table and parser-language bindings
from another.

 -- procedure: make-parser-macros parent-table
     Create and return a new parser-macro table that inherits from
     PARENT-TABLE.  PARENT-TABLE must be either a parser-macro table, or
     '#f'; usually it is specified as the value of
     'global-parser-macros'.

 -- procedure: parser-macros? object
     This is a predicate for parser-macro tables.

 -- procedure: global-parser-macros
     Return the global parser-macro table.  This table is predefined and
     contains all of the bindings documented here.

   There is a "current" table at all times, and macro definitions are
always placed in this table.  By default, the current table is the
global macro table, but the following procedures allow this to be
changed.

 -- procedure: current-parser-macros
     Return the current parser-macro table.

 -- procedure: set-current-parser-macros! table
     Change the current parser-macro table to TABLE, which must satisfy
     'parser-macros?'.

 -- procedure: with-current-parser-macros table thunk
     Bind the current parser-macro table to TABLE, call THUNK with no
     arguments, then restore the original table binding.  The value
     returned by THUNK is the returned as the value of this procedure.
     TABLE must satisfy 'parser-macros?', and THUNK must be a procedure
     of no arguments.


File: mit-scheme-ref.info,  Node: XML Support,  Prev: Parser Language,  Up: Input/Output

14.15 XML Support
=================

MIT/GNU Scheme provides a simple non-validating XML parser.  This parser
is believed to be conformant with XML 1.0.  It passes all of the tests
in the "xmltest" directory of the XML conformance tests (dated
2001-03-15).  The parser supports XML namespaces; it doesn't support
external document type declarations (DTDs), and it doesn't yet support
XML 1.1.  The output of the parser is a record tree that closely
reflects the structure of the XML document.

   MIT/GNU Scheme also provides support for writing an XML record tree
to an output port.  There is no guarantee that parsing an XML document
and writing it back out will make a verbatim copy of the document.  The
output will be semantically identical but may have small syntactic
differences.  For example, entities are substituted during the parsing
process.

   The purpose of the XML support is to provide a mechanism for reading
and writing simple XML documents.  In the future this support may be
further developed to support a standard interface such as DOM or SAX.

   The XML support is a run-time-loadable option; to use it, execute

     (load-option 'xml)

once before running any code that uses it.

* Menu:

* XML Input::
* XML Output::
* XML Names::
* XML Structure::


File: mit-scheme-ref.info,  Node: XML Input,  Next: XML Output,  Prev: XML Support,  Up: XML Support

14.15.1 XML Input
-----------------

The primary entry point for the XML parser is 'read-xml', which reads
characters from a port and returns an XML document record.  The
character coding of the input is determined by reading some of the input
stream and looking for a byte order mark and/or an encoding in the XML
declaration.  We support all ISO 8859 codings, as well as UTF-8, UTF-16,
and UTF-32.

   When an XHTML document is read, the parser provides entity
definitions for all of the named XHTML characters; for example, it
defines '&nbsp;' and '&copy;'.  In order for a document to be recognized
as XHTML, it must contain an XHTML DTD, such as this:

     <!DOCTYPE html
               PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
               "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

At present the parser recognizes XHTML Strict 1.0 and XHTML 1.1
documents.

 -- procedure: read-xml port [pi-handlers]
     Read an XML document from PORT and return the corresponding XML
     document record.

     PI-HANDLERS, if specified, must be an association list.  Each
     element of PI-HANDLERS must be a list of two elements: a symbol and
     a procedure.  When the parser encounters processing instructions
     with a name that appears in PI-HANDLERS, the procedure is called
     with one argument, which is the text of the processing
     instructions.  The procedure must return a list of XML structure
     records that are legal for the context of the processing
     instructions.

 -- procedure: read-xml-file pathname [pi-handlers]
     This convenience procedure simplifies reading XML from a file.  It
     is roughly equivalent to

          (define (read-xml-file pathname #!optional pi-handlers)
            (call-with-input-file pathname
              (lambda (port)
                (read-xml port pi-handlers))))

 -- procedure: string->xml string [start [end [pi-handlers]]]
     This convenience procedure simplifies reading XML from a string.
     The STRING argument may be a string or a wide string.  It is
     roughly equivalent to

          (define (string->xml string #!optional start end pi-handlers)
            (read-xml (open-input-string string start end)
                      pi-handlers))


File: mit-scheme-ref.info,  Node: XML Output,  Next: XML Names,  Prev: XML Input,  Up: XML Support

14.15.2 XML Output
------------------

The following procedures serialize XML document records into character
sequences.  All are virtually identical except for the way that the
character sequence is represented.

   Each procedure will accept either an 'xml-document' record or any of
the other XML record types.  This makes it possible to write fragments
of XML documents, although you should keep in mind that such fragments
aren't documents and won't generally be accepted by any XML parser.

   If the XML being written is an 'xml-document' record, the procedures
'write-xml' and 'write-xml-file' will look for a contained
'xml-declaration' record and its 'encoding' attribute.  If the
'encoding' is a supported value, the output will be encoded as
specified; otherwise it will be encoded as UTF-8.

   When an XHTML document record is written, named XHTML characters are
translated into their corresponding entities.  For example, the
character '#\U+00A0' is written as '&nbsp;'.  In order for an XML
document record to be recognized as XHTML, it must have a DTD record
that satisfies the predicate 'html-dtd?'.

 -- procedure: write-xml xml port
     Write XML to PORT.  Note that character encoding will only be done
     if PORT supports it.

 -- procedure: write-xml-file xml pathname
     Write XML to the file specified by PATHNAME.  Roughly equivalent to

          (define (write-xml-file xml pathname)
            (call-with-output-file pathname
              (lambda (port)
                (write-xml xml port))))

 -- procedure: xml->wide-string xml
     Convert XML to a wide string.  No character encoding is used, since
     wide strings can represent all characters without encoding.
     Roughly equivalent to

          (define (xml->wide-string xml)
            (call-with-wide-output-string
             (lambda (port)
               (write-xml xml port))))

 -- procedure: xml->string xml
     Convert XML to a character string encoded as UTF-8.  Roughly
     equivalent to

          (define (xml->string xml)
            (wide-string->utf8-string (xml->wide-string xml)))


File: mit-scheme-ref.info,  Node: XML Names,  Next: XML Structure,  Prev: XML Output,  Up: XML Support

14.15.3 XML Names
-----------------

MIT/GNU Scheme implements XML names in a slightly complex way.
Unfortunately, this complexity is a direct consequence of the definition
of XML names rather than a mis-feature of this implementation.

   The reason that XML names are complex is that XML namespace support,
which was added after XML was standardized, is not very well integrated
with the core XML definition.  The most obvious problem is that names
can't have associated namespaces when they appear in the DTD of a
document, even if the body of the document uses them.  Consequently, it
must be possible to compare non-associated names with associated names.

   An XML name consists of two parts: the "qname", which is a symbol,
possibly including a namespace prefix; and the "Uniform Resource
Identifier" (URI), which identifies an optional namespace.

 -- procedure: make-xml-name qname uri
     Creates and returns an XML name.  QNAME must be a symbol whose name
     satisfies 'string-is-xml-name?'.  URI must satisfy either
     'absolute-uri?' or 'null-xml-namespace-uri?'.  The returned value
     is an XML name that satisfies 'xml-name?'.

     If URI is the "null" namespace (satisfies
     'null-xml-namespace-uri?'), the returned value is a symbol
     equivalent to QNAME.  This means that an ordinary symbol can be
     used as an XML name when there is no namespace associated with the
     name.

     For convenience, QNAME may be a string, in which case it is
     converted to a symbol using 'make-xml-qname'.

     For convenience, URI may be any object that '->uri' is able to
     convert to a URI record, provided the resulting URI meets the above
     restrictions.

 -- procedure: xml-name? object
     Returns '#t' if OBJECT is an XML name, and '#f' otherwise.

 -- procedure: xml-name->symbol xml-name
     Returns the symbol part of XML-NAME.

 -- procedure: xml-name-uri xml-name
     Returns the "URI" of XML-NAME.  The result always satisfies
     'absolute-uri?' or 'null-xml-namespace-uri?'.

 -- procedure: xml-name-string xml-name
     Returns the "qname" of XML-NAME as a string.  Equivalent to

          (symbol->string (xml-name->symbol XML-NAME))

   The next two procedures get the "prefix" and "local part" of an XML
name, respectively.  The prefix of an XML name is the part of the qname
to the left of the colon, while the local part is the part of the qname
to the right of the colon.  If there is no colon in the qname, the local
part is the entire qname, and the prefix is the null symbol (i.e. '||').

 -- procedure: xml-name-prefix xml-name
     Returns the "prefix" of XML-NAME as a symbol.

 -- procedure: xml-name-local xml-name
     Returns the "local part" of XML-NAME as a symbol.

   The next procedure compares two XML names for equality.  The rules
for equality are slightly complex, in order to permit comparing names in
the DTD with names in the document body.  So, if both of the names have
non-null namespace URIs, then the names are equal if and only if their
local parts are equal and their URIs are equal.  (The prefixes of the
names are not considered in this case.)  Otherwise, the names are equal
if and only if their qnames are equal.

 -- procedure: xml-name=? xml-name-1 xml-name-2
     Returns '#t' if XML-NAME-1 and XML-NAME-2 are the same name, and
     '#f' otherwise.

   These next procedures define the data abstraction for qnames.  While
qnames are represented as symbols, only symbols whose names satisfy
'string-is-xml-name?' are qnames.

 -- procedure: make-xml-qname string
     STRING must satisfy 'string-is-xml-name?'.  Returns the qname
     corresponding to STRING (the symbol whose name is STRING).

 -- procedure: xml-qname? object
     Returns '#t' if OBJECT is a qname, otherwise returns '#f'.

 -- procedure: xml-qname-prefix qname
     Returns the prefix of QNAME as a symbol.

 -- procedure: xml-qname-local qname
     Returns the local part of QNAME as a symbol.

   The prefix of a qname or XML name may be absent if there is no colon
in the name.  The absent, or null, prefix is abstracted by the next two
procedures.  Note that the null prefix is a symbol, just like non-null
prefixes.

 -- procedure: null-xml-name-prefix
     Returns the null prefix.

 -- procedure: null-xml-name-prefix? object
     Returns '#t' if OBJECT is the null prefix, otherwise returns '#f'.

   The namespace URI of an XML name may be null, meaning that there is
no namespace associated with the name.  This namespace is represented by
a relative URI record whose string representation is the null string.

 -- procedure: null-xml-namespace-uri
     Returns the null namespace URI record.

 -- procedure: null-xml-namespace-uri? object
     Returns '#t' if OBJECT is the null namespace URI record, otherwise
     returns '#f'.

   The following values are two distinguished URI records.

 -- variable: xml-uri
     'xml-uri' is the URI reserved for use by the XML recommendation.
     This URI must be used with the 'xml' prefix.

 -- variable: xmlns-uri
     'xmlns-uri' is the URI reserved for use by the XML namespace
     recommendation.  This URI must be used with the 'xmlns' prefix.

 -- procedure: make-xml-nmtoken string

 -- procedure: xml-nmtoken? object

 -- procedure: string-is-xml-name? string

 -- procedure: string-is-xml-nmtoken? string


File: mit-scheme-ref.info,  Node: XML Structure,  Prev: XML Names,  Up: XML Support

14.15.4 XML Structure
---------------------

The output from the XML parser and the input to the XML output procedure
is a complex data structure composed of a hierarchy of typed components.
Each component is a record whose fields correspond to parts of the XML
structure that the record represents.  There are no special operations
on these records; each is a tuple with named subparts.  The root record
type is 'xml-document', which represents a complete XML document.

   Each record type TYPE has the following associated bindings:

'<TYPE>'
     is a variable bound to the record-type descriptor for TYPE.  The
     record-type descriptor may be used as a specializer in SOS method
     definitions, which greatly simplifies code to dispatch on these
     types.

'TYPE?'
     is a predicate for records of type TYPE.  It accepts one argument,
     which can be any object, and returns '#t' if the object is a record
     of this type, or '#f' otherwise.

'make-TYPE'
     is a constructor for records of type TYPE.  It accepts one argument
     for each field of TYPE, in the same order that they are written in
     the type description, and returns a newly-allocated record of that
     type.

'TYPE-FIELD'
     is an accessor procedure for the field FIELD in records of type
     TYPE.  It accepts one argument, which must be a record of that
     type, and returns the contents of the corresponding field in the
     record.

'set-TYPE-FIELD!'
     is a modifier procedure for the field FIELD in records of type
     TYPE.  It accepts two arguments: the first must be a record of that
     type, and the second is a new value for the corresponding field.
     The record's field is modified to have the new value.

 -- record type: xml-document declaration misc-1 dtd misc-2 root misc-3
     The 'xml-document' record is the top-level record representing a
     complete XML document.  DECLARATION is either an 'xml-declaration'
     object or '#f'.  DTD is either an 'xml-dtd' object or '#f'.  ROOT
     is an 'xml-element' object.  MISC-1, MISC-2, and MISC-3 are lists
     of miscellaneous items; a miscellaneous item is either an
     'xml-comment' object, an 'xml-processing-instructions' object, or a
     string of whitespace.

 -- record type: xml-declaration version encoding standalone
     The 'xml-declaration' record represents the '<?xml ... ?>'
     declaration that optionally appears at the beginning of an XML
     document.  VERSION is a version string, typically '"1.0"'.
     ENCODING is either an encoding string or '#f'.  STANDALONE is
     either '"yes"', '"no"', or '#f'.

 -- record type: xml-element name attributes contents
     The 'xml-element' record represents general XML elements; the bulk
     of a typical XML document consists of these elements.  NAME is the
     element name (an XML name).  ATTRIBUTES is a list of XML attribute
     objects.  CONTENTS is a list of the contents of the element.  Each
     element of this list is either a string, an 'xml-element' record or
     an 'xml-processing-instructions' record.

 -- record type: xml-processing-instructions name text
     The 'xml-processing-instructions' record represents processing
     instructions, which have the form '<?NAME ... ?>'.  These
     instructions are intended to contain non-XML data that will be
     processed by another interpreter; for example they might contain
     PHP programs.  The NAME field is the processor name (a symbol), and
     the TEXT field is the body of the instructions (a string).

 -- record type: xml-dtd root external internal
     The 'xml-dtd' record represents a document type declaration.  The
     ROOT field is an XML name for the root element of the document.
     EXTERNAL is either an 'xml-external-id' record or '#f'.  INTERNAL
     is a list of DTD element records (e.g. 'xml-!element',
     'xml-!attlist', etc.).

   The remaining record types are valid only within a DTD.

 -- record type: xml-!element name content-type
     The 'xml-!element' record represents an element-type declaration.
     NAME is the XML name of the type being declared (a symbol).
     CONTENT-TYPE describes the type and can have several different
     values, as follows:

        * The XML names 'EMPTY' and 'ANY' correspond to the XML keywords
          of the same name.

        * A list '(MIX TYPE ...)' corresponds to the '(#PCDATA | TYPE |
          ...)' syntax.

 -- record type: xml-!attlist name definitions
     The 'xml-!attlist' record represents an attribute-list declaration.
     NAME is the XML name of the type for which attributes are being
     declared (a symbol).  DEFINITIONS is a list of attribute
     definitions, each of which is a list of three elements '(NAME TYPE
     DEFAULT)'.  NAME is an XML name for the name of the attribute (a
     symbol).  TYPE describes the attribute type, and can have one of
     the following values:

        * The XML names 'CDATA', 'IDREFS', 'IDREF', 'ID', 'ENTITY',
          'ENTITIES', 'NMTOKENS', and 'NMTOKEN' correspond to the XML
          keywords of the same names.

        * A list '(NOTATION NAME1 NAME2 ...)' corresponds to the
          'NOTATION (NAME1 | NAME2 ...)' syntax.

        * A list '(ENUMERATED NAME1 NAME2 ...)' corresponds to the
          '(NAME1 | NAME2 ...)' syntax.

     DEFAULT describes the default value for the attribute, and can have
     one of the following values:

        * The XML names '#REQUIRED' and '#IMPLIED' correspond to the XML
          keywords of the same names.

        * A list '(#FIXED VALUE)' corresponds to the '#FIXED "VALUE"'
          syntax.  VALUE is represented as a string.

        * A list '(DEFAULT VALUE)' corresponds to the '"VALUE"' syntax.
          VALUE is represented as a string.

 -- record type: xml-!entity name value
     The 'xml-!entity' record represents a general entity declaration.
     NAME is an XML name for the entity.  VALUE is the entity's value,
     either a string or an 'xml-external-id' record.

 -- record type: xml-parameter-!entity name value
     The 'xml-parameter-!entity' record represents a parameter entity
     declaration.  NAME is an XML name for the entity.  VALUE is the
     entity's value, either a string or an 'xml-external-id' record.

 -- record type: xml-unparsed-!entity name id notation
     The 'xml-unparsed-!entity' record represents an unparsed entity
     declaration.  'Name' is an XML name for the entity.  ID is an
     'xml-external-id' record.  NOTATION is an XML name for the
     notation.

 -- record type: xml-!notation name id
     The 'xml-!notation' record represents a notation declaration.
     'Name' is an XML name for the notation.  ID is an 'xml-external-id'
     record.

 -- record type: xml-external-id id uri
     The 'xml-external-id' record is a reference to an external DTD.
     This reference consists of two parts: ID is a public ID literal,
     corresponding to the 'PUBLIC' keyword, while URI is a system
     literal, corresponding to the 'SYSTEM' keyword.  Either or both may
     be present, depending on the context.  ID is represented as a
     string, while URI is represented as a URI record.


File: mit-scheme-ref.info,  Node: Operating-System Interface,  Next: Error System,  Prev: Input/Output,  Up: Top

15 Operating-System Interface
*****************************

The Scheme standard provides a simple mechanism for reading and writing
files: file ports.  MIT/GNU Scheme provides additional tools for dealing
with other aspects of the operating system:

   * "Pathnames" are a reasonably operating-system independent tool for
     manipulating the component parts of file names.  This can be useful
     for implementing defaulting of file name components.

   * Control over the "current working directory": the place in the file
     system from which relative file names are interpreted.

   * Procedures that rename, copy, delete, and test for the existence of
     files.  Also, procedures that return detailed information about a
     particular file, such as its type (directory, link, etc.)  or
     length.

   * Procedures for reading the contents of a directory.

   * Procedures for obtaining times in various formats, converting
     between the formats, and generating human-readable time strings.

   * Procedures to run other programs as subprocesses of Scheme, to read
     their output, and write input to them.

   * A means to determine the operating system Scheme is running under.

* Menu:

* Pathnames::
* Working Directory::
* File Manipulation::
* Directory Reader::
* Date and Time::
* Machine Time::
* Subprocesses::
* TCP Sockets::
* Miscellaneous OS Facilities::


File: mit-scheme-ref.info,  Node: Pathnames,  Next: Working Directory,  Prev: Operating-System Interface,  Up: Operating-System Interface

15.1 Pathnames
==============

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
systems) and what equivalent file names might look like for each one:

     System          File Name
     ------          ---------
     TOPS-20         <LISPIO>FORMAT.FASL.13
     TOPS-10         FORMAT.FAS[1,4]
     ITS             LISPIO;FORMAT FASL
     MULTICS         >udd>LispIO>format.fasl
     TENEX           <LISPIO>FORMAT.FASL;13
     VAX/VMS         [LISPIO]FORMAT.FAS;13
     UNIX            /usr/lispio/format.fasl
     DOS             C:\USR\LISPIO\FORMAT.FAS

   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/GNU Scheme provides _two_ ways to
represent file names: "filenames" (also called "namestrings"), which are
strings in the implementation-dependent form customary for the file
system, and "pathnames", which are special abstract data objects that
represent file names in an implementation-independent way.  Procedures
are provided to convert between these two representations, and all
manipulations of files can be expressed in machine-independent terms by
using pathnames.

   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 "host", in
keeping with the usual networking terminology.(1)

   Note that the examples given in this section are specific to unix
pathnames.  Pathnames for other operating systems have different
external representations.

* Menu:

* Filenames and Pathnames::
* Components of Pathnames::
* Operations on Pathnames::
* Miscellaneous Pathnames::

   ---------- Footnotes ----------

   (1) This introduction is adapted from 'Common Lisp, The Language',
second edition, section 23.1.


File: mit-scheme-ref.info,  Node: Filenames and Pathnames,  Next: Components of Pathnames,  Prev: Pathnames,  Up: Pathnames

15.1.1 Filenames and Pathnames
------------------------------

Pathname objects are usually created by parsing filenames (character
strings) into component parts.  MIT/GNU Scheme provides operations that
convert filenames into pathnames and vice versa.

 -- procedure: ->pathname object
     Returns a pathname that is the equivalent of OBJECT.  OBJECT must
     be a pathname or a string.  If OBJECT is a pathname, it is
     returned.  If OBJECT is a string, this procedure returns the
     pathname that corresponds to the string; in this case it is
     equivalent to '(parse-namestring OBJECT #f #f)'.

          (->pathname "foo")          =>  #[pathname 65 "foo"]
          (->pathname "/usr/morris")  =>  #[pathname 66 "/usr/morris"]

 -- procedure: parse-namestring thing [host [defaults]]
     This turns THING into a pathname.  THING must be a pathname or a
     string.  If THING is a pathname, it is returned.  If THING is a
     string, this procedure returns the pathname that corresponds to the
     string, parsed according to the syntax of the file system specified
     by HOST.

     This procedure _does not_ do defaulting of pathname components.

     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/GNU Scheme supports more than one
     file system, otherwise you would use '->pathname'.  If given, HOST
     must be a host object or '#f', and DEFAULTS must be a pathname.
     HOST specifies the syntax used to parse the string.  If HOST is not
     given or '#f', the host component from DEFAULTS is used instead; if
     DEFAULTS is not given, the host component from
     'param:default-pathname-defaults' is used.

 -- procedure: ->namestring pathname
     '->namestring' returns a newly allocated string that is the
     filename corresponding to PATHNAME.
          (->namestring (->pathname "/usr/morris/minor.van"))
               =>  "/usr/morris/minor.van"

 -- procedure: pathname-simplify pathname
     Returns a pathname that locates the same file or directory as
     PATHNAME, but is in some sense simpler.  Note that
     'pathname-simplify' might not always be able to simplify the
     pathname, e.g. on unix with symbolic links the directory
     '/usr/morris/../' need not be the same as '/usr/'.  In cases of
     uncertainty the behavior is conservative, returning the original or
     a partly simplified pathname.

          (pathname-simplify "/usr/morris/../morris/dance")
               =>  #[pathname "/usr/morris/dance"]


File: mit-scheme-ref.info,  Node: Components of Pathnames,  Next: Operations on Pathnames,  Prev: Filenames and Pathnames,  Up: Pathnames

15.1.2 Components of Pathnames
------------------------------

A pathname object always has six components, described below.  These
components are the common interface that allows programs to work the
same way with different file systems; the mapping of the pathname
components into the concepts peculiar to each file system is taken care
of by the Scheme implementation.

HOST
     The name of the file system on which the file resides.  In the
     current implementation, this component is always a host object that
     is filled in automatically by the runtime system.  When specifying
     the host component, use either '#f' or the value of the variable
     'local-host'.

DEVICE
     Corresponds to the "device" or "file structure" concept in many
     host file systems: the name of a (logical or physical) device
     containing files.  This component is the drive letter for PC file
     systems, and is unused for unix file systems.

DIRECTORY
     Corresponds to the "directory" concept in many host file systems:
     the name of a group of related files (typically those belonging to
     a single user or project).  This component is always used for all
     file systems.

NAME
     The name of a group of files that can be thought of as conceptually
     the "same" file.  This component is always used for all file
     systems.

TYPE
     Corresponds to the "filetype" or "extension" concept in many host
     file systems.  This says what kind of file this is.  Files with the
     same name but different type are usually related in some specific
     way, such as one being a source file, another the compiled form of
     that source, and a third the listing of error messages from the
     compiler.  This component is currently used for all file systems,
     and is formed by taking the characters that follow the last dot in
     the namestring.

VERSION
     Corresponds to the "version number" concept in many host file
     systems.  Typically this is a number that is incremented every time
     the file is modified.  This component is currently unused for all
     file systems.

   Note that a pathname is not necessarily the name of a specific file.
Rather, it is a specification (possibly only a partial specification) of
how to access a file.  A pathname need not correspond to any file that
actually exists, and more than one pathname can refer to the same file.
For example, the pathname with a version of 'newest' may refer to the
same file as a pathname with the same components except a certain number
as the version.  Indeed, a pathname with version 'newest' may refer to
different files as time passes, because the meaning of such a pathname
depends on the state of the file system.  In file systems with such
facilities as "links", multiple file names, logical devices, and so on,
two pathnames that look quite different may turn out to address the same
file.  To access a file given a pathname, one must do a file-system
operation such as 'open-input-file'.

   Two important operations involving pathnames are "parsing" and
"merging".  Parsing is the conversion of a filename (which might be
something supplied interactively by the users when asked to supply the
name of a file) into a pathname object.  This operation is
implementation-dependent, because the format of filenames is
implementation-dependent.  Merging takes a pathname with missing
components and supplies values for those components from a source of
default values.

   Not all of the components of a pathname need to be specified.  If a
component of a pathname is missing, its value is '#f'.  Before the file
system interface can do anything interesting with a file, such as
opening the file, all the missing components of a pathname must be
filled in.  Pathnames with missing components are used internally for
various purposes; in particular, parsing a namestring that does not
specify certain components will result in a pathname with missing
components.

   Any component of a pathname may be the symbol 'unspecific', meaning
that the component simply does not exist, for file systems in which such
a value makes no sense.  For example, unix and Windows file systems
usually do not support version numbers, so the version component for
such a host might be 'unspecific'.(1)

   In addition to '#f' and 'unspecific', the components of a pathname
may take on the following meaningful values:

HOST
     An implementation-defined type which may be tested for using the
     'host?' predicate.

DEVICE
     On systems that support this component (Windows), it may be
     specified as a string containing a single alphabetic character, for
     which the alphabetic case is ignored.

DIRECTORY
     A non-empty list, which represents a "directory path": a sequence
     of directories, each of which has a name in the previous directory,
     the last of which is the directory specified by the entire path.
     Each element in such a path specifies the name of the directory
     relative to the directory specified by the elements to its left.
     The first element of the list is either the symbol 'absolute' or
     the symbol 'relative'.  If the first element in the list is the
     symbol 'absolute', then the directory component (and subsequently
     the pathname) is "absolute"; the first component in the sequence is
     to be found at the "root" of the file system.  If the directory is
     "relative" then the first component is to be found in some as yet
     unspecified directory; typically this is later specified to be the
     "current working directory".

     Aside from 'absolute' and 'relative', which may only appear as the
     first element of the list, each subsequent element in the list is
     either: a string, which is a literal component; the symbol 'wild',
     meaningful only when used in conjunction with the directory reader;
     or the symbol 'up', meaning the next directory is the "parent" of
     the previous one.  'up' corresponds to the file '..' in unix and PC
     file systems.

     (The following note does not refer to any file system currently
     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
     'absolute'.  If the system does not support directories other than
     a single global directory, the list will have no other elements.
     If the system supports "flat" directories, i.e. a global set of
     directories with no subdirectories, then the list will contain a
     second element, which is either a string or 'wild'.  In other
     words, a non-hierarchical file system is treated as if it were
     hierarchical, but the hierarchical features are unused.  This
     representation is somewhat inconvenient for such file systems, but
     it discourages programmers from making code depend on the lack of a
     file hierarchy.

NAME
     A string, which is a literal component; or the symbol 'wild',
     meaningful only when used in conjunction with the directory reader.

TYPE
     A string, which is a literal component; or the symbol 'wild',
     meaningful only when used in conjunction with the directory reader.

VERSION
     An exact positive integer, which is a literal component; the symbol
     'newest', which means to choose the largest available version
     number for that file; the symbol 'oldest', which means to choose
     the smallest version number; or the symbol 'wild', meaningful only
     when used in conjunction with the directory reader.  In the future
     some other possible values may be added, e.g. 'installed'.  Note
     that currently no file systems support version numbers; thus this
     component is not used and should be specified as '#f'.

 -- procedure: make-pathname host device directory name type version
     Returns a pathname object whose components are the respective
     arguments.  Each argument must satisfy the restrictions for the
     corresponding component, which were outlined above.

          (make-pathname #f
                         #f
                         '(absolute "usr" "morris")
                         "foo"
                         "scm"
                         #f)
               =>  #[pathname 67 "/usr/morris/foo.scm"]

 -- procedure: pathname-host pathname
 -- procedure: pathname-device pathname
 -- procedure: pathname-directory pathname
 -- procedure: pathname-name pathname
 -- procedure: pathname-type pathname
 -- procedure: pathname-version pathname
     Returns a particular component of PATHNAME.

          (define x (->pathname "/usr/morris/foo.scm"))
          (pathname-host x)       =>  #[host 1]
          (pathname-device x)     =>  unspecific
          (pathname-directory x)  =>  (absolute "usr" "morris")
          (pathname-name x)       =>  "foo"
          (pathname-type x)       =>  "scm"
          (pathname-version x)    =>  unspecific

 -- procedure: pathname-new-device pathname device
 -- procedure: pathname-new-directory pathname directory
 -- procedure: pathname-new-name pathname name
 -- procedure: pathname-new-type pathname type
 -- procedure: pathname-new-version pathname version
     Returns a new copy of PATHNAME with the respective component
     replaced by the second argument.  PATHNAME is unchanged.  Portable
     programs should not explicitly replace a component with
     'unspecific' because this might not be permitted in some
     situations.

          (define p (->pathname "/usr/blisp/rel15"))
          p
               =>  #[pathname 71 "/usr/blisp/rel15"]
          (pathname-new-name p "rel100")
               =>  #[pathname 72 "/usr/blisp/rel100"]
          (pathname-new-directory p '(relative "test" "morris"))
               =>  #[pathname 73 "test/morris/rel15"]
          p
               =>  #[pathname 71 "/usr/blisp/rel15"]

 -- procedure: pathname-default-device pathname device
 -- procedure: pathname-default-directory pathname directory
 -- procedure: pathname-default-name pathname name
 -- procedure: pathname-default-type pathname type
 -- procedure: pathname-default-version pathname version
     These operations are similar to the 'pathname-new-COMPONENT'
     operations, except that they only change the specified COMPONENT if
     it has the value '#f' in PATHNAME.

   ---------- Footnotes ----------

   (1) This description is adapted from 'Common Lisp, The Language',
second edition, section 23.1.1.


File: mit-scheme-ref.info,  Node: Operations on Pathnames,  Next: Miscellaneous Pathnames,  Prev: Components of Pathnames,  Up: Pathnames

15.1.3 Operations on Pathnames
------------------------------

 -- procedure: pathname? object
     Returns '#t' if OBJECT is a pathname; otherwise returns '#f'.

 -- procedure: pathname=? pathname1 pathname2
     Returns '#t' if PATHNAME1 is equivalent to PATHNAME2; otherwise
     returns '#f'.  Pathnames are equivalent if all of their components
     are equivalent, hence two pathnames that are equivalent must
     identify the same file or equivalent partial pathnames.  However,
     the converse is not true: non-equivalent pathnames may specify the
     same file (e.g. via absolute and relative directory components),
     and pathnames that specify no file at all (e.g. name and directory
     components unspecified) may be equivalent.

 -- procedure: pathname-absolute? pathname
     Returns '#t' if PATHNAME is an absolute rather than relative
     pathname object; otherwise returns '#f'.  Specifically, this
     procedure returns '#t' when the directory component of PATHNAME is
     a list starting with the symbol 'absolute', and returns '#f' in all
     other cases.  All pathnames are either absolute or relative, so if
     this procedure returns '#f', the argument is a relative pathname.

 -- procedure: directory-pathname? pathname
     Returns '#t' if PATHNAME has only directory components and no file
     components.  This is roughly equivalent to

          (define (directory-pathname? pathname)
            (string-null? (file-namestring pathname)))

     except that it is faster.

 -- procedure: pathname-wild? pathname
     Returns '#t' if PATHNAME contains any wildcard components;
     otherwise returns '#f'.

 -- procedure: merge-pathnames pathname [defaults [default-version]]
     Returns a pathname whose components are obtained by combining those
     of PATHNAME and DEFAULTS.  DEFAULTS defaults to the value of
     'param:default-pathname-defaults' and DEFAULT-VERSION defaults to
     'newest'.

     The pathnames are combined by components: if PATHNAME has a
     non-missing component, that is the resulting component, otherwise
     the component from DEFAULTS is used.  The default version can be
     '#f' to preserve the information that the component was missing
     from PATHNAME.  The directory component is handled specially: if
     both pathnames have directory components that are lists, and the
     directory component from PATHNAME is relative (i.e. starts with
     'relative'), then the resulting directory component is formed by
     appending PATHNAME's component to DEFAULTS's component.  For
     example:

          (define path1 (->pathname "scheme/foo.scm"))
          (define path2 (->pathname "/usr/morris"))
          path1
               =>  #[pathname 74 "scheme/foo.scm"]
          path2
               =>  #[pathname 75 "/usr/morris"]
          (merge-pathnames path1 path2)
               =>  #[pathname 76 "/usr/scheme/foo.scm"]
          (merge-pathnames path2 path1)
               =>  #[pathname 77 "/usr/morris.scm"]

     The merging rules for the version are more complex and depend on
     whether PATHNAME specifies a name.  If PATHNAME does not specify a
     name, then the version, if not provided, will come from DEFAULTS.
     However, if PATHNAME does specify a name then the version is not
     affected by DEFAULTS.  The reason is that the version "belongs to"
     some other file name and is unlikely to have anything to do with
     the new one.  Finally, if this process leaves the version missing,
     then DEFAULT-VERSION is used.

     The net effect is that if the user supplies just a name, then the
     host, device, directory and type will come from DEFAULTS, but the
     version will come from DEFAULT-VERSION.  If the user supplies
     nothing, or just a directory, the name, type and version will come
     over from DEFAULTS together.

 -- parameter: param:default-pathname-defaults
     The value of this parameter (*note Parameters::) is the default
     pathname-defaults pathname; if any pathname primitive that needs a
     set of defaults is not given one, it uses this one.  Modifying the
     'working-directory-pathname' parameter also changes this parameter
     to the same value, computed by merging the new working directory
     with the parameter's old value.

 -- variable: *default-pathname-defaults*
     This variable is *deprecated*; use
     'param:default-pathname-defaults' instead.

 -- procedure: pathname-default pathname device directory name type
          version
     This procedure defaults all of the components of PATHNAME
     simultaneously.  It could have been defined by:

          (define (pathname-default pathname
                                    device directory name type version)
            (make-pathname (pathname-host pathname)
                           (or (pathname-device pathname) device)
                           (or (pathname-directory pathname) directory)
                           (or (pathname-name pathname) name)
                           (or (pathname-type pathname) type)
                           (or (pathname-version pathname) version)))

 -- procedure: file-namestring pathname
 -- procedure: directory-namestring pathname
 -- procedure: host-namestring pathname
 -- procedure: enough-namestring pathname [defaults]
     These procedures return a string corresponding to a subset of the
     PATHNAME information.  'file-namestring' returns a string
     representing just the NAME, TYPE and VERSION components of
     PATHNAME; the result of 'directory-namestring' represents just the
     HOST, DEVICE, and DIRECTORY components; and 'host-namestring'
     returns a string for just the HOST portion.

     'enough-namestring' takes another argument, DEFAULTS.  It returns
     an abbreviated namestring that is just sufficient to identify the
     file named by PATHNAME when considered relative to the DEFAULTS
     (which defaults to the value of 'param:default-pathname-defaults').

          (file-namestring "/usr/morris/minor.van")
               =>  "minor.van"
          (directory-namestring "/usr/morris/minor.van")
               =>  "/usr/morris/"
          (enough-namestring "/usr/morris/men")
               =>  "men"      ;perhaps

 -- procedure: file-pathname pathname
 -- procedure: directory-pathname pathname
 -- procedure: enough-pathname pathname [defaults]
     These procedures return a pathname corresponding to a subset of the
     PATHNAME information.  'file-pathname' returns a pathname with just
     the NAME, TYPE and VERSION components of PATHNAME.  The result of
     'directory-pathname' is a pathname containing the HOST, DEVICE and
     DIRECTORY components of PATHNAME.

     'enough-pathname' takes another argument, DEFAULTS.  It returns an
     abbreviated pathname that is just sufficient to identify the file
     named by PATHNAME when considered relative to the DEFAULTS (which
     defaults to the value of 'param:default-pathname-defaults').

     These procedures are similar to 'file-namestring',
     'directory-namestring' and 'enough-namestring', but they return
     pathnames instead of strings.

 -- procedure: directory-pathname-as-file pathname
     Returns a pathname that is equivalent to PATHNAME, but in which the
     directory component is represented as a file.  The last directory
     is removed from the directory component and converted into name and
     type components.  This is the inverse operation to
     'pathname-as-directory'.

          (directory-pathname-as-file (->pathname "/usr/blisp/"))
               =>  #[pathname "/usr/blisp"]

 -- procedure: pathname-as-directory pathname
     Returns a pathname that is equivalent to PATHNAME, but in which any
     file components have been converted to a directory component.  If
     PATHNAME does not have name, type, or version components, it is
     returned without modification.  Otherwise, these file components
     are converted into a string, and the string is added to the end of
     the list of directory components.  This is the inverse operation to
     'directory-pathname-as-file'.

          (pathname-as-directory (->pathname "/usr/blisp/rel5"))
               =>  #[pathname "/usr/blisp/rel5/"]


File: mit-scheme-ref.info,  Node: Miscellaneous Pathnames,  Prev: Operations on Pathnames,  Up: Pathnames

15.1.4 Miscellaneous Pathname Procedures
----------------------------------------

This section gives some standard operations on host objects, and some
procedures that return some useful pathnames.

 -- variable: local-host
     This variable has as its value the host object that describes the
     local host's file system.

 -- procedure: host? object
     Returns '#t' if OBJECT is a pathname host; otherwise returns '#f'.

 -- procedure: host=? host1 host2
     Returns '#t' if HOST1 and HOST2 denote the same pathname host;
     otherwise returns '#f'.

 -- procedure: init-file-pathname [host]
     Returns a pathname for the user's initialization file on HOST.  The
     HOST argument defaults to the value of 'local-host'.  If the
     initialization file does not exist this procedure returns '#f'.

     Under unix, the init file is called '.scheme.init'; under Windows,
     the init file is called 'scheme.ini'.  In either case, it is
     located in the user's home directory, which is computed by
     'user-homedir-pathname'.

 -- procedure: user-homedir-pathname [host]
     Returns a pathname for the user's "home directory" on HOST.  The
     HOST argument defaults to the value of 'local-host'.  The concept
     of a "home directory" is itself somewhat implementation-dependent,
     but it should be the place where the user keeps personal files,
     such as initialization files and mail.

     Under unix, the user's home directory is specified by the 'HOME'
     environment variable.  If this variable is undefined, the user name
     is computed using the 'getlogin' system call, or if that fails, the
     'getuid' system call.  The resulting user name is passed to the
     'getpwnam' system call to obtain the home directory.

     Under Windows, several heuristics are tried to find the user's home
     directory.  The user's home directory is computed by examining
     several environment variables, in the following order:

        * 'HOMEDRIVE' and 'HOMEPATH' are both defined and
          '%HOMEDRIVE%%HOMEPATH%' is an existing directory.  (These
          variables are automatically defined by Windows NT.)

        * 'HOME' is defined and '%HOME%' is an existing directory.

        * 'USERDIR' and 'USERNAME' are defined and
          '%USERDIR%\%USERNAME%' is an existing directory.

        * 'USERDIR' and 'USER' are defined and '%USERDIR%\%USER%' is an
          existing directory.

        * 'USERNAME' is defined and '%USERNAME%' is an existing
          directory on the Windows system drive.

        * 'USER' is defined and '%USER%' is an existing directory on the
          Windows system drive.

        * Finally, if all else fails, the Windows system drive is used
          as the home directory.

 -- procedure: system-library-pathname pathname
     Locates PATHNAME in MIT/GNU Scheme's system library directory.  An
     error of type 'condition-type:file-operation-error' is signalled if
     PATHNAME cannot be located on the library search path.

          (system-library-pathname "compiler.com")
            => #[pathname 45 "/usr/local/lib/mit-scheme/compiler.com"]

 -- procedure: system-library-directory-pathname pathname
     Locates the pathname of an MIT/GNU Scheme system library directory.
     An error of type 'condition-type:file-operation-error' is signalled
     if PATHNAME cannot be located on the library search path.

          (system-library-directory-pathname "options")
               => #[pathname 44 "/usr/local/lib/mit-scheme/options/"]


File: mit-scheme-ref.info,  Node: Working Directory,  Next: File Manipulation,  Prev: Pathnames,  Up: Operating-System Interface

15.2 Working Directory
======================

When MIT/GNU Scheme is started, the "current working directory" (or
simply, "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
calling the 'pwd' procedure, and changed by calling the 'cd' procedure.
Each REP loop has its own working directory, and inferior REP loops
initialize their working directory from the value in effect in their
superior at the time they are created.

 -- parameter: working-directory-pathname
 -- parameter: pwd
     Returns the current working directory as a pathname that has no
     name, type, or version components, just host, device, and directory
     components.  'pwd' is an alias for 'working-directory-pathname';
     the long name is intended for programs and the short name for
     interactive use.

     This parameter may be called with an argument to set its value, in
     which case it also modifies the value of
     'param:default-pathname-defaults' by merging the new working
     directory into it.

 -- procedure: set-working-directory-pathname! filename
 -- procedure: cd filename
     This procedure is *deprecated*; instead call
     'working-directory-pathname' with an argument.

     Makes FILENAME the current working directory and returns the new
     current working directory as a pathname.  FILENAME is coerced to a
     pathname using 'pathname-as-directory'.  'cd' is an alias for
     'set-working-directory-pathname!'; the long name is intended for
     programs and the short name for interactive use.

     Additionally, 'set-working-directory-pathname!' modifies the value
     of 'param:default-pathname-defaults' by merging the new working
     directory into it.

     When this procedure is executed in the top-level REP loop, it
     changes the working directory of the running Scheme executable.

          (set-working-directory-pathname! "/usr/morris/blisp")
               =>  #[pathname "/usr/morris/blisp/"]
          (set-working-directory-pathname! "~")
               =>  #[pathname "/usr/morris/"]

     This procedure signals an error if FILENAME does not refer to an
     existing directory.

     If FILENAME describes a relative rather than absolute pathname,
     this procedure interprets it as relative to the current working
     directory, before changing the working directory.

          (working-directory-pathname)
               =>  #[pathname "/usr/morris/"]
          (set-working-directory-pathname! "foo")
               =>  #[pathname "/usr/morris/foo/"]

 -- procedure: with-working-directory-pathname filename thunk
     This procedure is *deprecated*; instead bind
     'working-directory-pathname' using 'parameterize'.

     This procedure dynamically binds the current working directory to
     FILENAME and returns the value of THUNK (a procedure of no
     arguments).  FILENAME is coerced to a pathname using
     'pathname-as-directory'.  In addition to binding the working
     directory, 'with-working-directory-pathname' also dynamically binds
     the 'param:default-pathname-defaults' parameter, merging the old
     value with the new working directory pathname.


File: mit-scheme-ref.info,  Node: File Manipulation,  Next: Directory Reader,  Prev: Working Directory,  Up: Operating-System Interface

15.3 File Manipulation
======================

This section describes procedures that manipulate files and directories.
Any of these procedures can signal a number of errors for many reasons.
The specifics of these errors are much too operating-system dependent to
document here.  However, if such an error is signalled by one of these
procedures, it will be of type 'condition-type:file-operation-error'.

 -- procedure: file-exists? filename
 -- procedure: file-exists-direct? filename
 -- procedure: file-exists-indirect? filename
     These procedures return '#t' if FILENAME is an existing file or
     directory; otherwise they return '#f'.  In operating systems that
     support symbolic links, if the file is a symbolic link,
     'file-exists-direct?' tests for the existence of the link, while
     'file-exists-indirect?' and 'file-exists?' test for the existence
     of the file pointed to by the link.

 -- procedure: copy-file source-filename target-filename
     Makes a copy of the file named by SOURCE-FILENAME.  The copy is
     performed by creating a new file called TARGET-FILENAME, and
     filling it with the same data as SOURCE-FILENAME.

 -- procedure: rename-file source-filename target-filename
     Changes the name of SOURCE-FILENAME to be TARGET-FILENAME.  In the
     unix implementation, this will not rename across file systems.

 -- procedure: delete-file filename
     Deletes the file named FILENAME.

 -- procedure: delete-file-no-errors filename
     Like 'delete-file', but returns a boolean value indicating whether
     an error occurred during the deletion.  If no errors occurred, '#t'
     is returned.  If an error of type 'condition-type:file-error' or
     'condition-type:port-error' is signalled, '#f' is returned.

 -- procedure: hard-link-file source-filename target-filename
     Makes a hard link from SOURCE-FILENAME to TARGET-FILENAME.  This
     operation gives the file specified by SOURCE-FILENAME a new name,
     in addition to the old name.

     This currently works only on unix systems.  It is further
     restricted to work only when SOURCE-FILENAME and TARGET-FILENAME
     refer to names in the same file system.

 -- procedure: soft-link-file source-filename target-filename
     Creates a new soft link called TARGET-FILENAME that points at the
     file SOURCE-FILENAME.  (Soft links are also sometimes called
     "symbolic" links.)  Note that SOURCE-FILENAME will be interpreted
     as a string (although you may specify it as a pathname object, if
     you wish).  The contents of this string will be stored in the file
     system as the soft link.  When a file operation attempts to open
     the link, the contents of the link are interpreted relative to the
     link's location at that time.

     This currently works only on unix systems.

 -- procedure: make-directory filename
     Creates a new directory named FILENAME.  Signals an error if
     FILENAME already exists, or if the directory cannot be created.

 -- procedure: delete-directory filename
     Deletes the directory named FILENAME.  Signals an error if the
     directory does not exist, is not a directory, or contains any files
     or subdirectories.

 -- procedure: ->truename filename
     This procedure attempts to discover and return the "true name" of
     the file associated with FILENAME within the file system.  An error
     of type 'condition-type:file-operation-error' is signalled if the
     appropriate file cannot be located within the file system.

 -- procedure: call-with-temporary-file-pathname procedure
     Calls 'temporary-file-pathname' to create a temporary file, then
     calls PROCEDURE with one argument, the pathname referring to that
     file.  When PROCEDURE returns, if the temporary file still exists,
     it is deleted; then, the value yielded by PROCEDURE is returned.
     If PROCEDURE escapes from its continuation, and the file still
     exists, it is deleted.

 -- procedure: temporary-file-pathname [directory]
     Creates a new empty temporary file and returns a pathname referring
     to it.  The temporary file is created with Scheme's default
     permissions, so barring unusual circumstances it can be opened for
     input and/or output without error.  The temporary file will remain
     in existence until explicitly deleted.  If the file still exists
     when the Scheme process terminates, it will be deleted.

     If DIRECTORY is specified, the temporary file will be stored there.
     If it is not specified, or if it is '#f', the temporary file will
     be stored in the directory returned by
     'temporary-directory-pathname'.

 -- procedure: temporary-directory-pathname
     Returns the pathname of an existing directory that can be used to
     store temporary files.  These directory names are tried, in order,
     until a writeable directory is found:

        * The directories specified by the environment variables
          'TMPDIR', 'TEMP', or 'TMP'.

        * Under unix, the directories '/var/tmp', '/usr/tmp', or '/tmp'.

        * Under Windows, the following directories on the system drive:
          '\temp', '\tmp', or '\'.

        * Under Windows, the current directory, as specified by
          'param:default-pathname-defaults'.

 -- procedure: file-directory? filename
     Returns '#t' if the file named FILENAME exists and is a directory.
     Otherwise returns '#f'.  In operating systems that support symbolic
     links, if FILENAME names a symbolic link, this examines the file
     linked to, not the link itself.

     This is equivalent to

          (eq? 'directory (file-type-indirect FILENAME))

 -- procedure: file-regular? filename
     Returns '#t' if the file named FILENAME exists and is a regular
     file (i.e. not a directory, symbolic link, device file, etc.).
     Otherwise returns '#f'.  In operating systems that support symbolic
     links, if FILENAME names a symbolic link, this examines the file
     linked to, not the link itself.

     This is equivalent to

          (eq? 'regular (file-type-indirect FILENAME))

 -- procedure: file-symbolic-link? filename
     In operating systems that support symbolic links, if the file named
     FILENAME exists and is a symbolic link, this procedure returns the
     contents of the symbolic link as a newly allocated string.  The
     returned value is the name of the file that the symbolic link
     points to and must be interpreted relative to the directory of
     FILENAME.  If FILENAME either does not exist or is not a symbolic
     link, or if the operating system does not support symbolic links,
     this procedure returns '#f'.

 -- procedure: file-type-direct filename
 -- procedure: file-type-indirect filename
     If the file named FILENAME exists, 'file-type-direct' returns a
     symbol specifying what type of file it is.  For example, if
     FILENAME refers to a directory, the symbol 'directory' is returned.
     If FILENAME doesn't refer to an existing file, '#f' is returned.

     If FILENAME refers to a symbolic link, 'file-type-direct' returns
     the type of the link itself, while 'file-type-indirect' returns the
     type of the file linked to.

     At this time, the symbols that can be returned are the following.
     The names are intended to be self-explanatory.  Most of these names
     can only be returned on particular operating systems, and so the
     operating-system name is prefixed to the name.

          regular
          directory
          unix-symbolic-link
          unix-character-device
          unix-block-device
          unix-named-pipe
          unix-socket
          win32-named-pipe

 -- procedure: file-readable? filename
     Returns '#t' if FILENAME names a file that can be opened for input;
     i.e. a "readable" file.  Otherwise returns '#f'.

 -- procedure: file-writeable? filename
     Returns '#t' if FILENAME names a file that can be opened for
     output; i.e. a "writeable" file.  Otherwise returns '#f'.

 -- procedure: file-executable? filename
     Returns '#t' if FILENAME names a file that can be executed.
     Otherwise returns '#f'.  Under unix, an executable file is
     identified by its mode bits.  Under Windows, an executable file has
     one of the file extensions '.exe', '.com', or '.bat'.

 -- procedure: file-access filename mode
     MODE must be an exact integer between '0' and '7' inclusive; it is
     a bitwise-encoded predicate selector with '1' meaning "executable",
     '2' meaning "writeable", and '4' meaning "readable".  'file-access'
     returns '#t' if FILENAME exists and satisfies the predicates
     selected by MODE.  For example, if MODE is '5', then FILENAME must
     be both readable and executable.  If FILENAME doesn't exist, or if
     it does not satisfy the selected predicates, '#f' is returned.

 -- procedure: file-eq? filename1 filename2
     Determines whether FILENAME1 and FILENAME2 refer to the same file.
     Under unix, this is done by comparing the inodes and devices of the
     two files.  Under Windows, this is done by comparing the filename
     strings.

 -- procedure: file-modes filename
     If FILENAME names an existing file, 'file-modes' returns an exact
     non-negative integer encoding the file's permissions.  The encoding
     of this integer is operating-system dependent.  Under unix, it is
     the least-significant 12 bits of the 'st_mode' element of the
     'struct stat' structure.  Under Windows, it is the file attribute
     bits, which are described below.  If FILENAME does not name an
     existing file, '#f' is returned.

 -- procedure: set-file-modes! filename modes
     FILENAME must name an existing file.  MODES must be an exact
     non-negative integer that could have been returned by a call to
     'file-modes'.  'set-file-modes!' modifies the file's permissions to
     be those encoded by MODES.

 -- variable: nt-file-mode/read-only
 -- variable: nt-file-mode/hidden
 -- variable: nt-file-mode/system
 -- variable: nt-file-mode/directory
 -- variable: nt-file-mode/archive
 -- variable: nt-file-mode/normal
 -- variable: nt-file-mode/temporary
 -- variable: nt-file-mode/compressed
     The values of these variables are the "mode bits" that comprise the
     value returned by 'file-modes' under Windows.  These bits are small
     integers that are combined by adding to form a complete set of
     modes.  The integer zero represents a set of modes in which none of
     these bits are set.

 -- procedure: file-modification-time filename
     Returns the modification time of FILENAME as an exact non-negative
     integer.  The result may be compared to other file times using
     ordinary integer arithmetic.  If FILENAME names a file that does
     not exist, 'file-modification-time' returns '#f'.

     In operating systems that support symbolic links, if FILENAME names
     a symbolic link, 'file-modification-time' returns the modification
     time of the file linked to.  An alternate procedure,
     'file-modification-time-direct', returns the modification time of
     the link itself; in all other respects it is identical to
     'file-modification-time'.  For symmetry,
     'file-modification-time-indirect' is a synonym of
     'file-modification-time'.

 -- procedure: file-access-time filename
     Returns the access time of FILENAME as an exact non-negative
     integer.  The result may be compared to other file times using
     ordinary integer arithmetic.  If FILENAME names a file that does
     not exist, 'file-access-time' returns '#f'.

     In operating systems that support symbolic links, if FILENAME names
     a symbolic link, 'file-access-time' returns the access time of the
     file linked to.  An alternate procedure, 'file-access-time-direct',
     returns the access time of the link itself; in all other respects
     it is identical to 'file-access-time'.  For symmetry,
     'file-access-time-indirect' is a synonym of 'file-access-time'.

 -- procedure: set-file-times! filename access-time modification-time
     FILENAME must name an existing file, while ACCESS-TIME and
     MODIFICATION-TIME must be valid file times that might have been
     returned by 'file-access-time' and 'file-modification-time',
     respectively.  'set-file-times!' alters the access and modification
     times of the file specified by FILENAME to the values given by
     ACCESS-TIME and MODIFICATION-TIME, respectively.  For convenience,
     either of the time arguments may be specified as '#f'; in this case
     the corresponding time is not changed.  'set-file-times!' returns
     an unspecified value.

 -- procedure: current-file-time
     Returns the current time as an exact non-negative integer, in the
     same format used by the above file-time procedures.  This number
     can be compared to other file times using ordinary arithmetic
     operations.

 -- procedure: file-touch filename
     "Touches" the file named FILENAME.  If the file already exists, its
     modification time is set to the current file time and '#f' is
     returned.  Otherwise, the file is created and '#t' is returned.
     This is an atomic test-and-set operation, so it is useful as a
     synchronization mechanism.

 -- procedure: file-length filename
     Returns the length, in bytes, of the file named FILENAME as an
     exact non-negative integer.

 -- procedure: file-attributes filename
     This procedure determines if the file named FILENAME exists, and
     returns information about it if so; if the file does not exist, it
     returns '#f'.

     In operating systems that support symbolic links, if FILENAME names
     a symbolic link, 'file-attributes' returns the attributes of the
     link itself.  An alternate procedure, 'file-attributes-indirect',
     returns the attributes of the file linked to; in all other respects
     it is identical to 'file-attributes'.  For symmetry,
     'file-attributes-direct' is a synonym of 'file-attributes'.

   The information returned by 'file-attributes' is decoded by accessor
procedures.  The following accessors are defined in all operating
systems:

 -- procedure: file-attributes/type attributes
     The file type: '#t' if the file is a directory, a character string
     (the name linked to) if a symbolic link, or '#f' for all other
     types of file.

 -- procedure: file-attributes/access-time attributes
     The last access time of the file, an exact non-negative integer.

 -- procedure: file-attributes/modification-time attributes
     The last modification time of the file, an exact non-negative
     integer.

 -- procedure: file-attributes/change-time attributes
     The last change time of the file, an exact non-negative integer.

 -- procedure: file-attributes/length attributes
     The length of the file in bytes.

 -- procedure: file-attributes/mode-string attributes
     The mode string of the file, a newly allocated string showing the
     file's mode bits.  Under unix, this string is in unix format.
     Under Windows, this string shows the standard "DOS" attributes in
     their usual format.

 -- procedure: file-attributes/n-links attributes
     The number of links to the file, an exact positive integer.  Under
     Windows, this is always '1'.

   The following additional accessors are defined under unix:

 -- procedure: file-attributes/uid attributes
     The user id of the file's owner, an exact non-negative integer.

 -- procedure: file-attributes/gid attributes
     The group id of the file's group, an exact non-negative integer.

 -- procedure: file-attributes/inode-number attributes
     The inode number of the file, an exact non-negative integer.

   The following additional accessor is defined under Windows:

 -- procedure: file-attributes/modes attributes
     The attribute bits of the file.  This is an exact non-negative
     integer containing the file's attribute bits, exactly as specified
     by the operating system's API.


File: mit-scheme-ref.info,  Node: Directory Reader,  Next: Date and Time,  Prev: File Manipulation,  Up: Operating-System Interface

15.4 Directory Reader
=====================

 -- procedure: directory-read directory [sort?]
     DIRECTORY must be an object that can be converted into a pathname
     by
     '->pathname'.  The directory specified by DIRECTORY is read, and
     the contents of the directory is returned as a newly allocated list
     of absolute pathnames.  The result is sorted according to the usual
     sorting conventions for directories, unless SORT? is specified as
     '#f'.  If DIRECTORY has name, type, or version components, the
     returned list contains only those pathnames whose name, type, and
     version components match those of DIRECTORY; 'wild' or '#f' as one
     of these components means "match anything".

     The Windows implementation supports "globbing", in which the
     characters '*' and '?' are interpreted to mean "match anything" and
     "match any character", respectively.  This "globbing" is supported
     only in the file part of DIRECTORY.


File: mit-scheme-ref.info,  Node: Date and Time,  Next: Machine Time,  Prev: Directory Reader,  Up: Operating-System Interface

15.5 Date and Time
==================

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.

   The primary time representation, "universal time", is an exact
non-negative integer counting the number of seconds that have elapsed
since midnight January 1, 1900 UTC. (UTC stands for "Coordinated
Universal Time", and is the modern name for Greenwich Mean Time.)  This
format is produced by 'get-universal-time' and
'decoded-time->universal-time'.

   The second representation, "decoded time", is a record structure in
which the time is broken down into components, such as month, minute,
etc.  Decoded time is always relative to a particular time zone, which
is a component of the structure.  This format is produced by
'global-decoded-time' and 'local-decoded-time'.

   The third representation, "file time", is an exact non-negative
integer that is larger for increasing time.  Unlike universal time, this
representation is operating-system dependent.  This format is produced
by all of the file-attribute procedures, for example
'file-modification-time' and 'file-attributes'.

   The fourth representation, the "time string", is an external
representation for time.  This format is defined by RFC-822, 'Standard
for the format of ARPA Internet text messages', with the modification
that years are represented as four-digit numbers rather than two-digit
numbers.  This format is the standard format for Internet email and
numerous other network protocols.

   Within this section, argument variables named UNIVERSAL-TIME,
DECODED-TIME, FILE-TIME, and TIME-STRING are respectively required to be
of the corresponding format.

* Menu:

* Universal Time::
* Decoded Time::
* File Time::
* Time-Format Conversion::
* External Representation of Time::


File: mit-scheme-ref.info,  Node: Universal Time,  Next: Decoded Time,  Prev: Date and Time,  Up: Date and Time

15.5.1 Universal Time
---------------------

 -- procedure: get-universal-time
     Return the current time in universal format.

          (get-universal-time) => 3131453078

 -- variable: epoch
     'epoch' is the representation of midnight January 1, 1970 UTC in
     universal-time format.

          epoch => 2208988800


File: mit-scheme-ref.info,  Node: Decoded Time,  Next: File Time,  Prev: Universal Time,  Up: Date and Time

15.5.2 Decoded Time
-------------------

Objects representing standard time components, such as seconds and
minutes, are required to be exact non-negative integers.  Seconds and
minutes must be inclusively between '0' and '59'; hours between '0' and
'23'; days between '1' and '31'; months between '1' and '12'; years are
represented in "four-digit" form, in which 1999 is represented as '1999'
-- _not_ '99'.

 -- procedure: local-decoded-time
     Return the current time in decoded format.  The decoded time is
     represented in the local time zone.

          (pp (local-decoded-time))
          -| #[decoded-time 76]
          -| (second 2)
          -| (minute 12)
          -| (hour 11)
          -| (day 27)
          -| (month 4)
          -| (year 1999)
          -| (day-of-week 1)
          -| (daylight-savings-time 1)
          -| (zone 5)

 -- procedure: global-decoded-time
     Return the current time in decoded format.  The decoded time is
     represented in UTC.

          (pp (global-decoded-time))
          -| #[decoded-time 77]
          -| (second 8)
          -| (minute 12)
          -| (hour 15)
          -| (day 27)
          -| (month 4)
          -| (year 1999)
          -| (day-of-week 1)
          -| (daylight-savings-time 0)
          -| (zone 0)

 -- procedure: make-decoded-time second minute hour day month year
          [zone]
     Return a new decoded-time object representing the given time.  The
     arguments must be valid components according to the above rules,
     and must form a valid date.

     If ZONE is not supplied or is '#f', the resulting decoded time will
     be represented in the local time zone.  Otherwise, ZONE must be a
     valid time zone, and the result will be represented in that zone.

     *Warning*: because this procedure depends on the operating system's
     runtime library, it is not capable of representing all dates.  In
     particular, on most unix systems, it is not possible to encode
     dates that occur prior to midnight, January 1, 1970 UTC. Attempting
     to do this will signal an error.

          (pp (make-decoded-time 0 9 11 26 3 1999))
          -| #[decoded-time 19]
          -| (second 0)
          -| (minute 9)
          -| (hour 11)
          -| (day 26)
          -| (month 3)
          -| (year 1999)
          -| (day-of-week 4)
          -| (daylight-savings-time 0)
          -| (zone 5)

          (pp (make-decoded-time 0 9 11 26 3 1999 3))
          -| #[decoded-time 80]
          -| (second 0)
          -| (minute 9)
          -| (hour 11)
          -| (day 26)
          -| (month 3)
          -| (year 1999)
          -| (day-of-week 4)
          -| (daylight-savings-time 0)
          -| (zone 3)

 -- procedure: decoded-time/second decoded-time
 -- procedure: decoded-time/minute decoded-time
 -- procedure: decoded-time/hour decoded-time
 -- procedure: decoded-time/day decoded-time
 -- procedure: decoded-time/month decoded-time
 -- procedure: decoded-time/year decoded-time
     Return the corresponding component of DECODED-TIME.

          (decoded-time/second (local-decoded-time)) => 17
          (decoded-time/year (local-decoded-time)) => 1999
          (decoded-time/day (local-decoded-time)) => 26

 -- procedure: decoded-time/day-of-week decoded-time
     Return the day of the week on which DECODED-TIME falls, encoded as
     an exact integer between '0' (Monday) and '6' (Sunday), inclusive.

          (decoded-time/day-of-week (local-decoded-time)) => 4

 -- procedure: decoded-time/daylight-savings-time? decoded-time
     Return '#t' if DECODED-TIME is represented using daylight savings
     time.  Otherwise return '#f'.

          (decoded-time/daylight-savings-time? (local-decoded-time))
                            => #f

 -- procedure: decoded-time/zone decoded-time
     Return the time zone in which DECODED-TIME is represented.  This is
     an exact rational number between '-24' and '+24' inclusive, that
     when multiplied by '3600' is an integer.  The value is the number
     of hours west of UTC.

          (decoded-time/zone (local-decoded-time)) => 5

 -- procedure: time-zone? object
     Returns '#t' if OBJECT is an exact number between '-24' and '+24'
     inclusive, that when multiplied by '3600' is an integer.

          (time-zone? -5)   => #t
          (time-zone? 11/2) => #t
          (time-zone? 11/7) => #f

 -- procedure: month/max-days month
     Returns the maximum number of days possible in MONTH.  MONTH must
     be an exact integer between '1' and '12' inclusive.

          (month/max-days 2) => 29
          (month/max-days 3) => 31
          (month/max-days 4) => 30


File: mit-scheme-ref.info,  Node: File Time,  Next: Time-Format Conversion,  Prev: Decoded Time,  Up: Date and Time

15.5.3 File Time
----------------

As stated above, file time is operating-system dependent.  As of this
writing, two formats are used.  For unix and Windows systems, file time
is the number of seconds since midnight January 1, 1970 UTC (the
standard unix time convention).

   The following procedures generate their results in file-time format:

     file-access-time
     file-access-time-direct
     file-access-time-indirect
     file-modification-time
     file-modification-time-direct
     file-modification-time-indirect
     file-attributes/access-time
     file-attributes/modification-time
     file-attributes/change-time

Additionally, 'set-file-times!' accepts its time arguments in file-time
format.


File: mit-scheme-ref.info,  Node: Time-Format Conversion,  Next: External Representation of Time,  Prev: File Time,  Up: Date and Time

15.5.4 Time-Format Conversion
-----------------------------

The procedures described in this section convert times from one format
to another.

 -- procedure: universal-time->local-decoded-time universal-time
 -- procedure: universal-time->global-decoded-time universal-time
     Converts an argument in universal-time format to decoded-time
     format.  The result is in the local time zone or UTC, respectively.

          (pp (universal-time->local-decoded-time (get-universal-time)))
          -| #[decoded-time 21]
          -| (second 23)
          -| (minute 57)
          -| (hour 17)
          -| (day 29)
          -| (month 4)
          -| (year 1999)
          -| (day-of-week 3)
          -| (daylight-savings-time 1)
          -| (zone 5)

          (pp (universal-time->global-decoded-time
               (get-universal-time)))
          -| #[decoded-time 22]
          -| (second 27)
          -| (minute 57)
          -| (hour 21)
          -| (day 29)
          -| (month 4)
          -| (year 1999)
          -| (day-of-week 3)
          -| (daylight-savings-time 0)
          -| (zone 0)

 -- procedure: universal-time->file-time universal-time
     Converts an argument in universal-time format to file-time format.

          (universal-time->file-time (get-universal-time))
              => 925422988

 -- procedure: universal-time->local-time-string universal-time
 -- procedure: universal-time->global-time-string universal-time
     Converts an argument in universal-time format to a time string.
     The result is in the local time zone or UTC, respectively.

          (universal-time->local-time-string (get-universal-time))
              => "Thu, 29 Apr 1999 17:55:31 -0400"
          (universal-time->global-time-string (get-universal-time))
              => "Thu, 29 Apr 1999 21:55:51 +0000"

 -- procedure: decoded-time->universal-time decoded-time
     Converts an argument in decoded-time format to universal-time
     format.

          (decoded-time->universal-time (local-decoded-time))
              => 3134411942
          (decoded-time->universal-time (global-decoded-time))
              => 3134411947

 -- procedure: decoded-time->file-time decoded-time
     Converts an argument in decoded-time format to file-time format.

          (decoded-time->file-time (local-decoded-time))
              => 925423191
          (decoded-time->file-time (global-decoded-time))
              => 925423195

 -- procedure: decoded-time->string decoded-time
     Convert an argument in decoded-time format to a time string.

          (decoded-time->string (local-decoded-time))
              => "Thu, 29 Apr 1999 18:00:43 -0400"
          (decoded-time->string (global-decoded-time))
              => "Thu, 29 Apr 1999 22:00:46 +0000"

 -- procedure: file-time->universal-time file-time
     Converts an argument in universal-time format to file-time format.

          (file-time->universal-time (file-modification-time "/"))
              => 3133891907

 -- procedure: file-time->local-decoded-time file-time
 -- procedure: file-time->global-decoded-time file-time
     Converts an argument in file-time format to decoded-time format.
     The result is in the local time zone or UTC, respectively.

          (pp (file-time->local-decoded-time
               (file-modification-time "/")))
          -| #[decoded-time 26]
          -| (second 47)
          -| (minute 31)
          -| (hour 17)
          -| (day 23)
          -| (month 4)
          -| (year 1999)
          -| (day-of-week 4)
          -| (daylight-savings-time 1)
          -| (zone 5)

          (pp (file-time->global-decoded-time
               (file-modification-time "/")))
          -| #[decoded-time 27]
          -| (second 47)
          -| (minute 31)
          -| (hour 21)
          -| (day 23)
          -| (month 4)
          -| (year 1999)
          -| (day-of-week 4)
          -| (daylight-savings-time 0)
          -| (zone 0)

 -- procedure: file-time->local-time-string file-time
 -- procedure: file-time->global-time-string file-time
     Converts an argument in file-time format to a time string.  The
     result is in the local time zone or UTC, respectively.

          (file-time->local-time-string (file-modification-time "/"))
              => "Fri, 23 Apr 1999 17:31:47 -0400"
          (file-time->global-time-string (file-modification-time "/"))
              => "Fri, 23 Apr 1999 21:31:47 +0000"

 -- procedure: string->universal-time time-string
     Converts a time-string argument to universal-time format.

          (string->universal-time "Fri, 23 Apr 1999 21:31:47 +0000")
              => 3133888307
          (string->universal-time "Fri, 23 Apr 1999 17:31:47 -0400")
              => 3133888307

 -- procedure: string->decoded-time time-string
     Converts a time-string argument to decoded-time format.

          (pp (string->decoded-time "Fri, 23 Apr 1999 17:31:47 -0400"))
          -| #[decoded-time 30]
          -| (second 47)
          -| (minute 31)
          -| (hour 17)
          -| (day 23)
          -| (month 4)
          -| (year 1999)
          -| (day-of-week 4)
          -| (daylight-savings-time 0)
          -| (zone 4)

 -- procedure: string->file-time time-string
     Converts a time-string argument to file-time format.

          (string->file-time "Fri, 23 Apr 1999 17:31:47 -0400")
              => 924899507


File: mit-scheme-ref.info,  Node: External Representation of Time,  Prev: Time-Format Conversion,  Up: Date and Time

15.5.5 External Representation of Time
--------------------------------------

The normal external representation for time is the time string, as
described above.  The procedures in this section generate alternate
external representations of time which are more verbose and may be more
suitable for presentation to human readers.

 -- procedure: decoded-time/date-string decoded-time
 -- procedure: decoded-time/time-string decoded-time
     These procedures return strings containing external representations
     of the date and time, respectively, represented by DECODED-TIME.
     The results are implicitly in local time.

          (decoded-time/date-string (local-decoded-time))
              => "Tuesday March 30, 1999"
          (decoded-time/time-string (local-decoded-time))
              => "11:22:38 AM"

 -- procedure: day-of-week/long-string day-of-week
 -- procedure: day-of-week/short-string day-of-week
     Returns a string representing the given DAY-OF-WEEK.  The argument
     must be an exact non-negative integer between '0' and '6'
     inclusive.  'day-of-week/long-string' returns a long string that
     fully spells out the name of the day.  'day-of-week/short-string'
     returns a shortened string that abbreviates the day to three
     letters.

          (day-of-week/long-string 0)  => "Monday"
          (day-of-week/short-string 0) => "Mon"
          (day-of-week/short-string 3) => "Thu"

 -- procedure: month/long-string month
 -- procedure: month/short-string month
     Returns a string representing the given MONTH.  The argument must
     be an exact non-negative integer between '1' and '12' inclusive.
     'month/long-string' returns a long string that fully spells out the
     name of the month.  'month/short-string' returns a shortened string
     that abbreviates the month to three letters.

          (month/long-string 1)   => "January"
          (month/short-string 1)  => "Jan"
          (month/short-string 10) => "Oct"

 -- procedure: time-zone->string
     Returns a string corresponding to the given time zone.  This string
     is the same string that is used to generate RFC-822 time strings.

          (time-zone->string 5)    => "-0500"
          (time-zone->string -4)   => "+0400"
          (time-zone->string 11/2) => "-0530"


File: mit-scheme-ref.info,  Node: Machine Time,  Next: Subprocesses,  Prev: Date and Time,  Up: Operating-System Interface

15.6 Machine Time
=================

The previous section dealt with procedures that manipulate clock time.
This section describes procedures that deal with computer time: elapsed
CPU time, elapsed real time, and so forth.  These procedures are useful
for measuring the amount of time it takes to execute code.

   Some of the procedures in this section manipulate a time
representation called "ticks".  A tick is a unit of time that is
unspecified here but can be converted to and from seconds by supplied
procedures.  A count in ticks is represented as an exact integer.  At
present each tick is one millisecond, but this may change in the future.

 -- procedure: process-time-clock
     Returns the amount of process time, in ticks, that has elapsed
     since Scheme was started.  Process time is measured by the
     operating system and is time during which the Scheme process is
     computing.  It does not include time in system calls, but depending
     on the operating system it may include time used by subprocesses.

          (process-time-clock) => 21290

 -- procedure: real-time-clock
     Returns the amount of real time, in ticks, that has elapsed since
     Scheme was started.  Real time is the time measured by an ordinary
     clock.

          (real-time-clock) => 33474836

 -- procedure: internal-time/ticks->seconds ticks
     Returns the number of seconds corresponding to TICKS.  The result
     is always a real number.

          (internal-time/ticks->seconds 21290) => 21.29
          (internal-time/ticks->seconds 33474836) => 33474.836

 -- procedure: internal-time/seconds->ticks seconds
     Returns the number of ticks corresponding to SECONDS.  SECONDS must
     be a real number.

          (internal-time/seconds->ticks 20.88) => 20880
          (internal-time/seconds->ticks 20.83) => 20830

 -- procedure: system-clock
     Returns the amount of process time, in seconds, that has elapsed
     since Scheme was started.  Roughly equivalent to:

          (internal-time/ticks->seconds (process-time-clock))

     Example:

          (system-clock) => 20.88

 -- procedure: runtime
     Returns the amount of process time, in seconds, that has elapsed
     since Scheme was started.  However, it does not include time spent
     in garbage collection.

          (runtime) => 20.83

 -- procedure: with-timings thunk receiver
     Calls THUNK with no arguments.  After THUNK returns, RECEIVER is
     called with three arguments describing the time spent while
     computing THUNK: the elapsed run time, the amount of time spent in
     the garbage collector, and the elapsed real time.  All three times
     are in ticks.

     This procedure is most useful for doing performance measurements,
     and is designed to have relatively low overhead.

          (with-timings
           (lambda () ... hairy computation ...)
           (lambda (run-time gc-time real-time)
             (write (internal-time/ticks->seconds run-time))
             (write-char #\space)
             (write (internal-time/ticks->seconds gc-time))
             (write-char #\space)
             (write (internal-time/ticks->seconds real-time))
             (newline)))

 -- procedure: measure-interval runtime? procedure
     Calls PROCEDURE, passing it the current process time, in seconds,
     as an argument.  The result of this call must be another procedure.
     When PROCEDURE returns, the resulting procedure is tail-recursively
     called with the ending time, in seconds, as an argument.

     If RUNTIME? is '#f', the elapsed time is deducted from the elapsed
     system time returned by 'runtime'.

     While this procedure can be used for time measurement, its
     interface is somewhat clumsy for that purpose.  We recommend that
     you use 'with-timings' instead, because it is more convenient and
     has lower overhead.

          (measure-interval #t
                            (lambda (start-time)
                              (let ((v ... hairy computation ...))
                                (lambda (end-time)
                                  (write (- end-time start-time))
                                  (newline)
                                  v))))


File: mit-scheme-ref.info,  Node: Subprocesses,  Next: TCP Sockets,  Prev: Machine Time,  Up: Operating-System Interface

15.7 Subprocesses
=================

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 it to completion in a single call.  Subprocesses that are
run in the latter fashion are referred to as "synchronous", because they
are started and stopped in synchrony with a Scheme procedure call.

   This chapter documents Scheme's high-level synchronous-subprocess
support.  The low-level support is not documented but is available for
those who are willing to read the source code.

   Synchronous-subprocess support is a run-time-loadable option.  To use
it, execute

     (load-option 'synchronous-subprocess)

once before calling it.

* Menu:

* Subprocess Procedures::
* Subprocess Conditions::
* Subprocess Options::


File: mit-scheme-ref.info,  Node: Subprocess Procedures,  Next: Subprocess Conditions,  Prev: Subprocesses,  Up: Subprocesses

15.7.1 Subprocess Procedures
----------------------------

There are two commands for running synchronous subprocesses under
Scheme.  'run-shell-command' is very simple to use, provides access to
all shell features, and is to be preferred in most situations.
'run-synchronous-subprocess' allows direct execution of a program and
precise control of the command-line arguments passed to the program, but
does not provide file globbing, I/O redirection, or other shell
features.

 -- procedure: run-shell-command command option ...
     Runs COMMAND, which must be a string.  COMMAND is passed to a
     command shell for interpretation; how the shell is chosen is
     detailed below.

     The OPTIONs are a sequence of keyword/value pairs that specify
     optional behavior.  *Note Subprocess Options::.

     'run-shell-command' waits until the subprocess completes its
     execution and returns the exit code from the subprocess.  If the
     subprocess is killed or stopped, an error is signalled and the
     procedure does not return.

 -- procedure: run-synchronous-subprocess program arguments option ...
     Runs PROGRAM, passing it the given command-line ARGUMENTS.  PROGRAM
     must be either the name of a program on the path, or else a
     pathname to a specific program.  ARGUMENTS must be a list of
     strings; each string is a single command-line argument to the
     program.

     The OPTIONs are a sequence of keyword/value pairs that specify
     optional behavior.  *Note Subprocess Options::.

     'run-synchronous-subprocess' waits until the subprocess completes
     its execution and returns the exit code from the subprocess.  If
     the subprocess is killed or stopped, an error is signalled and the
     procedure does not return.


File: mit-scheme-ref.info,  Node: Subprocess Conditions,  Next: Subprocess Options,  Prev: Subprocess Procedures,  Up: Subprocesses

15.7.2 Subprocess Conditions
----------------------------

If a subprocess spawned by one of the above procedures is killed or
suspended, then one of the following errors will be signalled.

 -- condition type: condition-type:subprocess-signalled subprocess
          reason
     This condition type is a subtype of
     'condition-type:subprocess-abnormal-termination'.  It is signalled
     when the subprocess is killed.

     SUBPROCESS is an object that represents the subprocess involved.
     The internals of this object can be accessed but the interface is
     not documented at this time; see the source code for details.

     REASON is interesting only on unix systems, where it is the signal
     that killed the process.  On other systems it has a fixed value
     that conveys no useful information.

 -- condition type: condition-type:subprocess-stopped subprocess reason
     This condition type is a subtype of
     'condition-type:subprocess-abnormal-termination'.  It is signalled
     when the subprocess is stopped or suspended.

     SUBPROCESS is an object that represents the subprocess involved.
     The internals of this object can be accessed but the interface is
     not documented at this time; see the source code for details.

     REASON is interesting only on unix systems, where it is the signal
     that stopped the process.  On other systems it has a fixed value
     that conveys no useful information.

 -- condition type: condition-type:subprocess-abnormal-termination
          subprocess reason
     This condition type is a subtype of 'condition-type:error'.  This
     is an abstract type that is never signalled.  It is provided so
     that condition handlers can be bound to it.


File: mit-scheme-ref.info,  Node: Subprocess Options,  Prev: Subprocess Conditions,  Up: Subprocesses

15.7.3 Subprocess Options
-------------------------

The following subprocess options may be passed to 'run-shell-command' or
'run-synchronous-subprocess'.  These options are passed as alternating
keyword/value pairs, for example:

     (run-shell-command "ls /"
                        'output my-output-port
                        'output-buffer-size 8192)

The example shows a shell command being run with two options specified:
'output' and 'output-buffer-size'.

 -- subprocess option: input port
     Specifies the standard input of the subprocess.  PORT may be an
     input port, in which case characters are read from PORT and fed to
     the subprocess until PORT reaches end-of-file.  Alternatively, PORT
     may be '#f', indicating that the subprocess has no standard input.

     The default value of this option is '#f'.

          (call-with-input-file "foo.in"
            (lambda (port)
              (run-shell-command "cat > /dev/null" 'input port)))

 -- subprocess option: input-line-translation line-ending
     Specifies how line-endings should be translated when writing
     characters to the subprocess.  Ignored if the 'input' option is
     '#f'.  LINE-ENDING must be either a string specifying the line
     ending, or the symbol 'default', meaning to use the operating
     system's standard line ending.  In either case, newline characters
     to be written to the 'input' port are translated to the specified
     line ending before being written.

     The default value of this option is 'default'.

          (call-with-input-file "foo.in"
            (lambda (port)
              (run-shell-command "cat > /dev/null"
                                 'input port
                                 'input-line-translation "\r\n")))

 -- subprocess option: input-buffer-size n
     Specifies the size of the input buffer for the standard input of
     the subprocess.  (This is the buffer on the Scheme side, and has
     nothing to do with any buffering done on the subprocess side.)
     Ignored if the 'input' option is '#f'.  N must be an exact positive
     integer specifying the number of characters the buffer can hold.

     The default value of this option is '512'.

          (call-with-input-file "foo.in"
            (lambda (port)
              (run-shell-command "cat > /dev/null"
                                 'input port
                                 'input-buffer-size 4096)))

 -- subprocess option: output port
     Specifies the standard output and standard error of the subprocess.
     PORT may be an output port, in which case characters are read from
     the subprocess and fed to PORT until the subprocess finishes.
     Alternatively, PORT may be '#f', indicating that the subprocess has
     no standard output or standard error.

     The default value of this option is the value of
     '(current-output-port)'.

          (call-with-output-file "foo.out"
            (lambda (port)
              (run-shell-command "ls -la /etc" 'output port)))

 -- subprocess option: output-line-translation line-ending
     Specifies how line-endings should be translated when reading
     characters from the standard output of the subprocess.  Ignored if
     the 'output' option is '#f'.  LINE-ENDING must be either a string
     specifying the line ending, or the symbol 'default', meaning to use
     the operating system's standard line ending.  In either case,
     newline characters read from the subprocess port are translated to
     the specified line ending.

     The default value of this option is 'default'.

          (call-with-output-file "foo.out"
            (lambda (port)
              (run-shell-command "ls -la /etc"
                                 'output port
                                 'output-line-translation "\r\n")))

 -- subprocess option: output-buffer-size n
     Specifies the size of the output buffer for the standard output of
     the subprocess.  (This is the buffer on the Scheme side, and has
     nothing to do with any buffering done on the subprocess side.)
     Ignored if the 'output' option is '#f'.  N must be an exact
     positive integer specifying the number of characters the buffer can
     hold.

     The default value of this option is '512'.

          (call-with-output-file "foo.out"
            (lambda (port)
              (run-shell-command "ls -la /etc"
                                 'output port
                                 'output-buffer-size 4096)))

 -- subprocess option: redisplay-hook thunk
     Specifies that THUNK is to be run periodically when output from the
     subprocess is available.  THUNK must be a procedure of no
     arguments, or '#f' indicating that no hook is supplied.  This
     option is mostly useful for interactive systems.  For example, the
     Edwin text editor uses this to update output buffers when running
     some subprocesses.

     The default value of this option is '#f'.

          (run-shell-command "ls -la /etc"
                             'redisplay-hook
                             (lambda ()
                               (update-buffer-contents buffer)))

 -- subprocess option: environment environment
     Specifies the environment variables that are to be used for the
     subprocess.  ENVIRONMENT must be either a vector of strings or '#f'
     indicating the default environment.  If it is a vector of strings,
     each string must be a name/value pair where the name and value are
     separated by an equal sign, for example, '"foo=bar"'.  To define a
     variable with no value, just omit the value, as in '"foo="'.

     Note that the variable 'scheme-subprocess-environment' is bound to
     the default subprocess environment.

     The default value of this option is '#f'.

          (run-shell-command "ls -la /etc"
                             'environment
                             (let* ((v scheme-subprocess-environment)
                                    (n (vector-length v))
                                    (v (vector-grow v (+ n 1))))
                               (vector-set! v n "TERM=none")
                               v))

 -- subprocess option: working-directory pathname
     Specifies the working directory in which the subprocess will run.

     The default value of this option is '(working-directory-pathname)'.

          (run-shell-command "ls -la" 'working-directory "/etc/")

 -- subprocess option: use-pty? boolean
     This option is meaningful only on unix systems; on other systems it
     is ignored.  Specifies whether to communicate with the subprocess
     using PTY devices; if true, PTYs will be used, otherwise pipes will
     be used.

     The default value of this option is '#f'.

          (run-shell-command "ls -la /etc" 'use-pty? #t)

 -- subprocess option: shell-file-name pathname
     Specifies the shell program to use for 'run-shell-command'.

     The default value of this option is '(os/shell-file-name)'.  This
     is the value of the environment variable 'SHELL', or if 'SHELL' is
     not set, the value is operating-system dependent as follows:

        * On unix systems, '/bin/sh' is used.

        * On Windows systems, the value of the environment variable
          'COMSPEC' is used.  If that is not set, 'cmd.exe' is used for
          Windows NT, or 'command.com' is used for Windows 9x; in each
          case the shell is found by searching the path.

          (run-shell-command "ls -la /etc"
                             'shell-file-name "/usr/local/bin/bash")


File: mit-scheme-ref.info,  Node: TCP Sockets,  Next: Miscellaneous OS Facilities,  Prev: Subprocesses,  Up: Operating-System Interface

15.8 TCP Sockets
================

MIT/GNU Scheme provides access to "sockets", which are a mechanism for
inter-process communication.  TCP stream sockets are supported, which
communicate between computers over a TCP/IP network.  TCP sockets are
supported on all operating systems.

   TCP sockets have two distinct interfaces: one interface to implement
a "client" and another to implement a "server".  The basic protocol is
that servers set up a listening port and wait for connections from
clients.  Implementation of clients is simpler and will be treated
first.

   The socket procedures accept two special arguments, called HOST-NAME
and SERVICE.  HOST-NAME is a string which must be the name of an
internet host.  It is looked up using the ordinary lookup rules for your
computer.  For example, if your host is 'foo.mit.edu' and HOST-NAME is
'"bar"', then it specifies 'bar.mit.edu'.

   SERVICE specifies the service to which you will connect.  A networked
computer normally provides several different services, such as telnet or
FTP.  Each service is associated with a unique "port number"; for
example, the '"www"' service is associated with port '80'.  The SERVICE
argument specifies the port number, either as a string, or directly as
an exact non-negative integer.  Port strings are decoded by the
operating system using a table; for example, on unix the table is in
'/etc/services'.  Usually you will use a port string rather than a
number.

 -- procedure: open-tcp-stream-socket host-name service
     'open-tcp-stream-socket' opens a connection to the host specified
     by HOST-NAME.  HOST-NAME is looked up using the ordinary lookup
     rules for your computer.  The connection is established to the
     service specified by SERVICE.  The returned value is an I/O port,
     to which you can read and write characters using ordinary Scheme
     I/O procedures such as 'read-char' and 'write-char'.

     When you wish to close the connection, just use 'close-port'.

     As an example, here is how you can open a connection to a web
     server:

          (open-tcp-stream-socket "web.mit.edu" "www")

   Next we will treat setting up a TCP server, which is slightly more
complicated.  Creating a server is a two-part process.  First, you must
open a "server socket", which causes the operating system to listen to
the network on a port that you specify.  Once the server socket is
opened, the operating system will allow clients to connect to your
computer on that port.

   In the second step of the process, you "accept" the connection, which
completes the connection initiated by the client, and allows you to
communicate with the client.  Accepting a connection does not affect the
server socket; it continues to listen for additional client connections.
You can have multiple client connections to the same server socket open
simultaneously.

 -- procedure: open-tcp-server-socket service [address]
     This procedure opens a server socket that listens for connections
     to SERVICE; the socket will continue to listen until you close it.
     The returned value is a server socket object.

     An error is signalled if another process is already listening on
     the service.  Additionally, ports whose number is less than '1024'
     are privileged on many operating systems, and cannot be used by
     non-privileged processes; if SERVICE specifies such a port and you
     do not have administrative privileges, an error may be signalled.

     The optional argument ADDRESS specifies the IP address on which the
     socket will listen.  If this argument is not supplied or is given
     as '#f', then the socket listens on all IP addresses for this
     machine.  (This is equivalent to passing the result of calling
     'host-address-any'.)

 -- procedure: tcp-server-connection-accept server-socket block?
          peer-address [line-translation]
     Checks to see if a client has connected to SERVER-SOCKET.  If so,
     an I/O port is returned.  The returned port can be read and written
     using ordinary Scheme I/O procedures such as 'read-char' and
     'write-char'.

     The argument BLOCK? says what to do if no client has connected at
     the time of the call.  If '#f', it says to return immediately with
     two values of '#f'.  Otherwise, the call waits until a client
     connects.

     The argument PEER-ADDRESS is either '#f' or an IP address as
     allocated by 'allocate-host-address'.  If it is an IP address, the
     address is modified to be the address of the client making the
     connection.

     The optional argument LINE-TRANSLATION specifies how end-of-line
     characters will be translated when reading or writing to the
     returned socket.  If this is unspecified or '#f', then lines will
     be terminated by CR-LF, which is the standard for most internet
     protocols.  Otherwise, it must be a string, which specifies the
     line-ending character sequence to use.

     Note that closing the port returned by this procedure does not
     affect SERVER-SOCKET; it just closes the particular client
     connection that was opened by the call.  To close SERVER-SOCKET,
     use 'close-tcp-server-socket'.

 -- procedure: close-tcp-server-socket server-socket
     Closes the server socket SERVER-SOCKET.  The operating system will
     cease listening for network connections to that service.  Client
     connections to SERVER-SOCKET that have already been accepted will
     not be affected.


File: mit-scheme-ref.info,  Node: Miscellaneous OS Facilities,  Prev: TCP Sockets,  Up: Operating-System Interface

15.9 Miscellaneous OS Facilities
================================

This section contains assorted operating-system facilities that don't
fit into other categories.

 -- variable: microcode-id/operating-system
 -- obsolete variable: microcode-id/operating-system-name
     'microcode-id/operating-system' is bound to a symbol that specifies
     the type of operating system that Scheme is running under.  There
     are two possible values: 'unix' or 'nt'.

     The *deprecated* variable 'microcode-id/operating-system-name' is a
     string that's equivalent to 'microcode-id/operating-system'.

 -- variable: microcode-id/operating-system-variant
     This variable is a string that identifies the particular variant of
     the operating system that Scheme is running under.  Here are some
     of the possible values:

          "GNU/Linux"
          "MacOSX"
          "Microsoft Windows NT 4.0 (Build 1381; Service Pack 3)"

     For Windows systems, it is recommended that you match on the prefix
     of this string and ignore the '"Build"' suffix.  This is because
     the suffix may contain information about service packs or fixes,
     while the prefix will be constant for a particular version of
     Windows.

   The next few procedures provide access to the "domain name service"
(DNS), which maintains associations between internet host names such as
'"www.swiss.ai.mit.edu"' and IP addresses, such as '18.23.0.16'.  In
MIT/GNU Scheme, we represent an internet host name as a string, and an
IP address as a byte vector of length 4 (byte vectors are just character
strings that are accessed using 'vector-8b-ref' rather than
'string-ref').  The bytes in an IP address read in the same order as
they do when written out:

     (get-host-by-name "www.swiss") => #("\022\027\000\020")

 -- procedure: get-host-by-name host-name
     Looks up the internet host name HOST-NAME using the DNS, returning
     a vector of IP addresses for the corresponding host, or '#f' if
     there is no such host.  Usually the returned vector has only one
     element, but if a host has more than one network interface, the
     vector might have more than one element.

          (get-host-by-name "www.swiss") => #("\022\027\000\020")

 -- procedure: get-host-by-address ip-address
     Does a reverse DNS lookup on IP-ADDRESS, returning the internet
     host name corresponding to that address, or '#f' if there is no
     such host.

          (get-host-by-address "\022\027\000\020") => "swissnet.ai.mit.edu"

 -- procedure: canonical-host-name host-name
     Finds the "canonical" internet host name for HOST-NAME.  For
     example:

          (canonical-host-name "zurich")    => "zurich.ai.mit.edu"
          (canonical-host-name "www.swiss") => "swissnet.ai.mit.edu"

     In both examples, the default internet domain 'ai.mit.edu' is added
     to HOST-NAME.  In the second example, '"www.swiss"' is an alias for
     another computer named '"swissnet"'.

 -- procedure: get-host-name
     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:

          (get-host-name) => "aarau"

 -- procedure: os/hostname
     Returns the canonical internet host name of the computer that
     MIT/GNU Scheme is running on.  So, in contrast to the example for
     'get-host-name':

          (os/hostname) => "aarau.ai.mit.edu"

 -- procedure: allocate-host-address
     Allocates and returns an IP address object.  This is just a string
     of a fixed length (current 4 bytes) into which an IP address may be
     stored.  This procedure is used to generate an appropriate argument
     to be passed to 'tcp-server-connection-accept'.

          (allocate-host-address) => "Xe\034\241"

 -- procedure: host-address-any
     Return an IP address object that specifies "any host".  This object
     is useful only when passed as the ADDRESS argument to
     'open-tcp-server-socket'.

          (host-address-any) => "\000\000\000\000"

 -- procedure: host-address-loopback
     Return an IP address object that specifies the local "loopback"
     network interface.  The loopback interface is a software network
     interface that can be used only for communicating between processes
     on the same computer.  This address object is useful only when
     passed as the ADDRESS argument to 'open-tcp-server-socket'.

          (host-address-loopback) => "\177\000\000\001"


File: mit-scheme-ref.info,  Node: Error System,  Next: Graphics,  Prev: Operating-System Interface,  Up: Top

16 Error System
***************

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:

'error'
     is used to signal simple errors, specifying a message and some
     irritant objects (*note Condition Signalling::).  Errors are
     usually handled by stopping the computation and putting the user in
     an error REPL.

'warn'
     is used to signal warnings (*note Condition Signalling::).
     Warnings are usually handled by printing a message on the console
     and continuing the computation normally.

'ignore-errors'
     is used to suppress the normal handling of errors within a given
     dynamic extent (*note Condition Handling::).  Any error that occurs
     within the extent is trapped, returning immediately to the caller
     of 'ignore-errors'.

   More demanding applications require more powerful facilities.  To
give a concrete example, suppose you want floating-point division to
return a very large number whenever the denominator is zero.  This
behavior can be implemented using the error system.

   The Scheme arithmetic system can signal many different kinds of
errors, including floating-point divide by zero.  In our example, we
would like to handle this particular condition specially, allowing the
system to handle other arithmetic errors in its usual way.

   The error system supports this kind of application by providing
mechanisms for distinguishing different types of error conditions and
for specifying where control should be transferred should a given
condition arise.  In this example, there is a specific object that
represents the "floating-point divide by zero" condition type, and it is
possible to dynamically specify an arbitrary Scheme procedure to be
executed when a condition of that type is signalled.  This procedure
then finds the stack frame containing the call to the division operator,
and returns the appropriate value from that frame.

   Another useful kind of behavior is the ability to specify uniform
handling for related classes of conditions.  For example, it might be
desirable, when opening a file for input, to gracefully handle a variety
of different conditions associated with the file system.  One such
condition might be that the file does not exist, in which case the
program will try some other action, perhaps opening a different file
instead.  Another related condition is that the file exists, but is read
protected, so it cannot be opened for input.  If these or any other
related conditions occur, the program would like to skip this operation
and move on to something else.

   At the same time, errors unrelated to the file system should be
treated in their usual way.  For example, calling 'car' on the argument
'3' should signal an error.  Or perhaps the name given for the file is
syntactically incorrect, a condition that probably wants to be handled
differently from the case of the file not existing.

   To facilitate the handling of classes of conditions, the error system
taxonomically organizes all condition types.  The types are related to
one another by "taxonomical links", which specify that one type is a
"kind of" another type.  If two types are linked this way, one is
considered to be a "specialization" of the other; or vice-versa, the
second is a "generalization" of the first.  In our example, all of the
errors associated with opening an input file would be specializations of
the condition type "cannot open input file".

   The taxonomy of condition types permits any condition type to have no
more than one immediate generalization.  Thus, the condition types form
a forest (set of trees).  While users can create new trees, the standard
taxonomy (*note Taxonomy::) is rooted at
'condition-type:serious-condition', 'condition-type:warning',
'condition-type:simple-condition', and 'condition-type:breakpoint';
users are encouraged to add new subtypes to these condition types rather
than create new trees in the forest.

   To summarize, the error system provides facilities for the following
tasks.  The sections that follow will describe these facilities in more
detail.

Signalling a condition
     A condition may be signalled in a number of different ways.  Simple
     errors may be signalled, without explicitly defining a condition
     type, using 'error'.  The 'signal-condition' procedure provides the
     most general signalling mechanism.

Handling a condition
     The programmer can dynamically specify handlers for particular
     condition types or for classes of condition types, by means of the
     'bind-condition-handler' procedure.  Individual handlers have
     complete control over the handling of a condition, and additionally
     may decide not to handle a particular condition, passing it on to
     previously bound handlers.

Restarting from a handler
     The 'with-restart' procedure provides a means for
     condition-signalling code to communicate to condition-handling code
     what must be done to proceed past the condition.  Handlers can
     examine the restarts in effect when a condition was signalled,
     allowing a structured way to continue an interrupted computation.

Packaging condition state
     Each condition is represented by an explicit object.  Condition
     objects contain information about the nature of the condition,
     information that describes the state of the computation from which
     the condition arose, and information about the ways the computation
     can be restarted.

Classification of conditions
     Each condition has a type, represented by a condition type object.
     Each condition type may be a specialization of some other condition
     types.  A group of types that share a common generalization can be
     handled uniformly by specifying a handler for the generalization.

* Menu:

* Condition Signalling::
* Error Messages::
* Condition Handling::
* Restarts::
* Condition Instances::
* Condition Types::
* Taxonomy::


File: mit-scheme-ref.info,  Node: Condition Signalling,  Next: Error Messages,  Prev: Error System,  Up: Error System

16.1 Condition Signalling
=========================

Once a condition instance has been created using 'make-condition' (or
any condition constructor), it can be "signalled".  The act of
signalling a condition is separated from the act of creating the
condition to allow more flexibility in how conditions are handled.  For
example, a condition instance could be returned as the value of a
procedure, indicating that something unusual has happened, to allow the
caller to clean up some state.  The caller could then signal the
condition once it is ready.

   A more important reason for having a separate condition-signalling
mechanism is that it allows _resignalling_.  When a signalled condition
has been caught by a particular handler, and the handler decides that it
doesn't want to process that particular condition, it can signal the
condition again.  This is one way to allow other handlers to get a
chance to see the condition.

 -- procedure: error reason argument ...
     This is the simplest and most common way to signal a condition that
     requires intervention before a computation can proceed (when
     intervention is not required, 'warn' is more appropriate).  'error'
     signals a condition (using 'signal-condition'), and if no handler
     for that condition alters the flow of control (by invoking a
     restart, for example) it calls the procedure
     'standard-error-handler', which normally prints an error message
     and stops the computation, entering an error REPL.  Under normal
     circumstances 'error' will not return a value (although an
     interactive debugger can be used to force this to occur).

     Precisely what condition is signalled depends on the first argument
     to 'error'.  If REASON is a condition, then that condition is
     signalled and the ARGUMENTs are ignored.  If REASON is a condition
     type, then a new instance of this type is generated and signalled;
     the ARGUMENTs are used to generate the values of the fields for
     this condition type (they are passed as the FIELD-PLIST argument to
     'make-condition').  In the most common case, however, REASON is
     neither a condition nor a condition type, but rather a string or
     symbol.  In this case a condition of type
     'condition-type:simple-error' is created with the MESSAGE field
     containing the REASON and the IRRITANTS field containing the
     ARGUMENTs.

 -- procedure: warn reason argument ...
     When a condition is not severe enough to warrant intervention, it
     is appropriate to signal the condition with 'warn' rather than
     'error'.  As with 'error', 'warn' first calls 'signal-condition';
     the condition that is signalled is chosen exactly as in 'error'
     except that a condition of type 'condition-type:simple-warning' is
     signalled if REASON is neither a condition nor a condition type.
     If the condition is not handled, 'warn' calls the procedure
     'standard-warning-handler', which normally prints a warning message
     and continues the computation by returning from 'warn'.

     'warn' establishes a restart named 'muffle-warning' before calling
     'signal-condition'.  This allows a signal handler to prevent the
     generation of the warning message by calling 'muffle-warning'.  The
     value of a call to 'warn' is unspecified.

 -- procedure: signal-condition condition
     This is the fundamental operation for signalling a condition.  The
     precise operation of 'signal-condition' depends on the condition
     type of which CONDITION is an instance, the condition types set by
     'break-on-signals', and the handlers established by
     'bind-condition-handler' and 'bind-default-condition-handler'.

     If the CONDITION is an instance of a type that is a specialization
     of any of the types specified by 'break-on-signals', then a
     breakpoint REPL is initiated.  Otherwise (or when that REPL
     returns), the handlers established by 'bind-condition-handler' are
     checked, most recent first.  Each applicable handler is invoked,
     and the search for a handler continues if the handler returns
     normally.  If all applicable handlers return, then the applicable
     handlers established by 'bind-default-condition-handler' are
     checked, again most recent first.  Finally, if no handlers apply
     (or all return in a normal manner), 'signal-condition' returns an
     unspecified value.

     _Note:_ unlike many other systems, the MIT/GNU Scheme runtime
     library does _not_ establish handlers of any kind.  (However, the
     Edwin text editor uses condition handlers extensively.)  Thus,
     calls to 'signal-condition' will return to the caller unless there
     are user supplied condition handlers, as the following example
     shows:

          (signal-condition
           (make-condition
            condition-type:error
            (call-with-current-continuation (lambda (x) x))
            '()    ; no restarts
            '()))  ; no fields
          =>  unspecified


File: mit-scheme-ref.info,  Node: Error Messages,  Next: Condition Handling,  Prev: Condition Signalling,  Up: Error System

16.2 Error Messages
===================

By convention, error messages (and in general, the reports generated by
'write-condition-report') should consist of one or more complete
sentences.  The usual rules for sentences should be followed: the first
word of the sentence should be capitalized, and the sentence should be
terminated by a period.  The message should not contain extraneous
whitespace such as line breaks or indentation.

   The error system provides a simple formatting language that allows
the programmer to have some control over the printing of error messages.
This formatting language will probably be redesigned in a future
release.

   Error messages typically consist of a string describing the error,
followed by some irritant objects.  The string is printed using
'display', and the irritants are printed using 'write', typically with a
space between each irritant.  To allow simple formatting, we introduce a
"noise" object, printed using 'display'.  The irritant list may contain
ordinary objects interspersed with noise objects.  Each noise object is
printed using 'display', with no extra whitespace, while each normal
object is printed using 'write', prefixed by a single space character.

   Here is an example:

     (define (error-within-procedure message irritant procedure)
       (error message
              irritant
              (error-irritant/noise "within procedure")
              procedure
              (error-irritant/noise ".")))

This would format as follows:

     (error-within-procedure "Bad widget" 'widget-32 'invert-widget) error->

     Bad widget widget-32 within procedure invert-widget.

   Here are the operations supporting error messages:

 -- procedure: format-error-message message irritants port
     MESSAGE is typically a string (although this is not required),
     IRRITANTS a list of irritant objects, and PORT an output port.
     Formats MESSAGE and IRRITANTS to PORT in the standard way.  Note
     that, during the formatting process, the depth and breadth to which
     lists are printed are each limited to small numbers, to guarantee
     that the output from each irritant is not arbitrarily large.

 -- procedure: error-irritant/noise value
     Creates and returns a noise object whose value is VALUE.


File: mit-scheme-ref.info,  Node: Condition Handling,  Next: Restarts,  Prev: Error Messages,  Up: Error System

16.3 Condition Handling
=======================

The occurrence of a condition is signalled using 'signal-condition'.
'signal-condition' attempts to locate and invoke a "condition handler"
that is prepared to deal with the type of condition that has occurred.
A condition handler is a procedure of one parameter, the condition that
is being signalled.  A procedure is installed as a condition handler by
calling 'bind-condition-handler' (to establish a handler that is in
effect only while a particular thunk is executing) or
'bind-default-condition-handler' (to establish a handler that is in
effect permanently).  As implied by the name, handlers created by
'bind-default-condition-handler' are invoked only after all other
applicable handlers have been invoked.

   A HANDLER may process a signal in any way it deems appropriate, but
the common patterns are:

Ignore the condition.
     By returning from the handler in the usual manner.

Handle the condition.
     By doing some processing and then invoking a restart (or, less
     preferably, a continuation) that was established at some point
     prior to the call to 'signal-condition'.

Resignal a condition.
     By doing some processing and calling 'signal-condition' with either
     the same condition or a newly created one.  In order to support
     this, 'signal-condition' runs HANDLER in such a way that a
     subsequent call to 'signal-condition' sees only the handlers that
     were established prior to this one.

   As an aid to debugging condition handlers, Scheme maintains a set of
condition types that will cause an interactive breakpoint to occur prior
to normal condition signalling.  That is, 'signal-condition' creates a
new REPL prior to its normal operation when its argument is a condition
that is a specialization of any of these types.  The procedure
'break-on-signals' establishes this set of condition types.

 -- procedure: ignore-errors thunk
     Executes THUNK with a condition handler that intercepts the
     signalling of any specialization of 'condition-type:error'
     (including those produced by calls to 'error') and immediately
     terminates the execution of THUNK and returns from the call to
     'ignore-errors' with the signalled condition as its value.  If
     THUNK returns normally, its value is returned from 'ignore-errors'.

     Notice that 'ignore-errors' does not "turn off signalling" or
     condition handling.  Condition handling takes place in the normal
     manner but conditions specialized from 'condition-type:error' are
     trapped rather than propogated as they would be by default.

 -- procedure: bind-condition-handler condition-types handler thunk
     Invokes THUNK after adding HANDLER as a condition handler for the
     conditions specified by CONDITION-TYPES.  CONDITION-TYPES must be a
     list of condition types; signalling a condition whose type is a
     specialization of any of these types will cause the HANDLER to be
     invoked.  See 'signal-condition' for a description of the mechanism
     used to invoke handlers.

     By special extension, if CONDITION-TYPES is the empty list then the
     HANDLER is called for all conditions.

 -- procedure: bind-default-condition-handler condition-types handler
     Installs HANDLER as a (permanent) condition handler for the
     conditions specified by CONDITION-TYPES.  CONDITION-TYPES must be a
     list of condition types; signalling a condition whose type is a
     specialization of any of these types will cause the HANDLER to be
     invoked.  See 'signal-condition' for a description of the mechanism
     used to invoke handlers.

     By special extension, if CONDITION-TYPES is the empty list then the
     HANDLER is called for all conditions.

 -- procedure: break-on-signals condition-types
     Arranges for 'signal-condition' to create an interactive REPL
     before it signals a condition that is a specialization of any of
     the types in the list of CONDITION-TYPES.  This can be extremely
     helpful when trying to debug code that uses custom condition
     handlers.  In order to create a REPL when _any_ condition type is
     signalled it is best to actually put a breakpoint on entry to
     'signal-condition'.

 -- procedure: standard-error-handler condition
     Called internally by 'error' after it calls 'signal-condition'.
     Normally creates a new REPL with the prompt '"error>"' (but see
     'standard-error-hook').  In order to simulate the effect of calling
     'error', code may call 'signal-condition' directly and then call
     'standard-error-handler' if 'signal-condition' returns.

 -- parameter: standard-error-hook
     This parameter controls the behavior of the procedure
     'standard-error-handler', and hence 'error'.  It is intended to be
     bound with 'parameterize' and is normally '#f'.  It may be changed
     to a procedure of one argument and will then be invoked (with
     'standard-error-hook' rebound to '#f') by 'standard-error-handler'
     just prior to starting the error REPL.  It is passed one argument,
     the condition being signalled.

 -- procedure: standard-warning-handler condition
     This is the procedure called internally by 'warn' after it calls
     'signal-condition'.  The normal behavior of
     'standard-warning-handler' is to print a message (but see
     'standard-warning-hook').  More precisely, the message is printed
     to the port returned by 'notification-output-port'.  The message is
     formed by first printing the string '"Warning: "' to this port, and
     then calling 'write-condition-report' on CONDITION and the port.

     In order to simulate the effect of calling 'warn', code may call
     'signal-condition' directly and then call
     'standard-warning-handler' if 'signal-condition' returns.  (This is
     not sufficient to implement the 'muffle-warning' protocol, however.
     For that purpose an explicit restart must be provided.)

 -- parameter: standard-warning-hook
     This parameter controls the behavior of the procedure
     'standard-warning-handler', and hence 'warn'.  It is intended to be
     bound with 'parameterize' and is normally '#f'.  It may be changed
     to a procedure of one argument and will then be invoked (with
     'standard-warning-hook' rebound to '#f') by
     'standard-warning-handler' in lieu of writing the warning message.
     It is passed one argument, the condition being signalled.


File: mit-scheme-ref.info,  Node: Restarts,  Next: Condition Instances,  Prev: Condition Handling,  Up: Error System

16.4 Restarts
=============

The Scheme error system provides a mechanism, known as "restarts", that
helps coordinate condition-signalling code with condition-handling code.
A module of code that detects and signals conditions can provide
procedures (using 'with-simple-restart' or 'with-restart') to be invoked
by handlers that wish to continue, abort, or restart the computation.
These procedures, called "restart effectors", are encapsulated in
restart objects.

   When a condition object is created, it contains a set of restart
objects, each of which contains a restart effector.  Condition handlers
can inspect the condition they are handling (using 'find-restart' to
find restarts by name, or 'condition/restarts' to see the entire set),
and they can invoke the associated effectors (using 'invoke-restart' or
'invoke-restart-interactively').  Effectors can take arguments, and
these may be computed directly by the condition-handling code or by
gathering them interactively from the user.

   The names of restarts can be chosen arbitrarily, but the choice of
name is significant.  These names are used to coordinate between the
signalling code (which supplies names for restarts) and the handling
code (which typically chooses a restart effector by the name of its
restart).  Thus, the names specify the "restart protocol" implemented by
the signalling code and invoked by the handling code.  The protocol
indicates the number of arguments required by the effector code as well
as the semantics of the arguments.

   Scheme provides a conventional set of names (hence, protocols) for
common use.  By choosing the names of restarts from this set, signalling
code can indicate that it is able to perform a small set of fairly
common actions ('abort', 'continue', 'muffle-warning', 'retry',
'store-value', 'use-value').  In turn, simple condition-handling code
can look for the kind of action it wishes to perform and simply invoke
it by name.  All of Scheme's conventional names are symbols, although in
general restart names are not restricted to any particular data type.
In addition, the object '#f' is reserved to indicate the "not for
automated use" protocol: these restarts should be activated only under
human control.

   Restarts themselves are first-class objects.  They encapsulate their
name, a procedure (known as the EFFECTOR) to be executed if they are
invoked, and a thunk (known as the REPORTER) that can be invoked to
display a description of the restart (used, for example, by the
interactive debugger).  Invoking a restart is an indication that a
handler has chosen to accept control for a condition; as a consequence,
the EFFECTOR of the restart should not return, since this would indicate
that the handler declined to handle the condition.  Thus, the EFFECTOR
should call a continuation captured before the condition-signalling
process began.  The most common pattern of usage by signalling code is
encapsulated in 'with-simple-restart'.

   Within this chapter, a parameter named RESTARTS will accept any of
the following values:

   * A list of restart objects.

   * A condition.  The procedure 'condition/restarts' is called on the
     condition, and the resulting list of restarts is used in place of
     the condition.

   * The symbol 'bound-restarts'.  The procedure 'bound-restarts' is
     called (with no arguments), and the resulting list of restarts is
     used in place of the symbol.

   * If the RESTARTS parameter is optional and is not supplied, it is
     equivalent to having specified the symbol 'bound-restarts'.

* Menu:

* Establishing Restart Code::
* Invoking Standard Restart Code::
* Finding and Invoking General Restart Code::
* The Named Restart Abstraction::


File: mit-scheme-ref.info,  Node: Establishing Restart Code,  Next: Invoking Standard Restart Code,  Prev: Restarts,  Up: Restarts

16.4.1 Establishing Restart Code
--------------------------------

 -- procedure: with-simple-restart name reporter thunk
     Invokes THUNK in a dynamic environment created by adding a restart
     named NAME to the existing named restarts.  REPORTER may be used
     during the execution of THUNK to produce a description of the newly
     created restart; it must either be a procedure of one argument (a
     port) or a string.  By convention, the description generated by
     REPORTER should be a short complete sentence, with first word
     capitalized and terminated by a period.  The sentence should fit on
     one line with a little room to spare (see the examples below);
     usually this means that the sentence should be 70 characters or
     less in length.

     If the restart created by 'with-simple-restart' is invoked it
     simply aborts the computation in progress by returning an
     unspecified value from the call to 'with-simple-restart'.
     Otherwise 'with-simple-restart' returns the value computed by
     THUNK.

     (with-simple-restart 'george "This restart is named george."
       (lambda () 3)) => 3

     (with-simple-restart 'george "This restart is named george."
       (lambda ()
         (invoke-restart (find-restart 'george)))) => unspecific

     (with-simple-restart 'george "This restart is named george."
       (lambda () (car 3)))
     ;The object 3, passed as the first argument to car,
     ; is not the correct type.
     ;To continue, call RESTART with an option number:
     ; (RESTART 3) => Specify an argument to use in its place.
     ; (RESTART 2) => This restart is named george.
     ; (RESTART 1) => Return to read-eval-print level 1.

 -- procedure: with-restart name reporter effector interactor thunk
     Invokes THUNK in a dynamic environment created by adding a restart
     named NAME to the existing named restarts.  REPORTER may be used
     during the execution of THUNK to produce a description of the newly
     created restart; it must either be a procedure of one argument (a
     port) or a string.  EFFECTOR is a procedure which will be called
     when the restart is invoked by 'invoke-restart'.  INTERACTOR
     specifies the arguments that are to be passed to EFFECTOR when it
     is invoked interactively; it may be either a procedure of no
     arguments, or '#f'.  If INTERACTOR is '#f', this restart is not
     meant to be invoked interactively.

     The value returned by 'with-restart' is the value returned by
     THUNK.  Should the restart be invoked by a condition handler,
     however, the EFFECTOR will not return back to the handler that
     invoked it.  Instead, the EFFECTOR should call a continuation
     created before the condition-signalling process began, and
     'with-restart' will therefore not return in the normal manner.

     (define (by-george! thunk)
       ; This code handles conditions that arise while executing THUNK
       ; by invoking the GEORGE restart, passing 1 and 2 to the restart's
       ; EFFECTOR code.
       (bind-condition-handler '() ; All conditions
        (lambda (condition)
          (invoke-restart (find-restart 'george) 1 2))
        thunk))

     (define (can-george! thunk)
       ; This code provides a way of handling errors: the GEORGE restart.
       ; In order to GEORGE you must supply two values.
       (lambda ()
         (call-with-current-continuation
          (lambda (kappa)
            (with-restart
             'george                         ; Name
             "This restart is named george." ; Reporter
             (lambda (a b)                   ; Effector
               (kappa (list 'george a b)))
             values                          ; Interactor
             thunk)))))                      ; Thunk

     (by-george! (can-george! (lambda () -3))        => -3
     (by-george! (can-george! (lambda () (car 'x)))) => (george 1 2)


File: mit-scheme-ref.info,  Node: Invoking Standard Restart Code,  Next: Finding and Invoking General Restart Code,  Prev: Establishing Restart Code,  Up: Restarts

16.4.2 Invoking Standard Restart Code
-------------------------------------

Scheme supports six standard protocols for restarting from a condition,
each encapsulated using a named restart (for use by condition-signalling
code) and a simple procedure (for use by condition-handling code).
Unless otherwise specified, if one of these procedures is unable to find
its corresponding restart, it returns immediately with an unspecified
value.

   Each of these procedures accepts an optional argument RESTARTS, which
is described above in *note Restarts::.

 -- procedure: abort [restarts]
     Abort the computation, using the restart named 'abort'.  The
     corresponding effector takes no arguments and abandons the current
     line of computation.  This is the restart provided by Scheme's
     REPL.

     If there is no restart named 'abort', this procedure signals an
     error of type 'condition-type:no-such-restart'.

 -- procedure: continue [restarts]
     Continue the current computation, using the restart named
     'continue'.  The corresponding effector takes no arguments and
     continues the computation beyond the point at which the condition
     was signalled.

 -- procedure: muffle-warning [restarts]
     Continue the current computation, using the restart named
     'muffle-warning'.  The corresponding effector takes no arguments
     and continues the computation beyond the point at which any warning
     message resulting from the condition would be presented to the
     user.  The procedure 'warn' establishes a 'muffle-warning' restart
     for this purpose.

     If there is no restart named 'muffle-warning', this procedure
     signals an error of type 'condition-type:no-such-restart'.

 -- procedure: retry [restarts]
     Retry the current computation, using the restart named 'retry'.
     The corresponding effector takes no arguments and simply retries
     the same computation that triggered the condition.  The condition
     may reoccur, of course, if the root cause has not been eliminated.
     The code that signals a "file does not exist" error can be expected
     to supply a 'retry' restart.  The restart would be invoked after
     first creating the missing file, since the computation is then
     likely to succeed if it is simply retried.

 -- procedure: store-value new-value [restarts]
     Retry the current computation, using the restart named
     'store-value', after first storing NEW-VALUE.  The corresponding
     effector takes one argument, NEW-VALUE, and stores it away in a
     restart-dependent location, then retries the same computation that
     triggered the condition.  The condition may reoccur, of course, if
     the root cause has not been eliminated.  The code that signals an
     "unassigned variable" error can be expected to supply a
     'store-value' restart; this would store the value in the variable
     and continue the computation.

 -- procedure: use-value new-value [restarts]
     Retry the current computation, using the restart named 'use-value',
     but substituting NEW-VALUE for a value that previously caused a
     failure.  The corresponding effector takes one argument, NEW-VALUE,
     and retries the same computation that triggered the condition with
     the new value substituted for the failing value.  The condition may
     reoccur, of course, if the new value also induces the condition.

     The code that signals an "unassigned variable" error can be
     expected to supply a 'use-value' restart; this would simply
     continue the computation with NEW-VALUE instead of the value of the
     variable.  Contrast this with the 'retry' and 'store-value'
     restarts.  If the 'retry' restart is used it will fail because the
     variable still has no value.  The 'store-value' restart could be
     used, but it would alter the value of the variable, so that future
     references to the variable would not be detected.


File: mit-scheme-ref.info,  Node: Finding and Invoking General Restart Code,  Next: The Named Restart Abstraction,  Prev: Invoking Standard Restart Code,  Up: Restarts

16.4.3 Finding and Invoking General Restart Code
------------------------------------------------

Restarts are a general mechanism for establishing a protocol between
condition-signalling and condition-handling code.  The Scheme error
system provides "packaging" for a number of common protocols.  It also
provides lower-level hooks that are intended for implementing customized
protocols.  The mechanism used by signalling code ('with-restart' and
'with-simple-restart') is used for both purposes.

   Four additional operations are provided for the use of
condition-handling code.  Two operations ('bound-restarts' and
'find-restart') allow condition-handling code to locate active restarts.
The other two operations ('invoke-restart' and
'invoke-restart-interactively') allow restart effectors to be invoked
once the restart object has been located.

   In addition, there is a data abstraction that provides access to the
information encapsulated in restart objects.

 -- procedure: bound-restarts
     Returns a list of all currently active restart objects, most
     recently installed first.  'bound-restarts' should be used with
     caution by condition-handling code, since it reveals all restarts
     that are active at the time it is called, rather than at the time
     the condition was signalled.  It is useful, however, for collecting
     the list of restarts for inclusion in newly generated condition
     objects or for inspecting the current state of the system.

 -- procedure: find-restart name [restarts]
     Returns the first restart object named NAME in the list of RESTARTS
     (permissible values for RESTARTS are described above in *note
     Restarts::).  When used in a condition handler, 'find-restart' is
     usually passed the name of a particular restart _and_ the condition
     object that has been signalled.  In this way the handler finds only
     restarts that were available when the condition was created
     (usually the same as when it was signalled).  If RESTARTS is
     omitted, the currently active restarts would be used, and these
     often include restarts added after the condition ocurred.

 -- procedure: invoke-restart restart argument ...
     Calls the restart effector encapsulated in RESTART, passing the
     specified ARGUMENTs to it.  'invoke-restart' is intended for use by
     condition-handling code that understands the protocol implemented
     by RESTART, and can therefore calculate and pass an appropriate set
     of arguments.

     If a condition handler needs to interact with a user to gather the
     arguments for an effector (e.g. if it does not understand the
     protocol implemented by RESTART) 'invoke-restart-interactively'
     should be used instead of 'invoke-restart'.

 -- procedure: invoke-restart-interactively restart
     First calls the interactor encapsulated in RESTART to interactively
     gather the arguments needed for RESTART's effector.  It then calls
     the effector, passing these arguments to it.

     'invoke-restart-interactively' is intended for calling interactive
     restarts (those for which 'restart/interactor' is not '#f').  For
     convenience, 'invoke-restart-interactively' will call the restart's
     effector with no arguments if the restart has no interactor; this
     behavior may change in the future.


File: mit-scheme-ref.info,  Node: The Named Restart Abstraction,  Prev: Finding and Invoking General Restart Code,  Up: Restarts

16.4.4 The Named Restart Abstraction
------------------------------------

A restart object is very simple, since it encapsulates only a name,
effector, interactor, and description.

 -- procedure: restart? object
     Returns '#f' if and only if OBJECT is not a restart.

 -- procedure: restart/name restart
     Returns the name of RESTART.  While the Scheme error system uses
     only symbols and the object '#f' for its predefined names, programs
     may use arbitrary objects (name equivalence is tested using 'eq?').

 -- procedure: restart/effector restart
     Returns the effector encapsulated in RESTART.  Normally this
     procedure is not used since 'invoke-restart' and
     'invoke-restart-interactively' capture the most common invocation
     patterns.

 -- procedure: restart/interactor restart
     Returns the interactor encapsulated in RESTART.  This is either a
     procedure of no arguments or the object '#f'.  Normally this
     procedure is not used since 'invoke-restart-interactively' captures
     the most common usage.  Thus 'restart/interactor' is most useful as
     a predicate to determine if RESTART is intended to be invoked
     interactively.

 -- procedure: write-restart-report restart port
     Writes a description of RESTART to PORT.  This works by either
     displaying (if it is a string) or calling (if it is a procedure)
     the REPORTER that was supplied when the restart was created.


File: mit-scheme-ref.info,  Node: Condition Instances,  Next: Condition Types,  Prev: Restarts,  Up: Error System

16.5 Condition Instances
========================

A "condition", in addition to the information associated with its type,
usually contains other information that is not shared with other
conditions of the same type.  For example, the condition type associated
with "unbound variable" errors does not specify the name of the variable
that was unbound.  The additional information is captured in a
"condition" object, also called a "condition instance".

   In addition to information that is specific to a given type of
condition (such as the variable name for "unbound variable" conditions),
every condition instance also contains a continuation that encapsulates
the state of the computation in which the condition occurred.  This
continuation is used for analyzing the computation to learn more about
the context in which the condition occurred.  It is _not_ intended to
provide a mechanism for continuing the computation; that mechanism is
provided by restarts.

* Menu:

* Generating Operations on Conditions::
* Condition State::
* Simple Condition Instance Operations::


File: mit-scheme-ref.info,  Node: Generating Operations on Conditions,  Next: Condition State,  Prev: Condition Instances,  Up: Condition Instances

16.5.1 Generating Operations on Conditions
------------------------------------------

Scheme provides four procedures that take a condition type as input and
produce operations on the corresponding condition object.  These are
reminiscent of the operations on record types that produce record
operators (*note Records::).  Given a condition type it is possible to
generate: a constructor for instances of the type (using
'condition-constructor'); an accessor to extract the contents of a field
in instances of the type (using 'condition-accessor'); a predicate to
test for instances of the type (using 'condition-predicate'); and a
procedure to create and signal an instance of the type (using
'condition-signaller').

   Notice that the creation of a condition object is distinct from
signalling an occurrence of the condition.  Condition objects are
first-class; they may be created and never signalled, or they may be
signalled more than once.  Further notice that there are no procedures
for modifying conditions; once created, a condition cannot be altered.

 -- procedure: condition-constructor condition-type field-names
     Returns a constructor procedure that takes as arguments values for
     the fields specified in FIELD-NAMES and creates a condition of type
     CONDITION-TYPE.  FIELD-NAMES must be a list of symbols that is a
     subset of the FIELD-NAMES in CONDITION-TYPE.  The constructor
     procedure returned by 'condition-constructor' has signature

          (lambda (CONTINUATION RESTARTS . FIELD-VALUES) ...)

     where the FIELD-NAMES correspond to the FIELD-VALUES.  The
     constructor argument RESTARTS is described in *note Restarts::.
     Conditions created by the constructor procedure have '#f' for the
     values of all fields other than those specified by FIELD-NAMES.

     For example, the following procedure 'make-simple-warning'
     constructs a condition of type 'condition-type:simple-warning'
     given a continuation (where the condition occurred), a description
     of the restarts to be made available, a warning message, and a list
     of irritants that caused the warning:

          (define make-simple-warning
            (condition-constructor condition-type:simple-warning
                                   '(message irritants)))

 -- procedure: condition-accessor condition-type field-name
     Returns a procedure that takes as input a condition object of type
     CONDITION-TYPE and extracts the contents of the specified
     FIELD-NAME.  'condition-accessor' signals
     'error:bad-range-argument' if the FIELD-NAME isn't one of the named
     fields of CONDITION-TYPE; the returned procedure will signal
     'error:wrong-type-argument' if passed an object other than a
     condition of type CONDITION-TYPE or one of its specializations.

     If it is known in advance that a particular field of a condition
     will be accessed repeatedly it is worth constructing an accessor
     for the field using 'condition-accessor' rather than using the
     (possibly more convenient, but slower) 'access-condition'
     procedure.

 -- procedure: condition-predicate condition-type
     Returns a predicate procedure for testing whether an object is a
     condition of type CONDITION-TYPE or one of its specializations
     (there is no predefined way to test for a condition of a given type
     but _not_ a specialization of that type).

 -- procedure: condition-signaller condition-type field-names
          default-handler
     Returns a signalling procedure with parameters FIELD-NAMES.  When
     the signalling procedure is called it creates and signals a
     condition of type CONDITION-TYPE.  If the condition isn't handled
     (i.e. if no handler is invoked that causes an escape from the
     current continuation) the signalling procedure reduces to a call to
     DEFAULT-HANDLER with the condition as its argument.

     There are several standard procedures that are conventionally used
     for DEFAULT-HANDLER.  If CONDITION-TYPE is a specialization of
     'condition-type:error', DEFAULT-HANDLER should be the procedure
     'standard-error-handler'.  If CONDITION-TYPE is a specialization of
     'condition-type:warning', DEFAULT-HANDLER should be the procedure
     'standard-warning-handler'.  If CONDITION-TYPE is a specialization
     of 'condition-type:breakpoint', DEFAULT-HANDLER should be the
     procedure 'standard-breakpoint-handler'.


File: mit-scheme-ref.info,  Node: Condition State,  Next: Simple Condition Instance Operations,  Prev: Generating Operations on Conditions,  Up: Condition Instances

16.5.2 Condition Abstraction
----------------------------

The condition data type is abstracted through a predicate 'condition?'
and a set of accessor procedures.

 -- procedure: condition? object
     Returns '#f' if and only if OBJECT is not a condition.

 -- procedure: condition/type condition
     Returns the condition type of which CONDITION is an instance.

 -- procedure: condition/error? condition
     Returns '#t' if the CONDITION is an instance of condition type
     'condition-type:error' or a specialization of it, '#f' otherwise.

 -- procedure: condition/restarts condition
     Returns the list of restarts specified when CONDITION was created.

 -- procedure: condition/continuation condition
     Returns the continuation specified when CONDITION was created.
     This is provided for inspecting the state of the system when the
     condition occurred, _not_ for continuing or restarting the
     computation.

 -- procedure: write-condition-report condition port
     Writes a description of CONDITION to PORT, using the reporter
     function from the condition type associated with CONDITION.  See
     also 'condition/report-string'.


File: mit-scheme-ref.info,  Node: Simple Condition Instance Operations,  Prev: Condition State,  Up: Condition Instances

16.5.3 Simple Operations on Condition Instances
-----------------------------------------------

The simple procedures described in this section are built on top of the
more detailed abstraction of condition objects described above.  While
these procedures are sometimes easier to use, they are often less
efficient.

 -- procedure: make-condition condition-type continuation restarts
          field-plist
     Create a new condition object as an instance of CONDITION-TYPE,
     associated with CONTINUATION.  The CONTINUATION is provided for
     inspection purposes only, _not_ for restarting the computation.
     The RESTARTS argument is described in *note Restarts::.  The
     FIELD-PLIST is an alternating list of field names and values for
     those fields, where the field names are those that would be
     returned by '(condition-type/field-names CONDITION-TYPE)'.  It is
     used to provide values for fields in the condition object; fields
     with no value specified are set to '#f'.  Once a condition object
     has been created there is no way to alter the values of these
     fields.

 -- procedure: access-condition condition field-name
     Returns the value stored in the field FIELD-NAME within CONDITION.
     FIELD-NAME must be one of the names returned by
     '(condition-type/field-names (condition/type CONDITION))'.
     'access-condition' looks up the FIELD-NAME at runtime, so it is
     more efficient to use 'condition-accessor' to create an access
     function if the same field is to be extracted from several
     instances of the same condition type.

 -- procedure: condition/report-string condition
     Returns a string containing a report of the CONDITION.  This is
     generated by calling 'write-condition-report' on CONDITION and a
     string output port, and returning the output collected by the port
     as a string.


File: mit-scheme-ref.info,  Node: Condition Types,  Next: Taxonomy,  Prev: Condition Instances,  Up: Error System

16.6 Condition Types
====================

Each condition has a "condition type" object associated with it.  These
objects are used as a means of focusing on related classes of
conditions, first by concentrating all of the information about a
specific class of condition in a single place, and second by specifying
an inheritance relationship between types.  This inheritance
relationship forms the taxonomic structure of the condition hierarchy
(*note Taxonomy::).

   The following procedures consititute the abstraction for condition
types.

 -- procedure: make-condition-type name generalization field-names
          reporter
     Creates and returns a (new) condition type that is a specialization
     of GENERALIZATION (if it is a condition type) or is the root of a
     new tree of condition types (if GENERALIZATION is '#f').  For
     debugging purposes, the condition type has a NAME, and instances of
     this type contain storage for the fields specified by FIELD-NAMES
     (a list of symbols) in addition to the fields common to all
     conditions (TYPE, CONTINUATION and RESTARTS).

     REPORTER is used to produce a description of a particular condition
     of this type.  It may be a string describing the condition, a
     procedure of arity two (the first argument will be a condition of
     this type and the second a port) that will 'write' the message to
     the given port, or '#f' to specify that the reporter should be
     taken from the condition type GENERALIZATION (or produce an
     "undocumented condition of type ..." message if GENERALIZATION is
     '#f').  The conventions used to form descriptions are spelled out
     in *note Error Messages::.

 -- procedure: condition-type/error? condition-type
     Returns '#t' if the CONDITION-TYPE is 'condition-type:error' or a
     specialization of it, '#f' otherwise.

 -- procedure: condition-type/field-names condition-type
     Returns a list of all of the field names for a condition of type
     CONDITION-TYPE.  This is the set union of the fields specified when
     this CONDITION-TYPE was created with the
     'condition-type/field-names' of the generalization of this
     CONDITION-TYPE.

 -- procedure: condition-type/generalizations condition-type
     Returns a list of all of the generalizations of CONDITION-TYPE.
     Notice that every condition type is considered a generalization of
     itself.

 -- procedure: condition-type? object
     Returns '#f' if and only if OBJECT is not a condition type.


File: mit-scheme-ref.info,  Node: Taxonomy,  Prev: Condition Types,  Up: Error System

16.7 Condition-Type Taxonomy
============================

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
specializations of a given type relative to the type.  Note that the
variables that are bound to these condition types are prefixed by
'condition-type:'; for example, the type appearing in the following
table as 'simple-error' is stored in the variable
'condition-type:simple-error'.  Users are encouraged to add new
condition types by creating specializations of existing ones.

   Following the chart are detailed descriptions of the predefined
condition types.  Some of these types are marked as "abstract" types.
Abstract types are not intended to be used directly as the type of a
condition; they are to be used as generalizations of other types, and
for binding condition handlers.  Types that are not marked as abstract
are "concrete"; they are intended to be explicitly used as a condition's
type.

     serious-condition
         error
             simple-error
             illegal-datum
                 wrong-type-datum
                     wrong-type-argument
                     wrong-number-of-arguments
                 datum-out-of-range
                     bad-range-argument
                 inapplicable-object
             file-error
                 file-operation-error
                 derived-file-error
             port-error
                 derived-port-error
             variable-error
                 unbound-variable
                 unassigned-variable
             arithmetic-error
                 divide-by-zero
                 floating-point-overflow
                 floating-point-underflow
             control-error
                 no-such-restart
             not-loading
             primitive-procedure-error
                 system-call-error
     warning
         simple-warning
     simple-condition
     breakpoint

 -- condition type: condition-type:serious-condition
     This is an abstract type.  All serious conditions that require some
     form of intervention should inherit from this type.  In particular,
     all errors inherit from this type.

 -- condition type: condition-type:error
     This is an abstract type.  All errors should inherit from this
     type.

 -- condition type: condition-type:simple-error message irritants
     This is the condition generated by the 'error' procedure when its
     first argument is not a condition or condition type.  The fields
     MESSAGE and IRRITANTS are taken directly from the arguments to
     'error'; MESSAGE contains an object (usually a string) and
     IRRITANTS contains a list of objects.  The reporter for this type
     uses 'format-error-message' to generate its output from MESSAGE and
     IRRITANTS.

 -- condition type: condition-type:illegal-datum datum
     This is an abstract type.  This type indicates the class of errors
     in which a program discovers an object that lacks specific required
     properties.  Most commonly, the object is of the wrong type or is
     outside a specific range.  The DATUM field contains the offending
     object.

 -- condition type: condition-type:wrong-type-datum datum type
     This type indicates the class of errors in which a program
     discovers an object that is of the wrong type.  The TYPE field
     contains a string describing the type that was expected, and the
     DATUM field contains the object that is of the wrong type.

     (error:wrong-type-datum 3.4 "integer")  error->
     ;The object 3.4 is not an integer.
     ;To continue, call RESTART with an option number:
     ; (RESTART 1) => Return to read-eval-print level 1.

 -- procedure: error:wrong-type-datum datum type
     This procedure signals a condition of type
     'condition-type:wrong-type-datum'.  The DATUM and TYPE fields of
     the condition are filled in from the corresponding arguments to the
     procedure.

 -- condition type: condition-type:wrong-type-argument datum type
          operator operand
     This type indicates that a procedure was passed an argument of the
     wrong type.  The OPERATOR field contains the procedure (or a symbol
     naming the procedure), the OPERAND field indicates the argument
     position that was involved (this field contains either a symbol, a
     non-negative integer, or '#f'), the TYPE field contains a string
     describing the type that was expected, and the DATUM field contains
     the offending argument.

     (+ 'a 3)                                error->
     ;The object a, passed as the first argument to integer-add,
     ; is not the correct type.
     ;To continue, call RESTART with an option number:
     ; (RESTART 2) => Specify an argument to use in its place.
     ; (RESTART 1) => Return to read-eval-print level 1.

     (list-copy 3)
     ;The object 3, passed as an argument to list-copy, is not a list.
     ;To continue, call RESTART with an option number:
     ; (RESTART 1) => Return to read-eval-print level 1.

 -- procedure: error:wrong-type-argument datum type operator
     This procedure signals a condition of type
     'condition-type:wrong-type-argument'.  The DATUM, TYPE and OPERATOR
     fields of the condition are filled in from the corresponding
     arguments to the procedure; the OPERAND field of the condition is
     set to '#f'.

 -- condition type: condition-type:wrong-number-of-arguments datum type
          operands
     This type indicates that a procedure was called with the wrong
     number of arguments.  The DATUM field contains the procedure being
     called, the TYPE field contains the number of arguments that the
     procedure accepts, and the OPERANDS field contains a list of the
     arguments that were passed to the procedure.

     (car 3 4)                               error->
     ;The procedure car has been called with 2 arguments;
     ; it requires exactly 1 argument.
     ;To continue, call RESTART with an option number:
     ; (RESTART 1) => Return to read-eval-print level 1.

 -- procedure: error:wrong-number-of-arguments datum type operands
     This procedure signals a condition of type
     'condition-type:wrong-number-of-arguments'.  The DATUM, TYPE and
     OPERANDS fields of the condition are filled in from the
     corresponding arguments to the procedure.

 -- condition type: condition-type:datum-out-of-range datum
     This type indicates the class of errors in which a program
     discovers an object that is of the correct type but is otherwise
     out of range.  Most often, this type indicates that an index to
     some data structure is outside of the range of indices for that
     structure.  The DATUM field contains the offending object.

     (error:datum-out-of-range 3)            error->
     ;The object 3 is not in the correct range.
     ;To continue, call RESTART with an option number:
     ; (RESTART 1) => Return to read-eval-print level 1.

 -- procedure: error:datum-out-of-range datum
     This procedure signals a condition of type
     'condition-type:datum-out-of-range'.  The DATUM field of the
     condition is filled in from the corresponding argument to the
     procedure.

 -- condition type: condition-type:bad-range-argument datum operator
          operand
     This type indicates that a procedure was passed an argument that is
     of the correct type but is otherwise out of range.  Most often,
     this type indicates that an index to some data structure is outside
     of the range of indices for that structure.  The OPERATOR field
     contains the procedure (or a symbol naming the procedure), the
     OPERAND field indicates the argument position that was involved
     (this field contains either a symbol, a non-negative integer, or
     '#f'), and the DATUM field is the offending argument.

     (string-ref "abc" 3)                    error->
     ;The object 3, passed as the second argument to string-ref,
     ; is not in the correct range.
     ;To continue, call RESTART with an option number:
     ; (RESTART 2) => Specify an argument to use in its place.
     ; (RESTART 1) => Return to read-eval-print level 1.

 -- procedure: error:bad-range-argument datum operator
     This procedure signals a condition of type
     'condition-type:bad-range-argument'.  The DATUM and OPERATOR fields
     of the condition are filled in from the corresponding arguments to
     the procedure; the OPERAND field of the condition is set to '#f'.

 -- condition type: condition-type:inapplicable-object datum operands
     This type indicates an error in which a program attempted to apply
     an object that is not a procedure.  The object being applied is
     saved in the DATUM field, and the arguments being passed to the
     object are saved as a list in the OPERANDS field.

     (3 4)                                   error->
     ;The object 3 is not applicable.
     ;To continue, call RESTART with an option number:
     ; (RESTART 2) => Specify a procedure to use in its place.
     ; (RESTART 1) => Return to read-eval-print level 1.

 -- condition type: condition-type:file-error filename
     This is an abstract type.  It indicates that an error associated
     with a file has occurred.  For example, attempting to delete a
     nonexistent file will signal an error.  The FILENAME field contains
     a filename or pathname associated with the operation that failed.

 -- condition type: condition-type:file-operation-error filename verb
          noun reason operator operands
     This is the most common condition type for file system errors.  The
     FILENAME field contains the filename or pathname that was being
     operated on.  The VERB field contains a string which is the verb or
     verb phrase describing the operation being performed, and the NOUN
     field contains a string which is a noun or noun phrase describing
     the object being operated on.  The REASON field contains a string
     describing the error that occurred.  The OPERATOR field contains
     the procedure performing the operation (or a symbol naming that
     procedure), and the OPERANDS field contains a list of the arguments
     that were passed to that procedure.  For example, an attempt to
     delete a nonexistent file would have the following field values:

          filename        "/zu/cph/tmp/no-such-file"
          verb            "delete"
          noun            "file"
          reason          "no such file or directory"
          operator        file-remove
          operands        ("/zu/cph/tmp/no-such-file")

     and would generate a message like this:

          (delete-file "/zu/cph/tmp/no-such-file") error->
          ;Unable to delete file "/zu/cph/tmp/no-such-file" because:
          ; No such file or directory.
          ;To continue, call RESTART with an option number:
          ; (RESTART 3) => Try to delete the same file again.
          ; (RESTART 2) => Try to delete a different file.
          ; (RESTART 1) => Return to read-eval-print level 1.

 -- procedure: error:file-operation index verb noun reason operator
          operands
     This procedure signals a condition of type
     'condition-type:file-operation-error'.  The fields of the condition
     are filled in from the corresponding arguments to the procedure,
     except that the filename is taken as the INDEXth element of
     OPERANDS.

 -- condition type: condition-type:derived-file-error filename condition
     This is another kind of file error, which is generated by obscure
     file-system errors that do not fit into the standard categories.
     The FILENAME field contains the filename or pathname that was being
     operated on, and the CONDITION field contains a condition
     describing the error in more detail.  Usually the CONDITION field
     contains a condition of type 'condition-type:system-call-error'.

 -- procedure: error:derived-file filename condition
     This procedure signals a condition of type
     'condition-type:derived-file-error'.  The FILENAME and CONDITION
     fields of the condition are filled in from the corresponding
     arguments to the procedure.

 -- condition type: condition-type:port-error port
     This is an abstract type.  It indicates that an error associated
     with a I/O port has occurred.  For example, writing output to a
     file port can signal an error if the disk containing the file is
     full; that error would be signalled as a port error.  The PORT
     field contains the associated port.

 -- condition type: condition-type:derived-port-error port condition
     This is a concrete type that is signalled when port errors occur.
     The PORT field contains the port associated with the error, and the
     CONDITION field contains a condition object that describes the
     error in more detail.  Usually the CONDITION field contains a
     condition of type 'condition-type:system-call-error'.

 -- procedure: error:derived-port port condition
     This procedure signals a condition of type
     'condition-type:derived-port-error'.  The PORT and CONDITION fields
     of the condition are filled in from the corresponding arguments to
     the procedure.

 -- condition type: condition-type:variable-error location environment
     This is an abstract type.  It indicates that an error associated
     with a variable has occurred.  The LOCATION field contains the name
     of the variable, and the ENVIRONMENT field contains the environment
     in which the variable was referenced.

 -- condition type: condition-type:unbound-variable location environment
     This type is generated when a program attempts to access or modify
     a variable that is not bound.  The LOCATION field contains the name
     of the variable, and the ENVIRONMENT field contains the environment
     in which the reference occurred.

     foo                                     error->
     ;Unbound variable: foo
     ;To continue, call RESTART with an option number:
     ; (RESTART 3) => Specify a value to use instead of foo.
     ; (RESTART 2) => Define foo to a given value.
     ; (RESTART 1) => Return to read-eval-print level 1.

 -- condition type: condition-type:unassigned-variable location
          environment
     This type is generated when a program attempts to access a variable
     that is not assigned.  The LOCATION field contains the name of the
     variable, and the ENVIRONMENT field contains the environment in
     which the reference occurred.

     foo                                     error->
     ;Unassigned variable: foo
     ;To continue, call RESTART with an option number:
     ; (RESTART 3) => Specify a value to use instead of foo.
     ; (RESTART 2) => Set foo to a given value.
     ; (RESTART 1) => Return to read-eval-print level 1.

 -- condition type: condition-type:arithmetic-error operator operands
     This is an abstract type.  It indicates that a numerical operation
     was unable to complete because of an arithmetic error.  (For
     example, division by zero.)  The OPERATOR field contains the
     procedure that implements the operation (or a symbol naming the
     procedure), and the OPERANDS field contains a list of the arguments
     that were passed to the procedure.

 -- condition type: condition-type:divide-by-zero operator operands
     This type is generated when a program attempts to divide by zero.
     The OPERATOR field contains the procedure that implements the
     failing operation (or a symbol naming the procedure), and the
     OPERANDS field contains a list of the arguments that were passed to
     the procedure.

     (/ 1 0)
     ;Division by zero signalled by /.
     ;To continue, call RESTART with an option number:
     ; (RESTART 1) => Return to read-eval-print level 1.

 -- procedure: error:divide-by-zero operator operands
     This procedure signals a condition of type
     'condition-type:divide-by-zero'.  The OPERATOR and OPERANDS fields
     of the condition are filled in from the corresponding arguments to
     the procedure.

 -- condition type: condition-type:floating-point-overflow operator
          operands
     This type is generated when a program performs an arithmetic
     operation that results in a floating-point overflow.  The OPERATOR
     field contains the procedure that implements the operation (or a
     symbol naming the procedure), and the OPERANDS field contains a
     list of the arguments that were passed to the procedure.

 -- condition type: condition-type:floating-point-underflow operator
          operands
     This type is generated when a program performs an arithmetic
     operation that results in a floating-point underflow.  The OPERATOR
     field contains the procedure that implements the operation (or a
     symbol naming the procedure), and the OPERANDS field contains a
     list of the arguments that were passed to the procedure.

 -- condition type: condition-type:primitive-procedure-error operator
          operands
     This is an abstract type.  It indicates that an error was generated
     by a primitive procedure call.  Primitive procedures are
     distinguished from ordinary procedures in that they are not written
     in Scheme but instead in the underlying language of the Scheme
     implementation.  The OPERATOR field contains the procedure that
     implements the operation (or a symbol naming the procedure), and
     the OPERANDS field contains a list of the arguments that were
     passed to the procedure.

 -- condition type: condition-type:system-call-error operator operands
          system-call error-type
     This is the most common condition type generated by primitive
     procedures.  A condition of this type indicates that the primitive
     made a system call to the operating system, and that the system
     call signalled an error.  The system-call error is reflected back
     to Scheme as a condition of this type, except that many common
     system-call errors are automatically translated by the Scheme
     implementation into more useful forms; for example, a system-call
     error that occurs while trying to delete a file will be translated
     into a condition of type 'condition-type:file-operation-error'.
     The OPERATOR field contains the procedure that implements the
     operation (or a symbol naming the procedure), and the OPERANDS
     field contains a list of the arguments that were passed to the
     procedure.  The SYSTEM-CALL and ERROR-TYPE fields contain symbols
     that describe the specific system call that was being made and the
     error that occurred, respectively; these symbols are completely
     operating-system dependent.

 -- condition type: condition-type:control-error
     This is an abstract type.  It describes a class of errors relating
     to program control flow.

 -- condition type: condition-type:no-such-restart name
     This type indicates that a named restart was not active when it was
     expected to be.  Conditions of this type are signalled by several
     procedures that look for particular named restarts, for example
     'muffle-warning'.  The NAME field contains the name that was being
     searched for.

     (muffle-warning)                        error->
     ;The restart named muffle-warning is not bound.
     ;To continue, call RESTART with an option number:
     ; (RESTART 1) => Return to read-eval-print level 1.

 -- procedure: error:no-such-restart name
     This procedure signals a condition of type
     'condition-type:no-such-restart'.  The NAME field of the condition
     is filled in from the corresponding argument to the procedure.

 -- condition type: condition-type:not-loading
     A condition of this type is generated when the procedure
     'current-load-pathname' is called from somewhere other than inside
     a file being loaded.

     (current-load-pathname)                 error->
     ;No file being loaded.
     ;To continue, call RESTART with an option number:
     ; (RESTART 1) => Return to read-eval-print level 1.

 -- condition type: condition-type:warning
     This is an abstract type.  All warnings should inherit from this
     type.  Warnings are a class of conditions that are usually handled
     by informing the user of the condition and proceeding the
     computation normally.

 -- condition type: condition-type:simple-warning message irritants
     This is the condition generated by the 'warn' procedure.  The
     fields MESSAGE and IRRITANTS are taken directly from the arguments
     to 'warn'; MESSAGE contains an object (usually a string) and
     IRRITANTS contains a list of objects.  The reporter for this type
     uses 'format-error-message' to generate its output from MESSAGE and
     IRRITANTS.

 -- condition type: condition-type:simple-condition message irritants
     This is an unspecialized condition that does not fall into any of
     the standard condition classes.  The MESSAGE field contains an
     object (usually a string) and IRRITANTS contains a list of objects.
     The reporter for this type uses 'format-error-message' to generate
     its output from MESSAGE and IRRITANTS.

 -- condition type: condition-type:breakpoint environment message prompt
     A condition of this type is generated by the breakpoint mechanism.
     The contents of its fields are beyond the scope of this document.


File: mit-scheme-ref.info,  Node: Graphics,  Next: Win32 Package Reference,  Prev: Error System,  Up: Top

17 Graphics
***********

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
uniform manner.  At the present time only one type of graphics device is
implemented on each operating system.

   Procedures are available for drawing points, lines, and text;
defining the coordinate system; clipping graphics output; controlling
some of the drawing characteristics; and controlling the output buffer
(for devices that perform buffering).  Additionally, devices may support
custom operations, such as control of colors.

   There are some constraints on the arguments to the procedures
described in this chapter.  Any argument named GRAPHICS-DEVICE must be a
graphics device object that was returned from a call to
'make-graphics-device'.  Any argument that is a coordinate must be
either an exact integer or an inexact real.

* Menu:

* Opening and Closing of Graphics Devices::
* Coordinates for Graphics::
* Drawing Graphics::
* Characteristics of Graphics Output::
* Buffering of Graphics Output::
* Clipping of Graphics Output::
* Custom Graphics Operations::
* Images::
* X Graphics::                  Graphics on the X Window System
* Win32 Graphics::              Graphics on Microsoft Windows and Windows NT


File: mit-scheme-ref.info,  Node: Opening and Closing of Graphics Devices,  Next: Coordinates for Graphics,  Prev: Graphics,  Up: Graphics

17.1 Opening and Closing of Graphics Devices
============================================

 -- procedure: graphics-type-available? graphics-device-type
     This predicate returns '#t' if the graphics system named by the
     symbol GRAPHICS-DEVICE-TYPE is implemented by the Scheme system.
     Otherwise it returns '#f', in which case it is an error to attempt
     to make a graphics device using GRAPHICS-DEVICE-TYPE.

 -- procedure: enumerate-graphics-types
     This procedure returns a list of symbols which are the names of all
     the graphics device types that are supported by the Scheme system.
     The result is useful in deciding what additional arguments to
     supply to 'make-graphics-device', as each device type typically has
     a unique way of specifying the initial size, shape and other
     attributes.

 -- procedure: make-graphics-device graphics-device-type object ...
     This operation creates and returns a graphics device object.
     GRAPHICS-DEVICE-TYPE is a symbol naming a graphics device type, and
     both the number and the meaning of the remaining arguments is
     determined by that type (see the description of each device type
     for details); GRAPHICS-DEVICE-TYPE must satisfy
     'graphics-type-available?'.  GRAPHICS-DEVICE-TYPE may also be '#f',
     in which case the graphics device type is chosen by the system from
     what is available.  This allows completely portable graphics
     programs to be written provided no custom graphics operations are
     used.  When GRAPHICS-DEVICE-TYPE is '#f' no further arguments may
     be given; each graphics device type will use some "sensible"
     defaults.  If more control is required then the program should use
     one of the two procedures above to dispatch on the available types.

     This procedure opens and initializes the device, which remains
     valid until explicitly closed by the procedure 'graphics-close'.
     Depending on the implementation of the graphics device, if this
     object is reclaimed by the garbage collector, the graphics device
     may remain open or it may be automatically closed.  While a
     graphics device remains open the resources associated with it are
     not released.

 -- procedure: graphics-close graphics-device
     Closes GRAPHICS-DEVICE, releasing its resources.  Subsequently it
     is an error to use GRAPHICS-DEVICE.


File: mit-scheme-ref.info,  Node: Coordinates for Graphics,  Next: Drawing Graphics,  Prev: Opening and Closing of Graphics Devices,  Up: Graphics

17.2 Coordinates for Graphics
=============================

Each graphics device has two different coordinate systems associated
with it: "device coordinates" and "virtual coordinates".  Device
coordinates are generally defined by low-level characteristics of the
device itself, and often cannot be changed.  Most device coordinate
systems are defined in terms of pixels, and usually the upper-left-hand
corner is the origin of the coordinate system, with X coordinates
increasing to the right and Y coordinates increasing downwards.

   In contrast, virtual coordinates are more flexible in the units
employed, the position of the origin, and even the direction in which
the coordinates increase.  A virtual coordinate system is defined by
assigning coordinates to the edges of a device.  Because these edge
coordinates are arbitrary real numbers, any Cartesian coordinate system
can be defined.

   All graphics procedures that use coordinates are defined on virtual
coordinates.  For example, to draw a line at a particular place on a
device, the virtual coordinates for the endpoints of that line are
given.

   When a graphics device is initialized, its virtual coordinate system
is reset so that the left edge corresponds to an x-coordinate of '-1',
the right edge to x-coordinate '1', the bottom edge to y-coordinate
'-1', and the top edge to y-coordinate '1'.

 -- procedure: graphics-device-coordinate-limits graphics-device
     Returns (as multiple values) the device coordinate limits for
     GRAPHICS-DEVICE.  The values, which are exact non-negative
     integers, are: X-LEFT, Y-BOTTOM, X-RIGHT, and Y-TOP.

 -- procedure: graphics-coordinate-limits graphics-device
     Returns (as multiple values) the virtual coordinate limits for
     GRAPHICS-DEVICE.  The values, which are real numbers, are: X-LEFT,
     Y-BOTTOM, X-RIGHT, and Y-TOP.

 -- procedure: graphics-set-coordinate-limits graphics-device x-left
          y-bottom x-right y-top
     Changes the virtual coordinate limits of GRAPHICS-DEVICE to the
     given arguments.  X-LEFT, Y-BOTTOM, X-RIGHT, and Y-TOP must be real
     numbers.  Subsequent calls to 'graphics-coordinate-limits' will
     return the new limits.  This operation has no effect on the
     device's displayed contents.

     Note: This operation usually resets the clip rectangle, although it
     is not guaranteed to do so.  If a clip rectangle is in effect when
     this procedure is called, it is necessary to redefine the clip
     rectangle afterwards.


File: mit-scheme-ref.info,  Node: Drawing Graphics,  Next: Characteristics of Graphics Output,  Prev: Coordinates for Graphics,  Up: Graphics

17.3 Drawing Graphics
=====================

The procedures in this section provide the basic drawing capabilities of
Scheme's graphics system.

 -- procedure: graphics-clear graphics-device
     Clears the display of GRAPHICS-DEVICE.  Unaffected by the current
     drawing mode.

 -- procedure: graphics-draw-point graphics-device x y
     Draws a single point on GRAPHICS-DEVICE at the virtual coordinates
     given by X and Y, using the current drawing mode.

 -- procedure: graphics-erase-point graphics-device x y
     Erases a single point on GRAPHICS-DEVICE at the virtual coordinates
     given by X and Y.  This procedure is unaffected by the current
     drawing mode.

This is equivalent to

     (lambda (device x y)
       (graphics-bind-drawing-mode device 0
         (lambda ()
           (graphics-draw-point device x y))))

 -- procedure: graphics-draw-line graphics-device x-start y-start x-end
          y-end
     X-START, Y-START, X-END, and Y-END must be real numbers.  Draws a
     line on GRAPHICS-DEVICE that connects the points (X-START, Y-START)
     and (X-END, Y-END).  The line is drawn using the current drawing
     mode and line style.

 -- procedure: graphics-draw-text graphics-device x y string
     Draws the characters of STRING at the point (X, Y) on
     GRAPHICS-DEVICE, using the current drawing mode.  The
     characteristics of the characters drawn are device-dependent, but
     all devices are initialized so that the characters are drawn
     upright, from left to right, with the leftmost edge of the leftmost
     character at X, and the baseline of the characters at Y.

   The following two procedures provide an alternate mechanism for
drawing lines, which is more akin to using a plotter.  They maintain a
"cursor", which can be positioned to a particular point and then dragged
to another point, producing a line.  Sequences of connected line
segments can be drawn by dragging the cursor from point to point.

   Many graphics operations have an unspecified effect on the cursor.
The following exceptions are guaranteed to leave the cursor unaffected:

     graphics-device-coordinate-limits
     graphics-coordinate-limits
     graphics-enable-buffering
     graphics-disable-buffering
     graphics-flush
     graphics-bind-drawing-mode
     graphics-set-drawing-mode
     graphics-bind-line-style
     graphics-set-line-style

   The initial state of the cursor is unspecified.

 -- procedure: graphics-move-cursor graphics-device x y
     Moves the cursor for GRAPHICS-DEVICE to the point (X, Y).  The
     contents of the device's display are unchanged.

 -- procedure: graphics-drag-cursor graphics-device x y
     Draws a line from GRAPHICS-DEVICE's cursor to the point (X, Y),
     simultaneously moving the cursor to that point.  The line is drawn
     using the current drawing mode and line style.


File: mit-scheme-ref.info,  Node: Characteristics of Graphics Output,  Next: Buffering of Graphics Output,  Prev: Drawing Graphics,  Up: Graphics

17.4 Characteristics of Graphics Output
=======================================

Two characteristics of graphics output are so useful that they are
supported uniformly by all graphics devices: "drawing mode" and "line
style".  A third characteristic, "color", is equally useful (if not more
so), but implementation restrictions prohibit a uniform interface.

   The "drawing mode", an exact integer in the range '0' to '15'
inclusive, determines how the figure being drawn is combined with the
background over which it is drawn to generate the final result.
Initially the drawing mode is set to "source", so that the new output
overwrites whatever appears in that place.  Useful alternative drawing
modes can, for example, erase what was already there, or invert it.

   Altogether 16 boolean operations are available for combining the
source (what is being drawn) and the destination (what is being drawn
over).  The source and destination are combined by the device on a
pixel-by-pixel basis as follows:

     Mode    Meaning
     ----    -------
     0       ZERO [erase; use background color]
     1       source AND destination
     2       source AND (NOT destination)
     3       source
     4       (NOT source) AND destination
     5       destination
     6       source XOR destination
     7       source OR destination
     8       NOT (source OR destination)
     9       NOT (source XOR destination)
     10      NOT destination
     11      source OR (NOT destination)
     12      NOT source
     13      (NOT source) OR destination
     14      (NOT source) OR (NOT destination)
     15      ONE [use foreground color]

   The "line style", an exact integer in the range '0' to '7' inclusive,
determines which parts of a line are drawn in the foreground color, and
which in the background color.  The default line style, "solid", draws
the entire line in the foreground color.  Alternatively, the "dash"
style alternates between foreground and background colors to generate a
dashed line.  This capability is useful for plotting several things on
the same graph.

   Here is a table showing the name and approximate pattern of the
different styles.  A '1' in the pattern represents a foreground pixel,
while a '-' represents a background pixel.  Note that the precise output
for each style will vary from device to device.  The only style that is
guaranteed to be the same for every device is "solid".

     Style   Name                    Pattern
     -----   -------                 -------
     0       solid                   1111111111111111
     1       dash                    11111111--------
     2       dot                     1-1-1-1-1-1-1-1-
     3       dash dot                1111111111111-1-
     4       dash dot dot            11111111111-1-1-
     5       long dash               11111111111-----
     6       center dash             111111111111-11-
     7       center dash dash        111111111-11-11-

 -- procedure: graphics-bind-drawing-mode graphics-device drawing-mode
          thunk
 -- procedure: graphics-bind-line-style graphics-device line-style thunk
     These procedures bind the drawing mode or line style, respectively,
     of GRAPHICS-DEVICE, invoke the procedure THUNK with no arguments,
     then undo the binding when THUNK returns.  The value of each
     procedure is the value returned by THUNK.  Graphics operations
     performed during THUNK's dynamic extent will see the newly bound
     mode or style as current.

 -- procedure: graphics-set-drawing-mode graphics-device drawing-mode
 -- procedure: graphics-set-line-style graphics-device line-style
     These procedures change the drawing mode or line style,
     respectively, of GRAPHICS-DEVICE.  The mode or style will remain in
     effect until subsequent changes or bindings.


File: mit-scheme-ref.info,  Node: Buffering of Graphics Output,  Next: Clipping of Graphics Output,  Prev: Characteristics of Graphics Output,  Up: Graphics

17.5 Buffering of Graphics Output
=================================

To improve performance of graphics output, most graphics devices provide
some form of buffering.  By default, Scheme's graphics procedures flush
this buffer after every drawing operation.  The procedures in this
section allow the user to control the flushing of the output buffer.

 -- procedure: graphics-enable-buffering graphics-device
     Enables buffering for GRAPHICS-DEVICE.  In other words, after this
     procedure is called, graphics operations are permitted to buffer
     their drawing requests.  This usually means that the drawing is
     delayed until the buffer is flushed explicitly by the user, or
     until it fills up and is flushed by the system.

 -- procedure: graphics-disable-buffering graphics-device
     Disables buffering for GRAPHICS-DEVICE.  By default, all graphics
     devices are initialized with buffering disabled.  After this
     procedure is called, all drawing operations perform their output
     immediately, before returning.

     Note: 'graphics-disable-buffering' flushes the output buffer if
     necessary.

 -- procedure: graphics-flush graphics-device
     Flushes the graphics output buffer for GRAPHICS-DEVICE.  This
     operation has no effect for devices that do not support buffering,
     or if buffering is disabled for the device.


File: mit-scheme-ref.info,  Node: Clipping of Graphics Output,  Next: Custom Graphics Operations,  Prev: Buffering of Graphics Output,  Up: Graphics

17.6 Clipping of Graphics Output
================================

Scheme provides a rudimentary mechanism for restricting graphics output
to a given rectangular subsection of a graphics device.  By default,
graphics output that is drawn anywhere within the device's virtual
coordinate limits will appear on the device.  When a "clip rectangle" is
specified, however, output that would have appeared outside the clip
rectangle is not drawn.

   Note that changing the virtual coordinate limits for a device will
usually reset the clip rectangle for that device, as will any operation
that affects the size of the device (such as a window resizing
operation).  However, programs should not depend on this.

 -- procedure: graphics-set-clip-rectangle graphics-device x-left
          y-bottom x-right y-top
     Specifies the clip rectangle for GRAPHICS-DEVICE in virtual
     coordinates.  X-LEFT, Y-BOTTOM, X-RIGHT, and Y-TOP must be real
     numbers.  Subsequent graphics output is clipped to the intersection
     of this rectangle and the device's virtual coordinate limits.

 -- procedure: graphics-reset-clip-rectangle graphics-device
     Eliminates the clip rectangle for GRAPHICS-DEVICE.  Subsequent
     graphics output is clipped to the virtual coordinate limits of the
     device.


File: mit-scheme-ref.info,  Node: Custom Graphics Operations,  Next: Images,  Prev: Clipping of Graphics Output,  Up: Graphics

17.7 Custom Graphics Operations
===============================

In addition to the standard operations, a graphics device may support
"custom operations".  For example, most devices have custom operations
to control color.  'graphics-operation' is used to invoke custom
operations.

 -- procedure: graphics-operation graphics-device name object ...
     Invokes the graphics operation on GRAPHICS-DEVICE whose name is the
     symbol NAME, passing it the remaining arguments.  This procedure
     can be used to invoke the standard operations, as well as custom
     operations that are specific to a particular graphics device type.
     The names of the standard graphics operations are formed by
     removing the 'graphics-' prefix from the corresponding procedure.
     For example, the following are equivalent:

          (graphics-draw-point device x y)
          (graphics-operation device 'draw-point x y)

     For information on the custom operations for a particular device,
     see the documentation for its type.


File: mit-scheme-ref.info,  Node: Images,  Next: X Graphics,  Prev: Custom Graphics Operations,  Up: Graphics

17.8 Images
===========

Some graphics device types support images, which are rectangular pieces
of picture that may be drawn into a graphics device.  Images are often
called something else in the host graphics system, such as bitmaps or
pixmaps.  The operations supported vary between devices, so look under
the different device types to see what operations are available.  All
devices that support images support the following operations.

 -- operation on graphics-device: create-image width height
     Images are created using the 'create-image' graphics operation,
     specifying the WIDTH and HEIGHT of the image in device coordinates
     (pixels).

          (graphics-operation device 'create-image 200 100)

     The initial contents of an image are unspecified.

     'create-image' is a graphics operation rather than a procedure
     because the kind of image returned depends on the kind of graphics
     device used and the options specified in its creation.  The image
     may be used freely with other graphics devices created with the
     same attributes, but the effects of using an image with a graphics
     device with different attributes (for example, different colors) is
     undefined.  Under X, the image is display dependent.

 -- operation on graphics-device: draw-image x y image
     The image is copied into the graphics device at the specified
     position.

 -- operation on graphics-device: draw-subimage x y image im-x im-y w h
     Part of the image is copied into the graphics device at the
     specified (X, Y) position.  The part of the image that is copied is
     the rectangular region at IM-X and IM-Y and of width W and height
     H.  These four numbers are given in device coordinates (pixels).

 -- procedure: image? object
     Returns '#t' if OBJECT is an image, otherwise returns '#f'.

 -- procedure: image/destroy image
     This procedure destroys IMAGE, returning storage to the system.
     Programs should destroy images after they have been used because
     even modest images may use large amounts of memory.  Images are
     reclaimed by the garbage collector, but they may be implemented
     using memory outside of Scheme's heap.  If an image is reclaimed
     before being destroyed, the implementation might not deallocate
     that non-heap memory, which can cause a subsequent call to
     'create-image' to fail because it is unable to allocate enough
     memory.

 -- procedure: image/height image
     Returns the height of the image in device coordinates.

 -- procedure: image/width image
     Returns the width of the image in device coordinates.

 -- procedure: image/fill-from-byte-vector image bytes
     The contents of IMAGE are set in a device-dependent way, using one
     byte per pixel from BYTES (a string).  Pixels are filled row by row
     from the top of the image to the bottom, with each row being filled
     from left to right.  There must be at least '(* (image/height
     IMAGE) (image/width IMAGE))' bytes in BYTES.


File: mit-scheme-ref.info,  Node: X Graphics,  Next: Win32 Graphics,  Prev: Images,  Up: Graphics

17.9 X Graphics
===============

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
control their size, position, colors, and mapping.  The X graphics
device type supports images, which are implemented as Xlib 'XImage'
objects.  X display, window, and image objects are automatically closed
if they are reclaimed by the garbage collector.

* Menu:

* X Graphics Type::
* Utilities for X Graphics::
* Custom Operations on X Graphics Devices::


File: mit-scheme-ref.info,  Node: X Graphics Type,  Next: Utilities for X Graphics,  Prev: X Graphics,  Up: X Graphics

17.9.1 X Graphics Type
----------------------

A graphics device for X windows is created by passing the symbol 'x' as
the graphics device type name to 'make-graphics-device':

     (make-graphics-device 'x #!optional DISPLAY GEOMETRY SUPPRESS-MAP?)

where DISPLAY is either a display object, '#f', or a string; GEOMETRY is
either '#f' or a string; and SUPPRESS-MAP? is a boolean or a vector (see
below).  A new window is created on the appropriate display, and a
graphics device representing that window is returned.

   DISPLAY specifies which X display the window is to be opened on; if
it is '#f' or a string, it is passed as an argument to 'x-open-display',
and the value returned by that procedure is used in place of the
original argument.  GEOMETRY is an X geometry string, or '#f' which
means to use the default geometry (which is specified as a resource).

   SUPPRESS-MAP?, if given, may take two forms.  First, it may be a
boolean: if '#f' (the default), the window is automatically mapped after
it is created; otherwise, '#t' means to suppress this automatic mapping.
The second form is a vector of three elements.  The first element is a
boolean with the same meaning as the boolean form of SUPPRESS-MAP?.  The
second element is a string, which specifies an alternative resource name
to be used for looking up the window's resources.  The third element is
also a string, which specifies a class name for looking up the window's
resources.  The default value for SUPPRESS-MAP? is '#f'.

   The default resource and class names are '"schemeGraphics"' and
'"SchemeGraphics"' respectively.

   The window is initialized using the resource and class names
specified by SUPPRESS-MAP?, and is sensitive to the following resource
properties:

     Property        Class           Default
     --------        -----           -------
     geometry        Geometry        512x384+0+0
     font            Font            fixed
     borderWidth     BorderWidth     2
     internalBorder  BorderWidth     [border width]
     background      Background      white
     foreground      Foreground      black
     borderColor     BorderColor     [foreground color]
     cursorColor     Foreground      [foreground color]
     pointerColor    Foreground      [foreground color]

   The window is created with a 'backing_store' attribute of 'Always'.
The window's name and icon name are initialized to '"scheme-graphics"'.


File: mit-scheme-ref.info,  Node: Utilities for X Graphics,  Next: Custom Operations on X Graphics Devices,  Prev: X Graphics Type,  Up: X Graphics

17.9.2 Utilities for X Graphics
-------------------------------

 -- procedure: x-graphics/open-display display-name
     Opens a connection to the display whose name is DISPLAY-NAME,
     returning a display object.  If unable to open a connection, '#f'
     is returned.  DISPLAY-NAME is normally a string, which is an X
     display name in the usual form; however, '#f' is also allowed,
     meaning to use the value of the unix environment variable
     'DISPLAY'.

 -- procedure: x-graphics/close-display display
     Closes DISPLAY; after calling this procedure, it is an error to use
     DISPLAY for any purpose.  Any windows that were previously opened
     on DISPLAY are destroyed and their resources returned to the
     operating system.

 -- procedure: x-close-all-displays
     Closes all open connections to X displays.  Equivalent to calling
     'x-close-display' on all open displays.

 -- procedure: x-geometry-string x y width height
     This procedure creates and returns a standard X geometry string
     from the given arguments.  X and Y must be either exact integers or
     '#f', while WIDTH and HEIGHT must be either exact non-negative
     integers or '#f'.  Usually either X and Y are both specified or
     both '#f'; similarly for WIDTH and HEIGHT.  If only one of the
     elements of such a pair is specified, it is ignored.

     Examples:

          (x-geometry-string #f #f 100 200) => "100x200"
          (x-geometry-string 2 -3 100 200) => "100x200+2-3"
          (x-geometry-string 2 -3 #f #f) => "+2-3"

     Note that the X and Y arguments cannot distinguish between '+0' and
     '-0', even though these have different meanings in X. If either of
     those arguments is '0', it means '+0' in X terminology.  If you
     need to distinguish these two cases you must create your own
     geometry string using Scheme's string and number primitives.


File: mit-scheme-ref.info,  Node: Custom Operations on X Graphics Devices,  Prev: Utilities for X Graphics,  Up: X Graphics

17.9.3 Custom Operations on X Graphics Devices
----------------------------------------------

Custom operations are invoked using the procedure 'graphics-operation'.
For example,

     (graphics-operation device 'set-foreground-color "blue")

 -- operation on x-graphics-device: set-background-color color-name
 -- operation on x-graphics-device: set-foreground-color color-name
 -- operation on x-graphics-device: set-border-color color-name
 -- operation on x-graphics-device: set-mouse-color color-name
     These operations change the colors associated with a window.
     COLOR-NAME must be a string, which is the X server's name for the
     desired color.  'set-border-color' and 'set-mouse-color'
     immediately change the border and mouse-cursor colors.
     'set-background-color' and 'set-foreground-color' change the colors
     to be used when drawing, but have no effect on anything drawn prior
     to their invocation.  Because changing the background color affects
     the entire window, we recommend calling 'graphics-clear' on the
     window's device afterwards.  Color names include both mnemonic
     names, like '"red"', and intensity names specified in the
     '"#RRGGBB"' notation.

 -- operation on x-graphics-device: draw-arc x y radius-x radius-y
          angle-start angle-sweep fill?

     Operation 'draw-arc' draws or fills an arc.  An arc is a segment of
     a circle, which may have been stretched along the x- or y- axis to
     form an ellipse.

     The parameters X, Y, RADIUS-X and RADIUS-Y describe the circle and
     ANGLE-START and ANGLE-SWEEP choose which part of the circle is
     drawn.  The arc is drawn on the graphics device with the center of
     the circle at the virtual coordinates given by X and Y.  RADIUS-X
     and RADIUS-Y determine the size of the circle in virtual coordinate
     units.

     The parameter ANGLE-START determines where the arc starts.  It is
     measured in degrees in an anti-clockwise direction, starting at 3
     o'clock.  ANGLE-SWEEP determines how much of the circle is drawn.
     It too is measured anti-clockwise in degrees.  A negative value
     means the measurement is in a clockwise direction.

     Note that the angles are determined on a unit circle before it is
     stretched into an ellipse, so the actual angles that you will see
     on the computer screen depends on all of: RADIUS-X and RADIUS-Y,
     the window size, and the virtual coordinates.

     If FILL? is '#f' then just the segment of the circle is drawn,
     otherwise the arc is filled in a pie-slice fashion.

     This draws a quarter circle pie slice, standing on its point, with
     point at virtual coordinates (3,5):

          (graphics-operation g 'draw-arc 3 5 .5 .5 45 90 #t)

 -- operation on x-graphics-device: draw-circle x y radius
 -- operation on x-graphics-device: fill-circle x y radius
     These operations draw a circle (outline) or a filled circle (solid)
     at on the graphics device at the virtual coordinates given by X and
     Y.  These operations could be implemented trivially interms of the
     'draw-arc' operation.

 -- operation on x-graphics-device: set-border-width width
 -- operation on x-graphics-device: set-internal-border-width width
     These operations change the external and internal border widths of
     a window.  WIDTH must be an exact non-negative integer, specified
     in pixels.  The change takes place immediately.  Note that changing
     the internal border width can cause displayed graphics to be
     garbled; we recommend calling 'graphics-clear' on the window's
     device after doing so.

 -- operation on x-graphics-device: set-font font-name
     Changes the font used when drawing text in a window.  FONT-NAME
     must be a string that is a font name known to the X server.  This
     operation does not affect text drawn prior to its invocation.

 -- operation on x-graphics-device: set-mouse-shape shape-number
     Changes the shape of the mouse cursor.  SHAPE-NUMBER is an exact
     non-negative integer that is used as an index into the mouse-shape
     font; when multiplied by 2 this number corresponds to an index in
     the file
     '/usr/include/X11/cursorfont.h'.

 -- operation on x-graphics-device: map-window
 -- operation on x-graphics-device: withdraw-window
     These operations control the mapping of windows.  They correspond
     directly to Xlib's 'XMapWindow' and 'XWithdrawWindow'.

 -- operation on x-graphics-device: resize-window width height
     Changes the size of a window.  WIDTH and HEIGHT must be exact
     non-negative integers.  The operation corresponds directly to
     Xlib's 'XResizeWindow'.

     This operation resets the virtual coordinate system and the clip
     rectangle.

 -- operation on x-graphics-device: move-window x y
     Changes the position of a window on the display.  X and Y must be
     exact integers.  The operation corresponds directly to Xlib's
     'XMoveWindow'.  Note that the coordinates X and Y do not take the
     external border into account, and therefore will not position the
     window as you might like.  The only reliable way to position a
     window is to ask a window manager to do it for you.

 -- operation on x-graphics-device: get-default resource property
     This operation corresponds directly to Xlib's 'XGetDefault'.
     RESOURCE and PROPERTY must be strings.  The operation returns the
     character string corresponding to the association of RESOURCE and
     PROPERTY; if no such association exists, '#f' is returned.

 -- operation on x-graphics-device: copy-area source-x-left source-y-top
          width height destination-x-left destination-y-top
     This operation copies the contents of the rectangle specified by
     SOURCE-X-LEFT, SOURCE-Y-TOP, WIDTH, and HEIGHT to the rectangle of
     the same dimensions at DESTINATION-X-LEFT and DESTINATION-Y-TOP.

 -- operation on x-graphics-device: font-structure font-name
     Returns a Scheme equivalent of the X font structure for the font
     named FONT-NAME.  If the string FONT-NAME does not name a font
     known to the X server, or names a 16-bit font, '#f' is returned.

 -- procedure: x-font-structure/name font-structure
 -- procedure: x-font-structure/direction font-structure
 -- procedure: x-font-structure/all-chars-exist font-structure
 -- procedure: x-font-structure/default-char font-structure
 -- procedure: x-font-structure/min-bounds font-structure
 -- procedure: x-font-structure/max-bounds font-structure
 -- procedure: x-font-structure/start-index font-structure
 -- procedure: x-font-structure/character-bounds font-structure
 -- procedure: x-font-structure/max-ascent font-structure
 -- procedure: x-font-structure/max-descent font-structure
     These procedures extract the components of the font description
     structure returned by the X graphics operation 'font-structure'.  A
     more complete description of these components appears in
     documentation of the 'XLoadQueryFont' Xlib call.  'start-index' is
     the index of the first character available in the font.  The
     'min-bounds' and 'max-bounds' components are structures of type
     'x-character-bounds', and the 'character-bounds' component is a
     vector of the same type.

 -- procedure: x-character-bounds/lbearing character-bounds
 -- procedure: x-character-bounds/rbearing character-bounds
 -- procedure: x-character-bounds/width character-bounds
 -- procedure: x-character-bounds/ascent character-bounds
 -- procedure: x-character-bounds/descent character-bounds
     These procedures extract components of objects of type
     'x-character-bounds'.  A more complete description of them appears
     in documentation of the
     'XLoadQueryFont' Xlib call.


File: mit-scheme-ref.info,  Node: Win32 Graphics,  Prev: X Graphics,  Up: Graphics

17.10 Win32 Graphics
====================

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 bitmaps (DIBs).

   The Win32 graphics device type is implemented as a top level window.
'graphics-enable-buffering' is implemented and gives a 2x to 4x speedup
on many graphics operations.  As a convenience, when buffering is
enabled clicking on the graphics window's title bar effects a
'graphics-flush' operation.  The user has the benefit of the increased
performance and the ability to view the progress in drawing at the click
of a mouse button.

* Menu:

* Win32 Graphics Type::
* Custom Operations for Win32 Graphics::  Custom Operations for Win32 Graphics Devices


File: mit-scheme-ref.info,  Node: Win32 Graphics Type,  Next: Custom Operations for Win32 Graphics,  Prev: Win32 Graphics,  Up: Win32 Graphics

17.10.1 Win32 Graphics Type
---------------------------

Win32 graphics devices are created by specifying the symbol 'win32' as
the GRAPHICS-DEVICE-TYPE argument to 'make-graphics-device'.  The Win32
graphics device type is implemented as a top-level window and supports
color drawing in addition to the standard Scheme graphics operations.

   Graphics devices are opened as follows:

     (make-graphics-device 'win32 #!optional WIDTH HEIGHT PALETTE)

where WIDTH and HEIGHT specify the size, in pixels, of the drawing area
in the graphics window (i.e. excluding the frame).  PALETTE determines
the colors available for drawing in the window.

   When a color is specified for drawing, the nearest color available in
the palette is used.  Permitted values for PALETTE are

''grayscale'
     The window allocates colors from a grayscale palette of
     approximately 236 shades of gray.

''grayscale-128'
     The window allocates colors from a grayscale palette of 128 shades
     of gray.

''standard'
     The standard palette has good selection of colors and grays.

'#f' or ''system'
     The colors available are those in the system palette.  There are
     usually 16 to 20 colors in the system palette and these are usually
     sufficent for simple applications like line drawings and x-vs-y
     graphs of mathematical functions.  Drawing with the system palette
     can be more efficient.

If PALETTE is not specified then the 'standard' palette is used.


File: mit-scheme-ref.info,  Node: Custom Operations for Win32 Graphics,  Prev: Win32 Graphics Type,  Up: Win32 Graphics

17.10.2 Custom Operations for Win32 Graphics
--------------------------------------------

Custom operations are invoked using the procedure 'graphics-operation'.
For example,

     (graphics-operation device 'set-foreground-color "blue")

 -- operation on win32-graphics-device: set-background-color color-name
 -- operation on win32-graphics-device: set-foreground-color color-name
     These operations change the colors associated with a window.
     COLOR-NAME must be of one of the valid color specification forms
     listed below.  'set-background-color' and 'set-foreground-color'
     change the colors to be used when drawing, but have no effect on
     anything drawn prior to their invocation.  Because changing the
     background color affects the entire window, we recommend calling
     'graphics-clear' on the window's device afterwards.

     The foreground color affects the drawing of text, points, lines,
     ellipses and filled polygons.

     Colors are specified in one of three ways:

     An integer
          This is the Win32 internal RGB value.

     By name
          A limited number of names are understood by the system.  Names
          are strings, e.g. '"red"', '"blue"', '"black"'.  More names
          can be registered with the 'define-color' operation.

     RGB (Red-Green-Blue) triples
          A triple is either a vector or list of three integers in the
          range 0-255 inclusive which specify the intensity of the red,
          green and blue components of the color.  Thus '#(0 0 0)' is
          black, '(0 0 128)' is dark blue and '#(255 255 255)' is white.

     If the color is not available in the graphics device then the
     nearest available color is used instead.

 -- operation on win32-graphics-device: define-color name spec
     Define the string NAME to be the color specified by SPEC.  SPEC may
     be any acceptable color specification.  Note that the color names
     defined this way are available to any Win32 graphics device, and
     the names do _not_ have to be defined for each device.

     Color names defined by this interface may also be used when setting
     the colors of the Scheme console window, or the colors of Edwin
     editor windows.

 -- operation on win32-graphics-device: find-color name
     Looks up a color previously defined by 'define-color'.  This
     returns the color in its most efficient form for operations
     'set-foreground-color' or 'set-background-color'.

 -- operation on win32-graphics-device: draw-ellipse left top right
          bottom
     Draw an ellipse.  LEFT, TOP, RIGHT and BOTTOM indicate the
     coordinates of the bounding rectangle of the ellipse.  Circles are
     merely ellipses with equal width and height.  Note that the
     bounding rectangle has horizontal and vertical sides.  Ellipses
     with rotated axes cannot be drawn.  The rectangle applies to the
     center of the line used to draw the ellipse; if the line width has
     been set to greater than 1 then the ellipse will spill outside the
     bounding rectange by half of the line width.

 -- operation on win32-graphics-device: fill-polygon points
     Draws a filled polygon using the current foreground color.  POINTS
     is a vector of real numbers.  The numbers are in the order x1 y1 x2
     y2 ... xn yn.  For example,

          (graphics-operation device 'fill-polygon #(0 0 0 1 1 0))

     draws a solid triangular region between the points (0, 0), (0, 1)
     and (1, 0).

 -- operation on win32-graphics-device: load-bitmap pathname
     The graphics device contents and size are initialized from the
     windows bitmap file specified by PATHNAME.  If no file type is
     supplied then a '".BMP"' extension is added.  If a clip rectangle
     is in effect when this procedure is called, it is necessary to
     redefine the clip rectangle afterwards.

 -- operation on win32-graphics-device: save-bitmap pathname
     The graphics device contents are saved as a bitmap to the file
     specified by PATHNAME.  If no file type is supplied then a '".BMP"'
     extension is added.  The saved bitmap may be incorporated into
     documents or printed.

 -- operation on win32-graphics-device: move-window x y
     The graphics device window is moved to the screen position
     specified by X and Y.

 -- operation on win32-graphics-device: resize-window width height
     The graphics device window is resized to the specified WIDTH and
     HEIGHT in device coordinates (pixels).  If a clip rectangle is in
     effect when this procedure is called, it is necessary to redefine
     the clip rectangle afterwards.

 -- operation on win32-graphics-device: set-line-width width
     This operation sets the line width for future drawing of lines,
     points and ellipses.  It does not affect existing lines and has no
     effect on filled polygons.  The line width is specified in device
     units.  The default and initial value of this parameter is 1 pixel.

 -- operation on win32-graphics-device: set-window-name name
     This sets the window title to the string NAME.  The window is given
     the name '"Scheme Graphics"' at creation.

 -- operation on win32-graphics-device: set-font handle
     Sets the font for drawing text.  Currently not well supported.  If
     you can get a Win32 font handle it can be used here.

 -- operation on win32-graphics-device: copy-area source-x-left
          source-y-top width height destination-x-left destination-y-top
     This operation copies the contents of the rectangle specified by
     SOURCE-X-LEFT, SOURCE-Y-TOP, WIDTH, and HEIGHT to the rectangle of
     the same dimensions at DESTINATION-X-LEFT and DESTINATION-Y-TOP.


File: mit-scheme-ref.info,  Node: Win32 Package Reference,  Next: GNU Free Documentation License,  Prev: Graphics,  Up: Top

18 Win32 Package Reference
**************************

The Win32 implementation is still in a state of development.  It is
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 those which
are a consequence of the Intel x86 architecture.

* Menu:

* Win32 Package Overview::
* Foreign function interface::
* Device Independent Bitmap Utilities::


File: mit-scheme-ref.info,  Node: Win32 Package Overview,  Next: Foreign function interface,  Prev: Win32 Package Reference,  Up: Win32 Package Reference

18.1 Overview
=============

The Win32 implementation is still in a state of development.  It is
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 those which
are a consequence of the Intel x86 architecture.

   Thus this documentation is not definitive, it merely outlines how the
current system works.  Parts of the system will change and any project
implemented using the win32 system must plan for a re-implementation
stage.

   The Win32 implementation has several components:

   * Special microcode primitives.

   * A foreign function interface (FFI) for calling procedures in
     dynamically linked libraries (DLLs).

   * An interface for Edwin.

   * The Win32 package provides support for using the features of the
     Windows 3.1 and Windows NT 3.1 environments.

   * Device Independent Bitmap utilities.  These are used by the win32
     Scheme Graphics implementation.  (The Scheme Graphics
     implementation is described in the Reference Manual).

   Note that all the names in the Win32 support are part of the 'win32'
package.  The names are bound in the '(win32)' environment, and do not
appear as bindings in the user or root environments.  An effect of this
is that it is far easier to develop Win32 software in the '(win32)'
package environment or a child environment.


File: mit-scheme-ref.info,  Node: Foreign function interface,  Next: Device Independent Bitmap Utilities,  Prev: Win32 Package Overview,  Up: Win32 Package Reference

18.2 Foreign Function Interface
===============================

The Win32 foreign function interface (FFI) is a primitive and fairly
simple system for calling procedures written in C in a dynamically
linked library (DLL). Both user's procedures from a custom DLL and
system procedures (e.g. MessageBox) are called using the same mechanism.

   *Warning*: The FFI as it stands has several flaws which make it
difficult to use reliably.  It is expected that both the interface to
and the mechanisms used by the FFI will be changed in the future.  We
provide it, and this documentation, only to give people an early start
in accessing some of the features of Win32 from Scheme.  Should you use
it in an experiment we welcome any feedback.

   The FFI is designed for calling C procedures that use C data types
rather than Scheme data objects.  Thus it is not possible to write and
call a C procedure that returns, for example, a Scheme list.  The object
returned will always be an integer (which may represent the address of a
C data structure).

   *Warning*: It is extremely dangerous to try to pass Scheme callback
procedures to C procedures.  It is only possible by passing integer
'handles' rather than the actual procedures, and even so, if a garbage
collection occurs during the execution of the callback procedure objects
in Scheme's heap will have moved.  Thus in a foreign procedure that has
a callback and a string, after calling the callback the string value may
no longer be valid.  Playing this game requires a profound knowledge of
the implementation.

   The interface to the FFI has two main components: a language for
declaring the types of values passed to and returned from the foreign
procedures and a form for declaring foreign procedures.

* Menu:

* Windows Types::
* Windows Foreign Procedures::
* Win32 API names and procedures::


File: mit-scheme-ref.info,  Node: Windows Types,  Next: Windows Foreign Procedures,  Prev: Foreign function interface,  Up: Foreign function interface

18.2.1 Windows Types
--------------------

Foreign types are designed to represent a correspondence between a
Scheme data type that is used to represent an object within the Scheme
world and a C data type that represents the data object in the C world.
Thus we cannot manipulate true C objects in Scheme, nor can we
manipulate Scheme objects in C.

   Each foreign type has four aspects that together ensure that the
correspondence between the Scheme and C objects is maintained.  These
aspects are all encoded as procedures that either check for validity or
convert between representations.  Thus a foreign type is not a
declarative type so much as a procedural description of how to pass the
type.  The underlying foreign procedure call mechanism can pass integers
and vector-like Scheme objects, and returns integer values.  All other
objects must be translated into integers or some other basic type, and
must be recovered from integers.

   The aspects are:

CHECK
     A predicate that returns '#t' if the argument is of an acceptable
     Scheme type, otherwise returns '#f'.  The CHECK procedure is used
     for type-checking.

CONVERT
     A procedure of one argument which returns a Scheme object of one of
     the basic types.  It is used to convert an object into a 'simpler'
     object that will eventually be converted into a C object.  The
     legal simpler objects are integers and strings.

RETURN-CONVERT
     A procedure of one argument that, given an integer, returns a
     Scheme object of a type satisfying CHECK.  Its purpose is to
     convert the result returned by the foreign procedure into a Scheme
     value.

REVERT
     Some C procedures modify one or more of their arguments.  These
     arguments are passed by reference, i.e. as a pointer to their
     address.  Since a Scheme object might have a different memory
     layout and storage conventions, it must be passed by copy-in and
     copy-out rather than by reference.  REVERT is a procedure of two
     parameters, the original object passed and the result of CONVERT on
     that object.  REVERT may then inspect the converted object and copy
     back the changes to the original.

 -- special form: define-windows-type name check convert return revert
 -- special form: define-similar-windows-type name model [check [convert
          [return [revert]]]]
     Both forms define a windows type.  The first form defines a type in
     terms of its aspects as described above.  The second defines the
     type as being like another type, except for certain aspects, which
     are redefined.  NAME is the name of the type.  MODEL is the name of
     a type.  CHECK, CONVERT, RETURN and REVERT are procedures or the
     value '#f'.  A '#f' means use the default value, which in the
     second form means use the definition provided for MODEL.  The
     defaults are

     CHECK
          '(lambda (x) #t)', i.e. unchecked.
     CONVERT
          '(lambda (x) x)', i.e. no translation performed.
     RETURN
          '(lambda (x) x)', i.e. no translation performed.
     REVERT
          '(lambda (x y) unspecific)', i.e. no update performed

     The 'unchecked' windows type (see below) is defined as:

          (define-windows-type unchecked #f #f #f #f)

     Windows types are _not_ first class values, so they cannot be
     stored in variables or defined using 'define':

          (define my-type unchecked)            error->  Unbound variable
          (define-similar-windows-type my-type unchecked)
                                                ;; the correct way

     Scheme characters must be converted to integers.  This is
     accomplished as follows:

          (define-windows-type char
             char?          ; check
             char->integer  ; convert
             integer->char  ; convert return value
             #f             ; cannot be passed by reference
          )

 -- windows type: unchecked
     The type which is not checked and undergoes only the basic
     conversion from a Scheme integer to a C integer or from a Scheme
     string to a C pointer to the first byte of the string.  Returned
     'unchecked' values are returned as integers.

 -- windows type: bool
     Scheme booleans are analogous to C integers '0' and '1'.  Windows
     type 'bool' have been defined as:

          (define-windows-type bool
             boolean?
             (lambda (x) (if x 1 0))
             (lambda (x) (if (eq? x 0) #f #t))
             #f)

 -- windows type: char
     Scheme characters are converted into C objects of type 'char',
     which are indistinguishable from small integers.

 -- windows type: int
 -- windows type: uint
 -- windows type: long
 -- windows type: ulong
 -- windows type: short
 -- windows type: ushort
 -- windows type: word
 -- windows type: byte
     Various integer types that are passed without conversion.

 -- windows type: string
     A string that is passed as a C pointer of type 'char*' to the first
     character in the string.

 -- windows type: char*
     A string or '#f'.  The string is passed as a pointer to characters.
     The string is correctly null-terminated.  '#f' is passed as the
     null pointer.  This is an example where there is a more complex
     mapping between C objects and Scheme objects.  C's 'char*' type is
     represented as one of two Scheme types depending on its value.
     This allows us us to distinguish between the C string (pointer)
     that points to the empty sequence of characters and the null
     pointer (which doesnt point anywhere).

 -- windows type: handle
 -- windows type: hbitmap
 -- windows type: hbrush
 -- windows type: hcursor
 -- windows type: hdc
 -- windows type: hicon
 -- windows type: hinstance
 -- windows type: hmenu
 -- windows type: hpalette
 -- windows type: hpen
 -- windows type: hrgn
 -- windows type: hwnd
     Various kinds of Win32 handle.  These names correspond to the same,
     but all uppercase, names in the Windows C language header files.
     Win32 API calls are the source of values of this type and the
     values are meaningless except as arguments to other Win32 API
     calls.  Currently these values are represented as integers but we
     expect that Win32 handles will in future be represented by
     allocated Scheme objects (e.g. records) that will allow predicates
     (e.g. 'hmenu?') and sensible interlocking with the garbage
     collector to free the programmer of the current tedious allocation
     and deallocation of handles.

 -- windows type: resource-id
     A Windows resource identifier is either a small integer or a
     string.  In C, this distinction is possible because pointers look
     like larger integers, so a machine word representing a small
     integer can be distinguished from a machine word that is a pointer
     to the text of the name of the resource.


File: mit-scheme-ref.info,  Node: Windows Foreign Procedures,  Next: Win32 API names and procedures,  Prev: Windows Types,  Up: Foreign function interface

18.2.2 Windows Foreign Procedures
---------------------------------

Foreign procedures are declared as callable entry-points in a module,
usually a dynamically linked library (DLL).

 -- procedure: find-module name
     Returns a module suitable for use in creating procedures with
     'windows-procedure'.  NAME is a string which is the name of a DLL
     file.  Internally, 'find-module' uses the 'LoadLibrary' Win32 API,
     so NAME should conform to the specifications for this call.  NAME
     should be either a full path name of a DLL, or the name of a DLL
     that resides in the same directory as the Scheme binary
     'SCHEME.EXE' or in the system directory.

     The module returned is a description for the DLL, and the DLL need
     not necessarily be linked at or immediately after this call.  DLL
     modules are linked on need and unlinked before Scheme exits and
     when there are no remaining references to entry points after a
     garbage-collection.  This behavior ensures that the Scheme system
     can run when a DLL is absent, provided the DLL is not actually used
     (i.e. no attempt is made to call a procedure in the DLL).

 -- variable: gdi32.dll
     This variable is bound to the module describing the 'GDI32.DLL'
     library, which contains the Win32 API graphics calls, e.g.
     'LineTo'.

 -- variable: kernel32.dll
     This variable is bound to the module describing the 'KERNEL32.DLL'
     library.

 -- variable: user32.dll
     This variable is bound to the module describing the 'USER32.DLL'
     library.  This module contains many useful Win32 API procedures,
     like 'MessageBox' and 'SetWindowText'.

 -- special form: windows-procedure (name (parameter type) ...)
          return-type module entry-name [options]
     This form creates a procedure, and could be thought of as
     "foreign-named-lambda".  The form creates a Scheme procedure that
     calls the C procedure identified by the exported entry point
     ENTRY-NAME in the module identified by the value of MODULE.  Both
     ENTRY-NAME and MODULE are evaluated at procedure creation time, so
     either may be expression.  ENTRY-NAME must evaluate to a string and
     MODULE must evaluate to a module as returned by 'find-module'.
     These are the only parts of the form that are evaluated at
     procedure creation time.

     NAME is the name of the procedure and is for documentation purposes
     only.  This form _does not_ define a procedure called NAME.  It is
     more like 'lambda'.  The name might be used for debugging and
     pretty-printing.

     A windows procedure has a fixed number of parameters (i.e. no
     'rest' parameters or 'varargs'), each of which is named and
     associated with a windows type TYPE.  Both the name PARAMETER and
     the windows type TYPE must be symbols and are not evaluated.  The
     procedure returns a value of the windows type RETURN-TYPE.

     The following example creates a procedure that takes a window
     handle ('hwnd') and a string and returns a boolean ('bool') result.
     The procedure does this by calling the 'SetWindowText' entry in the
     module that is the value of the variable 'user32.dll'.  The
     variable 'set-window-title' is defined to have this procedure as
     it's value.

          (define set-window-title
            (windows-procedure
             (set-window-text (window hwnd) (text string))
             bool user32.dll "SetWindowText"))

          (set-window-title my-win "Hi")
                                   =>  #t
                                   ;; Changes window's title/text

          set-window-title         =>  #[compiled-procedure  ...]
          set-window-text          error->  Unbound variable

     When there are no OPTIONS the created procedure will (a) check its
     arguments against the types, (b) convert the arguments, (c) call
     the C procedure and (d) convert the returned value.  No reversion
     is performed, even if one of the TYPES has a reversion defined.
     (Reverted types are rare [I have never used one], so paying a cost
     for this unless it is used seems silly).

     The following options are allowed:

     'with-reversions'
          The reversions are included in the type conversions.

     'expand'
          A synonym for 'with-reversions'.

     SCHEME CODE
          The SCHEME CODE is placed between steps (a) and (b) in the
          default process.  The Scheme code can enforce constraints on
          the arguments, including constraints between arguments such as
          checking that an index refers to a valid position in a string.

     If both options (i.e. 'with-reversions' and Scheme code) are used,
     'with-reversions' must appear first.  There can be arbitrarily many
     Scheme expression.


File: mit-scheme-ref.info,  Node: Win32 API names and procedures,  Prev: Windows Foreign Procedures,  Up: Foreign function interface

18.2.3 Win32 API names and procedures
-------------------------------------

This section is a moving target.

   The '#define' values from 'wingdi.h' and 'winuser.h' are available as
bindings in the '(win32)' package environment.  The '#define' symbols
are all uppercase; these have been translated to all lowercase Scheme
identifiers, thus 'WM_LBUTTONUP' is the scheme variable 'wm_lbuttonup'.
As Scheme is case insensitive, the upper-case version may be used and
probably should to make the code look more like conventional Windows
code.  The Scheme bindings have been produced automagically.  Most of
the '#define'-symbols contain an underscore so there are not many name
clashes.  There is one very notable name clash, however: 'ERROR' is
'#define'd to 0, which shadows the scheme procedure 'error' in the root
package environment.  To signal an error, use 'access' to get 'error'
from the system global environment:

     (declare (usual-integrations))
     ...
     ((access error system-global-environment) "Complain" ...)

   The set of procedures is incomplete because procedures have been
added on a by-need basis for the implementation of other parts of the
system, e.g. Scheme Graphics.  Look in the implementation for further
details.

   Win32 API procedure names have been uniformly converted into Scheme
identifiers as follows:

   * A leading uppercase letter is translated into a lowercase letter.
   * Subsequent sequences of uppercase letters are translated into
     lowercase letters preceeded by a hyphen (minus symbol), i.e.
     hyphens are inserted at a lowercase to uppercase transition.
   * Predicates beginning with 'Is' finally have a question-mark
     appended.

Example: applying these rules to 'IsWindow' yields 'is-window?', and
'GetDC' is translated into 'get-dc'.


File: mit-scheme-ref.info,  Node: Device Independent Bitmap Utilities,  Prev: Foreign function interface,  Up: Win32 Package Reference

18.3 Device Independent Bitmap Utilities
========================================

The Device Independent Bitmap (DIB) utilities library 'DIBUTILS.DLL' and
the associated procedures in 'dib.scm' in the Win32 system source is an
example of how to use the foreign function interface to access and
manipulate non-Scheme objects.

 -- windows type: dib
     In the C world a DIB is a "handle" to a piece of memory containing
     the bits that represent information about the image and the pixels
     of the image.  The handle is a machine-word sized piece of data
     which may be thought of as a 32 bit integer.  The handle may be
     null (i.e. zero), indicating that there is no block of memory
     describing the DIB. The null value is usually returned by C
     functions that are supposed to create a DIB but failed, for some
     reason like the memory could not be allocated or a file could not
     be opened.

     In the Scheme world a DIB is a structure containing information
     about the bitmap (specifically the integer that represents the
     handle).  We also include '#f' in the 'dib' windows type to mirror
     the null handle error value.

          (define dib-result
            (lambda (handle)
              (if (= handle 0)
                  #f
                  (make-dib handle))))

          (define dib-arg
            (lambda (dib)
              (if dib
                  (cell-contents (dib-handle dib))
                  0)))

          (define-windows-type dib
            (lambda (thing) (or (dib? thing) (eq? thing #f)))
            dib-arg
            dib-result)

* Menu:

* DIB procedures::
* Other parts of the DIB Utilities implementation::


File: mit-scheme-ref.info,  Node: DIB procedures,  Next: Other parts of the DIB Utilities implementation,  Prev: Device Independent Bitmap Utilities,  Up: Device Independent Bitmap Utilities

18.3.1 DIB procedures
---------------------

The following procedures have typed parameters, using the same
convention as 'windows-procedure'.

 -- procedure: open-dib (filename string)
     Return type: DIB.  Calls the 'OpenDIB' entry of 'DIBUTILS.DLL'.  If
     the return value is not '#f' then the file FILENAME was found,
     successfully opened, and the contents were suitable for loading
     into memory as a device independent bitmap.

 -- procedure: write-dib (filename string) (dib dib)
     Return type: BOOL.  Calls the 'WriteDIB' entry of 'DIBUTILS.DLL'.
     Returns '#t' if the file FILENAME could be opened and written to.
     After this operation the file contains the bitmap data in a
     standard format that is understood by 'open-dib' and various system
     utilities like the bitmap editor.  Any problems resulting in
     failure are signalled by a '#f' return value.

 -- procedure: bitmap-from-dib (dib dib) (palette hpalette)
     Return type: HBITMAP.  Calls the 'BitmapFromDib' entry of
     'DIBUTILS.DLL'.  The returned value is a device dependent bitmap.
     The colours from the DIB are matched against colors in PALETTE.

 -- procedure: dib-from-bitmap (bitmap hbitmap) (style dword) (bits
          word) (palette hpalette)
     Return type: DIB.  Returns a DIB containing the same image as the
     device dependent bitmap BITMAP.  STYLE determines the kind of DIB,
     e.g. compression style.  Calls the 'DibFromBitmap' entry of
     'DIBUTILS.DLL'.

 -- procedure: dib-blt (dest hdc) (x int) (y int) (w int) (h int) (src
          dib) (src-x int) (src-y int) (raster-op long)
     Return type: BOOL.  Calls the 'DibBlt' entry of 'DIBUTILS.DLL'.
     Similar to the Win32 API 'BitBlt' call, but draws a DIB rather than
     a piece of another device context.  Draws the DIB on device context
     HDC at position (X,Y).  A rectangle of width W and height H is
     copied from position (SRC-X,SRC-Y) of DIB.  RASTER-OP is supposed
     to allow the source and destination to be combined but I don't
     think I got this right so stick to 'SRCCOPY'.

 -- procedure: delete-dib (dib dib)
     Return type: BOOL.  This procedure reclaims the storage occupied by
     a DIB. After being deleted, the DIB should not be used.  This
     procedure allows the programmer to reclaim external heap storage
     rather than risking it running out before the next garbage
     collection.

 -- procedure: dib-height (dib dib)
     Return type: INT.  Calls the 'DibHeight' expand entry of
     'DIBUTILS.DLL', which returns the height of the bitmap in pixels.

 -- procedure: dib-width (dib dib)
     Return type: INT.  Calls the 'DibWidth' entry of 'DIBUTILS.DLL',
     which returns the width of the bitmap in pixels.

 -- procedure: copy-bitmap (bm hbitmap)
     Return type: HBITMAP.  Calls the 'CopyBitmap' of 'DIBUTILS.DLL',
     which creates a new bitmap with the same size and contents as the
     original.

 -- procedure: create-dib (width int) (height int) (style int) (depth
          int) (palette hpalette)
     Return type: DIB.  Calls the 'CreateDIB' entry of 'DIBUTILS.DLL'.
     Creates a DIB of WIDTH by HEIGHT pixels and DEPTH bits of colour
     information.  The STYLE parameter determines how the bitmap is
     stored.  I have only ever used 'BI_RGB'.  If DEPTH<=8 then the
     PALETTE determines the DIB's colour table.

 -- procedure: crop-bitmap (bm hbitmap) (left int) (top int) (right int)
          (bottom int)
     Return type: HBITMAP.  Calls the 'CropBitmap' entry of
     'DIBUTILS.DLL'.  Returns a new bitmap containing the image from a
     region of the original.

 -- procedure: dib-set-pixels-unaligned dib (pixels string)
     Return type: BOOL.  Calls the 'DIBSetPixelsUnaligned' entry of
     'DIBUTILS.DLL'.  Stuffs bytes from PIXELS into the bitmap.  There
     are no alignment constraints on PIXELS (the usual way of doing this
     is to use the 'SetDIBits' function which requires that every scan
     line of the bitmap is 32-bit word aligned, even if the scan lines
     are not a multiple of 4 bytes long).  doing this


File: mit-scheme-ref.info,  Node: Other parts of the DIB Utilities implementation,  Prev: DIB procedures,  Up: Device Independent Bitmap Utilities

18.3.2 Other parts of the DIB Utilities implementation
------------------------------------------------------

The 'DIBUTILS.DLL' library is an ordinary DLL. See the standard
Microsoft Windows documentation on how to create DLLs.  Look at the code
in the 'WIN32/DIBUTILS' directory of the Scheme source.

   Please note:
   * For the foreign function interface to find the procedures they must
     be declared as exports in the '.DEF' definition file.

   * To load the '.DLL' file use the 'find-module' Scheme function.
     Look at 'WIN32/DIB.SCM' to see how this is done.

   * The current system works with C procedures with the '__stdcall' and
     '__cdecl' calling conventions but _not_ the '__fastcall' calling
     convention.


File: mit-scheme-ref.info,  Node: GNU Free Documentation License,  Next: Binding Index,  Prev: Win32 Package Reference,  Up: Top

Appendix A GNU Free Documentation License
*****************************************

                      Version 1.2, November 2002

     Copyright (C) 2000,2001,2002 Free Software Foundation, Inc.
     51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA

     Everyone is permitted to copy and distribute verbatim copies
     of this license document, but changing it is not allowed.

  0. PREAMBLE

     The purpose of this License is to make a manual, textbook, or other
     functional and useful document "free" in the sense of freedom: to
     assure everyone the effective freedom to copy and redistribute it,
     with or without modifying it, either commercially or
     noncommercially.  Secondarily, this License preserves for the
     author and publisher a way to get credit for their work, while not
     being considered responsible for modifications made by others.

     This License is a kind of "copyleft", which means that derivative
     works of the document must themselves be free in the same sense.
     It complements the GNU General Public License, which is a copyleft
     license designed for free software.

     We have designed this License in order to use it for manuals for
     free software, because free software needs free documentation: a
     free program should come with manuals providing the same freedoms
     that the software does.  But this License is not limited to
     software manuals; it can be used for any textual work, regardless
     of subject matter or whether it is published as a printed book.  We
     recommend this License principally for works whose purpose is
     instruction or reference.

  1. APPLICABILITY AND DEFINITIONS

     This License applies to any manual or other work, in any medium,
     that contains a notice placed by the copyright holder saying it can
     be distributed under the terms of this License.  Such a notice
     grants a world-wide, royalty-free license, unlimited in duration,
     to use that work under the conditions stated herein.  The
     "Document", below, refers to any such manual or work.  Any member
     of the public is a licensee, and is addressed as "you".  You accept
     the license if you copy, modify or distribute the work in a way
     requiring permission under copyright law.

     A "Modified Version" of the Document means any work containing the
     Document or a portion of it, either copied verbatim, or with
     modifications and/or translated into another language.

     A "Secondary Section" is a named appendix or a front-matter section
     of the Document that deals exclusively with the relationship of the
     publishers or authors of the Document to the Document's overall
     subject (or to related matters) and contains nothing that could
     fall directly within that overall subject.  (Thus, if the Document
     is in part a textbook of mathematics, a Secondary Section may not
     explain any mathematics.)  The relationship could be a matter of
     historical connection with the subject or with related matters, or
     of legal, commercial, philosophical, ethical or political position
     regarding them.

     The "Invariant Sections" are certain Secondary Sections whose
     titles are designated, as being those of Invariant Sections, in the
     notice that says that the Document is released under this License.
     If a section does not fit the above definition of Secondary then it
     is not allowed to be designated as Invariant.  The Document may
     contain zero Invariant Sections.  If the Document does not identify
     any Invariant Sections then there are none.

     The "Cover Texts" are certain short passages of text that are
     listed, as Front-Cover Texts or Back-Cover Texts, in the notice
     that says that the Document is released under this License.  A
     Front-Cover Text may be at most 5 words, and a Back-Cover Text may
     be at most 25 words.

     A "Transparent" copy of the Document means a machine-readable copy,
     represented in a format whose specification is available to the
     general public, that is suitable for revising the document
     straightforwardly with generic text editors or (for images composed
     of pixels) generic paint programs or (for drawings) some widely
     available drawing editor, and that is suitable for input to text
     formatters or for automatic translation to a variety of formats
     suitable for input to text formatters.  A copy made in an otherwise
     Transparent file format whose markup, or absence of markup, has
     been arranged to thwart or discourage subsequent modification by
     readers is not Transparent.  An image format is not Transparent if
     used for any substantial amount of text.  A copy that is not
     "Transparent" is called "Opaque".

     Examples of suitable formats for Transparent copies include plain
     ASCII without markup, Texinfo input format, LaTeX input format,
     SGML or XML using a publicly available DTD, and standard-conforming
     simple HTML, PostScript or PDF designed for human modification.
     Examples of transparent image formats include PNG, XCF and JPG.
     Opaque formats include proprietary formats that can be read and
     edited only by proprietary word processors, SGML or XML for which
     the DTD and/or processing tools are not generally available, and
     the machine-generated HTML, PostScript or PDF produced by some word
     processors for output purposes only.

     The "Title Page" means, for a printed book, the title page itself,
     plus such following pages as are needed to hold, legibly, the
     material this License requires to appear in the title page.  For
     works in formats which do not have any title page as such, "Title
     Page" means the text near the most prominent appearance of the
     work's title, preceding the beginning of the body of the text.

     A section "Entitled XYZ" means a named subunit of the Document
     whose title either is precisely XYZ or contains XYZ in parentheses
     following text that translates XYZ in another language.  (Here XYZ
     stands for a specific section name mentioned below, such as
     "Acknowledgements", "Dedications", "Endorsements", or "History".)
     To "Preserve the Title" of such a section when you modify the
     Document means that it remains a section "Entitled XYZ" according
     to this definition.

     The Document may include Warranty Disclaimers next to the notice
     which states that this License applies to the Document.  These
     Warranty Disclaimers are considered to be included by reference in
     this License, but only as regards disclaiming warranties: any other
     implication that these Warranty Disclaimers may have is void and
     has no effect on the meaning of this License.

  2. VERBATIM COPYING

     You may copy and distribute the Document in any medium, either
     commercially or noncommercially, provided that this License, the
     copyright notices, and the license notice saying this License
     applies to the Document are reproduced in all copies, and that you
     add no other conditions whatsoever to those of this License.  You
     may not use technical measures to obstruct or control the reading
     or further copying of the copies you make or distribute.  However,
     you may accept compensation in exchange for copies.  If you
     distribute a large enough number of copies you must also follow the
     conditions in section 3.

     You may also lend copies, under the same conditions stated above,
     and you may publicly display copies.

  3. COPYING IN QUANTITY

     If you publish printed copies (or copies in media that commonly
     have printed covers) of the Document, numbering more than 100, and
     the Document's license notice requires Cover Texts, you must
     enclose the copies in covers that carry, clearly and legibly, all
     these Cover Texts: Front-Cover Texts on the front cover, and
     Back-Cover Texts on the back cover.  Both covers must also clearly
     and legibly identify you as the publisher of these copies.  The
     front cover must present the full title with all words of the title
     equally prominent and visible.  You may add other material on the
     covers in addition.  Copying with changes limited to the covers, as
     long as they preserve the title of the Document and satisfy these
     conditions, can be treated as verbatim copying in other respects.

     If the required texts for either cover are too voluminous to fit
     legibly, you should put the first ones listed (as many as fit
     reasonably) on the actual cover, and continue the rest onto
     adjacent pages.

     If you publish or distribute Opaque copies of the Document
     numbering more than 100, you must either include a machine-readable
     Transparent copy along with each Opaque copy, or state in or with
     each Opaque copy a computer-network location from which the general
     network-using public has access to download using public-standard
     network protocols a complete Transparent copy of the Document, free
     of added material.  If you use the latter option, you must take
     reasonably prudent steps, when you begin distribution of Opaque
     copies in quantity, to ensure that this Transparent copy will
     remain thus accessible at the stated location until at least one
     year after the last time you distribute an Opaque copy (directly or
     through your agents or retailers) of that edition to the public.

     It is requested, but not required, that you contact the authors of
     the Document well before redistributing any large number of copies,
     to give them a chance to provide you with an updated version of the
     Document.

  4. MODIFICATIONS

     You may copy and distribute a Modified Version of the Document
     under the conditions of sections 2 and 3 above, provided that you
     release the Modified Version under precisely this License, with the
     Modified Version filling the role of the Document, thus licensing
     distribution and modification of the Modified Version to whoever
     possesses a copy of it.  In addition, you must do these things in
     the Modified Version:

       A. Use in the Title Page (and on the covers, if any) a title
          distinct from that of the Document, and from those of previous
          versions (which should, if there were any, be listed in the
          History section of the Document).  You may use the same title
          as a previous version if the original publisher of that
          version gives permission.

       B. List on the Title Page, as authors, one or more persons or
          entities responsible for authorship of the modifications in
          the Modified Version, together with at least five of the
          principal authors of the Document (all of its principal
          authors, if it has fewer than five), unless they release you
          from this requirement.

       C. State on the Title page the name of the publisher of the
          Modified Version, as the publisher.

       D. Preserve all the copyright notices of the Document.

       E. Add an appropriate copyright notice for your modifications
          adjacent to the other copyright notices.

       F. Include, immediately after the copyright notices, a license
          notice giving the public permission to use the Modified
          Version under the terms of this License, in the form shown in
          the Addendum below.

       G. Preserve in that license notice the full lists of Invariant
          Sections and required Cover Texts given in the Document's
          license notice.

       H. Include an unaltered copy of this License.

       I. Preserve the section Entitled "History", Preserve its Title,
          and add to it an item stating at least the title, year, new
          authors, and publisher of the Modified Version as given on the
          Title Page.  If there is no section Entitled "History" in the
          Document, create one stating the title, year, authors, and
          publisher of the Document as given on its Title Page, then add
          an item describing the Modified Version as stated in the
          previous sentence.

       J. Preserve the network location, if any, given in the Document
          for public access to a Transparent copy of the Document, and
          likewise the network locations given in the Document for
          previous versions it was based on.  These may be placed in the
          "History" section.  You may omit a network location for a work
          that was published at least four years before the Document
          itself, or if the original publisher of the version it refers
          to gives permission.

       K. For any section Entitled "Acknowledgements" or "Dedications",
          Preserve the Title of the section, and preserve in the section
          all the substance and tone of each of the contributor
          acknowledgements and/or dedications given therein.

       L. Preserve all the Invariant Sections of the Document, unaltered
          in their text and in their titles.  Section numbers or the
          equivalent are not considered part of the section titles.

       M. Delete any section Entitled "Endorsements".  Such a section
          may not be included in the Modified Version.

       N. Do not retitle any existing section to be Entitled
          "Endorsements" or to conflict in title with any Invariant
          Section.

       O. Preserve any Warranty Disclaimers.

     If the Modified Version includes new front-matter sections or
     appendices that qualify as Secondary Sections and contain no
     material copied from the Document, you may at your option designate
     some or all of these sections as invariant.  To do this, add their
     titles to the list of Invariant Sections in the Modified Version's
     license notice.  These titles must be distinct from any other
     section titles.

     You may add a section Entitled "Endorsements", provided it contains
     nothing but endorsements of your Modified Version by various
     parties--for example, statements of peer review or that the text
     has been approved by an organization as the authoritative
     definition of a standard.

     You may add a passage of up to five words as a Front-Cover Text,
     and a passage of up to 25 words as a Back-Cover Text, to the end of
     the list of Cover Texts in the Modified Version.  Only one passage
     of Front-Cover Text and one of Back-Cover Text may be added by (or
     through arrangements made by) any one entity.  If the Document
     already includes a cover text for the same cover, previously added
     by you or by arrangement made by the same entity you are acting on
     behalf of, you may not add another; but you may replace the old
     one, on explicit permission from the previous publisher that added
     the old one.

     The author(s) and publisher(s) of the Document do not by this
     License give permission to use their names for publicity for or to
     assert or imply endorsement of any Modified Version.

  5. COMBINING DOCUMENTS

     You may combine the Document with other documents released under
     this License, under the terms defined in section 4 above for
     modified versions, provided that you include in the combination all
     of the Invariant Sections of all of the original documents,
     unmodified, and list them all as Invariant Sections of your
     combined work in its license notice, and that you preserve all
     their Warranty Disclaimers.

     The combined work need only contain one copy of this License, and
     multiple identical Invariant Sections may be replaced with a single
     copy.  If there are multiple Invariant Sections with the same name
     but different contents, make the title of each such section unique
     by adding at the end of it, in parentheses, the name of the
     original author or publisher of that section if known, or else a
     unique number.  Make the same adjustment to the section titles in
     the list of Invariant Sections in the license notice of the
     combined work.

     In the combination, you must combine any sections Entitled
     "History" in the various original documents, forming one section
     Entitled "History"; likewise combine any sections Entitled
     "Acknowledgements", and any sections Entitled "Dedications".  You
     must delete all sections Entitled "Endorsements."

  6. COLLECTIONS OF DOCUMENTS

     You may make a collection consisting of the Document and other
     documents released under this License, and replace the individual
     copies of this License in the various documents with a single copy
     that is included in the collection, provided that you follow the
     rules of this License for verbatim copying of each of the documents
     in all other respects.

     You may extract a single document from such a collection, and
     distribute it individually under this License, provided you insert
     a copy of this License into the extracted document, and follow this
     License in all other respects regarding verbatim copying of that
     document.

  7. AGGREGATION WITH INDEPENDENT WORKS

     A compilation of the Document or its derivatives with other
     separate and independent documents or works, in or on a volume of a
     storage or distribution medium, is called an "aggregate" if the
     copyright resulting from the compilation is not used to limit the
     legal rights of the compilation's users beyond what the individual
     works permit.  When the Document is included an aggregate, this
     License does not apply to the other works in the aggregate which
     are not themselves derivative works of the Document.

     If the Cover Text requirement of section 3 is applicable to these
     copies of the Document, then if the Document is less than one half
     of the entire aggregate, the Document's Cover Texts may be placed
     on covers that bracket the Document within the aggregate, or the
     electronic equivalent of covers if the Document is in electronic
     form.  Otherwise they must appear on printed covers that bracket
     the whole aggregate.

  8. TRANSLATION

     Translation is considered a kind of modification, so you may
     distribute translations of the Document under the terms of section
     4.  Replacing Invariant Sections with translations requires special
     permission from their copyright holders, but you may include
     translations of some or all Invariant Sections in addition to the
     original versions of these Invariant Sections.  You may include a
     translation of this License, and all the license notices in the
     Document, and any Warrany Disclaimers, provided that you also
     include the original English version of this License and the
     original versions of those notices and disclaimers.  In case of a
     disagreement between the translation and the original version of
     this License or a notice or disclaimer, the original version will
     prevail.

     If a section in the Document is Entitled "Acknowledgements",
     "Dedications", or "History", the requirement (section 4) to
     Preserve its Title (section 1) will typically require changing the
     actual title.

  9. TERMINATION

     You may not copy, modify, sublicense, or distribute the Document
     except as expressly provided for under this License.  Any other
     attempt to copy, modify, sublicense or distribute the Document is
     void, and will automatically terminate your rights under this
     License.  However, parties who have received copies, or rights,
     from you under this License will not have their licenses terminated
     so long as such parties remain in full compliance.

  10. FUTURE REVISIONS OF THIS LICENSE

     The Free Software Foundation may publish new, revised versions of
     the GNU Free Documentation License from time to time.  Such new
     versions will be similar in spirit to the present version, but may
     differ in detail to address new problems or concerns.  See
     <http://www.gnu.org/copyleft/>.

     Each version of the License is given a distinguishing version
     number.  If the Document specifies that a particular numbered
     version of this License "or any later version" applies to it, you
     have the option of following the terms and conditions either of
     that specified version or of any later version that has been
     published (not as a draft) by the Free Software Foundation.  If the
     Document does not specify a version number of this License, you may
     choose any version ever published (not as a draft) by the Free
     Software Foundation.

A.1 ADDENDUM: How to use this License for your documents
========================================================

To use this License in a document you have written, include a copy of
the License in the document and put the following copyright and license
notices just after the title page:

       Copyright (C)  YEAR  YOUR NAME.
       Permission is granted to copy, distribute and/or modify this document
       under the terms of the GNU Free Documentation License, Version 1.2
       or any later version published by the Free Software Foundation;
       with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
       A copy of the license is included in the section entitled ``GNU
       Free Documentation License''.

   If you have Invariant Sections, Front-Cover Texts and Back-Cover
Texts, replace the "with...Texts."  line with this:

         with the Invariant Sections being LIST THEIR TITLES, with
         the Front-Cover Texts being LIST, and with the Back-Cover Texts
         being LIST.

   If you have Invariant Sections without Cover Texts, or some other
combination of the three, merge those two alternatives to suit the
situation.

   If your document contains nontrivial examples of program code, we
recommend releasing these examples in parallel under your choice of free
software license, such as the GNU General Public License, to permit
their use in free software.


File: mit-scheme-ref.info,  Node: Binding Index,  Next: Concept Index,  Prev: GNU Free Documentation License,  Up: Top

Appendix B Binding Index
************************

[index]
* Menu:

* ":                                     Strings.             (line  11)
* #:                                     Syntax of numerical constants.
                                                              (line  11)
* #!optional:                            Additional Notations.
                                                              (line  77)
* #!optional <1>:                        Lambda Expressions.  (line  65)
* #!rest:                                Additional Notations.
                                                              (line  77)
* #!rest <1>:                            Lambda Expressions.  (line  65)
* #(:                                    Vectors.             (line  19)
* #b:                                    Syntax of numerical constants.
                                                              (line   6)
* #d:                                    Syntax of numerical constants.
                                                              (line   6)
* #e:                                    Syntax of numerical constants.
                                                              (line  11)
* #f:                                    True and False.      (line   6)
* #f <1>:                                Conditionals.        (line   6)
* #f <2>:                                Booleans.            (line   6)
* #i:                                    Syntax of numerical constants.
                                                              (line  11)
* #o:                                    Syntax of numerical constants.
                                                              (line   6)
* #t:                                    True and False.      (line   6)
* #t <1>:                                Conditionals.        (line   6)
* #t <2>:                                Booleans.            (line   6)
* #x:                                    Syntax of numerical constants.
                                                              (line   6)
* #\:                                    Characters.          (line  16)
* #\alarm:                               Characters.          (line  30)
* #\backspace:                           Characters.          (line  30)
* #\delete:                              Characters.          (line  30)
* #\escape:                              Characters.          (line  30)
* #\newline:                             Characters.          (line  30)
* #\null:                                Characters.          (line  30)
* #\return:                              Characters.          (line  30)
* #\space:                               Characters.          (line  30)
* #\space <1>:                           Strings.             (line 658)
* #\tab:                                 Characters.          (line  30)
* ':                                     Quoting.             (line  19)
* ' <1>:                                 Lists.               (line  69)
* (:                                     Lists.               (line  30)
* ():                                    Lists.               (line  37)
* ):                                     Lists.               (line  30)
* *:                                     Procedure Call Syntax.
                                                              (line  27)
* * <1>:                                 Numerical operations.
                                                              (line 103)
* * <2>:                                 Regular S-Expressions.
                                                              (line 122)
* * <3>:                                 *Matcher.            (line 147)
* * <4>:                                 *Parser.             (line  77)
* **:                                    Regular S-Expressions.
                                                              (line 164)
* ** <1>:                                Regular S-Expressions.
                                                              (line 190)
* **?:                                   Regular S-Expressions.
                                                              (line 165)
* *?:                                    Regular S-Expressions.
                                                              (line 123)
* *default-pathname-defaults*:           Operations on Pathnames.
                                                              (line  91)
* *matcher:                              *Matcher.            (line  54)
* *parser:                               *Parser.             (line  20)
* *parser-canonicalize-symbols?*:        Input Procedures.    (line 284)
* *parser-radix*:                        Input Procedures.    (line 283)
* *random-state*:                        Random Numbers.      (line  55)
* *unparse-with-maximum-readability?*:   Output Procedures.   (line 241)
* *unparser-list-breadth-limit*:         Output Procedures.   (line 238)
* *unparser-list-depth-limit*:           Output Procedures.   (line 239)
* *unparser-radix*:                      Output Procedures.   (line 237)
* *unparser-string-length-limit*:        Output Procedures.   (line 240)
* +:                                     Procedure Call Syntax.
                                                              (line  27)
* + <1>:                                 Exactness.           (line  21)
* + <2>:                                 Numerical operations.
                                                              (line 102)
* + <3>:                                 Regular S-Expressions.
                                                              (line 143)
* + <4>:                                 *Matcher.            (line 157)
* + <5>:                                 *Parser.             (line  85)
* +?:                                    Regular S-Expressions.
                                                              (line 144)
* +inf:                                  Flonum Operations.   (line  35)
* ,:                                     Quoting.             (line  84)
* , <1>:                                 Lists.               (line  69)
* ,@:                                    Quoting.             (line  84)
* ,@ <1>:                                Lists.               (line  69)
* -:                                     Numerical operations.
                                                              (line 112)
* -1+:                                   Numerical operations.
                                                              (line 126)
* ->namestring:                          Filenames and Pathnames.
                                                              (line  39)
* ->pathname:                            Filenames and Pathnames.
                                                              (line  10)
* ->pathname <1>:                        Working Directory.   (line  30)
* ->truename:                            File Manipulation.   (line  70)
* -inf:                                  Flonum Operations.   (line  35)
* .:                                     Lists.               (line  30)
* ...:                                   Pattern Language.    (line  34)
* /:                                     Implementation restrictions.
                                                              (line  48)
* / <1>:                                 Numerical operations.
                                                              (line 113)
* 1+:                                    Numerical operations.
                                                              (line 125)
* 1d-table/alist:                        1D Tables.           (line  46)
* 1d-table/get:                          1D Tables.           (line  34)
* 1d-table/lookup:                       1D Tables.           (line  38)
* 1d-table/put!:                         1D Tables.           (line  26)
* 1d-table/remove!:                      1D Tables.           (line  30)
* 1d-table?:                             1D Tables.           (line  22)
* 2d-get:                                The Association Table.
                                                              (line  25)
* 2d-get-alist-x:                        The Association Table.
                                                              (line  29)
* 2d-get-alist-y:                        The Association Table.
                                                              (line  39)
* 2d-put!:                               The Association Table.
                                                              (line  17)
* 2d-remove!:                            The Association Table.
                                                              (line  21)
* 8-bit-char-set?:                       Character Sets.      (line 103)
* <:                                     Numerical operations.
                                                              (line  61)
* <=:                                    Numerical operations.
                                                              (line  63)
* <xml-!attlist>:                        XML Structure.       (line  98)
* <xml-!element>:                        XML Structure.       (line  86)
* <xml-!entity>:                         XML Structure.       (line 129)
* <xml-!notation>:                       XML Structure.       (line 145)
* <xml-declaration>:                     XML Structure.       (line  54)
* <xml-document>:                        XML Structure.       (line  45)
* <xml-dtd>:                             XML Structure.       (line  77)
* <xml-element>:                         XML Structure.       (line  61)
* <xml-external-id>:                     XML Structure.       (line 150)
* <xml-parameter-!entity>:               XML Structure.       (line 134)
* <xml-processing-instructions>:         XML Structure.       (line  69)
* <xml-unparsed-!entity>:                XML Structure.       (line 139)
* =:                                     Equivalence Predicates.
                                                              (line  30)
* = <1>:                                 Equivalence Predicates.
                                                              (line  59)
* = <2>:                                 Numerical operations.
                                                              (line  28)
* = <3>:                                 Numerical operations.
                                                              (line  60)
* = <4>:                                 Strings.             (line 462)
* =>:                                    Conditionals.        (line  80)
* >:                                     Numerical operations.
                                                              (line  62)
* >=:                                    Numerical operations.
                                                              (line  64)
* ?:                                     Regular S-Expressions.
                                                              (line  99)
* ? <1>:                                 *Matcher.            (line 163)
* ? <2>:                                 *Parser.             (line  91)
* ??:                                    Regular S-Expressions.
                                                              (line 100)
* \":                                    Strings.             (line  28)
* \a:                                    Strings.             (line  28)
* \b:                                    Strings.             (line  28)
* \n:                                    Strings.             (line  28)
* \r:                                    Strings.             (line  28)
* \t:                                    Strings.             (line  28)
* \x:                                    Strings.             (line  28)
* \\:                                    Strings.             (line  28)
* \|:                                    Strings.             (line  28)
* `:                                     Quoting.             (line  84)
* ` <1>:                                 Lists.               (line  69)
* abort:                                 Restarts.            (line  23)
* abort <1>:                             Invoking Standard Restart Code.
                                                              (line  16)
* abs:                                   Numerical operations.
                                                              (line 130)
* access:                                Assignments.         (line  22)
* access-condition:                      Generating Operations on Conditions.
                                                              (line  56)
* access-condition <1>:                  Simple Condition Instance Operations.
                                                              (line  25)
* acos:                                  Numerical operations.
                                                              (line 321)
* alist->hash-table:                     Construction of Hash Tables.
                                                              (line  94)
* alist->rb-tree:                        Red-Black Trees.     (line 143)
* alist->wt-tree:                        Construction of Weight-Balanced Trees.
                                                              (line  63)
* alist-copy:                            Association Lists.   (line 103)
* alist?:                                Association Lists.   (line  18)
* allocate-host-address:                 Miscellaneous OS Facilities.
                                                              (line  85)
* alt:                                   Regular S-Expressions.
                                                              (line 197)
* alt <1>:                               *Matcher.            (line 125)
* alt <2>:                               *Parser.             (line  69)
* and:                                   Conditionals.        (line 136)
* and <1>:                               Booleans.            (line   9)
* and-let*:                              and-let* (SRFI 2).   (line  10)
* angle:                                 Numerical operations.
                                                              (line 324)
* angle <1>:                             Numerical operations.
                                                              (line 370)
* any:                                   Reduction of Lists.  (line  74)
* any-char:                              Regular S-Expressions.
                                                              (line  25)
* append:                                Cutting and Pasting Lists.
                                                              (line  30)
* append!:                               Cutting and Pasting Lists.
                                                              (line  47)
* append-map:                            Mapping of Lists.    (line  32)
* append-map <1>:                        Mapping of Lists.    (line  34)
* append-map!:                           Mapping of Lists.    (line  42)
* append-map! <1>:                       Mapping of Lists.    (line  44)
* append-map*:                           Mapping of Lists.    (line  33)
* append-map* <1>:                       Mapping of Lists.    (line  34)
* append-map*!:                          Mapping of Lists.    (line  43)
* append-map*! <1>:                      Mapping of Lists.    (line  44)
* apply:                                 Procedure Operations.
                                                              (line   6)
* apply-hook-extra:                      Application Hooks.   (line  40)
* apply-hook-procedure:                  Application Hooks.   (line  33)
* apply-hook?:                           Application Hooks.   (line  30)
* asin:                                  Numerical operations.
                                                              (line 320)
* assoc:                                 Association Lists.   (line  25)
* association-procedure:                 Association Lists.   (line  43)
* assq:                                  Association Lists.   (line  23)
* assv:                                  Association Lists.   (line  24)
* atan:                                  Numerical operations.
                                                              (line 322)
* atan <1>:                              Numerical operations.
                                                              (line 323)
* atan <2>:                              Flonum Operations.   (line  70)
* beep:                                  Output Procedures.   (line 144)
* begin:                                 Sequencing.          (line   9)
* binary-port?:                          Ports.               (line  73)
* bind-cell-contents!:                   Parameters.          (line  60)
* bind-condition-handler:                Error System.        (line  93)
* bind-condition-handler <1>:            Condition Signalling.
                                                              (line  64)
* bind-condition-handler <2>:            Condition Handling.  (line   6)
* bind-condition-handler <3>:            Condition Handling.  (line  56)
* bind-default-condition-handler:        Condition Signalling.
                                                              (line  64)
* bind-default-condition-handler <1>:    Condition Handling.  (line   6)
* bind-default-condition-handler <2>:    Condition Handling.  (line  67)
* bit-string->signed-integer:            Integer Conversions of Bit Strings.
                                                              (line  21)
* bit-string->unsigned-integer:          Integer Conversions of Bit Strings.
                                                              (line  20)
* bit-string-allocate:                   Construction of Bit Strings.
                                                              (line  13)
* bit-string-and:                        Bitwise Operations on Bit Strings.
                                                              (line  25)
* bit-string-and!:                       Bitwise Operations on Bit Strings.
                                                              (line  46)
* bit-string-andc:                       Bitwise Operations on Bit Strings.
                                                              (line  30)
* bit-string-andc!:                      Bitwise Operations on Bit Strings.
                                                              (line  49)
* bit-string-append:                     Cutting and Pasting Bit Strings.
                                                              (line   6)
* bit-string-clear!:                     Selecting Bit String Components.
                                                              (line  20)
* bit-string-copy:                       Construction of Bit Strings.
                                                              (line  17)
* bit-string-fill!:                      Modification of Bit Strings.
                                                              (line   6)
* bit-string-length:                     Selecting Bit String Components.
                                                              (line   9)
* bit-string-move!:                      Modification of Bit Strings.
                                                              (line  10)
* bit-string-movec!:                     Bitwise Operations on Bit Strings.
                                                              (line  18)
* bit-string-not:                        Bitwise Operations on Bit Strings.
                                                              (line  14)
* bit-string-or:                         Bitwise Operations on Bit Strings.
                                                              (line  36)
* bit-string-or!:                        Bitwise Operations on Bit Strings.
                                                              (line  47)
* bit-string-ref:                        Selecting Bit String Components.
                                                              (line  12)
* bit-string-set!:                       Selecting Bit String Components.
                                                              (line  16)
* bit-string-xor:                        Bitwise Operations on Bit Strings.
                                                              (line  41)
* bit-string-xor!:                       Bitwise Operations on Bit Strings.
                                                              (line  48)
* bit-string-zero?:                      Bitwise Operations on Bit Strings.
                                                              (line   6)
* bit-string=?:                          Bitwise Operations on Bit Strings.
                                                              (line  10)
* bit-string?:                           Selecting Bit String Components.
                                                              (line   6)
* bit-substring:                         Cutting and Pasting Bit Strings.
                                                              (line  12)
* bit-substring-find-next-set-bit:       Selecting Bit String Components.
                                                              (line  24)
* bit-substring-move-right!:             Modification of Bit Strings.
                                                              (line  16)
* bitless-char?:                         Character implementation.
                                                              (line  66)
* bitmap-from-dib:                       DIB procedures.      (line  23)
* bool:                                  Windows Types.       (line  99)
* boolean/and:                           Booleans.            (line  67)
* boolean/or:                            Booleans.            (line  71)
* boolean?:                              Booleans.            (line  39)
* both:                                  Strings.             (line 682)
* bound-restart:                         Finding and Invoking General Restart Code.
                                                              (line   6)
* bound-restarts:                        Finding and Invoking General Restart Code.
                                                              (line  23)
* bracketed-print-method:                Custom Output.       (line  44)
* break-on-signals:                      Condition Signalling.
                                                              (line  64)
* break-on-signals <1>:                  Condition Handling.  (line  36)
* break-on-signals <2>:                  Condition Handling.  (line  78)
* buffered-input-chars on textual input port: Textual Input Port Operations.
                                                              (line  85)
* buffered-output-chars on textual output port: Textual Output Port Operations.
                                                              (line  59)
* byte:                                  Windows Types.       (line 120)
* caaaar:                                Pairs.               (line  87)
* caaadr:                                Pairs.               (line  88)
* caaar:                                 Pairs.               (line  79)
* caadar:                                Pairs.               (line  89)
* caaddr:                                Pairs.               (line  90)
* caadr:                                 Pairs.               (line  80)
* caar:                                  Pairs.               (line  75)
* cadaar:                                Pairs.               (line  91)
* cadadr:                                Pairs.               (line  92)
* cadar:                                 Pairs.               (line  81)
* caddar:                                Pairs.               (line  93)
* cadddr:                                Pairs.               (line  94)
* caddr:                                 Pairs.               (line  82)
* cadr:                                  Pairs.               (line  76)
* call-with-binary-input-file:           File Ports.          (line  27)
* call-with-binary-input-file <1>:       File Ports.          (line  52)
* call-with-binary-output-file:          File Ports.          (line  28)
* call-with-binary-output-file <1>:      File Ports.          (line  52)
* call-with-current-continuation:        Continuations.       (line   6)
* call-with-input-file:                  File Ports.          (line  18)
* call-with-output-bytevector:           Bytevector Ports.    (line  31)
* call-with-output-file:                 File Ports.          (line  19)
* call-with-output-string:               String Ports.        (line  40)
* call-with-port:                        Ports.               (line  30)
* call-with-port <1>:                    File Ports.          (line  22)
* call-with-port <2>:                    File Ports.          (line  31)
* call-with-temporary-file-pathname:     File Manipulation.   (line  76)
* call-with-truncated-output-port:       Ports.               (line  47)
* call-with-truncated-output-port <1>:   String Ports.        (line  60)
* call-with-truncated-output-string:     String Ports.        (line  53)
* call-with-truncated-output-string <1>: String Ports.        (line  69)
* call-with-truncated-output-string <2>: String Ports.        (line  86)
* call-with-values:                      Continuations.       (line 142)
* canonical-host-name:                   Miscellaneous OS Facilities.
                                                              (line  60)
* capture-syntactic-environment:         SC Transformer Definition.
                                                              (line 161)
* car:                                   Storage Model.       (line  16)
* car <1>:                               Pairs.               (line  34)
* car <2>:                               Streams.             (line  45)
* car+cdr:                               Pairs.               (line  51)
* case:                                  Conditionals.        (line  92)
* case <1>:                              Sequencing.          (line  37)
* cd:                                    Working Directory.   (line  29)
* cdaaar:                                Pairs.               (line  95)
* cdaadr:                                Pairs.               (line  96)
* cdaar:                                 Pairs.               (line  83)
* cdadar:                                Pairs.               (line  97)
* cdaddr:                                Pairs.               (line  98)
* cdadr:                                 Pairs.               (line  84)
* cdar:                                  Pairs.               (line  77)
* cddaar:                                Pairs.               (line  99)
* cddadr:                                Pairs.               (line 100)
* cddar:                                 Pairs.               (line  85)
* cdddar:                                Pairs.               (line 101)
* cddddr:                                Pairs.               (line 102)
* cdddr:                                 Pairs.               (line  86)
* cddr:                                  Pairs.               (line  78)
* cdr:                                   Entry Format.        (line  66)
* cdr <1>:                               Pairs.               (line  43)
* cdr <2>:                               Streams.             (line  50)
* ceiling:                               Numerical operations.
                                                              (line 242)
* ceiling->exact:                        Numerical operations.
                                                              (line 274)
* cell-contents:                         Parameters.          (line  53)
* cell?:                                 Parameters.          (line  47)
* char:                                  *Matcher.            (line  63)
* char <1>:                              Windows Types.       (line 109)
* char*:                                 Windows Types.       (line 127)
* char->digit:                           Characters.          (line 198)
* char->integer:                         Characters.          (line 153)
* char->name:                            Characters.          (line  75)
* char-alphabetic?:                      Characters.          (line 124)
* char-alphanumeric?:                    Characters.          (line 139)
* char-bits:                             Character implementation.
                                                              (line  47)
* char-bits-limit:                       Character implementation.
                                                              (line  61)
* char-ci:                               Regular S-Expressions.
                                                              (line  19)
* char-ci <1>:                           *Matcher.            (line  64)
* char-ci-predicate:                     Character implementation.
                                                              (line  75)
* char-ci<=?:                            Characters.          (line 115)
* char-ci<?:                             Characters.          (line 113)
* char-ci=?:                             Characters.          (line 112)
* char-ci>=?:                            Characters.          (line 116)
* char-ci>?:                             Characters.          (line 114)
* char-code:                             Character implementation.
                                                              (line  38)
* char-code-limit:                       Character implementation.
                                                              (line  56)
* char-downcase:                         Characters.          (line 175)
* char-foldcase:                         Characters.          (line 176)
* char-general-category:                 Unicode.             (line  27)
* char-graphic?:                         Prompting.           (line  42)
* char-in:                               Regular S-Expressions.
                                                              (line  35)
* char-in-set?:                          Character Sets.      (line  15)
* char-lower-case?:                      Characters.          (line 128)
* char-not-in:                           Regular S-Expressions.
                                                              (line  36)
* char-numeric?:                         Characters.          (line 125)
* char-predicate:                        Character implementation.
                                                              (line  70)
* char-ready?:                           Input Procedures.    (line 110)
* char-ready? on textual input port:     Textual Input Port Operations.
                                                              (line  24)
* char-set:                              Character Sets.      (line  39)
* char-set <1>:                          *Matcher.            (line  79)
* char-set*:                             Character Sets.      (line  40)
* char-set->code-points:                 Character Sets.      (line  66)
* char-set-difference:                   Character Sets.      (line  82)
* char-set-intersection:                 Character Sets.      (line  81)
* char-set-intersection*:                Character Sets.      (line  87)
* char-set-invert:                       Character Sets.      (line  75)
* char-set-predicate:                    Character Sets.      (line  22)
* char-set-union:                        Character Sets.      (line  80)
* char-set-union*:                       Character Sets.      (line  86)
* char-set:alphabetic:                   Character Sets.      (line  92)
* char-set:alphanumeric:                 Character Sets.      (line  97)
* char-set:lower-case:                   Character Sets.      (line  96)
* char-set:numeric:                      Character Sets.      (line  93)
* char-set:upper-case:                   Character Sets.      (line  95)
* char-set:whitespace:                   Character Sets.      (line  94)
* char-set:whitespace <1>:               Strings.             (line 726)
* char-set=?:                            Character Sets.      (line  71)
* char-set?:                             Character Sets.      (line  11)
* char-upcase:                           Characters.          (line 174)
* char-upper-case?:                      Characters.          (line 127)
* char-whitespace?:                      Characters.          (line 126)
* char-whitespace? <1>:                  Strings.             (line 686)
* char<=?:                               Characters.          (line 103)
* char<?:                                Characters.          (line 101)
* char=?:                                Equivalence Predicates.
                                                              (line  33)
* char=? <1>:                            Equivalence Predicates.
                                                              (line  62)
* char=? <2>:                            Characters.          (line 100)
* char>=?:                               Characters.          (line 104)
* char>?:                                Characters.          (line 102)
* char?:                                 Characters.          (line  97)
* chars-remaining on textual input port: Textual Input Port Operations.
                                                              (line  80)
* circular-list:                         Miscellaneous List Operations.
                                                              (line   6)
* circular-list?:                        Selecting List Components.
                                                              (line  22)
* clear:                                 Output Procedures.   (line 152)
* close-all-open-files:                  File Ports.          (line  90)
* close-input-port:                      Ports.               (line 119)
* close-output-port:                     Ports.               (line 120)
* close-port:                            Ports.               (line 118)
* close-syntax:                          SC Transformer Definition.
                                                              (line 151)
* close-tcp-server-socket:               TCP Sockets.         (line 108)
* code-point-general-category:           Unicode.             (line  28)
* code-point-in-set?:                    Character Sets.      (line  18)
* compile-regsexp:                       Regsexp Procedures.  (line  11)
* compiled-procedure?:                   Procedure Operations.
                                                              (line  30)
* complex?:                              Numerical operations.
                                                              (line  16)
* compound-procedure?:                   Procedure Operations.
                                                              (line  34)
* compute-char-set:                      Character Sets.      (line  26)
* conc-name:                             Structure Definitions.
                                                              (line 199)
* cond:                                  Entry Format.        (line  27)
* cond <1>:                              Conditionals.        (line  36)
* cond <2>:                              Sequencing.          (line  37)
* cond <3>:                              Booleans.            (line   9)
* cond-expand:                           cond-expand (SRFI 0).
                                                              (line  11)
* condition-accessor:                    Generating Operations on Conditions.
                                                              (line   6)
* condition-accessor <1>:                Generating Operations on Conditions.
                                                              (line  47)
* condition-accessor <2>:                Simple Condition Instance Operations.
                                                              (line  26)
* condition-constructor:                 Generating Operations on Conditions.
                                                              (line   6)
* condition-constructor <1>:             Generating Operations on Conditions.
                                                              (line  23)
* condition-predicate:                   Generating Operations on Conditions.
                                                              (line   6)
* condition-predicate <1>:               Generating Operations on Conditions.
                                                              (line  62)
* condition-signaller:                   Generating Operations on Conditions.
                                                              (line   6)
* condition-signaller <1>:               Generating Operations on Conditions.
                                                              (line  68)
* condition-type/error?:                 Condition Types.     (line  37)
* condition-type/field-names:            Condition Types.     (line  41)
* condition-type/generalizations:        Condition Types.     (line  48)
* condition-type:arithmetic-error:       Taxonomy.            (line 314)
* condition-type:bad-range-argument:     Numerical operations.
                                                              (line 100)
* condition-type:bad-range-argument <1>: Numerical operations.
                                                              (line 396)
* condition-type:bad-range-argument <2>: Numerical operations.
                                                              (line 408)
* condition-type:bad-range-argument <3>: Integer Conversions of Bit Strings.
                                                              (line  10)
* condition-type:bad-range-argument <4>: Integer Conversions of Bit Strings.
                                                              (line  18)
* condition-type:bad-range-argument <5>: Object Hashing.      (line  39)
* condition-type:bad-range-argument <6>: Taxonomy.            (line 166)
* condition-type:breakpoint:             Error System.        (line  73)
* condition-type:breakpoint <1>:         Taxonomy.            (line 438)
* condition-type:control-error:          Taxonomy.            (line 386)
* condition-type:datum-out-of-range:     Taxonomy.            (line 148)
* condition-type:derived-file-error:     Taxonomy.            (line 247)
* condition-type:derived-port-error:     Taxonomy.            (line 268)
* condition-type:divide-by-zero:         Taxonomy.            (line 322)
* condition-type:error:                  Condition Handling.  (line  44)
* condition-type:error <1>:              Condition State.     (line  16)
* condition-type:error <2>:              Condition Types.     (line  38)
* condition-type:error <3>:              Taxonomy.            (line  62)
* condition-type:file-error:             Taxonomy.            (line 202)
* condition-type:file-operation-error:   Miscellaneous Pathnames.
                                                              (line  71)
* condition-type:file-operation-error <1>: File Manipulation. (line  10)
* condition-type:file-operation-error <2>: File Manipulation. (line  74)
* condition-type:file-operation-error <3>: Taxonomy.          (line 208)
* condition-type:floating-point-overflow: Taxonomy.           (line 340)
* condition-type:floating-point-underflow: Taxonomy.          (line 348)
* condition-type:illegal-datum:          Taxonomy.            (line  75)
* condition-type:inapplicable-object:    Taxonomy.            (line 190)
* condition-type:macro-binding:          Environment Operations.
                                                              (line  23)
* condition-type:no-such-restart:        Invoking Standard Restart Code.
                                                              (line  22)
* condition-type:no-such-restart <1>:    Invoking Standard Restart Code.
                                                              (line  39)
* condition-type:no-such-restart <2>:    Taxonomy.            (line 390)
* condition-type:not-loading:            Taxonomy.            (line 407)
* condition-type:port-error:             Taxonomy.            (line 261)
* condition-type:primitive-procedure-error: Taxonomy.         (line 356)
* condition-type:serious-condition:      Error System.        (line  73)
* condition-type:serious-condition <1>:  Taxonomy.            (line  57)
* condition-type:simple-condition:       Error System.        (line  73)
* condition-type:simple-condition <1>:   Taxonomy.            (line 431)
* condition-type:simple-error:           Condition Signalling.
                                                              (line  34)
* condition-type:simple-error <1>:       Taxonomy.            (line  66)
* condition-type:simple-warning:         Condition Signalling.
                                                              (line  48)
* condition-type:simple-warning <1>:     Taxonomy.            (line 423)
* condition-type:subprocess-abnormal-termination: Subprocess Conditions.
                                                              (line  36)
* condition-type:subprocess-signalled:   Subprocess Conditions.
                                                              (line   9)
* condition-type:subprocess-stopped:     Subprocess Conditions.
                                                              (line  23)
* condition-type:system-call-error:      Taxonomy.            (line 367)
* condition-type:unassigned-variable:    Variable Bindings.   (line  18)
* condition-type:unassigned-variable <1>: Environment Operations.
                                                              (line  13)
* condition-type:unassigned-variable <2>: Taxonomy.           (line 300)
* condition-type:unbound-variable:       Environment Concepts.
                                                              (line   9)
* condition-type:unbound-variable <1>:   Dynamic Binding.     (line 149)
* condition-type:unbound-variable <2>:   Taxonomy.            (line 287)
* condition-type:variable-error:         Taxonomy.            (line 281)
* condition-type:warning:                Error System.        (line  73)
* condition-type:warning <1>:            Taxonomy.            (line 417)
* condition-type:wrong-number-of-arguments: Lambda Expressions.
                                                              (line  37)
* condition-type:wrong-number-of-arguments <1>: Lambda Expressions.
                                                              (line  47)
* condition-type:wrong-number-of-arguments <2>: Arity.        (line  34)
* condition-type:wrong-number-of-arguments <3>: Taxonomy.     (line 128)
* condition-type:wrong-type-argument:    Entry Format.        (line  73)
* condition-type:wrong-type-argument <1>: Taxonomy.           (line  99)
* condition-type:wrong-type-datum:       Taxonomy.            (line  82)
* condition-type?:                       Condition Types.     (line  53)
* condition/continuation:                Condition State.     (line  22)
* condition/error?:                      Condition State.     (line  15)
* condition/report-string:               Simple Condition Instance Operations.
                                                              (line  34)
* condition/restarts:                    Generating Operations on Conditions.
                                                              (line  24)
* condition/restarts <1>:                Condition State.     (line  19)
* condition/restarts <2>:                Simple Condition Instance Operations.
                                                              (line  13)
* condition/type:                        Condition State.     (line  12)
* condition?:                            Condition State.     (line   9)
* conjugate:                             Numerical operations.
                                                              (line 371)
* cons:                                  Pairs.               (line  17)
* cons*:                                 Construction of Lists.
                                                              (line  24)
* cons-stream:                           Streams.             (line  31)
* console-i/o-port:                      Ports.               (line 147)
* constructor:                           Structure Definitions.
                                                              (line 131)
* continuation?:                         Continuations.       (line  66)
* continue:                              Restarts.            (line  23)
* continue <1>:                          Invoking Standard Restart Code.
                                                              (line  25)
* copier:                                Structure Definitions.
                                                              (line 116)
* copy-area on win32-graphics-device:    Custom Operations for Win32 Graphics.
                                                              (line 116)
* copy-area on x-graphics-device:        Custom Operations on X Graphics Devices.
                                                              (line 115)
* copy-bitmap:                           DIB procedures.      (line  60)
* copy-file:                             File Manipulation.   (line  22)
* cos:                                   Numerical operations.
                                                              (line 318)
* create-dib:                            DIB procedures.      (line  65)
* create-image on graphics-device:       Images.              (line  13)
* crop-bitmap:                           DIB procedures.      (line  73)
* current-error-port:                    Ports.               (line  86)
* current-file-time:                     File Manipulation.   (line 266)
* current-input-port:                    Ports.               (line  84)
* current-input-port <1>:                File Ports.          (line  38)
* current-output-port:                   Ports.               (line  85)
* current-output-port <1>:               File Ports.          (line  38)
* current-parser-macros:                 Parser-language Macros.
                                                              (line  68)
* day-of-week/long-string:               External Representation of Time.
                                                              (line  22)
* day-of-week/short-string:              External Representation of Time.
                                                              (line  23)
* debug:                                 Prompting.           (line  50)
* decoded-time->file-time:               Time-Format Conversion.
                                                              (line  64)
* decoded-time->string:                  Time-Format Conversion.
                                                              (line  72)
* decoded-time->universal-time:          Time-Format Conversion.
                                                              (line  55)
* decoded-time/date-string:              External Representation of Time.
                                                              (line  11)
* decoded-time/day:                      Decoded Time.        (line  88)
* decoded-time/day-of-week:              Decoded Time.        (line  97)
* decoded-time/daylight-savings-time?:   Decoded Time.        (line 103)
* decoded-time/hour:                     Decoded Time.        (line  87)
* decoded-time/minute:                   Decoded Time.        (line  86)
* decoded-time/month:                    Decoded Time.        (line  89)
* decoded-time/second:                   Decoded Time.        (line  85)
* decoded-time/time-string:              External Representation of Time.
                                                              (line  12)
* decoded-time/year:                     Decoded Time.        (line  90)
* decoded-time/zone:                     Decoded Time.        (line 110)
* default-object?:                       Lambda Expressions.  (line  49)
* define:                                Environment Concepts.
                                                              (line  22)
* define <1>:                            Definitions.         (line   6)
* define <2>:                            Definitions.         (line   7)
* define <3>:                            Internal Definitions.
                                                              (line   6)
* define <4>:                            Sequencing.          (line  37)
* define <5>:                            Environment Variables.
                                                              (line   6)
* define-*matcher-expander:              Parser-language Macros.
                                                              (line  35)
* define-*matcher-macro:                 Parser-language Macros.
                                                              (line  12)
* define-*parser-expander:               Parser-language Macros.
                                                              (line  36)
* define-*parser-macro:                  Parser-language Macros.
                                                              (line  13)
* define-color on win32-graphics-device: Custom Operations for Win32 Graphics.
                                                              (line  43)
* define-print-method:                   Custom Output.       (line  10)
* define-record-type:                    define-record-type (SRFI 9).
                                                              (line  22)
* define-similar-windows-type:           Windows Types.       (line  52)
* define-structure:                      Structure Definitions.
                                                              (line  12)
* define-structure <1>:                  Records.             (line  11)
* define-syntax:                         Syntactic Binding Constructs.
                                                              (line 105)
* define-windows-type:                   Windows Types.       (line  51)
* del-assoc:                             Association Lists.   (line  61)
* del-assoc!:                            Association Lists.   (line  82)
* del-assq:                              Association Lists.   (line  59)
* del-assq!:                             Association Lists.   (line  80)
* del-assv:                              Association Lists.   (line  60)
* del-assv!:                             Association Lists.   (line  81)
* delay:                                 Lexical Binding.     (line  99)
* delay <1>:                             Promises.            (line   6)
* delete:                                Filtering Lists.     (line  54)
* delete!:                               Filtering Lists.     (line  61)
* delete! <1>:                           Filtering Lists.     (line  84)
* delete-association-procedure:          Association Lists.   (line  90)
* delete-dib:                            DIB procedures.      (line  45)
* delete-directory:                      File Manipulation.   (line  65)
* delete-file:                           File Manipulation.   (line  31)
* delete-file-no-errors:                 File Manipulation.   (line  34)
* delete-matching-items:                 Filtering Lists.     (line  23)
* delete-matching-items!:                Filtering Lists.     (line  48)
* delete-member-procedure:               Filtering Lists.     (line  83)
* delq:                                  Filtering Lists.     (line  52)
* delq!:                                 Filtering Lists.     (line  59)
* delv:                                  Filtering Lists.     (line  53)
* delv <1>:                              Filtering Lists.     (line  84)
* delv!:                                 Filtering Lists.     (line  60)
* denominator:                           Numerical operations.
                                                              (line 231)
* dib:                                   Device Independent Bitmap Utilities.
                                                              (line  11)
* dib-blt:                               DIB procedures.      (line  35)
* dib-from-bitmap:                       DIB procedures.      (line  28)
* dib-height:                            DIB procedures.      (line  52)
* dib-set-pixels-unaligned:              DIB procedures.      (line  79)
* dib-width:                             DIB procedures.      (line  56)
* digit->char:                           Characters.          (line 213)
* digit-value:                           Characters.          (line 143)
* directory-namestring:                  Operations on Pathnames.
                                                              (line 110)
* directory-pathname:                    Operations on Pathnames.
                                                              (line 133)
* directory-pathname-as-file:            Operations on Pathnames.
                                                              (line 150)
* directory-pathname?:                   Operations on Pathnames.
                                                              (line  27)
* directory-read:                        Directory Reader.    (line   6)
* discard-chars on textual input port:   Textual Input Port Operations.
                                                              (line  32)
* discard-matched:                       *Matcher.            (line  88)
* discard-matched <1>:                   *Parser.             (line  55)
* discard-parser-buffer-head!:           Parser Buffers.      (line 102)
* discretionary-flush-output:            Output Procedures.   (line  14)
* discretionary-flush-output on textual output port: Textual Output Port Operations.
                                                              (line  30)
* display:                               Output Procedures.   (line  64)
* display <1>:                           Error Messages.      (line  18)
* do:                                    Environment Concepts.
                                                              (line  22)
* do <1>:                                Sequencing.          (line  37)
* do <2>:                                Iteration.           (line  59)
* dotted-list?:                          Selecting List Components.
                                                              (line  30)
* draw-arc:                              Custom Operations on X Graphics Devices.
                                                              (line  29)
* draw-arc on x-graphics-device:         Custom Operations on X Graphics Devices.
                                                              (line  27)
* draw-circle:                           Custom Operations on X Graphics Devices.
                                                              (line  62)
* draw-circle on x-graphics-device:      Custom Operations on X Graphics Devices.
                                                              (line  60)
* draw-ellipse on win32-graphics-device: Custom Operations for Win32 Graphics.
                                                              (line  58)
* draw-image on graphics-device:         Images.              (line  30)
* draw-subimage on graphics-device:      Images.              (line  34)
* dynamic-wind:                          Continuations.       (line  76)
* eighth:                                Selecting List Components.
                                                              (line  83)
* else:                                  Entry Format.        (line  27)
* else <1>:                              Conditionals.        (line  41)
* else <2>:                              Conditionals.        (line  97)
* encapsulate:                           *Parser.             (line 117)
* end-of-input:                          *Matcher.            (line  84)
* enough-namestring:                     Operations on Pathnames.
                                                              (line 112)
* enough-pathname:                       Operations on Pathnames.
                                                              (line 134)
* entity-extra:                          Application Hooks.   (line  61)
* entity-procedure:                      Application Hooks.   (line  54)
* entity?:                               Application Hooks.   (line  51)
* enumerate-graphics-types:              Opening and Closing of Graphics Devices.
                                                              (line  12)
* environment:                           Subprocess Options.  (line 123)
* environment-assign!:                   Environment Operations.
                                                              (line 107)
* environment-assignable?:               Environment Operations.
                                                              (line 102)
* environment-assigned?:                 Environment Operations.
                                                              (line  85)
* environment-bindings:                  Environment Operations.
                                                              (line  53)
* environment-bound-names:               Environment Operations.
                                                              (line  43)
* environment-bound?:                    Environment Operations.
                                                              (line  77)
* environment-definable?:                Environment Operations.
                                                              (line 112)
* environment-define:                    Environment Operations.
                                                              (line 118)
* environment-define-macro:              Environment Operations.
                                                              (line 123)
* environment-has-parent?:               Environment Operations.
                                                              (line  35)
* environment-lookup:                    Environment Operations.
                                                              (line  91)
* environment-lookup-macro:              Environment Operations.
                                                              (line  96)
* environment-macro-names:               Environment Operations.
                                                              (line  49)
* environment-parent:                    Environment Operations.
                                                              (line  39)
* environment-reference-type:            Environment Operations.
                                                              (line  60)
* environment?:                          Environment Operations.
                                                              (line  32)
* eof-object:                            Input Procedures.    (line 107)
* eof-object?:                           Input Procedures.    (line 101)
* eof? on textual input port:            Textual Input Port Operations.
                                                              (line  76)
* ephemeron-broken?:                     Ephemerons.          (line  36)
* ephemeron-datum:                       Ephemerons.          (line  41)
* ephemeron-key:                         Ephemerons.          (line  40)
* ephemeron?:                            Ephemerons.          (line  29)
* epoch:                                 Universal Time.      (line  11)
* eq-hash:                               Address Hashing.     (line  22)
* eq-hash-mod:                           Construction of Hash Tables.
                                                              (line 230)
* eq-hash-mod <1>:                       Address Hashing.     (line  57)
* eq?:                                   Equivalence Predicates.
                                                              (line   6)
* eq? <1>:                               Equivalence Predicates.
                                                              (line 155)
* eq? <2>:                               Filtering Lists.     (line  55)
* eq? <3>:                               Filtering Lists.     (line  62)
* eq? <4>:                               Searching Lists.     (line  40)
* eq? <5>:                               Symbols.             (line  12)
* eq? <6>:                               Symbols.             (line 122)
* eq? <7>:                               Association Lists.   (line  26)
* eq? <8>:                               Association Lists.   (line  62)
* eq? <9>:                               Association Lists.   (line  83)
* eq? <10>:                              The Association Table.
                                                              (line   6)
* eq? <11>:                              Construction of Hash Tables.
                                                              (line  22)
* eq? <12>:                              Construction of Hash Tables.
                                                              (line  29)
* eq? <13>:                              Construction of Hash Tables.
                                                              (line  35)
* eq? <14>:                              Construction of Hash Tables.
                                                              (line  42)
* eq? <15>:                              Construction of Hash Tables.
                                                              (line 230)
* eq? <16>:                              Object Hashing.      (line  22)
* eq? <17>:                              The Named Restart Abstraction.
                                                              (line  13)
* equal-hash:                            Address Hashing.     (line  24)
* equal-hash-mod:                        Construction of Hash Tables.
                                                              (line 230)
* equal-hash-mod <1>:                    Address Hashing.     (line  65)
* equal?:                                Quoting.             (line  42)
* equal? <1>:                            Equivalence Predicates.
                                                              (line   6)
* equal? <2>:                            Equivalence Predicates.
                                                              (line 194)
* equal? <3>:                            Filtering Lists.     (line  55)
* equal? <4>:                            Filtering Lists.     (line  62)
* equal? <5>:                            Searching Lists.     (line  40)
* equal? <6>:                            Association Lists.   (line  26)
* equal? <7>:                            Association Lists.   (line  62)
* equal? <8>:                            Association Lists.   (line  83)
* equal? <9>:                            Construction of Hash Tables.
                                                              (line  79)
* equal? <10>:                           Construction of Hash Tables.
                                                              (line 230)
* eqv-hash:                              Address Hashing.     (line  23)
* eqv-hash-mod:                          Address Hashing.     (line  61)
* eqv?:                                  Storage Model.       (line  16)
* eqv? <1>:                              Conditionals.        (line 111)
* eqv? <2>:                              Equivalence Predicates.
                                                              (line   6)
* eqv? <3>:                              Equivalence Predicates.
                                                              (line  13)
* eqv? <4>:                              Pairs.               (line  18)
* eqv? <5>:                              Filtering Lists.     (line  55)
* eqv? <6>:                              Filtering Lists.     (line  62)
* eqv? <7>:                              Searching Lists.     (line  40)
* eqv? <8>:                              Association Lists.   (line  26)
* eqv? <9>:                              Association Lists.   (line  62)
* eqv? <10>:                             Association Lists.   (line  83)
* eqv? <11>:                             Construction of Hash Tables.
                                                              (line  48)
* eqv? <12>:                             Construction of Hash Tables.
                                                              (line  57)
* eqv? <13>:                             Construction of Hash Tables.
                                                              (line  65)
* eqv? <14>:                             Construction of Hash Tables.
                                                              (line  72)
* er-macro-transformer:                  Explicit Renaming.   (line  12)
* error:                                 Errors.              (line   6)
* error <1>:                             Error System.        (line   6)
* error <2>:                             Condition Signalling.
                                                              (line  22)
* error <3>:                             Condition Signalling.
                                                              (line  48)
* error <4>:                             Condition Handling.  (line  44)
* error <5>:                             Condition Handling.  (line  88)
* error-irritant/noise:                  Error Messages.      (line  52)
* error:bad-range-argument:              Taxonomy.            (line 184)
* error:datum-out-of-range:              Taxonomy.            (line 160)
* error:derived-file:                    Taxonomy.            (line 255)
* error:derived-port:                    Taxonomy.            (line 275)
* error:divide-by-zero:                  Taxonomy.            (line 334)
* error:file-operation:                  Taxonomy.            (line 239)
* error:no-such-restart:                 Taxonomy.            (line 402)
* error:wrong-number-of-arguments:       Taxonomy.            (line 142)
* error:wrong-type-argument:             Taxonomy.            (line 121)
* error:wrong-type-datum:                Taxonomy.            (line  93)
* eval:                                  Environment Operations.
                                                              (line 131)
* even?:                                 Numerical operations.
                                                              (line  82)
* every:                                 Reduction of Lists.  (line 106)
* exact:                                 Exactness.           (line  27)
* exact->inexact:                        Numerical operations.
                                                              (line 390)
* exact->inexact <1>:                    Numerical operations.
                                                              (line 402)
* exact-integer?:                        Numerical operations.
                                                              (line  53)
* exact-nonnegative-integer?:            Numerical operations.
                                                              (line  54)
* exact-rational?:                       Numerical operations.
                                                              (line  55)
* exact?:                                Numerical operations.
                                                              (line  47)
* except-last-pair:                      Cutting and Pasting Lists.
                                                              (line  71)
* except-last-pair!:                     Cutting and Pasting Lists.
                                                              (line  72)
* exp:                                   Numerical operations.
                                                              (line 315)
* expt:                                  Numerical operations.
                                                              (line 358)
* extend-top-level-environment:          Top-level Environments.
                                                              (line  24)
* false:                                 Booleans.            (line  29)
* false?:                                Booleans.            (line  47)
* fifth:                                 Selecting List Components.
                                                              (line  80)
* file-access:                           File Manipulation.   (line 183)
* file-access-time:                      File Manipulation.   (line 242)
* file-access-time-direct:               File Manipulation.   (line 248)
* file-access-time-indirect:             File Manipulation.   (line 248)
* file-attributes:                       File Manipulation.   (line 283)
* file-attributes-direct:                File Manipulation.   (line 288)
* file-attributes-indirect:              File Manipulation.   (line 288)
* file-attributes/access-time:           File Manipulation.   (line 304)
* file-attributes/change-time:           File Manipulation.   (line 311)
* file-attributes/gid:                   File Manipulation.   (line 332)
* file-attributes/inode-number:          File Manipulation.   (line 335)
* file-attributes/length:                File Manipulation.   (line 314)
* file-attributes/mode-string:           File Manipulation.   (line 317)
* file-attributes/modes:                 File Manipulation.   (line 340)
* file-attributes/modification-time:     File Manipulation.   (line 307)
* file-attributes/n-links:               File Manipulation.   (line 323)
* file-attributes/type:                  File Manipulation.   (line 299)
* file-attributes/uid:                   File Manipulation.   (line 329)
* file-directory?:                       File Manipulation.   (line 113)
* file-eq?:                              File Manipulation.   (line 192)
* file-error?:                           File Ports.          (line  58)
* file-error? <1>:                       File Ports.          (line  65)
* file-error? <2>:                       File Ports.          (line  81)
* file-executable?:                      File Manipulation.   (line 177)
* file-exists-direct?:                   File Manipulation.   (line  13)
* file-exists-indirect?:                 File Manipulation.   (line  14)
* file-exists?:                          File Manipulation.   (line  12)
* file-length:                           File Manipulation.   (line 279)
* file-modes:                            File Manipulation.   (line 198)
* file-modification-time:                File Manipulation.   (line 227)
* file-modification-time-direct:         File Manipulation.   (line 233)
* file-modification-time-indirect:       File Manipulation.   (line 233)
* file-namestring:                       Operations on Pathnames.
                                                              (line 109)
* file-pathname:                         Operations on Pathnames.
                                                              (line 132)
* file-readable?:                        File Manipulation.   (line 169)
* file-regular?:                         File Manipulation.   (line 123)
* file-symbolic-link?:                   File Manipulation.   (line 134)
* file-time->global-decoded-time:        Time-Format Conversion.
                                                              (line  87)
* file-time->global-time-string:         Time-Format Conversion.
                                                              (line 118)
* file-time->local-decoded-time:         Time-Format Conversion.
                                                              (line  86)
* file-time->local-time-string:          Time-Format Conversion.
                                                              (line 117)
* file-time->universal-time:             Time-Format Conversion.
                                                              (line  80)
* file-touch:                            File Manipulation.   (line 272)
* file-type-direct:                      File Manipulation.   (line 144)
* file-type-indirect:                    File Manipulation.   (line 145)
* file-writeable?:                       File Manipulation.   (line 173)
* fill-circle:                           Custom Operations on X Graphics Devices.
                                                              (line  62)
* fill-circle on x-graphics-device:      Custom Operations on X Graphics Devices.
                                                              (line  61)
* fill-polygon:                          Custom Operations for Win32 Graphics.
                                                              (line  70)
* fill-polygon on win32-graphics-device: Custom Operations for Win32 Graphics.
                                                              (line  69)
* fill-with:                             Strings.             (line 621)
* filter:                                Filtering Lists.     (line   6)
* filter!:                               Filtering Lists.     (line  40)
* find:                                  Searching Lists.     (line   6)
* find-color on win32-graphics-device:   Custom Operations for Win32 Graphics.
                                                              (line  53)
* find-matching-item:                    Searching Lists.     (line  27)
* find-module:                           Windows Foreign Procedures.
                                                              (line   9)
* find-restart:                          Restarts.            (line  14)
* find-restart <1>:                      Finding and Invoking General Restart Code.
                                                              (line   6)
* find-restart <2>:                      Finding and Invoking General Restart Code.
                                                              (line  32)
* find-tail:                             Searching Lists.     (line  32)
* first:                                 Selecting List Components.
                                                              (line  76)
* fix:*:                                 Fixnum Operations.   (line  51)
* fix:+:                                 Fixnum Operations.   (line  49)
* fix:-:                                 Fixnum Operations.   (line  50)
* fix:-1+:                               Fixnum Operations.   (line  56)
* fix:1+:                                Fixnum Operations.   (line  55)
* fix:<:                                 Fixnum Operations.   (line  29)
* fix:<=:                                Fixnum Operations.   (line  31)
* fix:=:                                 Fixnum Operations.   (line  28)
* fix:>:                                 Fixnum Operations.   (line  30)
* fix:>=:                                Fixnum Operations.   (line  32)
* fix:and:                               Fixnum Operations.   (line  80)
* fix:andc:                              Fixnum Operations.   (line  87)
* fix:divide:                            Fixnum Operations.   (line  64)
* fix:fixnum?:                           Fixnum Operations.   (line  16)
* fix:gcd:                               Fixnum Operations.   (line  54)
* fix:lsh:                               Fixnum Operations.   (line 109)
* fix:negative?:                         Fixnum Operations.   (line  38)
* fix:not:                               Fixnum Operations.   (line  71)
* fix:or:                                Fixnum Operations.   (line  95)
* fix:positive?:                         Fixnum Operations.   (line  37)
* fix:quotient:                          Fixnum Operations.   (line  52)
* fix:remainder:                         Fixnum Operations.   (line  53)
* fix:xor:                               Fixnum Operations.   (line 102)
* fix:zero?:                             Fixnum Operations.   (line  36)
* flo:*:                                 Flonum Operations.   (line  29)
* flo:+:                                 Flonum Operations.   (line  27)
* flo:-:                                 Flonum Operations.   (line  28)
* flo:/:                                 Flonum Operations.   (line  30)
* flo:<:                                 Flonum Operations.   (line  15)
* flo:=:                                 Flonum Operations.   (line  14)
* flo:>:                                 Flonum Operations.   (line  16)
* flo:abs:                               Flonum Operations.   (line  46)
* flo:acos:                              Flonum Operations.   (line  53)
* flo:asin:                              Flonum Operations.   (line  52)
* flo:atan:                              Flonum Operations.   (line  54)
* flo:atan2:                             Flonum Operations.   (line  69)
* flo:ceiling:                           Flonum Operations.   (line  58)
* flo:ceiling->exact:                    Flonum Operations.   (line  62)
* flo:cos:                               Flonum Operations.   (line  50)
* flo:exp:                               Flonum Operations.   (line  47)
* flo:expt:                              Flonum Operations.   (line  56)
* flo:finite?:                           Flonum Operations.   (line  34)
* flo:flonum?:                           Flonum Operations.   (line  11)
* flo:floor:                             Flonum Operations.   (line  57)
* flo:floor->exact:                      Flonum Operations.   (line  61)
* flo:log:                               Flonum Operations.   (line  48)
* flo:negate:                            Flonum Operations.   (line  41)
* flo:negative?:                         Flonum Operations.   (line  23)
* flo:positive?:                         Flonum Operations.   (line  22)
* flo:random-unit:                       Random Numbers.      (line  41)
* flo:round:                             Flonum Operations.   (line  60)
* flo:round->exact:                      Flonum Operations.   (line  64)
* flo:sin:                               Flonum Operations.   (line  49)
* flo:sqrt:                              Flonum Operations.   (line  55)
* flo:tan:                               Flonum Operations.   (line  51)
* flo:truncate:                          Flonum Operations.   (line  59)
* flo:truncate->exact:                   Flonum Operations.   (line  63)
* flo:zero?:                             Flonum Operations.   (line  21)
* flonum-parser-fast?:                   Numerical input and output.
                                                              (line  40)
* flonum-unparser-cutoff:                Numerical input and output.
                                                              (line  52)
* floor:                                 Numerical operations.
                                                              (line 241)
* floor->exact:                          Numerical operations.
                                                              (line 273)
* fluid-let:                             Dynamic Binding.     (line 128)
* fluid-let <1>:                         Definitions.         (line   8)
* fluid-let <2>:                         Internal Definitions.
                                                              (line   6)
* fluid-let <3>:                         Sequencing.          (line  37)
* flush-output:                          Output Procedures.   (line 127)
* flush-output on textual output port:   Textual Output Port Operations.
                                                              (line  26)
* flush-output-port:                     Output Procedures.   (line  14)
* flush-output-port <1>:                 Output Procedures.   (line 123)
* fold-left:                             Reduction of Lists.  (line  58)
* fold-right:                            Reduction of Lists.  (line  29)
* font-structure on x-graphics-device:   Custom Operations on X Graphics Devices.
                                                              (line 121)
* for-all?:                              Reduction of Lists.  (line 129)
* for-each:                              Mapping of Lists.    (line  52)
* force:                                 Promises.            (line  13)
* force <1>:                             Streams.             (line  50)
* format:                                Format.              (line  17)
* format-error-message:                  Error Messages.      (line  44)
* fourth:                                Selecting List Components.
                                                              (line  79)
* fresh-line:                            Output Procedures.   (line 130)
* fresh-line on textual output port:     Textual Output Port Operations.
                                                              (line  19)
* gcd:                                   Numerical operations.
                                                              (line 218)
* gdi32.dll:                             Windows Foreign Procedures.
                                                              (line  26)
* ge:                                    Initial and Current Environments.
                                                              (line  14)
* ge <1>:                                REPL Environment.    (line  11)
* general-car-cdr:                       Pairs.               (line 108)
* generate-uninterned-symbol:            Symbols.             (line 121)
* get-default on x-graphics-device:      Custom Operations on X Graphics Devices.
                                                              (line 109)
* get-host-by-address:                   Miscellaneous OS Facilities.
                                                              (line  53)
* get-host-by-name:                      Miscellaneous OS Facilities.
                                                              (line  44)
* get-host-name:                         Miscellaneous OS Facilities.
                                                              (line  71)
* get-output-bytevector:                 Bytevector Ports.    (line  24)
* get-output-bytevector <1>:             Bytevector Ports.    (line  37)
* get-output-string:                     String Ports.        (line  24)
* get-output-string <1>:                 String Ports.        (line  47)
* get-parser-buffer-pointer:             Parser Buffers.      (line  81)
* get-parser-buffer-tail:                Parser Buffers.      (line  93)
* get-universal-time:                    Universal Time.      (line   6)
* global-decoded-time:                   Decoded Time.        (line  29)
* global-parser-macros:                  Parser-language Macros.
                                                              (line  59)
* grapheme-cluster-length:               Strings.             (line 314)
* grapheme-cluster-slice:                Strings.             (line 319)
* graphics-bind-drawing-mode:            Characteristics of Graphics Output.
                                                              (line  67)
* graphics-bind-line-style:              Characteristics of Graphics Output.
                                                              (line  69)
* graphics-clear:                        Drawing Graphics.    (line   9)
* graphics-clear <1>:                    Custom Operations on X Graphics Devices.
                                                              (line  15)
* graphics-clear <2>:                    Custom Operations on X Graphics Devices.
                                                              (line  69)
* graphics-close:                        Opening and Closing of Graphics Devices.
                                                              (line  43)
* graphics-coordinate-limits:            Coordinates for Graphics.
                                                              (line  36)
* graphics-device-coordinate-limits:     Coordinates for Graphics.
                                                              (line  31)
* graphics-disable-buffering:            Buffering of Graphics Output.
                                                              (line  18)
* graphics-drag-cursor:                  Drawing Graphics.    (line  69)
* graphics-draw-line:                    Drawing Graphics.    (line  29)
* graphics-draw-point:                   Drawing Graphics.    (line  13)
* graphics-draw-text:                    Drawing Graphics.    (line  36)
* graphics-enable-buffering:             Buffering of Graphics Output.
                                                              (line  11)
* graphics-erase-point:                  Drawing Graphics.    (line  17)
* graphics-flush:                        Buffering of Graphics Output.
                                                              (line  27)
* graphics-move-cursor:                  Drawing Graphics.    (line  65)
* graphics-operation:                    Custom Graphics Operations.
                                                              (line  11)
* graphics-reset-clip-rectangle:         Clipping of Graphics Output.
                                                              (line  25)
* graphics-set-clip-rectangle:           Clipping of Graphics Output.
                                                              (line  18)
* graphics-set-coordinate-limits:        Coordinates for Graphics.
                                                              (line  41)
* graphics-set-drawing-mode:             Characteristics of Graphics Output.
                                                              (line  77)
* graphics-set-line-style:               Characteristics of Graphics Output.
                                                              (line  78)
* graphics-type-available?:              Opening and Closing of Graphics Devices.
                                                              (line   6)
* group:                                 Regular S-Expressions.
                                                              (line 216)
* group-ref:                             Regular S-Expressions.
                                                              (line 227)
* guarantee-procedure-of-arity:          Arity.               (line  67)
* handle:                                Windows Types.       (line 137)
* hard-link-file:                        File Manipulation.   (line  40)
* hash:                                  Object Hashing.      (line  20)
* hash-by-equal:                         Address Hashing.     (line  45)
* hash-by-eqv:                           Address Hashing.     (line  39)
* hash-by-identity:                      Address Hashing.     (line  35)
* hash-object:                           Object Hashing.      (line  19)
* hash-table->alist:                     Basic Hash Table Operations.
                                                              (line  63)
* hash-table-clean!:                     Basic Hash Table Operations.
                                                              (line 148)
* hash-table-clear!:                     Basic Hash Table Operations.
                                                              (line  44)
* hash-table-constructor:                Construction of Hash Tables.
                                                              (line 112)
* hash-table-delete!:                    Basic Hash Table Operations.
                                                              (line  36)
* hash-table-entry-type:datum-ephemeral: Construction of Hash Tables.
                                                              (line 207)
* hash-table-entry-type:datum-weak:      Construction of Hash Tables.
                                                              (line 181)
* hash-table-entry-type:key&datum-ephemeral: Construction of Hash Tables.
                                                              (line 216)
* hash-table-entry-type:key&datum-weak:  Construction of Hash Tables.
                                                              (line 190)
* hash-table-entry-type:key-ephemeral:   Construction of Hash Tables.
                                                              (line 198)
* hash-table-entry-type:key-weak:        Construction of Hash Tables.
                                                              (line 172)
* hash-table-entry-type:key/datum-weak:  Construction of Hash Tables.
                                                              (line 191)
* hash-table-entry-type:strong:          Construction of Hash Tables.
                                                              (line 168)
* hash-table-grow-size:                  Resizing of Hash Tables.
                                                              (line 120)
* hash-table-intern!:                    Basic Hash Table Operations.
                                                              (line 133)
* hash-table-keys:                       Basic Hash Table Operations.
                                                              (line  71)
* hash-table-ref:                        Basic Hash Table Operations.
                                                              (line  22)
* hash-table-ref/default:                Basic Hash Table Operations.
                                                              (line  31)
* hash-table-rehash-size:                Resizing of Hash Tables.
                                                              (line 130)
* hash-table-rehash-threshold:           Resizing of Hash Tables.
                                                              (line 142)
* hash-table-set!:                       Basic Hash Table Operations.
                                                              (line  14)
* hash-table-shrink-size:                Resizing of Hash Tables.
                                                              (line 126)
* hash-table-size:                       Basic Hash Table Operations.
                                                              (line  52)
* hash-table-update!:                    Basic Hash Table Operations.
                                                              (line 114)
* hash-table-update!/default:            Basic Hash Table Operations.
                                                              (line 126)
* hash-table-values:                     Basic Hash Table Operations.
                                                              (line  78)
* hash-table-walk:                       Basic Hash Table Operations.
                                                              (line  88)
* hash-table/clean!:                     Basic Hash Table Operations.
                                                              (line 149)
* hash-table/clear!:                     Basic Hash Table Operations.
                                                              (line  45)
* hash-table/constructor:                Construction of Hash Tables.
                                                              (line 249)
* hash-table/count:                      Basic Hash Table Operations.
                                                              (line  53)
* hash-table/datum-list:                 Basic Hash Table Operations.
                                                              (line  79)
* hash-table/for-each:                   Basic Hash Table Operations.
                                                              (line  89)
* hash-table/get:                        Basic Hash Table Operations.
                                                              (line  32)
* hash-table/intern!:                    Basic Hash Table Operations.
                                                              (line 134)
* hash-table/key-list:                   Basic Hash Table Operations.
                                                              (line  72)
* hash-table/lookup:                     Basic Hash Table Operations.
                                                              (line 101)
* hash-table/make:                       Object Hashing.      (line  66)
* hash-table/modify!:                    Basic Hash Table Operations.
                                                              (line 128)
* hash-table/put!:                       Basic Hash Table Operations.
                                                              (line  15)
* hash-table/rehash-size:                Resizing of Hash Tables.
                                                              (line 131)
* hash-table/rehash-threshold:           Resizing of Hash Tables.
                                                              (line 143)
* hash-table/remove!:                    Basic Hash Table Operations.
                                                              (line  37)
* hash-table/size:                       Resizing of Hash Tables.
                                                              (line 121)
* hash-table?:                           Basic Hash Table Operations.
                                                              (line  11)
* hbitmap:                               Windows Types.       (line 138)
* hbrush:                                Windows Types.       (line 139)
* hcursor:                               Windows Types.       (line 140)
* hdc:                                   Windows Types.       (line 141)
* hicon:                                 Windows Types.       (line 142)
* hinstance:                             Windows Types.       (line 143)
* hmenu:                                 Windows Types.       (line 144)
* host-address-any:                      Miscellaneous OS Facilities.
                                                              (line  93)
* host-address-loopback:                 Miscellaneous OS Facilities.
                                                              (line 100)
* host-namestring:                       Operations on Pathnames.
                                                              (line 111)
* host=?:                                Miscellaneous Pathnames.
                                                              (line  16)
* host?:                                 Miscellaneous Pathnames.
                                                              (line  13)
* hpalette:                              Windows Types.       (line 145)
* hpen:                                  Windows Types.       (line 146)
* hrgn:                                  Windows Types.       (line 147)
* hwnd:                                  Windows Types.       (line 148)
* i/o-port-type?:                        Textual Port Types.  (line  47)
* i/o-port?:                             Ports.               (line  71)
* identifier=?:                          SC Identifiers.      (line  60)
* identifier?:                           SC Identifiers.      (line  33)
* if:                                    Conditionals.        (line  17)
* if <1>:                                Booleans.            (line   9)
* ignore-error:                          Condition Handling.  (line  88)
* ignore-errors:                         Condition Handling.  (line  43)
* imag-part:                             Numerical operations.
                                                              (line 368)
* image/destroy:                         Images.              (line  43)
* image/fill-from-byte-vector:           Images.              (line  60)
* image/height:                          Images.              (line  54)
* image/width:                           Images.              (line  57)
* image?:                                Images.              (line  40)
* implemented-primitive-procedure?:      Primitive Procedures.
                                                              (line  31)
* inexact:                               Numerical operations.
                                                              (line 389)
* inexact <1>:                           Numerical operations.
                                                              (line 401)
* inexact?:                              Numerical operations.
                                                              (line  48)
* init-file-pathname:                    Miscellaneous Pathnames.
                                                              (line  20)
* initial-offset:                        Structure Definitions.
                                                              (line 288)
* input:                                 Subprocess Options.  (line  17)
* input-buffer-size:                     Subprocess Options.  (line  46)
* input-buffer-size on textual input port: Textual Input Port Operations.
                                                              (line  90)
* input-line-translation:                Subprocess Options.  (line  29)
* input-port->parser-buffer:             Parser Buffers.      (line  23)
* input-port-blocking-mode:              Blocking Mode.       (line  35)
* input-port-open?:                      Ports.               (line  79)
* input-port-terminal-mode:              Terminal Mode.       (line  42)
* input-port-type?:                      Textual Port Types.  (line  45)
* input-port/char-ready?:                Textual Input Port Operations.
                                                              (line  61)
* input-port/discard-chars:              Textual Input Port Operations.
                                                              (line  63)
* input-port/peek-char:                  Textual Input Port Operations.
                                                              (line  60)
* input-port/read-char:                  Textual Input Port Operations.
                                                              (line  59)
* input-port/read-string:                Textual Input Port Operations.
                                                              (line  62)
* input-port/read-substring:             Textual Input Port Operations.
                                                              (line  64)
* input-port?:                           Ports.               (line  69)
* int:                                   Windows Types.       (line 113)
* integer->char:                         Characters.          (line 154)
* integer-ceiling:                       Numerical operations.
                                                              (line 182)
* integer-divide:                        Numerical operations.
                                                              (line 196)
* integer-divide <1>:                    Fixnum Operations.   (line  65)
* integer-divide-quotient:               Numerical operations.
                                                              (line 197)
* integer-divide-quotient <1>:           Fixnum Operations.   (line  65)
* integer-divide-remainder:              Numerical operations.
                                                              (line 198)
* integer-divide-remainder <1>:          Fixnum Operations.   (line  65)
* integer-floor:                         Numerical operations.
                                                              (line 181)
* integer-round:                         Numerical operations.
                                                              (line 184)
* integer-truncate:                      Numerical operations.
                                                              (line 179)
* integer-truncate <1>:                  Numerical operations.
                                                              (line 183)
* integer?:                              Numerical operations.
                                                              (line  19)
* interaction-i/o-port:                  Ports.               (line 110)
* interaction-i/o-port <1>:              Prompting.           (line  16)
* intern:                                Symbols.             (line  75)
* intern-soft:                           Symbols.             (line  88)
* internal-time/seconds->ticks:          Machine Time.        (line  40)
* internal-time/ticks->seconds:          Machine Time.        (line  33)
* interpreter-environment?:              Top-level Environments.
                                                              (line  17)
* invoke-restart:                        Restarts.            (line  14)
* invoke-restart <1>:                    Establishing Restart Code.
                                                              (line  41)
* invoke-restart <2>:                    Finding and Invoking General Restart Code.
                                                              (line   6)
* invoke-restart <3>:                    Finding and Invoking General Restart Code.
                                                              (line  43)
* invoke-restart <4>:                    The Named Restart Abstraction.
                                                              (line  18)
* invoke-restart-interactively:          Restarts.            (line  14)
* invoke-restart-interactively <1>:      Finding and Invoking General Restart Code.
                                                              (line   6)
* invoke-restart-interactively <2>:      Finding and Invoking General Restart Code.
                                                              (line  44)
* invoke-restart-interactively <3>:      Finding and Invoking General Restart Code.
                                                              (line  55)
* invoke-restart-interactively <4>:      The Named Restart Abstraction.
                                                              (line  18)
* invoke-restart-interactively <5>:      The Named Restart Abstraction.
                                                              (line  24)
* iota:                                  Construction of Lists.
                                                              (line  63)
* keep-matching-items:                   Filtering Lists.     (line  13)
* keep-matching-items!:                  Filtering Lists.     (line  48)
* kernel32.dll:                          Windows Foreign Procedures.
                                                              (line  31)
* keyword-constructor:                   Structure Definitions.
                                                              (line 166)
* lambda:                                Entry Format.        (line  46)
* lambda <1>:                            Static Scoping.      (line  34)
* lambda <2>:                            Additional Notations.
                                                              (line  77)
* lambda <3>:                            Procedure Call Syntax.
                                                              (line  27)
* lambda <4>:                            Lambda Expressions.  (line   6)
* lambda <5>:                            Lexical Binding.     (line  99)
* lambda <6>:                            Definitions.         (line   8)
* lambda <7>:                            Internal Definitions.
                                                              (line   6)
* lambda <8>:                            Sequencing.          (line  37)
* lambda <9>:                            Procedures.          (line   6)
* last-pair:                             Cutting and Pasting Lists.
                                                              (line  61)
* lcm:                                   Numerical operations.
                                                              (line 219)
* leading:                               Strings.             (line 618)
* leading <1>:                           Strings.             (line 682)
* length:                                Implementation restrictions.
                                                              (line  24)
* length <1>:                            Selecting List Components.
                                                              (line  38)
* length+:                               Selecting List Components.
                                                              (line  47)
* let:                                   Environment Concepts.
                                                              (line  22)
* let <1>:                               Lexical Binding.     (line  15)
* let <2>:                               Dynamic Binding.     (line 137)
* let <3>:                               Definitions.         (line   8)
* let <4>:                               Internal Definitions.
                                                              (line   6)
* let <5>:                               Sequencing.          (line  37)
* let <6>:                               Iteration.           (line  12)
* let*:                                  Environment Concepts.
                                                              (line  22)
* let* <1>:                              Lexical Binding.     (line  43)
* let* <2>:                              Definitions.         (line   8)
* let* <3>:                              Internal Definitions.
                                                              (line   6)
* let* <4>:                              Sequencing.          (line  37)
* let*-syntax:                           Syntactic Binding Constructs.
                                                              (line  84)
* let-syntax:                            Syntactic Binding Constructs.
                                                              (line  24)
* letrec:                                Environment Concepts.
                                                              (line  22)
* letrec <1>:                            Lexical Binding.     (line  74)
* letrec <2>:                            Definitions.         (line   8)
* letrec <3>:                            Internal Definitions.
                                                              (line   6)
* letrec <4>:                            Internal Definitions.
                                                              (line  18)
* letrec <5>:                            Sequencing.          (line  37)
* letrec-syntax:                         Syntactic Binding Constructs.
                                                              (line  54)
* line-end:                              Regular S-Expressions.
                                                              (line  49)
* line-start:                            Regular S-Expressions.
                                                              (line  48)
* link-variables:                        Top-level Environments.
                                                              (line  44)
* list:                                  Entry Format.        (line  87)
* list <1>:                              Construction of Lists.
                                                              (line   6)
* list <2>:                              Construction of Lists.
                                                              (line  25)
* list <3>:                              Miscellaneous List Operations.
                                                              (line   8)
* list <4>:                              Construction of Vectors.
                                                              (line  13)
* list <5>:                              String Ports.        (line  69)
* list->stream:                          Streams.             (line  16)
* list->string:                          Strings.             (line 258)
* list->vector:                          Construction of Lists.
                                                              (line  77)
* list->vector <1>:                      Construction of Vectors.
                                                              (line  21)
* list-copy:                             Construction of Lists.
                                                              (line  53)
* list-copy <1>:                         Association Lists.   (line 104)
* list-deletor:                          Filtering Lists.     (line  84)
* list-deletor <1>:                      Filtering Lists.     (line 107)
* list-deletor <2>:                      Association Lists.   (line  91)
* list-deletor!:                         Filtering Lists.     (line  84)
* list-deletor! <1>:                     Filtering Lists.     (line 108)
* list-deletor! <2>:                     Association Lists.   (line  91)
* list-head:                             Cutting and Pasting Lists.
                                                              (line  15)
* list-ref:                              Selecting List Components.
                                                              (line  63)
* list-search-negative:                  Searching Lists.     (line  27)
* list-search-positive:                  Searching Lists.     (line  27)
* list-tabulate:                         Construction of Lists.
                                                              (line  42)
* list-tail:                             Selecting List Components.
                                                              (line  74)
* list-tail <1>:                         Cutting and Pasting Lists.
                                                              (line  24)
* list-transform-negative:               Filtering Lists.     (line  23)
* list-transform-positive:               Filtering Lists.     (line  13)
* list?:                                 Selecting List Components.
                                                              (line   6)
* list? <1>:                             Association Lists.   (line  19)
* list? <2>:                             1D Tables.           (line  23)
* load-bitmap on win32-graphics-device:  Custom Operations for Win32 Graphics.
                                                              (line  79)
* load-option:                           Red-Black Trees.     (line  41)
* load-option <1>:                       Weight-Balanced Trees.
                                                              (line  69)
* load-option <2>:                       Format.              (line  14)
* load-option <3>:                       Parser Language.     (line 105)
* load-option <4>:                       XML Support.         (line  28)
* local-decoded-time:                    Decoded Time.        (line  13)
* local-host:                            Miscellaneous Pathnames.
                                                              (line   9)
* log:                                   Numerical operations.
                                                              (line 316)
* long:                                  Windows Types.       (line 115)
* magnitude:                             Numerical operations.
                                                              (line 369)
* make-1d-table:                         1D Tables.           (line  19)
* make-apply-hook:                       Application Hooks.   (line  26)
* make-bit-string:                       Construction of Bit Strings.
                                                              (line   6)
* make-cell:                             Parameters.          (line  50)
* make-char:                             Character implementation.
                                                              (line  21)
* make-circular-list:                    Miscellaneous List Operations.
                                                              (line   7)
* make-condition:                        Condition Signalling.
                                                              (line   6)
* make-condition <1>:                    Condition Signalling.
                                                              (line  34)
* make-condition <2>:                    Simple Condition Instance Operations.
                                                              (line  11)
* make-condition-type:                   Condition Types.     (line  17)
* make-datum-weak-eq-hash-table:         Construction of Hash Tables.
                                                              (line  34)
* make-datum-weak-eqv-hash-table:        Construction of Hash Tables.
                                                              (line  64)
* make-decoded-time:                     Decoded Time.        (line  45)
* make-directory:                        File Manipulation.   (line  61)
* make-entity:                           Application Hooks.   (line  47)
* make-ephemeron:                        Ephemerons.          (line  32)
* make-eq-hash-table:                    Construction of Hash Tables.
                                                              (line  28)
* make-equal-hash-table:                 Construction of Hash Tables.
                                                              (line  78)
* make-eqv-hash-table:                   Construction of Hash Tables.
                                                              (line  55)
* make-graphics-device:                  Opening and Closing of Graphics Devices.
                                                              (line  20)
* make-hash-table:                       Construction of Hash Tables.
                                                              (line  93)
* make-hash-table*:                      Construction of Hash Tables.
                                                              (line 109)
* make-hash-table-type:                  Construction of Hash Tables.
                                                              (line 125)
* make-hash-table-type*:                 Construction of Hash Tables.
                                                              (line 148)
* make-initialized-list:                 Construction of Lists.
                                                              (line  43)
* make-initialized-vector:               Construction of Vectors.
                                                              (line  42)
* make-key-ephemeral-eq-hash-table:      Construction of Hash Tables.
                                                              (line  41)
* make-key-ephemeral-eqv-hash-table:     Construction of Hash Tables.
                                                              (line  71)
* make-key-weak-eq-hash-table:           Construction of Hash Tables.
                                                              (line  26)
* make-key-weak-eqv-hash-table:          Construction of Hash Tables.
                                                              (line  53)
* make-list:                             Construction of Lists.
                                                              (line  17)
* make-list <1>:                         Miscellaneous List Operations.
                                                              (line   8)
* make-object-hash-table:                Construction of Hash Tables.
                                                              (line  56)
* make-object-hasher:                    Object Hashing.      (line  65)
* make-parameter:                        Parameters.          (line   9)
* make-parser-macros:                    Parser-language Macros.
                                                              (line  50)
* make-pathname:                         Components of Pathnames.
                                                              (line 158)
* make-polar:                            Numerical operations.
                                                              (line 366)
* make-port:                             Constructors and Accessors for Textual Ports.
                                                              (line  31)
* make-port-type:                        Textual Port Types.  (line  43)
* make-primitive-procedure:              Primitive Procedures.
                                                              (line   6)
* make-procedure-arity:                  Arity.               (line  16)
* make-random-state:                     Random Numbers.      (line  58)
* make-rb-tree:                          Red-Black Trees.     (line  44)
* make-record-type:                      Records.             (line  13)
* make-rectangular:                      Numerical operations.
                                                              (line 324)
* make-rectangular <1>:                  Numerical operations.
                                                              (line 365)
* make-root-top-level-environment:       Top-level Environments.
                                                              (line  26)
* make-settable-parameter:               Parameters.          (line  24)
* make-string:                           Strings.             (line  86)
* make-string-hash-table:                Construction of Hash Tables.
                                                              (line  84)
* make-strong-eq-hash-table:             Construction of Hash Tables.
                                                              (line  20)
* make-strong-eqv-hash-table:            Construction of Hash Tables.
                                                              (line  47)
* make-symbol-hash-table:                Construction of Hash Tables.
                                                              (line  21)
* make-syntactic-closure:                SC Transformer Definition.
                                                              (line 115)
* make-synthetic-identifier:             SC Identifiers.      (line  97)
* make-textual-port:                     Constructors and Accessors for Textual Ports.
                                                              (line   9)
* make-textual-port-type:                Textual Port Types.  (line   9)
* make-top-level-environment:            Top-level Environments.
                                                              (line  25)
* make-unsettable-parameter:             Parameters.          (line  10)
* make-vector:                           Construction of Vectors.
                                                              (line   6)
* make-weak-eq-hash-table:               Construction of Hash Tables.
                                                              (line  27)
* make-weak-eqv-hash-table:              Construction of Hash Tables.
                                                              (line  54)
* make-wt-tree:                          Construction of Weight-Balanced Trees.
                                                              (line  50)
* make-wt-tree-type:                     Construction of Weight-Balanced Trees.
                                                              (line  18)
* make-xml-!attlist:                     XML Structure.       (line  98)
* make-xml-!element:                     XML Structure.       (line  86)
* make-xml-!entity:                      XML Structure.       (line 129)
* make-xml-!notation:                    XML Structure.       (line 145)
* make-xml-declaration:                  XML Structure.       (line  54)
* make-xml-document:                     XML Structure.       (line  45)
* make-xml-dtd:                          XML Structure.       (line  77)
* make-xml-element:                      XML Structure.       (line  61)
* make-xml-external-id:                  XML Structure.       (line 150)
* make-xml-name:                         XML Names.           (line  21)
* make-xml-nmtoken:                      XML Names.           (line 128)
* make-xml-parameter-!entity:            XML Structure.       (line 134)
* make-xml-processing-instructions:      XML Structure.       (line  69)
* make-xml-qname:                        XML Names.           (line  83)
* make-xml-unparsed-!entity:             XML Structure.       (line 139)
* map:                                   Mapping of Lists.    (line   6)
* map <1>:                               *Parser.             (line 131)
* map*:                                  Mapping of Lists.    (line  24)
* map-window on x-graphics-device:       Custom Operations on X Graphics Devices.
                                                              (line  88)
* match:                                 *Parser.             (line  28)
* match-parser-buffer-char:              Parser Buffers.      (line 119)
* match-parser-buffer-char-ci:           Parser Buffers.      (line 120)
* match-parser-buffer-char-ci-no-advance: Parser Buffers.     (line 124)
* match-parser-buffer-char-in-set:       Parser Buffers.      (line 135)
* match-parser-buffer-char-in-set-no-advance: Parser Buffers. (line 136)
* match-parser-buffer-char-no-advance:   Parser Buffers.      (line 123)
* match-parser-buffer-not-char:          Parser Buffers.      (line 121)
* match-parser-buffer-not-char-ci:       Parser Buffers.      (line 122)
* match-parser-buffer-not-char-ci-no-advance: Parser Buffers. (line 126)
* match-parser-buffer-not-char-no-advance: Parser Buffers.    (line 125)
* match-parser-buffer-string:            Parser Buffers.      (line 141)
* match-parser-buffer-string-ci:         Parser Buffers.      (line 142)
* match-parser-buffer-string-ci-no-advance: Parser Buffers.   (line 144)
* match-parser-buffer-string-no-advance: Parser Buffers.      (line 143)
* match-parser-buffer-substring:         Parser Buffers.      (line 148)
* match-parser-buffer-substring-ci:      Parser Buffers.      (line 149)
* match-parser-buffer-substring-ci-no-advance: Parser Buffers.
                                                              (line 152)
* match-parser-buffer-substring-no-advance: Parser Buffers.   (line 150)
* max:                                   Numerical operations.
                                                              (line  86)
* measure-interval:                      Machine Time.        (line  84)
* member:                                Searching Lists.     (line  39)
* member-procedure:                      Searching Lists.     (line  54)
* memq:                                  Searching Lists.     (line  37)
* memv:                                  Searching Lists.     (line  38)
* merge-pathnames:                       File Ports.          (line  12)
* merge-pathnames <1>:                   Operations on Pathnames.
                                                              (line  40)
* merge-sort:                            Miscellaneous List Operations.
                                                              (line  34)
* merge-sort!:                           Modifying Vectors.   (line  36)
* microcode-id/operating-system:         Miscellaneous OS Facilities.
                                                              (line   9)
* microcode-id/operating-system-name:    Miscellaneous OS Facilities.
                                                              (line  10)
* microcode-id/operating-system-variant: Miscellaneous OS Facilities.
                                                              (line  18)
* min:                                   Numerical operations.
                                                              (line  87)
* modulo:                                Numerical operations.
                                                              (line 137)
* month/long-string:                     External Representation of Time.
                                                              (line  35)
* month/max-days:                        Decoded Time.        (line 126)
* month/short-string:                    External Representation of Time.
                                                              (line  36)
* move-window on win32-graphics-device:  Custom Operations for Win32 Graphics.
                                                              (line  92)
* move-window on x-graphics-device:      Custom Operations on X Graphics Devices.
                                                              (line 101)
* muffle-warning:                        Condition Signalling.
                                                              (line  58)
* muffle-warning <1>:                    Condition Handling.  (line 112)
* muffle-warning <2>:                    Restarts.            (line  23)
* muffle-warning <3>:                    Invoking Standard Restart Code.
                                                              (line  31)
* name->char:                            Characters.          (line  86)
* named:                                 Structure Definitions.
                                                              (line 235)
* named-lambda:                          Lambda Expressions.  (line 117)
* named-lambda <1>:                      Definitions.         (line  17)
* named-lambda <2>:                      Sequencing.          (line  37)
* NaN:                                   Flonum Operations.   (line  35)
* nearest-repl/environment:              REPL Environment.    (line   6)
* negative?:                             Numerical operations.
                                                              (line  80)
* newline:                               Output Procedures.   (line  84)
* nil:                                   Booleans.            (line  16)
* ninth:                                 Selecting List Components.
                                                              (line  84)
* noise:                                 *Parser.             (line  35)
* not:                                   Booleans.            (line  46)
* not-char:                              *Matcher.            (line  65)
* not-char-ci:                           *Matcher.            (line  66)
* notification-output-port:              Ports.               (line  92)
* notification-output-port <1>:          Condition Handling.  (line 104)
* nt-file-mode/archive:                  File Manipulation.   (line 217)
* nt-file-mode/compressed:               File Manipulation.   (line 220)
* nt-file-mode/directory:                File Manipulation.   (line 216)
* nt-file-mode/hidden:                   File Manipulation.   (line 214)
* nt-file-mode/normal:                   File Manipulation.   (line 218)
* nt-file-mode/read-only:                File Manipulation.   (line 213)
* nt-file-mode/system:                   File Manipulation.   (line 215)
* nt-file-mode/temporary:                File Manipulation.   (line 219)
* null-xml-name-prefix:                  XML Names.           (line 101)
* null-xml-name-prefix?:                 XML Names.           (line 104)
* null-xml-namespace-uri:                XML Names.           (line 111)
* null-xml-namespace-uri?:               XML Names.           (line 114)
* null?:                                 Selecting List Components.
                                                              (line  12)
* null? <1>:                             Selecting List Components.
                                                              (line  56)
* null? <2>:                             Streams.             (line  54)
* number->string:                        Numerical input and output.
                                                              (line   6)
* number-wt-type:                        Construction of Weight-Balanced Trees.
                                                              (line  38)
* number?:                               Numerical operations.
                                                              (line  15)
* numerator:                             Numerical operations.
                                                              (line 230)
* object-hash:                           Object Hashing.      (line  21)
* object-hashed?:                        Object Hashing.      (line  55)
* object-unhash:                         Object Hashing.      (line  31)
* odd?:                                  Numerical operations.
                                                              (line  81)
* open-binary-i/o-file:                  File Ports.          (line  80)
* open-binary-input-file:                File Ports.          (line  31)
* open-binary-input-file <1>:            File Ports.          (line  57)
* open-binary-output-file:               File Ports.          (line  31)
* open-binary-output-file <1>:           File Ports.          (line  64)
* open-dib:                              DIB procedures.      (line   9)
* open-i/o-file:                         File Ports.          (line  79)
* open-input-bytevector:                 Bytevector Ports.    (line  10)
* open-input-file:                       File Ports.          (line  22)
* open-input-file <1>:                   File Ports.          (line  56)
* open-input-string:                     String Ports.        (line  10)
* open-output-bytevector:                Bytevector Ports.    (line  20)
* open-output-bytevector <1>:            Bytevector Ports.    (line  37)
* open-output-file:                      File Ports.          (line  22)
* open-output-file <1>:                  File Ports.          (line  63)
* open-output-string:                    String Ports.        (line  20)
* open-output-string <1>:                String Ports.        (line  47)
* open-output-string <2>:                String Ports.        (line  60)
* open-tcp-server-socket:                TCP Sockets.         (line  62)
* open-tcp-stream-socket:                TCP Sockets.         (line  33)
* or:                                    Conditionals.        (line 149)
* or <1>:                                Booleans.            (line   9)
* os/hostname:                           Miscellaneous OS Facilities.
                                                              (line  78)
* output:                                Subprocess Options.  (line  61)
* output-buffer-size:                    Subprocess Options.  (line  92)
* output-buffer-size on textual output port: Textual Output Port Operations.
                                                              (line  64)
* output-line-translation:               Subprocess Options.  (line  75)
* output-port-blocking-mode:             Blocking Mode.       (line  36)
* output-port-open?:                     Ports.               (line  80)
* output-port-terminal-mode:             Terminal Mode.       (line  43)
* output-port-type?:                     Textual Port Types.  (line  46)
* output-port/discretionary-flush-output: Textual Output Port Operations.
                                                              (line  40)
* output-port/flush-output:              Textual Output Port Operations.
                                                              (line  39)
* output-port/fresh-line:                Textual Output Port Operations.
                                                              (line  38)
* output-port/write-char:                Textual Output Port Operations.
                                                              (line  35)
* output-port/write-string:              Textual Output Port Operations.
                                                              (line  49)
* output-port/write-substring:           Textual Output Port Operations.
                                                              (line  36)
* output-port/x-size:                    Textual Output Port Operations.
                                                              (line  83)
* output-port/y-size:                    Textual Output Port Operations.
                                                              (line  96)
* output-port?:                          Ports.               (line  70)
* pair?:                                 Pairs.               (line   9)
* pair? <1>:                             Selecting List Components.
                                                              (line  12)
* pair? <2>:                             Weak Pairs.          (line  17)
* param:default-pathname-defaults:       Operations on Pathnames.
                                                              (line  83)
* param:flonum-printer-cutoff:           Numerical input and output.
                                                              (line  56)
* param:print-with-maximum-readability?: Output Procedures.   (line 226)
* param:printer-list-breadth-limit:      Output Procedures.   (line 175)
* param:printer-list-depth-limit:        Output Procedures.   (line 192)
* param:printer-radix:                   Output Procedures.   (line 169)
* param:printer-string-length-limit:     Output Procedures.   (line 209)
* param:reader-fold-case?:               Input Procedures.    (line 271)
* param:reader-radix:                    Input Procedures.    (line 254)
* parameterize:                          Dynamic Binding.     (line   6)
* parameterize <1>:                      Ports.               (line 144)
* parameterize <2>:                      File Ports.          (line  38)
* parameterize <3>:                      File Ports.          (line  52)
* parameterize <4>:                      Output Procedures.   (line 166)
* parameterize*:                         Parameters.          (line  32)
* parse-namestring:                      Filenames and Pathnames.
                                                              (line  20)
* parser-buffer-pointer-index:           Parser Buffers.      (line 170)
* parser-buffer-pointer-line:            Parser Buffers.      (line 171)
* parser-buffer-pointer?:                Parser Buffers.      (line  51)
* parser-buffer-position-string:         Parser Buffers.      (line 160)
* parser-buffer-ref:                     Parser Buffers.      (line  71)
* parser-buffer?:                        Parser Buffers.      (line  48)
* parser-macros?:                        Parser-language Macros.
                                                              (line  56)
* partition:                             Filtering Lists.     (line  27)
* partition!:                            Filtering Lists.     (line  42)
* pathname-absolute?:                    Operations on Pathnames.
                                                              (line  19)
* pathname-as-directory:                 Operations on Pathnames.
                                                              (line 160)
* pathname-as-directory <1>:             Working Directory.   (line  30)
* pathname-default:                      Operations on Pathnames.
                                                              (line  95)
* pathname-default-device:               Components of Pathnames.
                                                              (line 208)
* pathname-default-directory:            Components of Pathnames.
                                                              (line 209)
* pathname-default-name:                 Components of Pathnames.
                                                              (line 210)
* pathname-default-type:                 Components of Pathnames.
                                                              (line 211)
* pathname-default-version:              Components of Pathnames.
                                                              (line 212)
* pathname-device:                       Components of Pathnames.
                                                              (line 172)
* pathname-directory:                    Components of Pathnames.
                                                              (line 173)
* pathname-host:                         Components of Pathnames.
                                                              (line 171)
* pathname-name:                         Components of Pathnames.
                                                              (line 174)
* pathname-new-device:                   Components of Pathnames.
                                                              (line 187)
* pathname-new-directory:                Components of Pathnames.
                                                              (line 188)
* pathname-new-name:                     Components of Pathnames.
                                                              (line 189)
* pathname-new-type:                     Components of Pathnames.
                                                              (line 190)
* pathname-new-version:                  Components of Pathnames.
                                                              (line 191)
* pathname-simplify:                     Filenames and Pathnames.
                                                              (line  45)
* pathname-type:                         Components of Pathnames.
                                                              (line 175)
* pathname-version:                      Components of Pathnames.
                                                              (line 176)
* pathname-wild?:                        Operations on Pathnames.
                                                              (line  36)
* pathname=?:                            Operations on Pathnames.
                                                              (line   9)
* pathname?:                             Operations on Pathnames.
                                                              (line   6)
* peek-char:                             Input Procedures.    (line  69)
* peek-char on textual input port:       Textual Input Port Operations.
                                                              (line  18)
* peek-parser-buffer-char:               Parser Buffers.      (line  67)
* peek-u8:                               Input Procedures.    (line 170)
* port-type/operation:                   Textual Port Types.  (line  53)
* port-type/operation-names:             Textual Port Types.  (line  52)
* port-type/operations:                  Textual Port Types.  (line  51)
* port-type?:                            Textual Port Types.  (line  44)
* port/input-blocking-mode:              Blocking Mode.       (line  53)
* port/input-terminal-mode:              Terminal Mode.       (line  60)
* port/operation:                        Constructors and Accessors for Textual Ports.
                                                              (line  35)
* port/operation-names:                  Constructors and Accessors for Textual Ports.
                                                              (line  36)
* port/output-blocking-mode:             Blocking Mode.       (line  57)
* port/output-terminal-mode:             Terminal Mode.       (line  64)
* port/set-input-blocking-mode:          Blocking Mode.       (line  54)
* port/set-input-terminal-mode:          Terminal Mode.       (line  61)
* port/set-output-blocking-mode:         Blocking Mode.       (line  58)
* port/set-output-terminal-mode:         Terminal Mode.       (line  65)
* port/state:                            Constructors and Accessors for Textual Ports.
                                                              (line  33)
* port/type:                             Constructors and Accessors for Textual Ports.
                                                              (line  32)
* port/with-input-blocking-mode:         Blocking Mode.       (line  55)
* port/with-input-terminal-mode:         Terminal Mode.       (line  62)
* port/with-output-blocking-mode:        Blocking Mode.       (line  59)
* port/with-output-terminal-mode:        Terminal Mode.       (line  66)
* port?:                                 Ports.               (line  74)
* positive?:                             Numerical operations.
                                                              (line  79)
* pp:                                    Output Procedures.   (line 158)
* predicate:                             Structure Definitions.
                                                              (line 109)
* primitive-procedure-name:              Primitive Procedures.
                                                              (line  26)
* primitive-procedure?:                  Procedure Operations.
                                                              (line  38)
* print-procedure:                       Structure Definitions.
                                                              (line 126)
* procedure:                             Booleans.            (line  58)
* procedure-arity:                       Arity.               (line  45)
* procedure-arity-max:                   Arity.               (line  31)
* procedure-arity-min:                   Arity.               (line  30)
* procedure-arity-valid?:                Arity.               (line  57)
* procedure-arity?:                      Arity.               (line  27)
* procedure-environment:                 Procedure Operations.
                                                              (line  42)
* procedure-of-arity?:                   Arity.               (line  60)
* procedure?:                            Procedure Operations.
                                                              (line  24)
* process-time-clock:                    Machine Time.        (line  17)
* promise-forced?:                       Promises.            (line  42)
* promise-value:                         Promises.            (line  46)
* promise?:                              Promises.            (line  39)
* prompt-for-command-char:               Prompting.           (line  41)
* prompt-for-command-expression:         Prompting.           (line  21)
* prompt-for-confirmation:               Prompting.           (line  89)
* prompt-for-evaluated-expression:       Prompting.           (line  82)
* prompt-for-expression:                 Prompting.           (line  69)
* pwd:                                   Working Directory.   (line  16)
* quasiquote:                            Quoting.             (line  41)
* quasiquote <1>:                        Lists.               (line  69)
* quick-sort:                            Miscellaneous List Operations.
                                                              (line  35)
* quick-sort!:                           Modifying Vectors.   (line  37)
* quote:                                 Quoting.             (line   9)
* quote <1>:                             Lists.               (line  69)
* quotient:                              Numerical operations.
                                                              (line 135)
* quotient <1>:                          Numerical operations.
                                                              (line 194)
* quotient <2>:                          Numerical operations.
                                                              (line 199)
* random:                                Random Numbers.      (line  18)
* random-state?:                         Random Numbers.      (line  67)
* rational?:                             Numerical operations.
                                                              (line  18)
* rationalize:                           Numerical operations.
                                                              (line 286)
* rationalize->exact:                    Numerical operations.
                                                              (line 287)
* rb-tree->alist:                        Red-Black Trees.     (line  74)
* rb-tree/copy:                          Red-Black Trees.     (line 136)
* rb-tree/datum-list:                    Red-Black Trees.     (line  88)
* rb-tree/delete!:                       Red-Black Trees.     (line  68)
* rb-tree/delete-max!:                   Red-Black Trees.     (line 188)
* rb-tree/delete-max-datum!:             Red-Black Trees.     (line 189)
* rb-tree/delete-max-pair!:              Red-Black Trees.     (line 190)
* rb-tree/delete-min!:                   Red-Black Trees.     (line 185)
* rb-tree/delete-min-datum!:             Red-Black Trees.     (line 186)
* rb-tree/delete-min-pair!:              Red-Black Trees.     (line 187)
* rb-tree/empty?:                        Red-Black Trees.     (line 111)
* rb-tree/equal?:                        Red-Black Trees.     (line 101)
* rb-tree/height:                        Red-Black Trees.     (line 121)
* rb-tree/insert!:                       Red-Black Trees.     (line  54)
* rb-tree/key-list:                      Red-Black Trees.     (line  82)
* rb-tree/lookup:                        Red-Black Trees.     (line  61)
* rb-tree/max:                           Red-Black Trees.     (line 173)
* rb-tree/max-datum:                     Red-Black Trees.     (line 177)
* rb-tree/max-pair:                      Red-Black Trees.     (line 181)
* rb-tree/min:                           Red-Black Trees.     (line 160)
* rb-tree/min-datum:                     Red-Black Trees.     (line 164)
* rb-tree/min-pair:                      Red-Black Trees.     (line 168)
* rb-tree/size:                          Red-Black Trees.     (line 115)
* rb-tree?:                              Red-Black Trees.     (line  51)
* read:                                  Overview.            (line  81)
* read <1>:                              External Representations.
                                                              (line  25)
* read <2>:                              Lists.               (line  69)
* read <3>:                              Symbols.             (line   6)
* read <4>:                              Symbols.             (line  27)
* read <5>:                              Symbols.             (line  41)
* read <6>:                              Ports.               (line  16)
* read <7>:                              Input Procedures.    (line  21)
* read-bytevector:                       Input Procedures.    (line 185)
* read-bytevector!:                      Input Procedures.    (line 200)
* read-char:                             Ports.               (line  16)
* read-char <1>:                         Input Procedures.    (line  46)
* read-char <2>:                         Input Procedures.    (line 111)
* read-char <3>:                         Input Procedures.    (line 232)
* read-char on textual input port:       Textual Input Port Operations.
                                                              (line   9)
* read-char-no-hang:                     Input Procedures.    (line  55)
* read-delimited-string:                 Input Procedures.    (line 219)
* read-line:                             Input Procedures.    (line  82)
* read-only:                             Structure Definitions.
                                                              (line 100)
* read-parser-buffer-char:               Parser Buffers.      (line  62)
* read-string:                           Input Procedures.    (line 126)
* read-string on textual input port:     Textual Input Port Operations.
                                                              (line  31)
* read-string!:                          Input Procedures.    (line 139)
* read-substring on textual input port:  Textual Input Port Operations.
                                                              (line  43)
* read-substring!:                       Input Procedures.    (line 158)
* read-u8:                               Ports.               (line  21)
* read-u8 <1>:                           Input Procedures.    (line 161)
* read-xml:                              XML Input.           (line  25)
* read-xml-file:                         XML Input.           (line  38)
* real-part:                             Numerical operations.
                                                              (line 367)
* real-time-clock:                       Machine Time.        (line  26)
* real?:                                 Numerical operations.
                                                              (line  17)
* receive:                               receive (SRFI 8).    (line  50)
* record-accessor:                       Records.             (line  58)
* record-constructor:                    Records.             (line  23)
* record-keyword-constructor:            Records.             (line  36)
* record-modifier:                       Records.             (line  68)
* record-predicate:                      Records.             (line  52)
* record-type-descriptor:                Records.             (line  86)
* record-type-field-names:               Records.             (line 105)
* record-type-name:                      Records.             (line  99)
* record-type?:                          Records.             (line  95)
* record?:                               Records.             (line  79)
* redisplay-hook:                        Subprocess Options.  (line 108)
* reduce-left:                           Reduction of Lists.  (line   6)
* reduce-right:                          Reduction of Lists.  (line  24)
* reference-barrier:                     Reference barriers.  (line  13)
* regsexp-match-string:                  Regsexp Procedures.  (line  27)
* regsexp-search-string-forward:         Regsexp Procedures.  (line  33)
* remainder:                             Numerical operations.
                                                              (line 136)
* remainder <1>:                         Numerical operations.
                                                              (line 199)
* remove:                                Filtering Lists.     (line  17)
* remove!:                               Filtering Lists.     (line  41)
* rename-file:                           File Manipulation.   (line  27)
* resize-window on win32-graphics-device: Custom Operations for Win32 Graphics.
                                                              (line  96)
* resize-window on x-graphics-device:    Custom Operations on X Graphics Devices.
                                                              (line  93)
* resource-id:                           Windows Types.       (line 160)
* restart/effector:                      The Named Restart Abstraction.
                                                              (line  17)
* restart/interactor:                    Finding and Invoking General Restart Code.
                                                              (line  60)
* restart/interactor <1>:                The Named Restart Abstraction.
                                                              (line  23)
* restart/name:                          The Named Restart Abstraction.
                                                              (line  12)
* restart?:                              The Named Restart Abstraction.
                                                              (line   9)
* retry:                                 Restarts.            (line  23)
* retry <1>:                             Invoking Standard Restart Code.
                                                              (line  42)
* retry <2>:                             Invoking Standard Restart Code.
                                                              (line  64)
* reverse:                               Miscellaneous List Operations.
                                                              (line  19)
* reverse!:                              Miscellaneous List Operations.
                                                              (line  26)
* round:                                 Numerical operations.
                                                              (line 244)
* round->exact:                          Numerical operations.
                                                              (line 276)
* rsc-macro-transformer:                 SC Transformer Definition.
                                                              (line  68)
* run-shell-command:                     Subprocess Procedures.
                                                              (line  14)
* run-synchronous-subprocess:            Subprocess Procedures.
                                                              (line  27)
* runtime:                               Machine Time.        (line  57)
* safe-accessors:                        Structure Definitions.
                                                              (line 274)
* save-bitmap on win32-graphics-device:  Custom Operations for Win32 Graphics.
                                                              (line  86)
* sc-macro-transformer:                  SC Transformer Definition.
                                                              (line  10)
* scheme-subprocess-environment:         Subprocess Options.  (line 131)
* second:                                Selecting List Components.
                                                              (line  77)
* seq:                                   Regular S-Expressions.
                                                              (line 205)
* seq <1>:                               *Matcher.            (line 113)
* seq <2>:                               *Parser.             (line  64)
* sequence:                              Sequencing.          (line  38)
* set!:                                  Top-Level Definitions.
                                                              (line  15)
* set! <1>:                              Assignments.         (line   6)
* set-apply-hook-extra!:                 Application Hooks.   (line  43)
* set-apply-hook-procedure!:             Application Hooks.   (line  36)
* set-background-color:                  Custom Operations for Win32 Graphics.
                                                              (line  13)
* set-background-color on win32-graphics-device: Custom Operations for Win32 Graphics.
                                                              (line  11)
* set-background-color on x-graphics-device: Custom Operations on X Graphics Devices.
                                                              (line  11)
* set-border-color on x-graphics-device: Custom Operations on X Graphics Devices.
                                                              (line  13)
* set-border-width on x-graphics-device: Custom Operations on X Graphics Devices.
                                                              (line  67)
* set-car!:                              Pairs.               (line  62)
* set-cdr!:                              Lists.               (line  45)
* set-cdr! <1>:                          Pairs.               (line  71)
* set-cdr! <2>:                          String Ports.        (line  69)
* set-cell-contents!:                    Parameters.          (line  56)
* set-current-input-port!:               Ports.               (line 131)
* set-current-output-port!:              Ports.               (line 132)
* set-current-parser-macros!:            Parser-language Macros.
                                                              (line  71)
* set-entity-extra!:                     Application Hooks.   (line  64)
* set-entity-procedure!:                 Application Hooks.   (line  57)
* set-ephemeron-datum!:                  Ephemerons.          (line  48)
* set-ephemeron-key!:                    Ephemerons.          (line  47)
* set-file-modes!:                       File Manipulation.   (line 207)
* set-file-times!:                       File Manipulation.   (line 255)
* set-font on win32-graphics-device:     Custom Operations for Win32 Graphics.
                                                              (line 112)
* set-font on x-graphics-device:         Custom Operations on X Graphics Devices.
                                                              (line  76)
* set-foreground-color:                  Custom Operations for Win32 Graphics.
                                                              (line  13)
* set-foreground-color on win32-graphics-device: Custom Operations for Win32 Graphics.
                                                              (line  12)
* set-foreground-color on x-graphics-device: Custom Operations on X Graphics Devices.
                                                              (line  12)
* set-hash-table-rehash-size!:           Resizing of Hash Tables.
                                                              (line 134)
* set-hash-table-rehash-threshold!:      Resizing of Hash Tables.
                                                              (line 146)
* set-hash-table/rehash-size!:           Resizing of Hash Tables.
                                                              (line 135)
* set-hash-table/rehash-threshold!:      Resizing of Hash Tables.
                                                              (line 147)
* set-input-buffer-size on textual input port: Textual Input Port Operations.
                                                              (line  94)
* set-input-port-blocking-mode!:         Blocking Mode.       (line  40)
* set-input-port-terminal-mode!:         Terminal Mode.       (line  47)
* set-interaction-i/o-port!:             Ports.               (line 135)
* set-internal-border-width on x-graphics-device: Custom Operations on X Graphics Devices.
                                                              (line  68)
* set-line-width on win32-graphics-device: Custom Operations for Win32 Graphics.
                                                              (line 102)
* set-mouse-color on x-graphics-device:  Custom Operations on X Graphics Devices.
                                                              (line  14)
* set-mouse-shape on x-graphics-device:  Custom Operations on X Graphics Devices.
                                                              (line  81)
* set-notification-output-port!:         Ports.               (line 133)
* set-output-buffer-size on textual output port: Textual Output Port Operations.
                                                              (line  68)
* set-output-port-blocking-mode:         Blocking Mode.       (line  41)
* set-output-port-terminal-mode!:        Terminal Mode.       (line  48)
* set-parser-buffer-pointer!:            Parser Buffers.      (line  85)
* set-port/state!:                       Constructors and Accessors for Textual Ports.
                                                              (line  34)
* set-record-type-unparser-method!:      Custom Output.       (line  66)
* set-textual-port-state!:               Constructors and Accessors for Textual Ports.
                                                              (line  19)
* set-trace-output-port!:                Ports.               (line 134)
* set-window-name on win32-graphics-device: Custom Operations for Win32 Graphics.
                                                              (line 108)
* set-working-directory-pathname!:       Working Directory.   (line  28)
* set-xml-!attlist-definitions!:         XML Structure.       (line  98)
* set-xml-!attlist-name!:                XML Structure.       (line  98)
* set-xml-!element-content-type!:        XML Structure.       (line  86)
* set-xml-!element-name!:                XML Structure.       (line  86)
* set-xml-!entity-name!:                 XML Structure.       (line 129)
* set-xml-!entity-value!:                XML Structure.       (line 129)
* set-xml-!notation-id!:                 XML Structure.       (line 145)
* set-xml-!notation-name!:               XML Structure.       (line 145)
* set-xml-declaration-encoding!:         XML Structure.       (line  54)
* set-xml-declaration-standalone!:       XML Structure.       (line  54)
* set-xml-declaration-version!:          XML Structure.       (line  54)
* set-xml-document-declaration!:         XML Structure.       (line  45)
* set-xml-document-dtd!:                 XML Structure.       (line  45)
* set-xml-document-misc-1!:              XML Structure.       (line  45)
* set-xml-document-misc-2!:              XML Structure.       (line  45)
* set-xml-document-misc-3!:              XML Structure.       (line  45)
* set-xml-document-root!:                XML Structure.       (line  45)
* set-xml-dtd-external!:                 XML Structure.       (line  77)
* set-xml-dtd-internal!:                 XML Structure.       (line  77)
* set-xml-dtd-root!:                     XML Structure.       (line  77)
* set-xml-element-attributes!:           XML Structure.       (line  61)
* set-xml-element-content!:              XML Structure.       (line  61)
* set-xml-element-name!:                 XML Structure.       (line  61)
* set-xml-external-id-id!:               XML Structure.       (line 150)
* set-xml-external-id-uri!:              XML Structure.       (line 150)
* set-xml-parameter-!entity-name!:       XML Structure.       (line 134)
* set-xml-parameter-!entity-value!:      XML Structure.       (line 134)
* set-xml-processing-instructions-name!: XML Structure.       (line  69)
* set-xml-processing-instructions-text!: XML Structure.       (line  69)
* set-xml-unparsed-!entity-id!:          XML Structure.       (line 139)
* set-xml-unparsed-!entity-name!:        XML Structure.       (line 139)
* set-xml-unparsed-!entity-notation!:    XML Structure.       (line 139)
* seventh:                               Selecting List Components.
                                                              (line  82)
* sexp:                                  *Matcher.            (line 169)
* sexp <1>:                              *Parser.             (line 148)
* shell-file-name:                       Subprocess Options.  (line 161)
* short:                                 Windows Types.       (line 117)
* signal-condition:                      Error System.        (line  87)
* signal-condition <1>:                  Condition Signalling.
                                                              (line  23)
* signal-condition <2>:                  Condition Signalling.
                                                              (line  48)
* signal-condition <3>:                  Condition Signalling.
                                                              (line  63)
* signal-condition <4>:                  Condition Handling.  (line  57)
* signal-condition <5>:                  Condition Handling.  (line  68)
* signal-condition <6>:                  Condition Handling.  (line  79)
* signal-condition <7>:                  Condition Handling.  (line 104)
* signed-integer->bit-string:            Integer Conversions of Bit Strings.
                                                              (line  12)
* simplest-exact-rational:               Numerical operations.
                                                              (line 305)
* simplest-rational:                     Numerical operations.
                                                              (line 304)
* sin:                                   Numerical operations.
                                                              (line 317)
* singleton-wt-tree:                     Construction of Weight-Balanced Trees.
                                                              (line  56)
* sixth:                                 Selecting List Components.
                                                              (line  81)
* soft-link-file:                        File Manipulation.   (line  49)
* sort:                                  Miscellaneous List Operations.
                                                              (line  33)
* sort!:                                 Modifying Vectors.   (line  35)
* source->parser-buffer:                 Parser Buffers.      (line  36)
* sqrt:                                  Implementation restrictions.
                                                              (line  65)
* sqrt <1>:                              Numerical operations.
                                                              (line 353)
* standard-error-handler:                Condition Handling.  (line  87)
* standard-error-handler <1>:            Condition Handling.  (line  95)
* standard-error-hook:                   Condition Handling.  (line  94)
* standard-print-method:                 Custom Output.       (line  20)
* standard-unparser-method:              Custom Output.       (line  85)
* standard-warning-handler:              Condition Handling.  (line 103)
* standard-warning-handler <1>:          Condition Handling.  (line 119)
* standard-warning-hook:                 Condition Handling.  (line 118)
* store-value:                           Restarts.            (line  23)
* store-value <1>:                       Invoking Standard Restart Code.
                                                              (line  52)
* store-value <2>:                       Invoking Standard Restart Code.
                                                              (line  64)
* stream:                                Streams.             (line  11)
* stream->list:                          Streams.             (line  20)
* stream-car:                            Streams.             (line  43)
* stream-cdr:                            Streams.             (line  48)
* stream-first:                          Streams.             (line  44)
* stream-head:                           Streams.             (line  69)
* stream-length:                         Streams.             (line  58)
* stream-map:                            Streams.             (line  79)
* stream-null?:                          Streams.             (line  53)
* stream-pair?:                          Streams.             (line  35)
* stream-ref:                            Streams.             (line  64)
* stream-rest:                           Streams.             (line  49)
* stream-tail:                           Streams.             (line  73)
* string:                                Strings.             (line  92)
* string <1>:                            *Matcher.            (line  73)
* string <2>:                            Windows Types.       (line 123)
* string*:                               Strings.             (line  93)
* string->decoded-time:                  Time-Format Conversion.
                                                              (line 135)
* string->file-time:                     Time-Format Conversion.
                                                              (line 150)
* string->list:                          Strings.             (line 257)
* string->nfc:                           Strings.             (line 363)
* string->nfd:                           Strings.             (line 364)
* string->number:                        Numerical input and output.
                                                              (line 159)
* string->parser-buffer:                 Parser Buffers.      (line  33)
* string->symbol:                        Symbols.             (line  96)
* string->uninterned-symbol:             Symbols.             (line 115)
* string->universal-time:                Time-Format Conversion.
                                                              (line 127)
* string->vector:                        Construction of Vectors.
                                                              (line  27)
* string->xml:                           XML Input.           (line  47)
* string-any:                            Strings.             (line 426)
* string-append:                         Strings.             (line 248)
* string-append*:                        Strings.             (line 249)
* string-builder:                        Strings.             (line 479)
* string-ci:                             Regular S-Expressions.
                                                              (line  22)
* string-ci <1>:                         *Matcher.            (line  74)
* string-ci<=?:                          Strings.             (line 146)
* string-ci<?:                           Strings.             (line 142)
* string-ci=?:                           Strings.             (line 134)
* string-ci=? <1>:                       Strings.             (line 462)
* string-ci>=?:                          Strings.             (line 148)
* string-ci>?:                           Strings.             (line 144)
* string-compare:                        Strings.             (line 176)
* string-compare-ci:                     Strings.             (line 177)
* string-copy:                           Strings.             (line 267)
* string-copy!:                          Strings.             (line 271)
* string-count:                          Strings.             (line 415)
* string-downcase:                       Strings.             (line 194)
* string-end:                            Regular S-Expressions.
                                                              (line  70)
* string-every:                          Strings.             (line 440)
* string-fill!:                          Strings.             (line 292)
* string-find-first-index:               Searching and Matching Strings.
                                                              (line  70)
* string-find-last-index:                Searching and Matching Strings.
                                                              (line  71)
* string-find-next-char:                 Searching and Matching Strings.
                                                              (line  82)
* string-find-next-char-ci:              Searching and Matching Strings.
                                                              (line  83)
* string-find-next-char-in-set:          Searching and Matching Strings.
                                                              (line  84)
* string-find-previous-char:             Searching and Matching Strings.
                                                              (line 111)
* string-find-previous-char-ci:          Searching and Matching Strings.
                                                              (line 112)
* string-find-previous-char-in-set:      Searching and Matching Strings.
                                                              (line 113)
* string-foldcase:                       Strings.             (line 196)
* string-for-each:                       Strings.             (line 395)
* string-hash:                           Strings.             (line 460)
* string-hash <1>:                       Symbols.             (line 168)
* string-hash-ci:                        Strings.             (line 461)
* string-hash-mod:                       Construction of Hash Tables.
                                                              (line 230)
* string-head:                           Strings.             (line 473)
* string-in-nfc?:                        Strings.             (line 352)
* string-in-nfd?:                        Strings.             (line 353)
* string-is-xml-name?:                   XML Names.           (line 132)
* string-is-xml-nmtoken?:                XML Names.           (line 134)
* string-joiner:                         Strings.             (line 524)
* string-joiner*:                        Strings.             (line 525)
* string-length:                         Implementation restrictions.
                                                              (line  24)
* string-length <1>:                     Strings.             (line 105)
* string-lower-case?:                    Strings.             (line 213)
* string-map:                            Strings.             (line 369)
* string-match-backward:                 Searching and Matching Strings.
                                                              (line 139)
* string-match-forward:                  Searching and Matching Strings.
                                                              (line 129)
* string-null?:                          Strings.             (line 454)
* string-pad-left:                       Strings.             (line 653)
* string-pad-right:                      Strings.             (line 654)
* string-padder:                         Strings.             (line 602)
* string-prefix-ci?:                     Searching and Matching Strings.
                                                              (line 150)
* string-prefix?:                        Searching and Matching Strings.
                                                              (line 149)
* string-ref:                            Storage Model.       (line  16)
* string-ref <1>:                        Strings.             (line 108)
* string-replace:                        Strings.             (line 740)
* string-search-all:                     Searching and Matching Strings.
                                                              (line  42)
* string-search-backward:                Searching and Matching Strings.
                                                              (line  25)
* string-search-forward:                 Searching and Matching Strings.
                                                              (line   9)
* string-set!:                           Storage Model.       (line   9)
* string-set! <1>:                       Strings.             (line 115)
* string-set! <2>:                       Symbols.             (line  62)
* string-slice:                          Strings.             (line 225)
* string-splitter:                       Strings.             (line 557)
* string-start:                          Regular S-Expressions.
                                                              (line  69)
* string-suffix-ci?:                     Searching and Matching Strings.
                                                              (line 159)
* string-suffix?:                        Searching and Matching Strings.
                                                              (line 158)
* string-tail:                           Strings.             (line 476)
* string-titlecase:                      Strings.             (line 195)
* string-trim:                           Strings.             (line 720)
* string-trim-left:                      Strings.             (line 721)
* string-trim-right:                     Strings.             (line 722)
* string-trimmer:                        Strings.             (line 672)
* string-upcase:                         Strings.             (line 193)
* string-upper-case?:                    Strings.             (line 212)
* string-word-breaks:                    Strings.             (line 326)
* string-wt-type:                        Construction of Weight-Balanced Trees.
                                                              (line  44)
* string<=?:                             Strings.             (line 145)
* string<?:                              Strings.             (line 141)
* string=?:                              Equivalence Predicates.
                                                              (line  27)
* string=? <1>:                          Equivalence Predicates.
                                                              (line  54)
* string=? <2>:                          Strings.             (line 129)
* string=? <3>:                          Strings.             (line 462)
* string=? <4>:                          Symbols.             (line  12)
* string=? <5>:                          Symbols.             (line  62)
* string=? <6>:                          Construction of Hash Tables.
                                                              (line  85)
* string=? <7>:                          Construction of Hash Tables.
                                                              (line 230)
* string>=?:                             Strings.             (line 147)
* string>?:                              Strings.             (line 143)
* string?:                               Strings.             (line  83)
* strong-hash-table/constructor:         Construction of Hash Tables.
                                                              (line 256)
* sublist:                               Cutting and Pasting Lists.
                                                              (line   6)
* substring:                             Strings.             (line 221)
* substring->parser-buffer:              Parser Buffers.      (line  27)
* substring?:                            Searching and Matching Strings.
                                                              (line  58)
* subvector:                             Cutting Vectors.     (line   6)
* subvector->list:                       Construction of Lists.
                                                              (line  76)
* subvector-fill!:                       Modifying Vectors.   (line   7)
* subvector-move-left!:                  Modifying Vectors.   (line  11)
* subvector-move-right!:                 Modifying Vectors.   (line  12)
* symbol->string:                        Storage Model.       (line  29)
* symbol->string <1>:                    Equivalence Predicates.
                                                              (line  27)
* symbol->string <2>:                    Equivalence Predicates.
                                                              (line  54)
* symbol->string <3>:                    Symbols.             (line  61)
* symbol-append:                         Symbols.             (line 153)
* symbol-hash:                           Symbols.             (line 167)
* symbol-hash-mod:                       Symbols.             (line 172)
* symbol<?:                              Symbols.             (line 182)
* symbol?:                               Symbols.             (line  54)
* syntax-rules:                          Pattern Language.    (line  12)
* system-clock:                          Machine Time.        (line  47)
* system-global-environment:             Environment Variables.
                                                              (line  15)
* system-library-directory-pathname:     Miscellaneous Pathnames.
                                                              (line  76)
* system-library-pathname:               Miscellaneous Pathnames.
                                                              (line  68)
* t:                                     Booleans.            (line  16)
* tan:                                   Numerical operations.
                                                              (line 319)
* tcp-server-connection-accept:          TCP Sockets.         (line  79)
* TEMPLATE:                              Entry Format.        (line   9)
* temporary-directory-pathname:          File Manipulation.   (line  97)
* temporary-file-pathname:               File Manipulation.   (line  84)
* tenth:                                 Selecting List Components.
                                                              (line  85)
* textual-i/o-port-type?:                Textual Port Types.  (line  38)
* textual-input-port->parser-buffer:     Parser Buffers.      (line  22)
* textual-input-port-type?:              Textual Port Types.  (line  36)
* textual-output-port-type?:             Textual Port Types.  (line  37)
* textual-port-operation:                Constructors and Accessors for Textual Ports.
                                                              (line  23)
* textual-port-operation-names:          Constructors and Accessors for Textual Ports.
                                                              (line  27)
* textual-port-state:                    Constructors and Accessors for Textual Ports.
                                                              (line  16)
* textual-port-type:                     Constructors and Accessors for Textual Ports.
                                                              (line  13)
* textual-port-type?:                    Textual Port Types.  (line  35)
* textual-port?:                         Ports.               (line  72)
* the-environment:                       Top-level Environments.
                                                              (line  11)
* there-exists?:                         Reduction of Lists.  (line 103)
* third:                                 Selecting List Components.
                                                              (line  78)
* thunk?:                                Arity.               (line  72)
* time-zone->string:                     External Representation of Time.
                                                              (line  47)
* time-zone?:                            Decoded Time.        (line 118)
* top-level-environment?:                Top-level Environments.
                                                              (line  16)
* trace-output-port:                     Ports.               (line 102)
* trailing:                              Strings.             (line 618)
* trailing <1>:                          Strings.             (line 682)
* transform:                             *Parser.             (line 102)
* tree-copy:                             Pairs.               (line 132)
* true:                                  Booleans.            (line  30)
* truncate:                              Numerical operations.
                                                              (line 243)
* truncate->exact:                       Numerical operations.
                                                              (line 275)
* type:                                  Structure Definitions.
                                                              (line 104)
* type <1>:                              Structure Definitions.
                                                              (line 217)
* type-descriptor:                       Structure Definitions.
                                                              (line 184)
* u8-ready?:                             Input Procedures.    (line 179)
* uint:                                  Windows Types.       (line 114)
* ulong:                                 Windows Types.       (line 116)
* unbind-variable:                       Top-level Environments.
                                                              (line  58)
* unchecked:                             Windows Types.       (line  93)
* unhash:                                Object Hashing.      (line  30)
* unhash-object:                         Object Hashing.      (line  29)
* unicode-char?:                         Unicode.             (line  22)
* unicode-code-point?:                   Unicode.             (line  14)
* unicode-scalar-value?:                 Unicode.             (line  18)
* universal-time->file-time:             Time-Format Conversion.
                                                              (line  39)
* universal-time->global-decoded-time:   Time-Format Conversion.
                                                              (line  10)
* universal-time->global-time-string:    Time-Format Conversion.
                                                              (line  46)
* universal-time->local-decoded-time:    Time-Format Conversion.
                                                              (line   9)
* universal-time->local-time-string:     Time-Format Conversion.
                                                              (line  45)
* unparser/set-tagged-pair-method!:      Custom Output.       (line  75)
* unparser/set-tagged-vector-method!:    Custom Output.       (line  73)
* unquote:                               Quoting.             (line  84)
* unquote <1>:                           Lists.               (line  69)
* unquote-splicing:                      Quoting.             (line  84)
* unquote-splicing <1>:                  Lists.               (line  69)
* unread-char:                           Input Procedures.    (line  61)
* unsigned-integer->bit-string:          Integer Conversions of Bit Strings.
                                                              (line   6)
* use-pty?:                              Subprocess Options.  (line 151)
* use-value:                             Restarts.            (line  23)
* use-value <1>:                         Invoking Standard Restart Code.
                                                              (line  63)
* user-homedir-pathname:                 Miscellaneous Pathnames.
                                                              (line  30)
* user-initial-environment:              Initial and Current Environments.
                                                              (line  14)
* user-initial-environment <1>:          Environment Variables.
                                                              (line  24)
* user-initial-environment <2>:          REPL Environment.    (line   7)
* user32.dll:                            Windows Foreign Procedures.
                                                              (line  35)
* ushort:                                Windows Types.       (line 118)
* valid-hash-number?:                    Object Hashing.      (line  59)
* valid-object-hash?:                    Object Hashing.      (line  58)
* values:                                Continuations.       (line 152)
* values <1>:                            *Parser.             (line  47)
* vector:                                Construction of Vectors.
                                                              (line  12)
* vector->list:                          Construction of Lists.
                                                              (line  75)
* vector->list <1>:                      Construction of Vectors.
                                                              (line  22)
* vector->string:                        Construction of Vectors.
                                                              (line  28)
* vector-binary-search:                  Selecting Vector Components.
                                                              (line  39)
* vector-copy:                           Construction of Vectors.
                                                              (line  18)
* vector-eighth:                         Selecting Vector Components.
                                                              (line  34)
* vector-fifth:                          Selecting Vector Components.
                                                              (line  31)
* vector-fill!:                          Modifying Vectors.   (line   6)
* vector-first:                          Selecting Vector Components.
                                                              (line  27)
* vector-fourth:                         Selecting Vector Components.
                                                              (line  30)
* vector-grow:                           Construction of Vectors.
                                                              (line  50)
* vector-head:                           Cutting Vectors.     (line  10)
* vector-length:                         Implementation restrictions.
                                                              (line  24)
* vector-length <1>:                     Selecting Vector Components.
                                                              (line   9)
* vector-map:                            Construction of Vectors.
                                                              (line  57)
* vector-ref:                            Storage Model.       (line  16)
* vector-ref <1>:                        Selecting Vector Components.
                                                              (line  12)
* vector-second:                         Selecting Vector Components.
                                                              (line  28)
* vector-set!:                           Selecting Vector Components.
                                                              (line  18)
* vector-seventh:                        Selecting Vector Components.
                                                              (line  33)
* vector-sixth:                          Selecting Vector Components.
                                                              (line  32)
* vector-tail:                           Cutting Vectors.     (line  15)
* vector-third:                          Selecting Vector Components.
                                                              (line  29)
* vector?:                               Selecting Vector Components.
                                                              (line   6)
* warn:                                  Condition Signalling.
                                                              (line  23)
* warn <1>:                              Condition Signalling.
                                                              (line  47)
* warn <2>:                              Invoking Standard Restart Code.
                                                              (line  32)
* weak-car:                              Weak Pairs.          (line  32)
* weak-cdr:                              Weak Pairs.          (line  64)
* weak-cons:                             Weak Pairs.          (line  23)
* weak-hash-table/constructor:           Construction of Hash Tables.
                                                              (line 262)
* weak-pair/car?:                        Weak Pairs.          (line  27)
* weak-pair?:                            Weak Pairs.          (line  20)
* weak-set-car!:                         Weak Pairs.          (line  60)
* weak-set-cdr!:                         Weak Pairs.          (line  67)
* where:                                 Prompting.           (line  50)
* windows-procedure:                     Windows Foreign Procedures.
                                                              (line  40)
* with-current-parser-macros:            Parser-language Macros.
                                                              (line  75)
* with-current-unparser-state:           Custom Output.       (line  89)
* with-input-from-binary-file:           File Ports.          (line  50)
* with-input-from-file:                  File Ports.          (line  36)
* with-input-from-port:                  Ports.               (line 139)
* with-input-from-string:                String Ports.        (line  91)
* with-input-port-blocking-mode:         Blocking Mode.       (line  45)
* with-input-port-terminal-mode:         Terminal Mode.       (line  52)
* with-interaction-i/o-port:             Ports.               (line 143)
* with-notification-output-port:         Ports.               (line 141)
* with-output-port-blocking-mode:        Blocking Mode.       (line  46)
* with-output-port-terminal-mode:        Terminal Mode.       (line  53)
* with-output-to-binary-file:            File Ports.          (line  51)
* with-output-to-file:                   File Ports.          (line  37)
* with-output-to-port:                   Ports.               (line 140)
* with-output-to-string:                 String Ports.        (line  92)
* with-output-to-truncated-string:       String Ports.        (line  93)
* with-pointer:                          *Matcher.            (line 198)
* with-pointer <1>:                      *Parser.             (line 158)
* with-restart:                          Error System.        (line 101)
* with-restart <1>:                      Restarts.            (line   6)
* with-restart <2>:                      Establishing Restart Code.
                                                              (line  40)
* with-restart <3>:                      Finding and Invoking General Restart Code.
                                                              (line   6)
* with-simple-restart:                   Restarts.            (line   6)
* with-simple-restart <1>:               Restarts.            (line  44)
* with-simple-restart <2>:               Establishing Restart Code.
                                                              (line   6)
* with-simple-restart <3>:               Finding and Invoking General Restart Code.
                                                              (line   6)
* with-timings:                          Machine Time.        (line  64)
* with-trace-output-port:                Ports.               (line 142)
* with-working-directory-pathname:       Working Directory.   (line  63)
* withdraw-window on x-graphics-device:  Custom Operations on X Graphics Devices.
                                                              (line  89)
* within-continuation:                   Continuations.       (line  69)
* word:                                  Windows Types.       (line 119)
* working-directory:                     Subprocess Options.  (line 144)
* working-directory-pathname:            Working Directory.   (line  15)
* write:                                 External Representations.
                                                              (line  25)
* write <1>:                             Symbols.             (line  18)
* write <2>:                             Symbols.             (line  27)
* write <3>:                             Ports.               (line  16)
* write <4>:                             String Ports.        (line  69)
* write <5>:                             String Ports.        (line  86)
* write <6>:                             Output Procedures.   (line  33)
* write <7>:                             Error Messages.      (line  18)
* write-bytevector:                      Output Procedures.   (line 110)
* write-char:                            Entry Format.        (line  92)
* write-char <1>:                        Ports.               (line  16)
* write-char <2>:                        Output Procedures.   (line  89)
* write-char on textual output port:     Textual Output Port Operations.
                                                              (line   9)
* write-condition-report:                Condition Handling.  (line 104)
* write-condition-report <1>:            Condition State.     (line  28)
* write-condition-report <2>:            Simple Condition Instance Operations.
                                                              (line  35)
* write-dib:                             DIB procedures.      (line  15)
* write-line:                            Output Procedures.   (line 139)
* write-restart-report:                  The Named Restart Abstraction.
                                                              (line  31)
* write-shared:                          Output Procedures.   (line  53)
* write-simple:                          Output Procedures.   (line  58)
* write-string:                          Output Procedures.   (line  94)
* write-string <1>:                      Format.              (line  18)
* write-substring:                       Output Procedures.   (line  98)
* write-substring on textual output port: Textual Output Port Operations.
                                                              (line  12)
* write-to-string:                       String Ports.        (line  80)
* write-u8:                              Ports.               (line  21)
* write-u8 <1>:                          Output Procedures.   (line 101)
* write-xml:                             XML Output.          (line  27)
* write-xml-file:                        XML Output.          (line  31)
* wt-tree/add:                           Basic Operations on Weight-Balanced Trees.
                                                              (line  23)
* wt-tree/add!:                          Basic Operations on Weight-Balanced Trees.
                                                              (line  31)
* wt-tree/delete:                        Basic Operations on Weight-Balanced Trees.
                                                              (line  51)
* wt-tree/delete!:                       Basic Operations on Weight-Balanced Trees.
                                                              (line  58)
* wt-tree/delete-min:                    Indexing Operations on Weight-Balanced Trees.
                                                              (line  67)
* wt-tree/delete-min!:                   Indexing Operations on Weight-Balanced Trees.
                                                              (line  77)
* wt-tree/difference:                    Advanced Operations on Weight-Balanced Trees.
                                                              (line  46)
* wt-tree/empty?:                        Basic Operations on Weight-Balanced Trees.
                                                              (line  15)
* wt-tree/fold:                          Advanced Operations on Weight-Balanced Trees.
                                                              (line  88)
* wt-tree/for-each:                      Advanced Operations on Weight-Balanced Trees.
                                                              (line 109)
* wt-tree/index:                         Indexing Operations on Weight-Balanced Trees.
                                                              (line  11)
* wt-tree/index-datum:                   Indexing Operations on Weight-Balanced Trees.
                                                              (line  12)
* wt-tree/index-pair:                    Indexing Operations on Weight-Balanced Trees.
                                                              (line  13)
* wt-tree/intersection:                  Advanced Operations on Weight-Balanced Trees.
                                                              (line  36)
* wt-tree/lookup:                        Basic Operations on Weight-Balanced Trees.
                                                              (line  44)
* wt-tree/member?:                       Basic Operations on Weight-Balanced Trees.
                                                              (line  38)
* wt-tree/min:                           Indexing Operations on Weight-Balanced Trees.
                                                              (line  46)
* wt-tree/min-datum:                     Indexing Operations on Weight-Balanced Trees.
                                                              (line  47)
* wt-tree/min-pair:                      Indexing Operations on Weight-Balanced Trees.
                                                              (line  48)
* wt-tree/rank:                          Indexing Operations on Weight-Balanced Trees.
                                                              (line  38)
* wt-tree/set-equal?:                    Advanced Operations on Weight-Balanced Trees.
                                                              (line  71)
* wt-tree/size:                          Basic Operations on Weight-Balanced Trees.
                                                              (line  19)
* wt-tree/split<:                        Advanced Operations on Weight-Balanced Trees.
                                                              (line   9)
* wt-tree/split>:                        Advanced Operations on Weight-Balanced Trees.
                                                              (line  16)
* wt-tree/subset?:                       Advanced Operations on Weight-Balanced Trees.
                                                              (line  56)
* wt-tree/union:                         Advanced Operations on Weight-Balanced Trees.
                                                              (line  23)
* wt-tree/union-merge:                   Advanced Operations on Weight-Balanced Trees.
                                                              (line 121)
* wt-tree?:                              Basic Operations on Weight-Balanced Trees.
                                                              (line  11)
* x-character-bounds/ascent:             Custom Operations on X Graphics Devices.
                                                              (line 148)
* x-character-bounds/descent:            Custom Operations on X Graphics Devices.
                                                              (line 149)
* x-character-bounds/lbearing:           Custom Operations on X Graphics Devices.
                                                              (line 145)
* x-character-bounds/rbearing:           Custom Operations on X Graphics Devices.
                                                              (line 146)
* x-character-bounds/width:              Custom Operations on X Graphics Devices.
                                                              (line 147)
* x-close-all-displays:                  Utilities for X Graphics.
                                                              (line  20)
* x-font-structure/all-chars-exist:      Custom Operations on X Graphics Devices.
                                                              (line 128)
* x-font-structure/character-bounds:     Custom Operations on X Graphics Devices.
                                                              (line 133)
* x-font-structure/default-char:         Custom Operations on X Graphics Devices.
                                                              (line 129)
* x-font-structure/direction:            Custom Operations on X Graphics Devices.
                                                              (line 127)
* x-font-structure/max-ascent:           Custom Operations on X Graphics Devices.
                                                              (line 134)
* x-font-structure/max-bounds:           Custom Operations on X Graphics Devices.
                                                              (line 131)
* x-font-structure/max-descent:          Custom Operations on X Graphics Devices.
                                                              (line 135)
* x-font-structure/min-bounds:           Custom Operations on X Graphics Devices.
                                                              (line 130)
* x-font-structure/name:                 Custom Operations on X Graphics Devices.
                                                              (line 126)
* x-font-structure/start-index:          Custom Operations on X Graphics Devices.
                                                              (line 132)
* x-geometry-string:                     Utilities for X Graphics.
                                                              (line  24)
* x-graphics/close-display:              Utilities for X Graphics.
                                                              (line  14)
* x-graphics/open-display:               Utilities for X Graphics.
                                                              (line   6)
* x-open-display:                        X Graphics Type.     (line  16)
* x-size on textual output port:         Textual Output Port Operations.
                                                              (line  73)
* xcons:                                 Pairs.               (line  28)
* xml-!attlist:                          XML Structure.       (line  97)
* xml-!attlist-definitions:              XML Structure.       (line  98)
* xml-!attlist-name:                     XML Structure.       (line  98)
* xml-!attlist?:                         XML Structure.       (line  98)
* xml-!element:                          XML Structure.       (line  85)
* xml-!element-content-type:             XML Structure.       (line  86)
* xml-!element-name:                     XML Structure.       (line  86)
* xml-!element?:                         XML Structure.       (line  86)
* xml-!entity:                           XML Structure.       (line 128)
* xml-!entity-name:                      XML Structure.       (line 129)
* xml-!entity-value:                     XML Structure.       (line 129)
* xml-!entity?:                          XML Structure.       (line 129)
* xml-!notation:                         XML Structure.       (line 144)
* xml-!notation-id:                      XML Structure.       (line 145)
* xml-!notation-name:                    XML Structure.       (line 145)
* xml-!notation?:                        XML Structure.       (line 145)
* xml->string:                           XML Output.          (line  49)
* xml->wide-string:                      XML Output.          (line  39)
* xml-declaration:                       XML Structure.       (line  53)
* xml-declaration-encoding:              XML Structure.       (line  54)
* xml-declaration-standalone:            XML Structure.       (line  54)
* xml-declaration-version:               XML Structure.       (line  54)
* xml-declaration?:                      XML Structure.       (line  54)
* xml-document:                          XML Structure.       (line  44)
* xml-document-declaration:              XML Structure.       (line  45)
* xml-document-dtd:                      XML Structure.       (line  45)
* xml-document-misc-1:                   XML Structure.       (line  45)
* xml-document-misc-2:                   XML Structure.       (line  45)
* xml-document-misc-3:                   XML Structure.       (line  45)
* xml-document-root:                     XML Structure.       (line  45)
* xml-document?:                         XML Structure.       (line  45)
* xml-dtd:                               XML Structure.       (line  76)
* xml-dtd-external:                      XML Structure.       (line  77)
* xml-dtd-internal:                      XML Structure.       (line  77)
* xml-dtd-root:                          XML Structure.       (line  77)
* xml-dtd?:                              XML Structure.       (line  77)
* xml-element:                           XML Structure.       (line  60)
* xml-element-attributes:                XML Structure.       (line  61)
* xml-element-content:                   XML Structure.       (line  61)
* xml-element-name:                      XML Structure.       (line  61)
* xml-element?:                          XML Structure.       (line  61)
* xml-external-id:                       XML Structure.       (line 149)
* xml-external-id-id:                    XML Structure.       (line 150)
* xml-external-id-uri:                   XML Structure.       (line 150)
* xml-external-id?:                      XML Structure.       (line 150)
* xml-name->symbol:                      XML Names.           (line  43)
* xml-name-local:                        XML Names.           (line  64)
* xml-name-prefix:                       XML Names.           (line  61)
* xml-name-string:                       XML Names.           (line  50)
* xml-name-uri:                          XML Names.           (line  46)
* xml-name=?:                            XML Names.           (line  75)
* xml-name?:                             XML Names.           (line  40)
* xml-nmtoken?:                          XML Names.           (line 130)
* xml-parameter-!entity:                 XML Structure.       (line 133)
* xml-parameter-!entity-name:            XML Structure.       (line 134)
* xml-parameter-!entity-value:           XML Structure.       (line 134)
* xml-parameter-!entity?:                XML Structure.       (line 134)
* xml-processing-instructions:           XML Structure.       (line  68)
* xml-processing-instructions-name:      XML Structure.       (line  69)
* xml-processing-instructions-text:      XML Structure.       (line  69)
* xml-processing-instructions?:          XML Structure.       (line  69)
* xml-qname-local:                       XML Names.           (line  93)
* xml-qname-prefix:                      XML Names.           (line  90)
* xml-qname?:                            XML Names.           (line  87)
* xml-unparsed-!entity:                  XML Structure.       (line 138)
* xml-unparsed-!entity-id:               XML Structure.       (line 139)
* xml-unparsed-!entity-name:             XML Structure.       (line 139)
* xml-unparsed-!entity-notation:         XML Structure.       (line 139)
* xml-unparsed-!entity?:                 XML Structure.       (line 139)
* xml-uri:                               XML Names.           (line 120)
* xmlns-uri:                             XML Names.           (line 124)
* y-size:                                Textual Port Primitives.
                                                              (line  43)
* y-size on textual output port:         Textual Output Port Operations.
                                                              (line  78)
* zero?:                                 Numerical operations.
                                                              (line  28)
* zero? <1>:                             Numerical operations.
                                                              (line  78)

