Thank you for correcting me, Brian. I got a little post happy I guess. :) On 8/18/05, Brian Schr?der <ruby.brian / gmail.com> wrote: > On 18/08/05, Brock Weaver <brockweaver / gmail.com> wrote: > > Sorry, to be a little more clear, the following 3 lines are all > > equivalent (notice the parens in line 2): > > > > if not thr or not thr.alive? > > unless (thr or thr.alive?) > > unless thr and thr.alive? > > > > It's easiest for me to think of "unless" == "if not". What's funny is > > that "if not" is no longer than "unless", so the "unless" keyword > > doesn't buy us much. > > > > I am quite shure that the above is not correct. > > if (not thr or not thr.alive?) > is equal to > if not (thr or thr.alive?) > and > unless (thr and thr.alive?) > and > unless thr and thr.alive? > > Proof: > > irb(main):008:0> [[false, false], [false, true], [true, false], [true, > true]].map do | a, b | [("No Parens" unless a or b), ("Parens" unless > (a or b))] end > => [["No Parens", "Parens"], [nil, nil], [nil, nil], [nil, nil]] > > regards, > > Brian > > -- > http://ruby.brian-schroeder.de/ > > Stringed instrument chords: http://chordlist.brian-schroeder.de/ > > -- Brock Weaver [OBC]Technique