[chuck-users] Static bug

Kassen signal.automatique at gmail.com
Tue Nov 24 17:09:22 EST 2009


2009/11/24 Hans Aberg <haberg at math.su.se>

> For some reason, 'chuck' does not instantiate class static constants until
> there has been an instantiation of the class itself.
>
>
Writing the value to the variable is deemed part of the constructor instead
of the instantiation.
You could get around this using a static member function to set all such
values, that way you could have static members set to default values without
a class instance.

I'm not completely happy with the current behaviour as two elements of a
single line are treated in very different ways without this being
intuitively clear. Of course it could be argued that if this bothers us we
simply shouldn't do it.

Kas.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cs.princeton.edu/pipermail/chuck-users/attachments/20091124/a5b3374e/attachment.htm>


More information about the chuck-users mailing list