Open Rhialto opened 8 years ago
Array flattening changed in the run-up to version 6.3 and that POD is out of date.
Variables with the @ sigil only autoflatten when they are being bound by a slurpy parameter. Everywhere else, if you want them flattened you have to use the flat
operator.
I don't know enough to comment on the [[[1 2]]] issue.
rakudo-star-2016.04/share/perl6/doc/Language/syntax.pod says
However, I do get 3 instead of 4. In fact, it doesn't flatten:
On the other hand, these two give the same output ?!?!?!?!
It seems that the comments "flattens" and "does not flatten" above are reversed. And the defining sentence above it seems to be reversed too. Somewhat. It is rather confusing to determine what it meant.
In fact, any attempt to put
@a
into a list, no matter in how many lists I try to nest it, fails:And note the following weird effect, where the flattening of the itemized array (that seems to be what it is)
[1,2]
, depends on what other things are in the containing array:So, how does one create
[[[1 2]]]
from@a
, or from an Array literal?