digitalmars.D.bugs - [Issue 10381] New: Nonsense associative array comparison
- d-bugmail puremagic.com (31/31) Jun 16 2013 http://d.puremagic.com/issues/show_bug.cgi?id=10381
- d-bugmail puremagic.com (7/7) Jul 08 2013 http://d.puremagic.com/issues/show_bug.cgi?id=10381
- d-bugmail puremagic.com (14/16) Jul 08 2013 http://d.puremagic.com/issues/show_bug.cgi?id=10381
- d-bugmail puremagic.com (6/6) Sep 19 2013 http://d.puremagic.com/issues/show_bug.cgi?id=10381
- d-bugmail puremagic.com (11/14) Sep 20 2013 http://d.puremagic.com/issues/show_bug.cgi?id=10381
- d-bugmail puremagic.com (10/16) Sep 20 2013 http://d.puremagic.com/issues/show_bug.cgi?id=10381
- d-bugmail puremagic.com (8/8) Sep 24 2013 http://d.puremagic.com/issues/show_bug.cgi?id=10381
- d-bugmail puremagic.com (10/10) Sep 24 2013 http://d.puremagic.com/issues/show_bug.cgi?id=10381
http://d.puremagic.com/issues/show_bug.cgi?id=10381 Summary: Nonsense associative array comparison Product: D Version: D2 Platform: All OS/Version: All Status: NEW Keywords: wrong-code Severity: critical Priority: P2 Component: DMD AssignedTo: nobody puremagic.com ReportedBy: verylonglogin.reg gmail.com 18:29:05 MSD --- Currently associative arrays are compared by comparing its `impl` pointers e.g. `aa1 < aa2` is rewritten as `cast(void*) aa1 > cast(void*) aa2` instead of calling a runtime function. --- void main() { int[int] aa1 = [0: 1]; int[int] aa2 = [0: 1]; assert(aa1 == aa2); // Passes assert(!(aa1 < aa2) && !(aa1 > aa2)); // Fails, different `impl`-s } --- And yes, there is not such function in druntime so this is druntime's issue too. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jun 16 2013
http://d.puremagic.com/issues/show_bug.cgi?id=10381 IMO, comparing AA's with < should be a compile-time error. AA's are unordered so it makes no sense to use < to compare them. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jul 08 2013
http://d.puremagic.com/issues/show_bug.cgi?id=10381 bearophile_hugs eml.cc changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |bearophile_hugs eml.ccIMO, comparing AA's with < should be a compile-time error. AA's are unordered so it makes no sense to use < to compare them.There are some meaningful (and occasionally useful) operations done on whole associative arrays, like testing if the keys of an associative array are a subset (or strict subset) of the keys of another associative array. But probably it's not the best idea to use < to perform similar set comparisons... -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jul 08 2013
http://d.puremagic.com/issues/show_bug.cgi?id=10381 https://github.com/D-Programming-Language/dmd/pull/2575 -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Sep 19 2013
http://d.puremagic.com/issues/show_bug.cgi?id=10381 Martin Nowak <code dawg.eu> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |code dawg.euThere are some meaningful (and occasionally useful) operations done on whole associative arrays, like testing if the keys of an associative array are a subset (or strict subset) of the keys of another associative array.Yes, interesting but too complex/specialized for built-in functionality IMHO. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Sep 20 2013
http://d.puremagic.com/issues/show_bug.cgi?id=10381FWIW, using == on AA's already does (a superset of) what an AA subset operation would do (iterate over AA keys and check for existence in the other AA). But I agree that it shouldn't be built-in functionality. Maybe a nice library wrapper in std.array, but not much beyond that. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------There are some meaningful (and occasionally useful) operations done on whole associative arrays, like testing if the keys of an associative array are a subset (or strict subset) of the keys of another associative array.Yes, interesting but too complex/specialized for built-in functionality IMHO.
Sep 20 2013
http://d.puremagic.com/issues/show_bug.cgi?id=10381 Commit pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/f357fb07cfbb5b64c5a4ccc12a4ce7b83cb7a3b8 Fix issue 10381 Nonsense associative array comparison -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Sep 24 2013
http://d.puremagic.com/issues/show_bug.cgi?id=10381 Walter Bright <bugzilla digitalmars.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED CC| |bugzilla digitalmars.com Resolution| |FIXED -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Sep 24 2013