schm
schm copied to clipboard
Procedures that return procedures as values
Currently the code can't handle correctly procedures that will return other procedures, e.g.
(define compose (lambda ( f g) (lambda (x) (f (g x))))) (( compose + -) 10)
should return -10 ...
How do you think about to develop additional function objects for your class library? Would you like to reuse lambda functions for your software?
Initially I've considered using C++11 lambdas for mapping Scheme procedures ...
The C++11 lambda functions are a programming mean for compile time. Are you looking for a lambda approach which will support the generation and application of anonymous functions also in a dynamical way at run time?
Yes, having a way to create functions at runtime will be great. Currently I simulate this by interpreting the Scheme code each time a function is called.