A critic of Guido's blog on Python's lambda

Ken Tilton kentilton at gmail.com
Mon May 8 21:27:25 CEST 2006



Ken Tilton wrote:
> 
> I just keep what I call a "datapulse ID", sequentially growing from 
> zero, in a global variable. Each ruled Cell keeps track of its memoized 
> value, datapulse stamp, and whether it in fact changed value in reaching 
> its current datapulse stamp. (I can reach the current datapulse stamp by 
> determining no dependency (direct or indirect recursively down the 
> dependency graph) is both more current than me /and/ in fact changed in 
> value getting there.[1] If not, I take on the current datapulse but 
> never run my rule. Or, if yes, I run my rule but might compute the same 
> value as last time. Either way, I can flag myself as current but 
> not-actually-changed.)
> 
....

> 
> [1] Aha! I see a flaw. Arises if two datapulses pass before I (a cell 
> <g>) get read and must determine if my cache is obsolete, and some 
> dependency changed in the first datapulse but not the second. 

No, I do not think that can happen. I was conflating two mutually 
exclusive paths. If I am checking a dependency that means it would have 
notified me when it in fact changed. If my rule is running i will always 
get a valid value from a read. So i do not think there is a hole in 
there anywhere.

In any case, I would not have needed a new last-changed-datapulse slot, 
i could just change the "changed" flag to be last-changed-datapulse.

kenny

-- 
Cells: http://common-lisp.net/project/cells/

"Have you ever been in a relationship?"
    Attorney for Mary Winkler, confessed killer of her
    minister husband, when asked if the couple had
    marital problems.



More information about the Python-list mailing list