Okay, if we install a workaround version of XX that only does two arrays (compliments of Gothmog++):
multi infix:<XX> (@a, @b) is equiv(&infix:<¥>) { @a.map: -> $a { @b.map: -> $b { ($a, $b) } } }
then the following seems to work in the devel version of pugs:
my @dir = map -> $i { [map {$i*$_}, 0..3] }, 1, 22, 21, 20; my @data = map { .comb, 0 }, @DATA; say max gather { for ^@data XX @dir { take int [*] @data[ $^base »+« $^offs ]; } }
The first two lines are unchanged. I used gather/take to let me use a for loop and get the inputs in front. The int suppresses the floating notation. The two parameters are passed using placeholder variables, which work as long as they're not nested inside internal braces. (They rely on "base" coming before "offs" in alphabetical order.) And I just used a slice to pull out the four values instead of another map. (Note also that the hyperoperator is still behaving under the old specs of dwimming both sides, but that actually won't work under the latest specs, which requires the quote to be reversed to get dwimmery on that side.) Oh, I also used the unary ^ to get a range from 0 up to the size of the array, which also helped because the XX doesn't quite parse with the correct precedence yet for some reason, so saying 0..^@data would have required extra parens in the current pugs.

In reply to Re^3: How to write this in Perl 6? by TimToady
in thread How to write this in Perl 6? by blazar

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.