From: Mischa Fierer Date: 2009-01-02T18:46:14+09:00 Subject: Re: Help using ruby enumerator idioms > But here inner_acc is always identical to acc, making the inject just > for show. You're back to using #each. > > I guess the moral of the story is that functional style in ruby > realistically applies only to flat arrays and hashes. Once we reach > the hash-of-hashes realm, imperative constructs are more suitable. > > Lazy evaluation is needed to be efficient, recursive, and purely > functional all at the same time. (See Haskell.) Interesting, thanks a ton for the reply. I think you may be right that for hashes of hashes imperative style Ruby starts to make more sense. This has been hitting me a lot lately, as one of the projects I'm working on has a lot of hashes of hashes (data crunching). I used the inject style a few times, but as you note, it becomes mostly just for show. M -- Posted via http://www.ruby-forum.com/.