[Swift-devel] Associative array in Swift [GSoC]

Justin M Wozniak wozniak at mcs.anl.gov
Sat Jun 18 10:19:23 CDT 2011


On Sat, 18 Jun 2011, Ben Clifford wrote:

>
>> But then we can already have arrays of arrays, so I'm not quite
>> sure what the issue is here.
>
> In a Swift context, I could imagine a syntax:
>
>  a[!] = f(i,j)
>
> where ! means "some appropriate unique index" (I think the restart code
> did/does do that foreach loops to label variables in nested scope in a way
> that could be used here).
>
> So then Yadu's: a[0] = 100; a[0] = 200; example might turn into:
>
>  int a[][]; a[0][!] = 100; a[0][!] = 200;
>
> That parallelises still but doesn't require you to explicitly think about
> the index.

I think this is a nice next step.

-- 
Justin M Wozniak



More information about the Swift-devel mailing list