swarm-support
[Top][All Lists]
Advanced

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

[Swarm-Support] Customize & Protocol problem updating tipsybug from cont


From: Paul Johnson
Subject: [Swarm-Support] Customize & Protocol problem updating tipsybug from contrib
Date: Sun, 16 Mar 2003 19:09:36 -0600
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.1) Gecko/20021003

Hello, Swarmish folk:

My students have been pointing out to me that many of the old standards in Swarm's ftp do not work anymore. SO I'm updating the ones I can fix, and I come across some things I can fix, but don't understand very well.

Can anybody clarify for me?


Consider Barry McMullin's old standby "tipsybugs". You can see his original here (which Alex Lancaster had updated):

ftp://ftp.swarm.org/pub/swarm/apps/objc/contrib/tipsybugs-2.1.tar.gz

And I put the one I "fixed" (hacked?) in here:


ftp://ftp.swarm.org/pub/swarm/apps/objc/contrib/tipsybugs-2.1-Swarm-2.1.141.tar.gz

So, what don't I understand?

1 First the problem is that the file Coord2d.m in tipsybugs is missing a @end at the end of the line.

gcc -c -g -O2 -march=i386 -mcpu=i686 -Wall -Wno-import -Wno-protocol -Werror -D_GNU_SOURCE -DAPPNAME=tipsybugs -DAPPVERSION=2.1 address@hidden -I/usr/include/swarm Coord2d.m /usr/include/swarm/defobj/Customize.h:143: warning: address@hidden' missing in implementation context /usr/include/swarm/defobj/Customize.h:143: warning: incomplete implementation of class `Coord2d'

The compiler used to ignore that, no more, no big problem, just add it. The compiler also points out that Swarm's own Customize.h is missing the @end. Customize.m is missing @end at the end as well. I suspect the Swarm files are missing that for a reason, as is usually the case in Swarm. But I don't see why.


2. After adding @end at the end of Coord2d.m, then I get a problem with protocols:

gcc -c -g -O2 -march=i386 -mcpu=i686 -Wall -Wno-import -Wno-protocol -Werror -D_GNU_SOURCE -DAPPNAME=tipsybugs -DAPPVERSION=2.1 address@hidden -I/usr/include/swarm ModelSwarm.m gcc -c -g -O2 -march=i386 -mcpu=i686 -Wall -Wno-import -Wno-protocol -Werror -D_GNU_SOURCE -DAPPNAME=tipsybugs -DAPPVERSION=2.1 address@hidden -I/usr/include/swarm Tipsybug.m gcc -c -g -O2 -march=i386 -mcpu=i686 -Wall -Wno-import -Wno-protocol -Werror -D_GNU_SOURCE -DAPPNAME=tipsybugs -DAPPVERSION=2.1 address@hidden -I/usr/include/swarm LatticeAgent.m gcc -c -g -O2 -march=i386 -mcpu=i686 -Wall -Wno-import -Wno-protocol -Werror -D_GNU_SOURCE -DAPPNAME=tipsybugs -DAPPVERSION=2.1 address@hidden -I/usr/include/swarm Agent.m gcc -c -g -O2 -march=i386 -mcpu=i686 -Wall -Wno-import -Wno-protocol -Werror -D_GNU_SOURCE -DAPPNAME=tipsybugs -DAPPVERSION=2.1 address@hidden -I/usr/include/swarm Lattice2d.m gcc -c -g -O2 -march=i386 -mcpu=i686 -Wall -Wno-import -Wno-protocol -Werror -D_GNU_SOURCE -DAPPNAME=tipsybugs -DAPPVERSION=2.1 address@hidden -I/usr/include/swarm Coord2d.m
Coord2d.m:284: warning: incomplete implementation of class `Coord2d'
Coord2d.m:284: warning: method definition for `-_I_Using' not found
Coord2d.m:284: warning: class `Coord2d' does not fully implement the `Copy' protocol
make: *** [Coord2d.o] Error 1


This happens because tipsybug's Coord.h file declares a protocol that
adopts the Copy protocol.

//Coord.h
#import <objectbase.h>

#import "NeighborCode.h"

@protocol Coord <Copy>

I've gone into the Swarm source, I see how examples of how macros like USING (and CREATING, and SETTING) are put into the h files and m files have parallel phase macros, PHASE(Using) and such.

If I just act like a trained monkey typing the Bible, then I am able to fix the problem by mimicing the Swarm source code.

In Coord.h, I put in phase using the MACROS just like the Swarm source

CREATING
USING
SETTING

And in Coord2d.m, the implementation file that adopts <Coord>, then I put in

PHASE(Creating)

PHASE(Setting)

PHASE(Using)

That makes the program compile and run, but I do not understand the reason that it works. In particular, I don't understand why it is looking for _I_Using at all, or why it was macro'd to be just USING, etc etc.

I conceptually understand the phases in Swarm, just not how this code implements them.


--
Paul E. Johnson                       email: address@hidden
Dept. of Political Science            http://lark.cc.ku.edu/~pauljohn
University of Kansas                  Office: (785) 864-9086
Lawrence, Kansas 66045                FAX: (785) 864-5700



reply via email to

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