Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Meaning of ~| in Common Lisp format

The CLHS describes 22.3.1.4 Tilde Vertical-Bar: Page This outputs a page separator character, if possible. ~n| does this n times.

I did not find much for page separator character. Trying it out with SBCL 2.0 on MacOS a page separator seems to be the newline (Ascii 0A). This would make it the same as ~%?

Was it something else in the long history of Common Lisp?

like image 263
thunder Avatar asked Dec 22 '22 19:12

thunder


2 Answers

For me, the output is ^L - ASCII NP, which, when presented to a printer, finishes the current page and starts on the next page.

like image 156
Xach Avatar answered Feb 14 '23 09:02

Xach


It's the #\page character:

CL-USER> #\page
#\Page


CL-USER> (describe *)
#\Page
  [base-char]

Char-code: 12
Char-name: Page


CL-USER> (format nil "~|")
"^L"


CL-USER> (aref * 0)
#\Page
like image 30
Rainer Joswig Avatar answered Feb 14 '23 09:02

Rainer Joswig