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

Re: strings draft

This page is part of the web mail archives of SRFI 50 from before July 7th, 2015. The new archives for SRFI 50 contain all messages, not just those from before July 7th, 2015.

Tom Lord <lord@xxxxxxx> writes:

> 1) Standard Scheme becomes case-sensitive.  May as well drop the case
>    mappings from the standard entirely, in this case.

I don't want this; I suspect nobody does.

> 2) Standard Scheme specifies a deterministic case mapping for the
>    portable character set in which portable programs may be written.

Just as identifiers should not notice case in matching, it seems
perfectly fair for me for a Scheme implementation to say that they
don't notice diacriticals either.  This is already a common procedure
in alphebetizing in some languages (French, for example, but not
Spanish).  But we should not mandate it either way.

Moreover, case-insensitivity is a matter of how you implement
string-ci=?  In a Unicode-aware program, string-ci=? is locale
dependent, *and* it is not correctly implemented by a simplistic
iteration of char-ci=?.  

So my proposal is: drop the char-ci* functions entirely.  Add locale
arguments to the string-ci* functions.  And then say:

"Two scheme identifiers are the same if they match with the string-ci*
function in the locale returned by (scheme-standard-locale).  It is
guaranteed that in this locale, a..z are not distinguished by
string-ci* from A..Z, and that all other characters required to exist
by the standard are distinguished from these and each other."

So this meets your requirement (2), and also meets my suggested
requirements that we not have per-character case functions mandated by
the standard, and we require locale arguments on all case-related