Hi,

In message "Re: new method dispatch rule (matz' proposal)"
    on Wed, 24 Jan 2007 09:15:56 +0900, Daniel DeLorme <dan-ml / dan42.com> writes:

|Ok, if private methods are not in a separate namespace, what happens here?
|  class A
|    def foo; bar; end
|    def bar; "A"; end
|  end
|  class B
|    private :bar
|  end
|  B.new.foo #=> ?
|
|1. lookup in private methods starting at A => not found (in A, bar is public)
|2. lookup in public methods starting at B => not found (in B, public bar has 
|been overwritten by private bar)
|3. NoMethodError?

Can I suppose B inherits A?

If so: 

  * foo calls bar in functional style.
  * private method search begins from A.
  * when no private method found, start public method search from the
    receiver's class.
  * bar in class B will be skipped, since it's private.
  * bar in class A is chosen.

							matz.