[fpc-devel] Unicode support - for the 20th time... ;-)

Graeme Geldenhuys graemeg.lists at gmail.com
Thu Nov 20 12:08:44 CET 2008


On Thu, Nov 20, 2008 at 12:55 PM, Michael Schnell <mschnell at lumino.de> wrote:
>>> * What about usage like:   SomeString[x] := 'A';
>>
>> String element based.
>
> This also holds for Copy, Length, Pos, etc.
>
> I thinks if would be a good idea to provide dedicated functions for the
> "element based" (fast) and the "character based" (old style compatible,
> easily readable) functionality. The user should be allowed to choose by
> means of compiler directions which of them should be used with the old-style
> notation. This would allow for not breaking old code.

For best backward compatibility, I would say Copy, Length, Pos etc
should work by "character based" by default. Then introduce more
optimised versions like ElementCopy, ElementLength, etc...  Old
programs will work out of the box, but might experience a minor speed
penalty, until the developer has time to convert to the more optimise
calls.  Just a thought?

And to replace  SomeString[x]  code with a unicode safe / equivalent,
we can implement a CharAt(str, x) method.

Regards,
  - Graeme -


_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/



More information about the fpc-devel mailing list