[Swift-devel] hanging problem

Mihael Hategan hategan at mcs.anl.gov
Sun Mar 27 20:13:52 CDT 2011


Let me be clear. I don't think that's your problem. That is simply a
matter of, perhaps, style. I found it unclear. It doesn't say what it
does.

On Sun, 2011-03-27 at 20:10 -0500, Jonathan Monette wrote:
> This makes sense syntactically but I am guessing the internal logic
> does not like this so is this something that Swift shouldn't  do or
> something that Swift should do but is just broken?
> 
> On Sun, Mar 27, 2011 at 8:05 PM, Jonathan Monette
> <jon.monette at gmail.com> wrote:
>         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?
>          
>         
>         
>         
>         On Sun, Mar 27, 2011 at 8:02 PM, Daniel S. Katz
>         <dsk at ci.uchicago.edu> wrote:
>                 Can you suggest how this should be done?
>                 
>                 Dan
>                 
>                 
>                 
>                 On Mar 27, 2011, at 8:00 PM, Mihael Hategan wrote:
>                 
>                 > Well, you seem to be iterating over an array that
>                 you are trying to
>                 > build inside the iteration, and you are not doing a
>                 fold. It's somewhat
>                 > coincidental that it works, probably because stats
>                 is mapped by a static
>                 > mapper and you don't actually use the value ("img").
>                 >
>                 > Though I see what you are trying to do. And it
>                 should either work or
>                 > fail nicely. So I'll see if I can make a simple test
>                 case out of this.
>                 >
>                 > Mihael
>                 >
>                 > On Sun, 2011-03-27 at 19:43 -0500, Jonathan Monette
>                 wrote:
>                 >> stats is an array mapped to several files in a
>                 directory of metadata
>                 >> generated by mFitplane.  I need to pass all these
>                 files and another
>                 >> metadata file to mConcatFit which is the app after
>                 this foreach loop.
>                 >> I need to wait for the foreach loop to be complete
>                 before mConcatFit
>                 >> can run.
>                 >>
>                 >> On Sun, Mar 27, 2011 at 7:41 PM, Mihael Hategan
>                 <hategan at mcs.anl.gov>
>                 >> wrote:
>                 >>        You have:
>                 >>        foreach img, i in stats
>                 >>           {
>                 >>               stats[ i ] = mFitplane
>                 ( diff_imgs[i] );
>                 >>           }
>                 >>
>                 >>
>                 >>        What is it that you are trying to do there?
>                 >>
>                 >>        Mihael
>                 >>
>                 >>
>                 >>        On Sun, 2011-03-27 at 15:54 -0500, Jonathan
>                 Monette wrote:
>                 >>> here is my entire script
>                 >>>
>                 >>> On Sun, Mar 27, 2011 at 3:45 PM, Mihael Hategan
>                 >>        <hategan at mcs.anl.gov>
>                 >>> wrote:
>                 >>>        On Wed, 2011-03-23 at 16:31 -0500, Jonathan
>                 Monette
>                 >>        wrote:
>                 >>>
>                 >>>> How can the array be closed but all of its values
>                 >>        not be?
>                 >>>
>                 >>>
>                 >>>        The array being closed simply means that
>                 its size is
>                 >>        known,
>                 >>>        but not
>                 >>>        necessarily that its elements have all been
>                 >>        computed.
>                 >>>
>                 >>>        I'll look at the log, but I'd also like the
>                 entire
>                 >>        script.
>                 >>>
>                 >>>        Mihael
>                 >>>
>                 >>>
>                 >>>
>                 >>>
>                 >>>
>                 >>> --
>                 >>> 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.
>                 >>> - Albert Einstein
>                 >>>
>                 >>>
>                 >>
>                 >>
>                 >>
>                 >>
>                 >>
>                 >>
>                 >> --
>                 >> 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.
>                 >> - Albert Einstein
>                 >>
>                 >>
>                 >
>                 >
>                 
>                 > _______________________________________________
>                 > Swift-devel mailing list
>                 > Swift-devel at ci.uchicago.edu
>                 >
>                 http://mail.ci.uchicago.edu/mailman/listinfo/swift-devel
>                 
>                 --
>                 Daniel S. Katz
>                 University of Chicago
>                 (773) 834-7186 (voice)
>                 (773) 834-3700 (fax)
>                 d.katz at ieee.org or dsk at ci.uchicago.edu
>                 http://www.ci.uchicago.edu/~dsk/
>                 
>                 
>                 
>         
>         
>         
>         
>         -- 
>         
>         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.
>         - Albert Einstein
>         
>         
>         
> 
> 
> 
> -- 
> 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.
> - Albert Einstein
> 
> 





More information about the Swift-devel mailing list