Home / Learn / 15 Concurrency and parallelism
15.8 Recap and reference
Page 9 of 9
15.8.1 For agents
una --json check . prints each diagnostic of this chapter with its code, message and primary span; none carries a repair edit, so the document reports "fixable":0, and una fix changes nothing. U2023 marks the outer name a task assigns; U2024 marks together, with each line of the block that is not a let; U0101 marks together or together for where it stands; U0103 marks async or await. In una --json test ., an example's trace lists the events of a block's tasks in task order, each event with its task's path in task. The compact rule: a together block or a together for gives the result of running its tasks one after another, in order, stopping at the first failure; a task reads outer names and never assigns them.
15.8.2 Recap
togetherwith two or moreletbranches runs them as tasks, and binds their names after the block, in order.- A branch sees the names bound before the block, never its siblings, and keeps its own clause.
together for x in xsruns one task per element and gives their values in list order.togetheris a statement;together foris a value: afterlet, in an assignment, or last in a block.- A task never assigns an outer name (U2023): return a value, and combine the list after the block.
- The first failure in order wins; later tasks are canceled, earlier ones run on.
- Effects are recorded in task order, but printed lines may appear in any order: print after the block.
15.8.3 Reference
- Construct pages:
together,for,let edit,if error,uses,example - Commands:
una run,una test,una build - Diagnostics: U0101, U0103, U1001, U2023, U2024, U3007
- Specification: structured concurrency, dynamic semantics, the native backend, capabilities and effects, errors
Next:16 Memory