News for hackers. Stuff that matters.
Re:Perl far from dead, more popular than you think by colomon on Friday November 06, 2009 @09:33PM (#927394)
The second one is easily translated into Perl 6:

    sub fib() {
        my $fn2 = 1;
        my $fn1 = 1;
        gather loop {
            my $oldfn2;
            ($fn1, $fn2, $oldfn2) = ($fn1 + $fn2, $fn1, $fn2);
            take $oldfn2;
        }
    }

    my @g = fib;
    for ^20 -> $i {
        say $i, @g.shift;
    }
That's untested because lazy evaluation isn't yet supported in Rakudo Perl 6, but my understanding is that feature should be up and running in the next few weeks.

I don't know enough Ruby to make heads or tails of the first example, though...

There are no comments on this comment yet.