aboutsummaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/impure-concept.lisp2
-rw-r--r--examples/purity-test.lisp20
2 files changed, 21 insertions, 1 deletions
diff --git a/examples/impure-concept.lisp b/examples/impure-concept.lisp
index f769424..893b29e 100644
--- a/examples/impure-concept.lisp
+++ b/examples/impure-concept.lisp
@@ -9,4 +9,4 @@
(let! f (\[x] x))
; impure function
-(let! g (\![x] (print! x)))
+(let! g! (\![x] (print! x)))
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)