"Guy N. Hurst" <gnhurst / hurstlinks.com> writes:

> possible errata...
> One thing I noticed about the iterator I made, is that it was sending 
> both parameters even if the block provided for only one. This happened
> in the commafy block, which is why I use "|t,i|" even though I
> only needed t for that. Yet the top of page 43 in the PR Book says that
> any extra parameters passed by yield to a block are ignored (Dave?)

With just one parameter in the block, and a yield that passes more
than one, Ruby converts the parameters to an array. It's basically the 
same as assignment.

   a = 1,2
   p a                  #=>[1, 2]


   def yielder
     yield 3,4,5
   end

   yielder { |b| p b}   #=>[3, 4, 5]

   yielder { |c,d| p c; p d}   #=> 3
                               #=> 4

In the last case, the '5' is ignored.

I guess the statement on page 43 is too broad. Let me see if I can fit 
in a correction.



Dave