X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=static.el;h=b64440d65e8175075d7f52cffb5636dcba0642a4;hb=6104c81424d0d145a0171e008f74433140d96e11;hp=7e21065ec02c4af24d23bef532420692e2c7806e;hpb=a93dda0349df931cb035877eca672cefb89a399d;p=elisp%2Fapel.git diff --git a/static.el b/static.el index 7e21065..b64440d 100644 --- a/static.el +++ b/static.el @@ -51,13 +51,15 @@ (list (quote quote) (, bodyform)) (,@ (mapcar (if var - (lambda (h) - (` ((, (car h)) - (list (quote funcall) - (lambda ((, var)) (,@ (cdr h))) - (list (quote quote) (, var)))))) - (lambda (h) - (` ((, (car h)) (quote (progn (,@ (cdr h)))))))) + (function + (lambda (h) + (` ((, (car h)) + (list (quote funcall) + (function (lambda ((, var)) (,@ (cdr h)))) + (list (quote quote) (, var))))))) + (function + (lambda (h) + (` ((, (car h)) (quote (progn (,@ (cdr h))))))))) handlers)))))) (put 'static-defconst 'lisp-indent-function 'defun) @@ -69,10 +71,19 @@ The variable SYMBOL can be referenced at either compile-time or run-time." (eval (` (defconst (, symbol) (quote (, value)) (, docstring)))) (` (defconst (, symbol) (quote (, value)) (, docstring))))) +(defmacro static-cond (&rest clauses) + "`cond' expression but the car of each clause is evaluated at compile-time." + (while (and clauses + (not (eval (car (car clauses))))) + (setq clauses (cdr clauses))) + (if clauses + (cons 'progn (cdr (car clauses))))) + ;;; @ end ;;; -(provide 'static) +(require 'product) +(product-provide (provide 'static) (require 'apel-ver)) ;;; static.el ends here