On Thu, Sep 11, 2008 at 9:27 AM, Kassen
Stefan Blixt;
Yeah, 4 => 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.
I think it should be set at define time because of the special case that static data (in public classes) forms for ChucK. It's useful to be able to set values in classes that are never instantiated and are only used to share data across the VM. We can already do that by setting the value outside of the class in the file that defines the class but I feel this is far cleaner and less likely to lead to confusion when we have a lot of files holding a lot of classes.
My perspective on this bug is that it should behave like C. i.e., the
following code,
#include