Programming

(Lisp) Global lexical variable implementation by Kent M. Pitman

steloflute 2023. 10. 10. 03:13

Source: Global lexical variable? (google.com)

 

Global lexical variable?

> > I'm working my way through _On_Lisp_ (Paul Graham, 1994), and got to > chapter 20 where he discusses continuation passing macros. Now, I > understand all about the macros and how they work, but his example > does a > > (setq *cont* #'identity) > > to s

groups.google.com

(defmacro deflexical (var &optional init doc)
    `(progn (define-symbol-macro ,var (get ',var 'lexical))
    (setf ,var ,init)
    (setf (get ',var 'lexical-doc) ',doc)
    ',var))