Qu

to_bool

Builtin index · Collections & strings

result = to_bool(x)

Input: x · Output: result

What it is

For a Str, x is parsed, not weighed: "true"/"false" (any case) and any number spelling work, and anything else errors — because a config file holding "false" means false, and truthiness would call that non-empty string true. For every other type this is exactly Qu's own truthiness, the same rule if and while use.

Overloads

One call shape — this function is not overloaded.

CodeInputOutputDescription
result = to_bool(x)
x Str, number, or stringnot documented yet
result —
Returns a Bool.

Examples

No documentation example calls this form yet. The Collections & strings chapter is where one belongs.