Structure
AQLConditionalExpression
Represents conditional expressions (if-then-else) in AQL.
struct AQLConditionalExpression
Overview
Conditional expressions evaluate a condition and return one of two values based on whether the condition is true or false.
Syntax
if condition then thenExpression else elseExpression endif
Example Usage
// if age >= 18 then 'Adult' else 'Minor'
let conditional = AQLConditionalExpression(
condition: ageComparisonExpr,
thenExpression: AQLLiteralExpression(value: "Adult"),
elseExpression: AQLLiteralExpression(value: "Minor")
)
Null Handling
If the condition evaluates to null or non-boolean, it is treated as false.
Topics
Initializers
?
init(condition:thenExpression:elseExpression:)
Creates a conditional expression.
Instance Properties
V
condition
The condition expression (should evaluate to Boolean).
V
elseExpression
The expression to evaluate if condition is false or null.
V
thenExpression
The expression to evaluate if condition is true.
Instance Methods
F
evaluate(in:)
Evaluates the expression within the specified execution context.