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

Michael Wilde wilde at mcs.anl.gov
Fri Apr 1 10:51:03 CDT 2011



----- Original Message -----
> Try/catch statements don't have a clean intepretation if you're trying
> to follow the flow of data through the program.

I cant comment on this, as its likely a point of programming style that could involve much debate.

On the issue of an exists() function, I feel:

- we should first verify that exists() will solve the NCAR need in a sufficiently clean way

- if so, implement it, because its easy to do

- I do favor an exception handling model in the language, but feel that this is a much more complex PL and systems research project - far more complex just to design not to mention implement than the exists() function.

So even if we would conclude that exceptions and try/catch would be cleaner, we dont have the resources or the driving requirement to do that in any near time frame.

I think it would be a year-long MS-scale project.

- Mike

> 
> 
> On Fri, Apr 1, 2011 at 5:35 AM, Allan Espinosa <
> aespinosa at cs.uchicago.edu > wrote:
> 
> 
> Would it be better to handle it as an exception?
> 
> type file;
> 
> app foo (file x) {
> foo x;
> }
> 
> app (file x) produce_a () {
> }
> 
> file a <"dne">;
> 
> try{
> foo (a);
> }
> catch (dne) {
> a = produce_a();
> foo(a);
> }
> 
> 2011/3/31 < bugzilla-daemon at mcs.anl.gov >:
> 
> 
> 
> > https://bugzilla.mcs.anl.gov/swift/show_bug.cgi?id=291
> >
> > Summary: Add a exists() function to test for file existence
> > Product: Swift
> > Version: 0.93
> > Platform: PC
> > OS/Version: Mac OS
> > Status: NEW
> > Severity: enhancement
> > Priority: P1
> > Component: SwiftScript language
> > AssignedTo: wozniak at mcs.anl.gov
> > ReportedBy: wilde at mcs.anl.gov
> >
> >
> > Requested by John Dennis / NCAR.
> >
> > --
> > Configure bugmail:
> > https://bugzilla.mcs.anl.gov/swift/userprefs.cgi?tab=email
> > ------- You are receiving this mail because: -------
> > You are watching the reporter.
> > _______________________________________________
> > Swift-devel mailing list
> > Swift-devel at ci.uchicago.edu
> > http://mail.ci.uchicago.edu/mailman/listinfo/swift-devel
> >
> >
> 
> 
> 
> --
> Allan M. Espinosa < http://amespinosa.wordpress.com >
> PhD student, Computer Science
> University of Chicago < http://people.cs.uchicago.edu/~aespinosa >
> 
> 
> 
> _______________________________________________
> Swift-devel mailing list
> Swift-devel at ci.uchicago.edu
> http://mail.ci.uchicago.edu/mailman/listinfo/swift-devel
> 
> 
> _______________________________________________
> Swift-devel mailing list
> Swift-devel at ci.uchicago.edu
> http://mail.ci.uchicago.edu/mailman/listinfo/swift-devel

-- 
Michael Wilde
Computation Institute, University of Chicago
Mathematics and Computer Science Division
Argonne National Laboratory




More information about the Swift-devel mailing list