Re: What wrong did i do? (key in hashtable is always null)

2009-12-31 Thread grauzone
The Anh Tran wrote: This is just a small D exercise. I port c++ knucleotide from shootout.alioth.debian.org Issue 1: If i manually listing hashtable contents, the key does exist in that ht. But (key in hash_table) always yield null. Worse, if i use: auto val = ht[key], an exception is thrown.

Re: What wrong did i do? (key in hashtable is always null)

2009-12-31 Thread The Anh Tran
grauzone wrote: Is your opCmp/toHash really called? Maybe the function signature is off, and dmd doesn't find the function. Just a guess, I don't really know how this D2 stuff works. toHash + opCmp are called. The awkward is that, most of those functions are copied pasted from C. They work

Re: What wrong did i do? (key in hashtable is always null)

2009-12-31 Thread The Anh Tran
bearophile wrote: This was my version, maybe it solves some of your problems: http://shootout.alioth.debian.org/debian/benchmark.php?test=knucleotidelang=gdcid=2 I haven't used my dlibs here, so for example that sort in the middle is long and ugly (and not fully correct, that opCmp doesn't

What wrong did i do? (key in hashtable is always null)

2009-12-30 Thread The Anh Tran
This is just a small D exercise. I port c++ knucleotide from shootout.alioth.debian.org Issue 1: If i manually listing hashtable contents, the key does exist in that ht. But (key in hash_table) always yield null. Worse, if i use: auto val = ht[key], an exception is thrown. Problem code is