Problem in xml-type-tags
Posted: Wed Aug 06, 2008 5:29 pm
I'm working on an application where I need to frequently alter the xml-type-tags and want to return to a default, so I wrote a macro, with-xml-type-tags:
I'm getting some odd results using it:
...prints out:
That looks like some sort of weird alignment problem... any ideas?
Code: Select all
(define-macro (with-xml-type-tags)
(letex ((old-tags (xml-type-tags))
(new-tags (args 0))
(body (cons 'begin (rest (args)))))
(apply 'xml-type-tags 'new-tags)
(let ((res body))
(apply 'xml-type-tags 'old-tags)
res)))
Code: Select all
(println "1: " (xml-type-tags))
(println "2: "
(with-xml-type-tags (nil nil nil nil)
(xml-type-tags)))
(println "3: " (xml-type-tags))
Code: Select all
1: ("TEXT" "CDATA" "COMMENT" "ELEMENT") ; before macro
2: (nil nil nil nil) ; in macro body
3: ("\000\0005{" "COMME" "ELEMENT" "\000\0005{\000\000\000") ; after macro