From: Max Williams Date: 2009-07-23T19:11:46+09:00 Subject: Re: Ruby "star".... what's it? 7stud -- wrote: > > Depending on the context the * means: > > a) replace an array with its individual elements > b) gather individual elements into an array I said a more precise explanation would be forthcoming :) 7stud - am i right in thinking that if i do this a, b = 1, 2 ruby is automatically starring just the right side of the expression, under the hood? eg >> a,b = 1,2 => [1, 2] >> puts a.inspect;puts b.inspect 1 2 => nil >> a,b = [1,2] => [1, 2] >> puts a.inspect;puts b.inspect 1 2 => nil >> [a,b] = [1,2] SyntaxError: compile error (irb):37: syntax error, unexpected '=', expecting $end [a,b] = [1,2] ^ from (irb):37 -- Posted via http://www.ruby-forum.com/.