From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 97246 invoked by alias); 7 Jun 2017 14:17:12 -0000 Mailing-List: contact kawa-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: kawa-owner@sourceware.org Received: (qmail 97166 invoked by uid 89); 7 Jun 2017 14:17:11 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.6 required=5.0 tests=AWL,BAYES_00,FOREIGN_BODY1,GIT_PATCH_2,KAM_LAZY_DOMAIN_SECURITY autolearn=no version=3.3.2 spammy=Vous, UD:www.w3.org, wwww3org, xmlns X-HELO: smtps-n.oca.eu Received: from smtps-n.oca.eu (HELO smtps-n.oca.eu) (192.54.174.167) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 07 Jun 2017 14:17:04 +0000 Received: from [192.168.109.88] (natoca100-13.unice.fr [134.59.100.13]) by smtps-n.oca.eu (Postfix) with ESMTPSA id 66F3A80495 for ; Wed, 7 Jun 2017 16:17:06 +0200 (CEST) From: Damien MATTEI To: kawa@sourceware.org Subject: Re: xml literals Date: Wed, 07 Jun 2017 14:17:00 -0000 User-Agent: KMail/1.9.6 References: <201705151611.09622.Damien.Mattei@unice.fr> <3fbfb5fb-fbcb-b772-45c5-e330112a8498@bothner.com> <201706061126.16579.Damien.Mattei@unice.fr> In-Reply-To: <201706061126.16579.Damien.Mattei@unice.fr> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <201706071617.05973.Damien.Mattei@unice.fr> X-IsSubscribed: yes X-SW-Source: 2017-q2/txt/msg00093.txt.bz2 i checked in my Dropbox history at what point did the code begin to compile= with error and issued a diif on the files and get this: [mattei@moita Jkawa]$ diff DBtoWebObserversKawa.scm DBtoWebObserversKawa_fi= rst_bug.scm 287c287 < (html:td html-literal-table)) --- > (html:td align: "center" html-literal-table)) seems that the simple fact to add an attribute makes the errors. Le Tuesday 06 June 2017 11:26:16 Damien MATTEI, vous avez =C3=A9crit=C2=A0: >=20 > Le Monday 15 May 2017 20:51:11 Per Bothner, vous avez =C3=A9crit=C2=A0: > > I checked in a fix, in both the master and kawa-2.4 branches. > >=20 > > The bug only happened when the value of (html:td result) is not used. > > You might say: But it is used in: > > (set! html-literal-table-data-code > > (html:td result)) > >=20 > > No, because html-literal-table-data-code is not used, so the assignment > > is ignored (except for possible side-effects). >=20 >=20 > hello Per, >=20 > it seems the bug is still active under some circumstances, > i have made a few modif. in the code and even if the literal is used i ha= ve the same error: >=20 > mattei@moita Jkawa]$ java -cp /home/mattei/kawa-2.4/lib/kawa.jar:/home/m= attei/NetBeansProjects/Sidonie/build/web/WEB-INF/classes kawa.repl --output= -format html -C DBtoWebObserversKawa.scm > (compiling DBtoWebObserversKawa.scm to eu.oca.kawafunct.DBtoWebObserversK= awa) > Exception in thread "main" java.lang.Error: gnu.kawa.xml.MakeElement does= not implement Externalizable > at gnu.expr.LitTable.error(LitTable.java:122) > at gnu.expr.LitTable.writeObject(LitTable.java:282) > at gnu.expr.LitTable.emit(LitTable.java:85) > at gnu.expr.Compilation.generateBytecode(Compilation.java:2210) > at gnu.expr.Compilation.process(Compilation.java:1943) > at gnu.expr.ModuleInfo.loadByStages(ModuleInfo.java:306) > at gnu.expr.ModuleInfo.loadByStages(ModuleInfo.java:288) > at kawa.repl.compileFiles(repl.java:780) > at kawa.repl.processArgs(repl.java:441) > at kawa.repl.main(repl.java:820) >=20 > i have make some development in the code, and i cannot tell exactly what = is the new instructions causing the same error again, > i compiled it with the latest stable kawa-2.4 binary, i suppose your fixs= are in the binary too. >=20 > i have provided the source code in attachment, it should compile till it = reach the error the same way on your host than on mine (i have commeted out= some include scheme files from my library > but there is no concern about that to compile) >=20 > youn can compile it with your 2.4 kawa version like this: > java -cp kawa-2.4.jar kawa.repl --output-format html -C DBtoWebObserversK= awa.scm >=20 > i suppose the news instructions causing the trouble are in those part of = my code: >=20 > in a let i assign option-lst to '(DIR: "LTR" BORDER: 1 width: 315 id: "ta= ble_observateurs") >=20 > and use it here: >=20 > ;; HTML table with options > ;; Kawa offers simple slicing: @ not in Scheme R7RS=20 > (set! html-literal-table=20 > (html:table @option-lst @literal-rows-list)) >=20=20=20=20=20=20 > ;; HTML > (set! html-literal > (html:td align: "center" html-literal-table)) >=20=20=20=20=20=20 > (set! html-literal-str (html-literal:toString)) >=20=20=20=20=20=20=20 > (display-msg-var-nl "DBtoWebObserversKawa : work : html-literal-str= =3D " html-literal-str) >=20=20=20=20=20=20 > (display-msg-var-nl "DBtoWebObserversKawa : work : res =3D " res) >=20=20=20=20=20=20 > (append-string-to-result html-literal-str) >=20 > but i also add some change in the literals in the WHILE loop before, > is uppose if i revert all the changes it will compile again at some point= ... >=20 > i had made some test in REPL before coding and all was good exept one tim= e the REPL exit to shell after an error,=20 > i have made a lot of test here is a sample that lead to error in shell (i= admit my literal input was strange...): > [mattei@moita bin]$ ./kawa --output-format html > #|kawa:1|# (html:td "foo") > foo > #|kawa:2|# (define td1 (html:td "foo")) > #|kawa:3|# (define td-lst (list td1 td1 td1)) > #|kawa:4|# td-lst > foo foo foo > #|kawa:5|# (car td-lst) > foo > #|kawa:6|# (eval `(html:table ,td-lst)) > java.lang.NullPointerException > at gnu.xml.XMLPrinter.getHtmlTag(XMLPrinter.java:525) > at gnu.xml.XMLPrinter.startElement(XMLPrinter.java:498) > at gnu.lists.TreeList.consumeIRange(TreeList.java:1252) > at gnu.lists.TreeList.consumeNext(TreeList.java:1080) > at gnu.xml.XMLPrinter.writeObject(XMLPrinter.java:723) > at gnu.kawa.xml.NodeConstructor.popNodeContext(NodeConstructor.ja= va:67) > at atEvalLevel-1.run() > at gnu.expr.ModuleExp.evalModule2(ModuleExp.java:292) > at gnu.expr.ModuleExp.evalModule(ModuleExp.java:211) > at kawa.lang.Eval.evalBody(Eval.java:100) > at kawa.lang.Eval.evalForm$X(Eval.java:27) > at kawa.lib.scheme.eval.eval$X(eval.scm:9) > at kawa.lib.scheme.eval.eval$X(eval.scm) > at atInteractiveLevel-6.run(stdin:6) > at gnu.expr.ModuleExp.evalModule2(ModuleExp.java:292) > at gnu.expr.ModuleExp.evalModule(ModuleExp.java:211) > at kawa.Shell.run(Shell.java:283) > at kawa.Shell.run(Shell.java:196) > at kawa.Shell.run(Shell.java:183) > at kawa.repl.processArgs(repl.java:714) > at kawa.repl.main(repl.java:820) > <{null name} > #|kawa:7|# `(html:table td-lst) > #|kawa:8|# `(html:table ,td-lst) > #|kawa:9|# (apply html:table td-lst) > #|kawa:10|# (define bar (apply html:table td-lst)) > #|kawa:11|# bar > #|kawa:12|# (display bar) > foo
foofoo
> #|kawa:13|# (define bar2 `(html:table ,td-lst)) > #|kawa:14|# bar2 > #|kawa:15|# (display bar2) > (html:table > (foo > foo > foo)) > #|kawa:16|# td-lst > #|kawa:17|# (display td-lst) > (foo > foo > foo) > #|kawa:18|# DIR: > /dev/stdin:18:1: warning - keyword should be quoted if not in argument po= sition > java.lang.RuntimeException: attribute 'DIR' follows non-attribute content > at gnu.xml.XMLFilter.error(XMLFilter.java:1474) > at gnu.xml.XMLFilter.startAttribute(XMLFilter.java:963) > at gnu.xml.XMLFilter.writeObject(XMLFilter.java:700) > at atInteractiveLevel-18.run(stdin:18) > at gnu.expr.ModuleExp.evalModule2(ModuleExp.java:292) > at gnu.expr.ModuleExp.evalModule(ModuleExp.java:211) > at kawa.Shell.run(Shell.java:283) > at kawa.Shell.run(Shell.java:196) > at kawa.Shell.run(Shell.java:183) > at kawa.repl.processArgs(repl.java:714) > at kawa.repl.main(repl.java:820) > #|kawa:19|# (define option-lst '(DIR: "LTR" BORDER: 1 width: 315 id: "tab= le_observateurs")) > #|kawa:20|# option-lst > java.lang.RuntimeException: attribute 'DIR' follows non-attribute content > at gnu.xml.XMLFilter.error(XMLFilter.java:1474) > at gnu.xml.XMLFilter.startAttribute(XMLFilter.java:963) > at gnu.xml.XMLFilter.writeObject(XMLFilter.java:700) > at gnu.xml.XMLFilter.writeObject(XMLFilter.java:695) > at gnu.mapping.Values.writeValues(Values.java:226) > at atInteractiveLevel-20.run(stdin:20) > at gnu.expr.ModuleExp.evalModule2(ModuleExp.java:292) > at gnu.expr.ModuleExp.evalModule(ModuleExp.java:211) > at kawa.Shell.run(Shell.java:283) > at kawa.Shell.run(Shell.java:196) > at kawa.Shell.run(Shell.java:183) > at kawa.repl.processArgs(repl.java:714) > at kawa.repl.main(repl.java:820) > #|kawa:21|# td-lst > #|kawa:22|# (display td-lst > #|.....23|# ) > (foo > foo > foo) > #|kawa:24|# (append option-lst td-lst) > java.lang.RuntimeException: attribute 'DIR' follows non-attribute content > at gnu.xml.XMLFilter.error(XMLFilter.java:1474) > at gnu.xml.XMLFilter.startAttribute(XMLFilter.java:963) > at gnu.xml.XMLFilter.writeObject(XMLFilter.java:700) > at gnu.xml.XMLFilter.writeObject(XMLFilter.java:695) > at gnu.mapping.Values.writeValues(Values.java:226) > at atInteractiveLevel-24.run(stdin:24) > at gnu.expr.ModuleExp.evalModule2(ModuleExp.java:292) > at gnu.expr.ModuleExp.evalModule(ModuleExp.java:211) > at kawa.Shell.run(Shell.java:283) > at kawa.Shell.run(Shell.java:196) > at kawa.Shell.run(Shell.java:183) > at kawa.repl.processArgs(repl.java:714) > at kawa.repl.main(repl.java:820) > #|kawa:25|# (define option-lst '('DIR: "LTR" 'BORDER: 1 'width: 315 'id: = "table_observateurs")) > #|kawa:26|# option-lst > java.lang.RuntimeException: attribute 'DIR' follows non-attribute content > at gnu.xml.XMLFilter.error(XMLFilter.java:1474) > at gnu.xml.XMLFilter.startAttribute(XMLFilter.java:963) > at gnu.xml.XMLFilter.writeObject(XMLFilter.java:700) > at gnu.xml.XMLFilter.writeObject(XMLFilter.java:695) > at gnu.xml.XMLFilter.writeObject(XMLFilter.java:695) > at gnu.mapping.Values.writeValues(Values.java:226) > at atInteractiveLevel-26.run(stdin:26) > at gnu.expr.ModuleExp.evalModule2(ModuleExp.java:292) > at gnu.expr.ModuleExp.evalModule(ModuleExp.java:211) > at kawa.Shell.run(Shell.java:283) > at kawa.Shell.run(Shell.java:196) > at kawa.Shell.run(Shell.java:183) > at kawa.repl.processArgs(repl.java:714) > at kawa.repl.main(repl.java:820) > #|kawa:27|# (list DIR: "LTR" BORDER: 1 width: 315 id: "table_observateurs= ") > java.lang.RuntimeException: attribute 'DIR' follows non-attribute content > at gnu.xml.XMLFilter.error(XMLFilter.java:1474) > at gnu.xml.XMLFilter.startAttribute(XMLFilter.java:963) > at gnu.xml.XMLFilter.writeObject(XMLFilter.java:700) > at gnu.xml.XMLFilter.writeObject(XMLFilter.java:695) > at gnu.mapping.Values.writeValues(Values.java:226) > at gnu.mapping.CallContext.writeValue(CallContext.java:333) > at gnu.mapping.Procedure.apply(Procedure.java:153) > at gnu.mapping.Procedure.apply(Procedure.java:118) > at gnu.mapping.CallContext.runUntilDone(CallContext.java:227) > at gnu.expr.ModuleExp.evalModule2(ModuleExp.java:349) > at gnu.expr.ModuleExp.evalModule(ModuleExp.java:211) > at kawa.Shell.run(Shell.java:283) > at kawa.Shell.run(Shell.java:196) > at kawa.Shell.run(Shell.java:183) > at kawa.repl.processArgs(repl.java:714) > at kawa.repl.main(repl.java:820) > #|kawa:28|# (define tbl-rows (apply html:tr td-lst)) > #|kawa:29|# tbl-rows > #|kawa:30|# (display tbl-rows) > foofoofo= o > #|kawa:31|# html:table > #|kawa:32|# list > #|kawa:33|# car > #|kawa:34|# > #|kawa:35|# (define option-lst '(DIR: "LTR" BORDER: 1 width: 315 id: "tab= le_observateurs")) > #|kawa:36|# `(html-table ,@option-lst ,@tbl-rows) > Exception in thread "main" java.lang.Error: expected list in quasi-quote = splicing > at kawa.lang.Quote.append$V(Quote.java:418) > at atInteractiveLevel-36.run(stdin:36) > at gnu.expr.ModuleExp.evalModule2(ModuleExp.java:292) > at gnu.expr.ModuleExp.evalModule(ModuleExp.java:211) > at kawa.Shell.run(Shell.java:283) > at kawa.Shell.run(Shell.java:196) > at kawa.Shell.run(Shell.java:183) > at kawa.repl.processArgs(repl.java:714) > at kawa.repl.main(repl.java:820) >=20 > shell exit here >=20 > another run that does not exit with error to shell: > [mattei@moita bin]$ ./kawa --output-format html > #|kawa:1|# (define option-lst '(DIR: "LTR" BORDER: 1 width: 315 id: "tabl= e_observateurs")) > #|kawa:2|# (define td1 (html:td "foo")) > #|kawa:3|# (define td-lst (list td1 td1 td1)) > #|kawa:4|# td-lst > foo foo foo > #|kawa:5|# (car td-lst) > foo > #|kawa:6|# (display td-lst) > (foo > foo > foo) > #|kawa:7|# (define tbl-rows (apply html:tr td-lst)) > #|kawa:8|# (display tbl-rows) > foofoofo= o > #|kawa:9|# (html:tr @td-lst) > foofoofoo > #|kawa:10|# (map html:tr td-lst) > foo foo foo > #|kawa:11|# (define tbl-row-lst (map html:tr td-lst)) > #|kawa:12|# tbl-row-lst > foo foo foo > #|kawa:13|# (html:table DIR: "LTR" BORDER: 1 width: 315 id: "table_observ= ateurs" @tbl-row-lst) > <= tr>
foo
foo
foo
> #|kawa:14|# (html:table @option-lst @tbl-row-lst) > <= tr>
foo
foo
foo
> #|kawa:15|# (display option-lst) > (DIR: LTR BORDER: 1 width: 315 id: table_observateurs) > #|kawa:16|# `(html-table ,@option-lst ,@tbl-row-lst) > html-table DIR=3D" LTR " BORDER=3D" 1 " width=3D" 315 " id=3D" tab= le_observateurs > #|kawa:17|# (exit) > Vous avez du nouveau courrier dans /var/spool/mail/mattei > [mattei@moita bin]$ pwd > /home/mattei/kawa-2.4/bin >=20 >=20 > those examples are with kawa-2.4, the last one run well, but when i do si= milar thing in code i have the error >=20 > i also test if first with kawa-2.1 as i expected it to do not make error = if the literal was used >=20 > regards, >=20 > damien >=20 > included file: DBtoWebObserversKawa.scm >=20