From: Henry Savr Date: 2006-09-03T05:51:03+09:00 Subject: Re: That's Ruby, Virginia! Morton Goldberg wrote: > I don't want to rain on your parade, especially because I can't > figure out why you're having a parade. I could understand a newbie > being puzzled about this code (because he wrote [0 ... length] where > he should used 0 ... length) and posting it so someone could explain > why it works the way it does, but you say that's not your situation. > Could you be more explicit about what amuses, delights, intrigues, or > otherwise motivates you to bring this to our attention? > > Regards, Morton Well, I bring it to your attention because: It mentioned in Programming Ruby, that *for* works with array. They gave the example of song array. All languages, which I am familiar with work the same way. They - take an item from Array, - execute the block, - and then take another item So as [0 ... len] is a new Array, I expected the same behaviour. But it was not so obvious. It took the whole array and executes the statement ones. I would expect this behaviour if the code were for i = [0 ... len] So, my question was to persons, who realy UNDERSTAND Ruby internal logic, what was it, a bug or undocumented (or may be documented, but I just missed it) feature? Regards, Henry -- Posted via http://www.ruby-forum.com/.