Why is to_a going to be obsolete?

Hi,

···

In message “Re: Why is to_a going to be obsolete?” on 04/01/24, Patrick Bennett patrick.bennett@inin.com writes:

I’m still curious though - may I ask why Object.to_a is going away?

I wanted to reserve “to_a” method for Array-like objects, such as
Enumerables.

						matz.

Hi,

···

In message “Re: Why is to_a going to be obsolete?” on 04/01/24, Dan Janowski danj@3skel.com writes:

My apology, I read a few more messages: to_a will still be the
sanctioned way for an object to emit itself as an array, but Object
will not include such a method. Correct?

Right, as long as I understand you correctly.

						matz.

Yukihiro Matsumoto wrote:

I wanted to reserve “to_a” method for Array-like objects, such as
Enumerables.

Ok, now that I know about Array.new’s behavior, it makes a bit more sense now. Thanks Matz.

Cheers…
Patrick Bennett

I thought that was the purpose of to_ary()?

Paul

···

On Sat, Jan 24, 2004 at 04:15:12PM +0900, Yukihiro Matsumoto wrote:

I wanted to reserve “to_a” method for Array-like objects, such as
Enumerables.

#to_x and #to_xyz are meant to have different semantics (explicit and
implicit conversion, respectively). So there is room for both #to_a
and #to_ary in Enumerable et al.

Gavin

···

On Tuesday, January 27, 2004, 7:15:08 AM, Paul wrote:

On Sat, Jan 24, 2004 at 04:15:12PM +0900, Yukihiro Matsumoto wrote:

I wanted to reserve “to_a” method for Array-like objects, such as
Enumerables.

I thought that was the purpose of to_ary()?