Ah, sorry Hans, I didn&#39;t read your original example properly. Static members should be initialized the first time the class is referenced, at the latest.<div><br></div><div>/Stefan<br><br><div class="gmail_quote">2009/11/25 Kassen <span dir="ltr">&lt;<a href="mailto:signal.automatique@gmail.com">signal.automatique@gmail.com</a>&gt;</span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hans;<div class="im"><br><br>&gt; That is my worry, too: lack of intuition. It invites errors.<br><br><br></div>I agree. The current behaviour is predictable, it could be called &quot;expected&quot; but I don&#39;t feel it&#39;s intuitive and I agree that it invites error. It&#39;s currently on the bugs page though it should probably be on a &quot;open for debate and better suggestions&quot; page instead.<br>

<br>I feel there is a issue here but I&#39;m not sure I have a alternative. We could have -for example- have a parser warning at this. We could also simply have attempts at setting values at definitions of static members result in a error or we could make a exception and set the value at defining the class itself. Then again; what if it&#39;s not a int being set as in;<br>

<br>3 =&gt; static int foo;<br><br> but a function-call returning a int? This;<br><br>my_fun() =&gt; static int bar;<br><br>might have side effects that could be quit far-ranging.<br><br>I think that if it were my call I&#39;d suggest leaving this be and dealing with it once we get &#39;round to constructors. It does have uses as it is; for one thing it can tell us whether this static member is a member of a class that has a instance at all, in convenient -if hackish- shorthand. Classes and instantiation have far worse issues than this, though indeed this particular behaviour could stand documentation.<br>

<br>Yours,<br>Kas.<br>
<br>_______________________________________________<br>
chuck-users mailing list<br>
<a href="mailto:chuck-users@lists.cs.princeton.edu">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>
<br></blockquote></div><br><br clear="all"><br>-- <br>Release me, insect, or I will destroy the Cosmos!<br>
</div>