; insert into list at index
(define insert-at-index
(lambda (k lst obj)
(cond ((or (null? lst)
(< k 0))
lst)
((= k 0)
(cons obj lst))
((> k (length lst))
lst)
(else (set-cdr! (cl:nthcdr (- k 1) lst)
(cons obj (cl:nthcdr k lst)))
lst))))