Changeset 5405


Ignore:
Timestamp:
Oct 23, 2006, 4:26:33 AM (18 years ago)
Author:
Gary Byers
Message:

WITH-OUTPUT-TO-STRING: don't expand into code which evaluates the string form
twice; don't do whatever was being done to default the element type of the
string stream.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ccl/lib/macros.lisp

    r5397 r5405  
    13771377executed as an implicit progn with VAR bound to an output string stream.
    13781378All output to that string stream is saved in a string."
    1379   (let ((e-type (gensym "e-type")))
     1379  (let ((string-var (gensym "string")))
    13801380    (multiple-value-bind (forms decls) (parse-body body env nil)
    1381       `(let* ((,e-type ,(if element-type-p element-type `'base-char))
    1382               (,var (if ,string
     1381      `(let* ((,string-var ,string)
     1382              (,var (if ,string-var
    13831383                        (%make-string-output-stream ,string)
    1384                         (make-string-output-stream :element-type ,e-type))))
     1384                      ,@(if element-type-p
     1385                            `((make-string-output-stream :element-type ',element-type))
     1386                            `((make-string-output-stream))))))
    13851387         ,@decls
    13861388         (unwind-protect
Note: See TracChangeset for help on using the changeset viewer.