--=-G4l5FF75fzmnjImKa3Vd
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable

On Tue, 2008-03-11 at 08:40 +0900, David A. Black wrote:
> irb(main):002:0> obj =3D Object.new
> =3D> #<Object:0x3cb748>
> irb(main):003:0> obj.to_a
> NoMethodError: undefined method `to_a' for #<Object:0x3cb748>
> irb(main):004:0> [*obj]
> =3D> [#<Object:0x3cb748>]
>=20
> Am I right in interpreting this to mean that * works by doing an
> implicit to_a-ish operation, unless to_a is defined in which case it
> uses to_a? (I was kind of expect it not to work in the absence of the
> default to_a, though I'm happy if it does.)

I believe the splat operator is based on Array(), not #to_a directly.

-mental

--=-G4l5FF75fzmnjImKa3Vd
Content-Type: application/pgp-signature; name=signature.asc
Content-Description: This is a digitally signed message part

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQBH1dVwEpMFVe94r24RAvt3AJ0WPjC8Omr4szj08MEXxhA/TWak0ACfXjLd
spjvTI/y8GCL2+94i2UY2mY=
=T3WI
-----END PGP SIGNATURE-----

--=-G4l5FF75fzmnjImKa3Vd--