www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Issue 3825 and 3789

reply "bearophile" <bearophileHUGS lycos.com> writes:
A bit of celebration is in order because step by step D is 
becoming usable :-)
DMD 2.063 will have a significant improvement, this bug seems now 
fixed:

http://d.puremagic.com/issues/show_bug.cgi?id=3825


This program:


import std.stdio;
void main() {
     string[] words = ["how", "are", "you", "are"];

     int[string] aa1;
     foreach (w; words)
         aa1[w] = (w in aa1) ? (aa1[w] + 1) : 2;
     writeln(aa1);

     int[string] aa2;
     foreach (w; words)
         if (w in aa2)
             aa2[w]++;
         else
             aa2[w] = 2;
     writeln(aa2);


Used to write:
["how":1, "you":1, "are":2]
["how":2, "you":2, "are":3]

Now it writes:
["how":2, "are":3, "you":2]
["how":2, "are":3, "you":2]

This bug fix removes a big trap of D AAs.

---------------

Currently this is near the top of my wish list of bugs:
"Structs members that require non-bitwise comparison not 
correctly compared":

http://d.puremagic.com/issues/show_bug.cgi?id=3789

Fixing 3789 will remove another significant class of bugs from D 
programs.

Bye,
bearophile
Mar 03 2013
next sibling parent "Maxim Fomin" <maxim maxim-fomin.ru> writes:
I remember you were talking about "D top bug" list (15 or 10).  
Can you tell the whole list?
Mar 03 2013
prev sibling parent "bearophile" <bearophileHUGS lycos.com> writes:
Maxim Fomin:

 I remember you were talking about "D top bug" list (15 or 10).  
 Can you tell the whole list?

I think different persons have different priorities. (And generally it's not a good idea to show lists of not easy & open problems. It's better to face them one at a time). Bye, bearophile
Mar 04 2013