At 5:37 PM +0200 11/1/03, 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?

It'd suffice, but I'd rather not do that for the moment. When these get called a lot the small speed hits will pile up, and the regex engine will end up doing that often. (And if we declare that the chartype functions are immutable we can play games with the JIT easier at some point in the future) I think we'd be better served with a small set of functions to detect common things and a fallback function for the rest. We can wrap them all in macros so the internals can do a PARROT_IS_SPACE(foo) regardless of whether is_space is a vtable slot or uses the parameter function.


If we're feeling fancy, we can do something similar to the PMC functions, where each required chartype function is a regular function and we can fill in the structure appropriately depending on which functions get their own vtable slot and which hang off the fallback function.
--
Dan


--------------------------------------"it's like this"-------------------
Dan Sugalski                          even samurai
[EMAIL PROTECTED]                         have teddy bears and even
                                      teddy bears get drunk

Reply via email to