emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Compiler macro for apply-partially


From: Eric Abrahamsen
Subject: Re: Compiler macro for apply-partially
Date: Wed, 25 Aug 2021 11:44:34 -0700
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>> 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.

Gotcha, thanks.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]