summaryrefslogtreecommitdiff
path: root/tests/clos3.bth
diff options
context:
space:
mode:
authorubq323 <ubq323@ubq323.website>2024-07-03 12:01:22 +0100
committerubq323 <ubq323@ubq323.website>2024-07-03 12:06:42 +0100
commitd8d3770f88d6acc37620d6577fa5a0b026fb1231 (patch)
tree65808bc58319a3002b6690b1811ab02fbf4ddc2d /tests/clos3.bth
parent9f4e10da9df486b4c048ec2fedbe28491059b739 (diff)
add some failing tests for closures
Diffstat (limited to 'tests/clos3.bth')
-rw-r--r--tests/clos3.bth16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/clos3.bth b/tests/clos3.bth
new file mode 100644
index 0000000..4742391
--- /dev/null
+++ b/tests/clos3.bth
@@ -0,0 +1,16 @@
+(defn (counter)
+ (let (a 0)
+ (fn ()
+ (set a (+ a 1))
+ (say a))))
+(def c1 (counter))
+(def c2 (counter))
+(c1)
+(c1)
+(c2)
+(c2)
+(c2)
+(c2)
+(c1)
+(c1)
+