I would like to see Ruby gain a "scoping feature" (I usually refer to
this as a "namespace", but looking at Matz' discussion of Rite he's
using that to mean something else). This idea is this:

  class String

    scope format

      def jumble
        j = ''
        split(//).each_with_index{ |c,i| j << ( i % 2 == 0 ? c.downcase
: c.upcase ) }
        j
      end

    end

  end

  "Wizard".format.jumble  #=> wIzArD


Currently I can implement like so:

  require 'delegate'

  class String

    def format
      @__format__ ||= Format.new( self )
    end

    class Format < DelegateClass( self )

      def jumble
        j = ''
        split(//).each_with_index{ |c,i| j << ( i % 2 == 0 ? c.downcase
: c.upcase ) }
        j
      end

    end

  end

But that has a whole lot of icky overhead. I would be nice if Ruby
could support this kind of thing natively. It's a nice way to organize
methods.

T.