[Swift-devel] Explicit subscript types at declaration

Yadu Nand yadudoc1729 at gmail.com
Thu Jun 30 13:44:14 CDT 2011


Hi,


> This involves saying ,
> int assoc_array[string][int][ ]
> (where empty brackets implicity mean int )

This is hard. It would mean a lot of effort in terms of code from what
I understand. Further more, It also means less flexibility for the user
in terms of the type of subscript.

Is it wrong for the user to say,
array[5] = 10;
array["key"] = 25;

If this is dealt with at the foreach level, by doing type inference of the
index, I think this would be easier. This would mean we would need
to change the type of the index in the template for foreach to say,
_UNDEF_

-- 

Thanks and Regards,
Yadu Nand B



More information about the Swift-devel mailing list