From 4002b8988c799a904ef1f359d4267ef4ad80cba3 Mon Sep 17 00:00:00 2001 From: Jan Tuomi Date: Mon, 5 Dec 2022 14:19:12 +0200 Subject: Rename project to Milch --- examples/impure-concept.milch | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 examples/impure-concept.milch (limited to 'examples/impure-concept.milch') diff --git a/examples/impure-concept.milch b/examples/impure-concept.milch new file mode 100644 index 0000000..893b29e --- /dev/null +++ b/examples/impure-concept.milch @@ -0,0 +1,12 @@ +; What color is your function? +; Impure functions are functions that can call both pure and impure functions. +; Pure functions can only call pure functions. +; Impure function names end in an exclamation mark (!) by convention. +; The top-level context is impure but has special rules +; related to `import!`, `let!`, and other builtins. + +; pure function +(let! f (\[x] x)) + +; impure function +(let! g! (\![x] (print! x))) -- cgit v1.3