From: 7stud -- Date: 2007-11-01T03:56:01+09:00 Subject: Re: .each do |foo, bar| what does bar do? 7stud -- wrote: > > I'm not getting it. With this definition: > > def each(&a_block) > > when I call: > > each() {some block} > > ruby converts the block to a Proc object and assigns it to the variable > a_block. So, it seems to me that after ruby passes the args specified > in the method call to each()... Whoops. That doesn't make any sense. That should say something like: After ruby gathers up the block, converts it to a Proc object, and assigns the Proc object to the parameter variable a_block... > the block would no longer be accessible > inside the method--only the Proc object assigned to a_block would be > accessible. -- Posted via http://www.ruby-forum.com/.