[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
locales (was Re: 200alpha13)
At Thu, 7 Mar 2002 15:05:05 -0500, Eli Barzilay wrote:
> 2. Each of these functions would do a system call to set the locale,
No --- the nice thing about portable routines is we won't need to use
platform-specific libraries. `string-ci<?' will use a hardwired table
of case conversions, as opposed to calling toupper().
(You're right that it takes significant time to change locales.)
> 3. If the goal is avoiding using parameterize,
The goal as I see it is to keep the distance between reality and the
programmer's expectation as small as possible. If a programmer isn't
thinking about locales, probably the program shouldn't be affected by
them.
I'm less certain on this point for `char-locale-alphabetic?' than
`string-locale<?', though.
> 4. And the most important thing -- doing this will force either
> writing programs that are hard-wired to using or not using locales,
> or to pass around yet another argument (or use the parameter!) to
> know what function to use.
I don't see passing around yet another argument as solving any problem,
because `string-locale<?' will be the same as `string<?' when the
locale is disabled.
It does mean that we need to look at existing uses of `string<?' to
determine whether they should be `string-locale<?' instead (e.g., in
the Unix file dialog).
> -- since locales are something relatively new, I think
> it is better to stay as close to the C model since that is not likely
> to change too much.
In fact, adding new functions is closer to the C model. setlocale()
does not affect strcmp(); there's a separate strcoll() function.
Matthew