[llvm-commits] [PATCH 01/13] Add For Loop Structures

David A. Greene greened at obbligato.org
Tue Feb 7 11:57:28 PST 2012


Jakob Stoklund Olesen <stoklund at 2pi.dk> writes:

>> Ah.  I'm assuming I should submit the patch as review, not break
>> it up.  Is that right?
>
> Yes. I don't think it makes sense to review a series of commit-sized
> changes. A single patch can be quite large as long as it is doing just
> one thing, see for example Hal's vectorizer.

Ok, makes sense.

>> Ok.  I thought zip was a no-go.  I'm going to wait on it anyway while I
>> work out how various things might work.  It may or may not come back.
>
> Let's discuss the design before you put too much work into it.  The
> example you pasted looked like it would require a laundry list of
> syntax and type system extensions.  I don't want to do that for
> something that probably won't be used much.

Yep.

> Back in October, we discussed something much simpler: "foreach x =
> […], y = […] in …". That's a fairly simple extension to your first
> patch, and it doesn't require you to invent tuple types and generic
> zip operators. I think that would be fine to add.

Yes, I am leaning that way.  Originally I thought zip would be better as
it is more general and can be used anytime one wants a list of tuples.
But I think it will really mainly be used for iteration and I like the
above syntax better than having !zip() all over that obscures the values
being iterated over.

!zip() also has the complexity of potentially being an nary operator and
that would require some work.

So I'll do the foreach extension instead, once I come across a need.  I
have some ideas I want to pass by you and others but I'm still working
out the details.  We can always add zip later.

Thanks!

                         -Dave




More information about the llvm-commits mailing list