Documentation Language: Swift

Structure

ATLLambdaExpression

ATL Lambda Expression for OCL iterator operations.

struct ATLLambdaExpression

Overview

Lambda expressions represent function-like constructs used in OCL collection operations such as select, collect, exists, and forAll. They encapsulate both parameter binding and expression evaluation within iterator contexts.

Overview

Lambda expressions in ATL follow OCL semantics where an iterator variable is bound to each collection element during evaluation. The lambda body is evaluated once for each element with the parameter bound to that element.

Example Usage

// Equivalent to OCL: collection->select(item | item.age > 18)
let lambda = ATLLambdaExpression(
    parameter: "item",
    body: ATLNavigationExpression(
        source: ATLVariableExpression(name: "item"),
        property: "age"
    )
)

Topics

Operators

Initializers

?
init(parameter:body:)

Creates a lambda expression.

Instance Properties

V
body

The expression body of the lambda.

V
parameter

The parameter name for the lambda variable.

Instance Methods

F
evaluate(in:)

Evaluates the lambda expression in the standard context.

F
evaluateWith(parameterValue:in:)

Evaluates the lambda expression with a parameter value bound.

Default Implementations

Relationships

Conforms To