From: Rick DeNatale Date: 2007-10-17T20:55:27+09:00 Subject: Re: nil.to_i returning zero On 10/17/07, Robert Dober wrote: > On 10/16/07, Rick DeNatale wrote: > > On 10/16/07, Robert Dober wrote: > > > > > Nevertheless one question remains, where is the border between > > > a += 1 > > > a << 3 > > > a << ( :a=>42 ) > > > a << ?a > > > > For these I'd draw the border at mutating operators. > Reasonable choice I have to admit ;) > > > > > that is weird. > > > > And going a bit too far I would say. > ok that was actually what I wanted you hear saying ;) > > > > Afer all I wasn't even necessarily prepared to push for NilClass#+ > But how would you implement > a +=1 for a being nil? Been there, done that From two days ago: class NilClass def +(aNumber) aNumber end def -(aNumber) 0 - aNumber end ... -- Rick DeNatale My blog on Ruby http://talklikeaduck.denhaven2.com/