I've been working on this procedure in Scheme (specifically Pretty Big) and I've hit a brick wall. What I'm trying to do is create a procedure that can create other procedures or functions. For the most part I think I'm on the correct track.
(define (function-maker function-specs)
(let* [(specs (map cdr function-specs))
(name (caar specs))
(args (cadr function-specs))
(body (cdr(cdr function-specs)))]
(eval(list 'define name
(list 'lambda args body)))))
Current Output:
Above is the current output and I'll explain to the best of my knowledge what is happening. The input takes in three arguments essentially. A name, to name the function. Arguments for the function and finally the body of the function.
The three arguments are then listed together and then it's supposed to create a new function. The picture above shows the error that I'm reaching. Thanks for the help!