Hi,

This post is translation of [ruby-dev:30107], a new method dispatch rule
proposed by Matz.  I post it because I want to discuss about it widely.


This change is to clarify "private" feature.

(1) send(:foo) accesses only public methods.

(2) send(:foo) and recv.foo (with receiver method dispatch) only skips
    private methods.
    In current Ruby, if any private method foo are there, raise exception.

(3) method dispatch as function like "foo()", introduce new method
search ordering.

    1. search *only private methods* in inheritance tree.
    2. search public methods in inheritance tree from CLASS_OF(self).

(4) (unconfirmed) private method dispatch searches from caller method class.

(5) remove send!, __send! methods.  private method funcall is added.

      funcall name, args...


Japanese developer: please comment if there are any wrong statements or
lack features.


I feel C.new.foo returns "C1#m" is strange with following code (because
of rule 3.1).

class C1
  def m
    "C1#m"
  end
  private :m
end

class C2 < C1
  def m
    "C2#m"
  end

  def foo
    m
  end
end


-- 
// SASADA Koichi at atdot dot net