.xgp .vsp 11 .squish .ltrspc 0 .c << text font >> .font 0 25fr1 .c << SCHEME font >> .font 1 22fg .c << heading fonts >> .font 2 30vrb .font 3 66vr .font 4 gls;foo1 .quote .dummy _ .twinch 6.25 .tlinch 9 .sidm 53 .c << want to flush losing multiple cr's >> .crcomp .c << want to make leading spaces on line small >> .c << want to have at least 3 lines of a section on a page >> .sblock 5 .spw 16 .adjust .center 2MASSACHUSETTS INSTITUTE OF TECHNOLOGY .CENTER ARTIFICIAL INTELLIGENCE LABORATORY .sp .spread /0AI Memo No. 452//January 1978 .sp .center 2THE__REVISED__REPORT__ON .sp 2 .center 3SCHEME .sp .center 2A__DIALECT__OF__LISP .sp .center 0by .sp .center Guy Lewis Steele Jr.* and Gerald Jay Sussman .sp 2 0Abstract: .br SCHEME is a dialect of LISP. It is an expression-oriented, applicative order, interpreter-based language which allows one to manipulate programs as data. It differs from most current dialects of LISP in that it closes all lambda-expressions in the environment of their definition or declaration, rather than in the execution environment. This has the consequence that variables are normally lexically scoped, as in ALGOL. However, in contrast with ALGOL, SCHEME treats procedures as a first-class data type. They can be the values of variables, the returned values of procedures, and components of data structures. Another difference from LISP is that SCHEME is implemented in such a way that tail-recursions execute without net growth of the interpreter stack. The effect of this is that a procedure call behaves like a GOTO, and thus procedure calls can be used to implement iterations, as in PLASMA. Here we give a complete "user manual" for the SCHEME language. Some features described here were not documented in the original report on SCHEME (for instance particular macros). Other features have been added, changed, or deleted as our understanding of certain language issues evolved. Annotations to the manual describe the motivations for these changes. .sp .in 4 .un 4 Keywords:__LISP, SCHEME, LISP-like languages, lambda-calculus, environments, lexical scoping, dynamic scoping, fluid variables, control structures, macros, extensible syntax, extensible languages .in 0 .sp This report describes research done at the Artificial Intelligence Laboratory of the Massachusetts Institute of Technology. Support for the laboratory's artificial intelligence research is provided in part by the Advanced Research Projects Agency of the Department of Defense under Office of Naval Research contract N00014-75-C-0643. .sp *__NSF Fellow .page .spage .php1 .he1 1Steele and Sussman .he2 1The Revised Report on SCHEME0 .section A.__The Representation of SCHEME Procedures as S-expressions .sp SCHEME programs are represented as LISP s-expressions. The evaluator interprets these s-expressions in a specified way. This specification constitutes the definition of the language. The definition of SCHEME is a little fuzzy around the edges. This is because of the inherent extensibility of LISP-like languages {Note LISP Is a Ball of Mud}. We can define a few essential features which constitute the "kernel" of the language, and also enumerate several syntactic and semantic extensions which are convenient and normally included in a given implementation. The existence of a mechanism for such extensions is a part of the kernel of SCHEME; however, any particular such extension is not necessarily part of the kernel. .sp For those who like this sort of thing, here is the BNF for SCHEME programs {Note LISP BNF}: .sp .nofill .spw 13 .in 4 1