From b7bae01820fc0b13e9fd1f09dd19e19e3be6709a Mon Sep 17 00:00:00 2001 From: yamaoka Date: Wed, 16 Jun 1999 02:45:36 +0000 Subject: [PATCH] (static-cond): New function. --- static.el | 8 ++++++++ 1 file changed, 8 insertions(+) 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 ;;; -- 1.7.10.4