> You are right, still a gotcha tho:
>
> Ruby 1.9.2:
>
>   def foo(a, b={})
>     b[:handler].call if b.has_key?(:handler)
>   end
>   foo :bar, handler: Proc.new do
>     puts 42
>   end
>
> `new': tried to create Proc object without a block (ArgumentError)

Works if you add parentheses though :
  def foo(a, b={})
    b[:handler].call if b.has_key?(:handler)
  end
  foo :bar, handler: (Proc.new do
    puts 42
  end)
_______________________________________________
MacRuby-devel mailing list
MacRuby-devel@lists.macosforge.org
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel

Reply via email to