From: Phillip Gawlowski Date: 2008-04-11T14:37:01+09:00 Subject: Re: var = nil if false; p var.nil? #=> true | bug of the day ? -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Arie Kusuma Atmaja wrote: | I tested it using Ruby 1.8.6 patch 111 and also Ruby 1.9.0 (revision 15968). | | var = nil if false | var.nil? #=> true | | I actually saw it from tobi's blog, then I discussed with a perler who | loves ruby as well, here's a copy paste. (Bottomline: is it a feature | or a bug????) irb(main):001:0> something = "something" if false => nil irb(main):002:0> something_else = nil => nil irb(main):003:0> something_else.class => NilClass irb(main):004:0> exit - -- Phillip Gawlowski Twitter: twitter.com/cynicalryan ~ My life needs a rewind/erase button. -- Calvin -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkf++QEACgkQbtAgaoJTgL/0pgCgpnN3q2Ka1pPXwa7M4HmDZEvW 1t8AoJtxM8KASS4LHSmXe57vrzYC1Ney =vxup -----END PGP SIGNATURE-----