Kent M Pitman <email@example.com> wrote:
| I tried to get global lexicals into the language, but the attempt failed.
| See info on failed X3J13 issue PROCLAIM-LEXICAL at
| There's no provision for it in the language, but it's an easy user
| program to write. DEFINE-SYMBOL-MACRO is the operator you need,
| and you can google for prior discussion on how to set it up.
Here's a version I posted just a few months ago:
(defmacro deflex (var val &optional (doc nil docp))
(let ((backing-var (intern (concatenate 'string
(defparameter ,backing-var ,val ,doc)
,@(when docp `((setf (documentation ',var 'variable) ,doc)))
(define-symbol-macro ,var ,backing-var))))
p.s. Reminder: If you're running CMUCL-19c or earlier, you will
need the path to MACROEXPAND-1 that I posted on 2006-12-18
or you will have problems with SETF expanders which reference
DEFLEX'd variable names.
Rob Warnock <firstname.lastname@example.org>
627 26th Avenue <URL:http://rpw3.org/>
San Mateo, CA 94403 (650)572-2607