From: Greg McIntyre Date: 2003-11-19T11:42:18+09:00 Subject: Re: Again, Rite explanation needed (keyword args and new hash syntax) I'm a bit confused by this too. --- def f(a, b: 2, **kwd) p [a,b,kwd] end f(1) #=> [1,2,{}] f(1,b:5) #=>[1,5,{}] f(1,b:5,c:6) #=>[1,5,{:c=>6}] --- Is the double asterisk (**) especially for grouping the rest of the arguments into a hash the same way that a single asterisk groups the rest of the arguments into an array? If so, f(1,b:5,6,7,8) # => ? runtime error? Can I still use position to in the argument list and forgo the keywordiness? f(1,5) # => [1,5,{}] Can I change the order of the arguments or leave as many as I like out? Shouldn't that be included in the primary example of this? It is the point, isn't it? def g(a:1,b:2,c:3) [a,b,c] end g(c:5,b:6) # => [1, 6, 5] Is that right? -- Greg McIntyre ======[ greg@puyo.cjb.net ]===[ http://puyo.cjb.net ]===