1: import std.file; 2: import std.stream; 3: 4: int main(char args[][]) { 5: char[][char[]] hashtable; 6: 7: hashtable["joe"] = "bob"; 8: hashtable["sally"] = "Once"; 9: 10: foreach (char ent[]; hashtable.keys) { 11: stdout.printf("%.*s = %.*s\n", ent, hashtable[ent]); 12: } 13: 14: return(0); 15: } associative_arrays.d is a simple example of a hash table/associative array written in D. |