[fpc-devel] Re: enumerators

Michael Schnell mschnell at lumino.de
Mon Nov 15 10:43:31 CET 2010


On 11/15/2010 10:22 AM, Vincent Snijders wrote:
>
> I cannot imagine another way that a translations table can give you o(1) access.
>
Maybe I don't understand the o(1) correctly. Do you think it should be 
necessary to access each character in the string with in each iteration 
in this way.

What I meant was:

A pointer to the first UTF8-Code of the next Unicode character is the 
internal invisible loop variable.

A string containing the multi-Byte code of the current Unicode character 
is the visible loop variable.

Constructing the string and the pointer at the start of each loop is 
straight forward (regarding the UTF-8 definition), fast, o(1) and does 
not need a table.

-Michael



More information about the fpc-devel mailing list