diff options
Diffstat (limited to 'share')
-rw-r--r-- | share/txr/stdlib/with-stream.tl | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/share/txr/stdlib/with-stream.tl b/share/txr/stdlib/with-stream.tl index 40043237..a422a07c 100644 --- a/share/txr/stdlib/with-stream.tl +++ b/share/txr/stdlib/with-stream.tl @@ -34,6 +34,11 @@ ,*body (get-list-from-stream ,stream))) +(defmacro with-out-buf-stream ((stream : buf) . body) + ^(let ((,stream (make-buf-stream ,*[[iff have list] buf]))) + ,*body + (get-buf-from-stream ,stream))) + (defmacro with-in-string-stream ((stream string) . body) ^(let ((,stream (make-string-input-stream ,string))) ,*body)) @@ -42,6 +47,10 @@ ^(let ((,stream (make-string-byte-input-stream ,string))) ,*body)) +(defmacro with-in-buf-stream ((stream buf) . body) + ^(let ((,stream (make-buf-stream ,buf))) + ,*body)) + (defmacro with-stream ((var stream) . body) ^(let ((,var ,stream)) (unwind-protect |