Am 20.05.2022 um 23:25 schrieb Cottrell, Allin:
On Fri, May 20, 2022 at 9:03 AM Sven Schreiber
<svetosch(a)gmx.net> wrote:
>
> I'm stumbling over the following behavior, which I can't rationalize. In
> short, using an indexing vector to pick certain elements of a list works
> with {1,2}, but fails with {1,3}. (Yes, the list has three elements as
> printed out by the example code.)
>
> Or is indexing into a list not really supported but only working by
> chance sometimes?
>
> <hansl>
> open denmark
> list L = LRM LRY IBO
> list L print
> list temp = L[{1,2}] # works
> list temp print
> temp = L[{1,3}] # fails
> list temp print
> </hansl>
Indexation into a list via a selection vector is not supported, It's
working by chance when the indexation vector {1,2} collapses to the
simple range specifier [1:2]. A simple range specifier is supported.
OK, thanks. It wasn't clear to me that a range 1:2 could also be
expressed as {1,2} in this context.
cheers
sven