From: Glenn Parker Date: 2004-12-09T00:33:17+09:00 Subject: Re: Idiom for creating hash from two arrays David A. Black wrote: > On Wed, 8 Dec 2004, Jonathan Paisley wrote: >> >> In addition, it would be nice if keys and values need not be arrays - >> just Enumerables. Implementing this may be a bit tricky, however. > > Very :-) I wouldn't want to create a hash from one of these: > > class Forever > include Enumerable > def each > i = 1 > loop { yield i += 1 } > end > end That's a fairly pathological case. Should we therefore deny all the other more useful applications of Enumerable in this context? -- Glenn Parker | glenn.parker-AT-comcast.net |