const challenge
Janice Caron
caron800 at googlemail.com
Sun Feb 3 00:43:54 PST 2008
On 2/3/08, Derek Parnell <derek at psych.ward> wrote:
> As far as I can recall, D has always said that
> concatenation creates a dynamic array, and since 'const' has been in use,
> that array is also a mutable one.
I don't think that's true. Back in November, Steven Schveighoffer
wrote this post:
http://www.digitalmars.com/webnews/newsgroups.php?art_group=digitalmars.D&article_id=61276
Stephen was finding he needed to explicitly .dup to get a mutable result.
Since nothing implicitly casts to both char[] and string, some duping
or iduping or explicit casting would always be necessary in some
circumstance or other. You can't keep /everyone/ happy (as you could
in D1). Unique would have fixed that problem. But that said, Walter
has now effectively closed this discussion by saying that
concatenation will in future give a polysemous result - a hack which
does the same as what unique would have done, but /only/ in that
circumstance. Once this is done, everyone's going to be happy.
More information about the Digitalmars-d
mailing list