[Swift-devel] Swift user guide

Ian Foster foster at uchicago.edu
Mon Mar 2 07:09:38 CST 2009


Ben:

The example I saw in the code had the input array (e.g., "a", in  
"foreach v in a") constructed elsewhere in the program, with a[0] =  
v1, a[1] = v2. That seemed particularly challenging.

Ian.


On Mar 2, 2009, at 1:40 AM, Ben Clifford wrote:

>
> On Sun, 1 Mar 2009, Ian Foster wrote:
>
>> 2) Arrays: I gather from below that the size of an array is defined  
>> by
>> assignments to it. This seems confusing and dangerous to me:  
>> doesn't it
>> require a global analysis, which must ultimately be undecidable, to  
>> determine
>> whether an array is closed?
>
> yes.
>
> They're a very unpleasant structure at the moment. As I've written in
> other mails in more depth, I'd prefer to see them behave as
> single-assignment structures constructued by something like looks  
> similar
> to but slightly different to the present loop constructs, so that  
> you'd
> say:
>
>  array = foreach ....
>
> rather than
>
>  foreach ... {
>     array[i]=...
>  }
>
> There would be no requirement for this to actually execute as some  
> atomic
> operation, and could happen over time interleaved with other tasks, as
> happens for foreach at the moment; but from a code analysis  
> perspective,
> its much clearer when the array is closed - after the single statement
> that assigns to it has fully completed, like non-array variables.
>
> -- 
> _______________________________________________
> Swift-devel mailing list
> Swift-devel at ci.uchicago.edu
> http://mail.ci.uchicago.edu/mailman/listinfo/swift-devel

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/swift-devel/attachments/20090302/50a907e6/attachment.html>


More information about the Swift-devel mailing list