On 10/16/07, <b class="gmail_sendername">Martin Ahnelöv</b> &lt;<a href="mailto:operagasten@gmail.com">operagasten@gmail.com</a>&gt; wrote:<div><span class="gmail_quote"></span><div>&nbsp;</div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Since it&#39;s a public class, multiple shreds can access it. However, I<br>don&#39;t really have an idea about how you do that. Please, kassen!<br>Explain!<br></blockquote><div><br>Well, you just execute the file that contains the public class in a VM.
<br><br>From then on, any chuck code that runs in that VM can instantiate objects of that class.<br><br>example;<br><br>-----------B.ck----------------------<br>Foo bar;<br>&lt;&lt;&lt;bar.value&gt;&gt;&gt;;<br>--------------------------------------
<br><br>-----------A.ck-------------------<br>public class Foo<br>{<br>23 =&gt; int value;<br>}<br>--------------------------<br><br>now B is only going to compile if you run A (and thus define Foo) first. Not very hard, I&#39;d say.
<br><br>&nbsp;</div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Also, no, currently chuck doesn&#39;t have a way to import libraries</blockquote>
<div><br><br>True. If <a href="http://B.ck">B.ck</a> would read;<br>-------B.ck-----------------------<br>Macine.add(&quot;<a href="http://A.ck">A.ck</a>&quot;);<br>Foo bar;<br>
&lt;&lt;&lt;bar.value&gt;&gt;&gt;;<br>&nbsp;
--------------------------------<br><br>It wouldn&#39;t work as B would be parsed (finding a undefined class) before A would be Machine.added. So; one possible solution to this would be a Machine.include() command that would see whether the classes in it&#39;s argument are already defined, if not define those and only then parse the rest of the file. That&#39;s not without problems as a way of fixing the issue though and if available I&#39;d support a more intelligent method.
<br></div><br><br>Also, once added a public class can&#39;t be edited, for example to add some feature to it, without restarting the whole VM.<br><br>Kas.<br></div>