You can sometimes get away with this, but beware of unexpected string coercions. When you want “1”, you may actually get “true” and wind up with unexpected results.
I’ve found that, whenever I feel the need for something like this, a simple if() is clearer and easier.
If you really need this, send me an email explaining a bit more about the situation. We could, for example, rig up something like
that explicitly coerces a boolean to a numeric value.