From: Zach Dennis Date: 2005-08-19T01:31:25+09:00 Subject: Re: unless statement... why oh why? Patrick Fernie wrote: > When you check thr directly, since thr is not nil (it is still a > Thread object, just dead), those parts of the test evaluate "true". > So, in: > "HERE" if not thr or not thr.alive? > the "not thr" evaluate false (since thr is an object, and therefore > not nil), but the "not thr.alive?" evaluates true (not false), so > "HERE" is printed since one of the tests is true > > in: > "HERE" unless thr or the.alive? > "thr" is not nil, so it's true, so we short circuit and don't print, > since it's an unless. > > in: > "HERE" unless the and the.alive? > "thr" is not nil, so it's true, but thr.alive? is false, so the "and" > overall evaluates to false, so "HERE" is printed since it's an unless. > > Hope that makes sense. Yes this lets my brain see things in a very simplistic fashion. Thank you for taking the time to respond! Zach