From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: lloda Newsgroups: gmane.lisp.guile.devel Subject: Re: [PATCH] New function array-mutable? Date: Sat, 27 Nov 2021 09:42:49 +0100 Message-ID: <0749BB80-9091-41C7-A003-7498C61EDA8C@sarc.name> References: <32F75DE0-14DA-4B7F-B6A9-81462A847A30@sarc.name> <53901e95268fe40d7bb426851af6e9e9354d2376.camel@telenet.be> <367DEE5F-9FE4-457E-9B81-BB1605F1EDFF@sarc.name> Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.7\)) 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="4117"; mail-complaints-to="usenet@ciao.gmane.io" Cc: guile-devel To: Maxime Devos Original-X-From: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Sat Nov 27 09:43:43 2021 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 1mqtJ9-0000tp-3M for guile-devel@m.gmane-mx.org; Sat, 27 Nov 2021 09:43:43 +0100 Original-Received: from localhost ([::1]:42848 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mqtJ7-0002hZ-J8 for guile-devel@m.gmane-mx.org; Sat, 27 Nov 2021 03:43:41 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:33066) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mqtIb-0002g1-5j for guile-devel@gnu.org; Sat, 27 Nov 2021 03:43:09 -0500 Original-Received: from mta-13-4.privateemail.com ([198.54.127.109]:57087) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mqtIY-0002A8-PA for guile-devel@gnu.org; Sat, 27 Nov 2021 03:43:08 -0500 Original-Received: from mta-13.privateemail.com (localhost [127.0.0.1]) by mta-13.privateemail.com (Postfix) with ESMTP id AEA5E18000A8; Sat, 27 Nov 2021 03:42:52 -0500 (EST) Original-Received: from [192.168.1.105] (unknown [10.20.151.234]) by mta-13.privateemail.com (Postfix) with ESMTPA id 1DEE918000A2; Sat, 27 Nov 2021 03:42:51 -0500 (EST) In-Reply-To: <367DEE5F-9FE4-457E-9B81-BB1605F1EDFF@sarc.name> X-Mailer: Apple Mail (2.3608.120.23.2.7) X-Virus-Scanned: ClamAV using ClamSMTP Received-SPF: pass client-ip=198.54.127.109; envelope-from=lloda@sarc.name; helo=MTA-13-4.privateemail.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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" Xref: news.gmane.io gmane.lisp.guile.devel:20987 Archived-At: > On 25 Nov 2021, at 19:56, lloda wrote: >=20 >=20 >=20 >> On 25 Nov 2021, at 19:22, Maxime Devos = wrote: >>=20 >> lloda schreef op do 25-11-2021 om 17:40 [+0100]: >>> +Arrays with empty roots are not considered immutable because >>> +@code{array-set!} operations with valid indices won't fail (since >>> there >>> +are no valid indices). >>> + >>> +@example >>> +(array-mutable? #()) @result{} #t >>> +@end example >>> +@end deffn >>=20 >> By this logic, shouldn't empty subarrays (*) with a possibly mutable >> and non-empty root be considered mutable as well? >>=20 >> (*) called =E2=80=98shared arrays=E2=80=99 in the manual >>=20 >> Greetings, >> Maxime >=20 > That would make sense, I think. >=20 > The test in the patch is the same one that is used to validate = array_handle_xxx_writable_elements(), which looks only at the root and = not at the array dimensions. Those two tests should be the same, so I'll = have to change the test in array_handle_xxx_writable_elements(). >=20 > Thanks >=20 > Daniel Another option would be to rename the function to array-root-mutable?. = Then the condition would remain as is. This also makes sense because = mutability isn't a property of the array descriptor, rather it's a = property of the root.