From: Robert Klemme Date: 2010-10-07T21:42:58+09:00 Subject: Re: Can anyone give a an example of this please On Thu, Oct 7, 2010 at 2:29 PM, Phillip Gawlowski wrote: > On Thu, Oct 7, 2010 at 2:17 PM, Robert Klemme > wrote: >>> irb(main):001:0> [0,1,2,3].each { puts "no param" } >>> no param >>> no param >>> no param >>> no param >>> => [0, 1, 2, 3] >> >> There is _one_ parameter passed - you just do not pick it up in the block. > > Ah, then I misunderstood the question, I guess, thinking that the OP > wanted an example of a block without a parameter enclosed in ||, > analogus to the |key,value| pair in the OP's example. Actually I am not sure what the OP *really* wanted either. :-) I just wanted to point out that the parameter is actually passed (which you can see if you add a formal parameter to the block) but that the block does not use it. > Though, do you count the array index passed into the #each block as a > parameter, or not? The index is only passed with #each_index. And yes, of course it is a parameter. Kind regards robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/