[Swift-devel] iterate behavior

Ketan Maheshwari ketancmaheshwari at gmail.com
Tue Jul 5 14:04:11 CDT 2011


The first instance 'until' i gets greater than 2 is when it gets 3. With
this regard, I think trace could go ahead and show the value of i but
somehow no other statement should get evaluated in that iteration. This is
justified imho since if one does manual tracing, it would go something like
this:

i=0
i>2? No
---
i=1
i>2? No
---
i=2
i>2? No
---
i=3
i>2? Yes
---

On Tue, Jul 5, 2011 at 1:39 PM, Mihael Hategan <hategan at mcs.anl.gov> wrote:

> I have
>
> iterate i {
>  trace(i);
> } until (i > 2);
>
> I read that "until" as "the iteration body should not be run if i > 2",
> and yet trace goes up to 3. And I'm not sure if that's the right way to
> go.
>
> Discuss...
>
> _______________________________________________
> Swift-devel mailing list
> Swift-devel at ci.uchicago.edu
> https://lists.ci.uchicago.edu/cgi-bin/mailman/listinfo/swift-devel
>



-- 
Ketan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/swift-devel/attachments/20110705/1ad955c2/attachment.html>


More information about the Swift-devel mailing list