Introduce *sharedp* variable
Hi,
It could be interesting to have a way to allow operation on strings share the same storage as an input string. For example, substring could make a displaced string instead of calling subseq (e.g. slices in Go, string views in C++)
Following the naming from cl-ppcre, I'd like to introduce *sharedp* with a default value of NIL, and make functions learn this behaviour when possible, namely: when *sharedp* is T, functions may return strings that share storage with their inputs (or even return an input); operations remain non-destructive w.r.t. inputs
For context, I am starting to collect some of my utility functions to package them as small libraries (starting with https://github.com/christophejunke/tilde-slash), and I'd prefer to reuse or extend cl-str instead of having a separate string library.
That seems a nice optional feature. (considering it doesn't bring much complexity :) I like to think that the current code is very approachable and helps to learn the built-in string manipulation).
Thanks for sharing and porting your utilities.