From c1713b4ea6c542fa2fe0d66b51c5b7b27fedf57a Mon Sep 17 00:00:00 2001 From: Jan Tuomi Date: Tue, 4 Oct 2022 15:21:56 +0300 Subject: Add import! --- examples/import.lisp | 3 +++ examples/maybe.lisp | 54 ++++++++++++++++++++++++++-------------------------- 2 files changed, 30 insertions(+), 27 deletions(-) create mode 100644 examples/import.lisp (limited to 'examples') diff --git a/examples/import.lisp b/examples/import.lisp new file mode 100644 index 0000000..d302562 --- /dev/null +++ b/examples/import.lisp @@ -0,0 +1,3 @@ +(import! M "examples/maybe.lisp") + +(print! (fmt "{0}\n" [(M:just 666)])) diff --git a/examples/maybe.lisp b/examples/maybe.lisp index dab7bf8..7cabfea 100644 --- a/examples/maybe.lisp +++ b/examples/maybe.lisp @@ -31,30 +31,30 @@ ; TESTING -(let! print-line! (\[s] - (print! (concat s "\n")))) - -(let! a (just 10)) -(let! b (nothing)) - -(map (+ 5) a) -(map (+ 5) b) - -(and-then (\[n] (just (+ n 5))) a) -(and-then (\[n] (just (+ n 5))) b) - -(let! m (just 10)) -(match m - (just _) - (print-line! (fmt "found just {0}!" [(unpack-just m)])) - (nothing) - (print-line! "found nothing!")) - -;; (let! exports [ -;; just -;; nothing -;; unpack-just -;; kind -;; map -;; and-then -;; ]) +;; (let! print-line! (\[s] +;; (print! (concat s "\n")))) + +;; (let! a (just 10)) +;; (let! b (nothing)) + +;; (map (+ 5) a) +;; (map (+ 5) b) + +;; (and-then (\[n] (just (+ n 5))) a) +;; (and-then (\[n] (just (+ n 5))) b) + +;; (let! m (just 10)) +;; (match m +;; (just _) +;; (print-line! (fmt "found just {0}!" [(unpack-just m)])) +;; (nothing) +;; (print-line! "found nothing!")) + +(let! exports [ + just + nothing + unpack-just + kind + map + and-then +]) -- cgit v1.3