News for hackers. Stuff that matters.
Re:Lua: Good, bad, and ugly parts by omaranto on Saturday March 09, 2013 @09:28PM (#5350447)
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.

There are no comments on this comment yet.