nobu.nokada / softhome.net wrote: > Hi, > > At Thu, 3 Jun 2004 02:33:44 +0900, > Paul Brannan wrote in [ruby-talk:102177]: > >>But how would (a) work? It seems like it would make the following >>ambiguous: >> >>def foo(foo, bar=2) >>end >> >>foo(:foo => 14, :bar => 92) >> >>(is this calling foo with a hash and leaving bar with default argument, >>or is it calling foo with foo equal to 14 and bar equal to 92?) > > > The former. The latter syntax will be > > foo(foo: 14, bar: 92) Lovely! So that means foo(bar: 1, :bar => 2) will pass two distinct arguments: 1) the integer 1 in keyword argument "bar", and 2) the hash {:bar => 2} ? I like it, even though it is a little inconsistent with irb(main):001:0> {bar: 1} == {:bar => 1} => true irb(main):002:0> RUBY_VERSION => "1.9.0"