language.types · type ·
function of A to B (oracle only)
A callable value accepting A and returning B. Check the selected backend admission before using it.
A focused reference with a complete example. Numeric widths and experimental types still depend on the selected backend.
function of A to B (oracle only)Status: experimental
Function pointer call
Use ordinary named top-level functions in product code. Explore function values only through the explicit comparison oracle.
cpu · complete-program · type checked
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")
}
project.mech
package = "tests.compiler.kyber.functionPointerCall"
version = "0.1.0"
backend = "kyber"
osTarget = "windows"
archTarget = "x64"
selfContainedApp = false
Notes and source
demonhunterlabs/app/lib/yeho-language-reference.ts