guile-user
[Top][All Lists]
Advanced

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

Re: bytevector-string-ref


From: tomas
Subject: Re: bytevector-string-ref
Date: Thu, 22 Dec 2022 06:34:53 +0100

On Wed, Dec 21, 2022 at 04:49:09PM +0100, Sascha Ziemann wrote:
> > Is that related to "shared arrays"? This seems to be even more general (the
> > affine part being the offset of the slice).
> 
> Thanks for the hint. I was not aware of them.
> 
> But I am struggling to use them. This does not work:
> 
> (define str "Hello, World!")
> (define bv (string->utf8 str))
> (define sa (make-shared-array bv (lambda (i) (list (+ i 7))) '(0 4)))

I think this should be

  (define sa (make-shared-array bv (lambda (i) (list (+ i 7))) 4))

since you have a one-dimensional vector. But perhaps I mis-read
your intentions.

Cheers
-- 
t

Attachment: signature.asc
Description: PGP signature


reply via email to

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