# HG changeset patch # User Steve Losh # Date 1545797923 18000 # Node ID 9ee4097163962f6696a567e46c108b5c1e1cfe83 # Parent 18f9292a0c6cff2faa7e357938e0a3bb08b6f6b3 Safety first diff -r 18f9292a0c6c -r 9ee409716396 src/main.lisp --- a/src/main.lisp Tue Dec 25 23:17:13 2018 -0500 +++ b/src/main.lisp Tue Dec 25 23:18:43 2018 -0500 @@ -132,12 +132,18 @@ (defun write-row (row &optional (stream *standard-output*)) "Write `row` to `stream` as CSV data." + (check-type stream stream) + (assert (output-stream-p stream) (stream) + "Stream ~S is not an output stream." stream) (check-delimiter) (write-row% row stream *delimiter*) (values)) (defun write-rows (rows &optional (stream *standard-output*)) "Write `rows` to `stream` as CSV data." + (check-type stream stream) + (assert (output-stream-p stream) (stream) + "Stream ~S is not an output stream." stream) (check-delimiter) (loop :with delimiter = *delimiter* :for row :in rows