3 ms·
If I understood your comments in this thread correctly what you are calling an inconsistency is that there are many values x for which if x then print "OK"
by omaranto 14y ago
If I understood your comments in this thread correctly what you are calling an inconsistency is that there are many values x for which
if x then print "OK" end
prints "OK" but for which
x == true
returns false. Is that right? If it is, then this is completely normal for languages that allow non-booleans in if statements. For example, x=2 is "inconsistent" in very many languages such as C, Python, Ruby, Perl, most Lisps, etc. I've never heard of this Squirrel language before, but if I read the docs correctly, x=2 is also "inconsistent" in Squirrel. In fact I'd be very surprised by a language that had no "inconsistent" values of x and that didn't achieve this by simply restricting x to be Boolean in an if.