On Sunday, 20 October 2013 at 16:08:50 UTC, bearophile wrote:
Logesh Pillay:
Thanks. Coming to D from python, I have to say D's tuples
look difficult. I'm going to see how far I can get with
structs writing my sudoku solver.
I think defining the full correct hashing protocol manually for
structs is harder than using tuples.
There were many discussions to improve and simplify D tuples,
but nothing has come out of them yet.
Bye,
bearophile
This thread is dead. But I'm just posting to say using struct as
a key to an associative array worked fine without opHash and
other special methods. Does that mean (Alexandrescu, ch 4.4.7)
that the array retrieves slower (The sudoku solver seems fast
enough though) If so, there is an obvious way to write (x, y) as
an int: 10x + y