Re: I wonder if I'm missing something...
"Tim Bradshaw (as tfb at tfeb dot org)" <[email protected]>
| Newsgroups | gmane.lisp.lispworks.general |
|---|---|
| Message-ID | <[email protected]> |
Here is a sketch (which I may have mentioned here previously) of how functionality could be added to CL which would enable fast I/O of, for instance, vectors of floats without destroying the language by allowing arbitrary type punning, and also dealing with things like ensuring things are written in defined byte orders. There would be objects called 'stream transducers' which describe how to read or write a type to a stream. These object can be made by ensure-stream-transducer: (ensure-stream-transducer <object type> <stream element type> [<format>]) <object type> is a type specifier. upgraded-array-element-type for it must not be T: in other words there must be a specialized array for this thing. <stream element type> is a type specifier for a valid stream element type. <format> specifies how the conversion should be done. There will probably be some standard ones which will probably be keyword symbols. If <format> is not given then the default stream transducer for the pair of type specifiers is returned, if there is one. ensure-transducer returns a suitable transducer, or NIL if there isn't one. read-sequence and write-sequence are extended to take optional stream transducer arguments. Note that there's a small finite number of distinct stream transducers. They have no mutable state, and may be symbols in fact. --tim > On 7 Nov 2025, at 17:44, Yuri Davidovsky (as work at disclosure dot ie) <[email protected]> wrote: > > Have you ever realised that there is absolutely no way in Common Lisp to read binary floats from disk? Has it ever occurred to you that Common Lisp has close to zero file system operation utilities? (we do have the Taj Mahal of pathnames to admire though. but why?). Have you noticed that Common Lisp does not have even a concept of sockets? Multithreading model? Do I need to say more, or does it hurt enough already? _______________________________________________ Lisp Hug - the mailing list for LispWorks users [email protected] http://www.lispworks.com/support/lisp-hug.html