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

Ben Clifford benc at hawaga.org.uk
Sat Jun 18 19:15:46 CDT 2011


> Use the size of the array at the time of the append. 

might introduce non-deterministic behaviour when used with restarts when 
the index is used later (for example, to determine a filename) as the 
index is then a race-based random number, I think. That's what I was 
getting at with my comment about how things were done in the past with 
restarts: I think that its possible to make restart-proofed identifiers 
that look something like a combination of the position in the source file 
combined with an index for any containing code that causes the same source 
text to be executed multiple times (eg. each time you have a foreach, 
stick the index onto the end of the identifier; each time you call a 
function, stick the source position of the call onto the end of the 
identifier).


-- 



More information about the Swift-devel mailing list