I'm having problems 'properly' using defparameter (or defvar or defconstant) in my code. Occasionally I find myself trying to code something like:
- Code: Select all
(defparameter *functions* `((label1 . ,#'function1) (label2 ,#'other-function)))
(defun function1 (something)
(defun other-function ()
And when I load the entire file to start editing it, I get the error that function1 is not fboundp, which I suppose it isn't at the time the defparameter is executed. I'm now left wondering, what is 'proper style' for common lisp in this situation?
How and where do I initialise the *functions* variable in my file such that it is properly assigned after the file has been loaded?
I'm also still really unclear on the way lisp load and compile and eval-when works. I read the Gigamonkeys Common Lisp Book's chapter about it three times, and I checked the CLHS, but it still isn't making much sense to me Probably if I correctly understood this I could solve the problem above myself. If anyone has some good reading on this, I'd love to know about it.
Any advice/tips/tricks on this would be greatly appreciated