boolean
Boolean values in Soul represent logical truth values:true and false. They are fundamental for conditional logic, comparisons, and control flow.
Boolean Literals
Soul supports two boolean literals:Boolean Operations
Boolean values work with logical operators:Comparison Operations
Comparison operations return boolean values:Boolean in Conditional Statements
Booleans are used in conditional logic:Boolean in Loops
Boolean conditions control loop execution:Boolean Functions
Functions can return boolean values:Truthy and Falsy Values
Soul has truthy and falsy values for conditions:Boolean with Ternary Operator
Boolean expressions work with ternary operators:Boolean in Collections
Booleans can be stored in collections:Complex Boolean Expressions
Combine multiple boolean operations:Boolean Constants
Define boolean constants for clarity:Best Practices
- Use meaningful names:
isActiveinstead offlag - Avoid double negatives:
isEnabledinstead ofisNotDisabled - Use explicit comparisons:
value == truewhen clarity is needed - Group complex conditions: Use parentheses for readability

