in reply to Re: Re: Re: Re: Pure Perl tail call optimization
in thread Pure Perl tail call optimization
When you have tail call optimization in place, visit_leaf can return directly to accept's caller('s caller's caller's ...). Even without recursion, this can be a win because stack frames can be costly to create.package LeafNode; ... sub accept { my($self, $visitor) = @_; $visitor->visit_leaf($self); }
|
---|