warning: default `to_a' will be obsolete
However, I can't find what the expected alternative is. Any pointers?
David
Returns an array representation of _obj_. For objects of class
+Object+ and others that don't explicitly override the method, the
return value is an array containing +self+. However, this latter
behavior will soon be obsolete.
so it's this "return array containing self" that's going obsolete.
Use [*foo].
> David
--
Christian Neukirchen <chneuk...@gmail.com> http://chneukirchen.org
That doesn't really look much clearer to me...
Cheers,
Daniel
> Christian Neukirchen wrote:
>> David Corbin <dco...@machturtle.com> writes:
>>
>>> I'm getting this warning, which I think is new in 1.8.3.
>>>
>>> warning: default `to_a' will be obsolete
>>>
>>> However, I can't find what the expected alternative is. Any pointers?
>> Use [*foo].
>>
> That doesn't really look much clearer to me...
But it doesn't hurt duck-typing.
> Daniel
Array( foo )
Same effect.
James Edward Gray II
Array[ foo ]
T.
>> Array( foo )
>
> Array[ foo ]
Not quite the same:
foo = [1, 2, 3]
Array(foo) => [1, 2, 3]
Array[foo] => [[1, 2, 3]]
Markus