New SSAX for PLT
Kirill Lisovsky <[email protected]> Sat, 6 Dec 2003 23:24:54 -0500 (EST)
| Newsgroups | gmane.lisp.scheme.ssax-sxml |
|---|---|
| Message-ID | <Pine.LNX.4.44.0312062323320.5499-100000@ant> |
Hello!
A new package of SSAX for PLT Schemes is available:
http://pair.com/lisovsky/download/sxml/plt/preview/ssax20031206.plt
http://pair.com/lisovsky/download/sxml/plt/preview/ssax20031206.tgz
It's based on RELEASE_4A_PT SSAX from SourceForge CVS.
In addition to "SourceForge" SSAX this port provides:
1. Some handlers for parsing errors and warnings and a facility for
their customization and parameterization (see documentation in parse-error.ss)
Please note: the function
(port-count-lines! <port>)
has to be called following the opening of an input port
in order to obtain additional information about line and column
of the error location in warning/error messages
2. A function
ssax:declare-parsed-entities!
of one argument, a list of parsed
entities to declare in addition to
& < > ' "
pre-declared by SSAX.
One of the problems with SSAX/PLT packaging is duplicated
functions "read-line" and "read-string": both of them are built-in
MzScheme functions while input-parse.scm in SSAX provide another,
slightly different version of these functions.
"read-string" in PLT and input-parse are not exactly compatible:
In PLT it expects argument of type <non-negative exact integer>;
in input-parse it may be negative, and an empty string will be
returned.
"read-line" is slightly different also: while in input-parse
a line is a (possibly empty) sequence of characters terminated
by CR, CRLF or LF (or even the end of file) in PLT the default
terminator is LF only.
It's possible to remove these offending functions from MzScheme creating
a new language:
(module ssax-mzscheme mzscheme
(provide (all-from-except mzscheme
read-line read-string)))
but this solution will probably affect other PLT code integrated with
SSAX, and an attempt to use input-parse in any module
which uses a regular mzscheme (or its derivative which doesn't exclude
read-line) will lead to "read-line: identifier is already imported" error
In other words, this will restrict (or complicate) a use of any other functions
from input-parse.scm
Besides, this problem is not PLT-specific: many other Schemes provide
their own "read-line" and "read-string" functions of different flavor...
IMHO, the simplest solution is just to use some prefixed names:
input-parse:read-line
input-parse:read-string
as this is done in current versions.
The obvious drawback is that this names are long.
Any suggestions on this subject (as well as any other feedback) are very welcome.
File
http://pair.com/lisovsky/download/sxml/plt/preview/ssax-test.scm
contains a set of SSAX tests (extracted from ssax.scm)
However, I prefer to test this package more before declaring it "stable".
Best regards,
Kirill.
-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills. Sign up for IBM's
Free Linux Tutorials. Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click