On Wed, Dec 06, 2006 at 07:40:03PM +0900, Martin DeMello wrote: > While golfing with the hex_ip thread, I realised that map takes no > argument, and join takes no block, leaving a vacuum for a combined > method: > > module Enumerable > def join_with(sep, &blk) > map(&blk).join(sep) > end > end > > hex_ip.scan(/../).join_with('.') {|i| i.hex} hex_ip.scan(/../).map {|i| i.hex}.join('.') Hey look, the long way is even shorter! Do you just want to conflate these two because theres room in the interface? That seems like a silly reason. It would also set a bad precendent. (Well hey, delete doesn't take a block, lets add one and pass the deleted item in...) > > join_with is still a little clunky - any better name? > > martin