---
title: "6.8 Recap and reference"
url: https://una-lang.org/en/learn/functions/recap-and-reference/
release: v0.4.0
edition: "0.2"
---

# 6.8 Recap and reference

## 6.8.1 For agents

:::agents
`una --json check .` gives every diagnostic with its `code`, `message`, `primary` span and `repairs`. U2004 and U7001 carry exact edits, which `una fix .` applies. U3004's repair, a `uses` line, widens authority and is a description with no edit: add it by hand. U5001 carries ranked repairs that need a decision. `una contract module.name` prints a function's whole header, declared or inferred. The compact rule: *label every argument after the first; `x.f(args)` is `f(x, args)`; a call that prints is a line or a `let` of its own; a block's last line is the result; a `pub` header declares its `uses`; callers rely only on the header.*
:::

## 6.8.2 Recap

:::recap
- Label every argument after the first; a name equal to its parameter's name counts as its label, and labeled arguments may come in any order.
- `lamp.rate()` is `rate(lamp)`: the value before the dot is the first argument. Without parentheses, a field of that name comes first.
- Arguments are evaluated left to right, inner calls first; a call that prints is a line or a `let` of its own.
- A function's result is its body's value: the one line of the short form, or the last line of a block. Una has no `return`.
- A statement may throw away only a `Unit` value; bind any other with `let`.
- A caller knows a result only from the header: its type and its `ensures`.
- A `pub` function writes its `uses`; a private one may leave them out, and `una contract` shows what the checker inferred.
:::

## 6.8.3 Reference

:::reference
- Construct pages: [functions: forms, clauses, labels, method calls](https://una-lang.org/en/docs/language/functions/), [`ensures` and `result`](https://una-lang.org/en/docs/language/functions/ensures/), [`uses`](https://una-lang.org/en/docs/language/capabilities/uses/), [canonical form](https://una-lang.org/en/docs/language/canonical-form/)
- Commands: [`una contract`](https://una-lang.org/en/docs/cli/contract/), [`una report`](https://una-lang.org/en/docs/cli/report/), [`una fmt`](https://una-lang.org/en/docs/cli/fmt/), [`una fix`](https://una-lang.org/en/docs/cli/fix/)
- Diagnostics: [U0101](https://una-lang.org/en/docs/errors/U0101/), [U0102](https://una-lang.org/en/docs/errors/U0102/), [U0103](https://una-lang.org/en/docs/errors/U0103/), [U2001](https://una-lang.org/en/docs/errors/U2001/), [U2004](https://una-lang.org/en/docs/errors/U2004/), [U2005](https://una-lang.org/en/docs/errors/U2005/), [U2006](https://una-lang.org/en/docs/errors/U2006/), [U2011](https://una-lang.org/en/docs/errors/U2011/), [U3001](https://una-lang.org/en/docs/errors/U3001/), [U3004](https://una-lang.org/en/docs/errors/U3004/), [U3013](https://una-lang.org/en/docs/errors/U3013/), [U5001](https://una-lang.org/en/docs/errors/U5001/), [U6003](https://una-lang.org/en/docs/errors/U6003/), [U7001](https://una-lang.org/en/docs/errors/U7001/)
- Specification: [functions and contracts](https://una-lang.org/en/docs/spec/04-functions-and-contracts/), [grammar](https://una-lang.org/en/docs/spec/02-grammar/), [capabilities and effects](https://una-lang.org/en/docs/spec/05-capabilities-and-effects/), [verification](https://una-lang.org/en/docs/spec/12-verification/), [canonical form](https://una-lang.org/en/docs/spec/15-canonical-form/)
:::
