From: "T. Onoma" Date: 2004-01-24T14:09:12+09:00 Subject: Re: Why is to_a going to be obsolete? On Saturday 24 January 2004 01:29 am, Mark J. Reed wrote: > No, because to_a will still exist and will still be the way to get > arrays out of objects which are collections of some sort. > > All that's going away is the default to_a of class Object, which > returns a one-elment array containing the receiver. That has never > made sense to me. I mean, if I have an object obj and I want an > array containing it, I would just write [ obj ]. If the object may > or may not already be an array and I don't want to add a level of > arrayness if it is, which feels fuzzy but never mind, then I would > write [ *obj ]. There's no new syntax there; that's just how you do > that in Ruby. > > Calling to_a would not occur to me unless I had something that I knew was > some sort of collection object and wanted to get its members as an > array - that's what to_a was made for, and that's what it'll *still* be > for even if Object#to_a -> [ self ] goes away. ah. thank you mark. that makes this whole subject much more comprehensible. - T. P.S. i just noticed that my notion of a ** hashing operator should be enclosed in script brackets instead or square brackets, i.e. {**x} not [**x]. not that it really matters, but nonetheless...