From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: daanturo Newsgroups: gmane.emacs.bugs Subject: bug#49316: Add apply-partially's right version Date: Fri, 2 Jul 2021 09:49:19 +0700 Message-ID: <27c5c6c9-32d7-0b9a-b883-4f28167ec25c@gmail.com> References: <2315db79-00cf-b2f0-b5df-93cd53392292@gmail.com> <87czs2faas.fsf@tcd.ie> <834kddlvpg.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------BB301AE7B914055C3B749020" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24793"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 Cc: contovob@tcd.ie To: 49316@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jul 02 04:50:10 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lz9Fq-0006Hw-Qg for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 02 Jul 2021 04:50:10 +0200 Original-Received: from localhost ([::1]:43572 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lz9Fp-0000wx-O2 for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 01 Jul 2021 22:50:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:60622) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lz9Fj-0000vB-HE for bug-gnu-emacs@gnu.org; Thu, 01 Jul 2021 22:50:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:50585) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lz9Fi-00072a-5G for bug-gnu-emacs@gnu.org; Thu, 01 Jul 2021 22:50:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lz9Fh-0005fK-UA for bug-gnu-emacs@gnu.org; Thu, 01 Jul 2021 22:50:01 -0400 X-Loop: help-debbugs@gnu.org 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 Original-Received: via spool by 49316-submit@debbugs.gnu.org id=B49316.162519418221748 (code B ref 49316); Fri, 02 Jul 2021 02:50:01 +0000 Original-Received: (at 49316) by debbugs.gnu.org; 2 Jul 2021 02:49:42 +0000 Original-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 Original-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 Original-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) Original-Received: from ?IPv6:2402:800:630f:53b:ee3a:5256:1634:1e03? ([2402:800:630f:53b:ee3a:5256:1634:1e03]) by smtp.gmail.com with ESMTPSA id 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) In-Reply-To: <834kddlvpg.fsf@gnu.org> Content-Language: en-US X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:209296 Archived-At: 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--