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

Arrays

@@ -826,20 +826,21 @@
-

Associative Arrays

+

Associative Arrays

D goes one step further with arrays - adding associative arrays. Associative arrays have an index that is not necessarily an integer, and can be sparsely populated. The index for an associative array - is called the key. + is called the key, and its type is called the KeyType.

- 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);
+	    }
+	}
+	

Properties

@@ -873,27 +909,27 @@ - - - - -
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

+
    +
  • Structs can now be forward referenced. +
  • Structs can now be used as keys in associative arrays. +
  • Arrays of structs can now be sorted. +
  • Drastically speedup up compiler with projects that contain + complicated imports. +
  • Does a better job soldiering on after errors are diagnosed. +
  • .sizeof property can no longer be overridden. +
+ +

Bugs Fixed

+
    +
  • Fixed regression on using super or this outside of a class. +
  • Fixed internal error cod1 2729. +
  • Object file now deleted if compilation errors occurred. +
  • Fixed some circumstances where properties were not recognized. +
  • Fixed potential hang in critical section release code. +
  • Fixed pointer value returned by 'in' expressions. +
  • Fixed codegen bug with some array initializations. +
  • Fixed access violation in std.uri.encodeComponent(). +
+ +

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] -
Last update Sep 1, 2004 +
Last update Dec 14, 2004

D Programming Language

@@ -74,6 +74,9 @@ + "D Language Perfect Guide" +

+ For SDWest 2004 I gave a presentation on D. diff -uNr dmd-0.109/dmd/html/d/lex.html dmd-0.110/dmd/html/d/lex.html --- dmd-0.109/dmd/html/d/lex.html 2004-10-25 15:11:30.000000000 +0200 +++ dmd-0.110/dmd/html/d/lex.html 2004-12-30 02:01:08.000000000 +0100 @@ -10,7 +10,7 @@ [Search] [D] -
Last update Oct 25, 2004 +
Last update Dec 30, 2004


Lexical

@@ -786,6 +786,7 @@ true try typedef + typeid typeof ubyte diff -uNr dmd-0.109/dmd/html/d/toc.html dmd-0.110/dmd/html/d/toc.html --- dmd-0.109/dmd/html/d/toc.html 2004-09-10 18:30:08.000000000 +0200 +++ dmd-0.110/dmd/html/d/toc.html 2004-12-30 01:56:36.000000000 +0100 @@ -78,8 +78,15 @@ · News
· Forum
· D links
-· Archives
-· Old Archives
+ + +
+Archives
+· digitalmars.D
+· digitalmars.D.dtl
+· digitalmars.D.bugs
+· D.gnu
+· Old D