I'm working on a scheme evaluator in scheme. I need to implement let, I have parsed so that I have variable names, values to input and the body of the function. I need to return a lambda function using the parsed information and as such I have the following code:
(define (eval-let exp env)
((lambda (let-variables (let-bindings exp)) (let-body exp)) (let-exp (let-bindings exp))))
(let-variables (let-bindings exp)) evaluates to a list of variable names (ex: '(x y)), so I'm basically evaluating to this:
((lambda '(x y) (* x y)) '(2 3))
The scheme interpreter simple says: #%plain-lambda: not an identifier in: (let-bindings exp) which I'm guessing is because it wants a set of identifiers, not a list of values.
How do I turn my list of values into a set of identifiers?