From: yamaoka Date: Wed, 16 Jun 1999 02:45:36 +0000 (+0000) Subject: (static-cond): New function. X-Git-Tag: apel-9_20~26 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b7bae01820fc0b13e9fd1f09dd19e19e3be6709a;p=elisp%2Fapel.git (static-cond): New function. --- diff --git a/static.el b/static.el index 7e21065..2a2a89d 100644 --- a/static.el +++ b/static.el @@ -69,6 +69,14 @@ 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 ;;;