# Know what your action changes

Make changes to shared collections intentional.

Last updated: 2026-09-09

Package: recipes | Status: complete-program

Tags: cpu, recipe

We have used functions that calculate and return a new value. Now imagine an action whose job is to add something to the caller's existing list. That intent should be visible when you read its parameters. The original binding in this example asks to work with the caller's admitted source value. This is an experimental, type- and target-checked feature. It is not permission to alias every kind of value.

```yh
start.yh
```


## Know what your action changes

Make changes to shared collections intentional.

Verification: type checked

```yh
AddSnack(list of text original basket, text snack)
{
    basket.Add(snack)
}

list of text picnic = []
AddSnack(picnic, "berry")
Console.Log(Text.From(picnic.count))
```

Save this beside start.yh as project.mech:

```toml
manifestVersion = "2"
package = "api.example.recipe__ownership"
version = "0.1.0"
languageEdition = "yeho-core-2026.1"

[app]
kind = "headless"

```

Expected output:

```text
1
```

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/recipe--ownership/program --backend cpu-oracle -o /tmp/yeho-example
/tmp/yeho-example
```


Call AddSnack twice with different foods, then print the collection with a for loop.

Source: demonhunterlabs/app/lib/yeho-walkthrough.ts

AI training permission: https://demonhunterlabs.com/ai-use
