Re: Bits from a stream
- From: "Alan Manuel K. Gloria" <almkglor@xxxxxxxxx>
- Date: 20 Mar 2006 06:18:53 -0800
Otherwise, your READ-BIT function is wrong. You've not proved it,That's weird. I've tried it. It seems to work....
it's clear, but did you even try it?
F:\LispTest>type foo.txt
7n
F:\LispTest>clisp
[1]> (load "bitstream.lisp")
;; Loading file bitstream.lisp ...
;; Loaded file bitstream.lisp
T
[2]> (setf f (open "foo.txt" :direction :input :element-type
'unsigned-byte))
#<INPUT BUFFERED FILE-STREAM (UNSIGNED-BYTE 8) #P"foo.txt">
[3]> (read-bit f)
1
[4]> (read-bit f)
1
[5]> (read-bit f)
1
[6]> (read-bit f)
0
[7]> (read-bit f)
1
[8]> (read-bit f)
1
[9]> (read-bit f)
0
[10]> (read-bit f)
0
[11]> (read-bit f)
0
[12]> (read-bit f)
1
[13]> (read-bit f)
1
[14]> (read-bit f)
1
[15]> (read-bit f)
0
[16]> (read-bit f)
1
[17]> (read-bit f)
1
[18]> (read-bit f)
0
7=>37h, 00110111
n=>6eh, 01101110
stream read (in sequence):
1 1 1 0 _ 1 1 0 0 _ 0 1 1 1 _ 0 1 1 0
which was exactly what I was expecting...
Hmm, lemme change test benches... (btw I've now followed your
recommendation and changed 'eq to '=)
.
- Follow-Ups:
- Re: Bits from a stream
- From: Pascal Bourguignon
- Re: Bits from a stream
- References:
- Bits from a stream
- From: Alan Manuel K. Gloria
- Re: Bits from a stream
- From: Zach Beane
- Re: Bits from a stream
- From: Peter Seibel
- Re: Bits from a stream
- From: Alan Manuel K. Gloria
- Bits from a stream
- Prev by Date: Re: Graphic-Forms screenshots
- Next by Date: Re: UI and CLISP
- Previous by thread: Re: Bits from a stream
- Next by thread: Re: Bits from a stream
- Index(es):
Relevant Pages
|