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

prin1


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

Syntax

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

Description

The 'prin1' function prints the 'expr' to the specified 'destination'. The 'expr' is printed without a 'newline' character. If 'expr' is a string, it will be printed with quotes around the string. The '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. The terpri function is used to terminate the print lines produced.

Examples

(prin1 'a)                              ; prints A     without #\Newline
(prin1 '(a b))                          ; prints (A B) without #\Newline
(prin1 2.5)                             ; prints 2.5   without #\Newline
(prin1 "hi")                            ; prints "hi"  without #\Newline

(setq f (open "f" :direction :output))  ; create file
(prin1 "hi" f)                          ; returns "hi"
(prin1 1234 f)                          ; returns 1234
(prin1 "he" f)                          ; returns "he"
(close f)                               ; file contains "hi"1234"he"

Common Lisp: Common Lisp specifies that 'pprint' 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 prin1 function in the XLISP 2.0 manual.

  Back to Top


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