From 0cd815a88dba26389086e0cf9821f1fc57789f9d Mon Sep 17 00:00:00 2001 From: yamaoka Date: Thu, 26 Sep 2002 23:49:56 +0000 Subject: [PATCH] * luna.el (luna-make-clear-method-cache-function): Redefine it as a compiler macro. --- ChangeLog | 5 +++++ luna.el | 37 +++++++++++++++++++------------------ 2 files changed, 24 insertions(+), 18 deletions(-) diff --git a/ChangeLog b/ChangeLog index a6efbd6..f604fa9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2002-09-26 Katsumi Yamaoka + * luna.el (luna-make-clear-method-cache-function): Redefine it as + a compiler macro. + +2002-09-26 Katsumi Yamaoka + * luna.el (luna-make-clear-method-cache-function): New function. (luna-define-method): Use it. diff --git a/luna.el b/luna.el index 24912dc..979f9a0 100644 --- a/luna.el +++ b/luna.el @@ -133,25 +133,26 @@ The optional 2nd arg SLOTS is a list of slots CLASS will have." (defmacro luna-class-slot-index (class slot-name) (` (get (luna-class-find-member (, class) (, slot-name)) 'luna-slot-index))) -(defun luna-make-clear-method-cache-function (name) - "Make a function to clear cached method functions. +(eval-when-compile + (defmacro luna-make-clear-method-cache-function (name) + "Make a function to clear cached method functions. NAME is a symbol which has a cache as the property `luna-method-cache'. -This function is exclusively used by the macro `luna-define-method'." - (if (fboundp 'unintern) ;; Emacs 19.29 and later, XEmacs 19.14 and later. - '(mapatoms - (function - (lambda (s) - (if (memq (symbol-function sym) (symbol-value s)) - (unintern s cache)))) - cache) - (` (let ((new (make-vector (length cache) 0))) - (mapatoms - (function - (lambda (s) - (or (memq (symbol-function sym) (symbol-value s)) - (set (intern (symbol-name s) new) (symbol-value s))))) - cache) - (put '(, name) 'luna-method-cache new))))) +This macro will be unbound at run-time." + (if (fboundp 'unintern) ;; Emacs 19.29 and later, XEmacs 19.14 and later. + ''(mapatoms + (function + (lambda (s) + (if (memq (symbol-function sym) (symbol-value s)) + (unintern s cache)))) + cache) + '(` (let ((new (make-vector (length cache) 0))) + (mapatoms + (function + (lambda (s) + (or (memq (symbol-function sym) (symbol-value s)) + (set (intern (symbol-name s) new) (symbol-value s))))) + cache) + (put '(, name) 'luna-method-cache new)))))) (defmacro luna-define-method (name &rest definition) "Define NAME as a method of a luna class. -- 1.7.10.4