[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Compiler macro for apply-partially
From: |
Stefan Monnier |
Subject: |
Re: Compiler macro for apply-partially |
Date: |
Wed, 25 Aug 2021 14:27:32 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
> For us slower kids, this explicit approach might look like:
>
> (cl-flet ((curried (arg3)
> (function-to-apply-partially arg1 arg2 arg3)))
> (curried "arg3"))
>
> Either that or just plain `let' a lambda, and then `funcall' it?
I just meant that instead of writing
(apply-partially #'foo arg1 arg2)
you write
(lambda (arg3 &optional arg4 ...)
(foo arg1 arg2 arg3 arg4 ...))
A compiler macro can't easily do it for you because it's between hard
and impossible to automatically guess the (arg3 &optional arg4 ...)
part.
Stefan