XLISP > XLISP 2.0  -  Contents  -  Reference  -  Previous | Next

write-char


Type:   -   function (subr)
Source:   -   xlfio.c

Syntax

(write-char char-expr [dest])
char-expr - a character expression
dest - an optional destination, must be a file pointer or stream, default is *standard-output*
returns - the character

Description

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.

Examples

(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 XLISP 2.0 manual.

  Back to Top


XLISP > XLISP 2.0  -  Contents  -  Reference  -  Previous | Next