Hello,<br><br>I believe there may be a bug with iteration in the stable branch of Swift. Below is the code I am using (which came from the swift tutorial):<br><br>iterate.swift<br>-----------------<br>type counterfile; <br>
<br>(counterfile t) echo(string m) { <br> app { <br> echo m stdout=@filename(t); <br> } <br>} <br> <br>(counterfile t) countstep(counterfile i) { <br> app { <br> wcl @filename(i) @filename(t); <br> } <br>
} <br> <br>counterfile a[] <simple_mapper;prefix="foldout">; <br> <br>a[0] = echo("793578934574893"); <br> <br>iterate v { <br> a[v+1] = countstep(a[v]); <br> trace("extract int value ",@extractint(a[v+1])); <br>
} until (@extractint(a[v+1]) <= 1); <br>----------------<br><br>wcl<br>---------<br>#!/bin/bash<br>echo -n $(wc -c < $1) > $2<br>---------<br><br>Using the development version of swift the script works correctly, with the following output:<br>
<br>Swift svn swift-r3335 cog-r2752<br><br>RunID: 20100528-1243-6on02joa<br>Progress:<br>SwiftScript trace: extract int value , 16.0<br>SwiftScript trace: extract int value , 2.0<br>SwiftScript trace: extract int value , 1.0<br>
Final status: Finished successfully:4<br><br>However, when I use the stable branch (either using the tar.gz or by downloading from svn) I get:<br><br>Could not start execution.<br> variable a has multiple writers.<br>
<br><br><br>