forked from xach/dpans
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconcept-conformance.tex
275 lines (219 loc) · 11.4 KB
/
concept-conformance.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
%-*- Mode: TeX -*-
%%Compliance
This standard presents the syntax and semantics to be implemented by a
\term{conforming implementation} (and its accompanying documentation).
In addition, it imposes requirements on \term{conforming programs}.
\beginsubSection{Conforming Implementations}
A \newterm{conforming implementation} shall adhere to the requirements outlined
in this section.
\beginsubsubsection{Required Language Features}
\DefineSection{ReqLangFeatures}
A \term{conforming implementation} shall accept all features
(including deprecated features)
of the language specified in this standard,
with the meanings defined in this standard.
A \term{conforming implementation} shall not require the inclusion of substitute
or additional language elements in code in order to accomplish a feature of
the language that is specified in this standard.
\endsubsubsection%{Required Language Features}
\beginsubsubsection{Documentation of Implementation-Dependent Features}
A \term{conforming implementation} shall be accompanied by a document
that provides a definition of all \term{implementation-defined}
aspects of the language defined by this specification.
In addition, a \term{conforming implementation} is encouraged (but not required)
to document items in this standard that are identified as
\term{implementation-dependent}, although in some cases
such documentation might simply identify the item as ``undefined.''
\endsubsubsection%{Documentation of Implementation-Dependent Features}
\beginsubsubsection{Documentation of Extensions}
A \term{conforming implementation} shall be accompanied by a
document that separately describes any features accepted by the
\term{implementation} that are not specified in this standard, but that do not
cause any ambiguity or contradiction when added to the language
standard. Such extensions shall be described as being ``extensions to
\clisp\ as specified by ANSI \metavar{standard number}.''
\endsubsubsection%{Documentation of Extensions}
\beginsubsubsection{Treatment of Exceptional Situations}
A \term{conforming implementation} shall treat exceptional situations
in a manner consistent with this specification.
\beginsubsubsubsection{Resolution of Apparent Conflicts in Exceptional Situations}
If more than one passage in this specification appears to apply to the
same situation but in conflicting ways, the passage that appears
to describe the situation in the most specific way (not necessarily the
passage that provides the most constrained kind of error detection)
takes precedence.
\beginsubsubsubsubsection{Examples of Resolution of Apparent Conflicts
in Exceptional Situations}
Suppose that function \f{foo} is a member of a set $S$ of \term{functions} that
operate on numbers. Suppose that one passage states that an error must be
signaled if any \term{function} in $S$ is ever given an argument of \f{17}.
Suppose that an apparently conflicting passage states that the consequences
are undefined if \f{foo} receives an argument of \f{17}. Then the second passage
(the one specifically about \f{foo}) would dominate because the description of
the situational context is the most specific, and it would not be required that
\f{foo} signal an error on an argument of \f{17} even though other functions in
the set $S$ would be required to do so.
\endsubsubsubsubsection%{Examples of Resolution of Apparent Conflicts
% in Exceptional Situations}
\endsubsubsubsection%{Resolution of Apparent Conflicts in Exceptional Situations}
\endsubsubsection%{Treatment of Exceptional Situations}
\beginsubsubsection{Conformance Statement}
A \term{conforming implementation} shall produce a conformance statement
as a consequence of using the implementation, or that statement
shall be included in the accompanying documentation. If the implementation
conforms in all respects with this standard, the conformance statement
shall be
\beginlist
\item{} ``\metavar{Implementation} conforms with the requirements
of ANSI \metavar{standard number}''
\endlist
If the \term{implementation} conforms with some but not all of the requirements of this
standard, then the conformance statement shall be
\beginlist
\item{} ``\metavar{Implementation} conforms with the requirements of
ANSI \metavar{standard number} with the following exceptions:
\metavar{reference to or complete list of the requirements of
the standard with which the implementation does not conform}.''
\endlist
\endsubsubsection%{Conformance Statement}
\endsubSection%{Conforming Implementations}
\beginsubSection{Conforming Programs}
\idxterm{conforming program}\idxterm{conforming code}
Code conforming with the requirements of this standard shall adhere to the
following:
\beginlist
\itemitem{1.} \term{Conforming code} shall use only those features of the
language syntax and semantics that are
either specified in this standard
or defined using the extension mechanisms
specified in the standard.
%% This biz about syntactic extension seems overly specific for this context. -kmp 23-Oct-91
% (\eg \term{symbol macros},
% \term{macros},
% %%Compiler macros do not extend syntax.
% %%They only provide an alternate implementation of existing syntax. -kmp 11-Mar-91
% %\term{compiler macros},
% and \term{reader macros}).
%% Rewritten per X3J13 and Boyer/Kaufmann/Moore #2 (second public review).
%% -kmp 9-May-94
% \itemitem{2.} \term{Conforming code} shall not rely on any particular
% interpretation of \term{implementation-dependent} features.
\itemitem{2.} \term{Conforming code} may use
\term{implementation-dependent} features and values,
but shall not rely upon
any particular interpretation of these features and values
other than those that are discovered by the execution of \term{code}.
\itemitem{3.} \term{Conforming code} shall not depend on the consequences
of undefined or unspecified situations.
\itemitem{4.} \term{Conforming code} does not use any constructions
that are prohibited by the standard.
\itemitem{5.} \term{Conforming code} does not depend on extensions
included in an implementation.
\endlist
% This material is all covered in more detail in chapter 3 (in the section
% on constraints on externalizable objects). There is no need to repeat
% the material here. --sjl 13 Mar 92
%\beginsubsubsection{Conforming Programs in Files}
%
%A \term{conforming program} whose source text is in a \term{compilation unit}
%must satisfy the following constraints:
%
%\beginlist
%
%\item{\bull}
% Any \term{top level form} in a \term{file} that alters
% \thevalueof{*package*} at compile time must also alter it at load time
% to a \term{similar} \term{package}.
%
%\item{\bull}
% If the first \term{non-atomic} \term{top level form} in the \term{file}
% is not a call to \macref{in-package}, then the \term{current package}
% at load time must be a \term{similar} \term{package} to the one in effect at
% compile time.
%
%\item{\bull}
% Any \term{symbol} in the source text \term{accessible} in the
% \term{current package} at compile time and whose \term{home package}
% is the package $P$ must be \term{accessible} in the \term{current package}
% at load time and must also be \term{accessible} in a package \term{similar} to $P$.
%
%\item{\bull}
% Any \term{symbol} in the source text that is an \term{external symbol}
% of the package $P$ at compile time must be an \term{external symbol}
% of package \term{similar} to $P$ at load time.
%
%\endlist
%
%In \term{situations} in which any of these conditions does not hold,
%an \term{implementation} might signal an error
%or might extend \clisp\ to handle the situation.
%
%\endsubsubsection%{Conforming Programs in Files}
\beginsubsubsection{Use of Implementation-Defined Language Features}
Note that \term{conforming code} may rely on particular
\term{implementation-defined} values or features. Also note that the
requirements for \term{conforming code} and \term{conforming implementations} do not
require that the results produced by conforming code always be the
same when processed by a \term{conforming implementation}. The results may be the
same, or they may differ.
%% Moved to its own section (see below) per Dalton #1 (1st Public Review)
%% by X3J13 vote May 4-5, 1994 (after 2nd public review).
%% -kmp 9-May-94
% %!!! Barmar wonders if this is really the right place for the next sentence.
% \term{Portable code} is written using only \term{standard characters}.
%Informally, the basic rules for conformance are as follows:
%1. Conforming code is defined in terms of its structure,
%and not in terms of its results and side effects.
%2. Conforming code is written using only the syntax specified in the standard,
%or syntax defined using the syntax extension mechanisms (macros and reader
%macros) specified in the standard.
%3. Conforming code is written in only the sequence specified in the standard.
%4. Conforming code is written using only the functions, macros,
%special forms, variables, and constants specified in the standard.
%5. Conforming implementations provide the functionality and behavior
%specified in the standard.
%The definitions of all names and syntax that aren't specified in the
%standard and aren't provided by the implementation must accompany the code.
%6. Conformance is not machine-checkable.
Conforming code may run in all conforming implementations, but might
have allowable \term{implementation-defined} behavior that makes it
non-portable code.
%Insofar as we allow options in the standard this will be true.
For example, the following are examples of \term{forms} that are conforming, but
that might return different \term{values} in different implementations:
\code
(evenp most-positive-fixnum) \EV \term{implementation-dependent}
(random) \EV \term{implementation-dependent}
(> lambda-parameters-limit 93) \EV \term{implementation-dependent}
(char-name #\\A) \EV \term{implementation-dependent}
\endcode
\beginsubsubsubsection{Use of Read-Time Conditionals}
\DefineSection{ReadTimeConditionals}
%The following is added to clarify a question from RWK.
%Mail sent to him and Quinquevirate noting that this interpretation was made.
% -kmp 10-Apr-91
Use of \f{\#+} and \f{\#-} does not automatically disqualify a program
from being conforming. A program which uses \f{\#+} and \f{\#-} is
considered conforming if there is no set of \term{features} in which the
program would not be conforming. Of course, \term{conforming programs} are
not necessarily working programs. The following program is conforming:
\code
(defun foo ()
\#+ACME (acme:initialize-something)
(print 'hello-there))
\endcode
However, this program might or might not work, depending on whether the
presence of the feature \f{ACME} really implies that a function named
\f{acme:initialize-something} is present in the environment. In effect,
using \f{\#+} or \f{\#-} in a \term{conforming program} means that the variable
\varref{*features*}\idxref{*features*}
becomes just one more piece of input data to that
program. Like any other data coming into a program, the programmer
is responsible for assuring that the program does not make unwarranted
assumptions on the basis of input data.
\endsubsubsubsection%{Use of Read-Time Conditionals}
\endsubsubsection%{Use of Implementation-Defined Language Features}
\beginsubsubsection{Character Set for Portable Code}
\term{Portable code} is written using only \term{standard characters}.
\endsubsubsection%{Character Set for Portable Code}
\endsubSection%{Conforming Programs}