Yea. I use the foreach loop because I need to iterate through the diff_imgs array and run an app on each of the entries. The loop runs and completes and all the files in stats are mapped and have data they are just not being closed. So is there a better way of accomplishing what I am doing in Swift? <br>
<br><div class="gmail_quote">On Sun, Mar 27, 2011 at 8:02 PM, Daniel S. Katz <span dir="ltr"><<a href="mailto:dsk@ci.uchicago.edu">dsk@ci.uchicago.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Can you suggest how this should be done?<br>
<br>
Dan<br>
<div><div></div><div class="h5"><br>
<br>
On Mar 27, 2011, at 8:00 PM, Mihael Hategan wrote:<br>
<br>
> Well, you seem to be iterating over an array that you are trying to<br>
> build inside the iteration, and you are not doing a fold. It's somewhat<br>
> coincidental that it works, probably because stats is mapped by a static<br>
> mapper and you don't actually use the value ("img").<br>
><br>
> Though I see what you are trying to do. And it should either work or<br>
> fail nicely. So I'll see if I can make a simple test case out of this.<br>
><br>
> Mihael<br>
><br>
> On Sun, 2011-03-27 at 19:43 -0500, Jonathan Monette wrote:<br>
>> stats is an array mapped to several files in a directory of metadata<br>
>> generated by mFitplane. I need to pass all these files and another<br>
>> metadata file to mConcatFit which is the app after this foreach loop.<br>
>> I need to wait for the foreach loop to be complete before mConcatFit<br>
>> can run.<br>
>><br>
>> On Sun, Mar 27, 2011 at 7:41 PM, Mihael Hategan <<a href="mailto:hategan@mcs.anl.gov">hategan@mcs.anl.gov</a>><br>
>> wrote:<br>
>> You have:<br>
>> foreach img, i in stats<br>
>> {<br>
>> stats[ i ] = mFitplane ( diff_imgs[i] );<br>
>> }<br>
>><br>
>><br>
>> What is it that you are trying to do there?<br>
>><br>
>> Mihael<br>
>><br>
>><br>
>> On Sun, 2011-03-27 at 15:54 -0500, Jonathan Monette wrote:<br>
>>> here is my entire script<br>
>>><br>
>>> On Sun, Mar 27, 2011 at 3:45 PM, Mihael Hategan<br>
>> <<a href="mailto:hategan@mcs.anl.gov">hategan@mcs.anl.gov</a>><br>
>>> wrote:<br>
>>> On Wed, 2011-03-23 at 16:31 -0500, Jonathan Monette<br>
>> wrote:<br>
>>><br>
>>>> How can the array be closed but all of its values<br>
>> not be?<br>
>>><br>
>>><br>
>>> The array being closed simply means that its size is<br>
>> known,<br>
>>> but not<br>
>>> necessarily that its elements have all been<br>
>> computed.<br>
>>><br>
>>> I'll look at the log, but I'd also like the entire<br>
>> script.<br>
>>><br>
>>> Mihael<br>
>>><br>
>>><br>
>>><br>
>>><br>
>>><br>
>>> --<br>
>>> Any intelligent fool can make things bigger and more<br>
>> complex... It<br>
>>> takes a touch of genius - and a lot of courage to move in<br>
>> the opposite<br>
>>> direction.<br>
>>> - Albert Einstein<br>
>>><br>
>>><br>
>><br>
>><br>
>><br>
>><br>
>><br>
>><br>
>> --<br>
>> Any intelligent fool can make things bigger and more complex... It<br>
>> takes a touch of genius - and a lot of courage to move in the opposite<br>
>> direction.<br>
>> - Albert Einstein<br>
>><br>
>><br>
><br>
><br>
</div></div>> _______________________________________________<br>
> Swift-devel mailing list<br>
> <a href="mailto:Swift-devel@ci.uchicago.edu">Swift-devel@ci.uchicago.edu</a><br>
> <a href="http://mail.ci.uchicago.edu/mailman/listinfo/swift-devel" target="_blank">http://mail.ci.uchicago.edu/mailman/listinfo/swift-devel</a><br>
<font color="#888888"><br>
--<br>
Daniel S. Katz<br>
University of Chicago<br>
<a href="tel:%28773%29%20834-7186">(773) 834-7186</a> (voice)<br>
<a href="tel:%28773%29%20834-3700">(773) 834-3700</a> (fax)<br>
<a href="mailto:d.katz@ieee.org">d.katz@ieee.org</a> or <a href="mailto:dsk@ci.uchicago.edu">dsk@ci.uchicago.edu</a><br>
<a href="http://www.ci.uchicago.edu/~dsk/" target="_blank">http://www.ci.uchicago.edu/~dsk/</a><br>
<br>
<br>
<br>
</font></blockquote></div><br><br clear="all"><br>-- <br>Any intelligent fool can make things bigger and more complex... It takes a touch of genius - and a lot of courage to move in the opposite direction.<br>- Albert Einstein<br>
<br><br>