From: James Coglan Date: 2009-03-20T21:18:31+09:00 Subject: Re: nested methods --001636c924d904b1ae04658bf4c3 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit 2009/3/20 Brian Adkins > James Coglan writes: > > > [Note: parts of this message were removed to make it a legal post.] > > > > 2009/3/20 Leo > > > >> > Can someone explain why the nested method hides the outer method? > >> > >> There are no nested methods in ruby (similar to smalltalk, eiffel, > >> java and unlike scheme, python etc.). > > > > > > This statement could confuse people given the above. Clearly you can > define > > methods inside other methods, the point is that the 'inner' method is not > > local to the outer one. The inner one becomes defined in the same scope > as > > the outer one, > > Isn't being defined in the same scope the antithesis of nesting? > > > and does not remember the environment it was created in. > > Methods are not closures, unlike blocks/procs/lambdas. > Depends what you mean by nesting, which was supposed to be my point -- that the methods are lexically nested but not dynamically nested. In other words their lexical nesting does not imply lexical scope or closures in this case. --001636c924d904b1ae04658bf4c3--