<br><div class="gmail_quote"><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></blockquote><div><br>Hey, Peter,<br>&nbsp;<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>I don&#39;t see what the problem is.&nbsp;</blockquote><div><br>There is no real problem, there is just some strange behaviour and a lack of documentation. The word &quot;public&quot; as far as I know isn&#39;t defined at all aside from how it affects classes. I&#39;m really quite sure it&#39;s not defined for functions in ChucK.<br>
&nbsp;<br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> You&#39;re not sporking &#39;a public&#39;; surely public is an access modifier that can apply to functions perfectly viably.&nbsp; </blockquote>
<div><br>Well, clearly it&#39;s a function but I defined it by calling it a &quot;public&quot;.<br><br>if <br><br>fun void foo() {}<br><br>is a &quot;function&quot;<br><br>then by my logic<br><br>public void bar() { }<br>
<br>is a &quot;public&quot;. I suppose this is pushing some linguistic envelopes but you have to admit there is some logic to it, right? ;¬)<br><br>&nbsp;</div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I wouldn&#39;t expect the code you posted to be illegal, although there may be some slight redundancy.&nbsp;</blockquote><div><br>I agree. I have no issue beyond a lack of documentation and being surprised I can use the word there at all and that it works exactly like &quot;fun&quot;.<br>
&nbsp;</div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> I haven&#39;t chucked for a while, so this could be inaccurate but I think that &#39;public&#39; there will just mean that you could run (perhaps by sporking, or not, it&#39;s somewhat irrelevant) that function from other files once that one had been loaded (and also that you couldn&#39;t redefine the function foo() until you restart the VM).&nbsp;</blockquote>
<div><br>I just tried that and you can&#39;t. You can&#39;t run a &quot;public&quot; from another file, I think you are confused with &quot;public&quot; as it applies to classes. This;<br><br>public class foo { static int bar; }<br>
<br>can be instantiated from other files and can&#39;t be redefined until you restart the VM. That&#39;s fine... well it&#39;s at least documented, it&#39;s useful too.<br><br>What &quot;public functions&quot; ought to be and how -if in any way- they are different from normal functions isn&#39;t at all clear and even after trying everything I could think of I can&#39;t find a single difference.<br>
<br>At the risk of repeating myself; there is no issue with that at all (yet....) but it&#39;s not documented and I don&#39;t see the logic to having a second word, which is why I asked. I would imagine it&#39;s there as a place-holder for future usage but it can&#39;t hurt to ask and be sure.<br>
<br>I&#39;d be really happy if I *could* run them from different files, especially if I could also change them later, presumably on the condition that I&#39;d keep the return type the same.<br><br>&nbsp;</div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
 Also, can you not spork a function that returns something, just not access the returned value?&nbsp; I don&#39;t see why not.<br>
</blockquote><div><br>No, I fear you can&#39;t. I&#39;d explain why but as luck would have it there was a topic on this list on this exact subject just yesterday called &quot;return values of sporked functions&quot; where Mike &amp; me covered this very subject. I recommend you look that one up in your inbox. <br>
</div></div><br>Yours,<br>Kas.<br>