D
Daniel Berger
Hi all,
I see that Ruby 1.8 added the option of passing an array to Array.new.
a = Array.new([1,2,3])
p a # [1,2,3]
My question is, what is the point of this construct? If it's just a
dup, shouldn't we just use .dup? What advantage am I missing here?
I ask in part because I'm doing a little refactoring project, and
having to support this sort of pseudo overloading is a pain on the C
side.
Regards,
Dan
I see that Ruby 1.8 added the option of passing an array to Array.new.
a = Array.new([1,2,3])
p a # [1,2,3]
My question is, what is the point of this construct? If it's just a
dup, shouldn't we just use .dup? What advantage am I missing here?
I ask in part because I'm doing a little refactoring project, and
having to support this sort of pseudo overloading is a pain on the C
side.
Regards,
Dan