From: Dave Thomas Date: 2002-01-24T11:45:01+09:00 Subject: Re: a can be true and false moontoeki@aol.com (Sung Moon) writes: > a can be true and false at the same time > > a = "" > if a != true; p "a is false" ; end > if a; p "a is true" ; end > > this produces: > > a is false > a is true > > It means a can be true and false at the same time. > Am I right? No. 'a' is neither true nor false. 'a' is a String. In boolean contexts (such as in an 'if' statement), anything apart from 'false' and 'nil' makes the test succeed. So: "a" != true #=> true (a is a string) if a #=> test succeeds (a is not false of nil) Is just the same as if (99) .... if (99 == TRUE) ... in C Dave