From: Gunnar Andersson Date: 2001-10-30T08:20:40+09:00 Subject: [ruby-talk:23776] RE: why is true and false = true ? > tf = true and false Try only that line in the ruby interp and you get an error message that should show you what is wrong: -:1: warning: found = in conditional, should be == So the assignment becomes part of the conditional expression because of precedence rules. "and" has lower precedence than "&&" if I remember correctly so that's why: tf = true && false is interpreted (correctly) as tf = (true && false) but tf = true and false is apparently interpreted (incorrectly, according to what you expected) as: (tf = true) and false i.e. you have assigned true to tf /Gunnar __________________________________________________ Do You Yahoo!? Make a great connection at Yahoo! Personals. http://personals.yahoo.com