On Mon, 2009-05-04 at 22:11 +0200, Patrik Husfloen wrote:
> I was reading up a little on SXML [1] but found that using @ as a
> symbol doesn't work in Ikarus, it does in Larceny though, so now I'm
> wondering which one is right?
> After reading R6RS it looks to me like Ikarus is being compliant in
> this case, can anyone confirm?
As R6RS 4.2.1 says, @ is not a valid R6RS symbol. As John Cowan told me
[1]:
If @ were permitted as the initial character of an identifier,
then it would be ambiguous whether {,@foo} and {,@ foo} were
unquotes or splicing unquotes.
I've already ported SSAX, sxml-tools, sxml-match, and htmlprag [2]. I
modified all of them to use ^ instead of @ [3], but otherwise they're
the original code, named and structured as libraries very similarly to
the original files. I've encouraged others to use ^. My ports include
all the (many) original tests, and they all pass. I think ^ looks good:
((p (br))
(table
(^ (bgcolor "#CCCCCC") (width "100%") (cellpadding "3"))
(tr (td ("KMRY, MONTEREY PENINSULA"))
(td "Id: " ("724915"))
(td "[" ("36.583, -121.850") "]")))
(table
(^ (width "100%") (cellpadding "1") (BORDER "1")
(RULES "none") (FRAME "hsides"))
(tr
(td (^ (width "20%")) (5 "-" 11 " " 17 ":" 30) (br)
((11 " " 18 ":" 0) " - " (11 " " 18 ":" 0)))
(td ("111730Z 111818")
((div (^ (class "per_nc")) () " "
("31010KT P6SM FEW030"))
(div (^ (class "per_c")) ("FM2100") " "
("29016KT P6SM FEW040"))
(div (^ (class "per_nc")) ("FM0400") " "
("29010KT P6SM SCT200"))
(div (^ (class "var")) ("BECMG 0708") " "
("VRB05KT")))))))
> Larceny v0.97b1 (beta test) (Aug 25 2008 04:23:30, precise:Posix Unix:unified)
> larceny.heap, built on Mon Aug 25 04:24:57 EDT 2008
>
> > '@
> \x40;
If you run Larceny in R6RS mode, it does give you the error:
$ cat at-sym.sps
(import (rnrs))
(define @ 'hmm)
(write @)
$ larceny -r6rs -program at-sym.sps
Error: no handler for exception #<record &compound-condition>
Compound condition has these components:
#<record &lexical>
#<record &who>
who : get-datum
#<record &message>
message : "lexical error: illegal symbol syntax in line 2: @ "
#<record &irritants>
irritants : #<INPUT PORT at-sym.sps>
Terminating program execution.
$
[1] http://lists.r6rs.org/pipermail/r6rs-discuss/2008-June/003518.html
[2] https://code.launchpad.net/~derick-eddington/ikarus-libraries/xitomatl
[3]
http://sourceforge.net/mailarchive/forum.php?thread_name=1214378777.31858.90.camel%40eep&forum_name=ssax-sxml
--
: Derick
----------------------------------------------------------------