From: Trans Date: 2005-10-21T20:06:59+09:00 Subject: Re: A comparison by example of keyword argument styles Why not a Parameters class. This would allow cool things like: a = [ :a, :b, :c ] def foo(a.to_parm) #as def foo(a,b,c) #... end And it would be more useful in the def too (Although maybe this would be a different class): def foo(**parm) p parm.arguments p parm.named_arguments p parm.block.call end foo(1,2,:a=>3){ "block" } => [1,2] {:a=>3} "block" I'm not so keen on sticking with symbols in the parameters list for named parameters. I think there's too much ':' run-on. Things like this are aweful: foo set: :vital, sort: :reverse, mod: :odds do |a: :express| # ... end Short of getting a new demarker for Symbol, I think it would be much better to do without them in parameters if possible. This would work fine I think: def foo( a, b, c, x=>nil, y=>nil, z=>nil ) # ... end The def can be a shortened too: def foo( a, b, c, x=>, y=>, z=> ) # ... end And call them in the same way: foo( 1, 2, 3, x=>8, y=>9, z=>10 ) Which is *almost* exactly what we do now with hash parameters. T.