On Wed, Sep 26, 2012 at 10:40 PM, David Kastrup <d...@gnu.org> wrote: > Han-Wen Nienhuys <hanw...@gmail.com> writes: > >> In order to do cache invalidation, you will have to construct the >> reverse graph. If A.x depends on B.y, now A points to B. For proper >> cache invalidation, if B.y changes, then A.x becomes invalid. This >> means that A has to store a back-reference to B. Hence all pointers >> have to be stored both ways (including inverting 1-N relations into >> N-1 relations), and the both-way links have to be rewritten correctly >> during line breaking. > > You can assign a generational count to properties. If the generational > count of any dependency is higher than that of the dependent property, > it needs to get regenerated. As long as the dependencies don't get lost > (and we use arbitrary size integers, resetting for each session), this > should be pretty straightforward and not require backwards links. It > "just" requires double-checking your dependencies for change.
But since the dependencies are also properties that could be invalidated, you'd have to recurse , so each property access would potentially expand into an almost infinite number of get_property calls. I think it is a much clearer abstraction to decide that each property can only be evaluated once, and that everything should be driven by callbacks. In fact, one thing I would suggest looking at is removing {before,after}_line_breaking which breaks this model somewhat. -- Han-Wen Nienhuys - han...@xs4all.nl - http://www.xs4all.nl/~hanwen _______________________________________________ lilypond-devel mailing list lilypond-devel@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-devel