unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: tantalum <sph@posteo.eu>
To: taylanbayirli@gmail.com
Cc: Mark H Weaver <mhw@netris.org>, guile-devel@gnu.org
Subject: Re: bytevector-copy creates srfi-4 vector with greater length
Date: Mon, 27 Oct 2014 13:36:06 +0100	[thread overview]
Message-ID: <a92aecce31dd6f4e085d1a933a303ae4@posteo.de> (raw)
In-Reply-To: <87lho1bwwe.fsf@taylan.uni.cx>

from the explanations in the manual i interpret the definition of the 
srfi-4 compatibility to be "can work on srfi-4 vectors because the 
storage is the same, even though it regards the data as 8-bit values"
i looked at the code and it seems to work just like this for the read 
and write part of the copy. for the creation part it uses 
make-bytevector with the input type copied in a generic way - i think 
this is sound so far because it does not include any special cases for 
working with srfi-4 types.
the main problem may be that SCM_BYTEVECTOR_LENGTH returns the wrong 
length - that it does not follow 8-bit interpretation
if bytevector-copy would have a input/output type discrepancy, then the 
general bytevector/srfi-4 compatibility as i understand it would be in 
question - read supported, but not create or write.

bytevector-copy! has the same issues

On 27.10.2014 12:00, taylanbayirli@gmail.com wrote:
> Mark H Weaver <mhw@netris.org> writes:
> 
>> Thoughts?
> 
> I have no experience with SRFI-4 so don't know what would be most
> pragmatic, but reading the specification, I see s8vector, u8vector,
> s16vector, etc. are all distinct data types, though u8vector 
> corresponds
> to u8vector from SRFI-66, bytevectors from R6RS, and bytevectors from
> R7RS.  Thus I would expect those four to be the same data type, and
> distinct from the other SRFI-4 types.  Correspondingly, I'd expect the
> SRFI-4/66 u8vector and R6/7RS bytevector APIs all to work on that type
> and only that type.  Other types from SRFI-4 should have their 
> dedicated
> APIs, including a copy procedure.
> 
> That seems like the relatively obvious Right Way to me, unless I'm
> missing something.
> 
> If useful, there could be a separate API of procedures that work on 
> both
> u8vector (i.e. bytevector) and other SRFI-4 data types, but otherwise
> I'm of the opinion that any distinct data type exposed to Scheme users
> should also have its dedicated API that works on no other types.
> 
> Taylan



  reply	other threads:[~2014-10-27 12:36 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-26 14:49 bytevector-copy creates srfi-4 vector with greater length tantalum
2014-10-27  8:49 ` Mark H Weaver
2014-10-27 11:00   ` Taylan Ulrich Bayırlı/Kammer
2014-10-27 12:36     ` tantalum [this message]
2014-11-12  6:15   ` Mark H Weaver

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a92aecce31dd6f4e085d1a933a303ae4@posteo.de \
    --to=sph@posteo.eu \
    --cc=guile-devel@gnu.org \
    --cc=mhw@netris.org \
    --cc=taylanbayirli@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).