(define (list-with-insertion lst idx val) (if (zero? idx) (cons val lst) (append (take lst idx) (cons val (drop lst idx)))))