From: gwtmp01@... Date: 2006-01-11T14:03:43+09:00 Subject: Re: Stupid question from a Ruby newb On Jan 10, 2006, at 11:42 PM, David Vallner wrote: > If you like Ever So Cool one-liners, this one might also work: > > myHash = objects.inject({}){|hash, item| hash[item.key] = > item.value; hash} > > It does pretty much completely the same, except were this > Smalltalk, the block wouldn't be a closure and therefore a horse's > butthair more memory-efficient solution. > Is this because the Smalltalk compiler will notice that there are no references to variables outside the block and Ruby's current implementation will not notice the same thing? Gary Wright