From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: contovob@tcd.ie, Eli Zaretskii <eliz@gnu.org>,
Stefan Kangas <stefan@marxist.se>,
daanturo@gmail.com, 49316@debbugs.gnu.org
Subject: bug#49316: Add apply-partially's right version
Date: Sun, 24 Oct 2021 10:28:14 -0400 [thread overview]
Message-ID: <jwvr1cav77w.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <87fssq8rhn.fsf@gnus.org> (Lars Ingebrigtsen's message of "Sun, 24 Oct 2021 15:47:00 +0200")
Lars Ingebrigtsen [2021-10-24 15:47:00] wrote:
> Eli Zaretskii <eliz@gnu.org> writes:
>> As for the rest, I'd like Lars to state his opinion about this new
>> function. AFAICT, he didn't say what he thinks here.
>
> I'm not very enthusiastic -- is partial application used a lot now that
> we've got lexical binding? Partial application has always seemed like
> One Weird Trick to me.
Like Stefan, I don't find partial application weird.
But I'm not sure what's the advantage of
(apply-rpartially #'foo x y)
over
(lambda (a b) (foo a b x y))
It's not necessarily shorter, it's less flexible (the lambda form lets
you pass args in the middle), and it's less efficient (it necessarily
relies on `&rest`, `append/nconc` and `apply`, which imply allocating
lists).
[ And with prettify-symbols-mode the lambda version is even shorter. ]
> On the other hand -- some people are used to programming using these
> idioms, so perhaps it makes sense to add a right version as well?
`apply-partially` was handy before we had `lexical-binding`, but
I wouldn't have added it to Emacs after Emacs-24.
We already have `dash.el` for those users who like this style.
Stefan
next prev parent reply other threads:[~2021-10-24 14:28 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-01 12:40 bug#49316: Add apply-partially's right version daanturo
2021-07-01 13:11 ` Basil L. Contovounesios
2021-07-01 16:24 ` daanturo
2021-07-01 17:06 ` daanturo
2021-07-01 17:16 ` daanturo
2021-07-01 18:45 ` Eli Zaretskii
2021-07-02 2:49 ` daanturo
2021-07-03 7:03 ` Eli Zaretskii
2021-10-24 6:55 ` Stefan Kangas
2021-10-24 10:49 ` daanturo
2021-10-24 11:18 ` Stefan Kangas
2021-10-24 12:13 ` Eli Zaretskii
2021-10-24 13:47 ` Lars Ingebrigtsen
2021-10-24 14:10 ` Stefan Kangas
2021-10-24 14:28 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2021-10-25 12:50 ` Lars Ingebrigtsen
2021-10-24 13:38 ` Lars Ingebrigtsen
2021-07-02 16:32 ` daanturo
2021-07-03 7:03 ` Eli Zaretskii
2021-07-01 22:34 ` Michael Heerdegen
2021-07-02 4:39 ` daanturo
2021-07-03 3:06 ` Michael Heerdegen
2021-07-03 6:17 ` daanturo
2021-07-03 14:13 ` Phil Sainty
2021-07-05 4:29 ` daanturo
2021-07-05 12:02 ` Phil Sainty
2021-07-06 4:33 ` Michael Heerdegen
2021-07-07 16:30 ` daanturo
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=jwvr1cav77w.fsf-monnier+emacs@gnu.org \
--to=bug-gnu-emacs@gnu.org \
--cc=49316@debbugs.gnu.org \
--cc=contovob@tcd.ie \
--cc=daanturo@gmail.com \
--cc=eliz@gnu.org \
--cc=larsi@gnus.org \
--cc=monnier@iro.umontreal.ca \
--cc=stefan@marxist.se \
/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 public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).