Skip to content

Commit

Permalink
with-input-from-file
Browse files Browse the repository at this point in the history
> (with-input-from-file (stream "/etc/passwd") (read-line stream))
"root:x:0:0:root:/root:/bin/bash"
  • Loading branch information
whalliburton authored and Student committed Jun 29, 2015
1 parent f4591be commit 119448a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions nuts-and-bolts.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ this file is verified."
:if-does-not-exist :create)
,@body))

(defmacro with-input-from-file ((stream filename) &body body)
`(with-open-file (,stream ,filename :direction :input)
,@body))

(defmacro with-output-to-data-file (filename &body body)
(let ((bytes (gensym))
(name (gensym)))
Expand Down

0 comments on commit 119448a

Please sign in to comment.