From ... Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!newsfeeds.belnet.be!news.belnet.be!ossa.telenet-ops.be!nmaster.kpnqwest.net!nreader3.kpnqwest.net.POSTED!not-for-mail Newsgroups: comp.lang.lisp Subject: Re: make-****-input-stream References: <87wuvsazu7.fsf@nkapi.internal> Mail-Copies-To: never From: Erik Naggum Message-ID: <3226641546765711@naggum.net> Organization: Naggum Software, Oslo, Norway Lines: 38 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Mon, 01 Apr 2002 09:18:51 GMT X-Complaints-To: newsmaster@KPNQwest.no X-Trace: nreader3.kpnqwest.net 1017652731 193.71.199.50 (Mon, 01 Apr 2002 11:18:51 MET DST) NNTP-Posting-Date: Mon, 01 Apr 2002 11:18:51 MET DST Xref: archiver1.google.com comp.lang.lisp:30674 * Bulent Murtezaoglu | Anyhow, I thought it would be good if I could just write the routine for | streams and use the analogue of make-string-input-stream for (byte 8) | except that such a thing doesn't seem to exist. The Hyperspec seems to | give no clue about turning arrays into a streams. The string-stream is basically a stream that has a string for buffer. Buffer management is not part of Common Lisp, which I personally think is a tragedy, so there is no way you can make a (standard) stream with a buffer that utilizes an existing object. That would have been so very useful in so many cases. *sigh* | Where do I find clues about how one might do it w/o going into | extensions? Look around in the internals of your implementation to find out how you can create a specialized-vector-stream based on how string-streams are made. It should actually not be too hard to find out. From a cursory look at the source code that comes with a supported Allegro CL license (i.e., not the Trial editions), it should be doable at user level. I am quite certain that CMUCL and CLISP come with a sufficiently good streams class hierarchy that you can whip together your own vector-stream in no time. | Or is this where I finally get the motivation to read about Gray streams | and simple streams? Yes, you would do this with Gray streams if you were to roll your own, but I would strongly suggest poking around in your systems internals first. Remember: portable code depends on unportable support code, so if you look for a portable way to do something like this, you will not find it, but if you write unportable code to support something that could be implemented with the same functionality everywhere, you are in business. /// -- In a fight against something, the fight has value, victory has none. In a fight for something, the fight is a loss, victory merely relief.