schm icon indicating copy to clipboard operation
schm copied to clipboard

Procedures that return procedures as values

Open sol-prog opened this issue 14 years ago • 4 comments

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 ...

sol-prog avatar Nov 25 '11 03:11 sol-prog

How do you think about to develop additional function objects for your class library? Would you like to reuse lambda functions for your software?

elfring avatar Nov 25 '11 10:11 elfring

Initially I've considered using C++11 lambdas for mapping Scheme procedures ...

sol-prog avatar Nov 25 '11 12:11 sol-prog

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?

elfring avatar Nov 25 '11 12:11 elfring

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.

sol-prog avatar Nov 26 '11 05:11 sol-prog