[fpc-devel] Free Pascal 2.6.2 rc1
Michael Schnell
mschnell at lumino.de
Tue Nov 13 09:55:37 CET 2012
On 11/13/2012 06:48 AM, Marco van de Voort wrote:
> * (for..in) Enumerators in records
(Not really on-topic, but how to communicate this decently ?)
IMHO it makes sense to design/provide (for..in) Enumerators in strings,
providing one printable character after the other with respect to the
actual coding.
IMHO this would be a decent way to help the users avoid the myString[i]
notation, that asks for incompatibility between differently coded
strings and between different fpc releases and between fpc and Delphi XE.
While, for speed sake, it does not seem to make sense to do an
implementation of something similar to myString[i] in a "regarding
printable-character" way, an enumerator offers no speed disadvantage and
can be used in most of the cases we right now are inclined to do
myString[i] (and very successfully did before Unicode was introduced).
Maybe this is possible by somehow providing the enumerator with the
coding style before using it, while "string" is not a dynamically coded
"NewString". With "NewString", it's rather obvious, how the enumerator
should work. (And AFAI understand there will be a move to Strings to be
Delphi XE compatible "NewStrings" by default some day soon.)
-Michael
More information about the fpc-devel
mailing list