IEEE-1178-1990-R2002.pdf

上传人:哈尼dd 文档编号:3770117 上传时间:2019-09-23 格式:PDF 页数:80 大小:429.70KB
返回 下载 相关 举报
IEEE-1178-1990-R2002.pdf_第1页
第1页 / 共80页
IEEE-1178-1990-R2002.pdf_第2页
第2页 / 共80页
IEEE-1178-1990-R2002.pdf_第3页
第3页 / 共80页
IEEE-1178-1990-R2002.pdf_第4页
第4页 / 共80页
IEEE-1178-1990-R2002.pdf_第5页
第5页 / 共80页
亲,该文档总共80页,到这儿已超出免费预览范围,如果喜欢就下载吧!
资源描述

《IEEE-1178-1990-R2002.pdf》由会员分享,可在线阅读,更多相关《IEEE-1178-1990-R2002.pdf(80页珍藏版)》请在三一文库上搜索。

1、 IEEE Std 1178-1990 (R2002) IEEE Standard for the Scheme Programming Language Sponsor Microprocessor and Microcomputer Standards Subcommittee of the IEEE Computer Society Approved December 10, 1990 Reaffirmed December 10, 2002 IEEE Standards Board Abstract: The form and meaning of programs written i

2、n the Scheme programming language in particular, their syntax, the semantic rules for interpreting them, and the representation of data to be input or output by them, are specified. The fundamental ideas of the language and the notational conventions used for describing and writing programs in the l

3、anguage are presented. The syntax and semantics of expressions, programs, and definitions are specified. Schemes built-in procedures, which include all of the languages data manipulation and input/output primitives, are described, and a formal syntax for Scheme written in extended Backus-Naur form i

4、s provided. A formal denotational semantics for Schemes and some issues in the implementation of Schemes arithmetic are covered in the appendixes. Keywords: Lisp, Scheme, Scheme programming language The Institute of Electrical and Electronics Engineers, Inc. 345 East 47th Street, New York, NY 10017-

5、2394, USA 1991 by the Institute of Electrical and Electronics Engineers, Inc. All rights reserved. Published 1991. Printed in the United States of America Library of Congress Cataloging in Publication Data will be found in the following page. No part of this publication may be reproduced in any form

6、, in an electronic retrieval system or otherwise, without prior written permission of the publisher. Copyright The Institute of Electrical and Electronics Engineers, Inc. Provided by IHS under license with IEEELicensee=NASA Technical Standards 1/9972545001 Not for Resale, 04/21/2007 11:59:04 MDTNo r

7、eproduction or networking permitted without license from IHS -,-,- ii IEEE Standards documents are developed within the Technical Committees of the IEEE Societies and the Standards Coordinating Committees of the IEEE Standards Board. Members of the committees serve voluntarily and without compensati

8、on. They are not necessarily members of the Institute. The standards developed within IEEE represent a consensus of the broad expertise on the subject within the Institute as well as those activities outside of IEEE which have expressed an interest in participating in the development of the standard

9、. Use of an IEEE Standard is wholly voluntary. The existence of an IEEE Standard does not imply that there are no other ways to produce, test, measure, purchase, market, or provide other goods and services related to the scope of the IEEE Standard. Furthermore, the viewpoint expressed at the time a

10、standard is approved and issued is subject to change brought about through developments in the state of the art and comments received from users of the standard. Every IEEE Standard is subjected to review at least every five years for revision or reaffirmation. When a document is more than five year

11、s old, and has not been reaffirmed, it is reasonable to conclude that its contents, although still of some value, do not wholly reflect the present state of the art. Users are cautioned to check to determine that they have the latest edition of any IEEE Standard. Comments for revision of IEEE Standa

12、rds are welcome from any interested party, regardless of membership affiliation with IEEE. Suggestions for changes in documents should be in the form of a proposed change of text, together with appropriate supporting comments. Interpretations: Occasionally questions may arise regarding the meaning o

13、f portions of standards as they relate to specific applications. When the need for interpretations is brought to the attention of IEEE, the Institute will initiate action to prepare appropriate responses. Since IEEE Standards represent a consensus of all concerned interests, it is important to ensur

14、e that any interpretation has also received the concurrence of a balance of interests. For this reason IEEE and the members of its technical committees are not able to provide an instant response to interpretation requests except in those cases where the matter has previously received formal conside

15、ration. Comments on standards and requests for interpretations should be addressed to: Secretary, IEEE Standards Board 445 Hoes Lane P.O. Box 1331 Piscataway, NJ 08555-1331 USA ISBN 1-55937-125-0 IEEE Standards documents are adopted by the Institute of Electrical and Electronics Engineers without re

16、gard to whether their adoption may involve patents on articles, materials, or processes. Such adoption does not assume any liability to any patent owner, nor does it assume any obligation whatever to parties adopting the standards documents. Copyright The Institute of Electrical and Electronics Engi

17、neers, Inc. Provided by IHS under license with IEEELicensee=NASA Technical Standards 1/9972545001 Not for Resale, 04/21/2007 11:59:04 MDTNo reproduction or networking permitted without license from IHS -,-,- iii Foreword (This Foreword is not a part of IEEE Std 1178-1990, IEEE Standard for the Schem

18、e Programming Language.) Programming languages should be designed not by piling feature on top of feature, but by removing the weaknesses and restrictions that make additional features appear necessary. The Scheme programming language demonstrates that a very small number of rules for forming expres

19、sions, with few restrictions on how they are composed, suffi ce to form a practical and effi cient programming language that is fl exible enough to support most of the major programming paradigms in use today. Scheme places few restrictions on the use of procedural abstractions: procedures are full

20、fi rst-class objects. Although Scheme is a block-structured language, and it permits side effects, it differs from most imperative block-structured languages by encouraging a functional style of programming that uses procedures to encapsulate state. In a similar spirit, Scheme implementations impose

21、 no storage penalty for tail-recursive procedure calls, and continuations (which are present, although behind the scenes, in all programming languages) are fi rst-lass Scheme objects that act like procedures. This permits nearly all known sequential control structures to be expressed in terms of pro

22、cedure calls. Purpose of This Standard Throughout its thirty-year life, the Lisp family of languages has continually evolved to encompass changing ideas about programming-language design. Scheme has participated in the evolution of Lisp. Scheme was one of the fi rst programming languages to incorpor

23、ate fi rst-class procedures as in the lambda calculus, thereby proving the usefulness of static scope rules and block structure in a dynamically typed language. Scheme was the fi rst major dialect of Lisp to distinguish procedures from lambda expressions and symbols, to use a single lexical environm

24、ent for all variables, and to evaluate the operator position of a procedure call in the same way as an operand position. Scheme was the fi rst widely used programming language to rely entirely on procedure calls to express iteration and to embrace fi rst-class escape procedures. Specifying a standar

25、d for Scheme is intended to encourage the continued evolution of Lisp dialects by identifying a coherent set of constructs that is large enough to support the implementation of substantial programs, but also small enough to admit signifi cant extensions and alternate approaches to language design. F

26、or example, this standard does not mandate the inclusion in Scheme of large run-time libraries, particular user interfaces, or complex interactions with external operating systems, although practical Scheme implementations ordinarily provide such features. In particular, there are important linguist

27、ic design issues that are not discussed in this standard precisely because Scheme has sparked fruitful new approaches in these areas, and this working group does not wish to discourage the further development of good ideas by taking a position on issues under active investigation. Some of these issu

28、es are macros, packaging, and object-oriented programming. The working group hopes that future revisions of this standard will be sensitive to the fact that good ideas need time to mature, and that exploration can often be stifl ed by the premature adoption of standards. Background The fi rst descri

29、ption of Scheme was written in 1975 B20. 1 A revised report B17 appeared in 1978, which described the evolution of the language as its MIT implementation was upgraded to support an innovative compiler 4. Three distinct projects began in 1981 and 1982 to use variants of Scheme for courses at MIT, Yal

30、e, and Indiana University B14, B12, B6. An introductory computer science textbook using Scheme was published in 1984 B2. 1 See footnote 1, page 7. Copyright The Institute of Electrical and Electronics Engineers, Inc. Provided by IHS under license with IEEELicensee=NASA Technical Standards 1/99725450

31、01 Not for Resale, 04/21/2007 11:59:04 MDTNo reproduction or networking permitted without license from IHS -,-,- iii iv As Scheme became more widespread, local dialects began to diverge until students and researchers occasionally found it difficult to understand code written at other sites. Fifteen

32、representatives of the major implementations of Scheme therefore met in October 1984 to work toward a better and more widely accepted standard for Scheme. Their report B4 was published at MIT and Indiana University in the summer of 1985. Subsequent rounds of revision took place in the spring of 1986

33、 B15, and at a meeting that preceded the 1988 ACM Conference on Lisp and Functional Programming B5. The working group for this standard first met at that same conference; the standard draws heavily on the earlier reports. Readers interested in the evolution of the Scheme language are referred to the

34、 above documents, and in particular to the “Notes” following chapter 7 in B15 and B5. Members of the Scheme Working Group of the Microprocessor and Microcomputer Standards Subcommittee and those who participated by correspondence were as follows: Christopher T. Haynes, Chair David H. Bartley, Chris

35、Hanson, James S. Miller (Editors) Harold Abelson Norman Adams Cyril N. Alberga Joel F. Bartlett Scott Burson Clyde Camp Bill Campbell Jerome Chailloux Stewart Clamen William Clinger Pavel Curtis Jeffrey Dalton Olivier Danvy Klaus Dassler Kenneth Dickey Bruce Duba R. Kent Dybvig Marc Feeley Daniel P.

36、 Friedman Mark Friedman Richard P. Gabriel John Gateley Arthur Gleckler Patrick Greussay Jed Harris Robert Hieb Takayasu Ito Roger Kirchner Paul Kristoff Tim McNerney William Maddox Sidney Marshall Robert Mathis Richard Mlynarik Andy Norman Eric Ost John D. Ramsdell Jonathan Rees Guillermo J. Rozas

37、Benjamin Schreiber George Springer Guy L. Steele Jr. Gerald Jay Sussman Eric Tiedemann Queyen Tran R. L. Tritchard Mitchell Wand Jon L. White Taiichi Yuasa The following persons were on the balloting committee that approved this document for submission to the IEEE Standards Board: Harold Abelson Wil

38、liam B. Adams Mohammad Al-Malki Duane L. Anderson Joel F. Bartlett David H. Bartley Winsor A. Brown Lyle Burnett Todd Busniewski Carl Cagan Michael J. Caldwell George Carson Donald Chi David Cohen Paul D. Cook J. R. Davis Kenneth Alan Dickey Su Dongzhuang Kent R. Dybvig Jeff S. Ebert Neal M. Gafter

39、John Gateley Tayeb Giuma Willard Graves Gregory Guthrie Christopher T. Haynes Herbert Hecht Robert H. Hyerle John Jensen Richard Karcich Evan Kirshenbaum Peter M. Kogge Ezzat Korany Paul Kristoff Takahiko Kuki Tuvia Lamdan James S. Miller John E. Montague Keith Morgan Cuong Nguyen Peter Olsen James

40、R. Otto Don Oxley Chandresh J. Patel Crispin Perdue Robert Pettengill, Jr. John D. Ramsdell Hans Roosli Norman Schneidewind David Seraphin Michael Smolin Serge Szukalow Mitchell Wand Carl Warren W. L. Whipple Fritz Whittington Andrew Wilson Qiufeng Wu Oren Yuen Copyright The Institute of Electrical

41、and Electronics Engineers, Inc. Provided by IHS under license with IEEELicensee=NASA Technical Standards 1/9972545001 Not for Resale, 04/21/2007 11:59:04 MDTNo reproduction or networking permitted without license from IHS -,-,- v The final conditions for approval of this standard were met on Decembe

42、r 10, 1990. This standard was conditionally approved by the IEEE Standards Board on December 6, 1990, with the following membership: Marco W. Migliaro, Chair James M. Daly, Vice Chair Andrew G. Salem, Secretary Dennis Bodson Paul L. Borrill Fletcher J. Buckley Allen L. Clapp Stephen R. Dillon Donald

43、 C. Fleckenstein Jay Forster* Thomas L. Hannan Kenneth D. Hendrix John W. Horch Joseph L. Koepfinger* Irving Kolodny Michael A. Lawler Donald J. Loughry John E. May, Jr. Lawrence V. McCall L. Bruce McClung Donald T. Michael* Stig Nilsson Roy T. Oishi Gary S. Robinson Terrance R. Whittemore Donald W.

44、 Zipse *Member Emeritus Copyright The Institute of Electrical and Electronics Engineers, Inc. Provided by IHS under license with IEEELicensee=NASA Technical Standards 1/9972545001 Not for Resale, 04/21/2007 11:59:04 MDTNo reproduction or networking permitted without license from IHS -,-,- vi CLAUSEP

45、AGE Introduction.1 Objectives1 Scope.1 Future Directions.2 Compliance .2 Organization of the Document2 Definitions of Terms.2 Examples.3 Base Document.3 References.4 Description of the Language.4 1. Overview of Scheme.4 1.1 Semantics. 4 1.2 Syntax. 5 1.3 Notation and Terminology. 5 2. Lexical Conven

46、tions .7 2.1 Identifiers. 7 2.2 Whitespace and Comments 8 2.3 Other Notations 9 3. Basic Concepts9 3.1 Variables and Regions . 9 3.2 True and False 10 3.3 External Representations 10 3.4 Disjointness of Types. 10 3.5 Storage Model 11 4. Expressions .11 4.1 Primitive Expression Types. 12 4.2 Derived

47、Expression Types. 14 5. Program Structure.20 5.1 Programs 20 5.2 Definitions 20 6. Standard Procedures22 Copyright The Institute of Electrical and Electronics Engineers, Inc. Provided by IHS under license with IEEELicensee=NASA Technical Standards 1/9972545001 Not for Resale, 04/21/2007 11:59:04 MDT

48、No reproduction or networking permitted without license from IHS -,-,- vii CLAUSEPAGE 6.1 Booleans. 22 6.2 Equivalence Predicates 23 6.3 Pairs and Lists 26 6.4 Symbols 30 6.5 Numbers. 32 6.6 Characters. 42 6.7 Strings 43 6.8 Vectors. 45 6.9 Control Features. 46 6.10 Input and Output 49 7. Formal Syn

49、tax.51 7.1 Lexical Structure 51 7.2 External Representations 53 7.3 Expressions 53 7.4 Quasiquotations 54 7.5 Programs and Definitions. 55 7.6 Derived Expression Types. 55 7.6 Bibliography58 Annex A (informative) Formal Semantics60 Annex B (informative) Number System Subsets67 Annex C (informative) I

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 其他


经营许可证编号:宁ICP备18001539号-1