From 2e2263a011846cb04dce9538079d2d5e9b7724d0 Mon Sep 17 00:00:00 2001 From: Colin Okay Date: Thu, 13 Aug 2020 13:23:18 -0500 Subject: added lazyness eg --- examples.lisp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) 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) + + -- cgit v1.2.3