From: Ned Konz Date: 2001-10-30T08:21:23+09:00 Subject: [ruby-talk:23777] Re: why is true and false = true ? 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". -- Ned Konz currently: Stanwood, WA email: ned@bike-nomad.com homepage: http://bike-nomad.com