Vsevolod
2008-07-06 19:19:19 UTC
I have experimented with the solution, that I've sent previously and
have found out, that it's better to place the macroexpansion part in
the TREE-TO-TEMPLATE function (instead of TREE-TO-COMMANDS). Thus it's
possible to support nested EMB's.
The diff looks like this:
@@ -11,12 +11,10 @@
;; normal tag
(process-tag element #'tree-to-template))
((listp element)
- ;; most likely a normal Lisp form (check if we
- ;; have nested HTM subtrees) or an EMB form
+ ;; most likely a normal Lisp form - check if we
+ ;; have nested HTM subtrees
(list
- (if (eql (car element) 'emb)
- (replace-htm (list 'htm (macroexpand-1 (cadr element)))
#'tree-to-template)
- (replace-htm element #'tree-to-template))))
+ (replace-htm element #'tree-to-template)))
(t
(if *indent*
(list +newline+ (n-spaces *indent*) element)
-
Vsevolod
have found out, that it's better to place the macroexpansion part in
the TREE-TO-TEMPLATE function (instead of TREE-TO-COMMANDS). Thus it's
possible to support nested EMB's.
The diff looks like this:
@@ -11,12 +11,10 @@
;; normal tag
(process-tag element #'tree-to-template))
((listp element)
- ;; most likely a normal Lisp form (check if we
- ;; have nested HTM subtrees) or an EMB form
+ ;; most likely a normal Lisp form - check if we
+ ;; have nested HTM subtrees
(list
- (if (eql (car element) 'emb)
- (replace-htm (list 'htm (macroexpand-1 (cadr element)))
#'tree-to-template)
- (replace-htm element #'tree-to-template))))
+ (replace-htm element #'tree-to-template)))
(t
(if *indent*
(list +newline+ (n-spaces *indent*) element)
-
Vsevolod