Understand Truthiness and Null Safety
mainLoon does not have null, nil, or undefined. Instead, it uses Option and Result types to handle absence and errors.
Truthiness Rules
A value is truthy unless it 'says no' (false) or 'says nothing' ((), None).
Falsy values:
false()(unit)None
Truthy values include:
0(integer)0.0(float)""(empty string)#[](empty collection)[Some x](anySomewrapper, even ifxisfalse)
Pattern: Unwrapping Values
To safely unwrap Option values while testing truthiness, use:
[if-let [x expr] then else][when-let [x expr] body…]- Predicates
some?andnone?for exact complement testing.