Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Force .join to reify at least 4 elements of a list (if available).
This should help with infinite lists that currently produce "..."
-- now it will at least produce the first four elements of such a list.
  • Loading branch information
pmichaud committed Apr 9, 2012
1 parent 5f7a220 commit 3bd91f5
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/core/Any.pm
Expand Up @@ -44,6 +44,7 @@ my class Any {
method join($separator = '') {
my $list = (self,).flat.eager;
my Mu $rsa := pir::new__Ps('ResizableStringArray');
$list.gimme(4); # force reification of at least 4 elements
nqp::push_s($rsa, nqp::unbox_s($list.shift.Stringy))
while $list.gimme(0);
nqp::push_s($rsa, '...') if $list.infinite;
Expand Down

0 comments on commit 3bd91f5

Please sign in to comment.