[fpc-devel] Re: enumerators

Michael Schnell mschnell at lumino.de
Wed Nov 17 10:33:24 CET 2010


On 11/15/2010 01:24 PM, Marco van de Voort wrote:
>
> Typically I'd iterate by means outside the language (I've used simple iterators
> based on a record with a few inline methods in the past), and review the
> places where you iterate by char through strings, and reduce it
> signficantly.
>
> Since the latter is needed for optimal result in nearly every solution.
While I of course do see that in many cases it does make sense to use a 
full blown enumerator to to a loop that traverses an UTF-8 (or other 
Unicode) string in terms of Unicode characters, with a loop variable 
that represents the position of the Unicode character in the string (in 
therms of what ? ), I feel that there are also many cases that only ask 
for a simple loop that just offers a loop variable coded as a 32 bit UCS 
Unicode character or as an UTF-8 string.

-Michael



More information about the fpc-devel mailing list