|
From: | Paul Johnson |
Subject: | Re: [Swarm-Support] Selectors |
Date: | Wed, 09 Jul 2003 10:28:19 -0500 |
User-agent: | Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20030225 |
No, not equivalent. Mine is better :)Your loop will stop if there is a nil object in your list, while mine is guaranteed to process all objects in a list. The for loop I suggest is the recommended way.
Marcello wrote:
Simplest route sounds good (I thought forEach was faster!) . thanks I take it as your code is equivalent to this: id index=[list begin:[self getZone]] while ((tgt=[index next])) [tgt setPayoff: pay]; [index drop]; Am I right? cheers marcello On Wed, 2003-07-09 at 16:31, Paul Johnson wrote:
-- 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
[Prev in Thread] | Current Thread | [Next in Thread] |