From: Eero Saynatkari Date: 2006-10-11T02:16:57+09:00 Subject: Re: [ruby-cvs:18323] ruby: * eval.c (splat_value): use "to_splat" instead of "to_ary" to --z4+8/lEcDcG5Ke9S Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2006.10.10 23:57, dblack@wobblini.net wrote: > Hi -- >=20 > On Tue, 10 Oct 2006, James Edward Gray II wrote: >=20 > >On Oct 10, 2006, at 8:43 AM, Yukihiro Matsumoto wrote: > > > >>Hi, > >> > >>In message "Re: [ruby-cvs:18323] ruby: * eval.c (splat_value): use=20 > >>"to_splat" instead of "to_ary" to" > >> on Tue, 10 Oct 2006 22:36:44 +0900, "Rick DeNatale"=20 > >> writes: > >> > >>If it's possible, I'd like to hear your feeling against the changes in > >>detail. Can you express? Why don't you right? > > > >I believe I understand where Rick is coming from. > > > >He's saying that when we do a *whatever, we are actively asking that=20 > >whatever be split into values. Because we consciously make that choice,= =20 > >to_a (a general solution) is fine. We understand that we are calling to= _a=20 > >and willingly accept the consequences. If we want to divide up a string= =20 > >into arguments that way, that's our business not Ruby's business. > > > >At least, that's what I *think* he means. Correct me if I'm wrong Rick. >=20 > I've been thinking about the whole thing, and I tend to agree. I'm > not sure why we need a whole star-related sub-system, including a > method hook, independent of the existing array sub-system. I think > the star can be understood as syntactic sugar for to_a. The problem is that * does not just create an Array--in fact, that seems to be the less-used functionality. In most situations, #to_a is the exact opposite of what is happening. If *5 # =3D> [5] Then #to_a is correct. This is what can be considered to happen in method definitions and in the left-hand-side of assignments. What is more, these are not controlled by the user: the only context where the programmer can explicitly affect the result of * is this: *[1, 2] # =3D> 1, 2 (And variations thereof) Here we are definitely NOT doing a #to_a but the exact opposite=20 (whatever it is decreed to be called).=20 I think this is what matz means--correct me if I am wrong :) --z4+8/lEcDcG5Ke9S Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (FreeBSD) iD8DBQFFK9T77Nh7RM4TrhIRAqgPAJ4tLEoNdBlv7M5fYB9XAQYILq0/3wCgnxhs 8xrqA8IWRh2mOVCPStDetKA= =JxGj -----END PGP SIGNATURE----- --z4+8/lEcDcG5Ke9S--