[Swift-devel] file declaration inside foreach

Mihael Hategan hategan at mcs.anl.gov
Wed Apr 25 09:20:31 CDT 2007



On Wed, 25 Apr 2007, Ben Clifford wrote:

>
>
> On Tue, 24 Apr 2007, Mihael Hategan wrote:
>
> > It's been hacked around for a while now:
>
> > int[] r = [1:2:1];
> > for i in r {
> > }
>
> Do you mean foreach there?

Yes. Should have spelled that out: create an array of integers with the
range construct then iterate over that with the iterator for arrays.

>
> If not, then that doesn't correspond with my view of the history at all -
> the VDL.g grammar lost its production rule for for(;;) in r375, and
> immediately before that it looked like:
>
>    "for" LPAREN e1=assignStat SEMI e2=expression SEMI e3=assignStat RPAREN
>
> which is  for(a;b;c)  syntax.
>
> --
>
>



More information about the Swift-devel mailing list