From: Rick DeNatale Date: 2009-08-20T21:25:11+09:00 Subject: Re: #has_arguments? On Thu, Aug 20, 2009 at 8:03 AM, Brian Candler wrote: > No, it's not the same. Consider: > >  def foo(a = nil) >    m(a) >  end > >  foo() > > It saves replicating your default values all over the place, which isn't > very DRY. I didn't take Robert as meaning that the above is silly. > > Or you could more simply write > >  def m(a = nil) >    @a = a || 123 >  end 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, and seems much clearer. -- Rick DeNatale Blog: http://talklikeaduck.denhaven2.com/ Twitter: http://twitter.com/RickDeNatale WWR: http://www.workingwithrails.com/person/9021-rick-denatale LinkedIn: http://www.linkedin.com/in/rickdenatale