Truthiness

In dt many values can coerce into other types. You can also directly convert something to a boolean value with to-bool.

ยป "hello" to-bool pls
true

The rules for truthiness in dt are:

typetrue when:false when:
booltruefalse
intnon-zero positivezero or negative
floatnon-zero positivezero or negative
stringnot empty"" empty string
commanddefinedundefined
deferred commanddefinedundefined
quotenot empty[ ] empty quote

Conditions

Coming soon...