Hi<br>
<br>
I think these are problems for the Chuck compiler, there are things that I think that makes no sense.<br>
<div id="result_box" dir="ltr">Perhaps what I like to me is a compiler that will not allow me to do mistakes<br>
<br>
</div>
// printf: print float :_)<br>
public float printf( float n ) {<br>
&nbsp;&nbsp;&nbsp; &lt;&lt;&lt; n &gt;&gt;&gt;;<br>
&nbsp;&nbsp;&nbsp; //return void;<br>
}<br>
<br>
printf( float n ) =&gt; float num;<br>
&lt;&lt;&lt; num &gt;&gt;&gt;;<br>
<br>
Uncomment the line return void, there is a wrong message syntax.<br>
<br>
<div id="result_box" dir="ltr">Greetings</div>
Lucas<br><br>
<br><div><span class="gmail_quote">2008/6/7, Kassen &lt;<a href="mailto:signal.automatique@gmail.com">signal.automatique@gmail.com</a>&gt;:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<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><span class="q"><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></span><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><span class="q"><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>

</span><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><span class="q"><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></span><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><span class="q"><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>
</span><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><span class="q"><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></span><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>
<br>_______________________________________________<br>
chuck-users mailing list<br>
<a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:chuck-users@lists.cs.princeton.edu">chuck-users@lists.cs.princeton.edu</a><br>
<a onclick="return top.js.OpenExtLink(window,event,this)" href="https://lists.cs.princeton.edu/mailman/listinfo/chuck-users" target="_blank">https://lists.cs.princeton.edu/mailman/listinfo/chuck-users</a><br>
<br></blockquote></div><br>