swarm-support
[Top][All Lists]
Advanced

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

Iterating through a list


From: Doug Donalson
Subject: Iterating through a list
Date: Tue, 25 Jul 2000 14:33:00 -0700

Suppose I have a list, call it aList.  aList can have members or be empty.
Suppose that aList is empty and I do the following:

    index=[aList create: self];
    while(  (aListMember=[index next]) )
   {
      do some stuff
   }

This should work for an empty list shouldn't it?  (I am assuming it just
terminates the loop before "do some stuff" is attempted.  The reason I ask
is that I am doing something like this and when I create the index it has an
id but when I do an "[index next]" it crashes.  I just want to make sure of
this aspect before I go any farther with debugging.

Thx,

   D4


*********************************************************************
* Dr. Doug Donalson             Office: (805) 893-2962
* Ecology, Evolution,           Home:   (805) 961-4447
* and Marine Biology            email address@hidden
* UC Santa Barbara
* Santa Barbara Ca. 93106
*********************************************************************
*
*   The most exciting phrase to hear in science, the one that
*   heralds new discoveries, is not "EUREKA" (I have found it) but
*   "That's funny ...?"
*
*       Isaac Asimov
*
*********************************************************************




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