Skip to content

Instantly share code, notes, and snippets.

@jakehow
Created January 31, 2011 07:47
Show Gist options
  • Save jakehow/803752 to your computer and use it in GitHub Desktop.
Save jakehow/803752 to your computer and use it in GitHub Desktop.
nil weirdness
ruby-1.8.7-p249 > x = p.to_account
=> nil
ruby-1.8.7-p249 > !x
=> false
ruby-1.8.7-p249 > !nil
=> true
ruby-1.8.7-p249 > x
=> nil
ruby-1.8.7-p249 > x === nil
=> true
ruby-1.8.7-p249 > x.eql? nil
=> true
ruby-1.8.7-p249 > x.equal? nil
=> true
ruby-1.8.7-p249 > !x
=> false
ruby-1.8.7-p249 > !nil
=> true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment