[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 200alpha13



Matthew Flatt writes:
> The main change in this version is the addition of a `current-locale'
> parameter, which mainly affects string and character comparisions.
> 
> . . .
> 
> This is a subtle change, and there's plenty of room for new bugs due to
> shifting character comparisions. But I've been using DrScheme with
> locale-sensitiviy enabled for a couple of weeks, and it seems to be an
> improvement. As always, feedback on this change is encouraged.

This change introduces subtle environmental dependencies into nearly
every algorithm dealing with strings, and (from your post; I haven't
looked at the code) it appears that you have to use dynamic-wind to
isolate a particular string algorithm from those dependencies without
breaking parts of your program which *should* be locale-dependent.
(If you didn't write all the code in the program, you may not even be
aware of their existence.)

These dependencies cause programs to depend not only on other things
in PLT Scheme, but also things that vary from machine to machine.  The
result is that a program that works perfectly on my machine may
produce incorrect results or crash on yours.

The subtle environmental dependencies introduced by this change will
break data structures that depend on string or character comparisons
returning consistent results and which persist across locale changes
or are transmitted from machine to machine.

It is not surprising that C implements locales this way, but I think
that Scheme can do better.

If I were adding locale sensitivity to PLT Scheme, I would do it by
adding new locale-sensitive functions, not by adding subtle
dependencies on global state to standard functions.

-- 
<kragen@pobox.com>       Kragen Sitaker     <http://www.pobox.com/~kragen/>
"Why are you withholding me?" -- name withheld  "Oh... And dig this:  I
am a fish.  'Nuff said." -- Joe Blaylock (no further explanation)
These are the denizens of the CLUG mailing list.  Their five-year mission: