From: Derek Michael Date: 2009-12-15T16:29:44+09:00 Subject: Re: Newbie Question: Blocks and Parameters Walton Hoops wrote: > > Going back to your first example. A possible implementation of .each > > class Array > def each > x=0 > while x yield(self[x]) > x+=1 > end > end > end > > Thus, in this example calling each calls yield passing in one at a time > each member of the array. Thus your block gets excuted once for each > member of the array. Does that help? I'm not sure how to explain it > better. Thanks to the both of you for the explanations. I think I understand now. I assume you mentioned the 'possible' implementation of .each method to imply to me that the each method must have a yield in it since it does something when you pass a block/closure, yes? -- Posted via http://www.ruby-forum.com/.