#!/usr/local/bin/sbcl --script (defun shuffle-list (ls &aux (len2 (1+ (length ls)))) (mapl (lambda (u) (rotatef (first u) (nth (random (decf len2)) u))) ls)) (let ((x (list 1 2 3 4 5))) (print (shuffle-list x))) (let ((x (list "1" "2" "3" "4" "5"))) (print (reduce (lambda (s acc) (list* s "a" acc)) (butlast x) :initial-value (last x) :from-end t)))