-
-
Save MasterDuke17/86c7c0e294a33e026a2d7d29cec3d9e8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/core/List.pm6 b/src/core/List.pm6 | |
index f098d294e..18b4bd7b6 100644 | |
--- a/src/core/List.pm6 | |
+++ b/src/core/List.pm6 | |
@@ -1492,10 +1492,51 @@ my class List does Iterable does Positional { # declared in BOOTSTRAP | |
# The , operator produces a List. | |
proto sub infix:<,>(|) is pure {*} | |
multi sub infix:<,>() { nqp::create(List) } | |
-multi sub infix:<,>(Int \a, Int \b) is default { | |
- nqp::p6bindattrinvres(nqp::create(List),List,'$!reified',nqp::list(a,b)) | |
+multi sub infix:<,>(Slip:D \a, Slip:D \b) { | |
+ nqp::stmts( | |
+ (my $reified := nqp::create(IterationBuffer)), | |
+ # now set up the List with a future | |
+ (my $list := | |
+ nqp::p6bindattrinvres(nqp::create(List),List,'$!reified',$reified)), | |
+ nqp::bindattr($list,List,'$!todo', | |
+ my $todo:= nqp::create(List::Reifier)), | |
+ nqp::bindattr($todo,List::Reifier,'$!reified',$reified), | |
+ nqp::bindattr($todo,List::Reifier,'$!future',nqp::list(a,b)), | |
+ nqp::bindattr($todo,List::Reifier,'$!reification-target',$reified), | |
+ $list | |
+ ) | |
+} | |
+multi sub infix:<,>(Any \a, Slip:D \b) { | |
+ nqp::stmts( # Slip seen, first copy non-slippy things | |
+ (my $reified := nqp::setelems(nqp::create(IterationBuffer),1)), | |
+ nqp::bindpos($reified,0,a), | |
+ # now set up the List with a future | |
+ (my $list := | |
+ nqp::p6bindattrinvres(nqp::create(List),List,'$!reified',$reified)), | |
+ nqp::bindattr($list,List,'$!todo', | |
+ my $todo:= nqp::create(List::Reifier)), | |
+ nqp::bindattr($todo,List::Reifier,'$!reified',$reified), | |
+ nqp::bindattr($todo,List::Reifier,'$!future',nqp::list(b)), | |
+ nqp::bindattr($todo,List::Reifier,'$!reification-target',$reified), | |
+ $list | |
+ ) | |
+} | |
+multi sub infix:<,>(Slip:D \a, Any \b) { | |
+ nqp::stmts( # Slip seen, first copy non-slippy things | |
+ (my $reified := nqp::setelems(nqp::create(IterationBuffer),1)), | |
+ nqp::bindpos($reified,1,b), | |
+ # now set up the List with a future | |
+ (my $list := | |
+ nqp::p6bindattrinvres(nqp::create(List),List,'$!reified',$reified)), | |
+ nqp::bindattr($list,List,'$!todo', | |
+ my $todo:= nqp::create(List::Reifier)), | |
+ nqp::bindattr($todo,List::Reifier,'$!reified',$reified), | |
+ nqp::bindattr($todo,List::Reifier,'$!future',nqp::list(a)), | |
+ nqp::bindattr($todo,List::Reifier,'$!reification-target',$reified), | |
+ $list | |
+ ) | |
} | |
-multi sub infix:<,>(Str \a, Str \b) { | |
+multi sub infix:<,>(Any \a, Any \b) { | |
nqp::p6bindattrinvres(nqp::create(List),List,'$!reified',nqp::list(a,b)) | |
} | |
multi sub infix:<,>(|) { |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment