M
Mischa Fierer
Hi --
After a good amount of digging, I'm still not sure how [*[1,2]] ==
[1,2]. I understand what it does, but I want to know why.
I had originally assumed it was a normal method (like + or -), but it
appears to be implemented at a deeper level. It looks like rubinius does
something with cast_array. Ruby 1.8 does to_ary and ruby 1.9 does
to_splat. Where does this happen? to_ary says that it just returns self,
so how does self get exploded?
Short of reading eval.c, does anyone have any pointers?
Best,
Mischa
After a good amount of digging, I'm still not sure how [*[1,2]] ==
[1,2]. I understand what it does, but I want to know why.
I had originally assumed it was a normal method (like + or -), but it
appears to be implemented at a deeper level. It looks like rubinius does
something with cast_array. Ruby 1.8 does to_ary and ruby 1.9 does
to_splat. Where does this happen? to_ary says that it just returns self,
so how does self get exploded?
Short of reading eval.c, does anyone have any pointers?
Best,
Mischa