Bug introduced in 10.3 and fixed in 10.4
--
Just checking whether anyone else can replicate this, or if it's a problem on my computer. The following refuses to execute on my machine, 10.3.1:
Take[{{1}}, All, {UpTo@3}]
It results in General::nomem
and Throw::sysexc
.
The behaviour seems to be for UpTo
[anything bigger than 3], but not for 2.
The intended behaviour would be for it to output {{}}
, analogously with
Take[{{1, 2, 3, 4}, {1, 2, 3, 4, 5}, {1}, {1, 2, 3}}, All, {UpTo@2}]
which outputs {{2}, {2}, {}, {2}}
.
UpTo[3]
does not have such a form. What are you trying to accomplish? This works:Take[{{1, 2, 3, 4, 5}}, All, {UpTo[3]}]
. $\endgroup$Take[{{1, 2, 3, 4}, {1, 2, 3, 4, 5}, {1}, {1, 2, 3}}, All, {UpTo@2}]
outputs{{2}, {2}, {}, {2}}
, for instance. I could just useTake[{{1}}, All, UpTo@3]
and trim down the lists as necessary, but this way was working for when I constructed my prototype using data that let me have 2 instead of 3. $\endgroup${UpTo[n]}
effectively means{UpTo[n], UpTo[n]}
and in a sequence specification{m1, m2}
only the second position allowsUpTo
. It would be confusing in the first position. $\endgroup$