From ... Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!news.teledanmark.no!news.equant.no!uio.no!nntp.uio.no!ifi.uio.no!not-for-mail From: Erik Naggum Newsgroups: comp.lang.lisp Subject: Re: conservative gc sucks Date: 10 Jan 2003 11:58:02 +0000 Organization: Naggum Software, Oslo, Norway Lines: 32 Message-ID: <3251188682174136@naggum.no> References: Reply-To: http://naggum.no/erik/contact.html Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: maud.ifi.uio.no 1042199883 13445 129.240.65.207 (10 Jan 2003 11:58:03 GMT) X-Complaints-To: abuse@ifi.uio.no NNTP-Posting-Date: 10 Jan 2003 11:58:03 GMT Mail-Copies-To: never User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Xref: archiver1.google.com comp.lang.lisp:50206 * lord@emf.emf.net (Tom Lord) | Ok, but, so what? The topic is closing _files_, not streams. Files | may be randomly accessible. Reaching the end-of-file during a read | is not a condition under which to automatically close the file. I thought you said this was obvious, but it appears that you were not entirely truthful. If you want freedom from closing/freeing a /stream/, the obvious solution is to close it when it has been exhausted. This is neatly localizable and abstractable. If you want to refer to /files/, the obvious solution is to intern pathnames and use a mechanism that keeps a maximum number of files open which is used to close the least recently referenced file if you are maxed out, so you save on the open calls. If you close a file, you can keep its file-position with this structure for use if you need to open it again. In this scheme, you never really talk to any streams -- they are hidden by the abstraction, and hence open and close are localized operations. Your argument was that certain algorithms were not implementable in Common Lisp because the language did not require the closing of operating-system files when the system garbage-collected streams. This is in fact wrong. There are far more possibilities that you have been willing to explore before you reached your conclusion. -- Erik Naggum, Oslo, Norway Act from reason, and failure makes you rethink and study harder. Act from faith, and failure makes you blame someone and push harder.