On Thu, 2 Mar 2006, Christian Neukirchen wrote:

> dblack / wobblini.net writes:
>
>> Hi --
>>
>> On Wed, 1 Mar 2006, ara.t.howard / noaa.gov wrote:
>>
>>> it's pretty dang easy to do already:
>>>
>>>    harp:~ > cat a.rb
>>>    animal, sound = %w[dog cat bird], %w[woof meow cheep]
>>>    require 'yaml' and y Hash[*animal.zip(sound).flatten]
>>>
>>>
>>>    harp:~ > ruby a.rb
>>>    ---
>>>    cat: meow
>>>    bird: cheep
>>>    dog: woof
>>
>> A good opportunity for my annual plug for the flattenx extension :-)
>> (On RAA, still, I think.)  It lets you flatten by any number of
>> levels, so that you can use that technique even with nested arrays.
>
> Try to get that into 2.0, at least flatten_once. *please*.

agreed.  however i'd strongly go with an api like


-a

-- 
judge your success by what you had to give up in order to get it.
- h.h. the 14th dali lama