On Tue, 18 Jul 2017 07:45:16 -0700, joshu...@gmail.com wrote:
> My thinking is that doing `[X] ((3,2),)` is kinda like doing `[X] 
> ((3,2),Empty)`...

Assuming I understand your analogy correctly, that's exactly what's *not* 
happening, and is why this RT exists. See:

    dd [X] 3, 2;       # ((3, 2),).Seq
    dd [X] (3, 2);     # ((3, 2),).Seq
    dd [X] ((3, 2),);  # ((3, 2),).Seq

The first two are unsurprising, but note how the third one is *also* being 
treated as the Cartesian product between the two sets `3` and `2`, rather than 
the single set `(3, 2)`.

Also, scenarios where the argument list to `[X]` or `[Z]` is fixed-sized (like 
in these examples), isn't what is tripping people up (because there's no reason 
to write that in the single-sublist case anyway). The problem is with crossing 
or zipping a variable-sized list of lists, like in `my @transpose = [Z] 
@matrix;`, which works fine for most inputs but breaks down for the "@matrix 
has exactly one row" edge-case. I've explained why this is happening and why it 
ruins people's day in this docs ticket: [1], and this StackOverflow answer: [2].

---
[1] https://github.com/perl6/doc/issues/1400
[2] 
https://stackoverflow.com/questions/44821983/recursive-generator-manual-zip-vs-operator/44831926#44831926

Reply via email to