This code is written in a functional programming style. Below is how this should work. (permutations ‘(a b c)) --> ((a b c) (a c b) (b a c) (b c a) (c a b) (c b a))