Re: Visitor pattern and separating iteration

2010-07-23 Thread Karsten Wutzke
On 22 Jul., 22:25, Ian wrote: > Hi Karsten, > > On 22/07/2010 12:03, Karsten Wutzke wrote:> What is it I'm missing? > > I think you are making it more complicated than it really is. > > The visitor pattern is about bringing all the little bits that would > otherwise be scattered all over > many no

Re: Visitor pattern and separating iteration

2010-07-22 Thread Mark Lawrence
On 22/07/2010 12:03, Karsten Wutzke wrote: Hello, I'm referring to http://groups.google.com/group/comp.lang.python/browse_thread/thread/4f9ba9816fe4fd55# I'm currently implementing what looks like a promising solution. I have one problem though. My code generator isn't awfully complex, but sti

Re: Visitor pattern and separating iteration

2010-07-22 Thread Ian
Hi Karsten, On 22/07/2010 12:03, Karsten Wutzke wrote: What is it I'm missing? I think you are making it more complicated than it really is. The visitor pattern is about bringing all the little bits that would otherwise be scattered all over many node classes into one visitor class. For c

Re: Visitor pattern and separating iteration

2010-07-22 Thread Karsten Wutzke
>         # "public final" >         modifierString = "" > >         i = 0 > >         for modifier in method.getModifiers(): >             if i > 0: >                 modifierString += " " >             modifierString += modifier > >             i += 1 > And please don't comment on the code itsel

Visitor pattern and separating iteration

2010-07-22 Thread Karsten Wutzke
Hello, I'm referring to http://groups.google.com/group/comp.lang.python/browse_thread/thread/4f9ba9816fe4fd55# I'm currently implementing what looks like a promising solution. I have one problem though. My code generator isn't awfully complex, but still I have problems trying to figure out where