2 ms·
But we can easily write a function plus such that (plus) returns (lambda (x y) (+ x y)), (plus 1) returns (lambda (y) (+ 1 y)) and (plus 1 1) just returns 2. A
by kazinator 10y ago
But we can easily write a function plus such that (plus) returns (lambda (x y) (+ x y)), (plus 1) returns (lambda (y) (+ 1 y)) and (plus 1 1) just returns 2.
And we can make a function writing macro to simplify writing such a function.
- lispm 10y agoTrue: but still you have to decide at definition time what kind of function it is. Plus it adds bloat to the function. Ideally the currying would be a task for the compiler/interpreter.
- kazinator 10y agoDefinition time is a big deal in static languages. For us, that could be while the app is running. I want that three arg function inside that running service to curry if called with two args, with no restart. Poof, done.