On 24.08.2012 16:14, Mark Morgan Lloyd wrote:
I wonder if I could ask a silly question. My understanding is that
strings are pretty much unique in not being objects, and relying on a
fair amount of compiler and RTL wizardry to handle reference counting
etc.
I note somebody at Embarcadero blogging [Paraphrase follows] "Delphi
is being enhanced by adding memory management features such as
reference counting".
Would there be any advantage in reimplementing strings as a tree of
classes, with the compiler doing appropriate things to change e.g.
Pos() into String.Pos(), UnicodeString.Pos() or whatever as appropriate?
String is the automatic reference-counted object.
But FPC team always denies this :))) citing Pascal standards of passed
century.
Btw
var
s:utf8string;
ws:UnicodeString;
i:=s.length();
ws:=s.convert(UTF-16);
much more readable and causes less headache.
regards,
Anton
_______________________________________________
fpc-devel maillist - fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel