Discussion:
Double sexp tree traversal
Slawek Zak
2009-02-26 18:13:32 UTC
Permalink
Hi,

Is it necessary to walk the tree two times in cl-who?

CL-USER> (cl-who:with-html-output-to-string (*standard-output*)
       (:one (:two)))
 0[7]: (CL-WHO::TREE-TO-TEMPLATE ((:ONE (:TWO))))
   1[7]: (CL-WHO::PROCESS-TAG (:ONE (:TWO))
                              #<Function TREE-TO-TEMPLATE>)
     2[7]: (CL-WHO::TREE-TO-TEMPLATE ((:TWO)))
       3[7]: (CL-WHO::PROCESS-TAG (:TWO) #<Function TREE-TO-TEMPLATE>)
       3[7]: returned ("<" "two" ">" "</" "two" ">")
     2[7]: returned ("<" "two" ">" "</" "two" ">")
   1[7]: returned
           ("<" "one" ">" "<" "two" ">" "</" "two" ">" "</" "one" ">")
 0[7]: returned
         ("<" "one" ">" "<" "two" ">" "</" "two" ">" "</" "one" ">")
 0[7]: (CL-WHO::TREE-TO-TEMPLATE ((:ONE (:TWO))))
   1[7]: (CL-WHO::PROCESS-TAG (:ONE (:TWO))
                              #<Function TREE-TO-TEMPLATE>)
     2[7]: (CL-WHO::TREE-TO-TEMPLATE ((:TWO)))
       3[7]: (CL-WHO::PROCESS-TAG (:TWO) #<Function TREE-TO-TEMPLATE>)
       3[7]: returned ("<" "two" ">" "</" "two" ">")
     2[7]: returned ("<" "two" ">" "</" "two" ">")
   1[7]: returned
           ("<" "one" ">" "<" "two" ">" "</" "two" ">" "</" "one" ">")
 0[7]: returned
         ("<" "one" ">" "<" "two" ">" "</" "two" ">" "</" "one" ">")

I use version:

$Header: /usr/local/cvsrep/cl-who/who.lisp,v 1.36 2008/03/27 23:17:55 edi Exp

Thanks, /S
Slawek Zak
2009-03-04 14:05:21 UTC
Permalink
Gah, it's macroexpanded twice! :)

/S
Post by Slawek Zak
Hi,
Is it necessary to walk the tree two times in cl-who?
CL-USER> (cl-who:with-html-output-to-string (*standard-output*)
(:one (:two)))
0[7]: (CL-WHO::TREE-TO-TEMPLATE ((:ONE (:TWO))))
1[7]: (CL-WHO::PROCESS-TAG (:ONE (:TWO))
#<Function TREE-TO-TEMPLATE>)
2[7]: (CL-WHO::TREE-TO-TEMPLATE ((:TWO)))
3[7]: (CL-WHO::PROCESS-TAG (:TWO) #<Function TREE-TO-TEMPLATE>)
3[7]: returned ("<" "two" ">" "</" "two" ">")
2[7]: returned ("<" "two" ">" "</" "two" ">")
1[7]: returned
("<" "one" ">" "<" "two" ">" "</" "two" ">" "</" "one" ">")
0[7]: returned
("<" "one" ">" "<" "two" ">" "</" "two" ">" "</" "one" ">")
0[7]: (CL-WHO::TREE-TO-TEMPLATE ((:ONE (:TWO))))
1[7]: (CL-WHO::PROCESS-TAG (:ONE (:TWO))
#<Function TREE-TO-TEMPLATE>)
2[7]: (CL-WHO::TREE-TO-TEMPLATE ((:TWO)))
3[7]: (CL-WHO::PROCESS-TAG (:TWO) #<Function TREE-TO-TEMPLATE>)
3[7]: returned ("<" "two" ">" "</" "two" ">")
2[7]: returned ("<" "two" ">" "</" "two" ">")
1[7]: returned
("<" "one" ">" "<" "two" ">" "</" "two" ">" "</" "one" ">")
0[7]: returned
("<" "one" ">" "<" "two" ">" "</" "two" ">" "</" "one" ">")
$Header: /usr/local/cvsrep/cl-who/who.lisp,v 1.36 2008/03/27 23:17:55 edi Exp
Thanks, /S
Edi Weitz
2009-03-05 20:14:05 UTC
Permalink
Hi Slawek,

Sorry for the late reply. I'm pretty busy, as usual.
Post by Slawek Zak
Gah, it's macroexpanded twice! :)
Yeah, I guessed it was something like that but had no time to check.

Edi.

Loading...