thanks for your reply, brian.

what's the definition of '*'?

is this pointer?

I've never heard about "pointer" IN RUBY.

Am I wrong?

2009. 01. 08, =BF=C0=C8=C4 8:06, Brian Candler =C0=DB=BC=BA:

> It does exactly what I'd expect. The insert line expands to:
>
> a.insert(2, 3, 4)  # a.length, b[0], b[1]
>
> and so it inserts 3 and 4 at the end of the array. (It inserts before
> element #n, but since a has only elements #0 and #1, asking to insert
> before element #2 is the same as asking to insert at the end of the
> list)
>
> irb(main):001:0> a =3D [1,2]
> =3D> [1, 2]
> irb(main):002:0> b =3D [3,4]
> =3D> [3, 4]
> irb(main):003:0> a.insert(a.length, *b)
> =3D> [1, 2, 3, 4]
> irb(main):004:0> a
> =3D> [1, 2, 3, 4]
>
> Of course, a +=3D b is a simpler way to write this.
>
> Do you get something different? I am using ruby-1.8.6p114 under Ubuntu
> Hardy.
> --=20
> Posted via http://www.ruby-forum.com/.
>
>