Am 28.02.2012 16:13, schrieb Sven Barth:
Am 28.02.2012 15:40, schrieb Hans-Peter Diettrich:
Sven Barth schrieb:

Before Delphi 2009 you might have been right, but with that version
Embarcadero did a cut and we now need to adapt and live with that.

I dare to disagree. A "ByteString" only requires a dedicated encoding
(value), which makes it incompatible with other encodings, and thus
disables all conversions. Such an encoding doesn't break Delphi
compatibility, but allows to use all stringhandling functions with it.

And instead of introducing yet another type or another special encoding
we could just leverage the features FPC has today and use TBytes.

Or even better, use FPC 2.6 AnsiString and UnicodeString and drop the encoding aware FPC 2.7 AnsiString. ;-)

BTW, please have a look into the different string concatenation compilerproc, it is probably not so easy to model that with equal or better performance with TBytes and operator overloading. Is it possible with operator overloading to combine different types?
"
<TBytes>:= <TBytes> + 'stringconstant' + <TBytes> + <AnsiString>;
"

Martin

--
_______________________________________________
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to