On Jan 25, 2007, at 7:02 AM, Yukihiro Matsumoto wrote: > Hi, > > In message "Re: new method dispatch rule (matz' proposal)" > on Thu, 25 Jan 2007 13:58:25 +0900, Evan Phoenix > <evan / fallingsnow.net> writes: > > |The more this discussion goes on, the more I worry that Joe Q Public > |programmer isn't going to be able to properly grasp these new rules. > | > |Everyone here is pretty much the creme de la creme of ruby core > |developers and we're all still having troubles get our minds around > |it (or at least I am). > | > |Let me propose a change to the rules that might help clean them up. > |Change rules 3 and 4 to be one rule that reads: > | > |"If functional style calling is used, say foo(1), foo is looked up > |first in the method table of the defining class as a private method. > |If it is not found, normal dispatch occurs." > > 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. > > - ordinary style call will look for > > (3) public methods up from the receiver's class to Kernel. > private > methods will be skipped. > > (b) Charles Nutter's proposal > > - functional style call will look for > > (1) any methods up from defining class to Kernel > > - 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. > > (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. > (3) Ordinary style calls will skip any private methods. Looks good. > Are above summary OK, Charles, Evan? > > For your note, MRI has implemented something similar to Evan's > proposal. > > matz. >