in reply to Re: Perl6 Contest #2: P6 That Doesn't Look Like P5
in thread Perl6 Contest #2: P6 That Doesn't Look Like P5
There is an off-by-one error in your translation, Limbic~Region. The P6 version is missing the first group because you used pre-increment rather than post-increment on $iter. This will correct the problem:
my $iter = -1;
I'm hoping to create a version soon that can handle this example from the NestedLoops documentation:
use Algorithm::Loops qw( NestedLoops ); my $depth= 3; NestedLoops( [ [ 0..$N ], ( sub { [$_+1..$N] } ) x ($depth-1), ], \&Stuff, );
In other words, a full implementation should allow code refs for the ranges, not just fixed ranges.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: Perl6 Contest #2: P6 That Doesn't Look Like P5
by Roy Johnson (Monsignor) on Jun 06, 2005 at 19:36 UTC | |
by tall_man (Parson) on Jun 06, 2005 at 21:29 UTC | |
by Roy Johnson (Monsignor) on Jun 06, 2005 at 23:36 UTC | |
Re^3: Perl6 Contest #2: P6 That Doesn't Look Like P5
by Limbic~Region (Chancellor) on Jun 06, 2005 at 19:02 UTC | |
Re^3: Perl6 Contest #2: P6 That Doesn't Look Like P5
by tall_man (Parson) on Jun 07, 2005 at 16:37 UTC | |
by tall_man (Parson) on Jun 08, 2005 at 00:16 UTC | |
by eric256 (Parson) on Jun 08, 2005 at 13:07 UTC | |
by tall_man (Parson) on Jun 08, 2005 at 18:17 UTC | |
by TimToady (Parson) on Jun 08, 2005 at 18:40 UTC |
In Section
Seekers of Perl Wisdom