On 02/23/2012 10:35 PM, Stas Boukarev wrote:
 (defmacro defconst (name value&optional (documentation nil docp))
> -  `(eval-when (:execute :load-toplevel :compile-toplevel)
> -     (unless (boundp ',name)
> -       ,(if docp
> -            `(defconstant ,name ,value ,documentation)
> -            `(defconstant ,name ,value)))))
> +  (let ((global (intern (format nil "%%~A" (symbol-name name)))))
> +    `(progn
> +       (defvar ,global ,value ,@(and docp `(,documentation)))
> +       (define-symbol-macro ,name (load-time-value ,global t)))))
Does it really have to be constant? Using just defparameter or defvar should
be as good.
I don't know how it's being used now, but it was written to follow "The Reasoned Schemer".  Though there were some unavoidable inconsistencies in translating that to a lisp-2 environment, I didn't want dynamically scoped globals to be one of them.