<br><br><div class="gmail_quote">2009/3/13 Robert Poor <span dir="ltr">&lt;<a href="mailto:rdpoor@gmail.com">rdpoor@gmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi Kas:<br>
<br>
My fault for not pointing this out: one contained a reference to the other, not an instance.</blockquote><div><br>You are saying it merely contains a reference to the class itself, names that and doesn&#39;t actually instantiate it? This would be useful for public classes with static data? I didn&#39;t know you could do that but I suppose it could make sense.<br>
<br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
<br>
But even when both are references, ChucK still won&#39;t compile it.<br>
</blockquote><div><br>I think it&#39;s quite clear why not; both files depend on the other file to be useful; basically both need to be run first yet in practice ChucK can only do one thing at a time. I fear this simply won&#39;t fly. Either the chicken or the egg will need to come first.<br>
 </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
Imagine you had a &quot;controller&quot; object that controls an &quot;engine&quot; object, but the engine needs a reference back to the controller, e.g. to query its state.  This is a standard programming pattern.  </blockquote>
<div><br>Ah, ok. Erm.... maybe define a class &quot;Foo&quot; that has both the controling and querying functions (at least functions of that type and name) and extend it twice, once for the engine and once for the controller? That way you could run the file containing the Foo class and refer to that type in the engine and controller code, you&#39;d then instantiate the engine and controller and asign the engine to the Foo in the controller and the controller to the Foo in the engine from a fourth file. That way the classes can be defined in any order as long as Foo goes first and we&#39;d instantiate and asign after that. I think that might work...<br>
<br>Not especially pleasant, I admit, and you better not need arrays or there will be &quot;Clemow&#39;s bane&quot; type trouble.<br><br></div></div>Sigh, this is now looking quite tricky.<br><br>Yours,<br>Kas.<br>