From unknown Sun Jun 22 00:55:41 2025 X-Loop: help-debbugs@gnu.org Subject: bug#49316: Add apply-partially's right version 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-GNU-PR-Keywords: To: 49316@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.162514323025019 (code B ref -1); Thu, 01 Jul 2021 12:41:02 +0000 Received: (at submit) by debbugs.gnu.org; 1 Jul 2021 12:40:30 +0000 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 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 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 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 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) 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) From: daanturo Message-ID: <2315db79-00cf-b2f0-b5df-93cd53392292@gmail.com> Date: Thu, 1 Jul 2021 19:40:20 +0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------2B31632080D50694645E39E6" 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-Spam-Score: -1.3 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) 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-- From unknown Sun Jun 22 00:55:41 2025 X-Loop: help-debbugs@gnu.org Subject: bug#49316: Add apply-partially's right version Resent-From: "Basil L. Contovounesios" Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 01 Jul 2021 13:13: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: To: daanturo Cc: 49316@debbugs.gnu.org Received: via spool by 49316-submit@debbugs.gnu.org id=B49316.162514512628035 (code B ref 49316); Thu, 01 Jul 2021 13:13:02 +0000 Received: (at 49316) by debbugs.gnu.org; 1 Jul 2021 13:12:06 +0000 Received: from localhost ([127.0.0.1]:59923 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lywUA-0007I6-9A for submit@debbugs.gnu.org; Thu, 01 Jul 2021 09:12:06 -0400 Received: from mail-wm1-f42.google.com ([209.85.128.42]:51150) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lywU7-0007HR-Lo for 49316@debbugs.gnu.org; Thu, 01 Jul 2021 09:12:04 -0400 Received: by mail-wm1-f42.google.com with SMTP id o22so4507814wms.0 for <49316@debbugs.gnu.org>; Thu, 01 Jul 2021 06:12:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tcd.ie; s=google21; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=QoP3REFaNpWWg+WOhU3lbhvcvZ/1uCHiHmZXkc1XaUQ=; b=IfeuYobN9dfkCKa0pqRf0LiwvuvgrezaekN82jT1j5TlchQf3fvBqIxVf4WyAQX6ox +vfkjuMlJLj/viYNOX4VRVTsKfQ7B7bsk/kZJITfptwPG0NOcugRYjltyo/pHwOrQHEd 5LG8lk+YivZSbhqIHSkPaiqdoP6bs+qJt52qzfBXfuElKdyKTgsz70YN4CuQjbqweZXt BIWr2I2mB35QIKC/bexAySEZxZRU+RSld0+mcVAEjGvnDEVMqkK+IzgszhTaNOB5x8rw hveDH+7BxR5Y8QYElPrz3HYs2F5a1fPRog56j6H9sMok9/G+bWJQtG4y0f6rSiCiijwB UK3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=QoP3REFaNpWWg+WOhU3lbhvcvZ/1uCHiHmZXkc1XaUQ=; b=LRgxJP4a+oyn/6TNn8rvtTXrqFgpLw5nNGCftcT5l2vIWRgg5rkoO7LfbVQn4ujXSv tMJCwls1iPxRnfGEpnQnJmAjcJDWdhxSOn5pDoaL6AKFbDWzpr5OAnH5ZZIGpZDzkYYu A4vCqN8lQymSu2dSCoL0JvXIhtAg5nEDOMKJ8HqB15M3FekVSkgmc5piRiBLsfa6PZ9E x40a0SsWJAoN40t2qtvwmwluJWpluiDt3GKJSwjAiRonb/v2pQDzL47Xpe8IEkxNs78h /elhQxZ/6vaXjkgdPnvsIsrg31YK4D21Eu3afrygyMWXlcjU11q6K4IQQfdrMDHNNhOb o8dg== X-Gm-Message-State: AOAM531Z+h0Jtv+yKJjYJbye0+6BxCl9XMSawFBzBWosIxuwxpaYcvuF mhWuOMjdoPtavCnc70Cxs/u1tA== X-Google-Smtp-Source: ABdhPJxmpCvwCDm6BKXqOA4RF7WTzb98BzWFI2ULJjuAfB6Lnd3Ab/u45MmuA8zsrvK6BCXs5bSWng== X-Received: by 2002:a7b:c8c1:: with SMTP id f1mr19409753wml.135.1625145117861; Thu, 01 Jul 2021 06:11:57 -0700 (PDT) Received: from localhost ([51.37.48.130]) by smtp.gmail.com with ESMTPSA id p7sm13131177wrr.68.2021.07.01.06.11.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Jul 2021 06:11:57 -0700 (PDT) From: "Basil L. Contovounesios" References: <2315db79-00cf-b2f0-b5df-93cd53392292@gmail.com> Date: Thu, 01 Jul 2021 14:11:55 +0100 In-Reply-To: <2315db79-00cf-b2f0-b5df-93cd53392292@gmail.com> (daanturo's message of "Thu, 1 Jul 2021 19:40:20 +0700") Message-ID: <87czs2faas.fsf@tcd.ie> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) tags 49316 + patch quit > 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 ^^^^^^^^^ rpartially > Which is analogous to `apply-partially` but arguments are aligned on the right > instead. Nit: Missing changelog-style entry (see the guidelines in the file CONTRIBUTE), e.g.: * lisp/subr.el (apply-rpartially): New function. > lisp/subr.el | 9 +++++++++ > 1 file changed, 9 insertions(+) This feature would probably also warrant an announcement in etc/NEWS and a manual entry under (info "(elisp) Calling Functions"). Thanks, -- Basil From unknown Sun Jun 22 00:55:41 2025 X-Loop: help-debbugs@gnu.org Subject: bug#49316: Add apply-partially's right version Resent-From: daanturo Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 01 Jul 2021 16:25:01 +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 To: 49316@debbugs.gnu.org Cc: "Basil L. Contovounesios" Received: via spool by 49316-submit@debbugs.gnu.org id=B49316.162515667226339 (code B ref 49316); Thu, 01 Jul 2021 16:25:01 +0000 Received: (at 49316) by debbugs.gnu.org; 1 Jul 2021 16:24:32 +0000 Received: from localhost ([127.0.0.1]:33586 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lyzUO-0006ql-4r for submit@debbugs.gnu.org; Thu, 01 Jul 2021 12:24:32 -0400 Received: from mail-pj1-f54.google.com ([209.85.216.54]:53189) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lyzUN-0006qW-BF for 49316@debbugs.gnu.org; Thu, 01 Jul 2021 12:24:31 -0400 Received: by mail-pj1-f54.google.com with SMTP id kt19so4582133pjb.2 for <49316@debbugs.gnu.org>; Thu, 01 Jul 2021 09:24:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language; bh=VeeyhrCHyfAAf8BkJM5nAsZxzbEbnrVWz+DabnMAqxk=; b=XGCscEcz+4yqBoUjDzL4HWe3EvFWO4P0mgNa6YtA0SWBWqHt7rZI7PFKe1vm85z87u eqi+RrVn84cyiTA8bJeKmAH0tZbZGtkmyKC8qEIQjErzZa1k3F5M/pZ0UsVqnrlUzjwG NE+IOnOeKqU5qGcudr/LnB99beDoneXXFPywmaQvpvJ4H0IMkrkjS5Dc+/HMV24qyBd8 aRJ7ijj9Vvl5Dv6UxYwzdanbr28+A3E7SsEEhGDq5mbeMBLLDJ9MN5SZGpq/GRJ5+Cug sNdG2HBIKv9Rx2VpjbYDoy3wkvvep+Y5Pfo+VvicbR/QOG0llYfHupG59eUhC+SX3nkX zI7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language; bh=VeeyhrCHyfAAf8BkJM5nAsZxzbEbnrVWz+DabnMAqxk=; b=ChPuAGtY3ZJT/H8FZEhj8tMaH7VN8f86LILxFmmkUgkDiK5iJvVHSTmVFFW+hk3k2J ZH4xMJIkCH5/BCR7Xpj47q/EtkGCgedfGidWRwK3PtVXp7mzeWuACcg/HcQFGVfXqDnX tl++y7MOZh4h2eBQpJ3iGSPgDyL0XWmVYEQ2I1Di3DygeaCh492rTQHbz5DM63U5mm0K r+E/A9MkM3JcaNoV9uZNxudff9POkaXnMYlS2odlClqY1zkRZPeRg81DkKNJk2r1ooVq x+yiu3VgSbIDU9nAAHyJBwOd5I6hbj9f6E4Zh/czfEW4f1pjor2Zw9+41Rvl7A0xtivS O0Fw== X-Gm-Message-State: AOAM532rfONIk/oYRT5tmHVyXzD9Ii6NMMZoJ+VyxeqXqwZ6dTAwCz2R YsWjDYAvJBOZhfcQc+ifeRw= X-Google-Smtp-Source: ABdhPJzlSrbfKfZKd+KQX80orAUfaCYDcQvCZjoLIvIzCGg+xP7TpSj0xC02eQakHBFeNyOoOnSD5Q== X-Received: by 2002:a17:902:d4c6:b029:128:9982:511e with SMTP id o6-20020a170902d4c6b02901289982511emr588527plg.43.1625156665615; Thu, 01 Jul 2021 09:24:25 -0700 (PDT) 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 o184sm352841pga.18.2021.07.01.09.24.24 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 01 Jul 2021 09:24:25 -0700 (PDT) References: <2315db79-00cf-b2f0-b5df-93cd53392292@gmail.com> <87czs2faas.fsf@tcd.ie> From: daanturo Message-ID: Date: Thu, 1 Jul 2021 23:24:22 +0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <87czs2faas.fsf@tcd.ie> Content-Type: multipart/mixed; boundary="------------FB754410FFEC91DC8766C690" Content-Language: en-US X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) This is a multi-part message in MIME format. --------------FB754410FFEC91DC8766C690 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Added documentation in doc/lispref/functions.texi and etc/NEWS. Thank you. On 7/1/21 8:11 PM, Basil L. Contovounesios wrote: > tags 49316 + patch > quit > >> 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 > ^^^^^^^^^ > rpartially > >> Which is analogous to `apply-partially` but arguments are aligned on the right >> instead. > Nit: Missing changelog-style entry (see the guidelines in the file > CONTRIBUTE), e.g.: > > * lisp/subr.el (apply-rpartially): New function. > >> lisp/subr.el | 9 +++++++++ >> 1 file changed, 9 insertions(+) > This feature would probably also warrant an announcement in etc/NEWS and > a manual entry under (info "(elisp) Calling Functions"). > > Thanks, > -- Daanturo. --------------FB754410FFEC91DC8766C690 Content-Type: text/x-patch; charset=UTF-8; name="0002-Add-apply-rpartially-documents.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="0002-Add-apply-rpartially-documents.patch" >From b56a83f2765d3dfb1db011acc561bf107c934594 Mon Sep 17 00:00:00 2001 From: Daanturo Date: Thu, 1 Jul 2021 23:01:42 +0700 Subject: [PATCH 2/2] Add apply-rpartially documents * doc/lispref/functions.texi (Calling Functions): Add explanation and example usage * etc/NEWS (Lisp Changes in Emacs 28.1): Announce new function --- doc/lispref/functions.texi | 17 +++++++++++++++++ etc/NEWS | 5 +++++ 2 files changed, 22 insertions(+) diff --git a/doc/lispref/functions.texi b/doc/lispref/functions.texi index 64883bf0f6..80d0c96687 100644 --- a/doc/lispref/functions.texi +++ b/doc/lispref/functions.texi @@ -845,6 +845,23 @@ built-in function: @end example @end defun +@defun apply-rpartially func &rest args +This function does mostly the same as @code{apply-partially}, but +@var{args} are aligned to the right of @var{func}'s parameters +instead. + +@example +@group +(defalias 'square (apply-rpartially #'expt 2) + "Return argument squared.") +@end group +@group +(square 3) + @result{} 9 +@end group +@end example +@end defun + @cindex functionals It is common for Lisp functions to accept functions as arguments or find them in data structures (especially in hook variables and property diff --git a/etc/NEWS b/etc/NEWS index 605c4d228f..252e6b4d0b 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -2909,6 +2909,11 @@ The former is now declared obsolete. * Lisp Changes in Emacs 28.1 ++++ +** New function 'apply-rpartially'. +Funcionally equivalent to 'apply-partially' but arguments are aligned +to the right instead. + +++ ** New function 'syntax-class-to-char'. This does almost the opposite of 'string-to-syntax' -- it returns the -- 2.32.0 --------------FB754410FFEC91DC8766C690 Content-Type: text/x-patch; charset=UTF-8; name="0001-Define-apply-rpartially.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="0001-Define-apply-rpartially.patch" >From 6af0d300d214c3fcf872641356a6c788b0aed771 Mon Sep 17 00:00:00 2001 From: Daanturo Date: Thu, 1 Jul 2021 22:03:05 +0700 Subject: [PATCH 1/2] Define apply-rpartially * lisp/subr.el (apply-rpartially): New function 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 --------------FB754410FFEC91DC8766C690-- From unknown Sun Jun 22 00:55:41 2025 X-Loop: help-debbugs@gnu.org Subject: bug#49316: Add apply-partially's right version Resent-From: daanturo Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 01 Jul 2021 17:07:01 +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 To: 49316@debbugs.gnu.org Cc: "Basil L. Contovounesios" Received: via spool by 49316-submit@debbugs.gnu.org id=B49316.162515920631414 (code B ref 49316); Thu, 01 Jul 2021 17:07:01 +0000 Received: (at 49316) by debbugs.gnu.org; 1 Jul 2021 17:06:46 +0000 Received: from localhost ([127.0.0.1]:33629 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lz09G-0008Ac-5l for submit@debbugs.gnu.org; Thu, 01 Jul 2021 13:06:46 -0400 Received: from mail-pg1-f169.google.com ([209.85.215.169]:35802) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lz09E-0008AK-RC for 49316@debbugs.gnu.org; Thu, 01 Jul 2021 13:06:45 -0400 Received: by mail-pg1-f169.google.com with SMTP id v7so6709991pgl.2 for <49316@debbugs.gnu.org>; Thu, 01 Jul 2021 10:06:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:from:to:cc:references:message-id:date:user-agent :mime-version:in-reply-to:content-language; bh=l9i+5+1Tick/1PfQO/GANiIHXn+Kd9eLfkJtZTfmmwA=; b=smlBoKcb4vIN8+eKwQfkCIvc0jRYUDEsf9RcO4SP7RqoOS0RuKLLe/E48FDsBja65g FsVmaKw/OIegMySlDRtuVplZkww2338wN/V/I9cwX9X/CIXEVJM80qWnObWo4IXRVyfQ G6vt5jLhghtY0fu8eGr9h+mglrk9c+sXIBOiV/5ZhQXoUsEDWx5BH39z+fW8WSaZK9MZ Zb913tRoeuex3j89l4mxM/8roaKKCuT8mTSoR5Sufw54ywbYYBpIBgQMuA65AaQoqJi1 sr2FQsT7wPgZe6XHp+FTkgGU15OkFxUfpS6SyPawx0MVkK6typp/YM+MHizRm4c7pqc4 91/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:cc:references:message-id:date :user-agent:mime-version:in-reply-to:content-language; bh=l9i+5+1Tick/1PfQO/GANiIHXn+Kd9eLfkJtZTfmmwA=; b=B1UBPOk9jrVnfdzpi26+daCWvFC6Y3jYU6/eh5AZMxs0W+LI0Yr2f8tDzNz3U6nunO ce8PUhWxAeD6NRR/KbXJ6/rEbtiMfmAgMC4QbZVE1NCYuZClEF+0C7a+QCkc2zryhKw2 YrGtcUoadfJpESo+PMOvo4kb40ApoBk3mXrPet/1yHGIfal7PbbHmFJeAVfiDN1N9jVA /D5NIuNzYenzJvcLsVz1hfo/nT2meDDZ9BEHspzwncCH/i3beYP+UCmX8yerqerCDsg1 DAts79zpRiQw3FQ2nYzAWN4TFhbXGrDxStTTuZINoD0r8yo8H2yrqoY+H47hdv6dE69T FS9g== X-Gm-Message-State: AOAM532HJgIlTAeSSNKXQR14c7+bdxw9AE3oeB1VH6EE+avJPLAtspNU bXBH+3FrfiQAvZNHZE5GzEY= X-Google-Smtp-Source: ABdhPJzHKkDhTKmJtKXC0GpSRve4miRUGRE1+ud8LlP21JJ9no5OAmwuMjrps/Ei+H4Q/VohQdvwiQ== X-Received: by 2002:aa7:9252:0:b029:2ae:bde3:621f with SMTP id 18-20020aa792520000b02902aebde3621fmr1007905pfp.18.1625159198873; Thu, 01 Jul 2021 10:06:38 -0700 (PDT) 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 i8sm524911pfo.154.2021.07.01.10.06.36 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 01 Jul 2021 10:06:38 -0700 (PDT) From: daanturo References: <2315db79-00cf-b2f0-b5df-93cd53392292@gmail.com> <87czs2faas.fsf@tcd.ie> Message-ID: Date: Fri, 2 Jul 2021 00:06:35 +0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/mixed; boundary="------------9BFCF884AFB7166958B388F1" Content-Language: en-US X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) This is a multi-part message in MIME format. --------------9BFCF884AFB7166958B388F1 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit --=-=-= Content-Type: text/plain Tags:  49316 + patch Added documentation in doc/lispref/functions.texi and etc/NEWS. (Please ignore my immediately precededing email, I'm sorry for not being used to sending patches by mailing list.) Thank you. --=-=-= Content-Type: text/patch Content-Disposition: attachment; filename=0002-Add-apply-rpartially-documents.patch From b56a83f2765d3dfb1db011acc561bf107c934594 Mon Sep 17 00:00:00 2001 From: Daanturo Date: Thu, 1 Jul 2021 23:01:42 +0700 Subject: [PATCH 2/2] Add apply-rpartially documents * doc/lispref/functions.texi (Calling Functions): Add explanation and example usage * etc/NEWS (Lisp Changes in Emacs 28.1): Announce new function --- doc/lispref/functions.texi | 17 +++++++++++++++++ etc/NEWS | 5 +++++ 2 files changed, 22 insertions(+) diff --git a/doc/lispref/functions.texi b/doc/lispref/functions.texi index 64883bf0f6..80d0c96687 100644 --- a/doc/lispref/functions.texi +++ b/doc/lispref/functions.texi @@ -845,6 +845,23 @@ built-in function: @end example @end defun +@defun apply-rpartially func &rest args +This function does mostly the same as @code{apply-partially}, but +@var{args} are aligned to the right of @var{func}'s parameters +instead. + +@example +@group +(defalias 'square (apply-rpartially #'expt 2) + "Return argument squared.") +@end group +@group +(square 3) + @result{} 9 +@end group +@end example +@end defun + @cindex functionals It is common for Lisp functions to accept functions as arguments or find them in data structures (especially in hook variables and property diff --git a/etc/NEWS b/etc/NEWS index 605c4d228f..252e6b4d0b 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -2909,6 +2909,11 @@ The former is now declared obsolete. * Lisp Changes in Emacs 28.1 ++++ +** New function 'apply-rpartially'. +Funcionally equivalent to 'apply-partially' but arguments are aligned +to the right instead. + +++ ** New function 'syntax-class-to-char'. This does almost the opposite of 'string-to-syntax' -- it returns the -- 2.32.0 --=-=-=-- -- Daanturo. --------------9BFCF884AFB7166958B388F1 Content-Type: text/x-patch; charset=UTF-8; name="0002-Add-apply-rpartially-documents.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="0002-Add-apply-rpartially-documents.patch" >From b56a83f2765d3dfb1db011acc561bf107c934594 Mon Sep 17 00:00:00 2001 From: Daanturo Date: Thu, 1 Jul 2021 23:01:42 +0700 Subject: [PATCH 2/2] Add apply-rpartially documents * doc/lispref/functions.texi (Calling Functions): Add explanation and example usage * etc/NEWS (Lisp Changes in Emacs 28.1): Announce new function --- doc/lispref/functions.texi | 17 +++++++++++++++++ etc/NEWS | 5 +++++ 2 files changed, 22 insertions(+) diff --git a/doc/lispref/functions.texi b/doc/lispref/functions.texi index 64883bf0f6..80d0c96687 100644 --- a/doc/lispref/functions.texi +++ b/doc/lispref/functions.texi @@ -845,6 +845,23 @@ built-in function: @end example @end defun +@defun apply-rpartially func &rest args +This function does mostly the same as @code{apply-partially}, but +@var{args} are aligned to the right of @var{func}'s parameters +instead. + +@example +@group +(defalias 'square (apply-rpartially #'expt 2) + "Return argument squared.") +@end group +@group +(square 3) + @result{} 9 +@end group +@end example +@end defun + @cindex functionals It is common for Lisp functions to accept functions as arguments or find them in data structures (especially in hook variables and property diff --git a/etc/NEWS b/etc/NEWS index 605c4d228f..252e6b4d0b 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -2909,6 +2909,11 @@ The former is now declared obsolete. * Lisp Changes in Emacs 28.1 ++++ +** New function 'apply-rpartially'. +Funcionally equivalent to 'apply-partially' but arguments are aligned +to the right instead. + +++ ** New function 'syntax-class-to-char'. This does almost the opposite of 'string-to-syntax' -- it returns the -- 2.32.0 --------------9BFCF884AFB7166958B388F1-- From unknown Sun Jun 22 00:55:41 2025 X-Loop: help-debbugs@gnu.org Subject: bug#49316: Add apply-partially's right version Resent-From: daanturo Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 01 Jul 2021 17:17: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 To: 49316@debbugs.gnu.org Cc: "Basil L. Contovounesios" Received: via spool by 49316-submit@debbugs.gnu.org id=B49316.162515982132643 (code B ref 49316); Thu, 01 Jul 2021 17:17:02 +0000 Received: (at 49316) by debbugs.gnu.org; 1 Jul 2021 17:17:01 +0000 Received: from localhost ([127.0.0.1]:33638 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lz0JB-0008UK-Jv for submit@debbugs.gnu.org; Thu, 01 Jul 2021 13:17:01 -0400 Received: from mail-pl1-f172.google.com ([209.85.214.172]:33472) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lz0JA-0008U1-DU for 49316@debbugs.gnu.org; Thu, 01 Jul 2021 13:17:00 -0400 Received: by mail-pl1-f172.google.com with SMTP id f11so4062016plg.0 for <49316@debbugs.gnu.org>; Thu, 01 Jul 2021 10:17:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:from:to:cc:references:message-id:date:user-agent :mime-version:in-reply-to:content-language; bh=AXR/Fqsf2wP3tTKugplkJSfRLW1nXmXAnMn9wjSPkSk=; b=ssMpg6o0PLnwFqJXyorxbKuQ2mMoAi6QG2Ky0YcOTuiXTISjWYSKDn4CclBFm8vZ/7 zAbZ1x2Ds10+LgvsybfZwny9CwJsz1ioIyl0FOMX3ei4LLraJVMd3wvwfupHeaBxIguX 0028nYBCHRZyTx/QC6c8d0h7+A2t8ZE/spyBgOkc403S5IxWVRqpF2787gBb+ki0LORs FiZHhzeCDXUiJZa3Mi//QuFEanpnLreLXHJLCKw4zIQbTwOyZRZerJ9xUdkAyc0M8fQI zEzjm3bCuETXECbrmhlmvfmXg0CovUFY3Q/j7tdS83twib/GlFAGsupzNLxZe4362irw XAWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:cc:references:message-id:date :user-agent:mime-version:in-reply-to:content-language; bh=AXR/Fqsf2wP3tTKugplkJSfRLW1nXmXAnMn9wjSPkSk=; b=U+XoAsOi2dvmn4mWKHugjVIj3OZgMRJGj2U9CEazyrS2u3mXyRY3z9hQZTrv1P6VXx uOJ7KpWUszYQBpojGWYk5cRKdzZwfmfJT29/9jfU/L36LG2uMfueOgIUCj3qO+vK2zMH /McJK4DsI77wD+Q0QQWPJQvg6dyOWdaRfD1jdGlJBURRFoyrI3THCg7v9LirgsHquCEn RknH7r4Lf+rGk6RDkmwmb01qTQYgY5/TmeBWq70FEo6BlfX9u0giy2ofDsLddKEPC7OY XTxU3iAgPnVv151o/sBWOeTUKCXuasYKCogAMdwjazkumEt/GzTDBt+XlGTPY1/r/m0M 5Xvg== X-Gm-Message-State: AOAM531tFnSigNdQuQkTfZhVE6ULZYnHZGc7oX0oOLJOUmcSY9xt4dXb jODcYKXqwD18S4Re2hFA22Y= X-Google-Smtp-Source: ABdhPJxEK9lgVQrGAWsMabvP9PDPn5kVSK3i0eH6K+HdkD3dkMN8RZORl76cGX3WQw5yhdfjkm1oYg== X-Received: by 2002:a17:90b:19c5:: with SMTP id nm5mr697549pjb.141.1625159814603; Thu, 01 Jul 2021 10:16:54 -0700 (PDT) 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 y3sm242639pjg.28.2021.07.01.10.16.53 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 01 Jul 2021 10:16:54 -0700 (PDT) From: daanturo References: <2315db79-00cf-b2f0-b5df-93cd53392292@gmail.com> <87czs2faas.fsf@tcd.ie> Message-ID: <1f1bd484-5579-9128-1a3f-1a3b3799a0ef@gmail.com> Date: Fri, 2 Jul 2021 00:16:48 +0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/mixed; boundary="------------B2C3E9DCFE1F17B177516330" Content-Language: en-US X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) This is a multi-part message in MIME format. --------------B2C3E9DCFE1F17B177516330 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit --=-=-= Content-Type: text/plain Tags:  49316 + patch Fix apply-rpartially's typo in etc/NEWS --=-=-= Content-Type: text/patch Content-Disposition: attachment; filename=0001-Fix-apply-rpartially-s-typo-in-etc-NEWS.patch From 002c1025b6aee1d112fe6b918384615b5ec9949c Mon Sep 17 00:00:00 2001 From: Daanturo Date: Fri, 2 Jul 2021 00:11:12 +0700 Subject: [PATCH] Fix apply-rpartially's typo in etc/NEWS * etc/NEWS (Lisp Changes in Emacs 28.1): fix apply-rpartially's typo: Funcionally -> Functionally --- etc/NEWS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etc/NEWS b/etc/NEWS index 252e6b4d0b..be30d6c859 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -2911,7 +2911,7 @@ The former is now declared obsolete. +++ ** New function 'apply-rpartially'. -Funcionally equivalent to 'apply-partially' but arguments are aligned +Functionally equivalent to 'apply-partially' but arguments are aligned to the right instead. +++ -- 2.32.0 --=-=-=-- -- Daanturo. --------------B2C3E9DCFE1F17B177516330 Content-Type: text/x-patch; charset=UTF-8; name="0001-Fix-apply-rpartially-s-typo-in-etc-NEWS.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="0001-Fix-apply-rpartially-s-typo-in-etc-NEWS.patch" >From 002c1025b6aee1d112fe6b918384615b5ec9949c Mon Sep 17 00:00:00 2001 From: Daanturo Date: Fri, 2 Jul 2021 00:11:12 +0700 Subject: [PATCH] Fix apply-rpartially's typo in etc/NEWS * etc/NEWS (Lisp Changes in Emacs 28.1): fix apply-rpartially's typo: Funcionally -> Functionally --- etc/NEWS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etc/NEWS b/etc/NEWS index 252e6b4d0b..be30d6c859 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -2911,7 +2911,7 @@ The former is now declared obsolete. +++ ** New function 'apply-rpartially'. -Funcionally equivalent to 'apply-partially' but arguments are aligned +Functionally equivalent to 'apply-partially' but arguments are aligned to the right instead. +++ -- 2.32.0 --------------B2C3E9DCFE1F17B177516330-- From unknown Sun Jun 22 00:55:41 2025 X-Loop: help-debbugs@gnu.org Subject: bug#49316: Add apply-partially's right version Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 01 Jul 2021 18:46: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 To: daanturo Cc: contovob@tcd.ie, 49316@debbugs.gnu.org Received: via spool by 49316-submit@debbugs.gnu.org id=B49316.16251651289304 (code B ref 49316); Thu, 01 Jul 2021 18:46:02 +0000 Received: (at 49316) by debbugs.gnu.org; 1 Jul 2021 18:45:28 +0000 Received: from localhost ([127.0.0.1]:33697 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lz1gm-0002Q0-6e for submit@debbugs.gnu.org; Thu, 01 Jul 2021 14:45:28 -0400 Received: from eggs.gnu.org ([209.51.188.92]:46850) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lz1gk-0002Pm-KZ for 49316@debbugs.gnu.org; Thu, 01 Jul 2021 14:45:27 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:58286) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lz1ge-0002kF-MI; Thu, 01 Jul 2021 14:45:20 -0400 Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:4512 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lz1ge-00030Q-B6; Thu, 01 Jul 2021 14:45:20 -0400 Date: Thu, 01 Jul 2021 21:45:15 +0300 Message-Id: <834kddlvpg.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: (message from daanturo on Fri, 2 Jul 2021 00:06:35 +0700) References: <2315db79-00cf-b2f0-b5df-93cd53392292@gmail.com> <87czs2faas.fsf@tcd.ie> X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: daanturo > Date: Fri, 2 Jul 2021 00:06:35 +0700 > Cc: "Basil L. Contovounesios" > > (Please ignore my immediately precededing email, I'm sorry for not being > used to sending patches by mailing list.) I see no problems in the preceding email, so I think you have nothing to apologize for. > +@defun apply-rpartially func &rest args > +This function does mostly the same as @code{apply-partially}, but > +@var{args} are aligned to the right of @var{func}'s parameters > +instead. I don't think this explains the purpose of the function clearly enough. The documentation of apply-partially doesn't mention any "alignment", so it's hard to understand what you want to say here. Can you think of a better description? > +@example > +@group > +(defalias 'square (apply-rpartially #'expt 2) > + "Return argument squared.") > +@end group > +@group > +(square 3) > + @result{} 9 > +@end group > +@end example IMO, the example could be more revealing if you could contrast apply-rpartially with apply-partially. > ++++ > +** New function 'apply-rpartially'. > +Funcionally equivalent to 'apply-partially' but arguments are aligned > +to the right instead. After we find a good wording for the manual, we should think how to reword the NEWS entry accordingly. Thanks. From unknown Sun Jun 22 00:55:41 2025 X-Loop: help-debbugs@gnu.org Subject: bug#49316: Add apply-partially's right version Resent-From: Michael Heerdegen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 01 Jul 2021 22:35:01 +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 To: daanturo Cc: 49316@debbugs.gnu.org Received: via spool by 49316-submit@debbugs.gnu.org id=B49316.162517888430147 (code B ref 49316); Thu, 01 Jul 2021 22:35:01 +0000 Received: (at 49316) by debbugs.gnu.org; 1 Jul 2021 22:34:44 +0000 Received: from localhost ([127.0.0.1]:33800 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lz5Ge-0007qB-G1 for submit@debbugs.gnu.org; Thu, 01 Jul 2021 18:34:44 -0400 Received: from mout.web.de ([212.227.15.3]:57117) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lz5Gc-0007px-HG for 49316@debbugs.gnu.org; Thu, 01 Jul 2021 18:34:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=dbaedf251592; t=1625178875; bh=kfhfe10mkcjd0NCQFh5BE/oenN64L+lieZYo5lq9dEg=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To; b=coHBWcfg7gSp1VtLBxs6VQkhGgLjasWgnB28u/p8MWd3qy02+tSIXM1/VkmVAzpSZ F9+LhHPB2z0hwKr/dzemrkQy/mfJmTp/T0Z/oILHj35OZumsmynIsVhY5ZqLm9H4XW luCdLFMfCc1N2R1kZNZU/7a5NaTTiaYH+2Vp2cdY= X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 Received: from drachen.dragon ([178.6.28.156]) by smtp.web.de (mrweb002 [213.165.67.108]) with ESMTPSA (Nemesis) id 0MVcrf-1liIuy31ZP-00Z265; Fri, 02 Jul 2021 00:34:35 +0200 From: Michael Heerdegen References: <2315db79-00cf-b2f0-b5df-93cd53392292@gmail.com> Date: Fri, 02 Jul 2021 00:34:34 +0200 In-Reply-To: <2315db79-00cf-b2f0-b5df-93cd53392292@gmail.com> (daanturo@gmail.com's message of "Thu, 1 Jul 2021 19:40:20 +0700") Message-ID: <87r1ghr7d1.fsf@web.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:+xjCzXpsFYn5/SBzZdChyEgOtckBJYO3uu2gVR3nLuxS+O5fBf4 10YJTz8FsOL3lRAqPIvp9wGy0/0NrIHxDJzV1MLEVaxralZMmaBikV8mhY6UBx0KEeJlpbs tdaoiRxWsHjKsfSkelAv4hAe8P8pi6ZDBR6CZEw+uNmIdveRu/DOVXJNjXIl+KVUtbw7kze h5sXDOKTPh3rr9GuFFfww== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:8jn68T6o85E=:2CRSLOL/IyuRSS4tAVnVJI if8oODRTh1snHaLFTZV25YRZTggpQom+gV27hC6Y5eZBOdi94rEnKBPHmUF8o3/dEEeXg2n/X HPcTB7krGVjynvXxL7SwBKFydXJyEKpjqXhFj93tBn7ykXSig9CyJAfwPtTMrbayQkCGJ3r7Q aAlb/74tAkWkJ5Rx53C64Ym4smUPeJZ0lq3dJDWqYvi8BbBSqYyJ5BZX0iSilWBQ2Ieg6ba+2 LMn8xKSLuGkIgVVO/gfsHGRk/pOBYCeUjZuhUYdXefxI2sIRRFA7CgIs+mt5SUJAlfQ8La2C7 Dwg9B7GD5iDXPkx35Z/lsoaqEE83Ok4XkLInLLoaCwroK69u+VAdPGkbTX0atXABtreOtgJ7h RXSzElhC8ukWqzdOK24PsD9Zfp2VXWSljk7XwON/93PpmtfBrH73ISgQGMzS2ooMPXu2LN29B 5HfoAnl8tWA5aIWnJwW5oxHYpFMZI9KHpj6axd8f8r7prB1PpE9a1yYv3sW0uloUNxnZQIo/n Ekkqd5XYojd8nwAjQBMc2v2DgYqkB8EVUR9dNqQ9n+11fj80rFp3elTS03gN8nZnheMC6fbGN q25NQm+YosPodW7zUvDIYDXtUyw9n+PaM8YT2AS7MAy55RoXqZrqKSWL1B/FcNg9jmsDCru/I H9m2kgqTNrOEcfxLcQn47PNm+3qqvR5PYakemuysGYIweZxe+HOpdsLCkmx+G+TEX3ZhvwN8k cikgUpptpMDUUaCp7iTXcMPF52ggL7zJGamX9wRStSOhi49XwTgfeB+0xJrIu4DAIRKUlJ6Z1 uTiUmk2zvtk+ljP4KxexlM1F4Ptti0YG3eXq0qDWnpuC7uCl/cLN8NG8V/6shrB2Y6Y88h1mt q2r4pzh06o+ABNT/4fL4Z//gIdyxEdEfRk9v/yTs9xkNbAerfqPamrjekZr4apzUHbJvG7MuI gzav4h8oZypzKKUO+SIkuMKU1+rhoakzRrhBO3dDjKSQcHchidf8JnB6JZcf818ZslmLY6c+r a5yPfX4nVUHhuQ1Bamlrdm0O+en7tKsf9n2y/7ES5OmRAFSzYfoWRMu9UvP6EO2iLA7GOeg0F tLXxGHTrH5EFk3BsMQgAwdT+zJFPbV5n/axtLjgK4BDDA6q/ykPS7WU+g== Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) daanturo writes: | +(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. I wonder: If we leave syntax aside for a moment - this suggestion seems to provide a solution for a quite special case: is this useful more often than partial application of arbitrary arguments? Could we instead provide something that allows partial application of arbitrary arguments, e.g. one of the arguments in the middle? Michael. From unknown Sun Jun 22 00:55:41 2025 X-Loop: help-debbugs@gnu.org Subject: bug#49316: Add apply-partially's right version Resent-From: daanturo Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 02 Jul 2021 02:50:01 +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 To: 49316@debbugs.gnu.org Cc: contovob@tcd.ie, Eli Zaretskii Received: via spool by 49316-submit@debbugs.gnu.org id=B49316.162519418221748 (code B ref 49316); Fri, 02 Jul 2021 02:50:01 +0000 Received: (at 49316) by debbugs.gnu.org; 2 Jul 2021 02:49:42 +0000 Received: from localhost ([127.0.0.1]:33898 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lz9FN-0005eg-KS for submit@debbugs.gnu.org; Thu, 01 Jul 2021 22:49:42 -0400 Received: from mail-pj1-f46.google.com ([209.85.216.46]:51185) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lz9FL-0005eM-A0 for 49316@debbugs.gnu.org; Thu, 01 Jul 2021 22:49:39 -0400 Received: by mail-pj1-f46.google.com with SMTP id ie21so3813923pjb.0 for <49316@debbugs.gnu.org>; Thu, 01 Jul 2021 19:49:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language; bh=fuhwwydK1nYOHcOVpG0n7NKRFQFuu7xVC3Mtc6TfQxM=; b=H4psCMHtA+NTzGg2LakxEOAecqsUivsSOcjR4rTyURwVh8CeSJnJXCRA6p+aqQ2wd7 DEhe3vwLLGxg/ja1pAk4YYQ4oyTpDZ4g6xj0AcblLV4h/SCvOaJj89R2obYoRbqaNuVG oaExC7SwQ8qn6mfkJE2i01Dv3Fwark8PoOotkyvqWShHb4+Z8aemykoQZV+AcfyMSb3V PAQP7ZUtaGoDUjoGILsIcbjq5krdiMzzokCAsW3GhHDYGnHX+/J4+d9DPah4NlMPKoaX +NteAtA194xSXwwfFKhT1BbsKaa6qwnXacPi3KlAUqCNdYekqKZF2FxClc/3bdZ8TWor axZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language; bh=fuhwwydK1nYOHcOVpG0n7NKRFQFuu7xVC3Mtc6TfQxM=; b=U16+zwraOTcdsAkn184n983YOGNWv5sewpQdPbUoPeeSzanQHP4ENZbgwHScdVQlWL a1GDv6N8WK0jWA1UDL+lAT6Wt2fYw4amYrQMmapXmhm7Ymd9262QUc5LE/gmCAqpckPW P+pDg8rS5jowf80mPbwuXz3pYSNNhXioUL9fggOnro6DQc/OwA7xLcQCHLRPDziaOyBj P0qhwsyt3GMBLI1yy/TnHqDkPGQeKgX/Mpe028vzx9ROQS5+K0YPKdXBY/WAE202x16Q MoMvXT4Cba1snanzuEdOqzKcV/9KJ8K4KPO/12mMcApulPPl7IYbYCzk+u9bX4jRskt7 DPGg== X-Gm-Message-State: AOAM532BYwUBm4pLBVuK9lOEBZBE8TyedsrZA8xRxvZ8/aKKQByu1xU1 AJV8P26psbxe9ata1AmYjUs= X-Google-Smtp-Source: ABdhPJzJ0TLqBarbN0wJFJVj4moMJ2QEHbOe/jbIGp4LbrwdD4Jr/6l1mwLOntlxcnqQWqZ0f4diYA== X-Received: by 2002:a17:90a:43c3:: with SMTP id r61mr2662769pjg.1.1625194173407; Thu, 01 Jul 2021 19:49:33 -0700 (PDT) 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 c9sm1437759pfb.82.2021.07.01.19.49.31 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 01 Jul 2021 19:49:32 -0700 (PDT) References: <2315db79-00cf-b2f0-b5df-93cd53392292@gmail.com> <87czs2faas.fsf@tcd.ie> <834kddlvpg.fsf@gnu.org> From: daanturo Message-ID: <27c5c6c9-32d7-0b9a-b883-4f28167ec25c@gmail.com> Date: Fri, 2 Jul 2021 09:49:19 +0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <834kddlvpg.fsf@gnu.org> Content-Type: multipart/mixed; boundary="------------BB301AE7B914055C3B749020" Content-Language: en-US X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) This is a multi-part message in MIME format. --------------BB301AE7B914055C3B749020 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit --=-=-= Content-Type: text/plain Tags: patch I have replaced the examples:           (defalias '**2 (apply-rpartially #'expt 2)             "Return argument ** 2.")           (defalias '2** (apply-partially #'expt 2)             "Return 2 ** argument.")           (**2 3)                => 9           (2** 3)                => 8 --=-=-= Content-Type: text/patch Content-Disposition: attachment; filename=0004-Better-apply-rpartially-documentation.patch From ab6977b40a4d2be418716c16bb0d38c35e62b62f Mon Sep 17 00:00:00 2001 From: Daanturo Date: Fri, 2 Jul 2021 09:43:27 +0700 Subject: [PATCH] Better apply-rpartially documentation * doc/lispref/functions.texi (Calling Functions): provide comparison with apply-partially --- doc/lispref/functions.texi | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/doc/lispref/functions.texi b/doc/lispref/functions.texi index 80d0c96687..9e08affd1e 100644 --- a/doc/lispref/functions.texi +++ b/doc/lispref/functions.texi @@ -847,17 +847,21 @@ built-in function: @defun apply-rpartially func &rest args This function does mostly the same as @code{apply-partially}, but -@var{args} are aligned to the right of @var{func}'s parameters -instead. +@var{args} are the last arguments to be passed to @var{func}'s +parameters instead. @example @group -(defalias 'square (apply-rpartially #'expt 2) - "Return argument squared.") +(defalias '**2 (apply-rpartially #'expt 2) + "Return argument ** 2.") +(defalias '2** (apply-partially #'expt 2) + "Return 2 ** argument.") @end group @group -(square 3) +(**2 3) @result{} 9 +(2** 3) + @result{} 8 @end group @end example @end defun -- 2.32.0 --=-=-=-- On 7/2/21 1:45 AM, Eli Zaretskii wrote: >> From: daanturo >> Date: Fri, 2 Jul 2021 00:06:35 +0700 >> Cc: "Basil L. Contovounesios" >> >> (Please ignore my immediately precededing email, I'm sorry for not being >> used to sending patches by mailing list.) > I see no problems in the preceding email, so I think you have nothing > to apologize for. > >> +@defun apply-rpartially func &rest args >> +This function does mostly the same as @code{apply-partially}, but >> +@var{args} are aligned to the right of @var{func}'s parameters >> +instead. > I don't think this explains the purpose of the function clearly > enough. The documentation of apply-partially doesn't mention any > "alignment", so it's hard to understand what you want to say here. > Can you think of a better description? > >> +@example >> +@group >> +(defalias 'square (apply-rpartially #'expt 2) >> + "Return argument squared.") >> +@end group >> +@group >> +(square 3) >> + @result{} 9 >> +@end group >> +@end example > IMO, the example could be more revealing if you could contrast > apply-rpartially with apply-partially. > >> ++++ >> +** New function 'apply-rpartially'. >> +Funcionally equivalent to 'apply-partially' but arguments are aligned >> +to the right instead. > After we find a good wording for the manual, we should think how to > reword the NEWS entry accordingly. > > Thanks. -- Daanturo. --------------BB301AE7B914055C3B749020 Content-Type: text/x-patch; charset=UTF-8; name="0004-Better-apply-rpartially-documentation.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="0004-Better-apply-rpartially-documentation.patch" >From ab6977b40a4d2be418716c16bb0d38c35e62b62f Mon Sep 17 00:00:00 2001 From: Daanturo Date: Fri, 2 Jul 2021 09:43:27 +0700 Subject: [PATCH] Better apply-rpartially documentation * doc/lispref/functions.texi (Calling Functions): provide comparison with apply-partially --- doc/lispref/functions.texi | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/doc/lispref/functions.texi b/doc/lispref/functions.texi index 80d0c96687..9e08affd1e 100644 --- a/doc/lispref/functions.texi +++ b/doc/lispref/functions.texi @@ -847,17 +847,21 @@ built-in function: @defun apply-rpartially func &rest args This function does mostly the same as @code{apply-partially}, but -@var{args} are aligned to the right of @var{func}'s parameters -instead. +@var{args} are the last arguments to be passed to @var{func}'s +parameters instead. @example @group -(defalias 'square (apply-rpartially #'expt 2) - "Return argument squared.") +(defalias '**2 (apply-rpartially #'expt 2) + "Return argument ** 2.") +(defalias '2** (apply-partially #'expt 2) + "Return 2 ** argument.") @end group @group -(square 3) +(**2 3) @result{} 9 +(2** 3) + @result{} 8 @end group @end example @end defun -- 2.32.0 --------------BB301AE7B914055C3B749020-- From unknown Sun Jun 22 00:55:41 2025 X-Loop: help-debbugs@gnu.org Subject: bug#49316: Add apply-partially's right version Resent-From: daanturo Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 02 Jul 2021 04:40: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 To: 49316@debbugs.gnu.org Cc: Michael Heerdegen Received: via spool by 49316-submit@debbugs.gnu.org id=B49316.162520075431308 (code B ref 49316); Fri, 02 Jul 2021 04:40:02 +0000 Received: (at 49316) by debbugs.gnu.org; 2 Jul 2021 04:39:14 +0000 Received: from localhost ([127.0.0.1]:33935 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lzAxO-00088u-4T for submit@debbugs.gnu.org; Fri, 02 Jul 2021 00:39:14 -0400 Received: from mail-pl1-f172.google.com ([209.85.214.172]:43741) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lzAxL-00088g-Uy for 49316@debbugs.gnu.org; Fri, 02 Jul 2021 00:39:13 -0400 Received: by mail-pl1-f172.google.com with SMTP id i13so4908969plb.10 for <49316@debbugs.gnu.org>; Thu, 01 Jul 2021 21:39:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language; bh=ZGd8Ci5HdaW6v/TMxm7h6uSvzP4EAwplyTjBox/fuNo=; b=PoUpX0xwbUBnNfo7XU9gfHEq11NDSaXI3t7Ztp+oHN9VPMG+K1UEr/EkIq27M9tdfn GdEt0JW6XNnN8UrjguklRvFMX/9Td2t07xtAWCzDSE4wg0HE8yzTiYQmadUOBPUg8AWi gwL7Yl4weiEgNYL6uAuPzDf3KyaYRFy3yhfoHcmkl3GtgiDEZfnSMPPZb+bYu4v/Oz0Y MxQhPkdiQoTV14we8MOmhU7abv3qEmOcX2jdVdU4AjbGBAdWRZvjPFitWWTmb4mcwQwM Vcl8R/6vOfeNRCLOfe9DrY5l89G3yt58U80j9/QD1bo7OfQTd5e5q4/P20S3mj4A+vEd 9acw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language; bh=ZGd8Ci5HdaW6v/TMxm7h6uSvzP4EAwplyTjBox/fuNo=; b=ekZwUoXmwH0HTxamjmfC9P37yIg0bL4Xvc4f3220+ZKAA3MRLurdLv13bQeAySEONP px80+7jKMxRrI9JDViSbZRkzg+JbZnjq4nP0ZITLyNa3wervo3ByaTNz5xCIJ/p4Zb9Z 5EbBLp85g+SZhiR/7QahFdA2TgZaqmAhL/xb/X8K8uitHuOE9+8vg/+wOZCP2PVbdcUh TYcp991grS2kuCwISXWd/bsGeUNO7pc1GRhhrgCscZ7cFoV8pZZZVQBpAMJWQngjfMuA IbXRtjJS7/f5S02bdPkOh9+MlYFNWb9JwsKLpdeIA2rJa9ntYT0jMxsuwDbmJMwiAESy /LWg== X-Gm-Message-State: AOAM531m3S56Ct6zCXW9ZAMt971IzOlvUfGD1tVP6dpjkRg+buFgWnNZ ObcpARv0JUSbFDMuPo5d0Nw= X-Google-Smtp-Source: ABdhPJxAbf45kMV9QB+xry0IRCE640+zQlPTKZmO5lYfbqvM+lEFIpoukm2VdWB6IjIXaxa0ZhzLag== X-Received: by 2002:a17:90b:4ac8:: with SMTP id mh8mr3075811pjb.84.1625200746093; Thu, 01 Jul 2021 21:39:06 -0700 (PDT) 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 d127sm1668960pfc.50.2021.07.01.21.39.04 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 01 Jul 2021 21:39:05 -0700 (PDT) References: <2315db79-00cf-b2f0-b5df-93cd53392292@gmail.com> <87r1ghr7d1.fsf@web.de> From: daanturo Message-ID: <5a08f089-3a19-d747-5098-4751c92a5b79@gmail.com> Date: Fri, 2 Jul 2021 11:39:03 +0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <87r1ghr7d1.fsf@web.de> Content-Type: multipart/mixed; boundary="------------88E6D1A450B33722F674C365" Content-Language: en-US X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) This is a multi-part message in MIME format. --------------88E6D1A450B33722F674C365 Content-Type: multipart/alternative; boundary="------------10EC503E83421FDEA3A2A9BB" --------------10EC503E83421FDEA3A2A9BB Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit --=-=-= Content-Type: text/plain Tags: patch > Could we instead > provide something that allows partial application of arbitrary > arguments, e.g. one of the arguments in the middle? I have tried implementing, but it's really hard to provide a practical example for documenting. Also, most of the time after specifying a position, we would insert to left of that. If 0 is for regular `apply-partially`, then -1 is certainly not possible for `apply-rpartially`. To pass ARGS at the last, should the following condition be OK?: "If POSITION is not an integer or is >= the length of the function application's arguments in the future." (funcall (apply-mid-partially #'append 0 '(0 1 2 3)) '(4) '(5)) ; Equivalent to `apply-partially'` => (0 1 2 3 4 5) (funcall (apply-mid-partially #'append 1 '(1 2 3)) '(0) '(4)) => (0 1 2 3 4) (funcall (apply-mid-partially #'append -1 '(1 2 3)) '(-2 -1) '(4 5) '(6 7)) => (-2 -1 4 5 1 2 3 6 7) ; apply-rpartially (funcall (apply-mid-partially #'append most-positive-fixnum '(1 2 3)) '(-2 -1) '(4 5) '(6 7)) => (-2 -1 4 5 6 7 1 2 3) (funcall (apply-mid-partially #'append 'foo '(1 2 3)) '(-2 -1) '(4 5) '(6 7)) => (-2 -1 4 5 6 7 1 2 3) --=-=-= Content-Type: text/patch Content-Disposition: attachment; filename=0005-b-Define-apply-mid-partially.patch From 88522f33b497a6463ee73c4ba9479e853291035a Mon Sep 17 00:00:00 2001 From: Daanturo Date: Fri, 2 Jul 2021 11:22:11 +0700 Subject: [PATCH] Define apply-mid-partially * lisp/subr.el (apply-mid-partially): Currying functions with arbitrary arguments position. --- lisp/subr.el | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/lisp/subr.el b/lisp/subr.el index 5965655d48..2c25343a76 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -474,6 +474,33 @@ function was called." (lambda (&rest args1) (apply fun (append args1 args)))) +(defun apply-mid-partially (fun position &rest args) + "Return a function that is a partial application of FUN to ARGS at POSITION. + +ARGS is a list of N arguments to pass to FUN, starting at +POSITION (integer). + +The result is a new function which does the same as FUN, except +that N arguments starting from POSITION (inclusive) are fixed at the +values with which this function was called. + +If POSITION is not an integer or is >= the length of the function +application's arguments in the future, ARGS will be at the last. + +Else if POSITION is non-negative integer, count from the left. + +Else (POSITION is a negative integer), count from the right." + (lambda (&rest other-args) + (let* ((right-partially (or (not (integerp position)) + (<= (length other-args) position))) + (first-args (seq-subseq other-args + 0 + (if right-partially nil position))) + (last-args (if right-partially + nil + (seq-subseq other-args position)))) + (apply fun (append first-args args last-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 --=-=-=-- On 7/2/21 5:34 AM, Michael Heerdegen wrote: > daanturo writes: > > | +(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. > > I wonder: If we leave syntax aside for a moment - this suggestion seems > to provide a solution for a quite special case: is this useful more > often than partial application of arbitrary arguments? Could we instead > provide something that allows partial application of arbitrary > arguments, e.g. one of the arguments in the middle? > > > Michael. -- Daanturo. --------------10EC503E83421FDEA3A2A9BB Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 7bit
--=-=-=
Content-Type: text/plain

Tags: patch


> Could we instead
> provide something that allows partial application of arbitrary
> arguments, e.g. one of the arguments in the middle?

I have tried implementing, but it's really hard to provide a practical
example for documenting.

Also, most of the time after specifying a position, we would insert to
left of that. If 0 is for regular `apply-partially`, then -1 is
certainly not possible for `apply-rpartially`.

To pass ARGS at the last, should the following condition be OK?:

"If POSITION is not an integer or is >= the length of the function
application's arguments in the future."

(funcall (apply-mid-partially #'append 0 '(0 1 2 3)) '(4) '(5)) ; Equivalent to `apply-partially'`
=> (0 1 2 3 4 5)

(funcall (apply-mid-partially #'append 1 '(1 2 3)) '(0) '(4))
=> (0 1 2 3 4)

(funcall (apply-mid-partially #'append -1 '(1 2 3)) '(-2 -1) '(4 5) '(6 7))
=> (-2 -1 4 5 1 2 3 6 7)

; apply-rpartially
(funcall (apply-mid-partially #'append most-positive-fixnum '(1 2 3)) '(-2 -1) '(4 5) '(6 7))
=> (-2 -1 4 5 6 7 1 2 3)

(funcall (apply-mid-partially #'append 'foo '(1 2 3)) '(-2 -1) '(4 5) '(6 7))
=> (-2 -1 4 5 6 7 1 2 3)


--=-=-=
Content-Type: text/patch
Content-Disposition: attachment;
filename=0005-b-Define-apply-mid-partially.patch

From 88522f33b497a6463ee73c4ba9479e853291035a Mon Sep 17 00:00:00 2001
From: Daanturo <daanturo@gmail.com>
Date: Fri, 2 Jul 2021 11:22:11 +0700
Subject: [PATCH] Define apply-mid-partially

* lisp/subr.el (apply-mid-partially): Currying functions with arbitrary
arguments position.
---
lisp/subr.el | 27 +++++++++++++++++++++++++++
1 file changed, 27 insertions(+)

diff --git a/lisp/subr.el b/lisp/subr.el
index 5965655d48..2c25343a76 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -474,6 +474,33 @@ function was called."
(lambda (&rest args1)
(apply fun (append args1 args))))

+(defun apply-mid-partially (fun position &rest args)
+ "Return a function that is a partial application of FUN to ARGS at POSITION.
+
+ARGS is a list of N arguments to pass to FUN, starting at
+POSITION (integer).
+
+The result is a new function which does the same as FUN, except
+that N arguments starting from POSITION (inclusive) are fixed at the
+values with which this function was called.
+
+If POSITION is not an integer or is >= the length of the function
+application's arguments in the future, ARGS will be at the last.
+
+Else if POSITION is non-negative integer, count from the left.
+
+Else (POSITION is a negative integer), count from the right."
+ (lambda (&rest other-args)
+ (let* ((right-partially (or (not (integerp position))
+ (<= (length other-args) position)))
+ (first-args (seq-subseq other-args
+ 0
+ (if right-partially nil position)))
+ (last-args (if right-partially
+ nil
+ (seq-subseq other-args position))))
+ (apply fun (append first-args args last-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


--=-=-=--



On 7/2/21 5:34 AM, Michael Heerdegen wrote:
daanturo <daanturo@gmail.com> writes:

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

I wonder: If we leave syntax aside for a moment - this suggestion seems
to provide a solution for a quite special case: is this useful more
often than partial application of arbitrary arguments?  Could we instead
provide something that allows partial application of arbitrary
arguments, e.g. one of the arguments in the middle?


Michael.
-- 
Daanturo.
--------------10EC503E83421FDEA3A2A9BB-- --------------88E6D1A450B33722F674C365 Content-Type: text/x-patch; charset=UTF-8; name="0005-b-Define-apply-mid-partially.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="0005-b-Define-apply-mid-partially.patch" >From 88522f33b497a6463ee73c4ba9479e853291035a Mon Sep 17 00:00:00 2001 From: Daanturo Date: Fri, 2 Jul 2021 11:22:11 +0700 Subject: [PATCH] Define apply-mid-partially * lisp/subr.el (apply-mid-partially): Currying functions with arbitrary arguments position. --- lisp/subr.el | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/lisp/subr.el b/lisp/subr.el index 5965655d48..2c25343a76 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -474,6 +474,33 @@ function was called." (lambda (&rest args1) (apply fun (append args1 args)))) +(defun apply-mid-partially (fun position &rest args) + "Return a function that is a partial application of FUN to ARGS at POSITION. + +ARGS is a list of N arguments to pass to FUN, starting at +POSITION (integer). + +The result is a new function which does the same as FUN, except +that N arguments starting from POSITION (inclusive) are fixed at the +values with which this function was called. + +If POSITION is not an integer or is >= the length of the function +application's arguments in the future, ARGS will be at the last. + +Else if POSITION is non-negative integer, count from the left. + +Else (POSITION is a negative integer), count from the right." + (lambda (&rest other-args) + (let* ((right-partially (or (not (integerp position)) + (<= (length other-args) position))) + (first-args (seq-subseq other-args + 0 + (if right-partially nil position))) + (last-args (if right-partially + nil + (seq-subseq other-args position)))) + (apply fun (append first-args args last-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 --------------88E6D1A450B33722F674C365-- From unknown Sun Jun 22 00:55:41 2025 X-Loop: help-debbugs@gnu.org Subject: bug#49316: Add apply-partially's right version Resent-From: daanturo Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 02 Jul 2021 16:33:01 +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 To: 49316@debbugs.gnu.org Cc: Eli Zaretskii Received: via spool by 49316-submit@debbugs.gnu.org id=B49316.162524355728004 (code B ref 49316); Fri, 02 Jul 2021 16:33:01 +0000 Received: (at 49316) by debbugs.gnu.org; 2 Jul 2021 16:32:37 +0000 Received: from localhost ([127.0.0.1]:36991 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lzM5k-0007Ha-Is for submit@debbugs.gnu.org; Fri, 02 Jul 2021 12:32:36 -0400 Received: from mail-pf1-f175.google.com ([209.85.210.175]:34549) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lzM5i-0007HM-I2 for 49316@debbugs.gnu.org; Fri, 02 Jul 2021 12:32:35 -0400 Received: by mail-pf1-f175.google.com with SMTP id f20so1477983pfa.1 for <49316@debbugs.gnu.org>; Fri, 02 Jul 2021 09:32:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language; bh=8CkrC9+Z1vdLcPhZIBhEFS6eJRvHaytg9Er88Aszegw=; b=I+Ui5GghMneUXuhSyzt+8nHMVRjgtgge4rW+U0DB89xINYHGKczv9H1pEA9n2H8Xnn A7iDtVAIB47uYqmuOMfmqey4XvIjuIImJ88skF4K462EALuT9L9mcy/yg7bGTtOxX5cj g5CsZc4d9A/O7KP/OQlvxIsvUMBaYJxK0s7h2fJ3tr1Cs0NKcm+gXv6D+7hmzkRYz0iw 7x/k64ZfjK+rxT+tnLGxygxpHk6juzj0+2CGLfEGXI3tQW0iNbOat3WSsjiNpOiY+uNP 7OYt9OLm/WoOvcKr12F04jxc4opvBlKSiYZJpVuBG/NkttPhJociLhU4ose7NUHoXPGw AqBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language; bh=8CkrC9+Z1vdLcPhZIBhEFS6eJRvHaytg9Er88Aszegw=; b=Xi0Prl2RZRFuEHqMKVCiuPY7gPTgXcNEOerdxIYgRzFaqqVHBAQsidmyrJPpQ5Jnwd 7iyt+5AsvffjECU9RAU0RWaMB2sJNERjS0rSCJ7rBpESSTou3D1LWexCfIeuQtD7DDTj fuL5AOB+mR0F1QDDFpWQECOC+cZ1oaeLm1sZkScyzReN4S0JZ+xTi/JGknjMceC0B1w7 WnE1qvD0d9BW++MLsbDTJLk8KlH1heGc6G9EYFBhXO/4SjAyRj2J5dCJ2Hvwh8BJxDmv eUwdWuuSxjJiFCx+ELVHIeSdi8PIKEtRBna5XkyFS6f8XaUpKDStkdkhJm5lrPYRmjVf fvOQ== X-Gm-Message-State: AOAM531KEjmigbtgOmdzK9ovurV6Dir9YXLkIYGH6gKhSkwhrMRHryBx Df46u5DXmcFRU5BpA3SiRXT2bNtdtRiC7Q== X-Google-Smtp-Source: ABdhPJzhSQyOqnd6+zB7HmwY78Mfsn+cvtah8bzqQheNCLc7Z2TNMFDDAoCH/pIYOVRVlsYUSc/XOw== X-Received: by 2002:a63:f65:: with SMTP id 37mr786428pgp.367.1625243548618; Fri, 02 Jul 2021 09:32:28 -0700 (PDT) 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 20sm3981441pfi.170.2021.07.02.09.32.26 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 02 Jul 2021 09:32:28 -0700 (PDT) References: <2315db79-00cf-b2f0-b5df-93cd53392292@gmail.com> <87czs2faas.fsf@tcd.ie> <834kddlvpg.fsf@gnu.org> From: daanturo Message-ID: <67d42829-b223-198b-3d46-c2705a7bbfc2@gmail.com> Date: Fri, 2 Jul 2021 23:32:25 +0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <834kddlvpg.fsf@gnu.org> Content-Type: multipart/mixed; boundary="------------BA23B12AC3991520B2AB21BF" Content-Language: en-US X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) This is a multi-part message in MIME format. --------------BA23B12AC3991520B2AB21BF Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit --=-=-= Content-Type: text/plain Tags: patch Re-write the NEWS entry of apply-rpartially. --=-=-= Content-Type: text/patch Content-Disposition: attachment; filename=0005-Better-explanation-for-apply-rpartially-in-NEWS.patch From 339b0ed82dbc0430ce71294f04a53547f532c1af Mon Sep 17 00:00:00 2001 From: Daanturo Date: Fri, 2 Jul 2021 23:24:37 +0700 Subject: [PATCH] Better explanation for apply-rpartially in NEWS * etc/NEWS (Lisp Changes in Emacs 28.1): Better explanation for apply-rpartially --- etc/NEWS | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index be30d6c859..a06456035c 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -2911,8 +2911,8 @@ The former is now declared obsolete. +++ ** New function 'apply-rpartially'. -Functionally equivalent to 'apply-partially' but arguments are aligned -to the right instead. +This is almost similar to 'apply-partially' except that the last +arguments are fixed instead of first ones. +++ ** New function 'syntax-class-to-char'. -- 2.32.0 --=-=-=-- On 7/2/21 1:45 AM, Eli Zaretskii wrote: >> From: daanturo >> Date: Fri, 2 Jul 2021 00:06:35 +0700 >> Cc: "Basil L. Contovounesios" >> >> (Please ignore my immediately precededing email, I'm sorry for not being >> used to sending patches by mailing list.) > I see no problems in the preceding email, so I think you have nothing > to apologize for. > >> +@defun apply-rpartially func &rest args >> +This function does mostly the same as @code{apply-partially}, but >> +@var{args} are aligned to the right of @var{func}'s parameters >> +instead. > I don't think this explains the purpose of the function clearly > enough. The documentation of apply-partially doesn't mention any > "alignment", so it's hard to understand what you want to say here. > Can you think of a better description? > >> +@example >> +@group >> +(defalias 'square (apply-rpartially #'expt 2) >> + "Return argument squared.") >> +@end group >> +@group >> +(square 3) >> + @result{} 9 >> +@end group >> +@end example > IMO, the example could be more revealing if you could contrast > apply-rpartially with apply-partially. > >> ++++ >> +** New function 'apply-rpartially'. >> +Funcionally equivalent to 'apply-partially' but arguments are aligned >> +to the right instead. > After we find a good wording for the manual, we should think how to > reword the NEWS entry accordingly. > > Thanks. -- Daanturo. --------------BA23B12AC3991520B2AB21BF Content-Type: text/x-patch; charset=UTF-8; name="0005-Better-explanation-for-apply-rpartially-in-NEWS.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename*0="0005-Better-explanation-for-apply-rpartially-in-NEWS.patch" >From 339b0ed82dbc0430ce71294f04a53547f532c1af Mon Sep 17 00:00:00 2001 From: Daanturo Date: Fri, 2 Jul 2021 23:24:37 +0700 Subject: [PATCH] Better explanation for apply-rpartially in NEWS * etc/NEWS (Lisp Changes in Emacs 28.1): Better explanation for apply-rpartially --- etc/NEWS | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index be30d6c859..a06456035c 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -2911,8 +2911,8 @@ The former is now declared obsolete. +++ ** New function 'apply-rpartially'. -Functionally equivalent to 'apply-partially' but arguments are aligned -to the right instead. +This is almost similar to 'apply-partially' except that the last +arguments are fixed instead of first ones. +++ ** New function 'syntax-class-to-char'. -- 2.32.0 --------------BA23B12AC3991520B2AB21BF-- From unknown Sun Jun 22 00:55:41 2025 X-Loop: help-debbugs@gnu.org Subject: bug#49316: Add apply-partially's right version Resent-From: Michael Heerdegen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 03 Jul 2021 03:07:01 +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 To: daanturo Cc: 49316@debbugs.gnu.org Received: via spool by 49316-submit@debbugs.gnu.org id=B49316.16252815897542 (code B ref 49316); Sat, 03 Jul 2021 03:07:01 +0000 Received: (at 49316) by debbugs.gnu.org; 3 Jul 2021 03:06:29 +0000 Received: from localhost ([127.0.0.1]:37547 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lzVzB-0001xa-6x for submit@debbugs.gnu.org; Fri, 02 Jul 2021 23:06:29 -0400 Received: from mout.web.de ([212.227.17.11]:35219) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lzVz7-0001xJ-NI for 49316@debbugs.gnu.org; Fri, 02 Jul 2021 23:06:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=dbaedf251592; t=1625281579; bh=rS33r5LQhRqyh37vMaBZDfAywctuTU7dxshV2Jeq1P0=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To; b=S/ctsrfKvZaIAc+Y0gO0kyYlsPufF+A2jrIWhaHjS+NSNRE6Cs18jT+U2nm23fPiB MXSwpiJPZc4Q3inGCDep/lzq4lI4xJojoGCjn4xdwC3RMo7RrJe/2HJaKlDqvajeOJ CzX+61DNigyG3VWPA0/P09Z17Qkmeeqi3VZQAVMw= X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 Received: from drachen.dragon ([84.59.210.69]) by smtp.web.de (mrweb105 [213.165.67.124]) with ESMTPSA (Nemesis) id 1MYcpt-1llRVJ3iK3-00VgnY; Sat, 03 Jul 2021 05:06:18 +0200 From: Michael Heerdegen References: <2315db79-00cf-b2f0-b5df-93cd53392292@gmail.com> <87r1ghr7d1.fsf@web.de> <5a08f089-3a19-d747-5098-4751c92a5b79@gmail.com> Date: Sat, 03 Jul 2021 05:06:18 +0200 In-Reply-To: <5a08f089-3a19-d747-5098-4751c92a5b79@gmail.com> (daanturo@gmail.com's message of "Fri, 2 Jul 2021 11:39:03 +0700") Message-ID: <875yxsxfit.fsf@web.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:p4xztCy2+mholY8pmxLizj8YBKvmzdQb8MJ2F9Cerm3lzhdTlFj ZYhaOWPnFjEGEGgwdbDp4U+IAP8aM49HDFIO/76NBIH6128mt3bYAM7LBQ8Y+WxVF565JPt TYbeunHIC0JNphMs6vCJauQlXpqt1qJmZ3mphrnmcD2Tvvdi9bxbl933q9Tl3oGX3Ip2rjF KZ4jhXR9wk70Iupg+MXoA== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:pC9OKkIUTLw=:aNOzKKIUCMXWbskUG4Xcnq Och3rglPXEfIMwnRfBcNbFfNiRguGlQiHsaEWrLc9LicMStDN4vb3+pBicIjUpCqXNFy/zIcp NrA+sbe+b3RcijoJnv2mGuH3Af1wMtAh4z4A4DJDNKUtXheDGrkJeCkickxXhgQk5Hw7c99/+ BWcb8hmsO/xvk4B3j+VIAvXavVnQ0DHb6X3wmzi2TsR5zAqnzFMJ6xLeF1YCEnpfOXnbwcm7t xEjwzL3PUqiNaTREoI7tUiXfKpMS7hO0ncgQz/mqtx1Rv5Yf/0e5vMmSiCXWQ1HCYXd8wkIrI ZjUHxyO8odGmQ3wbZHU7yK4TgjVy4Kq3xvHSE+kHcxUqAkzbyHxSccSHDfnQejfD+RmpChKc6 glCqF2cRx5vg0SuiImZJ7TzVJJvmP17PoWiZvSEuXqAwemBYuB61er1S0iGcy5L+FonQ9nAGY wHOIu9RsgR3LAZ+/bAG3Tsu7wkmxlDm1pP5tzZeHPs0H2WauMKqcCqScHR6bBZSwgwbGullvt vbsAJKLCbv0gcLmUZh9QlcHp/2kK356YcBVlTD6htezSX75FS+V4BYjqoFCm2ijwl6WcHEVib w8h3vHDpdCiaRMw3t6fmOGHPj8JVz2sICvauLRZsJXonceThdR6fg6MKkd0rjwmhw+bMmxtxi qbEqsRdfiUGcYLJf3nrNPPvyqlHaX298uU6p5OeR34ANJrVFr6LT+D7Rdw0Xah8tomea3Znlj YGla5qMA+in7xb728KgUQTXaKZ8QBMfrg+8eRrEz65LS0VsBcBakqOKLJN2K4nooT3JhHurA+ jbogA3FMsfe7s+2MMHckHXH2OUfeaJdhGUDoPnz+43XlGQVlm7PqGKXJZfqLS9sI9AsrQ0XYO +jqO8QANHQ1fDwM9JnUJqOyEVmX7cn9u2qbL6xg0rkCkFBhuukXAfcv9JDFa/L+xRBwlKB6Ht HMmv3/LuR6kYRn1ZdkUqbF5gAK9kCQTKJMI/tTG3LEq7goPAhhOKPSyQ3FcdGQns2UWWWKnaG OGTUfvCfSWFw5nDMNQp1FG/9gxzGRAZQF5FK1m3/nflWEwUSwbSV3T9Zk4h0yM+nMs2Kdg3cB eloZvUx6SNliT3PnIT9v+J1fMjv2LsxuXdk2IgFPZGkRhEwJgIoC/vGaQ== X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) daanturo writes: > +(defun apply-mid-partially (fun position &rest args) > + "Return a function that is a partial application of FUN to ARGS at POSITION. I'm not sure if I would prefer that. Personally I guess I would like something like this instead: A macro that allows partial application that really looks like an application. A placeholder (e.g. the symbol `_' which should normally be unbound) stands for an argument that is used from the args provided in the actual call: #+begin_src emacs-lisp (defmacro applying-partially (call) (let ((args (make-symbol "args"))) `(lambda (&rest ,args) (apply #',(car call) ,@(mapcar (lambda (arg) (if (eq arg '_) `(pop ,args) arg)) (cdr call)) ,args)))) (defalias 'minus-10 (applying-partially (- _ 10))) (minus-10 120) ;; ==> 110 (defalias 'my-list-with-some-elts (applying-partially (list 0 _ 2 _ 4))) (my-list-with-some-elts 'a 'b 'c 'd) ; => (0 a 2 b 4 c d) (symbol-function 'my-list-with-some-elts) ;; => (closure (t) (&rest args) ;; (apply #'list 0 (pop args) 2 (pop args) 4 args)) #+end_src In my eyes that would be more general and a bit better readable (I like when eldoc works with such stuff). Regards, Michael. From unknown Sun Jun 22 00:55:41 2025 X-Loop: help-debbugs@gnu.org Subject: bug#49316: Add apply-partially's right version Resent-From: daanturo Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 03 Jul 2021 06:19: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 To: Michael Heerdegen Cc: 49316@debbugs.gnu.org Received: via spool by 49316-submit@debbugs.gnu.org id=B49316.16252930931876 (code B ref 49316); Sat, 03 Jul 2021 06:19:02 +0000 Received: (at 49316) by debbugs.gnu.org; 3 Jul 2021 06:18:13 +0000 Received: from localhost ([127.0.0.1]:37797 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lzYyi-0000UB-SG for submit@debbugs.gnu.org; Sat, 03 Jul 2021 02:18:13 -0400 Received: from mail-pl1-f177.google.com ([209.85.214.177]:44964) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lzYyf-0000Tu-Tz for 49316@debbugs.gnu.org; Sat, 03 Jul 2021 02:18:11 -0400 Received: by mail-pl1-f177.google.com with SMTP id h6so5887018plf.11 for <49316@debbugs.gnu.org>; Fri, 02 Jul 2021 23:18:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=OhIaJRQAV2Xlzbiz6p7CLvCMQ1ikGE088eda5o3OvPQ=; b=m7B0ChMeZ0n1rKX9KKaEixnidUhlo7psotXQARw08aRx8ogoydAMKq+8HMoujf6kn3 bVtCcM0DydqZO0R+NXKUmyzw1gWACIWptVj1lN9tWGXdNHtpQWYjZSHgKrHsAwdwLaL8 i5ORhLrGxMAGEHfPxEZvOEd/czFnTohxQPa3g1RdRCfCcz90vB+p85vrjJFY9ksszsDy geu34bIc8CWndvsxDQaT5CIC9SZF6iG+bYX8gHJ1jwf/BNnOGoCTOeXZzPzSfbRHKlG/ qSxicmKGcjJTkzElbp2jGsRnvBzWgkOn5yMyCK5XhY9fa9MQ8bM5vQ2JCNcJu/ecjBcs mM8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=OhIaJRQAV2Xlzbiz6p7CLvCMQ1ikGE088eda5o3OvPQ=; b=KdKJRWsLdBmhjpc++vY2wQwpEBllROrvT2azKBRdVBc5c82weA5DLscpjYPxq5sN48 f2USkiNB2ZwP3Ss994MDAVZXaRiYGb01ZEltC5IqwY4c1XZWciMfm1+nerc7NRHcL/5M 7UeRwP0A7pF6gQ0NBVPsBv9KQ7yjfN8Gc8QlA37hE1b6XKdCtrsY7NqlMBsElgNkDwYm JVCoihjSv8ilg5P32mGXaXW4dqjWiUVVG+2BimKZ3Aqs5MwBNJQ4MR/ZCZmXe9kEJn3d E7P/uyzOpYKvsqm3TwQFwtszjJ1C9D8ontCNhC60ieSmKY2m5lEdFSAGqcA+QX1SE2gK nOeA== X-Gm-Message-State: AOAM531LrqpM0djpjjlWhsWg1gf2Yd/fPjAhDrAFu7DmLChRwW1RS4HC 06MVXsQzg3MrJynaOx6eP/n1Wf/86x58n1tc X-Google-Smtp-Source: ABdhPJyAZae3hYPPFnc5v0TKSMz+5GTF3kJ1YmjsBhZao3NYBE4J7T9iRLYjtdcJfsvzCqKJLaVx4Q== X-Received: by 2002:a17:90a:4f07:: with SMTP id p7mr3261084pjh.165.1625293083625; Fri, 02 Jul 2021 23:18:03 -0700 (PDT) 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 z16sm5683552pff.9.2021.07.02.23.18.02 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 02 Jul 2021 23:18:03 -0700 (PDT) References: <2315db79-00cf-b2f0-b5df-93cd53392292@gmail.com> <87r1ghr7d1.fsf@web.de> <5a08f089-3a19-d747-5098-4751c92a5b79@gmail.com> <875yxsxfit.fsf@web.de> From: daanturo Message-ID: <1aaac06c-da6d-0f60-3fab-937207ad527c@gmail.com> Date: Sat, 3 Jul 2021 13:17:50 +0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <875yxsxfit.fsf@web.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) That's cool! Can you submit the patch? On 7/3/21 10:06 AM, Michael Heerdegen wrote: > A placeholder (e.g. the symbol `_' which should normally be unbound) > stands for an argument that is used from the args provided in the actual > call: > > #+begin_src emacs-lisp > (defmacro applying-partially (call) > (let ((args (make-symbol "args"))) > `(lambda (&rest ,args) > (apply #',(car call) > ,@(mapcar (lambda (arg) > (if (eq arg '_) > `(pop ,args) > arg)) > (cdr call)) > ,args)))) > > (defalias 'minus-10 (applying-partially (- _ 10))) > > (minus-10 120) ;; ==> 110 > > (defalias 'my-list-with-some-elts > (applying-partially (list 0 _ 2 _ 4))) > > (my-list-with-some-elts 'a 'b 'c 'd) ; => (0 a 2 b 4 c d) > > (symbol-function 'my-list-with-some-elts) > ;; => (closure (t) (&rest args) > ;; (apply #'list 0 (pop args) 2 (pop args) 4 args)) > #+end_src > > -- > Daanturo. From unknown Sun Jun 22 00:55:41 2025 X-Loop: help-debbugs@gnu.org Subject: bug#49316: Add apply-partially's right version Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 03 Jul 2021 07:04:01 +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 To: daanturo Cc: 49316@debbugs.gnu.org Received: via spool by 49316-submit@debbugs.gnu.org id=B49316.16252958016143 (code B ref 49316); Sat, 03 Jul 2021 07:04:01 +0000 Received: (at 49316) by debbugs.gnu.org; 3 Jul 2021 07:03:21 +0000 Received: from localhost ([127.0.0.1]:37861 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lzZgP-0001b1-5A for submit@debbugs.gnu.org; Sat, 03 Jul 2021 03:03:21 -0400 Received: from eggs.gnu.org ([209.51.188.92]:54136) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lzZgM-0001al-TT for 49316@debbugs.gnu.org; Sat, 03 Jul 2021 03:03:19 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:35790) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lzZgH-0002F6-MX; Sat, 03 Jul 2021 03:03:13 -0400 Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:3369 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lzZgH-0001Th-A8; Sat, 03 Jul 2021 03:03:13 -0400 Date: Sat, 03 Jul 2021 10:03:15 +0300 Message-Id: <83mtr3j2vg.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: <67d42829-b223-198b-3d46-c2705a7bbfc2@gmail.com> (message from daanturo on Fri, 2 Jul 2021 23:32:25 +0700) References: <2315db79-00cf-b2f0-b5df-93cd53392292@gmail.com> <87czs2faas.fsf@tcd.ie> <834kddlvpg.fsf@gnu.org> <67d42829-b223-198b-3d46-c2705a7bbfc2@gmail.com> X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Cc: Eli Zaretskii > From: daanturo > Date: Fri, 2 Jul 2021 23:32:25 +0700 > > Re-write the NEWS entry of apply-rpartially. This LGTM, thanks. From unknown Sun Jun 22 00:55:41 2025 X-Loop: help-debbugs@gnu.org Subject: bug#49316: Add apply-partially's right version Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 03 Jul 2021 07:05: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 To: daanturo Cc: contovob@tcd.ie, 49316@debbugs.gnu.org Received: via spool by 49316-submit@debbugs.gnu.org id=B49316.16252958436222 (code B ref 49316); Sat, 03 Jul 2021 07:05:02 +0000 Received: (at 49316) by debbugs.gnu.org; 3 Jul 2021 07:04:03 +0000 Received: from localhost ([127.0.0.1]:37865 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lzZh5-0001cI-DK for submit@debbugs.gnu.org; Sat, 03 Jul 2021 03:04:03 -0400 Received: from eggs.gnu.org ([209.51.188.92]:54196) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lzZh4-0001bi-6G for 49316@debbugs.gnu.org; Sat, 03 Jul 2021 03:04:02 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:35796) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lzZgy-0002l3-Ek; Sat, 03 Jul 2021 03:03:56 -0400 Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:3412 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lzZgy-0003JG-19; Sat, 03 Jul 2021 03:03:56 -0400 Date: Sat, 03 Jul 2021 10:03:58 +0300 Message-Id: <83lf6nj2u9.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: <27c5c6c9-32d7-0b9a-b883-4f28167ec25c@gmail.com> (message from daanturo on Fri, 2 Jul 2021 09:49:19 +0700) References: <2315db79-00cf-b2f0-b5df-93cd53392292@gmail.com> <87czs2faas.fsf@tcd.ie> <834kddlvpg.fsf@gnu.org> <27c5c6c9-32d7-0b9a-b883-4f28167ec25c@gmail.com> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -0.3 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.3 (-) > Cc: contovob@tcd.ie, Eli Zaretskii > From: daanturo > Date: Fri, 2 Jul 2021 09:49:19 +0700 > > I have replaced the examples: > > >           (defalias '**2 (apply-rpartially #'expt 2) >             "Return argument ** 2.") >           (defalias '2** (apply-partially #'expt 2) >             "Return 2 ** argument.") >           (**2 3) >                => 9 >           (2** 3) >                => 8 Thanks, the patch LGTM. From unknown Sun Jun 22 00:55:41 2025 X-Loop: help-debbugs@gnu.org Subject: bug#49316: Add apply-partially's right version Resent-From: Phil Sainty Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 03 Jul 2021 14:15: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 To: Michael Heerdegen Cc: daanturo , 49316@debbugs.gnu.org Received: via spool by 49316-submit@debbugs.gnu.org id=B49316.1625321645546 (code B ref 49316); Sat, 03 Jul 2021 14:15:02 +0000 Received: (at 49316) by debbugs.gnu.org; 3 Jul 2021 14:14:05 +0000 Received: from localhost ([127.0.0.1]:39644 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lzgPE-00008k-Pb for submit@debbugs.gnu.org; Sat, 03 Jul 2021 10:14:05 -0400 Received: from smtp-3.orcon.net.nz ([60.234.4.44]:38507) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lzgP9-000082-F6 for 49316@debbugs.gnu.org; Sat, 03 Jul 2021 10:14:03 -0400 Received: from [10.253.37.70] (port=16702 helo=webmail.orcon.net.nz) by smtp-3.orcon.net.nz with esmtpa (Exim 4.90_1) (envelope-from ) id 1lzgP4-00006t-0V; Sun, 04 Jul 2021 02:13:54 +1200 Received: from ip-116-251-162-85.kinect.net.nz ([116.251.162.85]) via [10.253.37.253] by webmail.orcon.net.nz with HTTP (HTTP/1.1 POST); Sun, 04 Jul 2021 02:13:53 +1200 MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Sun, 04 Jul 2021 02:13:53 +1200 From: Phil Sainty In-Reply-To: <875yxsxfit.fsf@web.de> References: <2315db79-00cf-b2f0-b5df-93cd53392292@gmail.com> <87r1ghr7d1.fsf@web.de> <5a08f089-3a19-d747-5098-4751c92a5b79@gmail.com> <875yxsxfit.fsf@web.de> Message-ID: <8b10e4966ad9a1f621b5d9a6b069c7c7@webmail.orcon.net.nz> X-Sender: psainty@orcon.net.nz User-Agent: Orcon Webmail X-GeoIP: -- X-Spam_score: -2.9 X-Spam_score_int: -28 X-Spam_bar: -- X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) On 2021-07-03 15:06, Michael Heerdegen wrote: > A placeholder (e.g. the symbol `_' which should normally be unbound) > stands for an argument that is used from the args provided in the > actual > call: > > (defalias 'my-list-with-some-elts > (applying-partially (list 0 _ 2 _ 4))) > > (my-list-with-some-elts 'a 'b 'c 'd) ; => (0 a 2 b 4 c d) I like the flexibility of the placeholder approach. I'm not sold on the extra parens used here -- I don't feel too strongly about it, but it's inconsistent with how `apply-partially' is called. Similarly, being a macro is inconsistent, and eliminates the ability to apply an arbitrary list of arguments to this, which may be a useful thing to be able to do. (It's syntactic sugar though, so we don't *need* to account for all scenarios -- other use-cases can use the same approaches they do now.) It's slightly problematic that any chosen placeholder might be a valid argument to the function in question. An underscore feels as good a choice as any other, though, and provides the mental association with the conventional use of an underscore for unused arguments. I suppose this issue is partly mitigated if it does end up being a macro, as we can't then apply some unknown list of args (which might happen to include the placeholder value). I think this is useful enough to implement regardless of that last issue, and it could simply be documented that it shouldn't be used in cases where the arguments are unknown, or where an underscore (or whatever placeholder is chosen) is a valid arg. -Phil From unknown Sun Jun 22 00:55:41 2025 X-Loop: help-debbugs@gnu.org Subject: bug#49316: Add apply-partially's right version Resent-From: daanturo Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 05 Jul 2021 04:30: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 To: Phil Sainty , Michael Heerdegen Cc: 49316@debbugs.gnu.org Received: via spool by 49316-submit@debbugs.gnu.org id=B49316.162545936730373 (code B ref 49316); Mon, 05 Jul 2021 04:30:02 +0000 Received: (at 49316) by debbugs.gnu.org; 5 Jul 2021 04:29:27 +0000 Received: from localhost ([127.0.0.1]:43559 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m0GEZ-0007tp-9B for submit@debbugs.gnu.org; Mon, 05 Jul 2021 00:29:27 -0400 Received: from mail-pj1-f42.google.com ([209.85.216.42]:39817) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m0GEW-0007tb-Dc for 49316@debbugs.gnu.org; Mon, 05 Jul 2021 00:29:26 -0400 Received: by mail-pj1-f42.google.com with SMTP id in17-20020a17090b4391b0290170ba0ec7fcso13737463pjb.4 for <49316@debbugs.gnu.org>; Sun, 04 Jul 2021 21:29:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=bOhFkCGbYkYEmEL7+67yhPnZz9nadqB7K+urZPBG68c=; b=GT0ub4uAcHKgYSCIElQDzT8XP47ZUj9ceGne+7L4M+X/LsGZPv/PdVb0Jzbb6eldWv N/7VosXtYaQlUc0S3TZLFoz1jF9cDDwKxeXnac7JrjS35TMTX57NODXfMTjz7jtJgM8q hrvj1YhfkSkijxRQE99nlImRetBD1jhCKGz5O5VOz3mL4sqvWh+Ui0MQ9jphBxhzvX/d P0pDrB0qTzkCN25Mx2iBBxPfZm8phvCCSfm2iYxUN/rBDU+gwC+evC8gaaa3O9B3zCet apo+Wis67XY2wwr54Gw9E8hsk3bZ65738ZxHL8HXcn/+vr/4yolceJ8jEJ8DE3tC5igx aA4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=bOhFkCGbYkYEmEL7+67yhPnZz9nadqB7K+urZPBG68c=; b=hlNliIlV8WeBPmbisW5N2WLZshoq0SWmhzbjUZmgn2CDYdG8bQSn2406spKuZ4dGF9 b8kOxOHQmZT2Di9edY+XQKUlNXHWpf7yP/i1A8SQihx4ls46QKgX4eamzIjW3/FCM2bX CZ0inUhRrnQO43109oEUIjswGnyEyRv1f0fX3JoCMT4JbO2ZFZJkLi2wHurvColc5P6M cwGBSXn5yGFtKbaiaePIcKlFkBC1Rc0g0sXr6JvaS8j4F2WQqSTUNMMibNvmVIQeTADD 8qYdctclRk4hs5Xo35h19JwwhZSr/poiVi4r+HB8T+UR1bIj3uFQ9q9KbcDF1o4aK9Cu VcdA== X-Gm-Message-State: AOAM531d5b3QwG/DTYRB3U9+lCGwPsqaL+Uq0+tPbTyEyVbU4UxNYEQ5 1goJtwFk5tQQBqbmlu7ze2ZgpRmHBXu8QA== X-Google-Smtp-Source: ABdhPJxmq6zrpy4vLsdicmNFkip5k4Z2wdCCeYXzXibRWqml8mdvYJV2Q0ulz9vc0SVbGxwLh+1Tvw== X-Received: by 2002:a17:90a:454e:: with SMTP id r14mr13288194pjm.71.1625459358350; Sun, 04 Jul 2021 21:29:18 -0700 (PDT) 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 k20sm19569528pji.3.2021.07.04.21.29.16 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 04 Jul 2021 21:29:17 -0700 (PDT) References: <2315db79-00cf-b2f0-b5df-93cd53392292@gmail.com> <87r1ghr7d1.fsf@web.de> <5a08f089-3a19-d747-5098-4751c92a5b79@gmail.com> <875yxsxfit.fsf@web.de> <8b10e4966ad9a1f621b5d9a6b069c7c7@webmail.orcon.net.nz> From: daanturo Message-ID: <03694a85-9f3c-78d8-d06c-8bd5c6fae297@gmail.com> Date: Mon, 5 Jul 2021 11:29:15 +0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <8b10e4966ad9a1f621b5d9a6b069c7c7@webmail.orcon.net.nz> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On 7/3/21 9:13 PM, Phil Sainty wrote: > On 2021-07-03 15:06, Michael Heerdegen wrote: >> A placeholder (e.g. the symbol `_' which should normally be unbound) >> stands for an argument that is used from the args provided in the actual >> call: >> >> (defalias 'my-list-with-some-elts >>   (applying-partially (list 0 _ 2 _ 4))) >> >> (my-list-with-some-elts 'a 'b 'c 'd) ; => (0 a 2 b 4 c d) > > I like the flexibility of the placeholder approach.  I'm not > sold on the extra parens used here -- I don't feel too strongly > about it, but it's inconsistent with how `apply-partially' is > called. The author has mentioned that the reason for being a macro with extra parentheses was the ability to work with `eldoc`: inside the inner pair of parentheses, we can look at parameters suggestion which is normally not possible with `apply-partially`. `applying-partially` is bit confusing given the name of the existing function. To differentiate it, can we name this macro differently? Like `any-partial-application`, `partially-apply-at_`, etc. -- Daanturo. From unknown Sun Jun 22 00:55:41 2025 X-Loop: help-debbugs@gnu.org Subject: bug#49316: Add apply-partially's right version Resent-From: Phil Sainty Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 05 Jul 2021 12:03: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 To: daanturo Cc: Michael Heerdegen , 49316@debbugs.gnu.org Received: via spool by 49316-submit@debbugs.gnu.org id=B49316.162548655830887 (code B ref 49316); Mon, 05 Jul 2021 12:03:02 +0000 Received: (at 49316) by debbugs.gnu.org; 5 Jul 2021 12:02:38 +0000 Received: from localhost ([127.0.0.1]:44324 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m0NJ8-00081t-1y for submit@debbugs.gnu.org; Mon, 05 Jul 2021 08:02:38 -0400 Received: from smtp-4.orcon.net.nz ([60.234.4.59]:36167) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m0NJ6-000800-N0 for 49316@debbugs.gnu.org; Mon, 05 Jul 2021 08:02:37 -0400 Received: from [10.253.37.70] (port=9235 helo=webmail.orcon.net.nz) by smtp-4.orcon.net.nz with esmtpa (Exim 4.90_1) (envelope-from ) id 1m0NJ1-0001Pl-UC; Tue, 06 Jul 2021 00:02:32 +1200 Received: from ip-116-251-162-85.kinect.net.nz ([116.251.162.85]) via [10.253.37.253] by webmail.orcon.net.nz with HTTP (HTTP/1.1 POST); Tue, 06 Jul 2021 00:02:31 +1200 MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Tue, 06 Jul 2021 00:02:31 +1200 From: Phil Sainty In-Reply-To: <03694a85-9f3c-78d8-d06c-8bd5c6fae297@gmail.com> References: <2315db79-00cf-b2f0-b5df-93cd53392292@gmail.com> <87r1ghr7d1.fsf@web.de> <5a08f089-3a19-d747-5098-4751c92a5b79@gmail.com> <875yxsxfit.fsf@web.de> <8b10e4966ad9a1f621b5d9a6b069c7c7@webmail.orcon.net.nz> <03694a85-9f3c-78d8-d06c-8bd5c6fae297@gmail.com> Message-ID: X-Sender: psainty@orcon.net.nz User-Agent: Orcon Webmail X-GeoIP: -- X-Spam_score: -2.9 X-Spam_score_int: -28 X-Spam_bar: -- X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) On 2021-07-05 16:29, daanturo wrote: > The author has mentioned that the reason for being a macro with extra > parentheses was the ability to work with `eldoc`: inside the inner pair > of parentheses, we can look at parameters suggestion which is normally > not possible with `apply-partially`. Thanks, I missed that. That makes sense. > `applying-partially` is bit confusing given the name of the existing > function. I agree, although I've failed to think of any alternative names that I think are good. -Phil From unknown Sun Jun 22 00:55:41 2025 X-Loop: help-debbugs@gnu.org Subject: bug#49316: Add apply-partially's right version Resent-From: Michael Heerdegen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 06 Jul 2021 04:34:01 +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 To: daanturo Cc: Phil Sainty , 49316@debbugs.gnu.org Received: via spool by 49316-submit@debbugs.gnu.org id=B49316.16255460013529 (code B ref 49316); Tue, 06 Jul 2021 04:34:01 +0000 Received: (at 49316) by debbugs.gnu.org; 6 Jul 2021 04:33:21 +0000 Received: from localhost ([127.0.0.1]:47033 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m0clt-0000ur-B3 for submit@debbugs.gnu.org; Tue, 06 Jul 2021 00:33:21 -0400 Received: from mout.web.de ([212.227.15.4]:39211) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m0clr-0000ue-FH for 49316@debbugs.gnu.org; Tue, 06 Jul 2021 00:33:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=dbaedf251592; t=1625545985; bh=gb8Hnu65Y7U1mfCkZS1+rz33bK0CnrKPhR1Pn15lavg=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To; b=rlTtVpvQfiTmKeZxsXtcZBSpX9kSwmA2EYizAQNUeokp0NwWILpVlhiEW9Pyj2NWI elBeLIBGgnoj2T86lx4V2tjnvDkdQtLrRcKj9ZW3t/8ZalgLtHi5BuVZRxVEIo4Ppk WnxoYj29+MYUpR4E2ZxWieAnVm5EVL6+BInSIV9k= X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 Received: from drachen.dragon ([88.66.201.45]) by smtp.web.de (mrweb004 [213.165.67.108]) with ESMTPSA (Nemesis) id 0Mh7qL-1ln3zs1Xij-00MJ8u; Tue, 06 Jul 2021 06:33:05 +0200 From: Michael Heerdegen References: <2315db79-00cf-b2f0-b5df-93cd53392292@gmail.com> <87r1ghr7d1.fsf@web.de> <5a08f089-3a19-d747-5098-4751c92a5b79@gmail.com> <875yxsxfit.fsf@web.de> <8b10e4966ad9a1f621b5d9a6b069c7c7@webmail.orcon.net.nz> <03694a85-9f3c-78d8-d06c-8bd5c6fae297@gmail.com> Date: Tue, 06 Jul 2021 06:33:04 +0200 In-Reply-To: <03694a85-9f3c-78d8-d06c-8bd5c6fae297@gmail.com> (daanturo@gmail.com's message of "Mon, 5 Jul 2021 11:29:15 +0700") Message-ID: <87lf6k2ha7.fsf@web.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:wSuOYeMltmXFxlFMxCu+T3tT4OKTggHSytwx20h20zw/yBtyI81 d0ulrN/fFUFbjeDIuoN9Vcs56oBRCfPdb8c2IIczwtnNuknOEa99z2970cOqRDhw20Aldoj dIo88PCme2/bOWn14BF5E+iyfvY8AQ/g3iP9qFqZSLCj0jRSZTmbEtShrKGCPH3ReP46EI6 z2qoQ/m8NgX9IBqww+MSw== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:gZwvlJ+jr8M=:QnUtxTlFeMGg5Hskf2ppu3 Pakjc7+vYTftnUnS1/FE99LuV4GCv1qf0DriTHXlyFYvj0+XEH+LHjtxYwdoVc1LfLEnHBNH1 aBt+6FlGIbRosqUhuGq9DUlaV9t2XjtrmHC2n7MXQqrzVorGAxx65jPpgHiYtwbOVYvLLH2Yg FGY1s99whq9MYHdECqKcBG4uRxtxTMgLjUIPC8OnBwFUIAHhAJHeBGnIz+OVf4epCGc0CrwyK kNHU5GlFn8uI3nei6vlBNMZyFEnJ1pSHvCjKg31juJpovHWM+waCBTUedCl8T2wDjjqep/HOU q0Z7E3t3wjczl42yLbeAr4YVf9+5yODPODGo6cdUC76LpXHx/93GaaG5nHVq0FFS7nhz+Np5N 9B7WwFmEPQMAY0OqOxzdwbYBP8MBMpjY7At0fqYPMpnp05Yt2FvHHdq1Q5HKFoYo4w1MMqeDQ j+2nou4KaPbc1Yd1Y3xMCVtp7fo3Sc0HjqnMPdhz/aA8VvJ/O7BWKE1GRfQMQpuZFdtVrBl1s iyvbn8jPKzKDkLgS2gVC1IgdKTIr8mdplL6V3QEEEr0QP6vRXA0pcCOK3S5Rbt5wrYASOCS7P 3W12Qju02TcBlpHAw0FYi33gGNAeU097DJi6O4jw1lp4rMtKle48inTS0LRSLf8WloVPnjwv+ bCimqv/wZoU6Ksc/nZZpYZH0CjsBvn+OjErgQqzyQswbJ/0rTWrDrdAlO1Z1apObNcid+gnAQ nr7/BhNoQUutu3rvQy46cQcSNxY2imjNPsEqHrChpJgRpXCQxfrxbU7GJxyLvceQzLHLWgF41 p42nX9uXA48Dlfoiar9Zfpt5N33ZcqWeXV5vJmAfrjKLjLlew0kV7L1Kah2JCqR3ZdR4mUQ6o OpYs8P2E5+UGzrmq+II6pgwe91ubQ3XqTPnd5tRN72A9dUBtXtFuuD2nGwqNBfhkmnDhDLdq1 eH05WqD3mfq9ED8v3Bd/XlqIcaEPo55o1NAASPVwexlzEAyQD9CSUeU6snETxlzGl65URQoEe STOLprBJdDOZAEwRLIYi9XQgRfZFL3SAGVvuVTGNpKdTW2n6QguXbRsve/5lJ8k6P1bXW9Phm N2dP7u9zl4HSsSTJSflIzW3B7lOKEPeQO4Il06TQK8FKECcC08J2QZslg== X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) daanturo writes: > The author has mentioned that the reason for being a macro with extra > parentheses was the ability to work with `eldoc`: inside the inner pair of > parentheses, we can look at parameters suggestion which is normally > not possible > with `apply-partially`. > > `applying-partially` is bit confusing given the name of the existing > function. > To differentiate it, can we name this macro differently? Like > `any-partial-application`, `partially-apply-at_`, etc. I don't insist on the name, I used just some random different name. There are several advantages of a macro here: the parameters can be processed at compile-time, generating slightly nicer code. And the programmer doesn't need to quote the _ symbol. But I agree that a function version would make sense, too. Michael. From unknown Sun Jun 22 00:55:41 2025 X-Loop: help-debbugs@gnu.org Subject: bug#49316: Add apply-partially's right version Resent-From: daanturo Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 07 Jul 2021 16:32: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 To: Michael Heerdegen Cc: 49316@debbugs.gnu.org Received: via spool by 49316-submit@debbugs.gnu.org id=B49316.162567546214327 (code B ref 49316); Wed, 07 Jul 2021 16:32:02 +0000 Received: (at 49316) by debbugs.gnu.org; 7 Jul 2021 16:31:02 +0000 Received: from localhost ([127.0.0.1]:53325 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m1ARx-0003ir-TT for submit@debbugs.gnu.org; Wed, 07 Jul 2021 12:31:02 -0400 Received: from mail-pf1-f169.google.com ([209.85.210.169]:39561) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m1ARv-0003iQ-Vg for 49316@debbugs.gnu.org; Wed, 07 Jul 2021 12:31:00 -0400 Received: by mail-pf1-f169.google.com with SMTP id b12so2668435pfv.6 for <49316@debbugs.gnu.org>; Wed, 07 Jul 2021 09:30:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=bcAVgS9USLIzIJZSPvfWs7PENGlZtzVfBL/7bQqEXxU=; b=Dwoe8KkdxNObPYEElEI+F02UmShyFC2BKpUN3vPnWb8fxjJcz3GZ7oBtBWueErGC6L FCc5GzmJ4ak0APTBhCgEkohVYwXLZxzlRv/UvIKlBnMMcOp6poHH2Gjml3qsD8iBcgTY UUOROVaLA5mMPIwYoQKntUwdXyvM53HnaPTEoOEJ/xfNXJSA+WhMClHY856D2EMRu5n3 KoVxsjiv6cZRu1A3HzI5SKpH4NlwHXDpw9bQJ976ypg5DScRzF7ZIQn51FrKw+oZk2SU Sfq608S5nGFUvIyrLAhgk5iXtHzsJhOJpi7YnH0yRbAkxYFnRZXPfSYbRgKrG/gngroB PsGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=bcAVgS9USLIzIJZSPvfWs7PENGlZtzVfBL/7bQqEXxU=; b=uHBnztp5Gqhsepd9RzlrvHlfL0JcdXla6VQKC+12I6ALLtaDHtf+n9Mbb7kNTsmcDE xiRpuZfRgXkPRSHzmLUfb1FSyfr/SIAnLMz/TovSixlgMjp/hoZaU36BDRdWL2PEag5d A7K0xsBftJFQiGUy+W3C8nvtbLyX/2FbjuKGIaevRGtkZcBARmd4F8kXbs/E1uI3udN0 UdfqZ4Sz6DkmEHOUiGf4Rii4QS5iuKSAqRDVkpOdKi8qwRcK8ie+P2rCBhfrAb1piAUn acxlBJq85a9hlDC0Ge7FprEi5FwBaF68713gc5Ryoj94V5TSdZi5slv2anQrKJx7efVX cekg== X-Gm-Message-State: AOAM533R52zGb5krl7hfJmk5hgXFlfIfPDXLFY50qX5W/UL+k386flKM McsUuvvLGhEjsI7frzia1ESSbk8LeA6/bg== X-Google-Smtp-Source: ABdhPJy9riDJTcbOKsE6YBQq5T/zewEAHWdTPTYILumGyjj7tIP7bssmXfYqJ2ORC4Lt/Q0mAe1Bpg== X-Received: by 2002:a62:5285:0:b029:2e9:e0d5:67dc with SMTP id g127-20020a6252850000b02902e9e0d567dcmr26123808pfb.79.1625675453679; Wed, 07 Jul 2021 09:30:53 -0700 (PDT) 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 l3sm6969559pju.57.2021.07.07.09.30.52 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 07 Jul 2021 09:30:53 -0700 (PDT) References: <2315db79-00cf-b2f0-b5df-93cd53392292@gmail.com> <87r1ghr7d1.fsf@web.de> <5a08f089-3a19-d747-5098-4751c92a5b79@gmail.com> <875yxsxfit.fsf@web.de> <8b10e4966ad9a1f621b5d9a6b069c7c7@webmail.orcon.net.nz> <03694a85-9f3c-78d8-d06c-8bd5c6fae297@gmail.com> <87lf6k2ha7.fsf@web.de> From: daanturo Message-ID: Date: Wed, 7 Jul 2021 23:30:51 +0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <87lf6k2ha7.fsf@web.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On 7/6/21 11:33 AM, Michael Heerdegen wrote: > I don't insist on the name, I used just some random different name. Apparently the macro you haved proposed is named `cut` in Scheme (although without inner parameters): https://www.gnu.org/software/guile/manual/html_node/SRFI_002d26.html And `-cut` in dash.el. -- Daanturo. From unknown Sun Jun 22 00:55:41 2025 X-Loop: help-debbugs@gnu.org Subject: bug#49316: Add apply-partially's right version Resent-From: Stefan Kangas Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 24 Oct 2021 06:56: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 To: Eli Zaretskii Cc: contovob@tcd.ie, daanturo , 49316@debbugs.gnu.org Received: via spool by 49316-submit@debbugs.gnu.org id=B49316.163505852416713 (code B ref 49316); Sun, 24 Oct 2021 06:56:02 +0000 Received: (at 49316) by debbugs.gnu.org; 24 Oct 2021 06:55:24 +0000 Received: from localhost ([127.0.0.1]:37756 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1meXPf-0004LT-In for submit@debbugs.gnu.org; Sun, 24 Oct 2021 02:55:24 -0400 Received: from mail-pl1-f181.google.com ([209.85.214.181]:41717) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1meXPS-0004Kz-Qr for 49316@debbugs.gnu.org; Sun, 24 Oct 2021 02:55:22 -0400 Received: by mail-pl1-f181.google.com with SMTP id e10so5701006plh.8 for <49316@debbugs.gnu.org>; Sat, 23 Oct 2021 23:55:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:in-reply-to:references:user-agent :mime-version:date:message-id:subject:to:cc :content-transfer-encoding; bh=4sMc0fxR3pBpvtb9Tt2zcEB3ggyBcjkW6K+rSCZQrPE=; b=n+gC6Dge2FbXvtALJ/oAAg/K0m4910UcXIIzlvucWBGLUjnMuzJTF6MR3/IK6jZqh1 A/1xb8u4p6/zbYGEzARNLBFmfnb/NICRHq8zrusxbTlrIKmzPHyHFiAtK5aJ+Va+1hNP H2vk7C9yvwkJy7g3LTwCuK9t8SGdiFvbBQcQgOOp/g+tdsOI4WJHWKcFJ0yDS62vm3jR fMGBhlGhv1QYfmca5Ck5MskAbLcYC6jY4BrrdqU96V30LKY48lmcobL4boPdQwlhbYk/ 8L423c5UC5RXDfy3IqhMBgKtNf0lbRuxSBdQtT9DavUxPgqgsFglJc0La1wl6N866SmP JMiQ== X-Gm-Message-State: AOAM532zL7ixBZ+Iy+ShRC7mdoXN0sh0orOAqwnRQM+lBjgnPrGAHrML wuAdFAvv2m//A+IMG+AKojm/NRyDEXO7OpTQfSI= X-Google-Smtp-Source: ABdhPJwEIG6jcX5tRyOmX9mNpwEXTiAt/au/lgs8RVDZyHbOzY3d7sWbKSJFEIWF/vmyPTwW28zDSBjD5x3rVBxbM6U= X-Received: by 2002:a17:90a:d917:: with SMTP id c23mr4760298pjv.133.1635058505024; Sat, 23 Oct 2021 23:55:05 -0700 (PDT) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Sat, 23 Oct 2021 23:55:04 -0700 From: Stefan Kangas In-Reply-To: <83lf6nj2u9.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 03 Jul 2021 10:03:58 +0300") 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> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Date: Sat, 23 Oct 2021 23:55:04 -0700 Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: base64 X-Spam-Score: 0.5 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.5 (/) RWxpIFphcmV0c2tpaSA8ZWxpekBnbnUub3JnPiB3cml0ZXM6DQoNCj4+IENjOiBjb250b3ZvYkB0 Y2QuaWUsIEVsaSBaYXJldHNraWkgPGVsaXpAZ251Lm9yZz4NCj4+IEZyb206IGRhYW50dXJvIDxk YWFudHVyb0BnbWFpbC5jb20+DQo+PiBEYXRlOiBGcmksIDIgSnVsIDIwMjEgMDk6NDk6MTkgKzA3 MDANCj4+DQo+PiBJIGhhdmUgcmVwbGFjZWQgdGhlIGV4YW1wbGVzOg0KPj4NCj4+DQo+PiAgwqDC oMKgwqDCoMKgwqDCoMKgIChkZWZhbGlhcyAnKioyIChhcHBseS1ycGFydGlhbGx5ICMnZXhwdCAy KQ0KPj4gIMKgwqDCoMKgwqDCoMKgwqDCoMKgwqAgIlJldHVybiBhcmd1bWVudCAqKiAyLiIpDQo+ PiAgwqDCoMKgwqDCoMKgwqDCoMKgIChkZWZhbGlhcyAnMioqIChhcHBseS1wYXJ0aWFsbHkgIydl eHB0IDIpDQo+PiAgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoCAiUmV0dXJuIDIgKiogYXJndW1lbnQu IikNCj4+ICDCoMKgwqDCoMKgwqDCoMKgwqAgKCoqMiAzKQ0KPj4gIMKgwqDCoMKgwqDCoMKgwqDC oMKgwqDCoMKgwqAgPT4gOQ0KPj4gIMKgwqDCoMKgwqDCoMKgwqDCoCAoMioqIDMpDQo+PiAgwqDC oMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoCA9PiA4DQo+DQo+IFRoYW5rcywgdGhlIHBhdGNoIExH VE0uDQoNCkl0IHNlZW1zIGxpa2UgbmVpdGhlciB0aGlzIG5vciBhbnkgb2YgdGhlIG90aGVyIHBh dGNoZXMgaW4gdGhpcyBidWcNCnJlcG9ydCB3ZXJlIGFwcGxpZWQuDQoNCkRvIHdlIGhhdmUgYSBj b3B5cmlnaHQgYXNzaWdubWVudCBmb3IgZGFhbnR1cm8gPGRhYW50dXJvQGdtYWlsLmNvbT4gb24N CmZpbGU/DQo= From unknown Sun Jun 22 00:55:41 2025 X-Loop: help-debbugs@gnu.org Subject: bug#49316: Add apply-partially's right version Resent-From: daanturo Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 24 Oct 2021 10:52:01 +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 To: Stefan Kangas , Eli Zaretskii Cc: contovob@tcd.ie, 49316@debbugs.gnu.org Received: via spool by 49316-submit@debbugs.gnu.org id=B49316.16350727131596 (code B ref 49316); Sun, 24 Oct 2021 10:52:01 +0000 Received: (at 49316) by debbugs.gnu.org; 24 Oct 2021 10:51:53 +0000 Received: from localhost ([127.0.0.1]:37977 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1meb6X-0000Pg-AP for submit@debbugs.gnu.org; Sun, 24 Oct 2021 06:51:53 -0400 Received: from mail-pj1-f46.google.com ([209.85.216.46]:39693) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1meb6S-0000PP-S0 for 49316@debbugs.gnu.org; Sun, 24 Oct 2021 06:51:51 -0400 Received: by mail-pj1-f46.google.com with SMTP id u6-20020a17090a3fc600b001a00250584aso9145796pjm.4 for <49316@debbugs.gnu.org>; Sun, 24 Oct 2021 03:51:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to:content-transfer-encoding; bh=AQJsF/hx6pFAUuDXYsISV5Rl+Jnwv9mXT9NT1mmnf5k=; b=m0pJCwGJxEh/xXOH97Lr99M7tNJCtMWSHzF3F9OwmgXV7fhwqQBjLUh0+1EkQofwED TUvmtdXFGyP6cVU1TFEYK3GHFaIWuX9atAk6aqYpAcPevES+z+O8laEtLt2daNujbH7J BlayY9zaB5AzDOJ/mfoVk9+JJgtwicOjc4RsScJ2rmiblDlekCpx9e6oSopfl6wawVB1 G80bpFhKa+YgJYaVTZCFVmNCx4EV+tNSV0Nv89hX/Fi2fCJtmXRHp9fLFRqn8fqJdLkS gyC2ImrwwmDlvT3yKfoBA+w+zsLRC7uQdW88Ql6vbPEyUli5VzpYDssQPzGDHyifpLP2 zqsA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=AQJsF/hx6pFAUuDXYsISV5Rl+Jnwv9mXT9NT1mmnf5k=; b=gG7QvEwT4d1tHHM95XP4caca6VQX86MifmtOhb7sidX4EI5bqN2kMh3pb+gqPUzj4/ 6it6LAoMXb/iKAPcqEu9ZbMmybghnNNlb6xhlggLC3iyBtvJ4JD1n8HIYNGZagfCuRye ZKGcG5GPVOauoNfKy5Vh2dByrZ/aG2eJz5xhkCZjPsQHqRtZw/naL4kMH5hKdZnngKLn 6A6aAL1YZHfYO8bqs0kppmH3PvAqmD5yPbaeRFlX12pj/cKgSEm3CGoREtrsLsbDlrlD 55drPtXUXmQTo59J3Cj4CKtD6fZwYgcIo2Y/P3ChKblGonE3AqpTXQYk9ZjRJbtpGiFQ PeaA== X-Gm-Message-State: AOAM530Tu2ZClG96ou3pi0YNRg/e4YVEmEgWCzq8UiFfmElUdX/RmnQu 0Q08qrcPTzoU8lT32Wv3N0U= X-Google-Smtp-Source: ABdhPJynwshvt88SB5ADK2+5QIj9FUYGnfZzccWAtPyGXGDFz4DMGEfPtD46pVC0aQR62758lN/UoA== X-Received: by 2002:a17:90b:4f84:: with SMTP id qe4mr27952357pjb.209.1635072702815; Sun, 24 Oct 2021 03:51:42 -0700 (PDT) Received: from [192.168.1.14] ([14.187.106.204]) by smtp.gmail.com with ESMTPSA id k14sm15443060pji.45.2021.10.24.03.51.40 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 24 Oct 2021 03:51:42 -0700 (PDT) Message-ID: Date: Sun, 24 Oct 2021 17:49:29 +0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.2.1 Content-Language: en-US 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> From: daanturo In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -0.1 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.1 (-) I have signed the copyright assignment. Can this be backported to Emacs 28? On 10/24/21 13:55, Stefan Kangas wrote: > Eli Zaretskii writes: > >>> Cc: contovob@tcd.ie, Eli Zaretskii >>> From: daanturo >>> Date: Fri, 2 Jul 2021 09:49:19 +0700 >>> >>> I have replaced the examples: >>> >>> >>>           (defalias '**2 (apply-rpartially #'expt 2) >>>             "Return argument ** 2.") >>>           (defalias '2** (apply-partially #'expt 2) >>>             "Return 2 ** argument.") >>>           (**2 3) >>>                => 9 >>>           (2** 3) >>>                => 8 >> Thanks, the patch LGTM. > It seems like neither this nor any of the other patches in this bug > report were applied. > > Do we have a copyright assignment for daanturo on > file? -- Daanturo. From unknown Sun Jun 22 00:55:41 2025 X-Loop: help-debbugs@gnu.org Subject: bug#49316: Add apply-partially's right version Resent-From: Stefan Kangas Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 24 Oct 2021 11:19: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 To: daanturo , Eli Zaretskii Cc: contovob@tcd.ie, 49316@debbugs.gnu.org Received: via spool by 49316-submit@debbugs.gnu.org id=B49316.16350743014544 (code B ref 49316); Sun, 24 Oct 2021 11:19:02 +0000 Received: (at 49316) by debbugs.gnu.org; 24 Oct 2021 11:18:21 +0000 Received: from localhost ([127.0.0.1]:37991 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mebW8-0001BC-Sr for submit@debbugs.gnu.org; Sun, 24 Oct 2021 07:18:21 -0400 Received: from mail-pf1-f182.google.com ([209.85.210.182]:37815) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mebW7-0001B1-Og for 49316@debbugs.gnu.org; Sun, 24 Oct 2021 07:18:20 -0400 Received: by mail-pf1-f182.google.com with SMTP id v193so1317636pfc.4 for <49316@debbugs.gnu.org>; Sun, 24 Oct 2021 04:18:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:in-reply-to:references:mime-version:date :message-id:subject:to:cc; bh=YKxjqHSHtb0lw212z5b5p4eHoWV5S8REeHt9Ed4ZMQg=; b=DaO+V4x8kGueDqpBXmaN6o8keYOU2mUkXIOUm82HkJJvLR+O9Hkq5LxNTFZDmqzuNV Tb/6KmNRqD3FjMiqOc3G4heqFjAfMpWpvcRKWsGD6sAt8Pwy0Ov4/dlpV6G2yD17dvdn iwlP3KD8yk+kNKAi+PGUdNlB8QHM/5Bc7k3Pj1EWzi8/AveZGbdDA9Vc+7P4AwWLdxVm M9ii/TxWaRRvTmtSrLhHPUZxZdgWhKbslu3+rqzc3XTyyRyacFQjOXmups6DB5fKOAAX eprsnpZfwHcf1xYY1IKyvOIyY2QGGCPm81RI6Gf+3nHMVd6Ds5oq/e+TDTlnKlexTpz4 b6ww== X-Gm-Message-State: AOAM532ip919ChXNAQIE0YN6YykDTMkBqd0xow0ImuDfEFO6xR5BrlU7 9P/0sPyyfzHsVN1oigpMN4rIBzAMSTEzHA7IG8c= X-Google-Smtp-Source: ABdhPJxL7GYrzPNBrS6RXWk5xbQ1SwKmL248ktxNbu0NR2XdetpZue2WtHSzZbbnidl/py373F6p+Xlczwvh9WrBjwY= X-Received: by 2002:a63:b958:: with SMTP id v24mr638619pgo.114.1635074293963; Sun, 24 Oct 2021 04:18:13 -0700 (PDT) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Sun, 24 Oct 2021 04:18:13 -0700 From: Stefan Kangas In-Reply-To: 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> MIME-Version: 1.0 Date: Sun, 24 Oct 2021 04:18:13 -0700 Message-ID: Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.5 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.5 (/) daanturo writes: > I have signed the copyright assignment. Excellent, thanks for clarifying that. > Can this be backported to Emacs 28? That's for Eli or Lars to say. From unknown Sun Jun 22 00:55:41 2025 X-Loop: help-debbugs@gnu.org Subject: bug#49316: Add apply-partially's right version Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 24 Oct 2021 12:15:01 +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 To: Stefan Kangas Cc: contovob@tcd.ie, daanturo@gmail.com, 49316@debbugs.gnu.org Received: via spool by 49316-submit@debbugs.gnu.org id=B49316.163507764326266 (code B ref 49316); Sun, 24 Oct 2021 12:15:01 +0000 Received: (at 49316) by debbugs.gnu.org; 24 Oct 2021 12:14:03 +0000 Received: from localhost ([127.0.0.1]:38042 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mecO2-0006pW-K7 for submit@debbugs.gnu.org; Sun, 24 Oct 2021 08:14:02 -0400 Received: from eggs.gnu.org ([209.51.188.92]:41776) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mecO0-0006oy-At for 49316@debbugs.gnu.org; Sun, 24 Oct 2021 08:14:00 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:32844) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mecNu-000508-Ja; Sun, 24 Oct 2021 08:13:54 -0400 Received: from [87.69.77.57] (port=2022 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mecNu-0007zO-4g; Sun, 24 Oct 2021 08:13:54 -0400 Date: Sun, 24 Oct 2021 15:13:44 +0300 Message-Id: <835ytm4o3r.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: (message from Stefan Kangas on Sun, 24 Oct 2021 04:18:13 -0700) 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> X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Stefan Kangas > Date: Sun, 24 Oct 2021 04:18:13 -0700 > Cc: contovob@tcd.ie, 49316@debbugs.gnu.org > > daanturo writes: > > > I have signed the copyright assignment. > > Excellent, thanks for clarifying that. > > > Can this be backported to Emacs 28? > > That's for Eli or Lars to say. It's too late for the release branch. 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. From unknown Sun Jun 22 00:55:41 2025 X-Loop: help-debbugs@gnu.org Subject: bug#49316: Add apply-partially's right version Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 24 Oct 2021 13:39: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 To: Stefan Kangas Cc: contovob@tcd.ie, Eli Zaretskii , daanturo , 49316@debbugs.gnu.org Received: via spool by 49316-submit@debbugs.gnu.org id=B49316.163508273227181 (code B ref 49316); Sun, 24 Oct 2021 13:39:02 +0000 Received: (at 49316) by debbugs.gnu.org; 24 Oct 2021 13:38:52 +0000 Received: from localhost ([127.0.0.1]:38201 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1medi8-00074L-3I for submit@debbugs.gnu.org; Sun, 24 Oct 2021 09:38:52 -0400 Received: from quimby.gnus.org ([95.216.78.240]:44328) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1medi6-000744-1S for 49316@debbugs.gnu.org; Sun, 24 Oct 2021 09:38:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=h6hMs8MdB/Vp7lHjPkz2tzLaz3d1JmYWS0EodJ4n3Vo=; b=mLk7cefyHV2Fx8CEZWlNAwloHU 9X1Z+8Bu9FjZ5lHTlXrrYJoFLf2l/rWT4+VS4Nq0goHyt/OnV1s8OoQ8RZU1RPWgQYmC6UhkUeUSc fknjAX7XEHa1r4/b8cmV7UHNTO/7/Fdrs1QEHOV07fi9HWHCDPsi0mRISV7hLAmw/RbY=; Received: from [84.212.220.105] (helo=elva) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1medhx-0007Yz-2r; Sun, 24 Oct 2021 15:38:43 +0200 From: Lars Ingebrigtsen 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> Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAgMAAAAqbBEUAAAAAXNSR0IArs4c6QAAAAlQTFRF IB0euqGL////HT05FwAAAAFiS0dEAmYLfGQAAAAJcEhZcwAACxIAAAsSAdLdfvwAAAAHdElNRQfl ChgNIBo1fgnLAAAAM0lEQVQoz2NgGMlAACdHBJnDglOGRiAA2R4RsNugXFGQFKsDhMMYCgQhMHUg Hh3cRhkAAC63BDwjw/d4AAAAWmVYSWZNTQAqAAAACAAFARIAAwAAAAEAAQAAARoABQAAAAEAAABK ARsABQAAAAEAAABSASgAAwAAAAEAAgAAAhMAAwAAAAEAAQAAAAAAAAAAAEgAAAABAAAASAAAAAEf Uvc0AAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDIxLTEwLTI0VDEzOjMyOjI2KzAwOjAw4vns9wAAACV0 RVh0ZGF0ZTptb2RpZnkAMjAyMS0xMC0yNFQxMzozMjoyNiswMDowMJOkVEsAAAAXdEVYdGV4aWY6 WUNiQ3JQb3NpdGlvbmluZwAxrA+AYwAAADh0RVh0aWNjOmNvcHlyaWdodABDb3B5cmlnaHQgKGMp IDE5OTggSGV3bGV0dC1QYWNrYXJkIENvbXBhbnn5V3k3AAAAIXRFWHRpY2M6ZGVzY3JpcHRpb24A c1JHQiBJRUM2MTk2Ni0yLjFXrdpHAAAAJnRFWHRpY2M6bWFudWZhY3R1cmVyAElFQyBodHRwOi8v d3d3LmllYy5jaBx/AEwAAAA3dEVYdGljYzptb2RlbABJRUMgNjE5NjYtMi4xIERlZmF1bHQgUkdC IGNvbG91ciBzcGFjZSAtIHNSR0JEU0ipAAAAAElFTkSuQmCC Date: Sun, 24 Oct 2021 15:38:40 +0200 In-Reply-To: (Stefan Kangas's message of "Sat, 23 Oct 2021 23:55:04 -0700") Message-ID: <87lf2i8rvj.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Stefan Kangas writes: > Do we have a copyright assignment for daanturo on > file? Yup. Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Stefan Kangas writes: > Do we have a copyright assignment for daanturo on > file? Yup. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From unknown Sun Jun 22 00:55:41 2025 X-Loop: help-debbugs@gnu.org Subject: bug#49316: Add apply-partially's right version Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 24 Oct 2021 13:48: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 To: Eli Zaretskii Cc: contovob@tcd.ie, Stefan Kangas , daanturo@gmail.com, 49316@debbugs.gnu.org Received: via spool by 49316-submit@debbugs.gnu.org id=B49316.163508323327930 (code B ref 49316); Sun, 24 Oct 2021 13:48:02 +0000 Received: (at 49316) by debbugs.gnu.org; 24 Oct 2021 13:47:13 +0000 Received: from localhost ([127.0.0.1]:38205 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1medqC-0007GQ-UZ for submit@debbugs.gnu.org; Sun, 24 Oct 2021 09:47:13 -0400 Received: from quimby.gnus.org ([95.216.78.240]:44380) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1medqA-0007GA-Ri for 49316@debbugs.gnu.org; Sun, 24 Oct 2021 09:47:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=jd67cL+FzHbCCI+CD1rYcXVi/JLTc2JlfKkqQaZasaU=; b=hSjhKbzgAnSJi/ees1gyqHfs27 QlbENk5zvKVA6nzzfVNJBd2nHHSfdkN5Ter3q1oy0z9UVeZ+XTeWxRodqcP7mAg8XkbizYZ/7NCil nbtw+7ZEnFbNHK8Ib/A+8Sp7tRW6k6QHpAQTL1sNDwj61fhNN6yKCoRFwK2TU4Lxr3mk=; Received: from [84.212.220.105] (helo=elva) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1medq1-0007dp-5U; Sun, 24 Oct 2021 15:47:04 +0200 From: Lars Ingebrigtsen 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> Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAgMAAAAqbBEUAAAAAXNSR0IArs4c6QAAAAlQTFRF IB0euqGL////HT05FwAAAAFiS0dEAmYLfGQAAAAJcEhZcwAACxIAAAsSAdLdfvwAAAAHdElNRQfl ChgNIBo1fgnLAAAAM0lEQVQoz2NgGMlAACdHBJnDglOGRiAA2R4RsNugXFGQFKsDhMMYCgQhMHUg Hh3cRhkAAC63BDwjw/d4AAAAWmVYSWZNTQAqAAAACAAFARIAAwAAAAEAAQAAARoABQAAAAEAAABK ARsABQAAAAEAAABSASgAAwAAAAEAAgAAAhMAAwAAAAEAAQAAAAAAAAAAAEgAAAABAAAASAAAAAEf Uvc0AAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDIxLTEwLTI0VDEzOjMyOjI2KzAwOjAw4vns9wAAACV0 RVh0ZGF0ZTptb2RpZnkAMjAyMS0xMC0yNFQxMzozMjoyNiswMDowMJOkVEsAAAAXdEVYdGV4aWY6 WUNiQ3JQb3NpdGlvbmluZwAxrA+AYwAAADh0RVh0aWNjOmNvcHlyaWdodABDb3B5cmlnaHQgKGMp IDE5OTggSGV3bGV0dC1QYWNrYXJkIENvbXBhbnn5V3k3AAAAIXRFWHRpY2M6ZGVzY3JpcHRpb24A c1JHQiBJRUM2MTk2Ni0yLjFXrdpHAAAAJnRFWHRpY2M6bWFudWZhY3R1cmVyAElFQyBodHRwOi8v d3d3LmllYy5jaBx/AEwAAAA3dEVYdGljYzptb2RlbABJRUMgNjE5NjYtMi4xIERlZmF1bHQgUkdC IGNvbG91ciBzcGFjZSAtIHNSR0JEU0ipAAAAAElFTkSuQmCC Date: Sun, 24 Oct 2021 15:47:00 +0200 In-Reply-To: <835ytm4o3r.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 24 Oct 2021 15:13:44 +0300") Message-ID: <87fssq8rhn.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: 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. Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) 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. 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? -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From unknown Sun Jun 22 00:55:41 2025 X-Loop: help-debbugs@gnu.org Subject: bug#49316: Add apply-partially's right version Resent-From: Stefan Kangas Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 24 Oct 2021 14:11:01 +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 To: Lars Ingebrigtsen , Eli Zaretskii Cc: contovob@tcd.ie, daanturo@gmail.com, 49316@debbugs.gnu.org, Stefan Monnier Received: via spool by 49316-submit@debbugs.gnu.org id=B49316.163508464432483 (code B ref 49316); Sun, 24 Oct 2021 14:11:01 +0000 Received: (at 49316) by debbugs.gnu.org; 24 Oct 2021 14:10:44 +0000 Received: from localhost ([127.0.0.1]:40458 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1meeCy-0008Rr-5T for submit@debbugs.gnu.org; Sun, 24 Oct 2021 10:10:44 -0400 Received: from mail-pg1-f170.google.com ([209.85.215.170]:41665) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1meeCw-0008Rf-SY for 49316@debbugs.gnu.org; Sun, 24 Oct 2021 10:10:43 -0400 Received: by mail-pg1-f170.google.com with SMTP id 83so2051511pgc.8 for <49316@debbugs.gnu.org>; Sun, 24 Oct 2021 07:10:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:in-reply-to:references:mime-version:date :message-id:subject:to:cc; bh=DJ0xiu7C9UHIJDqh49jf2UXFQxVtrL/J9t2M59RdqRU=; b=iwsLXco7IlnGSdW64DjvYE4etg+DTYmE1S2JfRJdCk7B0n6iKIC2WwWM1a0qRX8p9U I5znNTrxY1Adk6mNbHyiXgwXtjFEnQ25Mjc1IbLV7/4wRW/6RP6m2gJcbco3etRK9WU/ 5ayn42+HGrvyq8cJjoFiDTUCGxbZAd/u4YvoiC7s+AAwuowNILSBiZjXUH3ofK6/7yIL /nm0DWXz9B2Ja+AOezV/MVm0naiqc3vh1uPTpZmJdKF+SyDkLkr4qoGJ5WYvpZwwMLXu 84aQTRE8lRivCNMezYPflqoxjB+5xWYpUzJlMWH41be4Xhj5rNEdJzTwXnOZ/um/7pBo /GMQ== X-Gm-Message-State: AOAM5336MjZ+OZ2mBoVGjPgKs4mt1OL5JDY0z5jnlV/8Dw4s2aGbPWAB ShRt9YEIP7e8VdqYqRAggY8ZlTUxMhbbB3AWMk72fpY0qZI= X-Google-Smtp-Source: ABdhPJzZ2lVGG/H5fxaYM9/O2N9D75UMhdgti4WGY7KbCKAx8N1C9EFtNDol1CBuIVtgBrOWoBMjbxRgKkG4LyI5eOc= X-Received: by 2002:a05:6a00:244d:b0:44d:c279:5155 with SMTP id d13-20020a056a00244d00b0044dc2795155mr12483131pfj.0.1635084637157; Sun, 24 Oct 2021 07:10:37 -0700 (PDT) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Sun, 24 Oct 2021 07:10:36 -0700 From: Stefan Kangas In-Reply-To: <87fssq8rhn.fsf@gnus.org> 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> MIME-Version: 1.0 Date: Sun, 24 Oct 2021 07:10:36 -0700 Message-ID: Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.5 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.5 (/) Lars Ingebrigtsen writes: > 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. > > 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? I don't think function currying (a.k.a. partial application) is a weird trick, but I'm also not sure how important it is in Emacs Lisp given that we prefer writing code in an imperative style. And we can just create a lambda instead; it is slightly more verbose but also slightly more familiar. I've personally missed this a couple of times though, so I definitely wouldn't mind if it was added. From unknown Sun Jun 22 00:55:41 2025 X-Loop: help-debbugs@gnu.org Subject: bug#49316: Add apply-partially's right version 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 To: Lars Ingebrigtsen Cc: contovob@tcd.ie, Eli Zaretskii , Stefan Kangas , daanturo@gmail.com, 49316@debbugs.gnu.org Received: via spool by 49316-submit@debbugs.gnu.org id=B49316.16350857071743 (code B ref 49316); Sun, 24 Oct 2021 14:29:02 +0000 Received: (at 49316) by debbugs.gnu.org; 24 Oct 2021 14:28:27 +0000 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 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 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) 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== 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) From: Stefan Monnier 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> Date: Sun, 24 Oct 2021 10:28:14 -0400 In-Reply-To: <87fssq8rhn.fsf@gnus.org> (Lars Ingebrigtsen's message of "Sun, 24 Oct 2021 15:47:00 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.786 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain KAM_WEIRDTRICK1 1.5 Huge family of spam that uses the word weird to grab attention X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) 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 From unknown Sun Jun 22 00:55:41 2025 X-Loop: help-debbugs@gnu.org Subject: bug#49316: Add apply-partially's right version Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 25 Oct 2021 12:52: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 To: Stefan Monnier Cc: contovob@tcd.ie, Eli Zaretskii , Stefan Kangas , daanturo@gmail.com, 49316@debbugs.gnu.org Received: via spool by 49316-submit@debbugs.gnu.org id=B49316.163516627112640 (code B ref 49316); Mon, 25 Oct 2021 12:52:02 +0000 Received: (at 49316) by debbugs.gnu.org; 25 Oct 2021 12:51:11 +0000 Received: from localhost ([127.0.0.1]:41862 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mezRX-0003Ho-Em for submit@debbugs.gnu.org; Mon, 25 Oct 2021 08:51:11 -0400 Received: from quimby.gnus.org ([95.216.78.240]:55060) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mezRV-0003HY-QC for 49316@debbugs.gnu.org; Mon, 25 Oct 2021 08:51:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=Sfr9gEdcdoxaAOpj80ljql2g79wOL06+WgeaEin1iws=; b=CHfGiLT+/dgvkPz+lE8yuGkg/R S6s/rSB4gwkEeOXGMeQe11yrcY8EE2wqO8xxg6wdDdyU4zn1VBvFWXFA7kBjSUPhlF43p/ETeint1 npMq395yeObz6HPI5D2v4EkbWaO0nZ0KM9woyIAgD8so87ygB5r+FTJa10VgRXhgOI/4=; Received: from [84.212.220.105] (helo=elva) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mezRK-0001AO-BT; Mon, 25 Oct 2021 14:51:01 +0200 From: Lars Ingebrigtsen 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> X-Now-Playing: Magnus Granberg & Skogen's _Let Pass My Weary Guiltless Ghost_: "Extract from 'Let Pass...' FOR STREAMING" Date: Mon, 25 Oct 2021 14:50:57 +0200 In-Reply-To: (Stefan Monnier's message of "Sun, 24 Oct 2021 10:28:14 -0400") Message-ID: <875ytl1d5a.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Stefan Monnier writes: > 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)) Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Stefan Monnier writes: > 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)) The advantage is that the first form looks more mysterious and you can use words like "currying" to sound smarter. :-) > `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. I agree. So I think the conclusion here is that we don't want to add apply-rpartially to Emacs core -- the people that prefer this style will find more complete coverage in dash.el (which is on GNU ELPA). So I'm closing this bug report. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Mon Oct 25 08:51:20 2021 Received: (at control) by debbugs.gnu.org; 25 Oct 2021 12:51:21 +0000 Received: from localhost ([127.0.0.1]:41865 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mezRg-0003IG-Mc for submit@debbugs.gnu.org; Mon, 25 Oct 2021 08:51:20 -0400 Received: from quimby.gnus.org ([95.216.78.240]:55080) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mezRf-0003Hx-2Y for control@debbugs.gnu.org; Mon, 25 Oct 2021 08:51:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Subject:From:To:Message-Id:Date:Sender:Reply-To:Cc: MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=lvdv/zCfMQPyE6BIJxxnwnCs2x0DgC0NpVxdHuxMqQY=; b=TXbqIh4V0+XiTFv/f0D4WqomjP 70+/FVCLgfn8S+2cvp9FCppp3GZXUZdlRp6qfXlFcUjk17rAryDIlKyTrZ5JK2cPfnQfDqhTeYcuu DvtpJq7gPdQJLv/FGpWhI4iaBGw+Wb6i6muPSuLh6gP6YJXZ98Qn5uyByKiCsi6vUNE4=; Received: from [84.212.220.105] (helo=elva) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mezRW-0001Al-Un for control@debbugs.gnu.org; Mon, 25 Oct 2021 14:51:13 +0200 Date: Mon, 25 Oct 2021 14:51:10 +0200 Message-Id: <874k951d4x.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #49316 X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: tags 49316 wontfix close 49316 quit Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) tags 49316 wontfix close 49316 quit