1
0
Fork 0
cl-sites/www.cs.cmu.edu/Groups/AI/html/cltl/clm/node109.html
2023-10-25 11:23:21 +02:00

51 lines
2.6 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3O//DTD W3 HTML 2.0//EN">
<!Converted with LaTeX2HTML 0.6.5 (Tue Nov 15 1994) by Nikos Drakos (nikos@cbl.leeds.ac.uk), CBLU, University of Leeds >
<HEAD>
<TITLE>10.2. The Print Name</TITLE>
</HEAD>
<BODY>
<meta name="description" value=" The Print Name">
<meta name="keywords" value="clm">
<meta name="resource-type" value="document">
<meta name="distribution" value="global">
<P>
<b>Common Lisp the Language, 2nd Edition</b>
<BR> <HR><A NAME=tex2html2880 HREF="node110.html"><IMG ALIGN=BOTTOM ALT="next" SRC="icons/next_motif.gif"></A> <A NAME=tex2html2878 HREF="node107.html"><IMG ALIGN=BOTTOM ALT="up" SRC="icons/up_motif.gif"></A> <A NAME=tex2html2872 HREF="node108.html"><IMG ALIGN=BOTTOM ALT="previous" SRC="icons/previous_motif.gif"></A> <A NAME=tex2html2882 HREF="node1.html"><IMG ALIGN=BOTTOM ALT="contents" SRC="icons/contents_motif.gif"></A> <A NAME=tex2html2883 HREF="index.html"><IMG ALIGN=BOTTOM ALT="index" SRC="icons/index_motif.gif"></A> <BR>
<B> Next:</B> <A NAME=tex2html2881 HREF="node110.html"> Creating Symbols</A>
<B>Up:</B> <A NAME=tex2html2879 HREF="node107.html"> Symbols</A>
<B> Previous:</B> <A NAME=tex2html2873 HREF="node108.html"> The Property List</A>
<HR> <P>
<H1><A NAME=SECTION001420000000000000000>10.2. The Print Name</A></H1>
<P>
Every symbol has an associated string called the <i>print name</i>.
This string is used as the external representation of the symbol:
if the characters in the string are typed in to <tt>read</tt>
(with suitable escape conventions for certain characters),
it is interpreted as a reference to that symbol
(if it is interned); and if the symbol is printed, <tt>print</tt> types out the
print name.
For more information, see the sections on the <i>reader</i>
(section <A HREF="node188.html#READER">22.1.1</A>)
and <i>printer</i> (section <A HREF="node193.html#PRINTER">22.1.6</A>).
<P>
<BR><b>[Function]</b><BR>
<tt>symbol-name <i>sym</i></tt><P>This returns the print name of the symbol <i>sym</i>.
For example:
<P><pre>
(symbol-name 'xyz) => &quot;XYZ&quot;
</pre><P>
It is an extremely bad idea to modify a string being used as the print name of
a symbol. Such a modification may tremendously confuse
the function <tt>read</tt> and the package system.
<P>
<img align=bottom alt="change_begin" src="gif/change_begin.gif"><br>
X3J13 voted in March 1989 (CHARACTER-PROPOSAL) <A NAME=10013>&#160;</A>
to specify that it is an error to modify a string being used
as the print name of a symbol.
<br><img align=bottom alt="change_end" src="gif/change_end.gif">
<P>
<HR>
<P><ADDRESS>
AI.Repository@cs.cmu.edu
</ADDRESS>
</BODY>