On 9/6/07, Brian Candler <B.Candler / pobox.com> wrote: > Quick question - what are the current thoughts about named argument passing > in future versions of Ruby? I've seen it requested in the past but not much > in the way of concrete proposals. > > Those awfully nice Merb people have just come up with a clever idea, already > implemented as a small C extension. This lets you reflect on the names of > arguments in a method definition. > > I had a look at http://eigenclass.org/hiki.rb?Changes+in+Ruby+1.9#l4 but > couldn't see anything along these lines. What IS in 1.9 is a new literal syntax for hash arguments: $ irb1.9 irb(main):001:0> def test(arg) irb(main):002:1> p arg irb(main):003:1> end => nil irb(main):004:0> test(a: "hello", b: 3) {:b=>3, :a=>"hello"} => nil as an alternative to: irb(main):005:0> test(:a => "hello", :b => 3) {:b=>3, :a=>"hello"} => nil This allows all the current code which uses options hashs as a form of named parameters to support a new "nicer" caller syntax without change. -- Rick DeNatale My blog on Ruby http://talklikeaduck.denhaven2.com/