diff -r -u cl-who-0.8.1/doc/index.html cl-who-0.8.1patch/doc/index.html
--- cl-who-0.8.1/doc/index.html 2007-04-27 12:09:30.000000000 -0700
+++ cl-who-0.8.1patch/doc/index.html 2007-05-04 18:51:00.000000000 -0700
@@ -400,14 +400,20 @@
A form which is neither a string nor a keyword nor a list beginning with a keyword will be left as is except for the following substitutions:
- - Forms that look like
(str form1 form*)
will be substituted with (princ form1 s)
. (Note that all forms behind form1
are ignored.)
-
-(loop for i below 10 do (str i)) => (loop for i below 10 do (princ i s)) |
+ - Forms that look like
(str form1 form*)
will be substituted with
+ (let ((result form1)) (when result (princ result s)))
.
+ (Note that all forms behind form1
are ignored.)
+
+(loop for i below 10 do (str i)) =>
+(loop for i below 10 do
+ (let ((#:result i))
+ (when #:result (princ #:result *standard-output*)))) |
- Forms that look like
(fmt form*)
will be substituted with (format s form*)
.
(loop for i below 10 do (fmt "~R" i)) => (loop for i below 10 do (format s "~R" i)) |
- - Forms that look like
(esc form1 form*)
will be substituted with (write-string (escape-string form1) s)
.
+ - Forms that look like
(esc form1 form*)
will be substituted with
+ (let ((result form1)) (when result (write-string (escape-string result s))))
.
- If a form looks like
(htm form*)
then each of the forms
will be subject to the transformation rules we're just describing.
diff -r -u cl-who-0.8.1/who.lisp cl-who-0.8.1patch/who.lisp
--- cl-who-0.8.1/who.lisp 2007-04-27 02:33:42.000000000 -0700
+++ cl-who-0.8.1patch/who.lisp 2007-05-04 18:27:00.000000000 -0700
@@ -373,14 +373,15 @@
(case (first x)
((esc)
;; (ESC form ...) ->
- ;; (WRITE-STRING (ESCAPE-STRING form STREAM))
- (list 'write-string
- (list 'escape-string
- (second x))
- stream))
+ ;; (LET ((RESULT form)) (WHEN RESULT (WRITE-STRING (ESCAPE-STRING RESULT STREAM))))
+ (let ((result (gensym)))
+ `(let ((,result ,(second x)))
+ (when ,result (write-string (escape-string ,result) ,stream)))))
((str)
- ;; (STR form ...) --> (PRINC form STREAM)
- `(princ ,(second x) ,stream))
+ ;; (STR form ...) --> (LET ((RESULT form)) (WHEN RESULT (PRINC RESULT STREAM)))
+ (let ((result (gensym)))
+ `(let ((,result ,(second x)))
+ (when ,result (princ ,result ,stream)))))
((fmt)
;; (FMT form*) --> (FORMAT STREAM form*)
(list* 'format stream (rest x)))))