> On 22 Dec 2022, at 09:58, Sascha Ziemann wrote:
>
>>> (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
> > (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))
This seems to be the same (equal?):
(make-shared-array bv
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
> 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 (m
On Sun, Dec 18, 2022 at 11:45:49PM +0100, Sascha Ziemann wrote:
> Maybe having a bytevector-slice-ref with shared memory would be more flexible.
> The partial usage of a bytevector as a string is just one use case.
> There may be others.
Is that related to "shared arrays"? This seems to be even mo
Maybe having a bytevector-slice-ref with shared memory would be more flexible.
The partial usage of a bytevector as a string is just one use case.
There may be others.
On 12/18/22 4:12 AM, Sascha Ziemann wrote:
I am wondering if something like bytevector-string-ref is missing in the API.
Or is there any other way to extract a string from a byte vector, without
copying the data twice?
I sympathize with the struggle here. I wonder if rlb is aware.
I believe
The 2 copies occur if you want a portion of the bytevector to be
converted to a string. The current API requires you to copy to a
bytevector that's the length of the slice, and then convert that copy to
a string.
I've sent patches to guile-devel to address this issue (by extending
utf{8,16,32}->st
On Sun, Dec 18, 2022 at 05:25:16PM +0100, Taylan Kammer wrote:
> On 18.12.2022 13:12, Sascha Ziemann wrote:
> > I am wondering if something like bytevector-string-ref is missing in the
> > API.
> > Or is there any other way to extract a string from a byte vector, without
> > copying the data twice
On 18.12.2022 13:12, Sascha Ziemann wrote:
> I am wondering if something like bytevector-string-ref is missing in the API.
> Or is there any other way to extract a string from a byte vector, without
> copying the data twice?
>
I don't think Guile currently has any way of giving you a string objec
On Sun, Dec 18, 2022 at 01:12:57PM +0100, Sascha Ziemann wrote:
> I am wondering if something like bytevector-string-ref is missing in the API.
> Or is there any other way to extract a string from a byte vector, without
> copying the data twice?
Alas, it's more complicated than this. There's a who
11 matches
Mail list logo