1、 STD-BSI BS ISO/IEC L381b-ENGL 1797 H Lb24bb9 Ob5b304 858 BRITISH STANDARD Information technology - Programming languages, their environments and system software interfaces - Programming language ISLISP ICs 36. 060 NO COPYING WITHOUT BSI PERMISSION EXCEPT AS PERMITTED BY COPYRIGHT LAW BS ISOREC 1381
2、6 : 1997 STDsBSI BS ISOIEC 1381b-ENGL 1977 m Lb24bb7 Ob5b305 774 m BS ISO/iEC 13816 : 1997 This itish Standard, having been prepared under the direction of the DISC Board,was published under the authority of the Standards Board and comes into effect on 15 November 1997 O BSI 1997 ISBN O 580 28772 6
3、National foreword This British Standard reproduces verbatim ISOAEC the UK national standard. 3816 997 and implements it as The UK participation in its preparation was entrusted to %chnical Committee IST/5, programming languages, their environments and system software interfaces, which has the respon
4、sibility to: - aid enquirers to understand the text; - present to the responsible internationallEuropean committee any enquiries on the interpretation, or proposals for change, and keep the UK interests informed; - monitor related international and European developments and promulgate them in the UK
5、 A list of organizations represented on this committee can be obtained on request to its secre-. From 1 January 1997, all IEC publications have the number 60000 added to the old number. For instance, IEC 27-1 has been renumbered as IEC 60027-1. For a period of time during the change over from one nu
6、mbering system to the other, publications may contain identifiers from both systems. Cross-references The British Standards which implement international or European publications referred to in this document may be found in the BSI Standards Catalogue under the section entitled International Standar
7、ds Correspondence Index, or by using the Find facility of the BSI Standards Electronic Catalogue. Compliance with a British Standard does not of itself confer immunity from legal obligations. Summary of pages This document comprises a front cover, an inside front cover, the ISOAEC title page, pages
8、ii to vi, pages 1 to 126, an inside back cover and a back cover. Amendments issued since publication I Te* affected Amd. No. Date STD.BS1 BS ISO/IEC L3Lb-ENGL L977 M lb24bb Ob5b30b b20 0 BS ISOAEC 13816 : 1997 INTERNATIONAL STANDARD ISOIIEC 1381 6 First edition 1997-05-01 Information technology - Pr
9、ogramming languages, their environments and system software interfaces - Programming language ISLISP Technologies de Iinfonna tion - langages de programmation, leurs environnements et interfaces systme - Langage de programmation ISLISP Reference number ISOIIEC 13816:1997(E) STD-BSI BS ISO/IEC L3Lb-E
10、NGL 1997 m LbZYbbS Ob5b307 5b7 m BS ISO/IEC 13816 : 1997 Contents 1 1.2 Normative References 1 1.3 Notation and Conventions 1 1.4 Lexemes 4 1.4.1 Separators . 5 1.4.2 Comments . 5 1.5 Textual Representation . 5 1.6 Reserved Identifiers 6 1.7 Definitions 6 1.8 Errors 9 1.8.1 Classes of error specific
11、ation . 9 1.8.2 Pervasive Error Types 9 1.9 Compliance of ISLISP Processors and Text 10 10 2.1 Metaclasses 11 2.2 Predefined Classes 13 2.3 Standard Classes 14 2.3.1 Slots 14 2.3.2 Creating Instances of Classes 14 14 3.1 The Lexical Principle 15 3.2 Scope ofIdentifiers 15 3.3 Some Specific Scope Rul
12、es 15 3.4 Extent 16 17 4.1 Forms 17 4.2 Function Application Forms 18 4.3 Special Forms 18 4.4 DefiningForms 19 4.5 MacroForms 19 4.6 The Evaluation Model 19 4.7 Functions 20 4.8 Defining Operators 24 1 Scope. Conventions and Compliance 1.1 Scope . 1 . . 2 Classes . 3 Scope and Extent . . 4 Forms an
13、d Evaluation . . . . . Descriptors: data processing. computer software. artificial languages. programming languages. LISP . II . = STD.BS1 BS ISO/IEC L3Lb-ENGL L997 u Lb24bb9 Ob5b308 4T3 W BS ISO/IEC 13816 : 1997 26 5.1 BooleanValues 26 5.2 Class Predicates . 26 5.3 Equality 26 5.4 Logical Connectiv
14、es . 29 5 Predicates 6 Control Structure 6.1 Constants . 6.2 Variables . 6.3 Dynamic Variables 6.4 Conditional Expressions . 6.5 Sequencing Forms 6.6 Iteration 6.7 Non-Local Exits . 6.7.1 Establishing and Invoking Non-Local Exits 6.7.2 Assuring Data Consistency during Non-Local Exits 30 30 31 35 36
15、38 39 40 40 44 45 7.1 DefiningClasses . 45 7.1.1 Determining the Class Precedence List . 48 7.1.2 Accessing Slots 48 7.1.3 Inheritance of Slots and Slot Options 49 7.2 Generic Functions 49 7.2.1 Defining Generic Functions . 50 7.2.2 Defining Methods for Generic Functions 51 7.2.2.1 Agreement on Para
16、meter Specializers and Qualifiers 53 7.2.2.2 53 7.2.3 Inheritance of Methods . 53 7.3 Calling Generic Functions 53 7.3.1 Selecting the Applicable Methods 54 7.3.2 Sorting the Applicable Methods . 54 7.3.3 Applying Methods 55 7.3.3.1 Simple Method Combination . 55 7.3.3.2 Standard Method Combination
17、55 7.3.4 Calling More General Methods . 56 7.4 Object Creation and Initialization . 57 7.4.1 Initialize-Object . 58 7.5 Class Enquiry . 59 7 Objects Congruent Lambda-Lists for all Methods of a Generic Function . . 60 8 Macros 61 9 Declarations and Coercions 63 10.1 SymbolNames 63 10.1.1 Notation for
18、 Symbols 64 10.1.2 Alphabetic Case in Symbol Names . 64 10.1.3 niand O 65 10.2 Symbol Properties 65 10.3 Unnamed Symbols 66 10 Symbol class 67 11.1 Number class . 67 11.2 Float class 76 11.3 Integer class 78 11 Number class . . 111 STD-BSI BS ISOIIEC L38Lb-ENGL 1997 lb24bb9 Ob5b309 33T BS ISO/IEC 13
19、816 : 1997 12 Character class 81 13 List class 83 13.1 Cons . 83 13.2 Null class . 85 13.3 List operations 86 14 Arrays 90 14.1 Array Classes . 90 14.2 General Arrays 91 14.3 Array Operations . 91 15 Vectors 94 16 String class 95 17 Sequence Functions 98 18 Stream class 101 18.1 Streams to Files . 1
20、02 18.2 Other Streams 104 19 Input and Output 105 19.1 Argument Conventions for Input Functions 105 19.2 Character 1/0 106 19.3 BinaryI/O 110 20 Files 111 21 Condition System 113 21.1 Conditions . 113 21.2 Signaling and Handling Conditions . 114 21.2.1 Operations relating to Condition Signaling 114
21、21.2.2 Operations relating to Condition Handling 115 21.3 Data associated with Condition Classes 116 21.3.1 Arithmetic Errors 116 21.3.2 Domain Errors 117 21.3.3 Parse Errors . 117 2 1.3.4 Simple Errors . 117 21.3.5 Stream Errors . 118 21.3.6 Undefined Entity Errors . 118 21.4 Error Identification 1
22、18 22 Miscellaneous 120 index 122 iV STD-BSI BS ISO/IEC 1381b-ENGL 1997 D 1b24bb9 Ob5b3LO 051 BS ISOAEC 13816 : 1997 Foreword IS0 (the International Organization for Standardization) and IEC (the International Electrotechnical Commission) form the specialized system for worldwide standardization. Na
23、tional bodies that are members of IS0 or IEC participate in the development of International Standards through technical committees established by the respective organization to deal with particular fields of technical activity. IS0 and IEC technical committees collaborate in fields of mutual intere
24、st. Other international organizations, governmental and non-governmental, in liaison with IS0 and IEC, also take part in the work. In the field of information technology, IS0 and IEC have established a joint technical committee, ISOiIEC JTC 1. Draft International Standards adopted by the joint techn
25、ical committee are circulated to national bodies for voting. Publication as an International Standard requires approval by at least 75 % of the national bodies casting a vote, International Standard ISOIIEC 13816 was prepared by Joint Technical Committee ISO/IEC JTC 1, Informafion technology, Subcom
26、mittee SC 22, Programming languages, their environments and system sofiware interfaces. V STD.BS1 BS ISO/IEC L3Lb-ENGL 1797 W Lb24bb9 Ob5b31L T8 BS ISO/IEC 13816 : 1997 Introduction The programming language ISLISP is a member of the LISP family. It is the result of standardization efforts by ISO/IEC
27、 JTC 1/SC 22/WG 16. The following factors influenced the establishment of design goals for ISLISP: 1. A desire of the international LISP community to standardize on those features of LISP upon which there is widespread agreement. 2. The existence of the incompatible dialects COMMON-LISP, EULISP, LE-
28、LISP, and SCHEME (mentioned in alphabetical order). 3. A desire to affirm LISP as an industrial language. This led to the following design goals for ISLISP: 1. ISLISP shall be compatible with existing LISP dialects where feasible. 2. ISLISP shall have as a primary goal to provide basic functionality
29、. 3. ISLISP shall be object-oriented. 4. ISLISP shall be designed with extensibility in mind. 5. ISLISP shall give priority to industrial needs over academic needs. 6. ISLISP shall promote efficient implementations and applications. ISO/IEC JTC 1/SC 22/WG 16 wishes to thank the many specialists who
30、contributed to this International Standard. vi * * rn STD-BSI BS ISO/IEC 138Lb-ENGL 1997 9 lb24bb7 17b5b3l2 724 9 BS ISOAEC 13816 : 1997 Information technology - Programming languages, their environments and system software interfaces - Programming language ISLISP 1.1 Scope 1. Positive Scope This In
31、ternational Standard specifies syntax and semantics of the computer programming language ISLISP by specifying requirements for a conforming ISLISP processor and a conforming ISLISP text. 2. Negative Scope This International Standard does not specify: (a) the size or complexity of an ISLISP text that
32、 exceeds the capacity of any specific data processing system or the capacity of a particular processor, nor the actions to be taken when the corresponding limits are exceeded; (b) the minimal requirements of a data processing system that is capable of supporting an implementation of a processor for
33、ISLISP; (c) the method of preparation of an ISLISP text for execution and the method of activation of this ISLISP text, prepared for execution; (d) the typographical presentation of an ISLISP text published for human reading. (e) extensions that might or might not be provided by the implementation.
34、1.2 Normative References The following standards contain provisions which, through reference in this text, constitute provisions of this International Standard. At the time of publication, the editions indicated were valid. All standards are subject to revision, and parties to agreements based on th
35、is International Standard are encouraged to investigate the possibility of applying the most recent editions of the standards indicated below. Members of IEC and IS0 maintain registers of currently valid International Standards. a ISO/IEC TR 10034: 1990, Guidelines for the preparation of conformity
36、clauses in programming language standards. IEEE standard 754-1985. IEEE standard for Binary floating point arithmetic. IEEE, New York, 1985. 1.3 Notation and Conventions For a clear definition of, and a distinction between, syntactic and semantic concepts, several levels of description abstraction a
37、re used in the following. 1 BS ISO/IEC 13816 : 1997 There is a correspondence from ISLISP textual units to their ISLISP data structure representations. Throughout this International Standard the text and the corresponding ISLISP objects (data structures) are addressed simultaneously. ISLISP text can
38、 be seen as an external specification of ISLISP data structures. To distinguish between the two representations different concepts are used. When textual representation is discussed, textual elements (such as identijers, literals, and compound forms) are used; when ISLISP objects are discussed, obje
39、cts (such as symbols and lists) are used. The constituents of ISLISP text are called forms. A form can be an identifier, a literal, or a compound form. A compound form can be a function application form, a macro form, a special form, or a defining form. An identifier is represented by a symbol. A co
40、mpound form is represented by a non-null list. A literal represents neither a symbol nor a list, and so is neither an identifier nor a compound form; for example, a number is a literal. An object is prepared for execution; this might include transformation or compilation, including macro expansion.
41、The method of preparation for execution and its result are not defined in this International Standard (with exception of the violations to be detected). After successful preparation for execution the result is ready for execution. The combination of preparation for execution and subsequent execution
42、 implements ISLISPS evaluation model. The term “evaluation” is used because ISLISP is an expression language-each form has a value which is used to compute the value of the containing form. The results obtained when an entity is prepared for execution are designated throughout this International Sta
43、ndard by the construction “prepared entity” ; e.g., “prepared form,” “prepared special form.” Example: A “cond special form” becomes a “prepared cond” by preparation for execution. In the examples, the metasymbol *” designates the result of an actual evaluation. For example: The metasymbol _i” ident
44、ifies the class that results from the evaluation of a form having a given pattern. For example: Given a form pattern (usually defined by its constant parts, the function name or special operator), - relates it to the class to which the result of the evaluation of all matching forms belong. Form patt
45、erns or forms which are equivalent are related by =. The following notational conventions for form patterns are used: (i -name argumeni*) -, result-class f kind In this notation, words written in italics are non-terminal (pattern variables). f-name is always terminal: Specific function names, specia
46、l operators, defining form names, or generic function names are always presented. 2 STD-BSI BS ISO/IEC L3Lb-ENGL 1797 m lb24bb7 Ob5b3LLi 7T7 II BS ISOLEC 13816 : 1997 An underlined term (like the name in a defining form) in this notation, indicates an expression that is not evaluated. If a form migh
47、t or might not be evaluated (like one of the then-form or else-form in an if), this is indicated explicitly in the text. Class names are uniformly denoted as follows: . For example, is the name of a class; this is usually spoken aloud as “list class.” Notes, appearing as Note: note-text, in this Int
48、ernational Standard have no effect on the language. They are for better understanding by the human reader. Regarding the pattern variables and the extensions of above, the following conventions are also adopted: term+ denotes one or more occurrences of term; tem* denotes zero or more occurrences of
49、term; term denotes at most one occurrence of term, commonly one says that term is optional; teml term2 . . . term1 I term2 I . . . denotes grouping of terms. denotes grouping of alternative terms. The following naming conventions are used to denote forms whose values obey the respective class restrictions: array, arrayl, . array, . . . cons, cons1, . . .cons, . . . list, lisil, . . . listj , . . . obj, objjl, . . . obj, . . . sequence, sequeneel, . . . sequence, . . . stream, streaml, . . . streamj, . . . siring, stringl, . . . stringj