Op 25/06/2019 om 21:58 schreef Ryan Joseph:
An exponential growing function applied to all strings would have many worse case behaviours, where it would eat up heaps of memory for nothing. This is why it is better to have the programmer indicate it is a growing string some how (or have a separate type, like TStringBuilder mentioned by Jonas) It would be nice if ansistring had a SetCapacity function to accompany SetLength but in leu of that I think making a new type is the best idea.
I think we have enough string types http://www.stack.nl/~marcov/delphistringtypes.txt
TStringbuilder is fine . Not every problem needs new syntax or types to solve.
_______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal