princ, print,
pretty_princ, pretty_print
princ, print,
pretty_princ,
pretty_print — write to the standard output file.
princ (s_exp...)
print (s_exp...)
pretty_princ (s_exp...)
pretty_print (s_exp...)
s_expAny Gamma or Lisp expression.
These functions write to the standard output file, typically the screen.
The princ and pretty_princ
functions produce formatted output, which means that special characters are
not escaped, and double quotes are not printed around character strings.
Output generated by princ cannot be read by the Lisp
reader.
print and pretty_print produce
Lisp-readable output. The result of reading a printed expression using a
call to read will generate an equal expression.
pretty_princ and pretty_print
generate carriage returns and spaces with the intention of formatting the
output to make long or complex Lisp expressions easier for a person to read.
Gamma>x = "hello";"hello"Gamma>print (x,"\n");"hello""\n"tGamma>princ (x,"\n");hello tGamma>>Gamma>class C {a; b; c;}(defclass C nil [][a b c])Gamma>princ (C);(defclass C nil [][a b c])tGamma>pretty_princ (C);(defclass C nil [] [a b c])tGamma>Gamma>L = list (1,2,3,4,5,list(1,2,3,4,5,list(1,2,3list(1,2,3,4,5,list(1,2,3,4,5,list(1,2,3,4,5,list(1,2,list(1,2,3,4,5,list(1,2,3,4,5)))))))))));(1 2 3 4 5 (1 2 3 4 5 (1 2 3 4 5 (1 2 3 4 5 (1 2 3 4 4 5 (1 2 3 4 5 (1 2 3 4 5 (1 2 3 4 5 (1 2 3 4 5)))))Gamma>princ (L);(1 2 3 4 5 (1 2 3 4 5 (1 2 3 4 5 (1 2 3 4 5 (1 2 3 4 4 5 (1 2 3 4 5 (1 2 3 4 5 (1 2 3 4 5 (1 2 3 4 5)))))Gamma>pretty_princ (L);(1 2 3 4 5 (1 2 3 4 5 (1 2 3 4 5 (1 2 3 4 5 (1 2 3 4 5 (1 2 3 4 5 (1 2 3 4 5 (1 2 3 4 5 (1 2 3 4 5 ( ))))))))))tGamma>