Plaster
New
List
Login
common-lisp
default
anonymous
2024.01.25 22:57:10
(defun partition (source n) (let* ((length (length source)) (end (- length (rem length n))) sink) (do ((i 0 (1+ i))) ((= i end)) (if (= (rem i n) 0) (push (subseq source i (+ i n)) sink))) (unless (= end length) (push (subseq source end length) sink)) (nreverse sink)))
Raw
Annotate
Repaste
Edit