Skip to content
Permalink
Browse files

Give List/Slip both special handling in @A >>+>> 42

Anything else will have to go through Foo.new(...), which may involve a
slowdown for Array's.  But I intend to give these special handling anyway,
so that should be ok for now.  Fixes R#2842.
  • Loading branch information...
lizmat committed Nov 11, 2018
1 parent a11d599 commit 78f642039f157c159481b9250105cd6fc08b3ade
Showing with 12 additions and 12 deletions.
  1. +12 −12 src/core/Hyper.pm6
@@ -91,12 +91,12 @@ class Hyper {
nqp::push(values, self.infix(value,right))
);

my \result := nqp::p6bindattrinvres(
nqp::create(List), List, '$!reified', values
);
nqp::bind(result,nqp::clone(left).STORE(result))
if nqp::istype(left.WHAT,List) # a subtype of List
&& nqp::not_i(nqp::eqaddr(left.WHAT,List));
my \result := nqp::eqaddr(left.WHAT,List)
|| nqp::eqaddr(left.WHAT,Slip)
?? nqp::p6bindattrinvres(nqp::create(left),List,'$!reified',values)
!! left.WHAT.new(
nqp::p6bindattrinvres(nqp::create(List),List,'$!reified',values)
);
nqp::iscont(left) ?? result.item !! result
}

@@ -121,12 +121,12 @@ class Hyper {
nqp::push(values, self.infix(left,value))
);

my \result := nqp::p6bindattrinvres(
nqp::create(List), List, '$!reified', values
);
nqp::bind(result,nqp::clone(right).STORE(result))
if nqp::istype(right.WHAT,List) # a subtype of List
&& nqp::not_i(nqp::eqaddr(right.WHAT,List));
my \result := nqp::eqaddr(right.WHAT,List)
|| nqp::eqaddr(right.WHAT,Slip)
?? nqp::p6bindattrinvres(nqp::create(right),List,'$!reified',values)
!! right.WHAT.new(
nqp::p6bindattrinvres(nqp::create(List),List,'$!reified',values)
);
nqp::iscont(right) ?? result.item !! result
}

0 comments on commit 78f6420

Please sign in to comment.
You can’t perform that action at this time.