It's easiest to create a second procedure:
(define (position L N)
(cond ((null? L) L)
((= N 1) (car L))
(else (position (cdr L) (- N 1)))))
(define (position2 L)
(lambda (N)
(position L N)))
then
> (define X (position2 '(1 5 8 2 7)))
> (X 4)
2
In Racket, you can also use curry
:
> (define x (curry position '(1 5 8 2 7)))
> (x 4)
2