I thought in the following, foo should be true
$ irb
ruby-1.9.2-p0 > foo = true if !defined? foo || foo.nil?
=> nil
ruby-1.9.2-p0 > foo
=> nil
because foo was at first not defined, but the foo = true
part make it temporarily has a nil value, so the !defined
didn't catch it, but the foo.nil?
should catch it, and make it true... but why is it still nil?
this is related to http://stackoverflow.com/questions/3775402/rubys-foo-true-if-defined-foo-wont-work-as-expected