On Sat, 02 May 2009 10:18:41 -0400, Andrei Alexandrescu
<seewebsiteforem...@erdani.org> wrote:
Bill Baxter wrote:
On Fri, May 1, 2009 at 6:25 PM, Andrei Alexandrescu
Matrix a, b, c; ... c = a; a += b;
Does the last operation mutate c as well?
I said "assignments like a = b are rare" and you put one of those in
your example.
You said it and I don't buy it one femtosecond. Code does need to copy
values around. It's a fundamental operation!
Andrei, he said that explicit assignments/copies of arrays/containers are
rare in numeric computing, which I agree with. Just because it's a
fundamental operation doesn't mean it gets used much is his (or I guess
Numply's actually) specific applications. Also, disregarding/disbelieving
a use case is not helpful to this discussion.
Yes, when you have an a=b anywhere you've got to pay attention and
make sure you didn't mean a=b.dup.
That is terrible. Anywhere == a portion of the code far, far away.
No, he was talking about a local decision. i.e. Did I or didn't I mean to
make a logical copy here?