Tobias DiPasquale <anany / ece.vill.edu> writes:

> 	What does the '&' signify in parameter listings? I have seen it in such 
> places as "def add(*params, &block)", but am not sure what it means? 
> Does it have the same significance as it does in C?

If the method is called with a block, convert that block to a proc
object and store a reference in the & parameter:

   def fred(a, b, &blk)
      if blk
        blk.call(a,b)
      else
        puts "No block given: #{a} #{b}"
      end
   end

   fred(1, 2)
=> No block given: 1 2

   fred(2, 3) {|x,y| puts "In block, x=#{x}, y=#{y}"}
=> In block, x=2, y=3


Dave