CL-USER> (defun combinations (first &rest strings) (if (null strings) (etypecase first (string (list first)) (list first)) (loop for first-choice in (if (listp first) first (list first)) append (loop for comb in (apply #'combinations strings) collect (concatenate 'string first-choice comb))))) COMBINATIONS CL-USER> (combinations "hi" "there") ("hithere") CL-USER> (combinations "hi " '("there" "libertyprime")) ("hi there" "hi libertyprime") CL-USER> (combinations "hi " '("there" "libertyprime") '(" how are you" " how was your day" "")) ("hi there how are you" "hi there how was your day" "hi there" "hi libertyprime how are you" "hi libertyprime how was your day" "hi libertyprime")