From: Brock Weaver Date: 2005-08-19T01:18:39+09:00 Subject: Re: unless statement... why oh why? DeMorgan's theorem and operator precedence in ruby. DeMorgan's theorem in a nutshell: (Not A) and (Not B) == Not (A or B) Your code is (Not A) and (Not B) == (Not A) or (B) See the difference? On 8/18/05, Zach Dennis 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 > > -- Brock Weaver [OBC]Technique