# delegate

Forward a method through a field

Last updated: 2026-09-09

Package: language | Status: generated-cpp-only

Tags: cpu, data, keyword, language, yeho

Prefer thing and ordinary functions for Kyber-ready programs. Use class and interface only while evaluating the explicit oracle route.

```yh
delegate
```


## Complete program

Forward behavior to an owned identity object using an explicit method.

Verification: type checked

```yh
// Explicit forwarding is the readable alternative shown here.
class Identity
{
    Name() -> text { return "Nova" }
}
class Player
{
    Identity identity = Identity()
    Name() -> text { return this.identity.Name() }
}
Player player = Player()
Console.Log(player.Name())

```

Save this beside start.yh as project.mech:

```toml
manifestVersion = "2"
package = "api.example.word__delegate"
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/word--delegate/complete --backend cpu-oracle -o /tmp/yeho-example
/tmp/yeho-example
```


Class and interface dispatch is generated-C++ only in Yeho Core 2026.1.

Generic classes and interfaces are not admitted even though the parser reserves research syntax.

Source: yeho/docs/language/conformance-2026.1.json: class-and-interface-dispatch; parser_declarations.cpp

AI training permission: https://demonhunterlabs.com/ai-use
