[LLVMdev] Enhancing TableGen
David Blaikie
dblaikie at gmail.com
Tue Oct 11 14:03:18 PDT 2011
On Tue, Oct 11, 2011 at 1:46 PM, Jakob Stoklund Olesen <stoklund at 2pi.dk>wrote:
>
> On Oct 11, 2011, at 1:33 PM, David A. Greene wrote:
>
> > Jakob Stoklund Olesen <stoklund at 2pi.dk> writes:
> >
> >> How about:
> >
> > foreach x = [...]
> >
> > I could do
> >
> > foreach x in [...]
> >
> > but that requires another keyword. Do we care?
>
> The syntax should be consistent with let expressions, even if the meaning
> is completely different.
>
> That is: "foreach x = […] in { def … }"
>
> >> Another thing that needs clarification is the multiple variable
> >> syntax:
> >>
> >> for x = [1, 2, 3], y = [4, 5, 6] in { … }
> >>
> >> It is not clear if you get a cross product or a 'zip'.
> >
> > Che-Liang proposed a zip and I think I like that.
>
> Yes, we definitely need to do a zip.
>
> I was looking for a syntax that makes it clear what is happening.
I'd assume something like:
for (x, y) = [(1, 4), (2, 5), (3, 6)] in { ... }
Though I don't know a great deal about tablegen syntax. But so long as the
lists are separate it seems it'd always be unclear that it was a zip.
- David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20111011/0ca65bf3/attachment.html>
More information about the llvm-dev
mailing list