[Swift-devel] Re: folding/sequential-while/whatever and accessing data in files

Ben Clifford benc at hawaga.org.uk
Sun Sep 9 13:42:46 CDT 2007



On Fri, 7 Sep 2007, Mihael Hategan wrote:

> On Fri, 2007-09-07 at 17:12 -0500, Mihael Hategan wrote:
> > On Fri, 2007-09-07 at 22:04 +0000, Ben Clifford wrote:
> > > 'v in a' doesn't get used at all... more complicated
> 
> Maybe this should be approached differently:
> for k in a.keys {}
> for v in a.values {}
> for kv in a.entries {print(kv.key); print(kv.value);}

some shift like that could be nice for what I percieve as a problem with 
this syntax:

 for v,i in a {
  b[i] = f(v);
 }

Its more consistent to write { b[i] = f(a[i]) }

The .keys syntax above would support that.

-- 




More information about the Swift-devel mailing list