Re: I wonder if I'm missing something...
"David McClain (as dbm at refined-audiometrics dot com)" <[email protected]>
| Newsgroups | gmane.lisp.lispworks.general |
|---|---|
| Message-ID | <[email protected]> |
Okay, I built my own wrapper called ADAPTER-STREAM around the network Socket stream. And I wrote my own STREAM:STREAM-READ-SEQUENCE specialized to the ADAPTER-STREAM. It works. But it still moves data that really shouldn’t need to be moved. I just moved the Simon FLI code to the inside of the new STREAM:STREAM-READ-SEQUENCE code. From high level LW what is needed is for SYS:TYPED-AREF vectors to be read into by unsigned byte streams. That can’t happen because the element type of these special vectors is DOUBLE-FLOAT. And you can’t substitute your own ‘(UNSIGNED-BYTE 8) vector for use in SYS:TYPED-AREF - it knows you are trying to cheat. And even if we could pull this off in LW, there is probably no way to port that over to SBCL. But that is of secondary concern to me. > On Nov 8, 2025, at 10:28, David McClain (as dbm at refined-audiometrics dot com) <[email protected]> wrote: > > I just tried building my own READ-SEQUENCE in LW. You can’t really do that because READ-SEQUENCE is a DEFUN. > > But you can define your own Method for STREAM:STREAM-READ-SEQUENCE. And that does what I need. > > > >> On Nov 8, 2025, at 10:21, Marco Antoniotti (as marco dot antoniotti at unimib dot it) <[email protected]> wrote: >> >> >> >> On Sat, Nov 8, 2025 at 6:15 PM David McClain <[email protected] <mailto:[email protected]>> wrote: >>> Meanwhile, I see that it is now possible to implement the ideas that you stated about Stream Adapters. >>> >>> I thought you were just musing about extensions that you would like to see added to Lisp. I didn’t realize that we could implement our own READ-SEQUENCE until now. >> >> You can with SBCL because most sequence functions are somewhat generic (I do not have much experience using them). Not sure about LW, or the ANSI. >> >> I am curious about how you'd do it in LW (even portably to, say, ECL) >> >> Cheers >> >> Marco >> >> >