swarm-support
[Top][All Lists]
Advanced

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

Re: Using collections


From: Roger M. Burkhart
Subject: Re: Using collections
Date: Thu, 23 Jan 1997 12:58:12 -0600

> I started with just:
> 
>        if ( (next_goal = [goalIndex next]) != NULL )
>           [self setGoal: next_goal];

If you want to reset the index to reprocess any new goals that show up,
another option would be to reposition the index to the Start location:

        if ( (next_goal = [goalIndex next]) != NULL ) {
          [self setGoal: next_goal];
        } else {
          [goalIndex setLoc: Start];
        }

Then the next call, as long as no new goals show up, will merely hit the
end and reset for processing again, but as soon as a new goal shows up,
it will set that instead.

I agree with Glen that we need more explanation (if not justification) of
rationale for the library interfaces, but especially I think what will be
useful are examples of typical usage and common idioms.  Resetting an
index to Start for purposes of reprocessing is one of these.  Indexes may
be used to move and position freely anywhere through a collection at any
time, forwards and backwards, at the beginning, end, or anywhere else.

Roger


reply via email to

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