[lively-kernel] data binding setters / why no infinite recursion?
robert.krahn at gmail.com
Tue Sep 16 01:30:50 CEST 2014
Hi, Davide --
Dan's original Fabrik does a topological sort before evaluating connections
when I'm not mistaken.
Lively's approach is much simpler: If a connection is active it is marked
as such (as kind of a dynamic variable) and subsequent activations won't
When you look at AttributeConnection>>update (eval
in Lively) then the first line does the activation check.
On Mon, Sep 15, 2014 at 4:10 PM, Davide Della Casa <davidedc at gmail.com>
> In the Celsius - Fahrenheit example, each text box is connected to the
> other one.
> So changing the Celsius calculates the Fahrenheit and vice-versa.
> Question is: why does it not go in infinite updates between the two text
> I’m going through the code and “How connect works” and can’t figure out
> what’s preventing the infinite updates. The original Ingalls 1988 Fabrik
> paper mentions that this loop can/should/is avoided but it doesn’t give
> specifics (“with some care” and “bidirectionality…shorthand for multiple
> paths” page 5). There doesn’t seem to be a check in “connect” or “update”
> or the setter. The setter seems to do an update, so why doesn’t changing
> the C box cause the setter of F to invoke updates on C again?
> Also tried to look for “loop” in source code
> <https://github.com/LivelyKernel/LivelyKernel/search?utf8=✓&q=loop&type=Code> but
> nothing jumps to the eye.
> What’s the trick I’m missing?
> (BTW the edit/select/move-cursor behaviour in the text boxes when they are
> connected is glitchy)
> Davide Della Casa
> lively-kernel mailing list
> lively-kernel at hpi.uni-potsdam.de
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the lively-kernel