The function applyToAll is suppose to take in a function and a List, then take the car of the list and apply each element to the fuction.
This is what I have worked out so far:
(define applyToAll(lambda (f L)
(cond
((null? L) '())
(#t (cons (L) (applyToAll f(car L))))
)))
I'm not sure what I am doing wrong. A fuction call would look like
(applyToAll (lambda (n) (* n n)) '(1 2 3) )
and it would return
(1 4 9)
Instead it returns: function call: expected a function after the open parenthesis, but received (list 1 2 3)
Any help as to why my code is not working?
Thanks