From: "David A. Black" Date: 2005-08-12T02:00:07+09:00 Subject: Re: Nested methods and define_method (was Re: Yet Another useless Ruby 2 Idea) Hi -- On Fri, 12 Aug 2005, mathew wrote: > gabriele renzi wrote: >> it is, I wrote that method nesting should be prohibited, thus your second >> interpretation is invalid and thus there is no ambiguity. > > Well, I disagree with prohibiting nested methods. > >> Nested method definitions are mostly useless anyway because of the method >> scoping (actually, I think I never saw an example of using a nested def >> instead of a define_method in some years of rubying :) > > What do you mean? When I try it, a nested method is scoped so that it is > only visible inside the method it's defined in. That's exactly the behavior > you want for nested methods to be useful. $ ruby -ve 'def x; def y; 1; end; end; x; p y' ruby 1.8.2 (2004-12-25) [i686-linux] 1 David -- David A. Black dblack@wobblini.net