------ art_179389_29459873.1169607123707 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline On 1/23/07, Charles Oliver Nutter <charles.nutter / sun.com> wrote: > > Evan Phoenix wrote: > > 1) Because of the current semantics, most ruby programmers treat > > self.foo the same as foo(). I'm very wary of making functional style > > behave much differently than normal method call style. It adds another > > layer and complexity and strangeness that I believe we do not need nor > > want. In fact, I think that it's a bug that private methods can only be > > called using functional style. The method dispatch mechanism can easily > > detect that the receiver of the method is the same all the current self > > end look for private methods. > > I agree here as well. Setting simpler logic for dispatching should be > the goal, not more complicated logic. Having funcall logic now do more > complicated dispatch logic than self.call logic will only make a > confusing situation worse. I think both are worthwhile goals -- a real private visibility, and undisturbed "self" calling semantics. Could it be possible to have " self.foo" have funcall semantics if caller self? class C def foo "f" end private :foo def bar self.foo end end C.new.bar # "f" C.new.foo # raise private method /Nick ------ art_179389_29459873.1169607123707 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline On 1/23/07, <b class mail_sendername">Charles Oliver Nutter</b> <<a href ailto:charles.nutter / sun.com">charles.nutter / sun.com</a>> wrote:<div><span class mail_quote"></span><blockquote class mail_quote" styleorder-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> Evan Phoenix wrote:<br>> 1) Because of the current semantics, most ruby programmers treat<br>> self.foo the same as foo(). I'm very wary of making functional style<br>> behave much differently than normal method call style. It adds another <br>> layer and complexity and strangeness that I believe we do not need nor<br>> want. In fact, I think that it's a bug that private methods can only be<br>> called using functional style. The method dispatch mechanism can easily <br>> detect that the receiver of the method is the same all the current self<br>> end look for private methods.<br><br>I agree here as well. Setting simpler logic for dispatching should be<br>the goal, not more complicated logic. Having funcall logic now do more <br>complicated dispatch logic than self.call logic will only make a<br>confusing situation worse.</blockquote><div><br>I think both are worthwhile goals -- a real private visibility, and undisturbed "self" calling semantics. Could it be possible to have " self.foo" have funcall semantics if caller self?<br><br>class C<br> def foo<br> "f"<br> end<br> private :foo<br> def bar<br></div> self.foo<br> end<br>end<br>C.new.bar # t; "f"<br> C.new.foo # t; raise private method<br><br>/Nick<br></div> ------ art_179389_29459873.1169607123707--