Oct 23
Inserting separators
A function is required to return a copy of a given list with separators added in between adjacent items, for example:
(SEPARATED-LIST '(1 -1 1 -1 1) 0) => (1 0 -1 0 1 0 -1 0 1)
This solution is incorrect due to a spurious separator at the end:
(DEFUN SEPARATED-LIST (ITEMS SEPARATOR)
(LOOP FOR I IN ITEMS
COLLECT I
COLLECT SEPARATOR))