[Swift-devel] Feedback loops in swift fails with deeper recursion
Yadu Nand
yadudoc1729 at gmail.com
Wed Jun 12 11:35:55 CDT 2013
The following recursion loop fails at depth >= 50. Swift is generating
intermediate files by appending
a string to the end of each intermediate file (in my case 5 chars). At
depth 50 this exceeds the 255
char limit on file names and swift fails with an -1 error code from
the user application which could
not create the filename swift gave it.
(tested on Swift 0.94 swift-r6414)
// Recursion loop
(file out) reiterate (file input, int cond){
int rval = readData(input);
//tracef("Content passes to reiterate is = %i \n", rval);
if ( check(input, cond) == 1 ){
out = input;
tracef("Reached tail end. Terminating! \n");
}else{
//file temp = process(input);
//out = reiterate(temp, cond);
out = reiterate(process(input), cond);
}
}
Is there a better way to do feedback of results from the app to
itself? Having the app rewrite the input
file with the result is IMHO a hack.
-Yadu
More information about the Swift-devel
mailing list