Automated recompilation in emacs / slime live

Given this situation:

(defmacro mac1 ...)

(defun func1 () 
  (mac1 ...))

Overriding mac1a living environment will not affect func1, until it is recompiled itself.

Is there a way to get emacs lisp or to automatically recompile func1when recompiling mac1?

Something like this in the source would be acceptable:

(watch
  (defmacro mac1 ...))

(on-signal (mac1)
  (defun func1 ...))

Not so difficult to implement, but I would rather avoid rethinking the wheels.

+4
source share
2 answers

. SBCL (. manual), sb-ext:*evaluator-mode*, ​​ :interpret, . - . , .

slime slime-who-macroexpands. , , , , Common Lisp (swank), emacs.

+5

, LispWorks . , SBCL .

, :

(defmacro foo ()
  `(list 1 2 3))

(defun bar () (first (foo)))
(defun baz () (second (foo)))

, foo:

CL-USER 11 > (who-calls 'foo)
(BAZ BAR)

:

CL-USER 12 > (mapcar 'compile (who-calls 'foo))
;;;*** Warning in BAZ: The definition of BAZ is already compiled.
;;;*** Warning in BAR: The definition of BAR is already compiled.
(BAZ BAR)

LispWorks who-calls, , /.

Edit Callers Continue Tags Search, , . / , .

+1

All Articles