Subject: Re: lisp idiom for processing each line in a file?
From: (Rob Warnock)
Date: Tue, 28 Feb 2006 03:54:30 -0600
Newsgroups: comp.lang.lisp
Message-ID: <>
David Trudgett  <> wrote:
| How about this version? ...
| ;;; ... and to add prefixes to GENSYMed symbols.

Small thing, perhaps, but personally I prefer *not* to do this.
In the CLs I use the system-defined macros don't do it, and I
haven't noticed that it makes debugging significantly harder.
But YMMV...

| 	    (do ((,line-var #1=(read-line ,stream nil 'eof) #1#))
| 		 ((eq 'eof ,line-var))
|             ...)

Just curious... Why did you change the NIL to 'EOF? Both are symbols,
so you don't get any more protection from the latter than the former
[given that we're using READ-LINE, which can't return either], but
using 'EOF requires the EQ test rather than simply NULL:

  	    (do ((,line-var #1=(read-line ,stream nil 'eof) #1#))
		((null ,line-var))


p.s. Christopher Rhodes spoke adequately to the other points...

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