<div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">Hi Greg,</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">

Array appends are done using the append operator <<. I'll correct the userguide to </div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">use the right syntax. The following corrected snippet should work for you :</div>

<div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_default"><div class="gmail_default"><font face="arial, helvetica, sans-serif">int[auto] array;</font></div><div class="gmail_default">

<font face="arial, helvetica, sans-serif"><br></font></div><div class="gmail_default"><font face="arial, helvetica, sans-serif">foreach i in [1:100] {</font></div><div class="gmail_default"><font face="arial, helvetica, sans-serif">    array << (i*2);</font></div>

<div class="gmail_default"><font face="arial, helvetica, sans-serif">}</font></div><div style="font-family:arial,helvetica,sans-serif"><br></div><div style="font-family:arial,helvetica,sans-serif">Thanks for reporting the bug. </div>

<div style="font-family:arial,helvetica,sans-serif"><br></div><div style="font-family:arial,helvetica,sans-serif">-Yadu</div></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">

<br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Feb 28, 2014 at 8:10 AM, Wilde, Michael J. <span dir="ltr"><<a href="mailto:wilde@mcs.anl.gov" target="_blank">wilde@mcs.anl.gov</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">



<div style="font-size:14px;font-family:Calibri,sans-serif;word-wrap:break-word">
<div>Greg, thanks for reporting this.</div>
<div><br>
</div>
<div>We can reproduce it and have created a bug ticket:</div>
<div>   <span style="font-family:Consolas;font-size:medium"><a href="https://bugzilla.mcs.anl.gov/swift/show_bug.cgi?id=1207" target="_blank">https://bugzilla.mcs.anl.gov/swift/show_bug.cgi?id=1207</a></span></div>
<div><br>
</div>
<div>It seems that this feature was not in the test suite. Will post when we have a fix.</div>
<div><br>
</div>
<div>- Mike</div>
<div><br>
</div>
<div><br>
</div>
<span>
<div style="border-right:medium none;padding-right:0in;padding-left:0in;padding-top:3pt;text-align:left;font-size:11pt;border-bottom:medium none;font-family:Calibri;border-top:#b5c4df 1pt solid;padding-bottom:0in;border-left:medium none">


<span style="font-weight:bold">From: </span><Bronevetsky>, Greg <<a href="mailto:bronevetsky1@llnl.gov" target="_blank">bronevetsky1@llnl.gov</a>><br>
<span style="font-weight:bold">Date: </span>Thursday, February 27, 2014 6:31 PM<br>
<span style="font-weight:bold">To: </span>Swift User <<a href="mailto:swift-user@ci.uchicago.edu" target="_blank">swift-user@ci.uchicago.edu</a>><br>
<span style="font-weight:bold">Subject: </span>[Swift-user] array append<br>
</div><div><div class="h5">
<div><br>
</div>
<blockquote style="BORDER-LEFT:#b5c4df 5 solid;PADDING:0 0 0 5;MARGIN:0 0 0 5">
<div>


<div lang="EN-US" link="blue" vlink="purple">
<div>
<p class="MsoNormal">I’m trying to use the array append function in Swift 0.94.1, based on Section 2.3 of the user guide (<a href="http://swift-lang.org/guides/release-0.94/userguide/userguide.html" target="_blank">http://swift-lang.org/guides/release-0.94/userguide/userguide.html</a>)<u></u><u></u></p>


<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Given the following program:<u></u><u></u></p>
<p class="MsoNormal" style="margin-left:.5in">int[auto] array;<u></u><u></u></p>
<p class="MsoNormal" style="margin-left:.5in"><u></u> <u></u></p>
<p class="MsoNormal" style="margin-left:.5in">foreach i in [1:100] {<u></u><u></u></p>
<p class="MsoNormal" style="margin-left:.5in">  append(array, i * 2);<u></u><u></u></p>
<p class="MsoNormal" style="margin-left:.5in">}<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">I run swift on it and get this following error:<u></u><u></u></p>
<p class="MsoNormal" style="margin-left:.5in">> swift test.swift<u></u><u></u></p>
<p class="MsoNormal" style="margin-left:.5in">Could not start execution<u></u><u></u></p>
<p class="MsoNormal" style="margin-left:.5in">        Compile error in foreach statement at line 3<u></u><u></u></p>
<p class="MsoNormal" style="margin-left:.5in">        Compile error in procedure invocation at line 4<u></u><u></u></p>
<p class="MsoNormal" style="margin-left:.5in">        Procedure append is not declared.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">How should I be using the append function to avoid this error? Thank you!<span style="font-size:10.5pt;color:#1f497d"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;color:#1f497d">Greg Bronevetsky</span><span style="font-size:12pt;color:rgb(31,73,125);font-family:'Times New Roman',serif"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;color:#1f497d">Lawrence Livermore National Lab</span><span style="color:#1f497d"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;color:#1f497d"><a href="tel:%28925%29%20424-5756" value="+19254245756" target="_blank">(925) 424-5756</a></span><span style="color:#1f497d"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;color:#1f497d"><a href="mailto:bronevetsky@llnl.gov" target="_blank"><span style="color:blue">bronevetsky@llnl.gov</span></a></span><span style="color:#1f497d"><u></u><u></u></span></p>


<p class="MsoNormal"><span style="font-size:10.5pt;color:#1f497d"><a href="http://greg.bronevetsky.com" target="_blank"><span style="color:blue">http://greg.bronevetsky.com</span></a></span><span style="color:#1f497d"><u></u><u></u></span></p>


<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div>
</div>
</blockquote>
</div></div></span>
</div>

<br>_______________________________________________<br>
Swift-user mailing list<br>
<a href="mailto:Swift-user@ci.uchicago.edu">Swift-user@ci.uchicago.edu</a><br>
<a href="https://lists.ci.uchicago.edu/cgi-bin/mailman/listinfo/swift-user" target="_blank">https://lists.ci.uchicago.edu/cgi-bin/mailman/listinfo/swift-user</a><br></blockquote></div><br><br clear="all"><div><br></div>-- <br>

<div dir="ltr">Yadu Nand B<div><br></div></div>
</div>