[Swift-devel] Re: [Swift-user] assigning file variables

Ben Clifford benc at hawaga.org.uk
Fri Feb 27 04:02:59 CST 2009


On Thu, 26 Feb 2009, Ben Clifford wrote:

> This style of piecewise assignment to arrays plays merry hell with 
> trying to do data-dependent ordering in a way that I think is not easily 
> resolvable; and anyone trying to do anything at all interesting with 
> arrays gets hit by strange things happening - "I know i've assigned 
> everything but somehow the next stage isn't running".

A different way of looking at this:

Why is it that Swift can have the 'close array returned from a procedure 
call' behaviour which made you move code out of the loop body and into a 
procedure?

Its because from the calling code, the procedure call looks like a single 
assignment:

  file a[] = foo();

or when accessing sub-arrays:

  file a[][];
  a[7] = foo();

We know a[7], which is an entire array, has its entire value because that 
assignment is the only place that a[7] can have its elements assigned - 
there is a single statement which assigns its entire value.

-- 




More information about the Swift-devel mailing list