From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: daanturo Newsgroups: gmane.emacs.bugs Subject: bug#49316: Add apply-partially's right version Date: Thu, 1 Jul 2021 19:40:20 +0700 Message-ID: <2315db79-00cf-b2f0-b5df-93cd53392292@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------2B31632080D50694645E39E6" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="3399"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 To: 49316@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jul 01 14:41:12 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 1lyw0G-0000kM-2C for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 01 Jul 2021 14:41:12 +0200 Original-Received: from localhost ([::1]:59950 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lyw0F-00077B-3j for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 01 Jul 2021 08:41:11 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34590) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lyw07-00076m-77 for bug-gnu-emacs@gnu.org; Thu, 01 Jul 2021 08:41:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:48312) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lyw06-0004sw-Vm for bug-gnu-emacs@gnu.org; Thu, 01 Jul 2021 08:41:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lyw06-0006WM-G6 for bug-gnu-emacs@gnu.org; Thu, 01 Jul 2021 08:41:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: daanturo Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 01 Jul 2021 12:41:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 49316 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.162514323025019 (code B ref -1); Thu, 01 Jul 2021 12:41:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 1 Jul 2021 12:40:30 +0000 Original-Received: from localhost ([127.0.0.1]:59858 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lyvza-0006VT-Cj for submit@debbugs.gnu.org; Thu, 01 Jul 2021 08:40:30 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:47414) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lyvzY-0006VK-RU for submit@debbugs.gnu.org; Thu, 01 Jul 2021 08:40:29 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34236) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lyvzY-0006zH-Jj for bug-gnu-emacs@gnu.org; Thu, 01 Jul 2021 08:40:28 -0400 Original-Received: from mail-pj1-x102a.google.com ([2607:f8b0:4864:20::102a]:39743) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lyvzW-0004VD-P3 for bug-gnu-emacs@gnu.org; Thu, 01 Jul 2021 08:40:28 -0400 Original-Received: by mail-pj1-x102a.google.com with SMTP id in17-20020a17090b4391b0290170ba0ec7fcso6550041pjb.4 for ; Thu, 01 Jul 2021 05:40:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=to:subject:from:message-id:date:user-agent:mime-version :content-language; bh=oPp+ZCoJLNodPoXYNTUAhtv+ToJ0LxCyfSe2Qf2+v1M=; b=WaGUwkMHJRBMhAMNYERToTiAexUIn9QyBL25PcKvo2siLBI+EZdn2zX/YoZj7XQvUX bIkJlWdQaOhKKcTfaxb8tjtzWQCTt0uRExWQ5smxK6nmvFC897j1y8mOnEGJZUqiROhH w2m+1z3h/HcUkSmf98T5t93Ye7wJtQnYXZl8DJyEyubE6y+u99MCdUacaX2KyyG3vanJ 5GmkghNTjOiWZaSj5UYuFT7nkSbXcLGjcebXQltVlYh/+KAEvzJVwOeRXq1LLnei5PUl q3jl81UpjgrnX7umtdux26S7UfaFhXwUce/+R5RfOdg6fj5swOUoU5lCkVl/MAuqCu6Y CzIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:subject:from:message-id:date:user-agent :mime-version:content-language; bh=oPp+ZCoJLNodPoXYNTUAhtv+ToJ0LxCyfSe2Qf2+v1M=; b=uYNvpG3RcHAC5zO5mgBXvP6AdQSDSHLxmK5fbR8ZVWLnn7wMrUPbNBz77Wi9mKyNWH iKOU/ycNGJNEv2Hi2HlqvONb9S0lpdfcJ8xFh0uZrk78geCbOc4uf8g2z9/3jJ9puUzN F/fqMQtphWSG1Q1qq7jKgHpGDDRknJxLXuqLoysMFxd5p+GNg+abWflOPkGO776bLFZI RadwIKgv3bQIeX5gpEBSEjRqNnXhZ7449fTl+M3P6tPx5Xwdo+3uQEHn8YxLjvgijK37 yBulTB+XQ122mBcflcd0vhO9ZxYK+3086tiMso1uByBKfnD6LnCGn2B3TNDkQC0NopKA c2iA== X-Gm-Message-State: AOAM531pOqms7LZNhCp0/iU3NagqhHhD4dz5i/0QmWjTCwKXTcDkxV15 t79kAQJq8JZ6MDkpgfGC7F6BUc7ogGqEGw== X-Google-Smtp-Source: ABdhPJz3QzTp3c3wgHLIWUyEudBIori1C0oVFcyLjPIsP0ZKQxSozR8r5EbWTCp0+F5o2lgzWOq3Sw== X-Received: by 2002:a17:90a:bd04:: with SMTP id y4mr9921137pjr.127.1625143223366; Thu, 01 Jul 2021 05:40:23 -0700 (PDT) Original-Received: from ?IPv6:2402:800:630f:53b:ee3a:5256:1634:1e03? ([2402:800:630f:53b:ee3a:5256:1634:1e03]) by smtp.gmail.com with ESMTPSA id m1sm10362731pjk.35.2021.07.01.05.40.21 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 01 Jul 2021 05:40:22 -0700 (PDT) Content-Language: en-US Received-SPF: pass client-ip=2607:f8b0:4864:20::102a; envelope-from=daanturo@gmail.com; helo=mail-pj1-x102a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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:209268 Archived-At: This is a multi-part message in MIME format. --------------2B31632080D50694645E39E6 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit --=-=-= Content-Type: text/plain Tags: patch Define apply-rpartial. The equivalent function in dash.el is widely used by other packages so it's beneficial to include it by default. In GNU Emacs 28.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.29, cairo version 1.17.4) of 2021-06-25 built on c6 Repository revision: e288348c0a785537d95b7ef2fff0cda729a29677 Repository branch: makepkg Windowing system distributor 'System Description: Arch Linux Configured using: 'configure --prefix=/usr --sysconfdir=/etc --libexecdir=/usr/lib --localstatedir=/var --mandir=/usr/share/man --with-gameuser=:games --with-sound=alsa --with-modules --without-gconf --without-gsettings --with-native-compilation --with-pgtk --with-x-toolkit=gtk3 --without-xaw3d --without-m17n-flt --with-cairo --with-xwidgets --without-compress-install 'CFLAGS=-march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -g -fuse-ld=gold -g -fuse-ld=gold' LDFLAGS=-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now' --=-=-= Content-Type: text/patch Content-Disposition: attachment; filename=0001-Define-apply-rpatially.patch From c594d6fc396b80019c48e63918f8c5e485f2782f Mon Sep 17 00:00:00 2001 From: Daanturo Date: Thu, 1 Jul 2021 19:21:08 +0700 Subject: [PATCH] Define apply-rpatially Which is analogous to `apply-partially` but arguments are aligned on the right instead. --- lisp/subr.el | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lisp/subr.el b/lisp/subr.el index e49c277335..5965655d48 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -465,6 +465,15 @@ was called." (lambda (&rest args2) (apply fun (append args args2)))) +(defun apply-rpartially (fun &rest args) + "Return a function that is a partial application of FUN to ARGS to the right. +ARGS is a list of the last N arguments to pass to FUN. +The result is a new function which does the same as FUN, except +that the last N arguments are fixed at the values with which this +function was called." + (lambda (&rest args1) + (apply fun (append args1 args)))) + (defun zerop (number) "Return t if NUMBER is zero." ;; Used to be in C, but it's pointless since (= 0 n) is faster anyway because -- 2.32.0 --=-=-=-- -- Daanturo. --------------2B31632080D50694645E39E6 Content-Type: text/x-patch; charset=UTF-8; name="0001-Define-apply-rpatially.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="0001-Define-apply-rpatially.patch" >From c594d6fc396b80019c48e63918f8c5e485f2782f Mon Sep 17 00:00:00 2001 From: Daanturo Date: Thu, 1 Jul 2021 19:21:08 +0700 Subject: [PATCH] Define apply-rpatially Which is analogous to `apply-partially` but arguments are aligned on the right instead. --- lisp/subr.el | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lisp/subr.el b/lisp/subr.el index e49c277335..5965655d48 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -465,6 +465,15 @@ was called." (lambda (&rest args2) (apply fun (append args args2)))) +(defun apply-rpartially (fun &rest args) + "Return a function that is a partial application of FUN to ARGS to the right. +ARGS is a list of the last N arguments to pass to FUN. +The result is a new function which does the same as FUN, except +that the last N arguments are fixed at the values with which this +function was called." + (lambda (&rest args1) + (apply fun (append args1 args)))) + (defun zerop (number) "Return t if NUMBER is zero." ;; Used to be in C, but it's pointless since (= 0 n) is faster anyway because -- 2.32.0 --------------2B31632080D50694645E39E6--