Please tell me this is a bug?

amber via Digitalmars-d digitalmars-d at puremagic.com
Sat Feb 21 18:48:27 PST 2015


On Sunday, 22 February 2015 at 02:35:02 UTC, Adam D. Ruppe wrote:
> On Sunday, 22 February 2015 at 02:27:30 UTC, Peter Alexander 
> wrote:
>> Seems questionable to me. Anyone know the rationale?
>
> I actually agree it is a bit questionable, but I think the 
> difference is += is, conceptually at least, atomic - it is a 
> single function, append() instead of two calls, 
> set(calculate()).

Isn't that a compiler implementation detail though?

I always considered a+=b as a shorthand for a=a+b so I find this 
surprising and a bit confusing.

Maybe I need to revise my thinking on this :)


/amber


More information about the Digitalmars-d mailing list