Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.lisp > #59552
| From | steve <sgonedes1977@gmail.com> |
|---|---|
| Newsgroups | comp.lang.lisp |
| Subject | Re: Synonym Streams |
| References | (2 earlier) <23FZrFyCKlaZfJP1R@bongo-ra.co> <20240219092306.348@kylheku.com> <867cj0qfbq.fsf_-_@williamsburg.bawden.org> <8734roez2s.fsf@gmail.com> <uvhtj1$3th0n$7@dont-email.me> |
| Date | 2024-04-19 13:44 -0400 |
| Message-ID | <87frvhl012.fsf@gmail.com> (permalink) |
Lawrence D'Oliveiro <ldo@nz.invalid> 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))
#<SB-SYS:FD-STREAM for "file /home/steve/file.txt" {1002E2A943}>
CL-USER>
File :
this
#<SB-SYS:FD-STREAM for "file /home/steve/file.txt" {1002E2A943}>
hope this helps...
Back to comp.lang.lisp | Previous | Next — Previous in thread | Next in thread | Find similar
CLHS on *DEBUG-IO* and others Spiros Bousbouras <spibou@gmail.com> - 2024-02-17 14:08 +0000
Re: CLHS on *DEBUG-IO* and others Kaz Kylheku <433-929-6894@kylheku.com> - 2024-02-17 16:34 +0000
Re: CLHS on *DEBUG-IO* and others Lawrence D'Oliveiro <ldo@nz.invalid> - 2024-02-18 22:06 +0000
Re: CLHS on *DEBUG-IO* and others Spiros Bousbouras <spibou@gmail.com> - 2024-02-19 12:09 +0000
Re: CLHS on *DEBUG-IO* and others Kaz Kylheku <433-929-6894@kylheku.com> - 2024-02-19 17:40 +0000
Synonym Streams Alan Bawden <alan@csail.mit.edu> - 2024-02-19 17:06 -0500
Re: Synonym Streams Spiros Bousbouras <spibou@gmail.com> - 2024-02-20 17:54 +0000
Re: Synonym Streams steve <sgonedes1977@gmail.com> - 2024-04-14 11:36 -0400
Re: Synonym Streams Alan Bawden <alan@csail.mit.edu> - 2024-04-14 18:49 -0400
Re: Synonym Streams Lawrence D'Oliveiro <ldo@nz.invalid> - 2024-04-15 00:49 +0000
Re: Synonym Streams steve <sgonedes1977@gmail.com> - 2024-04-19 13:44 -0400
Re: CLHS on *DEBUG-IO* and others Spiros Bousbouras <spibou@gmail.com> - 2024-02-20 17:47 +0000
Re: CLHS on *DEBUG-IO* and others Kaz Kylheku <433-929-6894@kylheku.com> - 2024-02-20 18:18 +0000
csiph-web