# Lists

list of T is an ordered typed value container with literals, indexing, count, and explicit mutation methods.

Last updated: 2026-09-09

Package: language | Status: experimental

Tags: Add, Contains, Remove, collections, count, cpu, language, list, of, yeho

Use a list when order and duplicates matter.

```yh
list of Type
[value, value]
list[index]
list.Add(value)
```


## Complete lists example

Use a list when order and duplicates matter.

Verification: type checked

```yh
list of text inventory = ["map", "torch"]
inventory.Add("key")
for item in inventory { Console.Log(item) }

```

Save this beside start.yh as project.mech:

```toml
manifestVersion = "2"
package = "api.example.language__lists"
version = "0.1.0"
languageEdition = "yeho-core-2026.1"

[app]
kind = "headless"

```

Extract the example archive beside the yeho and dolphin checkouts. This example requires those source dependencies and a current developer compiler.

```sh
./yeho/build/dolphin-metal/yehoc ./api-examples/language--lists/complete --backend cpu-oracle -o /tmp/yeho-example
/tmp/yeho-example
```


Collections are experimental in the 2026.1 conformance edition.

Index bounds remain part of the runtime contract.

Source: yeho/language-core.md §3.4; tests/compiler/kyber/list-runtime/start.yh

AI training permission: https://demonhunterlabs.com/ai-use
