# Re: setting nil to zero

**URL:** <https://www.ruby-forum.com/t/re-setting-nil-to-zero/72278>\
**Category:** Ruby\
**Created:** [February 23, 2006, 12:27pm UTC](https://www.ruby-forum.com/t/re-setting-nil-to-zero/72278 "2006-02-23T12:27:06Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![PeSSSSaS\_Botp](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/ecd19e/32.png) [@PeSSSSaS\_Botp](https://www.ruby-forum.com/u/PeSSSSaS_Botp)\
**Post date:** [February 23, 2006, 12:27pm UTC](https://www.ruby-forum.com/t/re-setting-nil-to-zero/72278/1 "2006-02-23T12:27:06Z")

</div>

Robert K. [[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)] wrote:

#Why so complicated? Why not just  
#class NilClass

# def +(n) n end

#end

why can i not see the simple light? 🙂

#Note, I recommend to use the veriant with 0 as default value for Hash  
#lookups because that avoids tampering with standard classes.

thanks for the advice, Robert.  
kind regards -botp

#Cheers

# 

# robert

# 

# 

#
