Skip to content

Instantly share code, notes, and snippets.

@uasi
Created December 12, 2010 12:30
Show Gist options
  • Save uasi/738009 to your computer and use it in GitHub Desktop.
Save uasi/738009 to your computer and use it in GitHub Desktop.
Fix RT #77668
diff --git a/src/Perl6/Actions.pm b/src/Perl6/Actions.pm
index 9e44a7b..2828b82 100644
--- a/src/Perl6/Actions.pm
+++ b/src/Perl6/Actions.pm
@@ -2547,8 +2547,13 @@ method postfixish($/) {
if $<postfix_prefix_meta_operator> {
my $past := $<OPER>.ast;
if $past && $past.isa(PAST::Op) && $past.pasttype() eq 'call' {
- $past.unshift($past.name());
- $past.name('!dispatch_dispatcher_parallel');
+ if ($past.name() eq '') {
+ $past.name('!dispatch_invocation_parallel');
+ }
+ else {
+ $past.unshift($past.name());
+ $past.name('!dispatch_dispatcher_parallel');
+ }
}
elsif $past && $past.isa(PAST::Op) && $past.pasttype() eq 'callmethod' {
$past.unshift($past.name());
diff --git a/src/glue/dispatch.pir b/src/glue/dispatch.pir
index 0f0c88b..29ec706 100644
--- a/src/glue/dispatch.pir
+++ b/src/glue/dispatch.pir
@@ -28,6 +28,33 @@ dispatcher for each thingy we're dispatching over.
.end
+=item !dispatch_invocation_parallel
+
+(TBD)
+
+=cut
+
+.sub '!dispatch_invocation_parallel'
+ .param pmc invocanty
+ .param pmc pos_args :slurpy
+ .param pmc named_args :slurpy :named
+
+ .local pmc it, results
+ results = new ['ResizablePMCArray']
+ invocanty = invocanty.'flat'()
+ it = iter invocanty
+ it_loop:
+ unless it goto it_loop_done
+ $P0 = shift it
+ $P0 = $P0(pos_args :flat, named_args :flat :named)
+ push results, $P0
+ goto it_loop
+ it_loop_done:
+
+ .tailcall '&infix:<,>'(results :flat)
+.end
+
+
=item !dispatch_method_parallel
Does a parallel method dispatch. Invokes the method for each thing in the
@uasi
Copy link
Author

uasi commented Dec 12, 2010

This could fix @array>>() thingy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment