Newsgroups: comp.lang.lisp
From: cbbro...@news.hex.net (Christopher Browne)
Date: 2000/06/23
Subject: Re: Newbie asking for help
Centuries ago, Nostradamus foresaw a time when Jochen Schmidt would say:
>The Glauber wrote: It indeed sounds like a CLISP bug; the HyperSpec indicates that for: >> ;; count number of lines in file key.html >> (with-open-file (ifile "key.html" :direction :input) >> (setf nlines 0) >> (loop >> (if (read-line ifile nil) >> (setf nlines (+ 1 nlines)) >> (return nlines)))) >> It doesn't work (it just hangs, so i think it's stuck in the loop). I >> I'm sorry for posting something so stupid, but why doesn't this work? >It works for me in cmucl (warning on the nondefined variable "nlines") >have not looked further into it, but I found this interesting enough to read-line &optional input-stream eof-error-p eof-value recursive-p the default value for eof-value is nil, which I'd expect to provide The code's a bit ugly, but I'd sure expect the call to return "nil" 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.
| ||||||||||||||