Created
July 9, 2013 19:01
-
-
Save jnthn/5960231 to your computer and use it in GitHub Desktop.
This file contains hidden or 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/Any.pm b/src/core/Any.pm | |
index 002309b..fb439ad 100644 | |
--- a/src/core/Any.pm | |
+++ b/src/core/Any.pm | |
@@ -48,6 +48,9 @@ my class Any { | |
my $list = (self,).flat.eager; | |
my Mu $rsa := nqp::list_s(); | |
$list.gimme(4); # force reification of at least 4 elements | |
+ unless $list.infinite { | |
+ nqp::setelems($rsa, nqp::unbox_i($list.elems)); | |
+ } | |
nqp::push_s($rsa, nqp::unbox_s($list.shift.Stringy)) | |
while $list.gimme(0); | |
nqp::push_s($rsa, '...') if $list.infinite; |
This file contains hidden or 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/Any.pm b/src/core/Any.pm | |
index 002309b..a43deeb 100644 | |
--- a/src/core/Any.pm | |
+++ b/src/core/Any.pm | |
@@ -48,8 +48,11 @@ my class Any { | |
my $list = (self,).flat.eager; | |
my Mu $rsa := nqp::list_s(); | |
$list.gimme(4); # force reification of at least 4 elements | |
- nqp::push_s($rsa, nqp::unbox_s($list.shift.Stringy)) | |
- while $list.gimme(0); | |
+ my $tmp; | |
+ while $list.gimme(0) { | |
+ $tmp := $list.shift; | |
+ nqp::push_s($rsa, nqp::unbox_s(nqp::istype($tmp, Str) ?? $tmp !! $tmp.Str)) | |
+ } | |
nqp::push_s($rsa, '...') if $list.infinite; | |
nqp::p6box_s(nqp::join(nqp::unbox_s($separator.Stringy), $rsa)) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment