blob: 1f772601029e228cd406d99430828a5970af7f0d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
<h3 class="section">Generalized Variables</h3> <p>A <em>generalized variable</em> or <em>place form</em> is one of the many places in Lisp memory where values can be stored using the <code>setf</code> macro (see <a href="setting-generalized-variables">Setting Generalized Variables</a>). The simplest place form is a regular Lisp variable. But the <small>CAR</small>s and <small>CDR</small>s of lists, elements of arrays, properties of symbols, and many other locations are also places where Lisp values get stored. </p> <p>Generalized variables are analogous to lvalues in the C language, where ‘<samp>x = a[i]</samp>’ gets an element from an array and ‘<samp>a[i] = x</samp>’ stores an element using the same notation. Just as certain forms like <code>a[i]</code> can be lvalues in C, there is a set of forms that can be generalized variables in Lisp. </p> <table class="menu" border="0" cellspacing="0"> <tr>
<td align="left" valign="top">• <a href="setting-generalized-variables" accesskey="1">Setting Generalized Variables</a>
</td>
<td> </td>
<td align="left" valign="top">The <code>setf</code> macro. </td>
</tr> <tr>
<td align="left" valign="top">• <a href="adding-generalized-variables" accesskey="2">Adding Generalized Variables</a>
</td>
<td> </td>
<td align="left" valign="top">Defining new <code>setf</code> forms. </td>
</tr> </table><div class="_attribution">
<p class="_attribution-p">
Copyright © 1990-1996, 1998-2022 Free Software Foundation, Inc. <br>Licensed under the GNU GPL license.<br>
<a href="https://www.gnu.org/software/emacs/manual/html_node/elisp/Generalized-Variables.html" class="_attribution-link">https://www.gnu.org/software/emacs/manual/html_node/elisp/Generalized-Variables.html</a>
</p>
</div>
|