Plaster
New
List
Login
common-lisp
default
Old Sock
2019.01.31 21:50:34
(defun strip-trailing-0s (sequence) "Removes only 0's on the end of a sequence, it will skip 0's in the middle and returns a new sequence" (loop :for x :across (reverse sequence) :for i :downfrom (length sequence) :to 0 :unless (zerop x) :return (subseq sequence 0 i)))
Raw
Annotate
Repaste