Yep, Chad Fowler explained to me that it's the difference between precedence and binding with do/end vs {}
- Matt
> You are right, still a gotcha tho:Works if you add parentheses though :
>
> 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)
def foo(a, b={})end)
b[:handler].call if b.has_key?(:handler)
end
foo :bar, handler: (Proc.new do
puts 42
_______________________________________________
MacRuby-devel mailing list
MacRuby-devel@lists.macosforge.org
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel