Hi !
I am writing a program in scheme, that uses recursion to walk through the list, and stop at certain pointer, when counter reaches a certain number N
(define (functX N lst)
(define counter 1)
(cond
[(empty? lst) empty]
[(negative? N) empty]
[(< (length lst) N) empty]
[(<= counter N) ((set! counter (+ counter 1))(cons (first lst) (functX N (rest lst)))))]
[else empty]))
I don't understand, why the second line from the bottom is giving me trouble: the error I am getting is "procedure application: expected procedure, given: '(1) (no arguments)"