bug-guile
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

make-shared-array and bitvectors


From: Ryan Moore
Subject: make-shared-array and bitvectors
Date: Wed, 01 Nov 2006 16:45:31 -0500

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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]