[r6rs-discuss] Scheme should not be changed to be case sensitive
cph at csail.mit.edu
Thu Nov 16 13:44:58 EST 2006
Shiro Kawai wrote:
> Symbol case folding is not only a matter of the reader but
> also affects the writer if we want to guarantee write-read
> invariance. In Common Lisp, they are unified; both are
> controlled by the value of readtable-case slot of the current
> readtable. If we want R6RS to support both modes, we need a
> dynamic scoped parameter that specifies the mode.
Strictly speaking this isn't necessary. The output can be in any mode
as long as it emits the correct prefix.
One way to think about this is as analogous to the Unicode BOM. Perhaps
that's a good reason to restrict the prefix marker to the beginning of
> This still causes surprises when persistent data is
> written in one mode and then read in another.
Not if output is consistently tagged with a prefix.
> (And remember, no matter how large your current code base is,
> we have to assume there will be more code to be written,
> and mostly by people younger than us, who are used to
> case-sensitive languages).
I don't see how this is relevant -- what I'm suggesting supports case
sensitivity in future code. It also provides an upgrade path:
implementations with large bodies of case-insensitive code can make that
the default, and maintain backwards compatibility. Meanwhile, that
legacy code can be incrementally modified by adding #!fold-case to the
relevant files. Eventually it should be possible to change the default
to case-sensitive, if that's desired. Meanwhile, implementations that
prefer weaker backwards compatibility can make case sensitivity the
default right away.
More information about the r6rs-discuss