ISO/IEC 13816:2007
(Main)Information technology — Programming languages, their environments and system software interfaces — Programming language ISLISP
Information technology — Programming languages, their environments and system software interfaces — Programming language ISLISP
ISO/IEC 13816:2007 specifies syntax and semantics of the computer programming language ISLisp by specifying requirements for a conforming ISLisp processor and a conforming ISLisp text. The design goals for ISLisp are the following. ISLisp shall be compatible with existing Lisp dialects where feasible. ISLisp shall have as a primary goal to provide basic functionality. ISLisp shall be object-oriented. ISLisp shall be designed with extensibility in mind. ISLisp shall give priority to industrial needs over academic needs. ISLisp shall promote efficient implementations and applications. ISO/IEC 13816:2007 does not specify: the size or complexity of an ISLisp text that 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; the minimal requirements of a data processing system that is capable of supporting an implementation of a processor for ISLisp; the method of preparation of an ISLisp text for execution and the method of activation of this ISLisp text, prepared for execution; the typographical presentation of an ISLisp text published for human reading; extensions that might or might not be provided by the implementation.
Technologies de l'information — Langages de programmation, leurs environnements et interfaces de logiciel système — Langage de programmation ISLISP
General Information
Relations
Standards Content (Sample)
INTERNATIONAL ISO/IEC
STANDARD 13816
Second edition
2007-10-01
Information technology — Programming
languages, their environments and
system software interfaces —
Programming language ISLISP
Technologies de l'information — Langages de programmation, leurs
environnements et interfaces de logiciel système — Langage de
programmation ISLISP
Reference number
©
ISO/IEC 2007
PDF disclaimer
This PDF file may contain embedded typefaces. In accordance with Adobe's licensing policy, this file may be printed or viewed but
shall not be edited unless the typefaces which are embedded are licensed to and installed on the computer performing the editing. In
downloading this file, parties accept therein the responsibility of not infringing Adobe's licensing policy. The ISO Central Secretariat
accepts no liability in this area.
Adobe is a trademark of Adobe Systems Incorporated.
Details of the software products used to create this PDF file can be found in the General Info relative to the file; the PDF-creation
parameters were optimized for printing. Every care has been taken to ensure that the file is suitable for use by ISO member bodies. In
the unlikely event that a problem relating to it is found, please inform the Central Secretariat at the address given below.
© ISO/IEC 2007
All rights reserved. Unless otherwise specified, no part of this publication may be reproduced or utilized in any form or by any means,
electronic or mechanical, including photocopying and microfilm, without permission in writing from either ISO at the address below or
ISO's member body in the country of the requester.
ISO copyright office
Case postale 56 • CH-1211 Geneva 20
Tel. + 41 22 749 01 11
Fax + 41 22 749 09 47
E-mail copyright@iso.org
Web www.iso.org
Published in Switzerland
ii © ISO/IEC 2007 – All rights reserved
Contents
1Scope 1
2 Normative references 1
3 Compliance of ISLisp processors and text 2
4 Terms and definitions 2
5 Notation and conventions 7
6 Lexemes 9
6.1 Separators. . . . . . . . . . . . . . . . . . 10
6.2 Comments. . . . . . . . . . . . . . . . . . 10
7 Textual representation 10
8 Reserved identifiers 11
9 Errors 11
9.1 Classesoferrorspecification. . . . . . . . . . . . . . 12
9.2 Pervasiveerrortypes . . . . . . . . . . . . . . . 12
10 Classes 13
10.1 Metaclasses . . . . . . . . . . . . . . . . . . 13
10.2 Predefinedclasses. . . . . . . . . . . . . . . . . . . . . . 15
10.3 Standardclasses . . . . . . . . . . . . . . . . 16
10.3.1 Slots . . . . . . . . . . . . . . . . . . . . . . . 16
10.3.2 Creatinginstancesofclasses. . . . . . . . . . . . 16
11 Scope and extent 17
11.1 Thelexicalprinciple . . . . . . . . . . . . . . . 17
11.2 Scopeofidentifiers . . . . . . . . . . . . . . . . 17
11.3 Somespecificscoperules. . . . . . . . . . . . . . . 18
11.4 Extent. . . . . . . . . . . . . . . . . . . . . . . . . 18
12 Forms and evaluation 19
12.1 Forms . . . . . . . . . . . . . . . . . . . 19
12.2 Functionapplicationforms . . . . . . . . . . . . . . 20
12.3 Specialforms . . . . . . . . . . . . . . . . . 20
12.4 Definingforms . . . . . . . . . . . . . . . . . 21
12.5 Macroforms. . . . . . . . . . . . . . . . . . 21
12.6 Theevaluationmodel . . . . . . . . . . . . . . . 21
12.7 Functions . . . . . . . . . . . . . . . . . . . . . . . . 22
12.8 Definingoperators . . . . . . . . . . . . . . . . 26
13 Predicates 28
13.1 Booleanvalues . . . . . . . . . . . . . . . . . 28
13.2 Classpredicates. . . . . . . . . . . . . . . . . . . . . . 28
13.3 Equality. . . . . . . . . . . . . . . . . . 29
13.4 Logicalconnectives . . . . . . . . . . . . . . . . 31
14 Control structure 33
14.1 Constants . . . . . . . . . . . . . . . . . . 33
14.2 Variables . . . . . . . . . . . . . . . . . . 34
c
� ISO/IEC 2007 – All rights reserved iii
14.3 Dynamicvariables . . . . . . . . . . . . . . . . 37
14.4 Conditionalexpressions . . . . . . . . . . . . . . . 38
14.5 Sequencingforms . . . . . . . . . . . . . . . . 40
14.6 Iteration. . . . . . . . . . . . . . . . . . 41
14.7 Non-localexits . . . . . . . . . . . . . . . . . 42
14.7.1 Establishing and invoking non-local exits . . . . . . . . . . . . . . . . . . . 42
14.7.2 Assuring data consistency during non-local exits . . . . . . . . . . . . . . . 46
15 Objects 47
15.1 Definingclasses . . . . . . . . . . . . . . . . . 47
15.1.1 Determining the class precedence list . . . . . . . . . . . . . . . . . . . . . . 50
15.1.2 Accessingslots . . . . . . . . . . . . . . . 51
15.1.3 Inheritanceofslotsandslotoptions . . . . . . . . . . 51
15.2 Genericfunctions . . . . . . . . . . . . . . . . 52
15.2.1 Defininggenericfunctions . . . . . . . . . . . . 52
15.2.2 Definingmethodsforgenericfunctions . . . . . . . . . 54
15.2.2.1 Agreement on parameter specializersandqualifiers. . . . 55
15.2.2.2 Congruent lambda-lists for all methods of a generic function . . . 55
15.2.3 Inheritanceofmethods. . . . . . . . . . . . . 55
15.3 Calling generic functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
15.3.1 Selectingtheapplicablemethods . . . . . . . . . . . . . . 56
15.3.2 Sortingtheapplicablemethods . . . . . . . . . . . 56
15.3.3 Applyingmethods . . . . . . . . . . . . . . . . . . . 57
15.3.3.1 Simple method combination . . . . . . . . . . . . . . . . . . . . . 57
15.3.3.2 Standard method combination . . . . . . . . . . . . . . . . . . . . 57
15.3.4 Calling more general methods . . . . . . . . . . . . . . . . . . . . . . . . . . 59
15.4 Objectcreationandinitialization . . . . . . . . . . . . 60
15.4.1 Initialize-object. . . . . . . . . . . . . . . 60
15.5 Classenquiry . . . . . . . . . . . . . . . . . 61
16 Macros 61
17 Declarations and coercions 63
18 Symbol class 65
18.1 Symbolnames . . . . . . . . . . . . . . . . . 65
18.1.1 Notation for symbols . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
18.1.2 Alphabeticcaseinsymbolnames . . . . . . . . . . . 66
18.1.3 nil and () . . . . . . . . . . . . . . . . . . . . . 67
18.2 Symbolproperties . . . . . . . . . . . . . . . . 67
18.3 Unnamedsymbols . . . . . . . . . . . . . . . . 68
19 Number class 68
19.1 Numberclass . . . . . . . . . . . . . . . . . 69
19.2 Floatclass. . . . . . . . . . . . . . . . . . . . . . . . 77
19.3 Integerclass. . . . . . . . . . . . . . . . . . 80
20 Character class 83
21 List class 84
21.1 Cons . . . . . . . . . . . . . . . . . . . 84
21.2 Nullclass . . . . . . . . . . . . . . . . . . 87
21.3 Listoperations . . . . . . . . . . . . . . . . . 87
22 Arrays 91
c
iv � ISO/IEC 2007 – All rights reserved
22.1 Arrayclasses . . . . . . . . . . . . . . . . . 91
22.2 Generalarrays . . . . . . . . . . . . . . . . . 92
22.3 Arrayoperations . . . . . . . . . . . . . . . . 93
23 Vectors 95
24 String class 96
25 Sequence functions 99
26 Stream class 102
26.1 Streamstofiles . . . . . . . . . . . . . . . . . 103
26.2 Otherstreams. . . . . . . . . . . . . . . . . 105
27 Input and output 107
27.1 Argument conventions for input functions . . . . . . . . . . . . . . . . . . . . . . . 107
27.2 CharacterI/O . . . . . . . . . . . . . . . . . 107
27.3 BinaryI/O . . . . . . . . . . . . . . . . . . . . . . . 111
28 Files 112
29 Condition system 114
29.1 Conditions. . . . . . . . . . . . . . . . . . . . . . . . 115
29.2 Signalingandhandlingconditions. . . . . . . . . . . . 115
29.2.1 Operations relating to condition signaling . . . . . . . . . . . . . . . . . . . 116
29.2.2 Operations relating to condition handling . . . . . . . . . . . . . . . . . . . 117
29.3 Dataassociatedwithconditionclasses . . . . . . . . . . . 118
29.3.1 Arithmeticerrors. . . . . . . . . . . . . . . 118
29.3.2 Domainerrors . . . . . . . . . . . . . . . 118
29.3.3 Parseerrors . . . . . . . . . . . . . . . . 118
29.3.4 Simpleerrors . . . . . . . . . . . . . . . 119
29.3.5 Streamerrors . . . . . . . . . . . . . . . 119
29.3.6 Undefinedentityerrors . . . . . . . . . . . . . 119
29.4 Erroridentification . . . . . . . . . . . . . . . . 120
30 Miscellaneous 122
Index 123
c
� ISO/IEC 2007 – All rights reserved v
Foreword
ISO (the International Organization for Standardization) and IEC (the International
Electrotechnical Commission) form the specialized system for worldwide standardization.
National bodies that are members of ISO 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. ISO and IEC technical committees collaborate in fields of
mutual interest. Other international organizations, governmental and non-governmental, in
liaison with ISO and IEC, also take part in the work. In the field of information technology, ISO
and IEC have established a joint technical committee, ISO/IEC JTC 1.
International Standards are drafted in accordance with the rules given in the ISO/IEC
Directives, Part 2.
The main task of the joint technical committee is to prepare International Standards. Draft
International Standards adopted by the joint technical 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.
Attention is drawn to the possibility that some of the elements of this document may be the
subject of patent rights. ISO and IEC shall not be held responsible for identifying any or all such
patent rights.
ISO/IEC 13816 was prepared by Joint Technical Committee ISO/IEC JTC 1, Information
technology, Subcommittee SC 22, Programming languages, their environments and system
software interfaces.
This second edition cancels and replaces the first edition (ISO/IEC 13816:1997), which has been
technically revised.
c
vi � ISO/IEC 2007 – All rights reserved
Introduction
The programming language ISLISP is a member of the LISP family.
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-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.
3. ISLISP shall be object-oriented.
4. ISLISP shall be designed with extensibility in mind.
ISLISP shall give priority to industrial needs over academic needs.
5.
6. ISLISP shall promote efficient implementations and applications.
c
� ISO/IEC 2007 – All rights reserved vii
INTERNATIONAL STANDARD ISO/IEC 13816:2007(E)
Information technology — Programming languages, their
environments and system software interfaces —
Programming language ISLISP
1Scope
This International Standard specifies syntax and semantics of the computer programming
language ISLISP by specifying requirements for a conforming ISLISP processor and a conforming
ISLISP text.
This International Standard does not specify:
(a) the size or complexity of an ISLISP text that 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 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.
2 Normative references
The following referenced documents are indispensable for the application of this document. For
dated references, only the edition cited applies. For undated references, the latest edition of the
referenced document (including any amendments) applies.
• ISO/IEC TR 10034:1990, Guidelines for the preparation of conformity clauses in
programming language standards
• IEEE standard 754-1985. Standard for binary floating point arithmetic
c
� ISO/IEC 2007 – All rights reserved 1
3 Compliance of ISLisp processors and text
An ISLISP processor complying with the requirements of this International Standard shall:
(a) accept and implement all features of ISLIS P specified in this International Standard;
(b) reject any text that contains any textual usage which this International Standard explicitly
defines to be a violation (see §9);
(c) be accompanied by a document that provides the definitions of all implementation-defined
features;
(d) be accompanied by a document that separately describes any features accepted by the
processor that are not specified in this International Standard; these extensions shall be
described as being “extensions to ISLISP as specified by ISO/IEC 13816:2007(E).”
A com
...
Questions, Comments and Discussion
Ask us and Technical Secretary will try to provide an answer. You can facilitate discussion about the standard in here.