From: Robert Klemme Date: 2009-06-19T20:17:34+09:00 Subject: Re: each by arity 2009/6/19 Robert Dober : > But on a theoretical ground I find it intriguing that the "proxy" > would do something similar to what an enumerator does. > An enumerator prepares a view of an enumerable for an actual method > delivering the behavior in a block. > One could say it "waits" for a message with a block. > The proxy will wait for a message too, and a block too, and will just > create the Enumerator on the fly with the information of the arity. > I even wonder if Enumerator could be the proxy with a little monkey > patch? ??? irb(main):002:0> %w{foo bar}.each_cons 2 => # > And that might as well lead to a "default" behavior for map, > without the "proxy method" which would meet Tom's original requirement > for Enumerators *only* Are you mixing up Enumerable and Enumerator? Kind regards robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/