[Swift-devel] Iterate example broken - semantics changed?

Michael Wilde wilde at mcs.anl.gov
Tue Feb 24 16:21:47 CST 2009


The iterate example in the swift tutorial no longer works.
Its at: 
http://www.ci.uchicago.edu/swift/guides/tutorial.php#tutorial.iterate

The problem seems to be the same as the example below: swift wont let 
you set the members of an array both in the declaring scope and in an 
inner nested scope, it seems.

This example:

---

int a[];

a[0] = 0;

iterate v {
   a[v+1] = v+1;
   trace("v=",v); 

} until ();

---

gives:

Could not start execution.
         variable a has multiple writers.




More information about the Swift-devel mailing list