[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Chicken-users] Problem with sxml-transforms html:begin translation rule
From: |
Scott Williams |
Subject: |
[Chicken-users] Problem with sxml-transforms html:begin translation rule |
Date: |
Fri, 13 Sep 2019 01:04:21 -0700 |
User-agent: |
mu4e 0.9.18; emacs 24.5.1 |
$ 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 yves.more-magic.net (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>"
elems
- "</HTML>"))))
+ "</HTML>")))))
)))
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Chicken-users] Problem with sxml-transforms html:begin translation rule,
Scott Williams <=