[Swift-user] suggestion for program flow control

Ben Clifford benc at hawaga.org.uk
Tue Jul 8 01:59:45 CDT 2008


On Tue, 17 Jun 2008, Ben Clifford wrote:

> > I can definitely see the benefit of having separate pipelines for 
> > non-dependent parts within the same script, but perhaps there is a way 
> > to chain dependent functions that is not dependent on files produced by 
> > previous functions?
> 
> I've been playing with some code to do that as someone else requested it.
> 
> Basically you will be able to have a swiftscript variable that expresses 
> the dependency, but doesn't have any actual content (such as a file).
> 
> Hopefully later this week there will be something in SVN.

Somewhat later than I'd hoped. Swift SVN r2095 has 'extern' types. You can 
use like this: 


(external o) a() {
    app {
        helperA @strcat(@arg("dir"),"/restart-extern.1.out") "/etc/group" 
"qux";
    }
}

b(external o) {
    app {
        helperB @strcat(@arg("dir"),"/restart-extern.2.out") "/etc/group" 
"baz";
    }
}


external sync;

sync=a();
b(sync);

This makes a dependency between a and b, but doesn't actually move any 
data around; its entirely up to you to ensure that when the a procedure 
finishes your data is in the right place for b to find it.

-- 




More information about the Swift-user mailing list