User Tools


Differences

This shows you the differences between two versions of the page.

Link to this comparison view

cl:functions:set-syntax-from-char [2019/09/14 05:00]
cl:functions:set-syntax-from-char [2019/09/20 16:00] (current)
Line 1: Line 1:
 +====== Function SET-SYNTAX-FROM-CHAR ======
 +
 +====Syntax====
 +  * **set-syntax-from-char** //to-char// //​from-char//​ ''&​optional''​ //​to-readtable//​ //​from-readtable//​ → **[[CL:​Constant Variables:​t]]**
 +
 +====Arguments and Values====
 +  * //to-char// - a //​[[CL:​Glossary:​character]]//​.
 +  * //​from-char//​ - a //​[[CL:​Glossary:​character]]//​.
 +  * //​to-readtable//​ - a //​[[CL:​Glossary:​readtable]]//​. The default is the //​[[CL:​Glossary:​current readtable]]//​.
 +  * //​from-readtable//​ - a //​[[CL:​Glossary:​readtable designator]]//​. The default is the //​[[CL:​Glossary:​standard readtable]]//​.
 +
 +====Description====
 +**set-syntax-from-char** makes the syntax of //to-char// in //​to-readtable//​ be the same as the syntax of //​from-char//​ in //​from-readtable//​.
 +
 +**set-syntax-from-char** copies the //​[[CL:​Glossary:​syntax type|syntax types]]// of //​from-char//​. If //​from-char//​ is a //​[[CL:​Glossary:​macro character]]//,​ its //​[[CL:​Glossary:​reader macro function]]//​ is copied also. If the character is a //​[[CL:​Glossary:​dispatching macro character]]//,​ its entire dispatch table of //​[[CL:​Glossary:​reader macro functions]]//​ is copied. The //​[[CL:​Glossary:​constituent traits]]// of //​from-char//​ are not copied.
 +
 +A macro definition from a character such as ''"''​ can be copied to another character; the standard definition for ''"''​ looks for another character that is the same as the character that invoked it. The definition of ''​(''​ can not be meaningfully copied to ''​{'',​ on the other hand. The result is that //​[[CL:​Glossary:​lists]]//​ are of the form ''​{a b c)'',​ not ''​{a b c}'',​ because the definition always looks for a closing parenthesis,​ not a closing brace.
 +
 +====Examples====
 +<​blockquote> ​
 +(set-syntax-from-char #\7 #\;) <​r>​[[CL:​Constant Variables:​T]] </r>
 +123579 <​r>​1235 </r>
 +</​blockquote>​
 +
 +====Side Effects====
 +The //​to-readtable//​ is modified.
 +
 +====Affected By====
 +The existing values in the //​from-readtable//​.
 +
 +====Exceptional Situations====
 +None.
 +
 +====See Also====
 +  * **[[CL:​Functions:​set-macro-character|Function SET-MACRO-CHARACTER]]**
 +  * **[[CL:​Functions:​make-dispatch-macro-character|Function MAKE-DISPATCH-MACRO-CHARACTER]]**
 +  * {\secref\CharacterSyntaxTypes}
 +
 +====Notes====
 +The //​[[CL:​Glossary:​constituent trait|constituent traits]]// of a //​[[CL:​Glossary:​character]]//​ are "hard wired" into the parser for extended //​[[CL:​Glossary:​token|tokens]]//​. For example, if the definition of ''​S''​ is copied to ''​*'',​ then ''​*''​ will become a //​[[CL:​Glossary:​constituent]]//​ that is //​[[CL:​Glossary:​alphabetic]]//​ but that cannot be used as a //​[[CL:​Glossary:​short float]]// //​[[CL:​Glossary:​exponent marker]]//. For further information,​ see section {\secref\ConstituentTraits}.
 +
 +\issue{RETURN-VALUES-UNSPECIFIED:​SPECIFY} \issue{ARGUMENTS-UNDERSPECIFIED:​SPECIFY}