James Edward Gray II schrieb:
> That's pretty darn clever.  You can collapse it to one line with 
> inject() of course:
> 
>   def mapn(&b)
>     enum_slice(b.arity).inject([]) {|r, args| r << b.call(*args) }
>   end

Simpler:

   def mapn(&b)
     to_enum(:each_slice, b.arity).map(&b)
   end

Regards,
Pit