Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix Seq already iterated issues with hyper ops
Have deepmap always return a List as the spec still requires. This should fix
several issues with already iterated Seq.
  • Loading branch information
niner committed Aug 22, 2015
1 parent 5c509b1 commit 185fc07
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/core/metaops.pm
Expand Up @@ -491,7 +491,7 @@ multi sub deepmap(\op, \obj) {
?? obj
!! obj.list;

Seq.new(class :: does SlippyIterator {
my \result := class :: does SlippyIterator {
has &!block;
has $!source;

Expand Down Expand Up @@ -552,7 +552,9 @@ multi sub deepmap(\op, \obj) {
$result
}
}
}.new(op, iterable.iterator));
}.new(op, iterable.iterator);

nqp::iscont(obj) ?? List.from-iterator(result).item !! List.from-iterator(result)
}

multi sub deepmap(\op, Associative \h) {
Expand Down

0 comments on commit 185fc07

Please sign in to comment.