From: Sean O'Halpin Date: 2005-11-05T21:22:22+09:00 Subject: Re: Optional block arguments? On 11/5/05, Vincent Foley 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]