From: Robert Dober Date: 2009-07-29T23:52:48+09:00 Subject: Re: previous value in array block On Wed, Jul 29, 2009 at 3:20 PM, David A. Black wrote: > Hi -- > > On Wed, 29 Jul 2009, Robert Dober wrote: > >> On Wed, Jul 29, 2009 at 2:31 PM, David A. Black wrote: >>> >>> I confess I don't see the point, but thanks for clarifying. >> >> It is cheating, bending Ruby to the needs of the problem. We even had >> a discussion if it should use each_cons or each_slice below the hood. >> >> But the point might be, that it might make sense to have things like >> map_cons or map_slice > > In 1.9 you get: enumerable.each_cons(x).map ...  which has much the > same effect. I don't like the idea of map having a stealth each_cons > in it. Also, defining it for Enumerable won't affect arrays (at least > in MRI), because Array overries map. yes we should not confuse, playing around and changing the language. I have sometimes the feeling that people get nervous when I do this "cheating" stuff, but if I meant this to be in Ruby I would say so and probably at Ruby core. No it is just for the fun and elegance. R.