[Issue 2093] string concatenation modifies original

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Nov 22 12:52:52 PST 2008


http://d.puremagic.com/issues/show_bug.cgi?id=2093





------- Comment #12 from ddparnell at bigpond.com  2008-11-22 14:52 -------
It seems to me then that this is a design choice  - does the string length
belong to the string or to the reference? For slices it must be the reference
but for arrays? hmmm... Curently in D, a dynamic array and a slice are
indistinguishable and I'm not so sure that should be the case. There are good
arguments for the current design and also for the separation of slices and
dynamic arrays.

Common sense seems to say that if I change the length of a string that
therefore every other reference to the same string should also honour the new
length, and that this should also have no effect on previously captured slices
of the string. 


-- 



More information about the Digitalmars-d-bugs mailing list