[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Implement ‘hash’ for structs

From: Ludovic Courtès
Subject: Re: [PATCH] Implement ‘hash’ for structs
Date: Thu, 11 Oct 2012 16:24:11 +0200
User-agent: Gnus/5.130005 (Ma Gnus v0.5) Emacs/24.2 (gnu/linux)


Mark H Weaver <address@hidden> skribis:

> address@hidden (Ludovic Courtès) writes:
>> Mark H Weaver <address@hidden> 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’ argument of ‘scm_hasher’
>> for that, as is done for pairs.
> I don't think 'depth' is an appropriate name for that argument.

Yeah, it’s debatable.  It’s called just ‘d’ in hash.c, and Andy renamed
it to ‘depth’ in 2.1.  I think ‘depth’ conveys the idea that it’s about
limiting the recursion depth.

I’d keep it this way for consistency.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]