I try to pass an xx re-array to the reduction function [X ~], but find that the array is smoothed. I searched for online docs and stack overflows but didn't find anything. Unfortunately, my knowledge of Perl 6 is rather rudimentary (although I know Perl 5 well).
[X~](<1 2>, <1 2>) # 11 12 21 22 (WHAT I WANT)
[X~](<1 2> xx 2) # 1 2 1 2 (NOT WHAT I WANT)
[X~](<1 2> xx 2).tree # 1 2 1 2
[X~](<1 2>.tree xx 2) # 1 2 1 2
Looking at .perl dumps, I don’t have much coverage:
(<1 2>, <1 2>).perl # (("1", "2"), ("1", "2"))
(<1 2> xx 2).perl # (("1", "2"), ("1", "2")).list
(<1 2> xx 2).tree.perl # ("1", "2"; "1", "2").item
I am using rakudo-star-2014.12.1-parrot.msi.
source
share