Re: Are associative arrays stable in D?

2013-07-20 Thread bearophile
Gary Willoughby: Are associative arrays stable in D? See also: http://d.puremagic.com/issues/show_bug.cgi?id=4179 Bye, bearophile

Re: Are associative arrays stable in D?

2013-07-17 Thread Mike Parker
On Tuesday, 16 July 2013 at 19:37:14 UTC, Gary Willoughby wrote: If however you remove the .byKey() call and use .keys instead, it works! With byKey, you are iterating over a range of original key values, meaning that attempting to remove any of them will result in bad bahavior. With

Re: Are associative arrays stable in D?

2013-07-17 Thread monarch_dodra
On Wednesday, 17 July 2013 at 08:31:00 UTC, Mike Parker wrote: On Tuesday, 16 July 2013 at 19:37:14 UTC, Gary Willoughby wrote: If however you remove the .byKey() call and use .keys instead, it works! With byKey, you are iterating over a range of original key values, meaning that

Re: Are associative arrays stable in D?

2013-07-17 Thread Yota
On Wednesday, 17 July 2013 at 09:48:06 UTC, monarch_dodra wrote: I find it disturbing that the built-in property keys would dup an entire array, and then copy all the keys into that array, whereas the function byKeys() will simply allow you to iterate on the keys. keys is in blatant

Re: Are associative arrays stable in D?

2013-07-17 Thread Jonathan M Davis
On Wednesday, July 17, 2013 19:21:03 Yota wrote: On Wednesday, 17 July 2013 at 09:48:06 UTC, monarch_dodra wrote: I find it disturbing that the built-in property keys would dup an entire array, and then copy all the keys into that array, whereas the function byKeys() will simply allow you

Re: Are associative arrays stable in D?

2013-07-17 Thread Ali Çehreli
On 07/17/2013 10:21 AM, Yota wrote: On Wednesday, 17 July 2013 at 09:48:06 UTC, monarch_dodra wrote: I find it disturbing that the built-in property keys would dup an entire array, and then copy all the keys into that array, whereas the function byKeys() will simply allow you to iterate on

Are associative arrays stable in D?

2013-07-16 Thread Gary Willoughby
Are associative arrays stable in D? I have to ask because i'm having a great deal of problems with them for simple operations. For example the following crashes. import std.stdio; void main(string[] args) { int[string] waiting; waiting[gary] = 1; waiting[tess] = 2

Re: Are associative arrays stable in D?

2013-07-16 Thread Jonathan M Davis
On Tuesday, July 16, 2013 21:37:13 Gary Willoughby wrote: Are associative arrays stable in D? I have to ask because i'm having a great deal of problems with them for simple operations. For example the following crashes. import std.stdio; void main(string[] args) { int[string] waiting