Subject: [clisp-list] read-byte and *standard-input*

From: Thibault Langlois <[email-masked]>
Date: Wed May 14 07:41:07 2003

Hello,

I have not solved my problem yet ...

From your post:
http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&frame=right&th=fb294bfa180cf2f6&seekm=1fff13b3.0305020803.3e8f554f%40posting.google.com#link8

I understood that if I upgrade from clisp-2.27 to clisp-2.30 I would be
able to change the element type of *standard-input* to unsigned byte.
I compiled the last version of clisp on the system (which happens to be
a very old RH6.1 but I cannot change that) and I still have an error 
when trying to change the element-type of the input stream:

$ clisp -norc -q -x "(progn (print (lisp-implementation-version)) (setf
(stream-element-type *standard-input*) '(unsigned-byte 8)))"

"2.30 (released 2002-09-15) (built 3261851213) (memory 3261852080)" 
*** - (SETF STREAM-ELEMENT-TYPE) on #<INPUT STRING-INPUT-STREAM> is
illegal

I must be doing something wrong.

Any help is much apreciated.

Thibault

-- 
Thibault Langlois <[email-masked]>

---

From: Sam Steingold <[email-masked]>
Date: Wed May 14 08:03:02 2003

> * In message <[email-masked]>
> * On the subject of "[clisp-list] read-byte and *standard-input*"
> * Sent on 14 May 2003 15:38:15 +0100
> * Honorable Thibault Langlois <[email-masked]> writes:
>

$ cat bin-stdio.lisp 
(progn
  (format t "~s=~s~%" '*standard-input* *standard-input*)
  (setf (stream-element-type *standard-input*) '(unsigned-byte 8))
  (format t "~s=~s~%" '*standard-input* *standard-input*)
  (setq buf (make-array 5 :element-type '(unsigned-byte)))
  (format t "read ~:d bytes:~%~s=~s~%" (read-sequence buf *standard-input*)
          buf (convert-string-from-bytes buf charset:utf-8))
  (quit))
123456789
$ ./clisp -q -norc < ../../bugs/bin-stdio.lisp  
*STANDARD-INPUT*=#<INPUT BUFFERED FILE-STREAM CHARACTER #P"/dev/fd/0" @8>
*STANDARD-INPUT*=#<INPUT BUFFERED FILE-STREAM (UNSIGNED-BYTE 8) #P"/dev/fd/0">
read 5 bytes:
#(10 49 50 51 52)=
"
1234"
$

-- 
Sam Steingold (http://www.podval.org/~sds) running RedHat9 GNU/Linux
<http://www.camera.org> <http://www.iris.org.il> <http://www.memri.org/>
<http://www.mideasttruth.com/> <http://www.palestine-central.com/links.html>
Modern man is the missing link between apes and human beings.