[Swift-user] Question about arrays and ordering of execution

Lorenzo Pesce lpesce at uchicago.edu
Fri Mar 22 14:00:26 CDT 2013


I apologize if I asked this question already or it is obvious, sometimes  I mix all these problems together...

I start with having a number of files associated with a specific Sample, do something with all of them, then merge them and move on to do more things (which also involved splitting them and remerging them). 

My rough swift code for it would be the following.

string [] FILES = readdata.... ;

string {} OUTFILES = <some mapper >; # don't exist yet

for file in FILES {

 (OUTFILE{file}...) do_something (file);
}

(next_file) = do_somethingmore(OUTFILE);


My question is: can I use an array/hash of files as input to a function and will this be sufficient to tell swift to wait till *all* the OUTFILE elements have been run?

If not, which is the next simplest approach (most portable, less prone to fall to pieces, less dependent on filesystems and so on).

Thanks a lot as usual,

Lorenzo


More information about the Swift-user mailing list