Newsgroups: comp.lang.lisp
From: Erik Naggum <e...@naggum.no>
Date: 2000/06/22
Subject: Re: Newbie asking for help
* Lieven Marchand <m...@bewoner.dma.be>
| This isn't meant to reopen the great LOOP flame war but one way of | doing it is: | | (with-open-file (ifile "key.html" :direction :input) | (loop for line = (read-line ifile nil) | while line | counting 1)) Simply using while (read-line ifile nil nil) seems even more compact. However, I have this negative gut reaction to wanton waste, as in (loop for char = (read-char ifile nil nil) Note that read-line will return nil on an empty file, but the data | (loop for line being each line of ifile Elegant. #:Erik You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||