swarm-support
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

A story about [self Class]...


From: mcmullin
Subject: A story about [self Class]...
Date: Fri, 4 Apr 1997 15:39:08 -0700 (MST)


I don't know what this means, but I pass it on for what
it's worth.

I had a class for which I wanted a tailored probeMap.
At various points in setting this up I used 
"[self Class] to refer to the object's class. It seemed
to work fine.  Then I changed some totally unrelated
(???)  things in my app, and the probeMap no longer got
set up properly - instead I seemed to be getting the
default probeMap (instance vars only since Swarm 1.0.1
I think).

It seems the problem was that I setting up the probeMap
within a *class* method.  Therefore, [self Class] was
invoking an *instance* method on a *class* object.  At
any rate, when I replaced "[self Class]" with simply
"self" (which, I guess, *should* mean the "class" when
invoked within a class method), my problems seemed to
go away, and everything is now running stably again.

Of course, I would have expected that if calling
instance methods is not allowed on a class object
(which would be reasonable enough) then some kind of
exception should be raised - instead of it "working"
intermittently. Can anyone else shed any light on this?

Barry.

-- 

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
| Barry McMullin, ALife Group,               |    address@hidden |
| Santa Fe Institute, 1399 Hyde Park Road,   |  Voice: +1-505-984-8800 |
| Santa Fe, NM 87501, USA.                   |  FAX:   +1-505-982-0565 |
| http://www.eeng.dcu.ie/~mcmullin           |                         |
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++



                  ==================================
   Swarm-Support is for discussion of the technical details of the day
   to day usage of Swarm.  For list administration needs (esp.
   [un]subscribing), please send a message to <address@hidden>
   with "help" in the body of the message.
                  ==================================


reply via email to

[Prev in Thread] Current Thread [Next in Thread]