Debian Codegraph @

info/gcl/acons.html

raw
1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2 <html>
3 <!-- Created by GNU Texinfo 6.7, http://www.gnu.org/software/texinfo/ -->
4 <head>
5 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
6 <title>acons (ANSI and GNU Common Lisp Document)</title>
7
8 <meta name="description" content="acons (ANSI and GNU Common Lisp Document)">
9 <meta name="keywords" content="acons (ANSI and GNU Common Lisp Document)">
10 <meta name="resource-type" content="document">
11 <meta name="distribution" content="global">
12 <meta name="Generator" content="makeinfo">
13 <link href="index.html" rel="start" title="Top">
14 <link href="Conses-Dictionary.html" rel="up" title="Conses Dictionary">
15 <link href="assoc.html" rel="next" title="assoc">
16 <link href="mapc.html" rel="prev" title="mapc">
17 <style type="text/css">
18 <!--
19 a.summary-letter {text-decoration: none}
20 blockquote.indentedblock {margin-right: 0em}
21 div.display {margin-left: 3.2em}
22 div.example {margin-left: 3.2em}
23 div.lisp {margin-left: 3.2em}
24 kbd {font-style: oblique}
25 pre.display {font-family: inherit}
26 pre.format {font-family: inherit}
27 pre.menu-comment {font-family: serif}
28 pre.menu-preformatted {font-family: serif}
29 span.nolinebreak {white-space: nowrap}
30 span.roman {font-family: initial; font-weight: normal}
31 span.sansserif {font-family: sans-serif; font-weight: normal}
32 ul.no-bullet {list-style: none}
33 -->
34 </style>
35
36
37 </head>
38
39 <body lang="en">
40 <span id="acons"></span><div class="header">
41 <p>
42 Next: <a href="assoc.html" accesskey="n" rel="next">assoc</a>, Previous: <a href="mapc.html" accesskey="p" rel="prev">mapc</a>, Up: <a href="Conses-Dictionary.html" accesskey="u" rel="up">Conses Dictionary</a> &nbsp; </p>
43 </div>
44 <hr>
45 <span id="acons-_005bFunction_005d"></span><h4 class="subsection">14.2.35 acons [Function]</h4>
46
47 <p><code>acons</code> <i>key datum alist</i> &rArr; <i>new-alist</i>
48 </p>
49 <span id="Arguments-and-Values_003a_003a-304"></span><h4 class="subsubheading">Arguments and Values::</h4>
50
51 <p><i>key</i>&mdash;an <i>object</i>.
52 </p>
53 <p><i>datum</i>&mdash;an <i>object</i>.
54 </p>
55 <p><i>alist</i>&mdash;an <i>association list</i>.
56 </p>
57 <p><i>new-alist</i>&mdash;an <i>association list</i>.
58 </p>
59 <span id="Description_003a_003a-405"></span><h4 class="subsubheading">Description::</h4>
60
61 <p>Creates a <i>fresh</i> <i>cons</i>,
62 the <i>cdr</i> of which is <i>alist</i> and
63 the <i>car</i> of which is another <i>fresh</i> <i>cons</i>,
64 the <i>car</i> of which is <i>key</i> and
65 the <i>cdr</i> of which is <i>datum</i>.
66 </p>
67 <span id="Examples_003a_003a-288"></span><h4 class="subsubheading">Examples::</h4>
68
69 <div class="example">
70 <pre class="example"> (setq alist '()) &rArr; NIL
71 (acons 1 &quot;one&quot; alist) &rArr; ((1 . &quot;one&quot;))
72 alist &rArr; NIL
73 (setq alist (acons 1 &quot;one&quot; (acons 2 &quot;two&quot; alist))) &rArr; ((1 . &quot;one&quot;) (2 . &quot;two&quot;))
74 (assoc 1 alist) &rArr; (1 . &quot;one&quot;)
75 (setq alist (acons 1 &quot;uno&quot; alist)) &rArr; ((1 . &quot;uno&quot;) (1 . &quot;one&quot;) (2 . &quot;two&quot;))
76 (assoc 1 alist) &rArr; (1 . &quot;uno&quot;)
77 </pre></div>
78
79 <span id="See-Also_003a_003a-329"></span><h4 class="subsubheading">See Also::</h4>
80
81 <p><a href="assoc.html">assoc</a>
82 ,
83 <a href="pairlis.html">pairlis</a>
84 </p>
85 <span id="Notes_003a_003a-219"></span><h4 class="subsubheading">Notes::</h4>
86
87 <div class="example">
88 <pre class="example">(acons <i>key</i> <i>datum</i> <i>alist</i>) &equiv; (cons (cons <i>key</i> <i>datum</i>) <i>alist</i>)
89 </pre></div>
90
91
92
93
94 </body>
95 </html>