From ce679bff109588dbceada4d880420aa68ee7bada Mon Sep 17 00:00:00 2001 From: Colin Okay Date: Wed, 15 Jul 2020 11:27:14 -0500 Subject: simplified scramble --- examples.lisp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'examples.lisp') diff --git a/examples.lisp b/examples.lisp index 33ae013..0a40a0c 100644 --- a/examples.lisp +++ b/examples.lisp @@ -131,10 +131,9 @@ vector VEC, one at a time." (defun scramble (n str) (assert (< n (length str))) (let ((str (pad str (* n (ceiling (/ (length str) n)))))) - (concatenate 'string - (apply #'nconc - (mapcar #'collect - (disperse! n (seq str))))))) + (apply #'concatenate 'string + (mapcar #'collect (disperse! n (seq str)))))) + (defun chunk (n str) (assert (zerop (mod (length str) n))) -- cgit v1.2.3