Commit ed774f95e8c461dc5a592edf2dc90e88d82c2f28

Thomas de Grivel 2014-03-06T01:39:15

Allow definition of unbound template variables.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
diff --git a/template.lisp b/template.lisp
index 5e52ff9..8bc276d 100644
--- a/template.lisp
+++ b/template.lisp
@@ -67,8 +67,10 @@
 				 bindings)
 	 ,@body))))
 
-(defmacro define-template-var (name value &optional doc)
-  `(defvar ,(template-var-key name) ,value ,doc))
+(defmacro define-template-var (name &optional (value nil value-p) doc)
+  (if value-p
+      `(defvar ,(template-var-key name) ,value ,doc))
+      `(defvar ,(template-var-key name)))
 
 ;;  Template reader