On Mon, Mar 23, 2009 at 12:15 PM, BCS <[email protected]> wrote: > Hello Qian, > >> Oh god. I have to add ".dup" at the end of every string to avoid >> potential program errors. This is so incredible.... >> > > Run it on linux and it will seg-v when you try to access a literal string. > > Oh, and that issue is in no way unique to D. Any language with mutable > strings will have it and any language without will force the copies anyway > (but with better syntax)
It is unique to DMD/Optlink. GDC Win will produce EXEs that throw a segfault if you attempt to modify a read-only string.
