From b26d274c67d8dd52111ba769a4dd8118bbdd0234 Mon Sep 17 00:00:00 2001 From: Colin Okay Date: Thu, 3 Feb 2022 08:27:04 -0600 Subject: pared the library down to just the reader macro and nesting macro --- examples.lisp | 36 ------------------------------------ 1 file changed, 36 deletions(-) delete mode 100644 examples.lisp (limited to 'examples.lisp') diff --git a/examples.lisp b/examples.lisp deleted file mode 100644 index fdfdbcf..0000000 --- a/examples.lisp +++ /dev/null @@ -1,36 +0,0 @@ - -(defpackage #:lt-examples - (:use #:cl #:lambda-tools)) - -(enable-partial-eval-reader-macro) - - -;; http://rosettacode.org/wiki/Luhn_test_of_credit_card_numbers -(defun luhn (n) - (>> n #'reverse - #$(map 'list #'digit-char-p $char) - #$(mapcar #'* - (loop :for i :upto (length $digits) :collect (1+ (mod i 2))) - $digits) - #$(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