All Manuals > LispWorks® User Guide and Reference Manual > 33 The COMMON-LISP Package

with-output-to-string Macro

Summary

Creates a character output stream, performs a series of operations that may send results to this stream, and then closes the stream.

Package

common-lisp

Signature

with-output-to-string (var &optional string-form &key element-type) {declaration}* {form}* => string-or-values

Arguments
var
A symbol.
string-form
A form that evaluates to produce a string that has a fill-pointer, or nil.
element-type
A type specifier.
declaration
A declare expression.
form
A form.
Values
string-or-values
A string or the value(s) of the last form.
Description

The macro with-output-to-string behaves as specified in the ANSI Common Lisp Standard with one exception: the default value of element-type is the value of *default-character-element-type*.

Therefore for strict compliance you must call set-default-character-element-type to set the default string type to character.

var, string-form, declaration and form can be used as specified by ANSI Common Lisp.

See also

with-output-to-string in the Common Lisp HyperSpec
compile-file
declare
proclaim
*default-character-element-type*
set-default-character-element-type


LispWorks® User Guide and Reference Manual - 01 Dec 2021 19:30:30