[Ecls-list] Case woes
Juan Jose Garcia Ripoll
lisp at arrakis.es
Tue Dec 21 01:43:05 UTC 2004
Hi,
I have fixed a couple of things in ECL regarding the effect of readtable
and print cases in the printing and reading of symbols. In particular
+ The capitalization now takes into account possible spaces, hyphens,
etc in the symbol name.
+ The value of +print-escape+/+print-readably+ determine that the output
should be such that if read with the standard readtable one recovers the
same symbol. In practice this means one has to escape symbols which have
lowercase letters in some cases.
+ What most puzzles me is the issue of packages. To ensure read/write
consistency, an implementation has to analyze the effect of
readtable/print-case in the name of the package and of the symbol either
separately or jointly. Consider for instance the case of readtable case
being :invert
package name symbol name
------------ -----------
foo:FAA foo FAA
foo:FAA FOO faa
In the first case, the whole of the token is analyzed and it is found
that there is not a common case. In the second case, the token is
actually analyzed as being made of two, and the :invert process is
applied to each of the component.
If one follows the reader algorithm the first option should be the one.
However, most implementations use the second algorithm, probably because
it is more intuitively clear to the user. Also, it has the potential of,
as an extension to ANSI, allowing us to specify a syntax for the symbol
name, or use nested packages, etc, etc.
I have also taken the second option when fixing ECL's parser.
Juanjo
More information about the ecl-devel
mailing list