(write standard-output "Testing 1.. 2.. 3..")
-| Testing 1.. 2.. 3..
=> 19
Be warned, if you don't choose the streams carefully you may get a deadlock which only an interrupt signal can break!
If possible, this representation will be such that read can
turn it into an object structurally similar to object. This will
not be possible if object does not have a read syntax.
object is returned.
(print '(1 2 3))
-|
-| (1 2 3)
=> (1 2 3)
print but no initial newline is output.
(prin1 '(1 2 3))
-| (1 2 3)
=> (1 2 3)
(prin1 '|(xy((z]|) ;A strange symbol
-| \(xy\(\(z\]
=> \(xy\(\(z\]
prin1 would
output when it prints object.
(prin1-to-string '(1 2 3))
=> "(1 2 3)"
read can
parse and no quote characters surround strings.
(princ "foo")
-| foo
=> "foo"
(princ '|(xy((z]|)
-| (xy((z]
=> \(xy\(\(z\]
If stream is nil the resulting string will be returned, not
written to a stream.
template is a string which may contain format specifiers, these are a `%' character followed by another character telling how to print the next of the values. The following options are available
princ function).
prin1 function).
The function works through the template a character at a time. If the character is a format specifier (a `%') it inserts the correct string (as defined above) into the output. Otherwise, the character is simply put into the output stream.
If stream isn't nil (i.e. the formatted string is returned) the
value of stream is returned.
(format nil "foo %S bar 0x%x" '(x . y) 255)
=> "foo (x . y) bar 0xff"
(format standard-output "The %s is %s!" "dog" "purple")
-| The dog is purple!
=> #<buffer *jade*>
Go to the first, previous, next, last section, table of contents.