From e529e0e48c999fccb216bd3f3bc948abe22dbe76 Mon Sep 17 00:00:00 2001 From: Jan Tuomi Date: Tue, 6 Dec 2022 17:37:43 +0200 Subject: Clean up examples, stdlib --- examples/purity-test.milch | 25 ------------------------- 1 file changed, 25 deletions(-) delete mode 100644 examples/purity-test.milch (limited to 'examples/purity-test.milch') diff --git a/examples/purity-test.milch b/examples/purity-test.milch deleted file mode 100644 index f7c77e5..0000000 --- a/examples/purity-test.milch +++ /dev/null @@ -1,25 +0,0 @@ -; utils - -(let println! (\![x] - (print! (fmt "{0}\n" [x])))) - -; pure vs. impure demo - -; this is a pure function -(let f (\[x] x)) - -(f 10) ; works - -; this is an impure function -(let g! (\![x] (println! x))) - -(g! "foo") ; works - -; this is a pure function that tries to call an impure function -(let h (\[x] (g! x))) - -(h "bar") -; error: cannot call impure function in pure context -; when calling function g! at examples/purity-test.milch:19:15 -; in a function definition at examples/purity-test.milch:19:12 -; when calling function h at examples/purity-test.milch:21:1 -- cgit v1.3