From: dblack@... Date: 2006-08-26T07:07:38+09:00 Subject: Re: What does *var mean? Hi -- On Sat, 26 Aug 2006, darren kirby wrote: > quoth the Chih-Chao Lam: >> Apologies for a newbie ruby question: >> >> I know an asterisk can precede a parameter in the argument list of a >> method definition as in >> >> def varargs(arg1, *rest) >> > > def varargs(arg1, *rest) > puts arg1 > rest.each |arg| > puts arg > end > end > >> varargs(one, two, three, four, five) > one > two > three > four > five >> > > Really, it just accumulates a variable amount of arguments and presents them > in the function as a list. > > **kwargs will collect them in a hash. When you say "will"... do you mean in the future? Is that documented somewhere? I can't puzzle out the reasoning behind it. David -- http://www.rubypowerandlight.com => Ruby/Rails training & consultancy ----> SEE SPECIAL DEAL FOR RUBY/RAILS USERS GROUPS! <----- http://dablog.rubypal.com => D[avid ]A[. ]B[lack's][ Web]log http://www.manning.com/black => book, Ruby for Rails http://www.rubycentral.org => Ruby Central, Inc.