i'm working on converting existing python code clisp exercise ...
the program reads list of numbers , creates mean, min, max , standard deviation list. have file-based function working:
(defun get-file (filename) (with-open-file (stream filename) (loop line = (read-line stream nil) while line collect (parse-float line))))
this works when call as
(get-file "/tmp/my.filename")
... want program read standard input , i've tried various things no luck.
any advice?
just separate concerns:
(defun get-stream (stream) (loop line = (read-line stream nil) while line collect (parse-float line))) (defun get-file (filename) (with-open-file (stream filename) (get-stream stream)))
then can use get-file
do, , (get-stream *standard-input*)
.
Comments
Post a Comment