Re: Associative array with duplicated keys?

2015-11-06 Thread cym13 via Digitalmars-d-learn
On Thursday, 5 November 2015 at 13:08:20 UTC, Adam D. Ruppe wrote: On Thursday, 5 November 2015 at 10:04:02 UTC, Andrea Fontana wrote: Anyway: are duplicated keys on declaration allowed? They shouldn't be... Why? I'll admit it is something I've never even thought of using, but every

Re: Associative array with duplicated keys?

2015-11-06 Thread cym13 via Digitalmars-d-learn
On Friday, 6 November 2015 at 14:28:53 UTC, cym13 wrote: auto aa = ["a":10, "b", 42, "a":20]; This should readauto aa = ["a":10, "b":42, "a":20]; of course.

Re: Associative array with duplicated keys?

2015-11-05 Thread Andrea Fontana via Digitalmars-d-learn
On Thursday, 5 November 2015 at 09:27:35 UTC, tcak wrote: On Thursday, 5 November 2015 at 08:55:10 UTC, Andrea Fontana wrote: Check this: http://dpaste.dzfl.pl/ebbb3ebac60e It doesn't give any error or warning. And writeln seems confused (do you see that "," at the end?) I am sure the coder

Associative array with duplicated keys?

2015-11-05 Thread Andrea Fontana via Digitalmars-d-learn
Check this: http://dpaste.dzfl.pl/ebbb3ebac60e It doesn't give any error or warning. And writeln seems confused (do you see that "," at the end?)

Re: Associative array with duplicated keys?

2015-11-05 Thread tcak via Digitalmars-d-learn
On Thursday, 5 November 2015 at 08:55:10 UTC, Andrea Fontana wrote: Check this: http://dpaste.dzfl.pl/ebbb3ebac60e It doesn't give any error or warning. And writeln seems confused (do you see that "," at the end?) I am sure the coder of writeln was lazy to prevent putting ", " after last

Re: Associative array with duplicated keys?

2015-11-05 Thread Adam D. Ruppe via Digitalmars-d-learn
On Thursday, 5 November 2015 at 10:04:02 UTC, Andrea Fontana wrote: Anyway: are duplicated keys on declaration allowed? They shouldn't be...

Re: Associative array with duplicated keys?

2015-11-05 Thread Marc Schütz via Digitalmars-d-learn
https://issues.dlang.org/show_bug.cgi?id=15290

Re: Associative array with duplicated keys?

2015-11-05 Thread Gary Willoughby via Digitalmars-d-learn
On Thursday, 5 November 2015 at 10:04:02 UTC, Andrea Fontana wrote: Anyway: are duplicated keys on declaration allowed? IMHO This should at least be a warning.

Re: Associative array with duplicated keys?

2015-11-05 Thread Marc Schütz via Digitalmars-d-learn
On Thursday, 5 November 2015 at 08:55:10 UTC, Andrea Fontana wrote: Check this: http://dpaste.dzfl.pl/ebbb3ebac60e It doesn't give any error or warning. And writeln seems confused (do you see that "," at the end?) This is an outright bug, please report on issues.dlang.org: void main() {