544 lines
No EOL
16 KiB
HTML
544 lines
No EOL
16 KiB
HTML
<!DOCTYPE HTML>
|
|
<HTML LANG="en-us"
|
|
><HEAD
|
|
><TITLE
|
|
>1.5 Conformance | Common Lisp Nova Spec</TITLE
|
|
><META CHARSET="US-ASCII"
|
|
><LINK REL="canonical" HREF="1_5_Conformance.html"
|
|
><LINK REL="next" HREF="1_6_Language_Extensions.html" TYPE="text/html" TITLE="1.6 Language Extensions"
|
|
><LINK REL="prev" HREF="1_4_Definitions.html" TYPE="text/html" TITLE="1.4 Definitions"
|
|
><LINK REL="up" HREF="1_Introduction.html" TYPE="text/html" TITLE="1. Introduction"
|
|
><LINK REL="start" HREF="index.html" TYPE="text/html" TITLE="Common Lisp Nova Spec"
|
|
><META NAME="VIEWPORT" CONTENT="width=device-width, initial-scale=1.0"
|
|
><LINK REL="STYLESHEET" HREF="dpans.css%3F3909942064.css"
|
|
><SCRIPT SRC="dpans.js%3F3909942064"
|
|
></SCRIPT
|
|
><SCRIPT SRC="apropos.js%3F3909942064"
|
|
></SCRIPT
|
|
></HEAD
|
|
><BODY
|
|
><DIV
|
|
><DIV CLASS="topnav"
|
|
><DIV CLASS="breadcrumb"
|
|
><SPAN CLASS="breadcrumb-item"
|
|
><A HREF="index.html"
|
|
>Common Lisp Nova Spec</A
|
|
></SPAN
|
|
> <SPAN CLASS="breadcrumb-item"
|
|
>→ <A HREF="1_Introduction.html"
|
|
>1. Introduction</A
|
|
></SPAN
|
|
> <SPAN CLASS="breadcrumb-item"
|
|
>→ <A HREF="1_5_Conformance.html"
|
|
>1.5 Conformance</A
|
|
></SPAN
|
|
></DIV
|
|
><DIV CLASS="apropos"
|
|
><DIV CLASS="apropos-io"
|
|
><A HREF="1_4_Definitions.html" CLASS="prev"
|
|
>←</A
|
|
><SPAN ID="apropos-label"
|
|
>Apropos </SPAN
|
|
><INPUT ID="apropos" AUTOFOCUS="AUTOFOCUS" PLACEHOLDER="Type here to search" ONINPUT="aproposInput(this);" ONKEYUP="aproposKeyup(event);" ONCHANGE="aproposChange(this);" ONFOCUS="aproposFocus(this);" ONFOCUSOUT="aproposFocusout(this);"
|
|
><A HREF="1_6_Language_Extensions.html" CLASS="next"
|
|
>→</A
|
|
></DIV
|
|
><DIV ID="apropos-res"
|
|
></DIV
|
|
></DIV
|
|
></DIV
|
|
><DIV CLASS="matter"
|
|
><SECTION
|
|
><H2 ID="sec_1_5" CLASS="HeadII"
|
|
>1.5 Conformance</H2
|
|
><UL CLASS="subtoc"
|
|
><LI
|
|
><A HREF="1_5_Conformance.html#sec_1_5_1"
|
|
>1.5.1 Conforming Implementations</A
|
|
></LI
|
|
><LI
|
|
><A HREF="1_5_Conformance.html#sec_1_5_1_1"
|
|
>1.5.1.1 Required Language Features</A
|
|
></LI
|
|
><LI
|
|
><A HREF="1_5_Conformance.html#sec_1_5_1_2"
|
|
>1.5.1.2 Documentation of Implementation-Dependent Features</A
|
|
></LI
|
|
><LI
|
|
><A HREF="1_5_Conformance.html#sec_1_5_1_3"
|
|
>1.5.1.3 Documentation of Extensions</A
|
|
></LI
|
|
><LI
|
|
><A HREF="1_5_Conformance.html#sec_1_5_1_4"
|
|
>1.5.1.4 Treatment of Exceptional Situations</A
|
|
></LI
|
|
><LI
|
|
><A HREF="1_5_Conformance.html#sec_1_5_1_4_1"
|
|
>1.5.1.4.1 Resolution of Apparent Conflicts in Exceptional Situations</A
|
|
></LI
|
|
><LI
|
|
><A HREF="1_5_Conformance.html#sec_1_5_1_4_1_1"
|
|
>1.5.1.4.1.1 Examples of Resolution of Apparent Conflicts in Exceptional Situations</A
|
|
></LI
|
|
><LI
|
|
><A HREF="1_5_Conformance.html#sec_1_5_1_5"
|
|
>1.5.1.5 Conformance Statement</A
|
|
></LI
|
|
><LI
|
|
><A HREF="1_5_Conformance.html#sec_1_5_2"
|
|
>1.5.2 Conforming Programs</A
|
|
></LI
|
|
><LI
|
|
><A HREF="1_5_Conformance.html#sec_1_5_2_1"
|
|
>1.5.2.1 Use of Implementation-Defined Language Features</A
|
|
></LI
|
|
><LI
|
|
><A HREF="1_5_Conformance.html#sec_1_5_2_1_1"
|
|
>1.5.2.1.1 Use of Read-Time Conditionals</A
|
|
></LI
|
|
><LI
|
|
><A HREF="1_5_Conformance.html#sec_1_5_2_2"
|
|
>1.5.2.2 Character Set for Portable Code</A
|
|
></LI
|
|
></UL
|
|
><P CLASS="j"
|
|
>This standard presents the syntax and semantics to be implemented by a <A HREF="26_1_Glossary.html#conforming_implementation"
|
|
><EM CLASS="term"
|
|
>conforming implementation</EM
|
|
></A
|
|
> (and its accompanying documentation). In addition, it imposes requirements on <A HREF="26_1_Glossary.html#conforming_program"
|
|
><EM CLASS="term"
|
|
>conforming programs</EM
|
|
></A
|
|
>.</P
|
|
><H3 ID="sec_1_5_1" CLASS="HeadIII"
|
|
>1.5.1 Conforming Implementations</H3
|
|
><P CLASS="j"
|
|
>A <DFN CLASS="newterm"
|
|
><SPAN CLASS="cmbxsl"
|
|
>conforming</SPAN
|
|
> <SPAN CLASS="cmbxsl"
|
|
>implementation</SPAN
|
|
></DFN
|
|
> <SPAN CLASS="idx" DATA-KIND="idxterm" DATA-TERM="conforming implementation"
|
|
></SPAN
|
|
>shall adhere to the requirements outlined in this section.</P
|
|
><H4 ID="sec_1_5_1_1" CLASS="HeadIV"
|
|
>1.5.1.1 Required Language Features</H4
|
|
><P CLASS="j"
|
|
>A <A HREF="26_1_Glossary.html#conforming_implementation"
|
|
><EM CLASS="term"
|
|
>conforming implementation</EM
|
|
></A
|
|
> shall accept all features (including deprecated features) of the language specified in this standard, with the meanings defined in this standard. </P
|
|
><P CLASS="j"
|
|
>A <A HREF="26_1_Glossary.html#conforming_implementation"
|
|
><EM CLASS="term"
|
|
>conforming implementation</EM
|
|
></A
|
|
> 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.</P
|
|
><H4 ID="sec_1_5_1_2" CLASS="HeadIV"
|
|
>1.5.1.2 Documentation of Implementation-Dependent Features</H4
|
|
><P CLASS="j"
|
|
>A <A HREF="26_1_Glossary.html#conforming_implementation"
|
|
><EM CLASS="term"
|
|
>conforming implementation</EM
|
|
></A
|
|
> shall be accompanied by a document that provides a definition of all <A HREF="26_1_Glossary.html#implementation-defined"
|
|
><EM CLASS="term"
|
|
>implementation-defined</EM
|
|
></A
|
|
> aspects of the language defined by this specification. </P
|
|
><P CLASS="j"
|
|
>In addition, a <A HREF="26_1_Glossary.html#conforming_implementation"
|
|
><EM CLASS="term"
|
|
>conforming implementation</EM
|
|
></A
|
|
> is encouraged (but not required) to document items in this standard that are identified as <A HREF="26_1_Glossary.html#implementation-dependent"
|
|
><EM CLASS="term"
|
|
>implementation-dependent</EM
|
|
></A
|
|
>, although in some cases such documentation might simply identify the item as “undefined.”</P
|
|
><H4 ID="sec_1_5_1_3" CLASS="HeadIV"
|
|
>1.5.1.3 Documentation of Extensions</H4
|
|
><P CLASS="j"
|
|
>A <A HREF="26_1_Glossary.html#conforming_implementation"
|
|
><EM CLASS="term"
|
|
>conforming implementation</EM
|
|
></A
|
|
> shall be accompanied by a document that separately describes any features accepted by the <A HREF="26_1_Glossary.html#implementation"
|
|
><EM CLASS="term"
|
|
>implementation</EM
|
|
></A
|
|
> 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 Common Lisp as specified by ANSI <SPAN CLASS="metavar"
|
|
><SPAN CLASS="cmsy"
|
|
>⟪</SPAN
|
|
><I
|
|
>standard</I
|
|
> <I
|
|
>number</I
|
|
><SPAN CLASS="cmsy"
|
|
>⟫</SPAN
|
|
></SPAN
|
|
>.”</P
|
|
><H4 ID="sec_1_5_1_4" CLASS="HeadIV"
|
|
>1.5.1.4 Treatment of Exceptional Situations</H4
|
|
><P CLASS="j"
|
|
>A <A HREF="26_1_Glossary.html#conforming_implementation"
|
|
><EM CLASS="term"
|
|
>conforming implementation</EM
|
|
></A
|
|
> shall treat exceptional situations in a manner consistent with this specification.</P
|
|
><H5 ID="sec_1_5_1_4_1" CLASS="HeadV"
|
|
>1.5.1.4.1 Resolution of Apparent Conflicts in Exceptional Situations</H5
|
|
><P CLASS="j"
|
|
>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.</P
|
|
><H6 ID="sec_1_5_1_4_1_1" CLASS="HeadVI"
|
|
>1.5.1.4.1.1 Examples of Resolution of Apparent Conflicts in Exceptional Situations</H6
|
|
><P CLASS="j"
|
|
>Suppose that function <CODE CLASS="f"
|
|
>foo</CODE
|
|
> is a member of a set <I
|
|
>S</I
|
|
> of <A HREF="26_1_Glossary.html#function"
|
|
><EM CLASS="term"
|
|
>functions</EM
|
|
></A
|
|
> that operate on numbers. Suppose that one passage states that an error must be signaled if any <A HREF="26_1_Glossary.html#function"
|
|
><EM CLASS="term"
|
|
>function</EM
|
|
></A
|
|
> in <I
|
|
>S</I
|
|
> is ever given an argument of <CODE CLASS="f"
|
|
>17</CODE
|
|
>. Suppose that an apparently conflicting passage states that the consequences are undefined if <CODE CLASS="f"
|
|
>foo</CODE
|
|
> receives an argument of <CODE CLASS="f"
|
|
>17</CODE
|
|
>. Then the second passage (the one specifically about <CODE CLASS="f"
|
|
>foo</CODE
|
|
>) would dominate because the description of the situational context is the most specific, and it would not be required that <CODE CLASS="f"
|
|
>foo</CODE
|
|
> signal an error on an argument of <CODE CLASS="f"
|
|
>17</CODE
|
|
> even though other functions in the set <I
|
|
>S</I
|
|
> would be required to do so.</P
|
|
><H4 ID="sec_1_5_1_5" CLASS="HeadIV"
|
|
>1.5.1.5 Conformance Statement</H4
|
|
><P CLASS="j"
|
|
>A <A HREF="26_1_Glossary.html#conforming_implementation"
|
|
><EM CLASS="term"
|
|
>conforming implementation</EM
|
|
></A
|
|
> 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</P
|
|
><DL
|
|
><DT
|
|
><SPAN CLASS="item"
|
|
></SPAN
|
|
></DT
|
|
><DD
|
|
><P CLASS="j"
|
|
>“<SPAN CLASS="metavar"
|
|
><SPAN CLASS="cmsy"
|
|
>⟪</SPAN
|
|
><I
|
|
>Implementation</I
|
|
><SPAN CLASS="cmsy"
|
|
>⟫</SPAN
|
|
></SPAN
|
|
> conforms with the requirements of ANSI <SPAN CLASS="metavar"
|
|
><SPAN CLASS="cmsy"
|
|
>⟪</SPAN
|
|
><I
|
|
>standard</I
|
|
> <I
|
|
>number</I
|
|
><SPAN CLASS="cmsy"
|
|
>⟫</SPAN
|
|
></SPAN
|
|
>”</P
|
|
></DD
|
|
></DL
|
|
><P CLASS="j"
|
|
>If the <A HREF="26_1_Glossary.html#implementation"
|
|
><EM CLASS="term"
|
|
>implementation</EM
|
|
></A
|
|
> conforms with some but not all of the requirements of this standard, then the conformance statement shall be</P
|
|
><DL
|
|
><DT
|
|
><SPAN CLASS="item"
|
|
></SPAN
|
|
></DT
|
|
><DD
|
|
><P CLASS="j"
|
|
>“<SPAN CLASS="metavar"
|
|
><SPAN CLASS="cmsy"
|
|
>⟪</SPAN
|
|
><I
|
|
>Implementation</I
|
|
><SPAN CLASS="cmsy"
|
|
>⟫</SPAN
|
|
></SPAN
|
|
> conforms with the requirements of ANSI <SPAN CLASS="metavar"
|
|
><SPAN CLASS="cmsy"
|
|
>⟪</SPAN
|
|
><I
|
|
>standard</I
|
|
> <I
|
|
>number</I
|
|
><SPAN CLASS="cmsy"
|
|
>⟫</SPAN
|
|
></SPAN
|
|
> with the following exceptions: <SPAN CLASS="metavar"
|
|
><SPAN CLASS="cmsy"
|
|
>⟪</SPAN
|
|
><I
|
|
>reference</I
|
|
> <I
|
|
>to</I
|
|
> <I
|
|
>or</I
|
|
> <I
|
|
>complete</I
|
|
> <I
|
|
>list</I
|
|
> <I
|
|
>of</I
|
|
> <I
|
|
>the</I
|
|
> <I
|
|
>requirements</I
|
|
> <I
|
|
>of</I
|
|
> <I
|
|
>the</I
|
|
> <I
|
|
>standard</I
|
|
> <I
|
|
>with</I
|
|
> <I
|
|
>which</I
|
|
> <I
|
|
>the</I
|
|
> <I
|
|
>implementation</I
|
|
> <I
|
|
>does</I
|
|
> <I
|
|
>not</I
|
|
> <I
|
|
>conform</I
|
|
><SPAN CLASS="cmsy"
|
|
>⟫</SPAN
|
|
></SPAN
|
|
>.”</P
|
|
></DD
|
|
></DL
|
|
><H3 ID="sec_1_5_2" CLASS="HeadIII"
|
|
>1.5.2 Conforming Programs</H3
|
|
><P CLASS="j"
|
|
><SPAN CLASS="idx" DATA-KIND="idxterm" DATA-TERM="conforming program"
|
|
></SPAN
|
|
><SPAN CLASS="idx" DATA-KIND="idxterm" DATA-TERM="conforming code"
|
|
></SPAN
|
|
>Code conforming with the requirements of this standard shall adhere to the following:</P
|
|
><OL
|
|
><LI
|
|
><P CLASS="j"
|
|
><A HREF="26_1_Glossary.html#conforming_code"
|
|
><EM CLASS="term"
|
|
>Conforming code</EM
|
|
></A
|
|
> 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.</P
|
|
></LI
|
|
><LI
|
|
><P CLASS="j"
|
|
><A HREF="26_1_Glossary.html#conforming_code"
|
|
><EM CLASS="term"
|
|
>Conforming code</EM
|
|
></A
|
|
> may use <A HREF="26_1_Glossary.html#implementation-dependent"
|
|
><EM CLASS="term"
|
|
>implementation-dependent</EM
|
|
></A
|
|
> 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 <A HREF="26_1_Glossary.html#code"
|
|
><EM CLASS="term"
|
|
>code</EM
|
|
></A
|
|
>.</P
|
|
></LI
|
|
><LI
|
|
><P CLASS="j"
|
|
><A HREF="26_1_Glossary.html#conforming_code"
|
|
><EM CLASS="term"
|
|
>Conforming code</EM
|
|
></A
|
|
> shall not depend on the consequences of undefined or unspecified situations.</P
|
|
></LI
|
|
><LI
|
|
><P CLASS="j"
|
|
><A HREF="26_1_Glossary.html#conforming_code"
|
|
><EM CLASS="term"
|
|
>Conforming code</EM
|
|
></A
|
|
> does not use any constructions that are prohibited by the standard.</P
|
|
></LI
|
|
><LI
|
|
><P CLASS="j"
|
|
><A HREF="26_1_Glossary.html#conforming_code"
|
|
><EM CLASS="term"
|
|
>Conforming code</EM
|
|
></A
|
|
> does not depend on extensions included in an implementation.</P
|
|
></LI
|
|
></OL
|
|
><H4 ID="sec_1_5_2_1" CLASS="HeadIV"
|
|
>1.5.2.1 Use of Implementation-Defined Language Features</H4
|
|
><P CLASS="j"
|
|
>Note that <A HREF="26_1_Glossary.html#conforming_code"
|
|
><EM CLASS="term"
|
|
>conforming code</EM
|
|
></A
|
|
> may rely on particular <A HREF="26_1_Glossary.html#implementation-defined"
|
|
><EM CLASS="term"
|
|
>implementation-defined</EM
|
|
></A
|
|
> values or features. Also note that the requirements for <A HREF="26_1_Glossary.html#conforming_code"
|
|
><EM CLASS="term"
|
|
>conforming code</EM
|
|
></A
|
|
> and <A HREF="26_1_Glossary.html#conforming_implementation"
|
|
><EM CLASS="term"
|
|
>conforming implementations</EM
|
|
></A
|
|
> do not require that the results produced by conforming code always be the same when processed by a <A HREF="26_1_Glossary.html#conforming_implementation"
|
|
><EM CLASS="term"
|
|
>conforming implementation</EM
|
|
></A
|
|
>. The results may be the same, or they may differ. </P
|
|
><P CLASS="j"
|
|
>Conforming code may run in all conforming implementations, but might have allowable <A HREF="26_1_Glossary.html#implementation-defined"
|
|
><EM CLASS="term"
|
|
>implementation-defined</EM
|
|
></A
|
|
> behavior that makes it non-portable code. For example, the following are examples of <A HREF="26_1_Glossary.html#form"
|
|
><EM CLASS="term"
|
|
>forms</EM
|
|
></A
|
|
> that are conforming, but that might return different <A HREF="26_1_Glossary.html#value"
|
|
><EM CLASS="term"
|
|
>values</EM
|
|
></A
|
|
> in different implementations:</P
|
|
><PRE CLASS="screen"
|
|
>(evenp most-positive-fixnum) <SPAN CLASS="cmsy"
|
|
><SPAN CLASS="arrow"
|
|
>→</SPAN
|
|
></SPAN
|
|
> <A HREF="26_1_Glossary.html#implementation-dependent"
|
|
><EM CLASS="term"
|
|
>implementation-dependent</EM
|
|
></A
|
|
>
|
|
(random) <SPAN CLASS="cmsy"
|
|
><SPAN CLASS="arrow"
|
|
>→</SPAN
|
|
></SPAN
|
|
> <A HREF="26_1_Glossary.html#implementation-dependent"
|
|
><EM CLASS="term"
|
|
>implementation-dependent</EM
|
|
></A
|
|
>
|
|
(> lambda-parameters-limit 93) <SPAN CLASS="cmsy"
|
|
><SPAN CLASS="arrow"
|
|
>→</SPAN
|
|
></SPAN
|
|
> <A HREF="26_1_Glossary.html#implementation-dependent"
|
|
><EM CLASS="term"
|
|
>implementation-dependent</EM
|
|
></A
|
|
>
|
|
(char-name #\A) <SPAN CLASS="cmsy"
|
|
><SPAN CLASS="arrow"
|
|
>→</SPAN
|
|
></SPAN
|
|
> <A HREF="26_1_Glossary.html#implementation-dependent"
|
|
><EM CLASS="term"
|
|
>implementation-dependent</EM
|
|
></A
|
|
></PRE
|
|
><H5 ID="sec_1_5_2_1_1" CLASS="HeadV"
|
|
>1.5.2.1.1 Use of Read-Time Conditionals</H5
|
|
><P CLASS="j"
|
|
>Use of <CODE CLASS="f"
|
|
>#+</CODE
|
|
> and <CODE CLASS="f"
|
|
>#-</CODE
|
|
> does not automatically disqualify a program from being conforming. A program which uses <CODE CLASS="f"
|
|
>#+</CODE
|
|
> and <CODE CLASS="f"
|
|
>#-</CODE
|
|
> is considered conforming if there is no set of <A HREF="26_1_Glossary.html#feature"
|
|
><EM CLASS="term"
|
|
>features</EM
|
|
></A
|
|
> in which the program would not be conforming. Of course, <A HREF="26_1_Glossary.html#conforming_program"
|
|
><EM CLASS="term"
|
|
>conforming programs</EM
|
|
></A
|
|
> are not necessarily working programs. The following program is conforming:</P
|
|
><PRE CLASS="screen"
|
|
>(defun foo ()
|
|
#+ACME (acme:initialize-something)
|
|
(print 'hello-there))</PRE
|
|
><P CLASS="j"
|
|
>However, this program might or might not work, depending on whether the presence of the feature <CODE CLASS="f"
|
|
>ACME</CODE
|
|
> really implies that a function named <CODE CLASS="f"
|
|
>acme:initialize-something</CODE
|
|
> is present in the environment. In effect, using <CODE CLASS="f"
|
|
>#+</CODE
|
|
> or <CODE CLASS="f"
|
|
>#-</CODE
|
|
> in a <A HREF="26_1_Glossary.html#conforming_program"
|
|
><EM CLASS="term"
|
|
>conforming program</EM
|
|
></A
|
|
> means that the variable <A HREF="v_features.html" CLASS="varref"
|
|
><B
|
|
>*features*</B
|
|
></A
|
|
> <SPAN CLASS="idx" DATA-KIND="idxref" DATA-TERM="*features*"
|
|
></SPAN
|
|
>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.</P
|
|
><H4 ID="sec_1_5_2_2" CLASS="HeadIV"
|
|
>1.5.2.2 Character Set for Portable Code</H4
|
|
><P CLASS="j"
|
|
><EM CLASS="term"
|
|
>Portable code</EM
|
|
> is written using only <A HREF="26_1_Glossary.html#standard_character"
|
|
><EM CLASS="term"
|
|
>standard characters</EM
|
|
></A
|
|
>.</P
|
|
></SECTION
|
|
></DIV
|
|
><DIV CLASS="footer"
|
|
><DIV CLASS="btmnav"
|
|
><A HREF="1_4_Definitions.html" CLASS="prev"
|
|
>←</A
|
|
><A HREF="1_6_Language_Extensions.html" CLASS="next"
|
|
>→</A
|
|
></DIV
|
|
><DIV CLASS="trail"
|
|
>Conversion to HTML copyright 2023 by Gilbert Baumann</DIV
|
|
></DIV
|
|
></DIV
|
|
><SCRIPT
|
|
>domReady();</SCRIPT
|
|
></BODY
|
|
></HTML
|
|
> |