swarm-support
[Top][All Lists]
Advanced

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

Re: Can a Swarm instance be treated like a SwarmObject instance?


From: Ken Cline
Subject: Re: Can a Swarm instance be treated like a SwarmObject instance?
Date: Thu, 22 Apr 1999 13:35:41 -0400 (EDT)

On Thu, 22 Apr 1999, William S. Shu wrote:

I presume the `createBegin:' fragment below is from the
SmlSwarm.m.  If so, why are you assigning the pointer
returned from `[super createBegin: aZone]' (that is,
`[Swarm createBegin: aZone]') to a SmlObject pointer?

(As I recall) By default the ivars for ObjC objects will
have a protected access level and hence the compiler is
correct to warn you about trying to access SmlObject ivars
from a SmlSwarm method.

My apologies if I've mis-interpreted what you are trying to
do.

Ken.

> The code and error messages follow:
> 
> The createBegin Method:
> 
> + createBegin: aZone
> {
>   SmlObject *obj;
> 
>   obj = [super createBegin: aZone];
> 
>   // initialise SmlObject to suitable (harmless) defaults
>   obj->birthday = 0;
>   obj->position.x = 0;
> 
> ...
> 
>   return obj;  // return self
> }
> 
> 
> 
> Compilation messages:
> 
> cd c:/u/mosq/proto/
> make -k SmlSwarm.o
> gcc -c -Wno-import -g -O2 -fno-inline  -I/Apps/Swarm-1.3.1/packages/swarm/in
> clude SmlSwarm.m
> SmlSwarm.m: In function `_c_SmlSwarm__createBegin_':
> SmlSwarm.m:317: instance variable `birthday' is declared protected
> SmlSwarm.m:318: instance variable `position' is declared protected
> SmlSwarm.m:319: instance variable `position' is declared protected
> SmlSwarm.m:320: instance variable `clusterList' is declared private
> SmlSwarm.m:321: instance variable `world' is declared protected
> SmlSwarm.m:322: instance variable `valueSpace' is declared protected
> SmlSwarm.m:323: instance variable `modelSwarm' is declared protected
> SmlSwarm.m:324: instance variable `smlColor' is declared protected
> make: *** [SmlSwarm.o] Error 1
> gcc -c -Wno-import -g -O2 -fno-inline  -I/Apps/Swarm-1.3.1/packages/swarm/in
> clude SmlPopSwarm.m
> 
> Compilation exited abnormally with code 2 at Thu Apr 22 16:32:27

_________________________________________________________
Ken Cline                             address@hidden
SAIC                                 VOICE (410) 571-0413
Annapolis, MD                          FAX (301) 261-8427




                  ==================================
   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]