From: Sean O'Halpin Date: 2006-06-17T04:54:47+09:00 Subject: Re: Symbol#to_proc Problem [snip Elliot trying to have his cake and eat it ;)] Think about what you're trying to do here. Applying map on its own to both input data structures gives you: { 1=>2, 3=>4}.map #=> [[1,2], [3,4]] [[1,2,3], [4,5,6], [7,8,9]].map #=> [[1,2,3], [4,5,6], [7,8,9]] i.e. in both cases you are effectively mapping an array of arrays. In the &:foo case, you want to apply the proc to the first element of each array, with subsequent elements as arguments. In the &:reverse case, you want to apply the proc to each array as a whole. How can the lambda in the to_proc method know which case is which? You might be able to devise a hack to check the arity of the methods involved, but even that is effectively guess work. On top of that, using Symbol.to_proc in this way is very inefficient compared to using blocks. IMHO this is one of those clever hacks that shouldn't make it into production code. Regards, Sean