Ralf Hemmecke <[EMAIL PROTECTED]> writes:

> >> I have seen your definitions of Partial and Generator before, but I am not
> >> quite sure whether they are needed.
> > Yes, I need them, since I don't want to create all the 848456353 binary
> > forests
> > at once.
> 
> Actually, that doesn't mean that you have to define Partial or Generator.
> 
> If you look more closely, you use "extend Generator" in axcombat2.as (trunk
> r109), i.e. Generator is already existing. 

Well, yes and no. Generator exists only in libaldor. extending Generator makes
it visible to axiom.

> And you need Partial and partialNext! only, because you want to be able to
> access the structures from "g:=structures(s)" one after the other. The only
> problem is that "for x in g repeat {...}" does not work on Axiom's command
> line.
> 
> But we could define a function in AC of the form
> 
> macro SPECIES == (L: LabelType) -> CombinatorialSpecies L;
> ForEach(L: LabelType, CS: SPECIES): with {
>    forEach: (Generator CS(L), CS(L) -> ()) -> ()
> } == add {
>    forEach(g: Generator CS(L), loopBody: CS(L) -> ()): () == {
>      for x in g repeat loopBody(x);
>    }
> }
> 
> 
> I think that should work nicely in Axiom. Don't you think?

Hmm, you want to loop over a set of species? Did you try this code?


> >> If I remember correctly, you need them in order to generate structures in
> >> Axiom. But all structures of a certain size are finite. Wouldn't it make 
> >> more
> >> sense to provide
> >>
> >> listStructures: SetSpecies L -> List %;
> >>
> >> ?
> > It is not needed. I introduced a function construct: Generator S -> % in
> > ACList
> > that allows one to use [g]$ACList S
> > for a generator g in Axiom, too.
> 
> OK. I think you meant the function "bracket" (which is the Aldor name of
> "construct"). And this function I have provided already in revision 106.

NO. I provide construct. For axiom, bracket is just any name, but construct is
special: [] is syntactic sugar for construct.

I don't see a reason to provide a workaround like forEach if no workaround is
necessary. Hm, I didn't try 

for x in g

yet...

Martin


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Aldor-combinat-devel mailing list
Aldor-combinat-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/aldor-combinat-devel

Reply via email to