From: "Peña, Botp" Date: 2002-11-16T14:15:31+09:00 Subject: Re: Ruby equivalent to Python's map()? Hi Aleksei [mailto:aleksei.guzev@bigfoot.com]: You wrote: > ###################################################### > > module Enumerable > def collectm(*args,&proc) > result = [] > each_with_index{|e,i| res << yield(e,*args.collect{|f| f[i]})} ^^^^^^ shouldn't be result? [snipped some] > > [1,2,3].collectm([18,12,16],[4,5,6]) {|a,b,c| b/a+c} > # results in [10,11,12] I get [22, 11, 11] :-) Anyway, you have very helpful code. Can you post it in wiki? Kind regards, -botp