I'm having some trouble figuring out how to use lambdas that are contained within lists in Scheme. For example, I have the following code:
(define abc '((lambda (x) (* x x))))
I would like to take the first lambda from the list and apply it to some numbers. Here is what I have so far:
(map (car abc) '(1 2 3))
However, I get the following error:
;The object (lambda (x) (* x x)) is not applicable.
But when I try the same thing directly using just the lambda, it works:
(map (lambda (x) (* x x)) '(1 2 3))
;Value 15: (1 4 9)
Can someone help me understand what I am doing wrong?