Re: [PATCH] Implement ‘hash’ for structs

2012-10-12 Thread Ludovic Courtès
Mark H Weaver m...@netris.org skribis: l...@gnu.org (Ludovic Courtès) writes: Mark H Weaver m...@netris.org skribis: I guess this 'if' is to avoid an infinite loop if the struct points back to itself. However, it apparently fails to detect cycles in the general case. Yes, indeed.

Re: [PATCH] Implement ‘hash’ for structs

2012-10-11 Thread Mark H Weaver
l...@gnu.org (Ludovic Courtès) writes: Mark H Weaver m...@netris.org skribis: I guess this 'if' is to avoid an infinite loop if the struct points back to itself. However, it apparently fails to detect cycles in the general case. Yes, indeed. Here’s an updated patch that uses the ‘depth’

Re: [PATCH] Implement ‘hash’ for structs

2012-10-11 Thread Ludovic Courtès
Hi, Mark H Weaver m...@netris.org skribis: l...@gnu.org (Ludovic Courtès) writes: Mark H Weaver m...@netris.org skribis: I guess this 'if' is to avoid an infinite loop if the struct points back to itself. However, it apparently fails to detect cycles in the general case. Yes, indeed.

Re: [PATCH] Implement ‘hash’ for structs

2012-10-10 Thread Ludovic Courtès
Hello! Mark H Weaver m...@netris.org skribis: l...@gnu.org (Ludovic Courtès) writes: As incredible as it may seem, ‘hash’ until now always returned 263 % n for structs, leading to interesting experiences when using structs as hash table keys. Yes, do you remember us talking about this long

[PATCH] Implement ‘hash’ for structs

2012-10-09 Thread Ludovic Courtès
Hello! As incredible as it may seem, ‘hash’ until now always returned 263 % n for structs, leading to interesting experiences when using structs as hash table keys. The attached patch provides a simple hasher for structs. I’ll commit it within a few days if there are no objections. Ludo’.

Re: [PATCH] Implement ‘hash’ for structs

2012-10-09 Thread Mark H Weaver
Hi Ludovic! l...@gnu.org (Ludovic Courtès) writes: As incredible as it may seem, ‘hash’ until now always returned 263 % n for structs, leading to interesting experiences when using structs as hash table keys. Yes, do you remember us talking about this long ago on IRC? I wanted to fix this,