Re: case-sensitivity of special symbols in SXML

[email protected] Mon, 31 Jan 2005 13:05:59 -0800 (PST)
Newsgroups gmane.lisp.scheme.ssax-sxml
Message-ID <[email protected]>
Hello!

> In SXML, are the non-XML-name symbols (e.g., "*TOP*", "*PI*") in
> all-uppercase (as I think is suggested by the code, examples, tests, and
> most of the packagings of SSAX)?  Or is the case of non-XML-name symbols
> dependent on the particular Scheme implementation?

That is a good question. In general, eq? comparison of symbols read
with a case-sensitive and a case-insensitive readers is always going to
be a problem. Some case-insensitive readers implicitly lowercase
symbols, whereas others uppercase (Bigloo used to do that -- and still
does, with the appropriate flag. Gambit can uppercase too).  Unless we
convert a symbol into a string, there is no standard way to serialize
a symbol so that its case is preserved. Granted, there are many
non-standard ways, e.g., the bar notation. It seems that the only
thing we can do is to minimize surprises by maintaining
case-consistency: if I ever wrote a symbol or an identifier in a
particular case, I try to keep that particular case and capitalization
all throughout the code and the comments.


> If one uses a case-sensitive read mode for interpreting/compiling the
> SSAX code and for reading literal SXML (from files, or embedded in
> Scheme code), that gives case to the non-XML-name symbols.  These
> symbols then, for example, aren't necessarily "eq?" in the same Scheme
> environment when compared by Scheme code that is/was
> interpreted/compiled with a different case-sensitivity mode.

That is very true. That's why the tests in the SSAX code go to great
length to make that symbol comparison operation portable and
reliable. That's why the run-test macro is far more complex than one
might have expected.

	Cheers,
	Oleg


-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl