Making a shared array out of a bit vector does not result in a bit
vector being returned when the shared array does not have as many
elements as the original:

(define somebits (make-bitvector 8 #f))
(define subbits (make-shared-array somebits (lambda (dim) (list dim))
4))
(define allsubbits (make-shared-array somebits (lambda (dim) (list dim))
8))

(bitvector? somebits) => #t
(bitvector? subbits) => #f
(bitvector? allsubbits) => #t

(display somebits) =>#*00000000
(display subbits) => #b(#f #f #f #f)
(display allsubbits) => #*00000000

The 1.8 manual states: "Bit vectors are are also generalized vectors,
See Generalized Vectors, and can thus be used with the array procedures,
See Arrays" but as we can see, array procedures do not work as expected
on bitvectors.  If this is expected behavior, I feel it should be
clarified. I would think that making a shared array out of a bitvector
would result in a bitvector after all...


Thanks,
Ryan Moore



_______________________________________________
Bug-guile mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-guile

Reply via email to