The 'write-char' function writes the 'char-expr' to the specified 'destination'. Only the 'char-expr' is written. The 'char-expr' must be a character expression. The 'char-expr' is returned as the result. The 'destination' may be a file pointer or a stream. If there is no 'destination', *standard-output* is the default.
(write-char #\C) ; prints C (setq fp (open "t" :direction :output)) ; create file (write-char #\A fp) ; returns #\A (write-char #\B fp) ; returns #\B (write-char #\Newline fp) ; returns #\Newline (close fp) ; returns NIL (read (open "t" :direction :input)) ; returns AB
Common Lisp: Common Lisp specifies that print operations with a 'destination' of NIL will go to *standard-output*. XLISP does not send the output to *standard-output* with a 'destination' of NIL. Common Lisp also specifies that a 'destination' of T will be sent to *terminal-io*, which is not defined in XLISP by default. XLISP does not allow T as a valid argument for 'destination'.
See the
write-char
function in the