<div dir="ltr">Yeah, 4 =&gt; static int i; in a class should either result in a syntax error or in 4 being assigned to i once, either at define time or the first time the class is referenced. The current behaviour is wrong.<div>
<br></div><div>/Stefan<br><br><div class="gmail_quote">On Wed, Sep 10, 2008 at 8:00 PM, Kassen <span dir="ltr">&lt;<a href="mailto:signal.automatique@gmail.com">signal.automatique@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;">
<div dir="ltr">Stefan Blixt;<span dir="ltr"></span><br><div class="gmail_quote"><div class="Ih2E3d"><blockquote class="gmail_quote" style="border-left:1px solid rgb(204, 204, 204);margin:0pt 0pt 0pt 0.8ex;padding-left:1ex">
<div dir="ltr">
Aha - so the initialization of a static member of a class doesn&#39;t work at all. I see. I am a bit confused about the mixing of static variable declarations and constructor code in classes - I would think it would be more clear if the two were separated syntactically somehow. But I guess it will work this way also.</div>

</blockquote></div><div><br>Yes. I do suppose this bug/feature could be a side effect of a desire to avoid having new instances reset the values of static members... but then again those static members don&#39;t belong to instances at all and instead belong to the class itself. <br>

<br>I could also imagine that the desired functionality might be to have &quot;3 =&gt; static int foo;&quot; only run when the class is defined and not when it&#39;s instantiated. Actually that would make sense to me. At any rate I object to the above being functionally identical to &quot;static int foo;&quot; with no warning.<br>

<br>It&#39;s interesting to note that ChucK does try;<br>This;<br>----------------<br>class foo<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; 4.3 =&gt; static int bar;<br>&nbsp;&nbsp;&nbsp; }<br></div></div>---------------<br>Does give a error about being unable to resolve the ChucK operator on types float and int.<br>

<br>Kas.<br></div>
<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></div>