(defun chunky (strings &optional (chunksize 3)) (format nil "~{~A~%~}" (loop while strings collect (reduce #'(lambda (a b) (concatenate 'string a " " b)) (loop repeat chunksize append (when strings (list (pop strings)))))))) (chunky '("a" "bb" "c" "d" "e" "f" "g" "h")) "a bb c d e f g h "
In reply to Re: Rosetta code: Split an array into chunks
by chb
in thread Rosetta code: Split an array into chunks
by eyepopslikeamosquito
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |