[Swift-devel] Feedback loops in swift fails with deeper recursion

Michael Wilde wilde at mcs.anl.gov
Wed Jun 12 11:53:00 CDT 2013


Yadu, I find your example hard to understand.  Can you clean it up to show what you are really trying to do here?

I dont see where cond changes to terminate the recursion.

Presumably its either for creating a test or for learning the language, but as-it its a bit confusing.

It would also help to show the full script.

If Swift's "concurrent" (default) mapper keeps extending the file name, you should map the files involved explicitly to a name that uses a short integer thats passed as an argument.

- Mike


----- Original Message -----
> From: "Yadu Nand" <yadudoc1729 at gmail.com>
> To: "swift-devel" <swift-devel at ci.uchicago.edu>
> Sent: Wednesday, June 12, 2013 11:35:55 AM
> Subject: [Swift-devel] Feedback loops in swift fails with deeper recursion
> 
> 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
> _______________________________________________
> Swift-devel mailing list
> Swift-devel at ci.uchicago.edu
> https://lists.ci.uchicago.edu/cgi-bin/mailman/listinfo/swift-devel
> 



More information about the Swift-devel mailing list