# to

Connect map key/value or function input/output types

Last updated: 2026-09-09

Package: language | Status: experimental

Tags: collections, complete-program, cpu, keyword, yeho

Use a map for lookup by identity or name when sequential scanning would hide the intent.

```yh
to
```


## Function pointer call

Use a map for lookup by identity or name when sequential scanning would hide the intent.

Verification: type checked

```yh
Twice(int value) returns int
{
    return value * 2
}

AddThree(int value) returns int
{
    return value + 3
}

function of int to int callback = Twice
int doubled = callback(21)
callback = AddThree
int shifted = callback(doubled)

if shifted == 45
{
    Console.Log("function-pointer-ok")
}



```

Save this beside start.yh as project.mech:

```toml
package = "tests.compiler.kyber.functionPointerCall"
version = "0.1.0"
backend = "kyber"
osTarget = "windows"
archTarget = "x64"
selfContainedApp = false




```

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/word--to/complete --backend cpu-oracle -o /tmp/yeho-example
/tmp/yeho-example
```


Map literals and list literals both use brackets; to distinguishes a map pair.

Collections are experimental.

Source: yeho/parser_types.cpp parseMapTypeRef; parser_expressions.cpp parseListOrMapLiteralExpression

AI training permission: https://demonhunterlabs.com/ai-use
