swarm-support
[Top][All Lists]
Advanced

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

Re: Using forEach:


From: Ken Cline
Subject: Re: Using forEach:
Date: Tue, 7 Sep 1999 03:56:58 -0400 (EDT)

On Tue, 7 Sep 1999, Darren Schreiber wrote:
> 
> In the first step of the algorithm I am building, I want to instruct all of
> the agents to do the method findClosest neighbor.  Currently, I am using
> the following:
> 
> for (i=0; i<listLength; i++) {
>     [[availableList atOffset: i] findClosestNeighbor: availableList];
>   }
> 
> I saw this type of construct in an example that Benedikt used.
> 
> [availableList forEach: M(findClosestNeighbor: availableList)];
> 
> But, I am getting a parse error before ).  How can I send the list to the
> group of agents and instruct them to execute the command?

[availableList forEach: M(findClosestNeighbor:) : availableList];



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