From: ptkwt@...1.aracnet.com (Phil Tomson) Date: 2001-10-30T08:51:02+09:00 Subject: [ruby-talk:23780] Re: why is true and false = true ? In article <20011029232122.42EF13B24@helium.ruby-lang.org>, Ned Konz wrote: >On Monday 29 October 2001 03:10 pm, Phil Tomson wrote: >> Bizarre, here's the code: >> >> tf = true && false >> puts "true && false = #{tf}" >> tf = true and false >> puts "true and false = #{tf}" >> >> Prints: >> true && false = false >> true and false = true >> >> Not what I would expect... >> Seems like a bug to me. > >Why is that? > >tf = true and false > >is the same as > >(tf = true) and false > >since assignment has higher precedence than "and". > Oh, so I've got to do: tf = (true and false) #=> false precedence... I should'a figured... Phil