[chuck-users] Doing something to all members of a class?

Kassen signal.automatique at gmail.com
Tue Mar 13 12:32:54 EDT 2007

On 3/13/07, Scott Wheeler <wheeler at kde.org> wrote:
> The conceptual problem that you had is that static functions operate on
> *no* instance of a class rather than *all* instances of a class.  Static
> functions can only access static variables since the others are not
> available (since there's no instance there for them to access).

Yes, that's it exactly! My reasoning was that it looked to me like changing
a static variable acted on all members and that this would mean that static
functions would work in the same way.

This idea got reinforced by Chuck allowing me to adress static functions as
members of instances and it not being very clear *why* this led to issues so
I just tried all variations that I could think of.

Oh, well, another great learning experience and another thing found that
could stand clarification in the docs. The examples do corectly adress only
static variables but they don't explain why they do so. I thought they were
taking static integers as a target because that section was explaining those
as well and that I could abstract this and aply it to other sorts of things
as well.

Thanks for your clear explanation, realy like that way of doing lists as
well, BTW.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.cs.princeton.edu/pipermail/chuck-users/attachments/20070313/c7e7e69c/attachment.htm 

More information about the chuck-users mailing list