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

# 3.9 Recap and reference

## 3.9.1 For agents

:::agents
`una --json check .` prints each diagnostic with its `code`, `message`, `primary` span and `repairs`; a refuted obligation, U5001, also carries its `obligation` and a `counterexample`, and its repairs, from a guard to a `requires`, are descriptions only. U0007 carries an exact edit, which `una fix .` applies; the U0101s, U0006 and U2001 are repaired by hand, since the right form is the author's choice. The compact rule: *join texts with interpolation, never `+`; name a text literal before it goes in braces; a condition is a `Bool`, and comparisons do not chain; a one-line `if` has `else` and branches of one type; guard a `slice` or a division with `if` or `and`.*
:::

## 3.9.2 Recap

:::recap
- A text is written between double quotes on one line; `\"`, `\\`, `\{`, `\}`, `\n`, `\t` and `\u{…}` are its escapes.
- Build a text from values with interpolation, `"{units} x {sku}"`; there is no `+` for texts, and no text literal inside the braces.
- `.len` counts characters, and `==` compares texts exactly, case and spaces included.
- For a prelude function `f`, or your own, `t.f(args)` is the call `f(t, args)`; chain such calls: `typed.trim.to_upper`.
- `slice` needs positions inside the text, and `replace` a pattern that is not empty: the checker proves both at every call.
- A condition is a `Bool`: compare, then join with `and`, `or` and `not`; the right side of `and` runs, and is proved, only when the left side holds.
- `if c then a else b` chooses a value: both branches have one type, `else` is required, and the `then` branch knows that `c` holds.
:::

## 3.9.3 Reference

:::reference
- Construct pages: [literals and operators](https://una-lang.org/en/docs/language/lexical-structure/), [built-in types](https://una-lang.org/en/docs/language/types/), [`let` and `if`](https://una-lang.org/en/docs/language/control-flow/), [`example`](https://una-lang.org/en/docs/language/examples/example/)
- Guides: [work with text](https://una-lang.org/en/docs/guides/text/)
- Standard library: [the prelude](https://una-lang.org/en/docs/std/) (`Text`, `Bool`, `trim`, `starts_with`, `is_digits`), [text](https://una-lang.org/en/docs/std/text/) (`slice`, `replace`, `contains_text`, `ends_with`, `to_upper`, `to_lower`, `trim_start`, `trim_end`), [the built-in methods](https://una-lang.org/en/docs/std/builtin/) (`.len`)
- Diagnostics: [U0004](https://una-lang.org/en/docs/errors/U0004/), [U0005](https://una-lang.org/en/docs/errors/U0005/), [U0006](https://una-lang.org/en/docs/errors/U0006/), [U0007](https://una-lang.org/en/docs/errors/U0007/), [U0101](https://una-lang.org/en/docs/errors/U0101/), [U2001](https://una-lang.org/en/docs/errors/U2001/), [U5001](https://una-lang.org/en/docs/errors/U5001/)
- Specification: [lexical structure](https://una-lang.org/en/docs/spec/01-lexical-structure/), [grammar](https://una-lang.org/en/docs/spec/02-grammar/), [types](https://una-lang.org/en/docs/spec/03-types/), [core IR](https://una-lang.org/en/docs/spec/09-core-ir/), [verification](https://una-lang.org/en/docs/spec/12-verification/), [the standard library](https://una-lang.org/en/docs/spec/14-standard-library/), [text](https://una-lang.org/en/docs/spec/22-text/)
:::
