From c53563a25314d17a437e3723ed10e8c825711879 Mon Sep 17 00:00:00 2001 From: Giulio De Stasio Date: Sun, 23 Jul 2023 00:59:21 +0200 Subject: [PATCH] graphics/package.lisp: resolved defchain kickstart --- graphics/package.lisp | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/graphics/package.lisp b/graphics/package.lisp index 1097199..5a4f5d9 100644 --- a/graphics/package.lisp +++ b/graphics/package.lisp @@ -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) -- 2.11.0