On Tue, 16 Mar 2010 17:33:03 -0400, Andrei Alexandrescu
<[email protected]> wrote:
On 03/16/2010 04:27 PM, Walter Bright wrote:
Steven Schveighoffer wrote:
On Tue, 16 Mar 2010 17:18:39 -0400, Walter Bright
<[email protected]> wrote:
bearophile wrote:
Glad to see that the answers I've written for that article aren't
useless.
But someone else has to file this bug because I am am not expert
enough to
write it.
http://d.puremagic.com/issues/show_bug.cgi?id=3977
Gah, I knew I'd be too late :) Took me a while to find it.
Marked as a duplicate of
http://d.puremagic.com/issues/show_bug.cgi?id=2095
It seems this bug keeps getting rediscovered!
Got my vote. Really needs to be fixed, otherwise we're no better than
Java.
Java does a runtime check to ensure you are not saving the wrong type to
the array. It's not the best system, but it's is definitely the most
flexible safe solution. The proposed solution for D is less flexible,
because it forces you to treat the objects themselves as const, and not
modify the contents of the array at all.
So it's really a judgement call on which is better depending on whether
you value flexibility or performance.
-Steve