I want to build a family of functions, my first attempt was

(setq function-set-1
   (loop for i from 0 to 9 collect
     (lambda (x) (list x i))))

But this don't work properly:

(setf f1-6 (nth 5 function-set-1))

> (funcall f1-6 3)
; => (3 10)  !!! It will must be (3 5)

When I do the same with mapcar:

(setq function-set-2
      (mapcar (lambda (i) (lambda (x) (list x i)))
       '(0 1 2 3 4 5 6 7 8 9)))
 
(setf f2-6 (nth 5 function-set-2))

> (funcall f2-6 3)
; => (3 5)

What's the problem with loop?