From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#49316: Add apply-partially's right version Date: Sun, 24 Oct 2021 10:28:14 -0400 Message-ID: References: <2315db79-00cf-b2f0-b5df-93cd53392292@gmail.com> <87czs2faas.fsf@tcd.ie> <834kddlvpg.fsf@gnu.org> <27c5c6c9-32d7-0b9a-b883-4f28167ec25c@gmail.com> <83lf6nj2u9.fsf@gnu.org> <835ytm4o3r.fsf@gnu.org> <87fssq8rhn.fsf@gnus.org> Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2197"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: contovob@tcd.ie, Eli Zaretskii , Stefan Kangas , daanturo@gmail.com, 49316@debbugs.gnu.org To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Oct 24 16:29:29 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1meeV6-0000PW-Iq for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 24 Oct 2021 16:29:28 +0200 Original-Received: from localhost ([::1]:38824 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1meeV5-0006Y2-KU for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 24 Oct 2021 10:29:27 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58080) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1meeUg-00066d-Cf for bug-gnu-emacs@gnu.org; Sun, 24 Oct 2021 10:29:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:57198) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1meeUg-0001KN-4Y for bug-gnu-emacs@gnu.org; Sun, 24 Oct 2021 10:29:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1meeUg-0000T7-1p for bug-gnu-emacs@gnu.org; Sun, 24 Oct 2021 10:29:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 24 Oct 2021 14:29:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49316 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 49316-submit@debbugs.gnu.org id=B49316.16350857071743 (code B ref 49316); Sun, 24 Oct 2021 14:29:02 +0000 Original-Received: (at 49316) by debbugs.gnu.org; 24 Oct 2021 14:28:27 +0000 Original-Received: from localhost ([127.0.0.1]:40505 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1meeU7-0000S3-0r for submit@debbugs.gnu.org; Sun, 24 Oct 2021 10:28:27 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:30308) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1meeU4-0000Rq-IZ for 49316@debbugs.gnu.org; Sun, 24 Oct 2021 10:28:25 -0400 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 1BDA84409BF; Sun, 24 Oct 2021 10:28:19 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id C2E4C440968; Sun, 24 Oct 2021 10:28:17 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1635085697; bh=OO4vhjDNqOXpKhA0bv7QTMQrNEo4IBTbdZWVlXNtkAc=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=GBbrcm5Wd7vSdWTRTNKsLOr5JEHqJLWr5KTvA/6TyiTkuco8WlGt5SGuXFjl/ehwK y5DkjQSsyP99ROV+7oj3VMbuSY8Hg/lsg4J1cB4PvlXdr3r0pfZkIK+Kjw+Ww5GonL vg/ZsBUOIKs0cldwWjPOysBcGcTohA/kuVa3yZ8ikjPCxTmkOc7sxdgW8z3WS7W4J/ Lwa0iFztBpLtg/GfgXBZRP4fsRoLjgjHjCsUdYkYVCzLgWyvQcij9nk+z4OItFZ0ku Mbmdotx8f7GAkzQbbJFkRQteSYdA5RP+T4VSxV4j+HtxoXCa7MOeBpLo/1sSJVXDcj 6j2Q4rgR76q4Q== Original-Received: from pastel (unknown [45.72.241.23]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 338DF12017E; Sun, 24 Oct 2021 10:28:17 -0400 (EDT) In-Reply-To: <87fssq8rhn.fsf@gnus.org> (Lars Ingebrigtsen's message of "Sun, 24 Oct 2021 15:47:00 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:218136 Archived-At: Lars Ingebrigtsen [2021-10-24 15:47:00] wrote: > Eli Zaretskii 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