[Swift-devel] Swift user guide
Ben Clifford
benc at hawaga.org.uk
Mon Mar 2 01:40:56 CST 2009
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.
--
More information about the Swift-devel
mailing list