Problem with sxml-transforms html:begin translation rule

Previous Topic Next Topic
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Problem with sxml-transforms html:begin translation rule

Scott Williams

$ grep -i version *
sxml-transforms.setup:  `((version "1.4.1")

$ csi -version
Version 4.11.0 (rev ce980c4)
linux-unix-gnu-x86-64 [ 64bit manyargs dload ptables ]
compiled 2016-05-28 on (Linux)

To reproduce:
$ csi
#;1> (use sxml-transforms)
#;2> (SXML->HTML '(html:begin "title" "body"))

Error: bad argument count - received 2 but expected 3: #<procedure>

        Call history:

        <syntax>  (SXML->HTML (quote (html:begin "title" "body")))
        <syntax>  (quote (html:begin "title" "body"))
        <syntax>  (##core#quote (html:begin "title" "body"))
        <eval>  (SXML->HTML (quote (html:begin "title" "body"))) <--

A patch that seems to fix the problem, but I could have easily missed something:

diff --git a/chicken/apply-limit-fixes.scm b/chicken/apply-limit-fixes.scm
index 919e695..a6b5417 100644
--- a/chicken/apply-limit-fixes.scm
+++ b/chicken/apply-limit-fixes.scm
@@ -113,11 +113,13 @@
                 ; Handle a nontraditional but convenient top-level element:
                 ; (html:begin title <html-body>) element
-     (html:begin . ,(lambda (tag title elems)
+     (html:begin . ,(lambda (tag title+elems)
+      (let ((title (car title+elems))
+    (elems (cdr title+elems)))
         (list "Content-type: text/html"         ; HTTP headers
               nl nl                            ; two nl end the headers
               "<HTML><HEAD><TITLE>" title "</TITLE></HEAD>"
-              "</HTML>"))))
+              "</HTML>")))))

Chicken-users mailing list
[hidden email]