On Wed May 18 07:56:18 2016, c...@zoffix.com wrote:
> When given a lazy list as the argument, .polymod divides until the
> original number given by the invocant reaches zero. That works when
> the lazy list is infinite, but when it isn't, we lose the final
> remainder. This affects both the Int and Real implementations. Here's
> a sample program demonstrating the issue:
> 
> say 42.polymod:      2, 3;
> say 42.polymod: lazy 2, 3;
> 
> say 42.Rat.polymod:      2, 3;
> say 42.Rat.polymod: lazy 2, 3;
> 
> # OUTPUT:
> # (0 0 7)
> # (0 0)
> # (0 0 7)
> # (0 0)

It's worth noting that Perl 6 doesn't have a concept of infinite lists (that 
is, doesn't try to track that or make decisions based on it). Rather, a list 
(or sequence) can be marked lazy (or not). So however this gets changed (if at 
all), it'll want to be based on deciding what to do in the lazy vs. non-lazy 
case.

/jnthn

Reply via email to