User Tools


Differences

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

Link to this comparison view

cl:variables:star-print-case-star [2017/05/01 21:00] (current)
Line 1: Line 1:
 +====== Variable *PRINT-CASE* ======
 +
 +====Value Type====
 +One of the //​[[CL:​Glossary:​symbols]]//​ **'':​upcase''​**,​ **'':​downcase''​**,​ or **'':​capitalize''​**.
 +
 +====Initial Value====
 +The //​[[CL:​Glossary:​symbol]]//​ **'':​upcase''​**.
 +
 +====Description====
 +The //​[[CL:​Glossary:​value]]//​ of **[[CL:​Variables:​star-print-case-star|*print-case*]]** controls the case (upper, lower, or mixed) in which to print any uppercase characters in the names of //​[[CL:​Glossary:​symbols]]//​ when vertical-bar syntax is not used.
 +
 +**[[CL:​Variables:​star-print-case-star|*print-case*]]** has an effect at all times when the //​[[CL:​Glossary:​value]]//​ of **[[CL:​Variables:​star-print-escape-star|*print-escape*]]** is //​[[CL:​Glossary:​false]]//​. **[[CL:​Variables:​star-print-case-star|*print-case*]]** also has an effect when the //​[[CL:​Glossary:​value]]//​ of **[[CL:​Variables:​star-print-escape-star|*print-escape*]]** is //​[[CL:​Glossary:​true]]//​ unless inside an escape context (i.e. unless between //​[[CL:​Glossary:​vertical-bars]]//​ or after a //​[[CL:​Glossary:​slash]]//​).
 +
 +====Examples====
 +Although the choice of which //​[[CL:​Glossary:​character|characters]]//​ to //​[[CL:​Glossary:​escape]]//​ is specified by **<​nowiki>​*print-case*</​nowiki>​**,​ the choice of how to //​[[CL:​Glossary:​escape]]//​ those //​[[CL:​Glossary:​character|haracters]]//​ (i.e., whether single escapes or multiple escapes are used) is //​[[CL:​Glossary:​implementation-dependent]]//​. The examples here show two of the many valid ways in which escaping might appear. ​
 +
 +<​blockquote> ​
 +(defun test-print-case ()
 +  (dolist (*print-case* '​(:​upcase :downcase :​capitalize)) ​
 +    (format t "​~&​~S ~S~%" '​this-and-that '​|And-something-elSE|)))
 +    → TEST-PC ​
 +(test-print-case) ​
 +<o>; Implementation A
 +THIS-AND-THAT |And-something-elSE|
 +this-and-that a\\n\\d-\\s\\o\\m\\e\\t\\h\\i\\n\\g-\\e\\lse
 +This-And-That A\\n\\d-\\s\\o\\m\\e\\t\\h\\i\\n\\g-\\e\\lse </o>
 +<o>; Implementation B
 +THIS-AND-THAT |And-something-elSE|
 +this-and-that a|nd-something-el|se
 +This-And-That A|nd-something-el|se </o>
 +<​r>​NIL</​r> ​
 +</​blockquote>​
 +
 +====Affected By====
 +None.
 +
 +====See Also====
 +  * **[[CL:​Functions:​write|Function WRITE]]**
 +
 +====Notes====
 +**[[CL:​Functions:​read]]** normally converts lowercase characters appearing in //​[[CL:​Glossary:​symbols]]//​ to corresponding uppercase characters, so that internally print names normally contain only uppercase characters.
 +
 +If **[[CL:​Variables:​star-print-escape-star|*print-escape*]]** is //​[[CL:​Glossary:​true]]//,​ lowercase characters in the //​[[CL:​Glossary:​name]]//​ of a //​[[CL:​Glossary:​symbol]]//​ are always printed in lowercase, and are preceded by a single escape character or enclosed by multiple escape characters; uppercase characters in the //​[[CL:​Glossary:​name]]//​ of a //​[[CL:​Glossary:​symbol]]//​ are printed in upper case, in lower case, or in mixed case so as to capitalize words, according to the value of **[[CL:​Variables:​star-print-case-star|*print-case*]]**. The convention for what constitutes a "​word"​ is the same as for **[[CL:​Functions:​string-capitalize]]**.
 +
 +\issue{PRINT-CASE-PRINT-ESCAPE-INTERACTION:​VERTICAL-BAR-RULE-NO-UPCASE} \issue{JUN90-TRIVIAL-ISSUES:​3} \issue{PRINT-CASE-BEHAVIOR:​CLARIFY}