---------- Forwarded Message ----------
Subject: Re: [Unicon-group] every vs while Date: Saturday 09 July 2005 14:25 From: Steve Graham <[EMAIL PROTECTED]> To: [EMAIL PROTECTED] On Saturday 09 July 2005 13:52, Steve Wampler wrote: > On Sat, Jul 09, 2005 at 01:48:12PM -0500, Steve Graham wrote: > > I am having troubles understanding this difference. > > > > In a piece of code I had defined a list which had 2 elements. Then I > > tried to do something like: > > > > while WritePara(get(aList)) > > > > However, it would never pickup the 2nd element. But when I changed it to > > this: > > > > every WritePara(!aList) > > > > It picked up both elements of the list. Now, I guess I understand the > > latter, that every activates the generator (!) and so it works. However, > > I would have supposed that the while construct would continue executing, > > until the stack was empty, > > > > Any comments? > > My guess is that WritePara fails instead of returns. Since get() isn't > a generator, that would terminate the loop. > > HTH, > Steve I forgot to terminate the WritePara with a return before the end. Adding the return did the trick. Thanks. Steve G ------------------------------------------------------- ------------------------------------------------------- This SF.Net email is sponsored by the 'Do More With Dual!' webinar happening July 14 at 8am PDT/11am EDT. We invite you to explore the latest in dual core and dual graphics technology at this free one hour event hosted by HP, AMD, and NVIDIA. To register visit http://www.hp.com/go/dualwebinar _______________________________________________ Unicon-group mailing list Unicon-group@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/unicon-group