>> 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?
Sorry, I didn't try that code. But don't you want to loop over the Generator that is returned by structures(s)? Why else would one want the function "structures" to return a Generator? If you want to access a particular species, there should be another function nthStructure: (SetSpecies L, Integer) -> % (which is something like "unrank"). Or why do you need a Generator? I certainly miss something. Ralf ------------------------------------------------------------------------- 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