On 11/5/05, Vincent Foley <vfoley / gmail.com> wrote:
> How can I have a block that optionally takes an argument?  Thanks.
>
> Vincent.
I seem to remember Ara Howard recently answered this with an idiom
something like this (apologies to Ara if I've remembered incorrectly):

block = proc{|*args|
      a, b = *args
      a ||= 1
      b ||= 2
      p [a, b]
      }

block.call
block.call(99)
block.call(99, 100)

__END__
[1, 2]
[99, 2]
[99, 100]