From: Thufir Date: 2007-10-27T19:57:48+09:00 Subject: Re: .each do |foo, bar| what does bar do? On Thu, 25 Oct 2007 06:14:12 +0900, Ben Giddings wrote: > Because "yield" has two arguments, the block you pass each should have > two parameters, which it does. If you used this instead: > > code_words.each do |foo| > ... > end > > Foo would be assigned an array containing both things sent by "yield", > i.e. foo[0] would be the same as real, and foo[1] would be the same as > code. I don't see what's wrong with having foo[0] and foo[1], but, yes, it's clearer to instead use foo and bar instead. Ok, that convinces me that it's good to do it this way, thank you. I just can't wrap my mind around *what's* being iterated through. I guess it's the way that, as you put it, the "yield(current_hash_key, current_hash_value)" is happening behind the scenes. -Thufir