On Tue, Apr 22, 2003 at 12:15:15AM +0900, Chris Pine wrote:
> Out of curiosity, what is it you are trying to do?  Why does it need to be a
> module function?

I have a function that I want to use as if it were a normal public
instance method, but I don't always want to create an instance in order
to use the method.  I thought module_function was the right way to do
this.  But when I write:

  module Foo
  public
    def f1; end
    def f2; end
    module_function :f2
    def f3; end
  private
    def f4; end
  end

It makes sense that f4 is private, but it is not clear why f2 is
private.

The workaround is obvious; I'm just interested in the reasoning behind
module_function()'s behavior.

Paul