Next: , Previous: , Up: formations   [Index]

52.3 Escape sequences for characters

Format Escape Sequence: ~c

Character. Parameter: charnum.

Output a character. The default is to simply output, as per write-char. ~@c prints in write style. ~:c prints control characters (ASCII 0 to 31) in ^X form.

(format #t "~c" #\z)        -| z
(format #t "~@c" #\z)       -| #\z
(format #t "~:c" #\newline) -| ^J

If the charnum parameter is given then an argument is not taken but instead the character is (integer->char charnum). This can be used for instance to output characters given by their Unicode code.

(format #t "~65c")  -| A