Skip to content
Permalink
Browse files

Make .head/.tail take Cool correctly

Fixes R#2862
  • Loading branch information...
lizmat committed Apr 27, 2019
1 parent 84144c7 commit 74c8f0442b7ff4d1f55b407beedccbcf588d1c67
Showing with 12 additions and 6 deletions.
  1. +1 −1 src/core/List.pm6
  2. +11 −5 src/core/Rakudo/Iterator.pm6
@@ -1482,7 +1482,7 @@ my class List does Iterable does Positional { # declared in BOOTSTRAP
),
nqp::unless(
nqp::istype($n,Whatever) || $n == Inf,
$iterator.skip-at-least(nqp::elems($!reified) - $n)
$iterator.skip-at-least(nqp::elems($!reified) - $n.Int)
)
),
$iterator
@@ -2354,11 +2354,17 @@ class Rakudo::Iterator {
times <= 0, # must be HLL comparison
Rakudo::Iterator.Empty, # negative is just nothing
nqp::if(
(nqp::istype(times,Int)
&& nqp::isbig_I(nqp::decont(times)))
|| times == Inf,
iterator, # big value = itself
nqp::create(self)!SET-SELF(iterator,times)
nqp::istype(times,Int),
nqp::if(
nqp::isbig_I(nqp::decont(times)),
iterator, # big value = itself
nqp::create(self)!SET-SELF(iterator,times)
),
nqp::if(
times == Inf, # big value = itself
iterator,
nqp::create(self)!SET-SELF(iterator,times.Int)
)
)
)
)

0 comments on commit 74c8f04

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