X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=luna.el;h=e66d26575e0f9f81864f25ec017c9f9a8fc785de;hb=f3019a9f4a7d1479d0f46cd61c24125acc277e3d;hp=65c647a00376dc852992958b6fc39ac0efbc1d2a;hpb=14165a378c8d3ab1f287d0c167398f98724c3b22;p=elisp%2Fflim.git diff --git a/luna.el b/luna.el index 65c647a..e66d265 100644 --- a/luna.el +++ b/luna.el @@ -27,6 +27,15 @@ (eval-when-compile (require 'cl)) +(eval-when-compile (require 'static)) + +(static-condition-case nil + :symbol-for-testing-whether-colon-keyword-is-available-or-not + (void-variable + (defconst :before ':before) + (defconst :after ':after) + (defconst :around ':around))) + (defmacro luna-find-class (name) "Return the luna-class of the given NAME." `(get ,name 'luna-class)) @@ -52,6 +61,13 @@ If SLOTS is specified, TYPE will be defined to have them." ',slots)) (defun luna-define-class-function (type &optional parents slots) + (static-condition-case nil + :symbol-for-testing-whether-colon-keyword-is-available-or-not + (void-variable + (let (key) + (dolist (slot slots) + (setq key (intern (format ":%s" slot))) + (set key key))))) (let ((oa (make-vector 31 0)) (rest parents) parent name