swarm-support
[Top][All Lists]
Advanced

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

getLoc/setLoc


From: glen e. p. ropella
Subject: getLoc/setLoc
Date: Thu, 30 Apr 1998 09:19:43 -0600

Hey!

Anybody have a rationalization for why one wouldn't be able to 
do:

   [bobListNdx1 setLoc: [bobListNdx2 getLoc]];

I took a short look at List_GEN.m's setLoc/getLoc and noticed that:

- getLoc
{
  if ( position > 0 ) return Member;
  if ( position < 0 ) return Removed;
  return (id)link;
}
- (void) setLoc: locSymbol
{
  if ( locSymbol == Start ) {
    position = 0;
    link     = (link_t)Start;
  } else if ( locSymbol == End ) {
    position = 0;
    link     = (link_t)End;
  } else {
    raiseEvent( InvalidLocSymbol, nil );
  }
}

In getLoc, we have the symbols: Member and Removed.  But, in
setLoc it looks like the only symbols tolerated are Start and End.
Shouldn't there be a kind of list query in there to find what
location a "Member" is at?  Symbols aren't capable of carrying 
this kind of info, though, are they?  Maybe the getLoc
should be changed to be something like getTypeAtLoc and setLoc
should be removed completely to avoid confusion between LocSymbols
being indices into a collection?  Eh?

glen

Obviously, the short trip is to just use offset.... 
glen e. p. ropella         =>Hail Eris!<=         <address@hidden>
The Swarm Corporation                             (505) 424-0448

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