unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: tomas@tuxteam.de
To: Sascha Ziemann <ceving@gmail.com>
Cc: guile-user@gnu.org
Subject: Re: bytevector-string-ref
Date: Thu, 22 Dec 2022 06:34:53 +0100	[thread overview]
Message-ID: <Y6PsfblwZht7odfC@tuxteam.de> (raw)
In-Reply-To: <CAGUt3y4SzQe7hcReOP3qckTq3323G6uGcuZime=t9b8SjC1asw@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 650 bytes --]

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 #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

  reply	other threads:[~2022-12-22  5:34 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-18 12:12 bytevector-string-ref Sascha Ziemann
2022-12-18 13:19 ` bytevector-string-ref tomas
2022-12-18 16:25 ` bytevector-string-ref Taylan Kammer
2022-12-18 16:35   ` bytevector-string-ref Vijay Marupudi
2022-12-18 16:38   ` bytevector-string-ref tomas
2022-12-18 21:17 ` bytevector-string-ref Matt Wette
2022-12-18 22:45   ` bytevector-string-ref Sascha Ziemann
2022-12-19  5:01     ` bytevector-string-ref tomas
2022-12-21 15:49       ` bytevector-string-ref Sascha Ziemann
2022-12-22  5:34         ` tomas [this message]
2022-12-22  8:58           ` bytevector-string-ref Sascha Ziemann
2022-12-22 12:24             ` bytevector-string-ref lloda

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=Y6PsfblwZht7odfC@tuxteam.de \
    --to=tomas@tuxteam.de \
    --cc=ceving@gmail.com \
    --cc=guile-user@gnu.org \
    /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).