in reply to Re: Re: Re: (Perl6) Groking Continuations (iterators)in thread (Perl6) Groking Continuations
sub tail_fact { my ($num, $k) = @_; return $k->(1) unless ($num); @_ = ($num - 1, sub { return $num * $k->(shift); }); goto &tail_fact; } [download]