On Sun, Oct 23, 2022 at 5:29 AM Sven Schreiber
<sven.schreiber(a)fu-berlin.de> wrote:
Am 23.10.2022 um 00:23 schrieb Cottrell, Allin:
On Sat, Oct 22, 2022 at 6:08 PM Sven Schreiber
<sven.schreiber(a)fu-berlin.de> wrote:
Thanks, Allin, but after Artur's intervention it's not clear to me whether
"-=" is officially supported or not? And if it is (for which I'm not
pushing), would it remove all occurrences or just the first one?
Yes, it's officially supported (the relevant Guide chapter now
reflects this). But it only works for arrays of strings, and it
removes all occurrences from the array.
I've also documented the use of a negative index with arrays: this
works to remove an element from an array of any type, For example, one
can use
A = A[-2]
to remove the second element from array A.
Aha! So the natural follow-up question is: what about indexing vectors with this? Like
A[- {1,3}] ?
Yes, that works too.
Allin