On 02/28/2012 07:29 AM, Martin Schreiber wrote:

Because of Delphi compatibility and code cleanness.
I see: The "Unicode Threat" that makes "String" a moving target, forcing the poor "String" type to be "visible Text" i.e. holding a (somehow) known encoding of its binary content.

Of course I do see both aspects: GUI programmers will hope that "strings" are just printable and thus the name of the "somehow encoded" type should stay "String", while technically, a String is just a decently managed sequence of "something".

Thus to me it's clear that a decent compiler should provide both: one or more types for appropriately encoded text and one or more types for sequences of binary objects. that both should be easily usable and provide fast operation as similar as possible to the legacy String handling.

Often we need to combine buffer data from binary pieces and character data/strings.

Obviously.

So why not define decent types like "ByteString", "WordString", "DWordString", (maybe CharString, PointerString or whatever, too) allowing for the legacy string operations in an appropriately overloaded way ?

-Michael
_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply via email to