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

Re: locales



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

Matthew Flatt wrote (not in response):
> In fact, adding new functions is closer to the C model. setlocale()
> does not affect strcmp(); there's a separate strcoll() function.

I was thinking C did the same thing 200alpha13 did; my apologies for
posting before verifying that.

In another message, Matthew Flatt writes:
> Previously, I was thinking of a locale as fixed for a particular
> machine. Shifting results for `string<?' across machines doesn't bother
> me much (it's little worse than shifting file name conventions), 

I generally expect file name conventions to shift across machines, so
routines I write that deal with filenames are written to deal with
that (and tested on different machines).  I generally don't expect
string comparison results to shift across machines, and much more of
my code deals with strings than with filenames.

(I don't actually think it's reasonable for things like string-ci<? to
be in the locale-independent set; they obviously are thinking of the
string as a string of characters, not a string of bytes, so they
obviously depend on the character set in which the string is encoded.
It follows that I don't think case-insensitive symbols are a
reasonable thing to do for on-disk source code, at least in a world
that contains non-ASCII character sets.)

Matthew Flatt writes:
> P.S. --- File names in Windows and Mac OS are "case insensitive", so
> "e" is the same file name as "E". But how about "<E8>" and "<C8>"? "<F1>" and
> "<D1>"? "<F6>" and "<D6>"?

FWIW, filename case-insensitivity causes a lot of trouble in the
presence of locales.  E.g. whether "i" is the same filename as "I"
depends, or should depend, on whether the present locale is Turkish or
ASCII.

-- 
<kragen@pobox.com>       Kragen Sitaker     <http://www.pobox.com/~kragen/>
It frightens the daylights out of me whenever I hear people proclaim that
the less knowledge our children have access to, the better.  
-- Duane Lindstrom, at <URL:http://www.examiner.com/skink/skinkmail.html>