diff options
| author | Baitinq <[email protected]> | 2025-02-23 21:25:39 +0100 |
|---|---|---|
| committer | Baitinq <[email protected]> | 2025-02-23 21:25:39 +0100 |
| commit | 741f9cc124b43b5e24b30110a584c82bc8c211e5 (patch) | |
| tree | 93080a0138820ca201c7e7275dcfd3aa8c6e9a3d /examples | |
| parent | Misc: Fix llvm error message cleanup (diff) | |
| download | interpreter-741f9cc124b43b5e24b30110a584c82bc8c211e5.tar.gz interpreter-741f9cc124b43b5e24b30110a584c82bc8c211e5.tar.bz2 interpreter-741f9cc124b43b5e24b30110a584c82bc8c211e5.zip | |
Codegen: Support functions as function params
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/11.src | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/examples/11.src b/examples/11.src index adaabe4..5289f9a 100644 --- a/examples/11.src +++ b/examples/11.src @@ -1,12 +1,13 @@ let main = () => i64 { - let x = (a: i64) => i64 { - print(a); - return 1; + let y = (f: (i64) => i64, x: i64) => i64 { + return f(x); }; - let y = (f: (i64) => i64) => i64 { - return f(2); + let id = (a: i64) => i64 { + print(a); + print(12); + return a; }; - return y(x); + return y(id, 2); }; |