Add query-action #403
Labels
Area/Lang
Relates to the Ballerina language specification
Type/Improvement
Enhancement to language design
Milestone
A query-action provides a convenient syntax for iteration that handles errors (see #402).
Like a query-expr, a query-action can be used with a value iterable with any error type. The result of the query-action is the termination value of the iterator. Thus if the source type is infallibly iterable, the result will be () and can be ignored.
The do-clause is executed as follows:
Variables bound by the clauses of the query expression should be treated as final (as with foreach) so cannot be modified by assignments in the block statement.
This is part of #340.
The text was updated successfully, but these errors were encountered: