Hi Martin

what do you gain by changing

<<implementation: Compose: auxiliary functions>>=
local structures(
     i: I,
     pi: Array List L
): Generator SetSpecies G L == generate {
         i = #pi => empty $ SetSpecies(G L);
         s: SetSpecies L := set pi.i;
         for g in structures(s) $ G(L) repeat {
                 for e in structures(next i, pi) repeat yield cons(g, e);
         }
}
@

into

<<implementation: Compose: auxiliary functions>>=
local structures(
     i: I,
     pi: Array List L
): Generator SetSpecies G L == generate {
         i = #pi => empty $ SetSpecies(G L);
         s: SetSpecies L := set pi.i;
         for g in structures(s) $ G(L) repeat {
                 if next i = #pi
                 then yield cons(g, empty $ SetSpecies(G 
L))$SetSpecies(G L)
                 else for e in structures(next i, pi) repeat yield 
cons(g, e);
         }
}
@

???

As I see it, you just avoid the last recursion at the price of calling 
#pi and next(i) several times and making the code more unreadable.

Do I 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

Reply via email to