# New Ticket Created by  Sam S. 
# Please include the string:  [perl #132109]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org/Ticket/Display.html?id=132109 >


When calling `.skip` on a list which contains a `Slip` at the start, the 
resulting `Seq` behaves in some cases as if *all* elements from that 
`Slip` were skipped (instead of just the first one):

     say (<a b c>, <d e>).map(|*).skip.perl;        # ("d", "e").Seq
     say (<a b c>, <d e>).map(|*).skip.eager.perl;  # ("d", "e").Seq
     say (<a b c>, <d e>).map(|*).skip.eager.gist;  # (d e)
     say (<a b c>, <d e>).map(|*).skip.eager.join;  # de
     say (<a b c>, <d e>).map(|*).skip.cache.perl;  # ("d", "e")
     say (<a b c>, <d e>).map(|*).skip.cache.join;  # de
     say (<a b c>, <d e>).map(|*).skip.[*].gist;    # (d e)

But it depends on how the returned `Seq` is iterated. In the following 
cases it behaves correctly:

     say (<a b c>, <d e>).map(|*).skip.gist;               # (b c d e)
     say (<a b c>, <d e>).map(|*).skip.join;               # bcde
     say (<a b c>, <d e>).map(|*).skip.cache.gist;         # (b c d e)
     say (<a b c>, <d e>).map(|*).skip.[0..*].gist;        # (b c d e)
     say (<a b c>, <d e>).map(|*).skip.iterator.pull-one;  # b

It looks like¹ this bug has existed ever since the `.skip` method was 
implemented² in January 2017.

---
[1] https://gist.github.com/Whateverable/973c1b6cb09af28a2249b4ba33165885
[2] https://github.com/rakudo/rakudo/commit/8a6bfc6

---
This is Rakudo version 2017.08-156-ge6a695b27 built on MoarVM version 
2017.08.1-171-gcf95892e
implementing Perl 6.c.

Reply via email to