#!/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 ((lst (list 1 2 3 4 5))) (print (shuffle lst)))