all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eric Abrahamsen <eric@ericabrahamsen.net>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: Adam Porter <adam@alphapapa.net>, emacs-devel@gnu.org
Subject: Re: Compiler macro for apply-partially
Date: Wed, 25 Aug 2021 11:44:34 -0700	[thread overview]
Message-ID: <87a6l5bbzh.fsf@ericabrahamsen.net> (raw)
In-Reply-To: <jwvlf4p757r.fsf-monnier+emacs@gnu.org> (Stefan Monnier's message of "Wed, 25 Aug 2021 14:27:32 -0400")

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	other threads:[~2021-08-25 18:44 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-24  6:37 Compiler macro for apply-partially Adam Porter
2021-08-24  6:51 ` Adam Porter
2021-08-24  7:22   ` Andreas Schwab
2021-08-24  7:38     ` Adam Porter
2021-08-24 22:32 ` Stefan Monnier
2021-08-25 17:45   ` Eric Abrahamsen
2021-08-25 18:27     ` Stefan Monnier
2021-08-25 18:44       ` Eric Abrahamsen [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87a6l5bbzh.fsf@ericabrahamsen.net \
    --to=eric@ericabrahamsen.net \
    --cc=adam@alphapapa.net \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.