From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?utf-8?Q?Ludovic_Court=C3=A8s?= Newsgroups: gmane.lisp.guile.devel Subject: Re: [PATCH] Add 'bytevector-slice'. Date: Wed, 11 Jan 2023 18:34:12 +0100 Message-ID: <87358hkmaz.fsf@gnu.org> References: <20230111150015.10219-1-ludo@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4371"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) Cc: guile-devel@gnu.org, Andy Wingo To: Jean Abou Samra Original-X-From: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Wed Jan 11 18:34:43 2023 Return-path: Envelope-to: guile-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pFezq-0000mr-Lt for guile-devel@m.gmane-mx.org; Wed, 11 Jan 2023 18:34:42 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pFezY-0001R6-C1; Wed, 11 Jan 2023 12:34:25 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pFezQ-0001MM-CK for guile-devel@gnu.org; Wed, 11 Jan 2023 12:34:16 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pFezP-0002FI-6E; Wed, 11 Jan 2023 12:34:15 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=fFpCY5wm3u+EnRuAmPqMh0liiRqgezF9Dy9x0d6lJoA=; b=YtqwoLGHpo3IoULlVwVq +pGADfkg8gv2/6QjDHKLV5/BBFVLcjJphtptJEauznMtPKtxw0IRMpiMFLWp9mA+hHNCtZqxgMHU1 AEJv1N0+REMJHqw94/qBjEf8m8s88Ay9Ov/wGkOX/mnxNEzp5YoM+nwLuiONoXvDzCS7hIkVrz3W0 fQIsF9izWPvDBKa1G8vCTnnCi+12wuacruNFEceDF6AJck56ZZGCZwrexHPRWp0dhW8/q24OFveN4 1/wfsu3JCTlffJKFg/dKTM4jz2HB6i/dA4RNbc97czviIcWb7+qtlqg41fOqUL5Q0bUN2DrzK5pQn K3+umyzehbdYng==; Original-Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201] helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pFezO-0004KS-G5; Wed, 11 Jan 2023 12:34:14 -0500 X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: Duodi 22 =?utf-8?Q?Niv=C3=B4se?= an 231 de la =?utf-8?Q?R=C3=A9volution=2C?= jour du Sel X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu In-Reply-To: (Jean Abou Samra's message of "Wed, 11 Jan 2023 16:29:56 +0100") X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Original-Sender: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.lisp.guile.devel:21560 Archived-At: Hi, Jean Abou Samra skribis: > What do you think about making it more similar to substrings? > There the 'substring' procedure makes a copy-on-write substring, > and you have substring/shared if you really want shared mutation. > Would something like this be meaningful / feasible / useful > for bytevectors? I=E2=80=99m not convinced there=E2=80=99s a need for copy-on-write bytevect= ors, and it would be hard to implement, and to implement efficiently=E2=80=94bytevector-mutating instructions would have to check wh= ether they=E2=80=99re accessing a CoW bytevector and DTRT. What could be convenient though is =E2=80=98bytevector-copy=E2=80=99 (no ba= ng), which would combine =E2=80=98make-bytevector=E2=80=99 + =E2=80=98bytevector-copy!= =E2=80=99. Ludo=E2=80=99.