Threadify not handling hashes inside of array correctly


I wanted to use threadify to iterate over my data structure, where
inside array I have hashes, but it seems that threadify produces
different results than #each.

Here is code sample:
require ‘threadify’

a = []
b = {:key => “value”}
a << b

a.each {|c| p c}
a.threadify {|c| p c}

Output is:
[:key, “value”]

Now, if I have multiple key, value pairs in Hash, then I will get this
warning of course:
warning: multiple values for a block parameter (2 for 1)

Why isn’t threadify working as expected? It seems as it’s iterating over
array and hash instead of just over array.



Forwarding conversationg with threadify’s author Ara T. Howard to the

On Tue, Jun 2, 2009 at 12:08 PM, Jarmo wrote:


Do you still care about threadify and it’s problems? I’ve posted into
Ruby list about one problem, but no-one doesn’t seem to bother to
answer. I’ve searched for you as an author of this great library to see
if you have any ideas about this problem.

You can read about it more from here:

I would be grateful if you’d help me, but if you have something better
to do then I’d also understand. Please just give me at least some answer :slight_smile:


i’m not on the list often these days - sorry i missed it.


pls relay to list.

– be kind whenever possible… it is always possible - h.h. the 14th
dalai lama