Subject: Re: lisp idiom for processing each line in a file?
From: (Rob Warnock)
Date: Tue, 28 Feb 2006 03:42:09 -0600
Newsgroups: comp.lang.lisp
Message-ID: <>
Christophe Rhodes  <> wrote:
| David Trudgett <> 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...


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

Rob Warnock			<>
627 26th Avenue			<URL:>
San Mateo, CA 94403		(650)572-2607