Look at this list
list={1,2,3,4}
Obiously
list[[1, 2]]
throws the error:
During evaluation of Part::partd: Part specification {1,2,3,4}[[1,2]] is longer than depth of object.
However:
list[[1,All]]
yields (Mathematica 12 on Windows)
Integer[]
which does not make much sense to me. Moreover, weird constructs like
list[[All,All,All,All,All]]
do not throw an error.
Can this (at least to me) strange behaviour of the basic command Part[]
be explained? (Needless to say, that this is just a simple demonstration of the effect, but it occured during execution a larger program with strange consequences.)
EDIT: I just realized that this question is closely related to mine and adds some more aspects to it.
list[[1, 0]]
. $\endgroup$Span
: Considere[[1 ;; -1]]
ande[[2 ;; -1]]
, withe
being1
,f[]
, andf[1]
. $\endgroup$