Invariant strings on Dr. Dobb's
BCS
ao at pathlink.com
Thu Mar 13 19:58:44 PDT 2008
Reply to Walter,
> BCS wrote:
>
>> And on the content; you mention concatenation as working on invariant
>> strings. I assume this is because you generally can't concatenate in
>> place anyway?
>>
> I'm not sure what you mean.
>
You say that the common ops generally don't mutate the data and then list
"moving references around, slicing, and concatenating". I guess my thought
is that the first two are a bit more self explanatory than the last. Clearly
1 & 2 are non mutating but, a guy who is a few Lattes behind might not notice
that because you, in general, don't known what comes after a string, if you
want to extend a string (for concatenating), you need to allocate new ram
for it, thus leaving the first blocks untouched. (I'm not thinking specific
to D here).
More information about the Digitalmars-d-announce
mailing list