I am trying to write a function in racket that takes in a list of numbers and outputs a list containing the square of those numbers. I am trying to not use the map implementation and instead solve the problem recursively. However, the code I have now is outputting the same list that was the input. The code I have is as follows:
(define (my-square lst)
(cond (cons? lst)
(append (* (first lst) (first lst)) (my-square (rest lst)))))
I appreciate any help!