Hi,
Just for curiosity, why is READ-BYTE-NO-HANG not included in the
Common Lisp standardization process, while there exists READ-CHAR-NO-
HANG?
Regards.
Volkan YAZICI <·············@gmail.com> writes:
> Just for curiosity, why is READ-BYTE-NO-HANG not included in the
> Common Lisp standardization process, while there exists READ-CHAR-NO-
> HANG?
My hypothesis is that you didn't read binary data interactively, so it didn't make sense.
Of course, nowadays, user interaction is often mediated by a "browser"
that can communicate with the program thru a binary stream, so we
would need it. But twenty years ago, I guess it would have seemed a
strange idea. Until a few years later when Tim invented HTTP, in
1990.
--
__Pascal Bourguignon__
On Wed, 05 Nov 2008 14:06:39 +0100, ···@informatimago.com (Pascal J.
Bourguignon) wrote:
>Volkan YAZICI <·············@gmail.com> writes:
>> Just for curiosity, why is READ-BYTE-NO-HANG not included in the
>> Common Lisp standardization process, while there exists READ-CHAR-NO-
>> HANG?
>
>My hypothesis is that you didn't read binary data interactively,
>so it didn't make sense.
But binary data could come through a network which was certainly
"interactive" in the sense of incomplete transmissions.
>Of course, nowadays, user interaction is often mediated by a "browser"
>that can communicate with the program thru a binary stream, so we
>would need it. But twenty years ago, I guess it would have seemed a
>strange idea. Until a few years later when Tim invented HTTP, in
>1990.
Arcnet and Ethernet both existed in 1980 ... not to mention HPIB and a
number of proprietary serial cable networks. Many universities and
even some high schools had, at least, small networks within their
computer labs.
I get that there were no protocol standards around which to base CL
primitives, but I would have thought that the need for non-blocking
binary I/O should have been foreseen.
George
On Nov 5, 9:17 pm, Volkan YAZICI <·············@gmail.com> wrote:
> Hi,
>
> Just for curiosity, why is READ-BYTE-NO-HANG not included in the
> Common Lisp standardization process, while there exists READ-CHAR-NO-
> HANG?
>
> Regards.
This does seem like an obvious omission. Perhaps there was little
demand, or perhaps a character stream with an one-to-one 8-bit coding
could be used.
The Scieneer Common Lisp implementation has a good range of byte
stream extensions to parallel the standard character stream functions:
ext:read-byte-no-hang, see http://www.scieneer.com/scl/doc/function/ext/read-byte-no-hang.html
ext:peek-byte, see http://www.scieneer.com/scl/doc/function/ext/peek-byte.html
ext:unread-byte, see http://www.scieneer.com/scl/doc/function/ext/unread-byte.html
ext:make-byte-input-stream, see http://www.scieneer.com/scl/doc/function/ext/make-byte-input-stream.html
ext:make-byte-output-stream, see http://www.scieneer.com/scl/doc/function/ext/make-byte-output-stream.html
ext:with-input-from-bytes, see http://www.scieneer.com/scl/doc/function/ext/with-input-from-bytes.html
ext:with-output-to-bytes, see http://www.scieneer.com/scl/doc/function/ext/with-output-to-bytes.html
ext:get-output-stream-bytes, see http://www.scieneer.com/scl/doc/function/ext/get-output-stream-bytes.html
Regards
Douglas Crosher