[Swift-devel] Associative array in Swift [GSoC]
    Ben Clifford 
    benc at hawaga.org.uk
       
    Sat Jun 18 19:11:22 CDT 2011
    
    
  
> I see no reason* why the addition operator couldn't be overloaded for
> arrays to mean "append".
With the control structures that exist now, you need to specify *some* 
index because you can extract that index (not just the values of the 
array) with foreach index,value in a { ...
}.
I personally find the idea of expression what looks like a mutating 
concatenation but isn't really to be more distasteful. But I agree with 
you on this for the most part:
>  Of course, I'd rather have this whole issue
> implemented as list comprehensions in python/karajan style (a = for v, k
> in b { f(v);}), but I think the changes, both semantic and syntactic to
> swift required to have that would be too dramatic.
-- 
    
    
More information about the Swift-devel
mailing list