From: gabriele renzi Date: 2005-08-12T02:06:10+09:00 Subject: Re: Yet Another useless Ruby 2 Idea mathew ha scritto: > > > No--the second definition of bar is only in scope within foo, so when > bar is called, the only visible definition is the first one, which > prints "ONE". Then foo is called, which prints "TWO". I tested my > examples before posting :-) actually, not, #bar just gets redefined overriding the former definition. There are no nested method in ruby (yet): irb(main):001:0> def bar irb(main):002:1> puts "ONE" irb(main):003:1> end => nil irb(main):004:0> irb(main):005:0* def foo irb(main):006:1> puts "TWO" irb(main):007:1> irb(main):008:1* def bar irb(main):009:2> puts "THREE" irb(main):010:2> end irb(main):011:1> end => nil irb(main):012:0> irb(main):013:0* bar ONE => nil irb(main):014:0> foo TWO => nil irb(main):015:0> bar THREE => nil