<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div>indeed had just traced through it.</div><div><br></div><div>For future Google searchers: it’s the “isActive” flag of the AttributeConnection.</div><div><br></div><div>It’s set at “this.isActive = true;” in the update method.</div><div><br></div><div>Update causes the setter in F to go to work. the setter in F calls the updater of C, but here we stop because we check the flag we set before.</div><div><br></div><div>(I’m short on time now, if I had the time I’d mark that flag to be explained in the code)</div><div><br></div><div><br></div><div><br></div><div>On separate note, targetProp/targetMethod turn loosely into each other:</div><div><br></div><div><i>   initialize: function(source, sourceProp, target, targetProp, spec)</i></div><div><br></div><div>should probably be something like</div><div><div><br></div><div><i>   initialize: function(source, sourceProp, target, targetPropOrMethod, spec)</i></div></div><div><br></div><div>and the ambivalence of that value “<i>targetPropOrMethod</i> “ should be probably propagated through, it seems that the naming “picks” one or the other value a little randomly along the code, e.g. in init function:</div><div><i><br></i></div><div><i>    this.targetMethodName = targetProp;</i></div><div><br></div><div>which seems strange, at least to me.</div><div><br></div><div>Cheers,</div><div>Davide Della Casa</div><br><div><div>On 16 Sep 2014, at 00:39, Lars <<a href="mailto:lars.wassermann@googlemail.com">lars.wassermann@googlemail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr"><div>Hi Davide,</div><div><br></div>The trick is somewhere in the binding activation. The implementation prevents the same connection to be triggered twice in the same scope. So changing C updates F updates C, but then the recursion stops. You can still run into infinite loops if you use asynchronous updater, afaik. But most of the base cases should be covered by that simple change of semantics.<div><br></div><div>Best,</div><div>Lars</div></div><div class="gmail_extra"><br><div class="gmail_quote">On 15 September 2014 16:10, Davide Della Casa <span dir="ltr"><<a href="mailto:davidedc@gmail.com" target="_blank">davidedc@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">In the Celsius - Fahrenheit example, each text box is connected to the other one.<div><br></div><div>So changing the Celsius calculates the Fahrenheit and vice-versa.</div><div><br></div><div>Question is: why does it not go in infinite updates between the two text boxes?</div><div><br></div><div>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?</div><div><br></div><div>Also tried to look for “loop” in source code <a href="https://github.com/LivelyKernel/LivelyKernel/search?utf8=%E2%9C%93&q=loop&type=Code" target="_blank">https://github.com/LivelyKernel/LivelyKernel/search?utf8=%E2%9C%93&q=loop&type=Code</a> but nothing jumps to the eye.</div><div><br></div><div>What’s the trick I’m missing?</div><div><br></div><div>(BTW the edit/select/move-cursor behaviour in the text boxes when they are connected is glitchy)</div><div><br></div><div>Cheers,</div><div>Davide Della Casa</div><div><br></div><div><br></div></div><br>_______________________________________________<br>
lively-kernel mailing list<br>
<a href="mailto:lively-kernel@hpi.uni-potsdam.de">lively-kernel@hpi.uni-potsdam.de</a><br>
<a href="http://lists.hpi.uni-potsdam.de/listinfo/lively-kernel" target="_blank">http://lists.hpi.uni-potsdam.de/listinfo/lively-kernel</a><br>
<br></blockquote></div><br></div>
</blockquote></div><br></body></html>