Rename std.ctype to std.ascii?
Jouko Koski
joukokoskispam101 at netti.fi
Mon Jun 13 22:48:44 PDT 2011
"Jonathan M Davis" <jmdavisProg at gmx.com> wrote:
> std.ctype is modeled after C's ctype.h. It has functions for operating on
> characters - particularly functions which indicate the type of a character
> (I
> believe that ctype stands for character type, so that makes sense). For
> instance, isdigit will tell you whether a particular character is a digit.
> It
> only works on ASCII characters (non-ASCII characters return false for
> functions like isdigit and functions like toupper do nothing to non-ASCII
> characters).
What is your definition for ASCII character?
Most of the <ctype.h> functions (or macros) are locale dependent, see
setlocale() and <locale.h>. And there is the <wctype.h>, too.
While the C standardized ways of doing things might not be most appropriate
approach in D domain, we must not base our design decisions on deficient
analysis. "I just want this text uppercase" is one of the hardest things in
the _world_. The problem is not just the header or package naming.
--
Jouko
More information about the Digitalmars-d
mailing list