On Tue, Sep 26, 2006 at 12:27:21PM +0100, David Cantrell wrote:
> On Mon, Sep 25, 2006 at 11:22:46PM -0400, John Macdonald wrote:
> > On Mon, Sep 25, 2006 at 12:35:49PM +0100, David Cantrell wrote:
> > > On Thu, Sep 21, 2006 at 07:02:56PM -0400, Duane Bronson top-posted:
> > > > Ronald J Kimball wrote:
> > > > > What would you have Perl do in the case of nested loops?
> > > > $.. should be the iterator count in the parent loop, $... should be the 
> > > > iterator count in the grandparent loop, ...
> > > Ick!  Better to use a stack, methinks, like I do for getting at outer
> > > map{}s' versions of $_ in NestedMap.
> > And even using a stack suffers from the flaw that any sort
> > of refactoring that puts a loop around a portion of the code
> > means search through the entire section and increasing the
> > index of any reference to a loop outside the new one ...
> 
> Any refactoring should be done carefully and with understanding of what
> the code you're refactoring is doing.  I'm not sure what your point is.

Yes, it should.  That doesn't mean it will be.

More importantly, by using explicit loop index variables, you don't have to
do any refactoring at all.  That's why (in my opinion) having magic loop
index variables is a bad idea.


> And the bugs you introduce while doing it will, of course, be caught by
> your regression tests.

You're a glass-is-completely-full kind of guy, huh?


Ronald
 
_______________________________________________
Boston-pm mailing list
Boston-pm@mail.pm.org
http://mail.pm.org/mailman/listinfo/boston-pm

Reply via email to