How to order my accumulate variable in this case on Racket?
I am coding with Racket for educational reasons. I was given a task in which I should create a function that, without filter, would receive a list as an input and return another list only with the even numbers of the first list. I came up with this recursive definition of an iterative process: (define (add-even lista) (define (iter lista accu) (cond ((null? lista) accu) ((even? (car lista)) (iter (cdr lista) (cons (car lista) accu))) (else (iter (cdr lista) accu)))) (iter lista empty)) It works fine. However, I get the result in a reverse order, e.g.: (add-even '(1 2 3 4 5 6 7)) >> '(6 4 2)