Hi all --<div><br></div><div>I am starting work with swift, and am testing out some of the language features. I have copied the following from the user guide</div><div><br></div><div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<i>int[auto] array;<br>foreach i in [1:100] {<br> append(array, i * 2);<br>}<br>foreach v in array {<br> trace(v);<br>}</i></blockquote></div><div><br></div><div>into a file <b>append_test.swift, </b>which is run with the following command:</div>
<div><br></div><div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">/opt/swift-0.94/bin/swift append_test.swift</blockquote>
</div><div><br></div><div>This returns the error:</div><div><br></div><div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<i>Could not start execution<br><span class="Apple-tab-span" style="white-space:pre"> </span>Compile error in foreach statement at line 3<br><span class="Apple-tab-span" style="white-space:pre"> </span>Compile error in procedure invocation at line 4<br>
<span class="Apple-tab-span" style="white-space:pre"> </span>Procedure append is not declared.</i></blockquote></div><div><br></div><div>Is the append feature not implemented in the stable branch? I have a specific application in mind where it would be very useful. Is this perhaps some misconfiguration in my installation?</div>
<div><br></div><div>Please let me know if any additional information is required (system, tc or sites files, etc.). Otherwise, any help would be much appreciated!</div><div><br></div><div>Version details:</div><div><i>Swift 0.94 swift-r6492 cog-r3658 (downloaded binary release)</i></div>
<div><i><br></i></div><div>Log dump:</div><div><br></div><div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<i>2013-05-10 13:49:50,724-0500 DEBUG Loader arguments: [append_test.swift]<br>2013-05-10 13:49:50,725-0500 DEBUG Loader Max heap: 954466304<br>2013-05-10 13:49:50,726-0500 DEBUG textfiles BEGIN SWIFTSCRIPT:<br>int[auto] array;<br>
foreach i in [1:100] {<br> append(array, i * 2);<br>}<br>foreach v in array {<br> trace(v);<br>}<br><br>2013-05-10 13:49:50,726-0500 DEBUG textfiles END SWIFTSCRIPT:<br>2013-05-10 13:49:50,726-0500 INFO Loader append_test.swift: source file is new. Recompiling.<br>
2013-05-10 13:49:51,102-0500 DEBUG Loader Detailed exception:<br>org.griphyn.vdl.karajan.CompilationException: Compile error in foreach statement at line 3<br><span class="Apple-tab-span" style="white-space:pre"> </span>at org.griphyn.vdl.engine.Karajan.foreachStat(Karajan.java:1001)<br>
<span class="Apple-tab-span" style="white-space:pre"> </span>at org.griphyn.vdl.engine.Karajan.statement(Karajan.java:681)<br><span class="Apple-tab-span" style="white-space:pre"> </span>at org.griphyn.vdl.engine.Karajan.statements(Karajan.java:641)<br>
<span class="Apple-tab-span" style="white-space:pre"> </span>at org.griphyn.vdl.engine.Karajan.program(Karajan.java:314)<br><span class="Apple-tab-span" style="white-space:pre"> </span>at org.griphyn.vdl.engine.Karajan.compile(Karajan.java:138)<br>
<span class="Apple-tab-span" style="white-space:pre"> </span>at org.griphyn.vdl.karajan.Loader.compile(Loader.java:350)<br><span class="Apple-tab-span" style="white-space:pre"> </span>at org.griphyn.vdl.karajan.Loader.main(Loader.java:171)<br>
Caused by: org.griphyn.vdl.karajan.CompilationException: Compile error in procedure invocation at line 4<br><span class="Apple-tab-span" style="white-space:pre"> </span>at org.griphyn.vdl.engine.Karajan.call(Karajan.java:886)<br>
<span class="Apple-tab-span" style="white-space:pre"> </span>at org.griphyn.vdl.engine.Karajan.statement(Karajan.java:678)<br><span class="Apple-tab-span" style="white-space:pre"> </span>at org.griphyn.vdl.engine.Karajan.statements(Karajan.java:641)<br>
<span class="Apple-tab-span" style="white-space:pre"> </span>at org.griphyn.vdl.engine.Karajan.foreachStat(Karajan.java:993)<br><span class="Apple-tab-span" style="white-space:pre"> </span>... 6 more<br>Caused by: org.griphyn.vdl.karajan.CompilationException: Procedure append is not declared.<br>
<span class="Apple-tab-span" style="white-space:pre"> </span>at org.griphyn.vdl.engine.Karajan.call(Karajan.java:708)<br><span class="Apple-tab-span" style="white-space:pre"> </span>... 9 more</i></blockquote></div><div><i><br>
</i></div><div><i><br></i></div>-- <br><font color="#999999">Vasily Trubetskoy</font><div><span><font color="#999999">Data Analyst, Cox Lab<br>University of Chicago<br>Chicago, IL 60637</font></span></div>