Subject: Re: lisp idiom for processing each line in a file?
From: rpw3@rpw3.org (Rob Warnock)
Date: Tue, 28 Feb 2006 03:42:09 -0600
Newsgroups: comp.lang.lisp
Message-ID: <6P-dncBU0sNsh5nZRVn-iw@speakeasy.net>
Christophe Rhodes  <csr21@cam.ac.uk> wrote:
+---------------
| David Trudgett <wpower@zeta.org.au.nospamplease> writes:
| > Does something need to be done to specifically allow declarations?
| 
| The macro above fails this criterion; the idea is that
|   (do-file-lines (s "/tmp/foo")
|     (declare (special s))
|     (bar))
| should cause a special binding of S to be visible in BAR.  With the
| above macro, this won't work, as any declarations in ,@body won't be
| bound declarations for the binding of LINE when a key function is not
| provided.  Fixing this up is quite simple; the last two lines should
| be replaced by
|   ,@(if key-p `((let ,let-args ,@body)) body)
+---------------

Yup. All of which is reason enough to use DO instead of LOOP in
the expansion. So noted...


-Rob

p.s. Thanks, everyone, for the comments in re LOOP in macro expansions.

-----
Rob Warnock			<rpw3@rpw3.org>
627 26th Avenue			<URL:http://rpw3.org/>
San Mateo, CA 94403		(650)572-2607