Will Coleda wrote:
On Thu, Jan 22, 2009 at 11:45 AM, Patrick R. Michaud <pmich...@pobox.com> wrote:
On Wed, Jan 21, 2009 at 09:00:23AM -0800, c...@cvs.perl.org wrote:
Author: coke
Date: Wed Jan 21 09:00:22 2009
New Revision: 35869
Modified:
trunk/languages/perl6/src/classes/Range.pir
Log:
Add a basic version of .pick() for Range and hopefully not break anything.
The version of .pick that was added does not match the spec.
It would also be nicer if we could simply use the .pick from Any
and not re-implement it for Range.
I'll remove it. The reason I override it for range was to avoid
flattening the entire list to provide szagab a speed boost for
(1..1000000).pick
I agree with the sentiment of the patch, even if it wasn't quite right -
.pick on a range shouldn't generate the whole list... OTOH, once we get
lazy lists perhaps .pick on Any can be smart enough? But I still see a
decent chance that the code for that will be messier than just
implementing .pick on Range...
Thanks,
Jonathan