zarqon
Well-known member
I discovered recently that the ASH interpreter sometimes allows strings to be used with boolean operators, but only if a string is specified on the left side of the operator.
Can anyone explain what's going on here? What strings would need to be supplied for A and B to make (A && B) return true? What operation is (A || B) actually performing?
Or, conversely, is this a bug?
> ash ("foo" && "bar")
Returned: false
> ash ("foo" && "foo")
Returned: false
> ash ("foo" && true)
Returned: false
> ash (true && "bar")
Cannot apply operator && to true (boolean) and bar (string) (zlib.ash)
Returned: void
> ash string foo; if (foo) print("bar")
"if" requires a boolean conditional expression (zlib.ash)
Returned: void
> ash ("a" || "b")
Returned: b
> ash ("c" || "b")
Returned: b
Can anyone explain what's going on here? What strings would need to be supplied for A and B to make (A && B) return true? What operation is (A || B) actually performing?
Or, conversely, is this a bug?