aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Okay <cbeok@protonmail.com>2020-08-13 13:23:18 -0500
committerColin Okay <cbeok@protonmail.com>2020-08-13 13:23:18 -0500
commit2e2263a011846cb04dce9538079d2d5e9b7724d0 (patch)
tree0a787abc6065d2de92d50fa4bad4e993638d60a4
parent49380ae714f2a32ec440b5c2f5f52b67d5b30a03 (diff)
added lazyness eg
-rw-r--r--examples.lisp19
1 files changed, 19 insertions, 0 deletions
diff --git a/examples.lisp b/examples.lisp
index 8d9204c..fdfdbcf 100644
--- a/examples.lisp
+++ b/examples.lisp
@@ -15,3 +15,22 @@
#$(mapcar #$$(if (> $$x 9) (- $$x 9) $$x) $digits) ;; <-- nested partial eval
#$(zerop (mod (apply #'+ $digits) 10))))
+
+
+(enable-lazy-eval-reader-macros)
+
+(defun lazy-eg1 ()
+ (let* ((four #~(print (+ 2 2)))
+ (sum #~(+ (print 1) (print 2) (print 3) #!four)))
+ (list #!sum #!sum)))
+
+;; prints
+;; 1
+;; 2
+;; 3
+;; 4
+
+;; returns
+;; (10 10)
+
+