Manual evaluation using sample arguments can help:
(apply partial partial [+ 1 2 3]) ; 1. ; => (partial partial + 1 2 3) ; 2. ; => (fn [& args] (apply partial + 1 2 (concat [3] args))) ; 3.
We replace the sample arguments in the faux-curry body with 1; then applying apply manually in 2; then applying the first partial manually in 3. (Note that [3] in 3. there will actually be a seq of “remaining arguments” to the external partial in the compiled code.)
The main thing to note is that partial is a function like any other, therefore, in particular, it can be passed as the first partial argument.
source share