[Swift-devel] [Bug 291] New: Add a exists() function to test for file existence

Ben Clifford benc at hawaga.org.uk
Fri Apr 1 23:36:32 CDT 2011


> Basically as far as I understand: the presence or absence of a 
> particular data file within the inout dataset is to be used to determine 
> whether the code to process that dataset subsection gets invoked or not:

> 
>   if (exists("extra.data")) {
>      DataFile extraInput<"extra.data">;
>      extraResult = analyze(extraInput);
>   }

Somehow this feels to me like you should be able to say something liek:

 DataFile extraInput<"extra.data">; 
 extraResult =? analyze(extraInput);

and have extra.data either kept from before or repopulated.

Or even have the swift runtime see that extraInput exists already and 
always skip the statement to create it, without anything else expressed in 
the code.

-- 




More information about the Swift-devel mailing list