Re: [PATCH] New function array-mutable?

2021-12-09 Thread Maxime Devos
Hi, lloda schreef op do 25-11-2021 om 20:08 [+0100]: I think literal arrays are always immutable, and one could base the test on that. > Is such a function useful in some other context? If one has an array which is already immutable, it can be referenced freely and copying it seems unnecessary.

Re: [PATCH] New function array-mutable?

2021-11-27 Thread lloda
> On 25 Nov 2021, at 19:56, lloda wrote: > > > >> On 25 Nov 2021, at 19:22, Maxime Devos 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

Re: [PATCH] New function array-mutable?

2021-11-25 Thread lloda
> On 25 Nov 2021, at 19:19, Maxime Devos wrote: > > lloda schreef op do 25-11-2021 om 17:40 [+0100]: >> [...] > > Suggestion: add a few tests to test-suite/tests/arrays.test: > > (pass-if-equal "new" > #t > (array-mutable? (make-array #f '(1 2) '(3 4 > > (pass-if-equal "empty

Re: [PATCH] New function array-mutable?

2021-11-25 Thread lloda
> On 25 Nov 2021, at 19:22, Maxime Devos 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 >>

Re: [PATCH] New function array-mutable?

2021-11-25 Thread Maxime Devos
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

Re: [PATCH] New function array-mutable?

2021-11-25 Thread Maxime Devos
lloda schreef op do 25-11-2021 om 17:40 [+0100]: > [...] Suggestion: add a few tests to test-suite/tests/arrays.test: (pass-if-equal "new" #t (array-mutable? (make-array #f '(1 2) '(3 4 (pass-if-equal "empty (two-dimensional)" #t (array-mutable? (array-copy #1( (pass-if-equal

[PATCH] New function array-mutable?

2021-11-25 Thread lloda
Doesn't seem there was any simple way to check this from either Scheme or C. 0001-New-function-array-mutable.patch Description: Binary data