Commit fd67500c authored by Liam M. Healy's avatar Liam M. Healy
Browse files

Generate parameter-symbol-create in expansion

The expansion of define-parameter includes a parameter-symbol-create
form instead of just the export form, because the symbol needs to be
created as well as exported, which is what parameter-symbol-create
does. Now Antik can be loaded from compiled code without error.
parent 1e45852b
;; Global/local parameters to pass to functions
;; Liam Healy 2013-02-16 20:51:14HST variable-metadata.lisp
;; Time-stamp: <2013-05-26 18:55:57EDT parameters.lisp>
;; Time-stamp: <2013-05-28 23:20:42EDT parameters.lisp>
;; Copyright 2011, 2013 Liam M. Healy
;; Distributed under the terms of the GNU General Public License
......@@ -99,6 +99,7 @@
;;;;****************************************************************************
(defun parameter-symbol-create (category name synonyms)
"Create and export the symbol used to represent the parameter, including possibly making the appropriate package (category)."
(multiple-value-bind (symbol sym-plain)
(find-parameter-symbol category name)
(let* ((syns (mapcar (alexandria:curry 'find-parameter-symbol category) synonyms)))
......@@ -107,7 +108,7 @@
(ensure-package category)
(pushnew (find-package category) *categories*)
(export syns (package-name (symbol-package symbol)))
(values symbol syns `(export ',syns ,(package-name (symbol-package symbol)))))))
(values symbol syns))))
(defun parameter-post-definition
(symbol syns documentation type type-supplied-p value value-supplied-p attribute attribute-supplied-p)
......@@ -134,12 +135,13 @@
(category name
&key (value nil value-supplied-p) (type nil type-supplied-p) (attribute nil attribute-supplied-p) documentation synonyms)
"Define the parameter (global special variable) with the given name. It will be defined in the package named by category (which will be created if necessary), and exported from it."
(multiple-value-bind (symbol syns export-form)
(multiple-value-bind (symbol syns)
(parameter-symbol-create category name synonyms)
`(eval-when (:compile-toplevel :load-toplevel :execute)
,export-form
(defvar ,symbol)
(parameter-post-definition
(parameter-symbol-create ',category ,name ,synonyms)
;;,export-form
(defvar ,symbol)
(parameter-post-definition
',symbol ',syns ,documentation ',type ,type-supplied-p ,value ,value-supplied-p ,attribute ,attribute-supplied-p))))
;;; Test definition
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment