From: Mirko Viviani Date: 2009-07-23T18:54:27+09:00 Subject: Re: Ruby "star".... what's it? --0016367fa374482026046f5c78e7 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable thank's to all.... this is a think I would remember :D 2009/7/23 7stud -- > Mirko Viviani wrote: > > Sorry, > > Complete code was like this > > x, *xs =3D *myarray > > > > after executing, x is 1 and xs [2,3,4,5,6,6] ..... :o > > > > 2009/7/23 Max Williams > > > x, y, z =3D 1, 2, 3 > puts x, y, z > > --output:-- > 1 > 2 > 3 > > > x, y, z =3D *[1, 2, 3] > puts x, y, z > > --output:-- > 1 > 2 > 3 > > > *y =3D 1, 2, 3 > p y > > --output:-- > [1, 2, 3] > > > x, *y =3D *[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/. > > --=20 -- Mirko Viviani -- GPG-PGP Public Key: 0xE4E8FAB1 Fingerprint: 14D3 A373 E926 7737 DF32 502B A4C4 1CE2 E4E8 FAB1 *********************************************** "=93Machines take me by surprise with great frequency.=94 A. Turing --0016367fa374482026046f5c78e7--