Open lassik opened 1 year ago
Yes, the description for DIGIT-CHAR says specifically "If the resulting character is to be an alphabetic[1] character, it will be an uppercase character." There maybe other places also.
Function DIGIT-CHAR
(http://clhs.lisp.se/Body/f_digit_.htm#digit-char)
If the resulting character is to be an alphabetic[1] character, it will be an uppercase character.
Variable *PRINT-BASE*
, *PRINT-RADIX*
(http://clhs.lisp.se/Body/v_pr_bas.htm#STprint-baseST)
For radices above 10, letters of the alphabet are used to represent digits above 9.
If the value of print-radix is true, the printer will print a radix specifier to indicate the radix in which it is printing a rational number. The radix specifier is always printed using lowercase letters. If print-base is 2, 8, or 16, then the radix specifier used is #b, #o, or #x, respectively.
2.3.2.1.1 Syntax of an Integer (http://clhs.lisp.se/Body/02_cbaa.htm)
13.1.4.6 Digits in a Radix (http://clhs.lisp.se/Body/13_adf.htm)
22.1.3.1.1 Printing Integers (http://clhs.lisp.se/Body/22_acaa.htm)
22.3.2.1 Tilde R: Radix (http://clhs.lisp.se/Body/22_cba.htm)
22.3.2.5 Tilde X: Hexadecimal (http://clhs.lisp.se/Body/22_cbe.htm)
current output base (http://clhs.lisp.se/Body/26_glo_c.htm#current_output_base)
Note that if you want a specific case, you can use format ~:@( or ~(
cl-user> (format t "~:@(~X~) ~:*~(~X~)~%" #xbabe)
BABE babe
nil
Does the standard say anywhere if hex and other base>10 numbers should be printed using uppercase (as opposed to lowercase) letters? Uppercase seems to be the norm.