On 10/17/07, Robert Dober <robert.dober / gmail.com> wrote:
> On 10/16/07, Rick DeNatale <rick.denatale / gmail.com> wrote:
> > On 10/16/07, Robert Dober <robert.dober / gmail.com> 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 ;)
>
> <snip>
> > > 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 <G>

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/