@DavidCarlisle Hi David, today I wanted to use your answer http://tex.stackexchange.com/a/109629/1952 and generate a permutation of a list of numbers. Your code works with all individual commands, but as soon as I use a `foreach` for repeating, the results are not all different. `\declarenumlist{mylist}{1}{10}% list from 1 to 10 inclusive.
\foreach \i in {1,...,10}{\pgfmathrandomitem\z{mylist}\z\prunelist{mylist}}` produces 1,3,6,1,8,4,4,9,10,2 (5 and 7 are missing, and 1 and 4 are repetaed) What I'm doing wrong?