diff -uNr dmd-0.109/dmd/html/d/acknowledgements.html dmd-0.110/dmd/html/d/acknowledgements.html
--- dmd-0.109/dmd/html/d/acknowledgements.html 2004-10-20 09:00:10.000000000 +0200
+++ dmd-0.110/dmd/html/d/acknowledgements.html 2004-12-12 19:59:50.000000000 +0100
@@ -29,6 +29,7 @@
Stewart Gordon,
Ben Hinkle,
Jan Knepper,
+ Thomas Kuehne,
Helmut Leitner,
Lubomir Litchev,
Christopher E. Miller,
diff -uNr dmd-0.109/dmd/html/d/arrays.html dmd-0.110/dmd/html/d/arrays.html
--- dmd-0.109/dmd/html/d/arrays.html 2004-11-30 09:52:30.000000000 +0100
+++ dmd-0.110/dmd/html/d/arrays.html 2004-12-16 02:16:00.000000000 +0100
@@ -16,7 +16,7 @@
[Home]
[Search]
[D]
-
Last update Nov 30, 2004
+
Last update Dec 16, 2004
- Associative arrays are declared by placing the key type within - the [] of an array declaration: + Associative arrays are declared by placing the KeyType + within the [] of an array declaration:
int[char[]] b; // associative array b of ints that are - // indexed by an array of characters + // indexed by an array of characters. + // The KeyType is char[] b["hello"] = 3; // set value associated with key "hello" to 3 func(b["hello"]); // pass 3 as parameter to func()@@ -848,7 +849,7 @@ delete operator:
- delete b["hello"]; + delete b["hello"];This confusingly appears to delete the value of b["hello"], but @@ -856,15 +857,50 @@
The InExpression yields a pointer to the value - if the key is in the associatve array, or null if not: + if the key is in the associative array, or null if not:
- if (("hello" in b) != null) + int* p; + p = ("hello" in b); + if (p != null) ...- Key types cannot be functions or voids. + KeyTypes cannot be functions or voids. +
+ + If the KeyType is a struct type, a default mechanism is used + to compute the hash and comparisons of it based on the binary + data within the struct value. A custom mechanism can be used + by providing the following functions as struct members: + +
+ uint toHash(); + int opCmp(KeyType* s); ++ + For example: +
+ import std.string; + + struct MyString + { + char[] str; + + uint toHash() + { uint hash; + foreach (char c; s) + hash = (hash * 9) + c; + return hash; + } + + int opCmp(MyString* s) + { + return std.string.cmp(this.str, s.str); + } + } +
size + | .size | Returns the size of the reference to the associative array; it is typically 8. |
length + | .length | Returns number of values in the associative array. Unlike for dynamic arrays, it is read-only. |
keys + | .keys | Returns dynamic array, the elements of which are the keys in the associative array. |
values + | .values | Returns dynamic array, the elements of which are the values in the associative array. |
rehash + | .rehash | Reorganizes the associative array in place so that lookups
are more efficient. rehash is effective when, for example,
the program is done loading up a symbol table and now needs
diff -uNr dmd-0.109/dmd/html/d/changelog.html dmd-0.110/dmd/html/d/changelog.html
--- dmd-0.109/dmd/html/d/changelog.html 2004-12-05 01:16:42.000000000 +0100
+++ dmd-0.110/dmd/html/d/changelog.html 2004-12-30 14:59:16.000000000 +0100
@@ -24,6 +24,7 @@
+ + What's New for + D 0.110 ++ +Dec 30, 2004 + +New/Changed Features+
Bugs Fixed+
What's New for
D 0.109
diff -uNr dmd-0.109/dmd/html/d/intro.html dmd-0.110/dmd/html/d/intro.html
--- dmd-0.109/dmd/html/d/intro.html 2004-09-01 11:40:04.000000000 +0200
+++ dmd-0.110/dmd/html/d/intro.html 2004-12-14 10:36:34.000000000 +0100
@@ -14,7 +14,7 @@
[Home]
[Search]
[D]
- |