From: zdennis Date: 2007-01-25T14:47:07+09:00 Subject: Re: new method dispatch rule (matz' proposal) -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Evan Phoenix wrote: > 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." > > This change means that no extended lookup is performed to find private > methods, only the module that defined the current method is looked for > the new method. > This means that no subclasses can call superclass > private methods, but really thats ok. A subclass probably shouldn't be > digging in and calling the private methods of it's superclass anyway, > the method isn't very private then. This is similar to how Java treats private methods. Would this implementation break Object#send when trying to access those private methods? Zach -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFFuEZoMyx0fW1d8G0RAhgiAJ4pztsX0XRsTEX5pGC70TI1fHFcuACeLJmR xWgeHYCLnV9py61ZBPQOVUM= =0wu1 -----END PGP SIGNATURE-----