From ... From: Erik Naggum Subject: Re: Q: on hashes and counting Date: 2000/10/20 Message-ID: <3181073523983640@naggum.net>#1/1 X-Deja-AN: 683993139 References: <8sl58e$ivq$1@nnrp1.deja.com> <3180944138438226@naggum.net> <6xvgupx8zl.fsf@lant.be> <3180960016357928@naggum.net> <8sq654$liu$1@nnrp1.deja.com> mail-copies-to: never Content-Type: text/plain; charset=us-ascii X-Complaints-To: newsmaster@eunet.no X-Trace: oslo-nntp.eunet.no 972087009 25452 195.0.192.66 (21 Oct 2000 00:10:09 GMT) Organization: Naggum Software; vox: +47 800 35477; gsm: +47 93 256 360; fax: +47 93 270 868; http://naggum.no; http://naggum.net User-Agent: Gnus/5.0803 (Gnus v5.8.3) Emacs/20.7 Mime-Version: 1.0 NNTP-Posting-Date: 21 Oct 2000 00:10:09 GMT Newsgroups: comp.lang.lisp * The Glauber | I still don't understand how this works. read-sequence returns a position, | not a string; "vendor" would be bound to the number 5, right? It doesn't work because I blew it. I have this nifty little Emacs hack that lets me edit Lisp code in an indirect buffer, but I must have posted the code I jotted down first and discarded the code that worked after improvements and testing. The real code goes like this: (let ((vendor (make-string 5))) (read-sequence vendor stream) ... The return value from read-sequence is discarded because it may be less than 5 only when the end of the file has been reached, and then we're going to hit the real end of file in the next read operations, so testing for zero would have been necessary, but only a waste. I have long been annoyed that read-sequence returns 0 on end of file. That kind of braindamaged conflation between a "no can do" whine (useless return value) and "read past the end of the file" condition doesn't belong in a programming language, but rather in some underdesigned little toy operating system like early 1970's Unix. *sigh* #:Erik -- I agree with everything you say, but I would attack to death your right to say it. -- Tom Stoppard