[chuck-users] setting static data at construction (bug)

Stefan Blixt stefan.blixt at gmail.com
Wed Sep 10 11:33:02 EDT 2008


Just checking to see that I understand this. So these two pieces of code
should result in different behaviour (not sure if you can reference static
variables in classes like this, but you get my drift):

class DaClazz {
  8 => static int daVariable;
}
9 => DaClass.daVariable;
DaClazz objektz[7];

------------------

class DaClazz {
  static int daVariable;
  8 => daVariable;
}
9 => DaClass.daVariable;
DaClazz objektz[7];

After the first has executed daVariable = 9. After the second has executed
daVariable = 8.

...?

/Stefan

On Wed, Sep 10, 2008 at 4:49 PM, Stephen Sinclair <radarsat1 at gmail.com>wrote:

> On Tue, Sep 9, 2008 at 9:42 PM, Kassen <signal.automatique at gmail.com>
> wrote:
> > Stephen Sinclair;
> >
> >>
> >> Hey, just wanted to mention: i encourage you (chuckers? chuckists?
> >> chuckians?) to post bugs here or on the dev list, even if you get
> >> little response.  At some point in the future we can do a simple
> >> search through the lists for the keyword "bug" and collect them all,
> >> so please don't be afraid to make these kind of posts.
> >
> > I took that to mean you agree this is a bug and not a feature?
>
> Initializing static data is pretty useful, so if there's no other way
> to do it then yes I'd agree.
> Well, you can do it I guess by sticking initialization code after the
> class, but I think your proposal is cleaner.
>
> Steve
> _______________________________________________
> chuck-users mailing list
> chuck-users at lists.cs.princeton.edu
> https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
>



-- 
Release me, insect, or I will destroy the Cosmos!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cs.princeton.edu/pipermail/chuck-users/attachments/20080910/7f8dd4e2/attachment.html>


More information about the chuck-users mailing list