Daniel Brockman <daniel / brockman.se> writes:

>    def foo(bar, baz = QUUX, *rest)
>      ...
>    end
>
> can be written as
>
>    define_method :foo do |bar, *rest|
>      baz = rest.empty? and QUUX or rest.shift
>      ...
>    end

My apologies, that should have been

   define_method :foo do |bar, *rest|
     baz = rest.empty? && QUUX || rest.shift
     ...
   end

-- 
Daniel Brockman <daniel / brockman.se>