Re: anaphoric macro question



On 16/11/2011 04:53, hans wrote:
I would like to see what are the ways or possibilities to write an
anaphoric macro, say "do-line", which takes successive lines from a
file and binds them to 'it', so you can do:

(do-line filename
(print it)) ;do something with 'it', the line

just as

(with-open-file (s "test.txt")
(loop for line = (read-line s nil)
while line do
(print line)))

thank you

This is very basic macrology. You should be able to do this by yourself. How far did you get already?


Pascal

--
My website: http://p-cos.net
Common Lisp Document Repository: http://cdr.eurolisp.org
Closer to MOP & ContextL: http://common-lisp.net/project/closer/
The views expressed are my own, and not those of my employer.
.