aboutsummaryrefslogtreecommitdiffstats
path: root/examples/purity-test.lisp
diff options
context:
space:
mode:
authorJan Tuomi <jans.tuomi@gmail.com>2022-12-05 12:42:21 +0200
committerJan Tuomi <jans.tuomi@gmail.com>2022-12-05 14:21:53 +0200
commitbba047ae945ae7d7899d6e2c1610923bcedb0442 (patch)
tree4c442e6e09cc3f4ec65edb04bfafe93084045689 /examples/purity-test.lisp
parentac6b455f4a9be11d322551a927c4330532f9f184 (diff)
Implement purity checking
Diffstat (limited to 'examples/purity-test.lisp')
-rw-r--r--examples/purity-test.lisp20
1 files changed, 20 insertions, 0 deletions
diff --git a/examples/purity-test.lisp b/examples/purity-test.lisp
new file mode 100644
index 0000000..31e82d3
--- /dev/null
+++ b/examples/purity-test.lisp
@@ -0,0 +1,20 @@
+(let! f (\[x] x))
+(f 10)
+
+(let! g! (\![x] (print! x)))
+(g! "foo")
+
+(let! h (\[x] (g! x)))
+(h "bar")
+
+(let! main! (\![]
+ (print! (fmt "{0}\n" ["main"]))
+ ))
+
+(main!)
+
+(let! pure-main (\[]
+ (print! (fmt "{0}\n" ["pure-main"]))
+ ))
+
+(pure-main)