I have two functions, tuples and perm. They are similar.
tuples[L_, 0] := {{}};
tuples[L_, k_] := Join @@ Table[{x}~Join~y, {x, L}, {y, tuples[L, k - 1]}];
perm[L_, 0] := {{}};
perm[L_, k_] := Join @@ Table[{x}~Join~y, {x, L}, {y, perm[Select[L, # != x &], k - 1]}];
(*tuples[{1, 2, 3}, 2]*)
(*{{1, 1}, {1, 2}, {1, 3}, {2, 1}, {2, 2}, {2, 3}, {3, 1}, {3, 2}, {3, 3}}*)
(*perm[{1, 2, 3}, 2]*)
(*{{1, 2}, {1, 3}, {2, 1}, {2, 3}, {3, 1}, {3, 2}}*)
I know tuples can be defined using Nest, but I don't know whether perm can be defined using Nest or Fold.
tuples2[L_, k_] := Nest[Join @@ Table[x~Join~{y}, {x, #}, {y, L}] &, {{}}, k];

permis supposed to do? Is it working correctly or not? And what specifically is your question? – whuber Feb 6 at 3:07permis equivalent toPermutations. It looks like it is a question of how to implement it functionally. – rcollyer Feb 6 at 3:10Permutations. For instance, the present implementation would not reproduce the behavior ofPermutationswith just one argument or with a list as a second argument. I think it's incumbent on the OP to tell us more precisely what he wants, rather than hoping our guesses will be correct. – whuber Feb 6 at 3:24permto produce the same output asPermutationbut in a different order? We don't know because the OP has not specified what the desired behavior is. – whuber Feb 6 at 3:33permis correct and does what the OP wants it to do (regardless of similarity toPermutation), can it be written usingNestorFold?". – rm -rf♦ Feb 6 at 4:49