diff options
| author | Jan Tuomi <jans.tuomi@gmail.com> | 2022-10-04 15:21:56 +0300 |
|---|---|---|
| committer | Jan Tuomi <jans.tuomi@gmail.com> | 2022-12-05 14:21:53 +0200 |
| commit | c1713b4ea6c542fa2fe0d66b51c5b7b27fedf57a (patch) | |
| tree | 84f580f25f4480525880759d069d0597686b3e8f /examples | |
| parent | 7a498e3a581f26b81fc9c2c9c7af8448a7f84f0f (diff) | |
Add import!
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/import.lisp | 3 | ||||
| -rw-r--r-- | examples/maybe.lisp | 44 |
2 files changed, 25 insertions, 22 deletions
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! print-line! (\[s] +;; (print! (concat s "\n")))) -(let! a (just 10)) -(let! b (nothing)) +;; (let! a (just 10)) +;; (let! b (nothing)) -(map (+ 5) a) -(map (+ 5) b) +;; (map (+ 5) a) +;; (map (+ 5) b) -(and-then (\[n] (just (+ n 5))) a) -(and-then (\[n] (just (+ n 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! 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! exports [ + just + nothing + unpack-just + kind + map + and-then +]) |
