Skip to content

Instantly share code, notes, and snippets.

@skids
Created August 20, 2015 18:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save skids/11e5cf9935e48f2a4cb9 to your computer and use it in GitHub Desktop.
Save skids/11e5cf9935e48f2a4cb9 to your computer and use it in GitHub Desktop.
metaop fix
ok 364 - RT #99942
ok 365 - reduce with X
1..2
ok 1 - '[leg] <a b c>' died
ok 2 - right exception type (X::Syntax::CannotMeta)
ok 366 - non-associative operator "[leg]" can not be used as reduction operator
ok 367 - does [:a] parse ok and give the right value
ok 368 - does [:a,] parse ok and give the right value
ok 369 - does [:!a] parse ok and give the right value
# Looks like you failed 7 tests of 369
$ perl6 --ll-exception -e 'say ([X~] <a b>, <a b>, <a b>);'
aaa aab aba abb baa bab bba bbb
$ git diff
diff --git a/src/core/metaops.pm b/src/core/metaops.pm
index 22d9c5a..7916ed6 100644
--- a/src/core/metaops.pm
+++ b/src/core/metaops.pm
@@ -51,7 +51,7 @@ sub METAOP_CROSS(\op, &reduce) {
my Mu $o := nqp::atpos($sublist, $j);
@v[$i] := $o;
$j = $j + 1;
- if $i >= $n { take $rop(|@v); }
+ if $i >= $n { take lol.elems == 2 ?? $rop(|@v) !! $rop(@v); }
else { $i = $i + 1; @j.push($j); $j = 0; }
}
elsif (my \value = @loi[$i].pull-one) !=:= IterationEnd {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment