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

Reply via email to