From: Kevin Brown Date: 2005-12-09T00:18:09+09:00 Subject: Re: increasing counter whithin loop? On Thursday 08 December 2005 02:07, Patrick Gundlach wrote: > >> OK, then it makes sense that one cannot manipulate counter. But IMO it > >> is not intuitive (POLS ;-)) that the counter in the for-loop can't be > >> changed. > > > > Don't base your sense of "intuitive" on other languages. > > ? How else should I expect a behaviour, if not from other languages? Perhaps how Ruby defines the construct, since it's not another language? The general idea here is simply that the Ruby way(R) isn't about skipping elements when going through one at a time. That's why this construct doesn't work like you're expecting, because there are more Ruby-ish ways to accomplish it, but do please come up with an example where this is the best way to do it, and I'll be more than happy to calm down and stop whining at you. :-) > [...] > > > Use RegExps to do your string processing then. > > Yes, but as soon as my elements aren't strings anymore, I need another > solution. Ok, so what are your elements? ;-) > Patrick