From: 7stud -- Date: 2009-07-23T18:50:29+09:00 Subject: Re: Ruby "star".... what's it? Mirko Viviani wrote: > Sorry, > Complete code was like this > x, *xs = *myarray > > after executing, x is 1 and xs [2,3,4,5,6,6] ..... :o > > 2009/7/23 Max Williams x, y, z = 1, 2, 3 puts x, y, z --output:-- 1 2 3 x, y, z = *[1, 2, 3] puts x, y, z --output:-- 1 2 3 *y = 1, 2, 3 p y --output:-- [1, 2, 3] x, *y = *[1, 2, 3] puts x p y --output:-- 1 [2, 3] Depending on the context the * means: a) replace an array with its individual elements b) gather individual elements into an array -- Posted via http://www.ruby-forum.com/.