[fpc-devel] for-in-index loop

Michael Schnell mschnell at lumino.de
Fri Jan 25 11:58:47 CET 2013


On 01/25/2013 11:23 AM, Mattias Gaertner wrote:
> Do you mean codepoint? Printable depends on ligatures and other things. 

Both might be desirable. I don't want to define that. This will depend 
´on the implementation of the indexer class.

>> Finding the 100000 th and then independently the 100005 th printable
>> character needs quite a lot of CPU time
> In UTF8, UTF16 and UTF32 it takes 5 steps.
What do you mean by "steps" ?

> There are plenty of functions for this. You can wrap them into 
> enumerators as demonstrated.

In fact I easily could do my own implementation of the functionality if 
I would have the need for it.

The question is whether it would make sens to provide a fast 
implementation of such a class in the RTL and offer some compiler magic 
to make it easily usable (e.g. for beginners) and compatible with 
possible future string types to prevent any porting effort of user code.

-Michael



More information about the fpc-devel mailing list