[EMAIL PROTECTED] (Ludovic Courtès) writes: > Hi, > > Neil Jerram <[EMAIL PROTECTED]> writes: > >> Yes. So it seems to me, therefore, that we should not be using >> isalpha() etc. to construct char-set:letter, but should instead hard >> code it as the intersection of (char-set:letter as specified by SRFI >> 14) with (the set of characters that Guile can represent). > > In practice, I can think of two ways to determine the set of _letters_ > available in the current encoding (which is what `char-set:letter' > expects). > > 1. Since SRFI-14 lists all the characters that have to be added to the > ASCII `char-set:letter' to get the Latin-1 `char-set:letter', we > could somehow hard-code them. But this is ugly.
I don't see why you think it's ugly. If it's the right solution, it's the right solution. > 2. Or, we can use a predicate that uses the `is' functions which we > expect to be language-independent (i.e., those functions that only > depend on the locale's charset), such as: > > (!isblank (c)) && (!ispunct (c)) && (!isdigit (c)) && (!iscntrl (c)) Now this is ugly, IMO! > This is certainly not perfect, but it should work for Latin-1, and > hopefully for other 8-bit charsets as well. > > As Kevin mentioned earlier, all the char sets could be re-computed in > `scm_setlocale ()'. This sounds even trickier, and wrong, given that the intention of SRFI 14 is for char-set:letter to be locale-independent. Regards, Neil _______________________________________________ Guile-devel mailing list Guile-devel@gnu.org http://lists.gnu.org/mailman/listinfo/guile-devel