marcus
2/28/2006 4:14:00 PM
Robert Klemme skrev:
> Meinrad Recheis wrote:
>> On 2/28/06, Robert Klemme <bob.news@gmx.net> wrote:
>>> - change the way you store things to avoid such a deep recursion
>>>
>> [...]
>>
>> i now remember that i had a similar problem with a deep recursion and
>> stack depth. i solved
>> it by converting the recursive function into a while loop. you can
>> transform every recursion
>> into a loop, but it will not be as easy to read anymore.
>
> That's exactly the other recommendation I gave. :-)
>
> robert
I haven't received the other mail(s) that is talked about. However:
I'm implementing the composite pattern using acts_as_tree and STI in
ActiveRecord. The thing that is modeled is nodes in a web site structure
that is kind of tree structured (isn't all web sites?). So I try to loop
over the nodes to do various operations (generate navigations, publish,
distribute etc).
I'm sure that there are ways around this but then you have to code
around stuff because of the language implementation and that doesn't
feel good at all...
/Marcus