File: Designators.html

package info (click to toggle)
gcl 2.6.14-21
  • links: PTS
  • area: main
  • in suites: forky, sid
  • size: 60,864 kB
  • sloc: ansic: 177,407; lisp: 151,509; asm: 128,169; sh: 22,510; cpp: 11,923; tcl: 3,181; perl: 2,930; makefile: 2,360; sed: 334; yacc: 226; lex: 95; awk: 30; fortran: 24; csh: 23
file content (108 lines) | stat: -rw-r--r-- 5,060 bytes parent folder | download | duplicates (4)
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
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- Created by GNU Texinfo 6.7, http://www.gnu.org/software/texinfo/ -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Designators (ANSI and GNU Common Lisp Document)</title>

<meta name="description" content="Designators (ANSI and GNU Common Lisp Document)">
<meta name="keywords" content="Designators (ANSI and GNU Common Lisp Document)">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<link href="index.html" rel="start" title="Top">
<link href="Notational-Conventions.html" rel="up" title="Notational Conventions">
<link href="Nonsense-Words.html" rel="next" title="Nonsense Words">
<link href="NIL.html" rel="prev" title="NIL">
<style type="text/css">
<!--
a.summary-letter {text-decoration: none}
blockquote.indentedblock {margin-right: 0em}
div.display {margin-left: 3.2em}
div.example {margin-left: 3.2em}
div.lisp {margin-left: 3.2em}
kbd {font-style: oblique}
pre.display {font-family: inherit}
pre.format {font-family: inherit}
pre.menu-comment {font-family: serif}
pre.menu-preformatted {font-family: serif}
span.nolinebreak {white-space: nowrap}
span.roman {font-family: initial; font-weight: normal}
span.sansserif {font-family: sans-serif; font-weight: normal}
ul.no-bullet {list-style: none}
-->
</style>


</head>

<body lang="en">
<span id="Designators"></span><div class="header">
<p>
Next: <a href="Nonsense-Words.html" accesskey="n" rel="next">Nonsense Words</a>, Previous: <a href="NIL.html" accesskey="p" rel="prev">NIL</a>, Up: <a href="Notational-Conventions.html" accesskey="u" rel="up">Notational Conventions</a> &nbsp; </p>
</div>
<hr>
<span id="Designators-1"></span><h4 class="subsubsection">1.4.1.12 Designators</h4>

<p>A <i>designator</i>
<span id="index-designator"></span>
 is an <i>object</i> that denotes another <i>object</i>.
</p>
<p>Where a <i>parameter</i> of an <i>operator</i> is described as a <i>designator</i>,
the description of the <i>operator</i> is written in a way that assumes that
the value of the <i>parameter</i> is the denoted <i>object</i>;
that is, that the <i>parameter</i> is already of the denoted <i>type</i>.
(The specific nature of the <i>object</i> denoted by
   a &ldquo;&lt;&lt;<i>type</i>&gt;&gt; <i>designator</i>&rdquo;
or a &ldquo;<i>designator</i> for a &lt;&lt;<i>type</i>&gt;&gt;&rdquo; 
can be found in the Glossary entry for &ldquo;&lt;&lt;<i>type</i>&gt;&gt; <i>designator</i>.&rdquo;)
</p>
<p>For example, &ldquo;<b>nil</b>&rdquo; and &ldquo;the <i>value</i> of <b>*standard-output*</b>&rdquo; are operationally
indistinguishable as <i>stream designators</i>.  Similarly, 
the <i>symbol</i> <tt>foo</tt> and the <i>string</i> <tt>&quot;FOO&quot;</tt> 
are operationally indistinguishable as <i>string designators</i>.  
</p>
<p>Except as otherwise noted, in a situation where the denoted <i>object</i> 
might be used multiple times, it is <i>implementation-dependent</i>
whether the <i>object</i> is coerced only once or whether the coercion occurs
each time the <i>object</i> must be used.
</p>
<p>For example, <b>mapcar</b> receives a <i>function designator</i> as an argument,
and its description is written as if this were simply a function.  In fact, it
is <i>implementation-dependent</i> whether the <i>function designator</i> is 
coerced right away or whether it is carried around internally in the form that
it was given as an <i>argument</i> and re-coerced each time it is needed.  In most
cases, <i>conforming programs</i> cannot detect the distinction, but there are some 
pathological situations (particularly those involving self-redefining or 
mutually-redefining functions) which do conform and which can detect this difference.
The following program is a <i>conforming program</i>, but might or might not have
portably correct results, depending on whether its correctness depends on one or
the other of the results:
</p>
<div class="example">
<pre class="example"> (defun add-some (x) 
   (defun add-some (x) (+ x 2))
   (+ x 1)) &rArr;  ADD-SOME
 (mapcar 'add-some '(1 2 3 4))
&rArr;  (2 3 4 5)
<i>OR</i>&rArr; (2 4 5 6)
</pre></div>

<p>In a few rare situations, there may be a need in a dictionary entry
to refer to the <i>object</i> that was the original <i>designator</i>
for a <i>parameter</i>.
Since naming the <i>parameter</i> would refer to the denoted <i>object</i>,
the phrase &ldquo;the &lt;&lt;<i>parameter-name</i>&gt;&gt; <i>designator</i>&rdquo; 
can be used to refer to the <i>designator</i> which was the <i>argument</i>
from which the <i>value</i> of &lt;&lt;<i>parameter-name</i>&gt;&gt; was computed.
</p>
<hr>
<div class="header">
<p>
Next: <a href="Nonsense-Words.html" accesskey="n" rel="next">Nonsense Words</a>, Previous: <a href="NIL.html" accesskey="p" rel="prev">NIL</a>, Up: <a href="Notational-Conventions.html" accesskey="u" rel="up">Notational Conventions</a> &nbsp; </p>
</div>



</body>
</html>