[Aldor-l] Generators

Bill Page bill.page at newsynthesis.org
Wed Nov 7 19:00:06 EST 2007


Peter, Martin;

Thank you Peter (for the patch) and Martin (for the example) of
extending the Aldor compiler! This small example makes me think I
might actually have a chance of understanding how some of this
works... I applied the patch and recompiled Aldor, then ran Martin's
example without any problems. Of course some notes about the design of
the patch would still be very much appreciated. :-)

One thing that surprised me a little was that Peter's patch apparently
did not contain any explicit change to the Aldor syntax - that is the
stuff generated by Flex and byacc.  Am I correct that syntactically
this was already allowed by the grammar?  Then the fragment:

+++ abcheck.c   (working copy)
@@ -594,8 +594,38 @@
 }

 local void
-abCheckFor0(AbSyn var)
+abCheckFor0(AbSyn lhs)
...

effectively just provides the required semantics for:

  for <var> in ...

versus

  for <lhs> in ...

where <lhs> was already defined (somewhere) in the grammar? Or is
something more subtle going on here with the parsing?

Regards,
Bill Page.

On 07 Nov 2007 08:28:24 +0100, Martin Rubey <martin.rubey at univie.ac.at> wrote:
> Peter Broadbery <p_broadbery at hotmail.com> writes:
>
> > This patch should (emphasis on that word there) implement 'for (x, y) in
> > ...'.
>
> Wow, that was quick.  Unfortunately, I currently don't have the resources to
> try it, and I'm not skilled enough to read what your patch does.  Do I
> understand correctly:
>
> your patch extends aldor to understand
>
>    for (x,y,...,z) in l
>
> where l is a generator producing crosses with the right number of components?


On 07 Nov 2007 19:47:42 +0100, Martin Rubey <martin.rubey at univie.ac.at> wrote:
> Dear Peter, Francois,
>
> well, I had to try it, and I'm quite amazed.  It's beautiful.
>
> It does not work for dependent crosses, but that's probably too much too ask
> for, as the compiler doesn't like them too much...
>
> Many thanks,
>
> Martin
>
>
> aldor -fx  -lalgebra -laldor ~/aldor-test/crossiterator.as
> ...




More information about the Aldor-l mailing list