ara.t.howard / noaa.gov wrote:
> On Tue, 12 Dec 2006, Trans wrote:
>
> >
> > ara.t.howard / noaa.gov wrote:
> >>      harp:~ > cat a.rb
> >>      module X
> >>        module_function  # side effect -> instance 'f' made private
> >>        def f; "f"; end
> >>        public :f
> >>      # ^^^^^^ ^^
> >>      # ^^^^^^ ^^
> >>      # ^^^^^^ ^^
> >>      end
> >
> > but that undoes the module_function-ality of X.
>
> ??
>
> harp:~ > cat a.rb
> module X
>    module_function  # side effect -> instance 'f' made private
>    def f; "f"; end
>    public :f
> end

Exactly. Here let me give an actual example to help explain:

  module CompressUtils
    module_function
    def tar_gz( folder, to_file=nil )
      # ...
    end
  end

I need CompressUtils to stay as is so as to work on it's own as a
function module. But in one case I was thinking of doing:

  module FileUtils
    include_extend_or_whatever CompressUtils
  end

With the desired effect being is as if I had originially done:

  module FileUtils
    module_function
    def tar_gz( folder, to_file=nil )
      # ...
    end
  end

t.