From: Robert Klemme Date: 2008-06-27T06:12:54+09:00 Subject: Re: question about defined? and y On 26.06.2008 22:32, Ben Bleything wrote: > On Fri, Jun 27, 2008, alandacosta@gmail.com wrote: >> The "!!" should take care of your nil situation when you want a true/ >> false. If "defined?(y)" is returning "method", that means you >> previously def'ed y ... maybe even in your .irbrc file (if called from >> irb). > > But I'm not sure when you ever actually *care* that it's either true > or false. nil is false, false is false, everything else is true. The > result is that you generally needn't care what defined? returns. I would go even as far as to not care what defined? actually does. I did not have use for it yet. I have observed that when I started Ruby with a bit of Perl background I felt that I needed it but quickly discovered that not. So, OP what do you need defined? for? Cheers robert