[Swift-devel] Re: restart variable scoping.
Mihael Hategan
hategan at mcs.anl.gov
Thu May 22 16:49:04 CDT 2008
On Thu, 2008-05-22 at 21:42 +0000, Ben Clifford wrote:
> On Thu, 22 May 2008, Mihael Hategan wrote:
>
> > for k in [1:2] {
> > X[k] = echo(k);
> > }
> >
> > for k, v in X {
> > Y[k] = X[k];
> > }
>
> > For the first loop it's fairly clear. k=1 - thread 1-1, k=2 - thread
> > 1-2. But on the second loop this is determined by the order in which the
> > echoes complete. It can very well be that echo(2) completes first, so
>
> in the second loop, you're indexed by v.
Brr. Well, I use "k" and "v" to disambiguate.
>
More information about the Swift-devel
mailing list