| Paste number 10119: | macro thang |
| Pasted by: | morecowbell |
| When: | 3 years, 11 months ago |
| Share: | Tweet this! | http://paste.lisp.org/+7T3 |
| Channel: | #lisp |
| Paste contents: |
(defmacro do-file (filename line-buffer &body body)
(let ((in-stream (gensym)))
`(with-open-file (,in-stream ,filename :direction :input)
(do ((,line-buffer (read-line ,in-stream nil :eof)
(read-line ,in-stream nil :eof)))
((eql ,line-buffer :eof) nil)
,body))))
the macro expansion looks like I expect but when I run it
sbcl complains:
"illegal function call (read-line #:G908 nil :eof)"
Sure looks legal to me!Annotations for this paste:
| Annotation number 2: | make baby |
| Pasted by: | sexoman |
| When: | 2 years, 5 months ago |
| Share: | Tweet this! | http://paste.lisp.org/+7T3#2 |
| Paste contents: |
sex+sex=fast baby| Annotation number 1: | 10119 |
| Pasted by: | wwk3492 |
| When: | 2 years, 11 months ago |
| Share: | Tweet this! | http://paste.lisp.org/+7T3#1 |
| Paste contents: |
(defmacro do-file (filename line-buffer &body body)
(let ((in-stream (gensym)))
`(with-open-file (,in-stream ,filename :direction :input)
(do ((,line-buffer (read-line ,in-stream nil :eof)
(read-line ,in-stream nil :eof)))
((eql ,line-buffer :eof) nil)
,body))))