Programming A Fuzzy Time Function

Ha Ling Peak In The Clouds

Macros in Common Lisp

updated: Tue 30 Jul 2019


#octobanana

5 years ago

c8b94eea


@cd4310f4 Thanks for the tip! I also removed the redundant progn.

1 2 3 4 5 6 7 8 9 10
@@ -1,6 +1,7 @@
 (defmacro deffun (name params &body body)
   (let ((var (surround-with-asterisks name)))
-    `(progn (defvar ,var
+    `(defvar ,var
       '(defun ,name ,params
         ,@body))
-    (eval ,var))))
+    `(defun ,name ,params
+      ,@body)))

anon

5 years ago

cd4310f4


just put the code again after the DEFVAR. No need for EVAL...

Back to Top

Programming A Fuzzy Time Function

Ha Ling Peak In The Clouds