# function

Describe an oracle-only function value or lambda

Last updated: 2026-09-09

Package: language | Status: generated-cpp-only

Tags: complete-program, cpu, functions, keyword, yeho

Use ordinary named top-level functions in product code. Explore function values only through the explicit comparison oracle.

```yh
function
```


## Function pointer call

Use ordinary named top-level functions in product code. Explore function values only through the explicit comparison oracle.

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--function/complete --backend cpu-oracle -o /tmp/yeho-example
/tmp/yeho-example
```


Lambdas and local functions are generated-C++ only.

Generic functions are unavailable.

Source: yeho/advanced-features-2026.1.json; conformance lambdas-local-functions

AI training permission: https://demonhunterlabs.com/ai-use
