64 lines
6.3 KiB
HTML
64 lines
6.3 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: Function SET-SYNTAX-FROM-CHAR</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="f_set_ma.htm">
|
|
<LINK REL=UP HREF="c_reader.htm">
|
|
<LINK REL=NEXT HREF="m_w_std_.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="f_set_ma.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Previous]" SRC="../Graphics/Prev.gif" ALIGN=Bottom></A><A REL=UP HREF="c_reader.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Up]" SRC="../Graphics/Up.gif" ALIGN=Bottom></A><A REL=NEXT HREF="m_w_std_.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Next]" SRC="../Graphics/Next.gif" ALIGN=Bottom></A></H1>
|
|
|
|
<HR>
|
|
|
|
<A NAME="set-syntax-from-char"><I>Function</I> <B>SET-SYNTAX-FROM-CHAR</B></A> <P>
|
|
<P><B>Syntax:</B><P>
|
|
<P>
|
|
|
|
<B>set-syntax-from-char</B> <I>to-char from-char <TT>&optional</TT> to-readtable from-readtable</I> => <I><A REL=DEFINITION HREF="a_t.htm#t"><B>t</B></A></I><P>
|
|
<P>
|
|
<P><B>Arguments and Values:</B><P>
|
|
<P>
|
|
<I>to-char</I>---a <A REL=DEFINITION HREF="26_glo_c.htm#character"><I>character</I></A>. <P>
|
|
<I>from-char</I>---a <A REL=DEFINITION HREF="26_glo_c.htm#character"><I>character</I></A>. <P>
|
|
<I>to-readtable</I>---a <A REL=DEFINITION HREF="26_glo_r.htm#readtable"><I>readtable</I></A>. The default is the <A REL=DEFINITION HREF="26_glo_c.htm#current_readtable"><I>current readtable</I></A>. <P>
|
|
<I>from-readtable</I>---a <A REL=DEFINITION HREF="26_glo_r.htm#readtable_designator"><I>readtable designator</I></A>. The default is the <A REL=DEFINITION HREF="26_glo_s.htm#standard_readtable"><I>standard readtable</I></A>. <P>
|
|
<P><B>Description:</B><P>
|
|
<P>
|
|
<A REL=DEFINITION HREF="#set-syntax-from-char"><B>set-syntax-from-char</B></A> makes the syntax of <I>to-char</I> in <I>to-readtable</I> be the same as the syntax of <I>from-char</I> in <I>from-readtable</I>. <P>
|
|
<A REL=DEFINITION HREF="#set-syntax-from-char"><B>set-syntax-from-char</B></A> copies the <A REL=DEFINITION HREF="26_glo_s.htm#syntax_type"><I>syntax types</I></A> of <I>from-char</I>. If <I>from-char</I> is a <A REL=DEFINITION HREF="26_glo_m.htm#macro_character"><I>macro character</I></A>, its <A REL=DEFINITION HREF="26_glo_r.htm#reader_macro_function"><I>reader macro function</I></A> is copied also. If the character is a <A REL=DEFINITION HREF="26_glo_d.htm#dispatching_macro_character"><I>dispatching macro character</I></A>, its entire dispatch table of <A REL=DEFINITION HREF="26_glo_r.htm#reader_macro_function"><I>reader macro functions</I></A> is copied. The <A REL=DEFINITION HREF="26_glo_c.htm#constituent_trait"><I>constituent traits</I></A> of <I>from-char</I> are not copied. <P>
|
|
A macro definition from a character such as <TT>"</TT> can be copied to another character; the standard definition for <TT>"</TT> looks for another character that is the same as the character that invoked it. The definition of <TT>(</TT> can not be meaningfully copied to <TT>{</TT>, on the other hand. The result is that <A REL=DEFINITION HREF="26_glo_l.htm#list"><I>lists</I></A> are of the form <TT>{a b c)</TT>, not <TT>{a b c}</TT>, because the definition always looks for a closing parenthesis, not a closing brace. <P>
|
|
<P><B>Examples:</B><P>
|
|
|
|
<PRE>
|
|
(set-syntax-from-char #\7 #\;) => T
|
|
123579 => 1235
|
|
</PRE>
|
|
</TT> <P>
|
|
<P><B>Side Effects:</B><P>
|
|
<P>
|
|
The <I>to-readtable</I> is modified. <P>
|
|
<P><B>Affected By:</B><P>
|
|
<P>
|
|
The existing values in the <I>from-readtable</I>. <P>
|
|
<P><B>Exceptional Situations:</B> None.
|
|
<P>
|
|
<P><B>See Also:</B><P>
|
|
<P>
|
|
<A REL=DEFINITION HREF="f_set_ma.htm#set-macro-character"><B>set-macro-character</B></A>, <A REL=DEFINITION HREF="f_mk_dis.htm#make-dispatch-macro-character"><B>make-dispatch-macro-character</B></A>, <A REL=CHILD HREF="02_ad.htm">Section 2.1.4 (Character Syntax Types)</A> <P>
|
|
<P><B>Notes:</B><P>
|
|
<P>
|
|
The <A REL=DEFINITION HREF="26_glo_c.htm#constituent_trait"><I>constituent traits</I></A> of a <A REL=DEFINITION HREF="26_glo_c.htm#character"><I>character</I></A> are ``hard wired'' into the parser for extended <A REL=DEFINITION HREF="26_glo_t.htm#token"><I>tokens</I></A>. For example, if the definition of <TT>S</TT> is copied to <TT>*</TT>, then <TT>*</TT> will become a <A REL=DEFINITION HREF="26_glo_c.htm#constituent"><I>constituent</I></A> that is <A REL=DEFINITION HREF="26_glo_a.htm#alphabetic"><I>alphabetic</I></A>[2] but that cannot be used as a <A REL=DEFINITION HREF="26_glo_s.htm#short_float"><I>short float</I></A> <A REL=DEFINITION HREF="26_glo_e.htm#exponent_marker"><I>exponent marker</I></A>. For further information, see <A REL=CHILD HREF="02_adb.htm">Section 2.1.4.2 (Constituent Traits)</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/iss013.htm">ARGUMENTS-UNDERSPECIFIED:SPECIFY</A><LI> <A REL=CHILD HREF="../Issues/iss299.htm">RETURN-VALUES-UNSPECIFIED:SPECIFY</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>
|