On 1 Nov 2003, at 16:37, Peter Gibbs wrote:

The current chartype struct contains an is_digit function. Do we want to add
is_alpha, is_space, etc., or will a single is_ctype function, with an enum
parameter, suffice?

Excuse me for being naming fusspot for a second.


What Parrot calls a chartype is more commonly called a character set. I mention this because it's the kind of thing you really notice when writing documentation

http://www.vendian.org/parrot/wiki/bin/view.cgi/Main/ ParrotDiagramsString

and therefore puts me in this frame of mind.

Since the enum will specify what you yourself call character classes can't we call the function is_charclass() instead?

BTW the related get_digit() function currently fails some test that I'm working on. If you pass it a non-digit character it blithely calculates from first_code and first_value. Rather, it should indicate failure in some way.

Mike


A single function would simplify the addition of new character classes, but
at a (small?) cost in speed. It would also keep the chartype struct smaller,
but there is unlikely to be enough of those to make any significant
difference.


Since the current prototype includes the chartype, existing functions
(eg ICU u_is<xxx>) could not be called without a wrapper function anyway,
so a single function would mean one wrapper with a switch statement,
versus individual wrappers for each class.


I prefer the single function approach, so that is what I will start
implementing if there are no timeous objections.

Regards
Peter Gibbs
EmKel Systems




Reply via email to