Hi --

On Wed, 2 Nov 2005, Minero Aoki wrote:

>    class String
>      def jcode$chop   # define #chop method in jcode namespace
>        ...
>      end
>    end
>
>    # "\244\242\244\244" is Japanese characters 'A'+'I' in EUC-JP
>    p "\244\242\244\244".chop         # "\244\242\244"  # wrong result
>    p "\244\242\244\244".jcode$chop   # "\244\242"      # right result
>
>  You can omit namespace specifier ("jcode$") by using "using" syntax:
>
>    class String
>      def jcode$chop() ... end
>    end
>
>    using jcode
>    p "\244\242\244\244".chop   # "\244\242"      # right result
>
>  There are still many arguments, for example:
>
>    * whether "using" effects statically or dynamically
>    * '$' is ugly
>    * scope of "using" (file level / module level / method level)

How about block level?

   using jcode do
     p "\244\242\244\244".chop
   end


David

-- 
David A. Black
dblack / wobblini.net