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.
-Patrick

On 8/18/05, Zach Dennis <zdennis / mktec.com> wrote:
> thr = Thread.new{}
> # thread dies
> 
> "HERE" if not thr or not thr.alive? # this works!!
> "HERE" unless thr or thr.alive? # doesn't work!! WHY?
> "HERE" unless thr and thr.alive? # works, but why?
> 
> I dont see why the unless/and works when the unless/or should be the one
> short-circuting no?
> 
> Thanks,
> 
> Zach
>