From: Tobias Reif Date: 2001-11-22T03:45:52+09:00 Subject: [ruby-talk:26057] Re: call_myself Michael Neumann wrote: >>Sometimes, this is not obvious, because there might me a lot of other code. >> >>def some_method arg >> # many LOC >> # some_method mod_arg >>end >> >>Is there something that makes it clear that the method calls itself? > > But do we really need this? I've never had problems with unwanted > recursions. me neither. It's not about unwanted recursions: it's about making it clearer what happens in the code, to make it more accessible, and easier to understand. If in a method def, after *many* LOC, there is a call to the method itself, it is not obvious that it's a call to itself. --- def fact(n) if n == 0 1 else n * call_myself(n-1) end end --- call_myself would make that clear. It doesn't offer any added functionality; it could be implemented to make the language easier to understand. Can it be implemented in a few lines of Ruby code? Tobi -- Tobias Reif http://www.pinkjuice.com/myDigitalProfile.xhtml go_to('www.ruby-lang.org').get(ruby).play.create.have_fun http://www.pinkjuice.com/ruby/