[mcclim-devel] small clim-lisp:defconstant improvement

Nikodemus Siivola nikodemus at random-state.net
Mon Jun 29 00:08:26 UTC 2009


I was recently somewhat burned (performance-wise) by
clim-lisp:defconstant being really a defvar.

Would something like the following be an acceptable substitute? It
remains portable, but allows implementations to do a much better job
for important cases like numeric constants:

(defmacro clim-lisp-patch:defconstant (symbol value &optional docu)
  (if (typep value '(or number character))
      `(cl:defconstant ,symbol ,value ,@(and docu (list docu)))
      `(defvar ,symbol ,value ,@(and docu (list docu)))))

Cheers,

 -- Nikodemus




More information about the mcclim-devel mailing list