...or at least as consistent as possible, taking into account the differences that do exist between class handling in Java and ChucK. In Java it&#39;s stated that static members are instantiated when classes are loaded, as part of the dynamic loading of classes - each is stored in its own file. ChucK doesn&#39;t load classes in this way, but since Java classes are usually loaded when they are first referenced, the effect is pretty much the same in the two languages.<div>
<br></div><div>I&#39;m guessing you want to do some kind of namespace encapsulation? It would be a cool thing to be able to create your own equivalents of Std and Math (maybe I&#39;m ignorant and you already can...)</div>
<div><br></div><div>/Stefan<br><br><div class="gmail_quote">On Tue, Nov 24, 2009 at 10:47 PM, Stefan Blixt <span dir="ltr">&lt;<a href="mailto:stefan.blixt@gmail.com">stefan.blixt@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Not necessarily a bug. Again, consistent with how Java works with classes (I sometimes wonder if Ge got hold of the Java compiler source code cheap ;)<div><br></div><div>/Stefan<div><div></div><div class="h5"><br><br><div class="gmail_quote">
On Tue, Nov 24, 2009 at 7:51 PM, Hans Aberg <span dir="ltr">&lt;<a href="mailto:haberg@math.su.se" target="_blank">haberg@math.su.se</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">For some reason, &#39;chuck&#39; does not instantiate class static constants until there has been an instantiation of the class itself.<br>


<br>
  Hans<br>
<br>
---- <a href="http://static.ck" target="_blank">static.ck</a> ----<br>
class Test {<br>
  3 =&gt; static int d;<br>
<br>
  fun static void print() {<br>
    if (d == 0)  chout &lt;= &quot;Nope!\n&quot;;<br>
    else  chout &lt;= &quot;Yep.\n&quot;;<br>
  }<br>
}<br>
<br>
Test.print();<br>
Test test_;<br>
Test.print();<br>
<br>
---- run ----<br>
$ chuck <a href="http://static.ck" target="_blank">static.ck</a><br>
Nope!<br>
Yep.<br>
----<br>
<br>
_______________________________________________<br>
chuck-users mailing list<br>
<a href="mailto:chuck-users@lists.cs.princeton.edu" target="_blank">chuck-users@lists.cs.princeton.edu</a><br>
<a href="https://lists.cs.princeton.edu/mailman/listinfo/chuck-users" target="_blank">https://lists.cs.princeton.edu/mailman/listinfo/chuck-users</a><br>
</blockquote></div><br><br clear="all"><br></div></div>-- <br>Release me, insect, or I will destroy the Cosmos!<br>
</div>
</blockquote></div><br><br clear="all"><br>-- <br>Release me, insect, or I will destroy the Cosmos!<br>
</div>