Subject: Re: lisp idiom for processing each line in a file?
From: rpw3@rpw3.org (Rob Warnock)
Date: Tue, 28 Feb 2006 03:54:30 -0600
Newsgroups: comp.lang.lisp
Message-ID: <bs2dnQ20yoZLgJnZRVn-qw@speakeasy.net>
David Trudgett  <wpower@zeta.org.au.nospamplease> 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))
	      ...)


-Rob

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

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