57 lines
17 KiB
HTML
57 lines
17 KiB
HTML
<!-- Common Lisp HyperSpec (TM), version 7.0 generated by Kent M. Pitman on Mon, 11-Apr-2005 2:31am EDT -->
|
|
<HTML>
|
|
<HEAD>
|
|
<TITLE>CLHS: System Class SYMBOL</TITLE>
|
|
<LINK HREF="../Data/clhs.css" REL="stylesheet" TYPE="text/css" />
|
|
<META HTTP-EQUIV="Author" CONTENT="Kent M. Pitman">
|
|
<META HTTP-EQUIV="Organization" CONTENT="LispWorks Ltd.">
|
|
<LINK REL=TOP HREF="../Front/index.htm">
|
|
<LINK REL=COPYRIGHT HREF="../Front/Help.htm#Legal">
|
|
<LINK REL=DISCLAIMER HREF="../Front/Help.htm#Disclaimer">
|
|
<LINK REL=PREV HREF="c_symbol.htm">
|
|
<LINK REL=UP HREF="c_symbol.htm">
|
|
<LINK REL=NEXT HREF="t_kwd.htm">
|
|
</HEAD>
|
|
<BODY>
|
|
<H1><A REV=MADE HREF="http://www.lispworks.com/"><IMG WIDTH=80 HEIGHT=65 ALT="[LISPWORKS]" SRC="../Graphics/LWSmall.gif" ALIGN=Bottom></A><A REL=TOP HREF="../Front/index.htm"><IMG WIDTH=237 HEIGHT=65 ALT="[Common Lisp HyperSpec (TM)]" SRC="../Graphics/CLHS_Sm.gif" ALIGN=Bottom></A> <A REL=PREV HREF="c_symbol.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Previous]" SRC="../Graphics/Prev.gif" ALIGN=Bottom></A><A REL=UP HREF="c_symbol.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Up]" SRC="../Graphics/Up.gif" ALIGN=Bottom></A><A REL=NEXT HREF="t_kwd.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Next]" SRC="../Graphics/Next.gif" ALIGN=Bottom></A></H1>
|
|
|
|
<HR>
|
|
|
|
<A NAME="symbol"><I>System Class</I> <B>SYMBOL</B></A> <P>
|
|
<P><B>Class Precedence List:</B><P>
|
|
<A REL=DEFINITION HREF="#symbol"><B>symbol</B></A>, <A REL=DEFINITION HREF="t_t.htm#t"><B>t</B></A> <P>
|
|
<P><B>Description:</B><P>
|
|
<P>
|
|
<A REL=DEFINITION HREF="26_glo_s.htm#symbol"><I>Symbols</I></A> are used for their <A REL=DEFINITION HREF="26_glo_o.htm#object"><I>object</I></A> identity to name various entities in Common Lisp, including (but not limited to) linguistic entities such as <A REL=DEFINITION HREF="26_glo_v.htm#variable"><I>variables</I></A> and <A REL=DEFINITION HREF="26_glo_f.htm#function"><I>functions</I></A>. <P>
|
|
<A REL=DEFINITION HREF="26_glo_s.htm#symbol"><I>Symbols</I></A> can be collected together into <A REL=DEFINITION HREF="26_glo_p.htm#package"><I>packages</I></A>. A <A REL=DEFINITION HREF="26_glo_s.htm#symbol"><I>symbol</I></A> is said to be <A REL=DEFINITION HREF="26_glo_i.htm#interned"><I>interned</I></A> in a <A REL=DEFINITION HREF="26_glo_p.htm#package"><I>package</I></A> if it is <A REL=DEFINITION HREF="26_glo_a.htm#accessible"><I>accessible</I></A> in that <A REL=DEFINITION HREF="26_glo_p.htm#package"><I>package</I></A>; the same <A REL=DEFINITION HREF="26_glo_s.htm#symbol"><I>symbol</I></A> can be <A REL=DEFINITION HREF="26_glo_i.htm#interned"><I>interned</I></A> in more than one <A REL=DEFINITION HREF="26_glo_p.htm#package"><I>package</I></A>. If a <A REL=DEFINITION HREF="26_glo_s.htm#symbol"><I>symbol</I></A> is not <A REL=DEFINITION HREF="26_glo_i.htm#interned"><I>interned</I></A> in any <A REL=DEFINITION HREF="26_glo_p.htm#package"><I>package</I></A>, it is called <A REL=DEFINITION HREF="26_glo_u.htm#uninterned"><I>uninterned</I></A>. <P>
|
|
An <A REL=DEFINITION HREF="26_glo_i.htm#interned"><I>interned</I></A> <A REL=DEFINITION HREF="26_glo_s.htm#symbol"><I>symbol</I></A> is uniquely identifiable by its <A REL=DEFINITION HREF="26_glo_n.htm#name"><I>name</I></A> from any <A REL=DEFINITION HREF="26_glo_p.htm#package"><I>package</I></A> in which it is <A REL=DEFINITION HREF="26_glo_a.htm#accessible"><I>accessible</I></A>. <P>
|
|
<A REL=DEFINITION HREF="26_glo_s.htm#symbol"><I>Symbols</I></A> have the following attributes. For historical reasons, these are sometimes referred to as <A REL=DEFINITION HREF="26_glo_c.htm#cell"><I>cells</I></A>, although the actual internal representation of <A REL=DEFINITION HREF="26_glo_s.htm#symbol"><I>symbols</I></A> and their attributes is <A REL=DEFINITION HREF="26_glo_i.htm#implementation-dependent"><I>implementation-dependent</I></A>. <P>
|
|
<P><DL><P>
|
|
<DT><B>Name</B> <P><DD>
|
|
The <A REL=DEFINITION HREF="26_glo_n.htm#name"><I>name</I></A> of a <A REL=DEFINITION HREF="26_glo_s.htm#symbol"><I>symbol</I></A> is a <A REL=DEFINITION HREF="26_glo_s.htm#string"><I>string</I></A> used to identify the <A REL=DEFINITION HREF="26_glo_s.htm#symbol"><I>symbol</I></A>. Every <A REL=DEFINITION HREF="26_glo_s.htm#symbol"><I>symbol</I></A> has a <A REL=DEFINITION HREF="26_glo_n.htm#name"><I>name</I></A>, and the consequences are undefined if that <A REL=DEFINITION HREF="26_glo_n.htm#name"><I>name</I></A> is altered. The <A REL=DEFINITION HREF="26_glo_n.htm#name"><I>name</I></A> is used as part of the external, printed representation of the <A REL=DEFINITION HREF="26_glo_s.htm#symbol"><I>symbol</I></A>; see <A REL=CHILD HREF="02_a.htm">Section 2.1 (Character Syntax)</A>. The <A REL=DEFINITION HREF="26_glo_f.htm#function"><I>function</I></A> <A REL=DEFINITION HREF="f_symb_2.htm#symbol-name"><B>symbol-name</B></A> returns the <A REL=DEFINITION HREF="26_glo_n.htm#name"><I>name</I></A> of a given <A REL=DEFINITION HREF="26_glo_s.htm#symbol"><I>symbol</I></A>. A <A REL=DEFINITION HREF="26_glo_s.htm#symbol"><I>symbol</I></A> may have any <A REL=DEFINITION HREF="26_glo_c.htm#character"><I>character</I></A> in its <A REL=DEFINITION HREF="26_glo_n.htm#name"><I>name</I></A>. <P>
|
|
<DT><B>Package</B> <P><DD>
|
|
The <A REL=DEFINITION HREF="26_glo_o.htm#object"><I>object</I></A> in this <A REL=DEFINITION HREF="26_glo_c.htm#cell"><I>cell</I></A> is called the <A REL=DEFINITION HREF="26_glo_h.htm#home_package"><I>home package</I></A> of the <A REL=DEFINITION HREF="26_glo_s.htm#symbol"><I>symbol</I></A>. If the <A REL=DEFINITION HREF="26_glo_h.htm#home_package"><I>home package</I></A> is <A REL=DEFINITION HREF="a_nil.htm#nil"><B>nil</B></A>, the <A REL=DEFINITION HREF="26_glo_s.htm#symbol"><I>symbol</I></A> is sometimes said to have no <A REL=DEFINITION HREF="26_glo_h.htm#home_package"><I>home package</I></A>. <P>
|
|
When a <A REL=DEFINITION HREF="26_glo_s.htm#symbol"><I>symbol</I></A> is first created, it has no <A REL=DEFINITION HREF="26_glo_h.htm#home_package"><I>home package</I></A>. When it is first <A REL=DEFINITION HREF="26_glo_i.htm#interned"><I>interned</I></A>, the <A REL=DEFINITION HREF="26_glo_p.htm#package"><I>package</I></A> in which it is initially <A REL=DEFINITION HREF="26_glo_i.htm#interned"><I>interned</I></A> becomes its <A REL=DEFINITION HREF="26_glo_h.htm#home_package"><I>home package</I></A>. The <A REL=DEFINITION HREF="26_glo_h.htm#home_package"><I>home package</I></A> of a <A REL=DEFINITION HREF="26_glo_s.htm#symbol"><I>symbol</I></A> can be <I>accessed</I> by using the <A REL=DEFINITION HREF="26_glo_f.htm#function"><I>function</I></A> <A REL=DEFINITION HREF="f_symb_3.htm#symbol-package"><B>symbol-package</B></A>. <P>
|
|
If a <A REL=DEFINITION HREF="26_glo_s.htm#symbol"><I>symbol</I></A> is <A REL=DEFINITION HREF="26_glo_u.htm#uninterned"><I>uninterned</I></A> from the <A REL=DEFINITION HREF="26_glo_p.htm#package"><I>package</I></A> which is its <A REL=DEFINITION HREF="26_glo_h.htm#home_package"><I>home package</I></A>, its <A REL=DEFINITION HREF="26_glo_h.htm#home_package"><I>home package</I></A> is set to <A REL=DEFINITION HREF="a_nil.htm#nil"><B>nil</B></A>. Depending on whether there is another <A REL=DEFINITION HREF="26_glo_p.htm#package"><I>package</I></A> in which the <A REL=DEFINITION HREF="26_glo_s.htm#symbol"><I>symbol</I></A> is <A REL=DEFINITION HREF="26_glo_i.htm#interned"><I>interned</I></A>, the symbol might or might not really be an <A REL=DEFINITION HREF="26_glo_u.htm#uninterned"><I>uninterned</I></A> <A REL=DEFINITION HREF="26_glo_s.htm#symbol"><I>symbol</I></A>. A <A REL=DEFINITION HREF="26_glo_s.htm#symbol"><I>symbol</I></A> with no <A REL=DEFINITION HREF="26_glo_h.htm#home_package"><I>home package</I></A> is therefore called <A REL=DEFINITION HREF="26_glo_a.htm#apparently_uninterned"><I>apparently uninterned</I></A>. <P>
|
|
The consequences are undefined if an attempt is made to alter the <A REL=DEFINITION HREF="26_glo_h.htm#home_package"><I>home package</I></A> of a <A REL=DEFINITION HREF="26_glo_s.htm#symbol"><I>symbol</I></A> external in the <TT>COMMON-LISP</TT> package or the <TT>KEYWORD</TT> package. <P>
|
|
<DT><B>Property list</B> <P><DD>
|
|
The <A REL=DEFINITION HREF="26_glo_p.htm#property_list"><I>property list</I></A> of a <A REL=DEFINITION HREF="26_glo_s.htm#symbol"><I>symbol</I></A> provides a mechanism for associating named attributes with that <A REL=DEFINITION HREF="26_glo_s.htm#symbol"><I>symbol</I></A>. The operations for adding and removing entries are <A REL=DEFINITION HREF="26_glo_d.htm#destructive"><I>destructive</I></A> to the <A REL=DEFINITION HREF="26_glo_p.htm#property_list"><I>property list</I></A>. Common Lisp provides <A REL=DEFINITION HREF="26_glo_o.htm#operator"><I>operators</I></A> both for direct manipulation of <A REL=DEFINITION HREF="26_glo_p.htm#property_list"><I>property list</I></A> <A REL=DEFINITION HREF="26_glo_o.htm#object"><I>objects</I></A> (e.g., see <A REL=DEFINITION HREF="f_getf.htm#getf"><B>getf</B></A>, <A REL=DEFINITION HREF="m_remf.htm#remf"><B>remf</B></A>, and <A REL=DEFINITION HREF="f_symb_4.htm#symbol-plist"><B>symbol-plist</B></A>) and for implicit manipulation of a <A REL=DEFINITION HREF="26_glo_s.htm#symbol"><I>symbol</I></A>'s <A REL=DEFINITION HREF="26_glo_p.htm#property_list"><I>property list</I></A> by reference to the <A REL=DEFINITION HREF="26_glo_s.htm#symbol"><I>symbol</I></A> (e.g., see <A REL=DEFINITION HREF="f_get.htm#get"><B>get</B></A> and <A REL=DEFINITION HREF="f_rempro.htm#remprop"><B>remprop</B></A>). The <A REL=DEFINITION HREF="26_glo_p.htm#property_list"><I>property list</I></A> associated with a <A REL=DEFINITION HREF="26_glo_f.htm#fresh"><I>fresh</I></A> <A REL=DEFINITION HREF="26_glo_s.htm#symbol"><I>symbol</I></A> is initially <A REL=DEFINITION HREF="26_glo_n.htm#null"><I>null</I></A>. <P>
|
|
<DT><B>Value</B> <P><DD>
|
|
If a symbol has a value attribute, it is said to be <A REL=DEFINITION HREF="26_glo_b.htm#bound"><I>bound</I></A>, and that fact can be detected by the <A REL=DEFINITION HREF="26_glo_f.htm#function"><I>function</I></A> <A REL=DEFINITION HREF="f_boundp.htm#boundp"><B>boundp</B></A>. The <A REL=DEFINITION HREF="26_glo_o.htm#object"><I>object</I></A> contained in the <A REL=DEFINITION HREF="26_glo_v.htm#value_cell"><I>value cell</I></A> of a <A REL=DEFINITION HREF="26_glo_b.htm#bound"><I>bound</I></A> <A REL=DEFINITION HREF="26_glo_s.htm#symbol"><I>symbol</I></A> is the <A REL=DEFINITION HREF="26_glo_v.htm#value"><I>value</I></A> of the <A REL=DEFINITION HREF="26_glo_g.htm#global_variable"><I>global variable</I></A> named by that <A REL=DEFINITION HREF="26_glo_s.htm#symbol"><I>symbol</I></A>, and can be <I>accessed</I> by the <A REL=DEFINITION HREF="26_glo_f.htm#function"><I>function</I></A> <A REL=DEFINITION HREF="f_symb_5.htm#symbol-value"><B>symbol-value</B></A>. A <A REL=DEFINITION HREF="26_glo_s.htm#symbol"><I>symbol</I></A> can be made to be <A REL=DEFINITION HREF="26_glo_u.htm#unbound"><I>unbound</I></A> by the <A REL=DEFINITION HREF="26_glo_f.htm#function"><I>function</I></A> <A REL=DEFINITION HREF="f_makunb.htm#makunbound"><B>makunbound</B></A>. <P>
|
|
The consequences are undefined if an attempt is made to change the <A REL=DEFINITION HREF="26_glo_v.htm#value"><I>value</I></A> of a <A REL=DEFINITION HREF="26_glo_s.htm#symbol"><I>symbol</I></A> that names a <A REL=DEFINITION HREF="26_glo_c.htm#constant_variable"><I>constant variable</I></A>, or to make such a <A REL=DEFINITION HREF="26_glo_s.htm#symbol"><I>symbol</I></A> be <A REL=DEFINITION HREF="26_glo_u.htm#unbound"><I>unbound</I></A>. <P>
|
|
<DT><B>Function</B> <P><DD>
|
|
If a symbol has a function attribute, it is said to be <A REL=DEFINITION HREF="26_glo_f.htm#fbound"><I>fbound</I></A>, and that fact can be detected by the <A REL=DEFINITION HREF="26_glo_f.htm#function"><I>function</I></A> <A REL=DEFINITION HREF="f_fbound.htm#fboundp"><B>fboundp</B></A>. If the <A REL=DEFINITION HREF="26_glo_s.htm#symbol"><I>symbol</I></A> is the <A REL=DEFINITION HREF="26_glo_n.htm#name"><I>name</I></A> of a <A REL=DEFINITION HREF="26_glo_f.htm#function"><I>function</I></A> in the <A REL=DEFINITION HREF="26_glo_g.htm#global_environment"><I>global environment</I></A>, the <A REL=DEFINITION HREF="26_glo_f.htm#function_cell"><I>function cell</I></A> contains the <A REL=DEFINITION HREF="26_glo_f.htm#function"><I>function</I></A>, and can be <I>accessed</I> by the <A REL=DEFINITION HREF="26_glo_f.htm#function"><I>function</I></A> <A REL=DEFINITION HREF="f_symb_1.htm#symbol-function"><B>symbol-function</B></A>. If the <A REL=DEFINITION HREF="26_glo_s.htm#symbol"><I>symbol</I></A> is the <A REL=DEFINITION HREF="26_glo_n.htm#name"><I>name</I></A> of either a <A REL=DEFINITION HREF="26_glo_m.htm#macro"><I>macro</I></A> in the <A REL=DEFINITION HREF="26_glo_g.htm#global_environment"><I>global environment</I></A> (see <A REL=DEFINITION HREF="f_macro_.htm#macro-function"><B>macro-function</B></A>) or a <A REL=DEFINITION HREF="26_glo_s.htm#special_operator"><I>special operator</I></A> (see <A REL=DEFINITION HREF="f_specia.htm#special-operator-p"><B>special-operator-p</B></A>), the <A REL=DEFINITION HREF="26_glo_s.htm#symbol"><I>symbol</I></A> is <A REL=DEFINITION HREF="26_glo_f.htm#fbound"><I>fbound</I></A>, and can be <I>accessed</I> by the <A REL=DEFINITION HREF="26_glo_f.htm#function"><I>function</I></A> <A REL=DEFINITION HREF="f_symb_1.htm#symbol-function"><B>symbol-function</B></A>, but the <A REL=DEFINITION HREF="26_glo_o.htm#object"><I>object</I></A> which the <A REL=DEFINITION HREF="26_glo_f.htm#function_cell"><I>function cell</I></A> contains is of <A REL=DEFINITION HREF="26_glo_i.htm#implementation-dependent"><I>implementation-dependent</I></A> <A REL=DEFINITION HREF="26_glo_t.htm#type"><I>type</I></A> and purpose. A <A REL=DEFINITION HREF="26_glo_s.htm#symbol"><I>symbol</I></A> can be made to be <A REL=DEFINITION HREF="26_glo_f.htm#funbound"><I>funbound</I></A> by the <A REL=DEFINITION HREF="26_glo_f.htm#function"><I>function</I></A> <A REL=DEFINITION HREF="f_fmakun.htm#fmakunbound"><B>fmakunbound</B></A>. <P>
|
|
The consequences are undefined if an attempt is made to change the <A REL=DEFINITION HREF="26_glo_f.htm#functional_value"><I>functional value</I></A> of a <A REL=DEFINITION HREF="26_glo_s.htm#symbol"><I>symbol</I></A> that names a <A REL=DEFINITION HREF="26_glo_s.htm#special_form"><I>special form</I></A>. <P>
|
|
<P></DL><P>
|
|
Operations on a <A REL=DEFINITION HREF="26_glo_s.htm#symbol"><I>symbol</I></A>'s <A REL=DEFINITION HREF="26_glo_v.htm#value_cell"><I>value cell</I></A> and <A REL=DEFINITION HREF="26_glo_f.htm#function_cell"><I>function cell</I></A> are sometimes described in terms of their effect on the <A REL=DEFINITION HREF="26_glo_s.htm#symbol"><I>symbol</I></A> itself, but the user should keep in mind that there is an intimate relationship between the contents of those <A REL=DEFINITION HREF="26_glo_c.htm#cell"><I>cells</I></A> and the <A REL=DEFINITION HREF="26_glo_g.htm#global_variable"><I>global variable</I></A> or global <A REL=DEFINITION HREF="26_glo_f.htm#function"><I>function</I></A> definition, respectively. <P>
|
|
<A REL=DEFINITION HREF="26_glo_s.htm#symbol"><I>Symbols</I></A> are used as identifiers for <A REL=DEFINITION HREF="26_glo_l.htm#lexical_variable"><I>lexical variables</I></A> and lexical <A REL=DEFINITION HREF="26_glo_f.htm#function"><I>function</I></A> definitions, but in that role, only their <A REL=DEFINITION HREF="26_glo_o.htm#object"><I>object</I></A> identity is significant. Common Lisp provides no operation on a <A REL=DEFINITION HREF="26_glo_s.htm#symbol"><I>symbol</I></A> that can have any effect on a <A REL=DEFINITION HREF="26_glo_l.htm#lexical_variable"><I>lexical variable</I></A> or on a lexical <A REL=DEFINITION HREF="26_glo_f.htm#function"><I>function</I></A> definition. <P>
|
|
<P><B>See Also:</B><P>
|
|
<P>
|
|
<A REL=CHILD HREF="02_cd.htm">Section 2.3.4 (Symbols as Tokens)</A>, <A REL=CHILD HREF="02_caa.htm">Section 2.3.1.1 (Potential Numbers as Tokens)</A>, <A REL=CHILD HREF="22_acc.htm">Section 22.1.3.3 (Printing Symbols)</A> <P>
|
|
<P><HR>The following <A REL=META HREF="../Front/X3J13Iss.htm">X3J13 cleanup issues</A>, <I>not part of the specification</I>, apply to this section:<P><UL><LI> <A REL=CHILD HREF="../Issues/iss214.htm">LISP-SYMBOL-REDEFINITION:MAR89-X3J13</A><LI> <A REL=CHILD HREF="../Issues/iss043.htm">CHARACTER-PROPOSAL:2-6-2</A><LI> <A REL=CHILD HREF="../Issues/iss044.htm">CHARACTER-PROPOSAL:2-6-3</A><P></UL><HR>
|
|
|
|
<A REL=NAVIGATOR HREF="../Front/StartPts.htm"><IMG WIDTH=80 HEIGHT=40 ALT="[Starting Points]" SRC="../Graphics/StartPts.gif" ALIGN=Bottom></A><A REL=TOC HREF="../Front/Contents.htm"><IMG WIDTH=80 HEIGHT=40 ALT="[Contents]" SRC="../Graphics/Contents.gif" ALIGN=Bottom></A><A REL=INDEX HREF="../Front/X_Master.htm"><IMG WIDTH=80 HEIGHT=40 ALT="[Index]" SRC="../Graphics/Index.gif" ALIGN=Bottom></A><A REL=INDEX HREF="../Front/X_Symbol.htm"><IMG WIDTH=80 HEIGHT=40 ALT="[Symbols]" SRC="../Graphics/Symbols.gif" ALIGN=Bottom></A><A REL=GLOSSARY HREF="../Body/26_a.htm"><IMG WIDTH=80 HEIGHT=40 ALT="[Glossary]" SRC="../Graphics/Glossary.gif" ALIGN=Bottom></A><A HREF="../Front/X3J13Iss.htm"><IMG WIDTH=80 HEIGHT=40 ALT="[Issues]" SRC="../Graphics/Issues.gif" ALIGN=Bottom></A><BR>
|
|
|
|
<A REL=COPYRIGHT HREF="../Front/Help.htm#Legal"><I>Copyright 1996-2005, LispWorks Ltd. All rights reserved.</I></A><P>
|
|
</BODY>
|
|
</HTML>
|