Newsgroups: comp.lang.dylan
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!news2.near.net!howland.reston.ans.net!ix.netcom.com!netcom.com!netcom4!haahr
From: haahr@netcom.com (Paul Haahr)
Subject: Re: for loop
In-Reply-To: Wolfgang Ziller's message of 25 Mar 1995 04:07:56 GMT
Message-ID: <HAAHR.95Mar26140852@netcom4.netcom.com>
Sender: haahr@netcom4.netcom.com
Organization: NETCOM On-line services
References: <3l04us$9r7@netnews.upenn.edu>
Date: Sun, 26 Mar 1995 13:08:52 GMT
Lines: 23

> From: Wolfgang Ziller <wziller@math.upenn.edu>
> Newsgroups: comp.lang.dylan
> Date: 25 Mar 1995 04:07:56 GMT
> NNTP-Posting-Host: ts8-23.upenn.edu
> 
> Say I have:
> 
> for (a from 0 under 100, b from 0 to 100, c from 0 above 100)
>   array[a] := b + c;
> end for;
> 
> Will the loop iterate 100, 101, or 102 times?  At the end of the
> loop a = b = c = 99, right? (In other words the loop terminates after
> the first terminating condition is met -- 'a' reaches 99).  Am I correct
> about this or what?

My interpretation is 0 times, since c is not above 100 the first time
through the loop.

The general rule is that if any of the loop clauses would cause the loop
to terminate, the loop terminates.

Paul
