Path: csiph.com!weretis.net!feeder6.news.weretis.net!border-3.nntp.ord.giganews.com!border-4.nntp.ord.giganews.com!border-2.nntp.ord.giganews.com!nntp.giganews.com!Xl.tags.giganews.com!local-2.nntp.ord.giganews.com!news.giganews.com.POSTED!not-for-mail NNTP-Posting-Date: Fri, 19 Apr 2024 17:44:58 +0000 From: steve Newsgroups: comp.lang.lisp Subject: Re: Synonym Streams References: <6pd1+E7bUWxwHGM59@bongo-ra.co> <23FZrFyCKlaZfJP1R@bongo-ra.co> <20240219092306.348@kylheku.com> <867cj0qfbq.fsf_-_@williamsburg.bawden.org> <8734roez2s.fsf@gmail.com> Date: Fri, 19 Apr 2024 13:44:57 -0400 Message-ID: <87frvhl012.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Cancel-Lock: sha1:L49SE/PHG48pJvZ2Ors8ypYx+Sc= MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Lines: 27 X-Usenet-Provider: http://www.giganews.com X-Trace: sv3-vK8qKAiVyThbuWGyPPUGBTOQ3u8pZI7xVxEOJ+cK4bmTm2NyL2mMCnEfG5I1pJwboByamBbWflhaSB3!PR4pt7cTOCQDvZfSVbWmGbvFCEN2OaIqome8B/K2KsWNPw== X-Complaints-To: abuse@giganews.com X-DMCA-Notifications: http://www.giganews.com/info/dmca.html X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 Xref: csiph.com comp.lang.lisp:59552 Lawrence D'Oliveiro writes: > On Sun, 14 Apr 2024 11:36:11 -0400, steve wrote: > < > *Bivalent Streams* < > A type of stream that can read and write both ‘character’ and < > ‘(unsigned-byte 8)’ values. > > How is that supposed to work, exactly? Is each stream item tagged in some > way to identify it as a “character” versus an “unsigned-byte 8”? I don't have any code at the moment - you could use 'base-char which includes (with-open-file (out "/home/steve/file.txt" :direction :output :element-type 'base-char :if-exists :overwrite) (write-string "this" out) (terpri out) (write out :stream out)) # CL-USER> File : this # hope this helps...