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

Mihael Hategan hategan at mcs.anl.gov
Sat Apr 2 03:33:52 CDT 2011


On Sat, 2011-04-02 at 04:36 +0000, Ben Clifford wrote:
> > 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);

Right. Or if you didn't want to be cryptic:

DataFile optional extraInput<"extra.data">;
...

And I am emphasizing here that the optional attribute should belong to
the data. You probably don't want to have it optional with one
invocation and non optional with another. Given that the successful
completion of a run requires that all invocations complete successfully,
anything else would be silly.





More information about the Swift-devel mailing list