[fpc-devel] Re: enumerators

Vincent Snijders vincent.snijders at gmail.com
Mon Nov 15 11:20:50 CET 2010


2010/11/15 Michael Schnell <mschnell at lumino.de>:
> 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.

I agree, and that is why you need enumerators to make it work.

Vincent



More information about the fpc-devel mailing list