//Marcus Daniels Sept. 21, 1999 swarm-support list JG> Time 1: Add agent "A" Time 2: Add agent "B" Time 3: Add agent "A" JG> Is the list now: A B A JG> or is it A B ? If it is an ordinary List then it is "A B A". JG> what happens if I "remove A" from the list, JG> will I end up with "B" or "B,A" from that list? Thanks in JG> advance! They are removed from left to right; "B,A". #import #import #import @interface Character: CreateDrop { char value; member_t link; } - setValue: (char)value; - (char)getValue; @end @implementation Character - setValue: (char)theValue { value = theValue; return self; } - (char)getValue { return value; } - (void)describe: outputCharStream { char buf[1 + 1 + 2 + 1]; sprintf (buf, "`%c'\n", value); [outputCharStream catC: buf]; } @end #define MAKECHARACTER(value) \ [[[Character createBegin: globalZone] setValue: value] createEnd] int main (int argc, const char **argv) { initSwarmBatch (argc, argv); { id l; id obj1, obj2; l = [List create: globalZone]; obj1 = MAKECHARACTER ('A'); obj2 = MAKECHARACTER ('B'); [l addLast: obj1]; [l addLast: obj2]; [l addLast: obj1]; [l remove: obj1]; xfprint (l); } } /* Local Variables: compile-command: "$SWARMHOME/bin/libtool-swarm --mode=link gcc -o list -g -Wno-import -I$SWARMHOME/include -L$SWARMHOME/lib list.m -lswarm -lobjc" End: */