add a word to make a sequence from a byte-array by taking n bits at a time

db4
Doug Coleman 2009-06-03 21:21:51 -05:00
parent 175b03c134
commit b9100e5077
1 changed files with 6 additions and 0 deletions

View File

@ -158,3 +158,9 @@ M: msb0-bit-reader peek ( n bs -- bits ) \ be> \ subseq>bits-be (peek) ;
writer bytes>> swap push
] unless
writer bytes>> ;
:: byte-array-n>seq ( byte-array n -- seq )
byte-array length 8 * n / iota
byte-array <msb0-bit-reader> '[
drop n _ read
] { } map-as ;