<?xml version="1.0" encoding="windows-1252"?>
<node id="866927" title="Re^4: (Perl6) Groking Continuations (iterators)" created="2010-10-23 00:58:03" updated="2010-10-23 00:58:03">
<type id="11">
note</type>
<author id="961">
Anonymous Monk</author>
<data>
<field name="doctext">
Perl can do something that closely resembles an optimized tail call, but it only does so if you tell it to.
&lt;code&gt;
sub tail_fact {
    my ($num, $k) = @_;
    return $k-&gt;(1) unless ($num);
    @_ = ($num - 1, sub { return $num * $k-&gt;(shift); });
    goto &amp;tail_fact;
}
&lt;/code&gt;
</field>
<field name="root_node">
248935</field>
<field name="parent_node">
249118</field>
<field name="reputation">
1</field>
</data>
</node>
