From: John Feezell Date: 2002-11-14T05:35:21+09:00 Subject: Re: *variable works in asssignment? Check out the Ruby FAQ at http://165.193.123.250/faq/rubyfaq.html section 4.8 11/13/2002 1:18:06 PM, Eric Schwartz wrote: >I was trying to figure out how to do the equivalent of (in Perl): > >$one, $two, @rest = @ARGV > >and it seems that I can do: > >one, two, *rest = ARGV > >in Ruby. However, I can't see this documented anywhere (I looked in >the pickaxe, and in the manual shipped with Debian's ruby-manual >package), and I wanted to make sure I could rely on it working in >future versions of Ruby. > >I do see it used in method parameters: > >def method(one,two,*rest) > #... >end > >But nobody seems to say that you can do it generically in assignments, >and I'm always a tad nervous about using what appear to be >undocumented language features. > >If this is documented, of course, a pointer to where would be nice. >Note: Source code doesn't count. :) > >-=Eric >-- >Come to think of it, there are already a million monkeys on a million >typewriters, and Usenet is NOTHING like Shakespeare. > -- Blair Houghton >