OSDN Git Service

graphics/package.lisp: resolved defchain kickstart entries
authorGiulio De Stasio <giuliodestasio98@gmail.com>
Sat, 22 Jul 2023 22:59:21 +0000 (00:59 +0200)
committerGiulio De Stasio <giuliodestasio98@gmail.com>
Sat, 22 Jul 2023 22:59:21 +0000 (00:59 +0200)
graphics/package.lisp

index 1097199..5a4f5d9 100644 (file)
@@ -98,21 +98,23 @@ used on uninitialized data to bootstrap the data")
 (defparameter *map-path* nil
   "this is the path where the json file lived")
 
-;; FIXME: Still doesn't work
 (defun kick-start-chain ()
   (progn
-    (defparameter *execute-before* nil)
-    (defparameter *execute-in-viewpoint* nil)
-    (defparameter *execute-in-window* nil)
-    (defparameter *execute-after* nil)
+    (defvar *execute-before* nil)
+    (defvar *execute-in-viewpoint* nil)
+    (defvar *execute-in-window* nil)
+    (defvar *execute-after* nil)
     (defmacro defchain (chain-name where &body body)
-      (cond
-        ((eq where :before) (push chain-name *execute-before*))
-        ((eq where :viewpoint) (push chain-name *execute-in-viewpoint*))
-        ((eq where :window) (push chain-name *execute-in-window*))
-        ((eq where :after) (push chain-name *execute-after*))
-        )
-      `(defun ,chain-name ()
-         ,@body))))
+      `(progn
+         (defun ,chain-name ()
+           ,@body)
+         (cond
+           ((eq ,where :before) (push ',chain-name *execute-before*))
+           ((eq ,where :viewpoint) (push ',chain-name *execute-in-viewpoint*))
+           ((eq ,where :window) (push ',chain-name *execute-in-window*))
+           ((eq ,where :after) (push ',chain-name *execute-after*))
+           )
+         )
+      )))
 
 (kick-start-chain)