Commit 92e292368cf416e9584b9a0957fbb2188bee4e7c

Thomas de Grivel 2017-06-27T15:57:16

sugar

diff --git a/babel-stream.lisp b/babel-stream.lisp
index 2fc264a..b4688a4 100644
--- a/babel-stream.lisp
+++ b/babel-stream.lisp
@@ -72,6 +72,16 @@
            (otherwise
             (error 'stream-input-error :stream stream)))))))
 
+(defun babel-input-stream (stream &optional (external-format :utf-8))
+  (make-instance 'babel-input-stream
+                 :external-format external-format
+                 :stream stream))
+
+#+test
+(let ((s (make-instance 'babel-input-stream
+                        :stream (fd-stream:fd-input-stream 0))))
+  (read-line s))
+
 (defclass babel-output-stream (babel-stream output-stream)
   ())
 
@@ -93,10 +103,10 @@
 (defmethod flush ((stream babel-output-stream))
   (flush (stream-underlying-stream stream)))
 
-#+test
-(let ((s (make-instance 'babel-input-stream
-                        :stream (fd-stream:fd-input-stream 0))))
-  (read-line s))
+(defun babel-output-stream (stream &optional (external-format :utf-8))
+  (make-instance 'babel-output-stream
+                 :external-format external-format
+                 :stream stream))
 
 #+test
 (let ((s (make-instance 'babel-output-stream