princ
(princ [ expression [ fileHandle ] ]
)
This function prints expression to command line or
to specified fileHandle.
Arguments
|
expression
(optional) any Lisp expression or value;
if omitted, NIL is used
fileHandle (optional) handle of a file as obtained from
(open);
if omitted or NIL is used, output goes to command line
|
Return
|
the evaluated value of
expression, or a
"void" value
|
Example
|
(setq x 123)
(princ x) 123, to command
line
(princ x fh) 123, to opened file
"fh"
|
Remarks
|
1.
if no argument is provided (prin1) a "void"
symbol value is returned (effectively "nothing");
(princ) can be used as last statement in a
defun scope, to return "nothing", so no result is finally output to
command line
2.
other than (prin1), (princ) does not use the
"\n" representation for any control character (\t \n \r \" \nnn
octal) when encountered in a string expression
|