I would like to see how it might be possible to emulate the (curry func)
that racket
provides. Here is an example of how I'm manually currying a function:
#lang sicp
; convert to a curried function
(define (add1 x y) (+ x y))
(define add2
(lambda (x)
(lambda (y)
(+ x y))))
(add1 2 3)
; 5
((add2 2) 3)
; 5
Where would I start to add a higher-order function such that it converts a 'normal' function into a curried function, something like this:
(((curry add1) 2) 3)