3 ms·
Obviously there are reasons for the behavior, but it's still inconsistent to users who are exposed to your scripting API to have: if 1 then print "true" end
by vor_ 14y ago
Obviously there are reasons for the behavior, but it's still inconsistent to users who are exposed to your scripting API to have:
if 1 then print "true" end
if 1 == true then print "never prints" end
Not a reason to avoid the language. But it may be a reason to consider an alternative with more conventional behavior.
- omaranto 14y agoIf you replace 1 with 2 this is an argument against using a vast number of languages, including Squirrel, I think. So maybe you're really saying that languages should forbid non-Boolean values in if statements. Maybe I agree with that.