aboutsummaryrefslogtreecommitdiff
path: root/test/lambdas.tm
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2024-07-14 14:13:23 -0400
committerBruce Hill <bruce@bruce-hill.com>2024-07-14 14:13:23 -0400
commitd3f14cf53cf857b90184900a726e3ee0875dea80 (patch)
treeb1f89d5be1781ce4ed1384446bc53b51118d0350 /test/lambdas.tm
parent4e6d8162bfa7149c3b947c6c759f82c1f52ef4d7 (diff)
Support nested lambda closures
Diffstat (limited to 'test/lambdas.tm')
-rw-r--r--test/lambdas.tm10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/lambdas.tm b/test/lambdas.tm
index 15a8f23b..cb5bf3d4 100644
--- a/test/lambdas.tm
+++ b/test/lambdas.tm
@@ -30,3 +30,13 @@ func main():
>> abs100 := mul_func(100, Int.abs)
>> abs100(-5)
= 500
+
+ // Test nested lambdas:
+ outer := "Hello"
+ fn := func():
+ return func():
+ return func():
+ defer: |{outer}
+ return outer
+ >> fn()()()
+ = "Hello"