On Fri, Jan 26, 2007 at 12:02:33AM +0900, Yukihiro Matsumoto wrote:
> I think we need to summarize the current proposed schemes:
> (a) my original proposal
> 
>   - functional style call will look for
> 
>     (1) private methods up from defining class to Kernel
>     (2) public methods up from the receiver's class to Kernel if not
>         found in step 1.

A < B < C

A makes function style call to foo().
B has public foo(), C has private foo().

It is C's foo that will be called?

You must have a reason, why is this desireable?

>   - ordinary style call will look for
> 
>     (3) public methods up from the receiver's class to Kernel.  private
>         methods will be skipped.

This is different from ruby 1.8, but makes sense to me. Today, error
raising behaviour means private methods intefere with public method
lookup.

> (b) Charles Nutter's proposal
> 
>   - functional style call will look for
> 
>     (1) any methods up from defining class to Kernel

This seems reasonable.

>   - ordinary style call will look for
> 
>     (2) he didn't say anything about this, either skipping private
>         methods or raise error as we have today.

Hopefully, same as (a)(3).


> (c) Evan Phoenix's proposal
> 
>   - functional style call will look for
> 
>     (1) private methods in the defining class/module.
>     (2) any methods up from the receiver's class to Kernel if not
>         found.
> 
>   - ordinary style call will look for
> 
>     (3) he didn't say anything about this, either skipping private
>         methods or raise error as we have today.

Hopefully, same as (a)(3).

> 
> Are above summary OK, Charles, Evan?

I don't see how (b)(1) and (c)(1,2) are different, except the former
says "defining class" and later says "defining class/module". Don't 
modules, once included, become "like" an ancestor class? Is the
difference how this is handled:

module M
  def this()
    that() # Calls A#that() or B#that()?
  end
end


class A;
  def that()
  end
end

class B < A
  include M
  def do_it()
    this()
  end

  def that() end
  private :that
end
   
??