From: lloda <lloda@sarc.name>
To: Maxime Devos <maximedevos@telenet.be>
Cc: guile-devel <guile-devel@gnu.org>
Subject: Re: [PATCH] New function array-mutable?
Date: Sat, 27 Nov 2021 09:42:49 +0100 [thread overview]
Message-ID: <0749BB80-9091-41C7-A003-7498C61EDA8C@sarc.name> (raw)
In-Reply-To: <367DEE5F-9FE4-457E-9B81-BB1605F1EDFF@sarc.name>
> On 25 Nov 2021, at 19:56, lloda <lloda@sarc.name> wrote:
>
>
>
>> On 25 Nov 2021, at 19:22, Maxime Devos <maximedevos@telenet.be> wrote:
>>
>> 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
>>
>> By this logic, shouldn't empty subarrays (*) with a possibly mutable
>> and non-empty root be considered mutable as well?
>>
>> (*) called ‘shared arrays’ in the manual
>>
>> Greetings,
>> Maxime
>
> That would make sense, I think.
>
> 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().
>
> Thanks
>
> 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.
prev parent reply other threads:[~2021-11-27 8:42 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-25 16:40 [PATCH] New function array-mutable? lloda
2021-11-25 18:19 ` Maxime Devos
2021-11-25 19:10 ` lloda
[not found] ` <97DC61EC-3DD4-444B-98DB-AB9A823EA1F3@sarc.name>
2021-12-09 20:34 ` Maxime Devos
2021-11-25 18:22 ` Maxime Devos
2021-11-25 18:56 ` lloda
2021-11-27 8:42 ` lloda [this message]
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=0749BB80-9091-41C7-A003-7498C61EDA8C@sarc.name \
--to=lloda@sarc.name \
--cc=guile-devel@gnu.org \
--cc=maximedevos@telenet.be \
/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).