[Sorry if folks have seen this before, but I haven't, so not sure what is going on. - kt]<br><br>---------- Forwarded message ----------<br><span class="gmail_quote">From: <b class="gmail_sendername">Ken Tilton</b> <
<a href="mailto:kentilton@gmail.com">kentilton@gmail.com</a>><br>Date: May 9, 2007 5:12 PM<br>Subject: Re: [cells-devel] How to delay evaluation of defobserver?<br>To: Josip Gracin <<a href="mailto:gracin@tel.fer.hr">
gracin@tel.fer.hr</a>><br><br></span>Not sure what is going on. I sent this to the list and you earlier from another mail account and apparently neither got thru. Trying again direct from google mail. Saw your second note. Nah, I would do anything with load order. But this is a design question, which means it cannot be answered in the abstract (which is what I cover below). kt
<br><br>
<div style="font-family: -moz-fixed; font-size: 13px;" lang="x-unicode"><span class="q">Josip Gracin wrote:
<br>
<br><blockquote type="cite">Hello!
<br>
<br>I've successfully ported my application from cells2.0 to Cells3.
Cells3 looks very nice indeed. When needed, I've used c_? to delay
evaluation and it worked great. However, I also have some observers
defined with defobserver and I'd like them to be lazily evaluated
because they depend on some not-yet-created instances. Is there a way
to do this?
<br></blockquote></span>
<br>You might have to provide an example, distilled from your application if
the whole thing would be too much. Are you saying obersvers are getting
called even before the lazy cell got kicked off? Or do you mean, OK, the
lazy cell gets kicked off when expected, but now I further want to defer
the observer running? Or is this unrelated to lazy cells? ie, You have a
normal cell but you want the observer deferred? But then, OK, how do you
indicate when the laziness ends and the observer should fire? Presumably
you want a rule X that terminates laziness and activates an observer. If
so, you could just code up:
<br>
<br> (defobserver .....
<br> (when X ;; in your case, (fm-includes self <whavtever>)
<br> <stuff that depends on whatever>))
<br>
<br>Depending on the design, you might also consider having a Cell that says
"OK, now the model has reached this state", part of which is determined
by these other instances coming into existence. Then you either hang
your observer off that new state variable or check that state variable
in the observer.
<br>
<br>kt
<br><br><br>
<br>
<br><div><span>-- <br></span>Ken Tilton
Theory Y Learning <a href="mailto:ken@theoryyalgebra.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">ken@theoryyalgebra.com</a>
2112 Baileys Corner Rd <a href="http://www.theoryyalgebra.com/" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://www.theoryyalgebra.com</a>
Wall, NJ 07719 732-359-6038 | 646-269-1077 (m)
<br>
<br>
<br>
<br></div></div>