While it is always possible to use mixins or method overrides to modify the Bool coercions, by default what values are considered to be truthy and what values are considered to be falsy?
Note: this question was asked previously, but unfortunately it is so old its content is completely out of date and useless is modern Raku.
There are no truthy values, as each type decides for itself via a
.Boolmethod that is called in boolean contexts. For built-in types, the following returnFalsewhen their.Boolmethod is called.0(exceptRatofx/0wherex≠0)FailurePromiseprior to being kept/broken.StrDistancewhose before/after is the same.Junction, when you expect it to.Otherwise, any defined value by default returns
Truewhen its.Boolmethod is called. This includes theStr'0',NaN, and zero-length range (0^..^0) that in other languages might not be truthy.This answer is intended as a quick reference. See this answer for a more detailed discussion.