diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2024-04-28 14:58:55 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2024-04-28 14:58:55 -0400 |
| commit | 3c0a8f0b899a343f43caf9c95147b2cf77a7b525 (patch) | |
| tree | b7193a8021ef9ab57c71319ecad797bf51849025 /test/lambdas.tm | |
| parent | 5910998a19aab5dab2c761aea946cfbb09a37918 (diff) | |
Syntax tweak: use ':' for blocks
Diffstat (limited to 'test/lambdas.tm')
| -rw-r--r-- | test/lambdas.tm | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/test/lambdas.tm b/test/lambdas.tm index a445540b..0ec0826b 100644 --- a/test/lambdas.tm +++ b/test/lambdas.tm @@ -1,13 +1,13 @@ -func make_adder(x:Int)-> func(y:Int)->Int +func make_adder(x:Int)-> func(y:Int)->Int: return func(y:Int) x + y -func suffix_fn(fn:func(t:Text)->Text, suffix:Text)->func(t:Text)->Text +func suffix_fn(fn:func(t:Text)->Text, suffix:Text)->func(t:Text)->Text: return func(t:Text) fn(t)++suffix -func mul_func(n:Int, fn:func(x:Int)->Int)-> func(x:Int)->Int +func mul_func(n:Int, fn:func(x:Int)->Int)-> func(x:Int)->Int: return func(x:Int) n*fn(x) -func main() +func main(): >> add_one := func(x:Int) x + 1 >> add_one(10) = 11 |
