On 21 Feb 2017, at 14:21, Diogo F. S. Ramos <d...@riseup.net> wrote:
> I want to take the length of a shared array, but `bytevector-length' > throws an error claiming the shared array isn't a bytevector, even > though it prints the error argument as one. > > --8<---------------cut here---------------start------------->8--- > scheme@(guile-user)> ,use (rnrs bytevectors) > scheme@(guile-user)> (bytevector-length > (make-shared-array (make-bytevector 42) > list > 7)) > ERROR: In procedure bytevector-length: > ERROR: In procedure scm_c_bytevector_length: Wrong type argument in position > 1 (expecting bytevector): #vu8(0 0 0 0 0 0 0) > > Entering a new prompt. Type `,bt' for a backtrace or `,q' to continue. > scheme@(guile-user) [1]> > --8<---------------cut here---------------end--------------->8--- > > I am using Guile 2.0.11, Debian Stable package 2.0.11+1-9. > This is addressed in 2.1, by eb3d623da57e6d31a58d95f932345fb761f9b701. Your example will print #1vu8(0 0 ...) to signify that it's not a bytevector. You can use array-length here. I suppose the patch could be applied to 2.0.