guile-devel
[Top][All Lists]
Advanced

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

Re: bytevector-copy creates srfi-4 vector with greater length


From: Mark H Weaver
Subject: Re: bytevector-copy creates srfi-4 vector with greater length
Date: Mon, 27 Oct 2014 04:49:07 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux)

tantalum <address@hidden> writes:

> with guile version 2.1.0.89-c5ea7 on an x86_64 GNU/Linux system
> and the following code
>   (use-modules (srfi srfi-4) (rnrs bytevectors))
>   (define a (make-f32vector 2 0))
>   (define b (bytevector-copy a))
>   (write (list a b))
>
> "b" turns out to be an f32vector with length 8, 4 times the length of "a".
> i expected the result to have the same length as the argument and this
> looks like a bug to me

Yes, this is definitely a bug, introduced in 2009, commit
e286c973fcd63c0930d9302cc5f1a280b9b22615.

Can you please send an email to address@hidden about it, so that it
will be assigned a bug number and ticket?  That's the proper place to
send bug reports.

I'm not sure whether 'bytevector-copy' should produce a SRFI-4 vector
with the same element type as its argument, or if it should produce a
normal bytevector with 8-bit elements.  The argument for the latter
would be that 'bytevector-copy' is a standard procedure that portable
code might reasonably expect to produce bytevectors that print as
vectors of 8-bit bytes.  I don't see a compelling argument for the
former, other than to provide a convenient way to copy SRFI-4 vectors.

Thoughts?

       Mark



reply via email to

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