[Lazarus] dynamic string proposal

Michael Schnell mschnell at lumino.de
Wed Aug 16 12:24:55 CEST 2017


On 16.08.2017 11:51, Mattias Gaertner via Lazarus wrote:
> Every Delphi/FPC type has a bunch of operators. Strings support :=, =, 
> <>, >=, <= and [] for read and write.
> When you propose a new string type "dynamicstring" you have to define these operators.
That is easily doable.
The definition of := is discussed in the paper. (Only for :=  there is 
no accessible encoding definition for the left operand.)
If the encoding branding is one of those that already exist, the current 
definition is used.
For "new" encoding brandings, such as CP_Byte, CP_Word, CP_DWord, 
CP_QWord, the working of the operators is obvious. It somebody tries to 
compare a printable Text string with a string of binary elements, maybe 
the behavior is undefined.

> There is no QWord codepage. That would be confusing. 

Of course the term "Codepage" Embarcadero chose for the encoding 
identification is misleading in this context. That is why in the said 
paper it's called "encoding style" (which is not a really appropriate 
wording, either, but hey, it's just an initial suggestion and not yet a 
final documentation, and it had been clear from the beginning that it's 
in vain, anyway. )

-Michael


More information about the Lazarus mailing list