From: Patrick Gundlach Date: 2005-12-13T20:12:38+09:00 Subject: Re: increasing counter whithin loop? Hi mental, [...] >> all these parts in an array: >> >> @schedule << ListOfMember.new.parse(the source) >> .... >> >> and output all like >> >> @schedule.each { |elt| elt.render } >> >> but in case of two 'ListOfMembers' following each other, they should be >> output next to each other, so I wrap them in a 'Group of two ListOfMember= > s' > > Hmm. What happens if you have three in a row? 'this can't happen' > Seems to me you could do something like this: > > collapsed = [] > @schedule.each do |elt| .... yes, but this involves another step which reduces readability a bit. Thanks again, Patrick