On 2 February 2018 at 14:28, Martin Ward <mar...@gkc.org.uk> wrote:
> Incidentally, perl strings can be over 4GB in length: in fact,
> any size which will will fit in memory (including swap space).
Just don't let the ASN.1 folks come closer, or you end up with variable
length length fields... ;-)
I would think that when things get long enough, the requirement for
consecutive storage of the characters would be restrictive. Implementing a
string as a series of (address,length) pairs would solve that, and would
also make for elegant string concatenation.
Considering that most strings are less than 4GB, I would be tempted to
maybe use negative length to imply the extra indirection, and use positive
length for characters following the length. If functions return such
strings, you'd need a garbage collector as well... sigh.