Philipp Stephani
writes:
>> I've been looking for a function that would automatically curry its
>> argument, but couldn't find it. Maybe I just missed it?
>>
> apply?
I'm looking for function that would curry arguments, as opposed to a
partial application.
For instance, it would transform a function that takes A B and C as
parameters into a closure like:
(lambda (a)
(lambda (b)
(lambda (c)
(funcall f a b c))))
(Meaningless) example:
(let ((people '(((name . "Bob") (age . 21))
((name . "John") (age . 32))))
(get (curry #'alist-get)))
;; Retrieve all names
(mapcar (funcall get 'name) people)) ;; => ("Bob" "John")
Nico