[perl #131617] [BUG] Any.tail(Callable) violates Iterator protocol

2018-02-09 Thread Zoffix Znet via RT
On Wed, 21 Jun 2017 11:46:46 -0700, c...@zoffix.com wrote:
> The "Died" message should never occur:
> 
> m: my $s = Seq.new: class :: does Iterator { has @!stuff = ;
> has $!ded = 1; method pull-one { $!ded or die; @!stuff ?? shift
> @!stuff !! $!ded-- && IterationEnd } }.new; say $s.tail: *-10
> rakudo-moar 86e7b2: OUTPUT: «Died␤  in method pull-one at  line
> 1␤  in block  at  line 1␤␤»
> 
> Looks like a check that .skip-at-least was successful is missing[^1].
> 
> [1]
> https://github.com/rakudo/rakudo/blob/86e7b2bd25ed62ecd93d83a49b6e2cbfeeb1c24c/src/core/Any-
> iterable-methods.pm#L1889-L1890
> [2]
> https://github.com/rakudo/rakudo/blob/86e7b2bd25ed62ecd93d83a49b6e2cbfeeb1c24c/src/core/List.pm#L1289-
> L1298


Thank you for the report. This is now fixed.

Fix:  https://github.com/rakudo/rakudo/commit/2cc7b6317e98592
Test: https://github.com/perl6/roast/commit/3e60598fea0d92307


[perl #131617] [BUG] Any.tail(Callable) violates Iterator protocol

2018-02-09 Thread Zoffix Znet via RT
On Wed, 21 Jun 2017 11:46:46 -0700, c...@zoffix.com wrote:
> The "Died" message should never occur:
> 
> m: my $s = Seq.new: class :: does Iterator { has @!stuff = ;
> has $!ded = 1; method pull-one { $!ded or die; @!stuff ?? shift
> @!stuff !! $!ded-- && IterationEnd } }.new; say $s.tail: *-10
> rakudo-moar 86e7b2: OUTPUT: «Died␤  in method pull-one at  line
> 1␤  in block  at  line 1␤␤»
> 
> Looks like a check that .skip-at-least was successful is missing[^1].
> 
> [1]
> https://github.com/rakudo/rakudo/blob/86e7b2bd25ed62ecd93d83a49b6e2cbfeeb1c24c/src/core/Any-
> iterable-methods.pm#L1889-L1890
> [2]
> https://github.com/rakudo/rakudo/blob/86e7b2bd25ed62ecd93d83a49b6e2cbfeeb1c24c/src/core/List.pm#L1289-
> L1298


Thank you for the report. This is now fixed.

Fix:  https://github.com/rakudo/rakudo/commit/2cc7b6317e98592
Test: https://github.com/perl6/roast/commit/3e60598fea0d92307


[perl #131617] [BUG] Any.tail(Callable) violates Iterator protocol

2017-06-21 Thread via RT
# New Ticket Created by  Zoffix Znet 
# Please include the string:  [perl #131617]
# in the subject line of all future correspondence about this issue. 
# https://rt.perl.org/Ticket/Display.html?id=131617 >


The "Died" message should never occur:

m: my $s = Seq.new: class :: does Iterator { has @!stuff = ; has 
$!ded = 1; method pull-one { $!ded or die; @!stuff ?? shift @!stuff !! $!ded-- 
&& IterationEnd } }.new; say $s.tail: *-10
rakudo-moar 86e7b2: OUTPUT: «Died␤  in method pull-one at  line 1␤  in 
block  at  line 1␤␤»

Looks like a check that .skip-at-least was successful is missing[^1].

[1] 
https://github.com/rakudo/rakudo/blob/86e7b2bd25ed62ecd93d83a49b6e2cbfeeb1c24c/src/core/Any-iterable-methods.pm#L1889-L1890
[2] 
https://github.com/rakudo/rakudo/blob/86e7b2bd25ed62ecd93d83a49b6e2cbfeeb1c24c/src/core/List.pm#L1289-L1298