Character classes in Parrot

2004-11-12 Thread Patrick R. Michaud
Does Parrot have anything available (yet?) for testing membership in
character classes-- things like isspace, isupper, islower, etc?
I searched around a bit in the docs, online references, and P6PE 
and found very little about it.

How about for creating and manipulating character classes?

Apologies in advance if I've simply overlooked something.

Pm


Re: Character classes in Parrot

2004-11-12 Thread Leopold Toetsch
Patrick R. Michaud [EMAIL PROTECTED] wrote:
 Does Parrot have anything available (yet?) for testing membership in
 character classes-- things like isspace, isupper, islower, etc?

RSN or when Dan's string stuff is merged.

 How about for creating and manipulating character classes?

There is an implementation of bit sets in imcc/sets.c. The old rx code
has some bitmap stuff in src/rx.c. But that's broken WRT memory leaks.
It uses a bitmap for chars  256 and a linear string for anything bigger
- suboptimal.

So it's probably best to to create a BitSet PMC. That could use a bitset
for the normal range of the charset and an additional hash for other
values, which is searched only if it's there.

 Apologies in advance if I've simply overlooked something.

No problem, the source tree is huge.

 Pm

leo


Re: Character classes in Parrot

2004-11-12 Thread Dan Sugalski
At 7:24 AM -0700 11/11/04, Patrick R. Michaud wrote:
Does Parrot have anything available (yet?) for testing membership in
character classes-- things like isspace, isupper, islower, etc?
I searched around a bit in the docs, online references, and P6PE
and found very little about it.
Not yet. I've got some basic code in the new string branch to provide 
a few checks (whitespace, alpha, number, and punctuation) but that's 
it for now.

How about for creating and manipulating character classes?
Nope, not yet. Character classes do need to be addressed, though, 
since they're... interesting to handle.

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