From: Brian Candler Date: 2009-08-20T22:32:08+09:00 Subject: Re: #has_arguments? Rick Denatale wrote: > But, unless I'm missing something subtle, THIS is what Robert was > calling silly, since as far as I can tell, this > > def m(a=123) > @a = a > end > > Has exactly the same effect I don't think so: # prog1.rb def m(a=123) @a = a end def a @a end def foo(x=nil) m(x) end foo puts "The result is #{a.inspect}" # shows nil # prog2.rb def m(a=nil) @a = a || 123 end def a @a end def foo(x=nil) m(x) end foo puts "The result is #{a.inspect}" # shows 123 -- Posted via http://www.ruby-forum.com/.