\input texinfo @c -*-texinfo-*-
@iftex
@finalout
@end iftex
@comment $Id: scheme.texinfo,v 1.125 2003/09/18 16:51:59 cph Exp $
@comment %**start of header (This is for running Texinfo on a region.)
@setfilename scheme.info
@settitle MIT/GNU Scheme Reference
@comment %**end of header (This is for running Texinfo on a region.)
@setchapternewpage odd
@syncodeindex vr fn
@syncodeindex pg fn
@syncodeindex tp fn

@comment Parts of this document are essentially plagiarized from "Common
@comment Lisp: The Language".  Those parts are marked by the following
@comment comment lines:
@comment
@comment **** begin CLTL ****
@comment **** end CLTL ****

@dircategory Programming Languages
@direntry
* MIT/GNU Scheme Ref: (mit-scheme-ref).	MIT/GNU Scheme Reference Manual
@end direntry

@tex
% Don't let TeX put extra vspace around math displays ($$ ... $$),
% because these always appear inside @tex ... @end tex commands
% that put space there to begin with.
\abovedisplayskip=0pt plus 3pt
\abovedisplayshortskip=0pt plus 3pt
\belowdisplayskip=0pt plus 3pt
\belowdisplayshortskip=0pt plus 3pt
@end tex

@ifinfo
This file documents the MIT/GNU Scheme system.

Copyright @copyright{} 1991,1992,1993,1994,1995 Massachusetts Institute of Technology@*
Copyright @copyright{} 1996,1997,1999,2000,2001 Massachusetts Institute of Technology@*
Copyright @copyright{} 2002,2003 Massachusetts Institute of Technology@*

Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.2 or
any later version published by the Free Software Foundation; with no
Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
Texts.  A copy of the license is included in the section entitled "GNU
Free Documentation License".
@end ifinfo

@titlepage
@title{MIT/GNU Scheme Reference Manual}
@subtitle Edition 1.99
@subtitle for Scheme Release 7.7.90
@subtitle 18 September 2003
@author by Chris Hanson
@author the MIT Scheme Team
@author and a cast of thousands

@page

@vskip 0pt plus 1filll
Copyright @copyright{} 1991,1992,1993,1994,1995 Massachusetts Institute of Technology@*
Copyright @copyright{} 1996,1997,1999,2000,2001 Massachusetts Institute of Technology@*
Copyright @copyright{} 2002,2003 Massachusetts Institute of Technology@*

Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.2 or
any later version published by the Free Software Foundation; with no
Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
Texts.  A copy of the license is included in the section entitled "GNU
Free Documentation License".
@end titlepage

@node Top, Acknowledgements, (dir), (dir)

@ifinfo
Scheme is the UnCommon Lisp.  This Info file is the programmer reference
document for the MIT/GNU implementation of Scheme.  It describes the
facilities available for developing programs in MIT/GNU Scheme, and the
``public'' parts of the implementation.
@end ifinfo

@menu
* Acknowledgements::            
* Overview::                    
* Special Forms::               
* Equivalence Predicates::      
* Numbers::                     
* Characters::                  
* Strings::                     
* Lists::                       
* Vectors::                     
* Bit Strings::                 
* Miscellaneous Datatypes::     
* Associations::                
* Procedures::                  
* Environments::                
* Input/Output::                
* Operating-System Interface::  
* Error System::                
* Graphics::                    
* Win32 Package Reference::     
* GNU Free Documentation License::  
* Binding Index::               
* Concept Index::               

@detailmenu
 --- The Detailed Node Listing ---

Overview

* Notational Conventions::      
* Scheme Concepts::             
* Lexical Conventions::         
* Expressions::                 

Notational Conventions

* Errors::                      
* Examples::                    
* Entry Format::                

Scheme Concepts

* Variable Bindings::           
* Environment Concepts::        
* Initial and Current Environments::  
* Static Scoping::              
* True and False::              
* External Representations::    
* Disjointness of Types::       
* Storage Model::               

Lexical Conventions

* Whitespace::                  
* Delimiters::                  
* Identifiers::                 
* Uppercase and Lowercase::     
* Naming Conventions::          
* Comments::                    
* Additional Notations::        

Expressions

* Literal Expressions::         
* Variable References::         
* Special Form Syntax::         
* Procedure Call Syntax::       

Special Forms

* Lambda Expressions::          
* Lexical Binding::             
* Dynamic Binding::             
* Definitions::                 
* Assignments::                 
* Quoting::                     
* Conditionals::                
* Sequencing::                  
* Iteration::                   
* Structure Definitions::       
* Macros::                      
* SRFI syntax::                 

Definitions

* Top-Level Definitions::       
* Internal Definitions::        

Macros

* Syntactic Binding Constructs::  
* Pattern Language::            
* Syntactic Closures::          
* Explicit Renaming::           

Syntactic Closures

* Syntax Terminology::          
* SC Transformer Definition::   
* SC Identifiers::              

SRFI syntax

* cond-expand (SRFI 0)::        
* receive (SRFI 8)::            
* define-record-type (SRFI 9)::  

Numbers

* Numerical types::             
* Exactness::                   
* Implementation restrictions::  
* Syntax of numerical constants::  
* Numerical operations::        
* Numerical input and output::  
* Fixnum and Flonum Operations::  
* Random Numbers::              

Fixnum and Flonum Operations

* Fixnum Operations::           
* Flonum Operations::           

Characters

* External Representation of Characters::  
* Comparison of Characters::    
* Miscellaneous Character Operations::  
* Internal Representation of Characters::  
* ISO-8859-1 Characters::       
* Character Sets::              
* Unicode::                     

Strings

* Construction of Strings::     
* Selecting String Components::  
* Comparison of Strings::       
* Alphabetic Case in Strings::  
* Cutting and Pasting Strings::  
* Searching Strings::           
* Matching Strings::            
* Regular Expressions::         
* Modification of Strings::     
* Variable-Length Strings::     
* Byte Vectors::                

Regular Expressions

* Regular-expression procedures::  
* REXP abstraction::            

Lists

* Pairs::                       
* Construction of Lists::       
* Selecting List Components::   
* Cutting and Pasting Lists::   
* Filtering Lists::             
* Searching Lists::             
* Mapping of Lists::            
* Reduction of Lists::          
* Miscellaneous List Operations::  

Vectors

* Construction of Vectors::     
* Selecting Vector Components::  
* Cutting Vectors::             
* Modifying Vectors::           

Bit Strings

* Construction of Bit Strings::  
* Selecting Bit String Components::  
* Cutting and Pasting Bit Strings::  
* Bitwise Operations on Bit Strings::  
* Modification of Bit Strings::  
* Integer Conversions of Bit Strings::  

Miscellaneous Datatypes

* Booleans::                    
* Symbols::                     
* Cells::                       
* Records::                     
* Promises::                    
* Streams::                     
* Weak Pairs::                  

Associations

* Association Lists::           
* 1D Tables::                   
* The Association Table::       
* Hash Tables::                 
* Object Hashing::              
* Red-Black Trees::             
* Weight-Balanced Trees::       

Hash Tables

* Construction of Hash Tables::  
* Basic Hash Table Operations::  
* Resizing of Hash Tables::     
* Address Hashing::             
* Low-Level Hash Table Operations::  

Weight-Balanced Trees

* Construction of Weight-Balanced Trees::  
* Basic Operations on Weight-Balanced Trees::  
* Advanced Operations on Weight-Balanced Trees::  
* Indexing Operations on Weight-Balanced Trees::  

Procedures

* Procedure Operations::        
* Primitive Procedures::        
* Continuations::               
* Application Hooks::           

Environments

* Environment Operations::      
* Environment Variables::       
* REPL Environment::            
* Top-level Environments::      

Input/Output

* Ports::                       
* File Ports::                  
* String Ports::                
* Input Procedures::            
* Output Procedures::           
* Format::                      
* Custom Output::               
* Prompting::                   
* Port Primitives::             
* Parser Buffers::              
* Parser Language::             
* XML Parser::                  

Port Primitives

* Port Types::                  
* Constructors and Accessors for Ports::  
* Input Port Operations::       
* Output Port Operations::      
* Blocking Mode::               
* Terminal Mode::               

Parser Language

* *Matcher::                    
* *Parser::                     
* Parser-language Macros::      

Operating-System Interface

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

Pathnames

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

Date and Time

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

Subprocesses

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

Error System

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

Restarts

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

Condition Instances

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

Graphics

* 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
* OS/2 Graphics::               Graphics on IBM OS/2

X Graphics

* X Graphics Type::             
* Utilities for X Graphics::    
* Custom Operations on X Graphics Devices::  

Win32 Graphics

* Win32 Graphics Type::         
* Custom Operations for Win32 Graphics::  Custom Operations for Win32 Graphics Devices

OS/2 Graphics

* OS/2 Graphics Type::          
* Color Operations for OS/2 Graphics::  
* Window Operations for OS/2 Graphics::  
* Event Operations for OS/2 Graphics::  
* Miscellaneous Operations for OS/2 Graphics::  

Win32 Package Reference

* Win32 Package Overview::      
* Foreign function interface::  
* Device Independent Bitmap Utilities::  

Foreign Function Interface

* Windows Types::               
* Windows Foreign Procedures::  
* Win32 API names and procedures::  

Device Independent Bitmap Utilities

* DIB procedures::              
* Other parts of the DIB Utilities implementation::  

@end detailmenu
@end menu

@node Acknowledgements, Overview, Top, Top
@unnumbered Acknowledgements

While "a cast of thousands" may be an overstatement, it is certainly the
case that this document represents the work of many people.  First and
foremost, thanks go to the authors of the @cite{Revised^4 Report on the
Algorithmic Language Scheme}, from which much of this document is
derived.  Thanks also to BBN Advanced Computers Inc.@: for the use of
parts of their @cite{Butterfly Scheme Reference}, and to Margaret
O'Connell for translating it from BBN's text-formatting language to
ours.

Special thanks to Richard Stallman, Bob Chassell, and Brian Fox, all of
the Free Software Foundation, for creating and maintaining the Texinfo
formatting language in which this document is written.

This report describes research done at the Artificial Intelligence
Laboratory and the Laboratory for Computer Science, both of the
Massachusetts Institute of Technology.  Support for this research is
provided in part by the Advanced Research Projects Agency of the
Department of Defense and by the National Science Foundation.

@include overview.texi
@include special-forms.texi
@include equivalence.texi
@include numbers.texi
@include characters.texi
@include strings.texi
@include lists.texi
@include vectors.texi
@include bit-strings.texi
@include misc-datatypes.texi
@include associations.texi
@include procedures.texi
@include environments.texi
@include io.texi
@include os-interface.texi
@include error.texi
@include graphics.texi
@include win32-packaging.texi
@node GNU Free Documentation License, Binding Index, Win32 Package Reference, Top
@appendix GNU Free Documentation License
@include gfdl.texinfo

@node Binding Index, Concept Index, GNU Free Documentation License, Top
@appendix Binding Index
@printindex fn

@node Concept Index,  , Binding Index, Top
@appendix Concept Index
@printindex cp

@summarycontents
@contents

@bye
