Great, much prettier, thanks!
On Fri, Dec 26, 2008 at 12:26 AM, Alexander Burger <a...@software-lab.de> wrote: > Hi Henrik, > > a merry christmas! > >> Hello everyone, I couldn't find anything already created to this > > Well, there is the 'permute' function in "lib/simul.l". Does it what you > intend? > > (de permute (Lst) > (ifn (cdr Lst) > (cons Lst) > (mapcan > '((X) > (mapcar > '((Y) (cons X Y)) > (permute (delete X Lst)) ) ) > Lst ) ) ) > > Even more cute is the corresponding Pilog rule: > > (be permute ((@X) (@X))) > (be permute (@L (@X . @Y)) > (delete @X @L @D) > (permute @D @Y) ) > > Cheers, > - Alex > -- > UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=unsubscribe > -- UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=unsubscribe