From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Gemini Lasswell Newsgroups: gmane.emacs.bugs Subject: bug#31052: 26.0.91; Improve documentation of inline-letevals Date: Tue, 03 Apr 2018 17:33:31 -0700 Message-ID: <87a7uj24kk.fsf@runbox.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: blaine.gmane.org 1522801987 28130 195.159.176.226 (4 Apr 2018 00:33:07 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 4 Apr 2018 00:33:07 +0000 (UTC) To: 31052@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Apr 04 02:33:03 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f3WMI-0007Do-Pq for geb-bug-gnu-emacs@m.gmane.org; Wed, 04 Apr 2018 02:33:03 +0200 Original-Received: from localhost ([::1]:47917 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f3WOO-00020c-4A for geb-bug-gnu-emacs@m.gmane.org; Tue, 03 Apr 2018 20:35:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53067) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f3WOH-00020E-Hz for bug-gnu-emacs@gnu.org; Tue, 03 Apr 2018 20:35:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f3WOE-0008WM-DR for bug-gnu-emacs@gnu.org; Tue, 03 Apr 2018 20:35:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:57796) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f3WOE-0008W7-8y for bug-gnu-emacs@gnu.org; Tue, 03 Apr 2018 20:35:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1f3WOE-0006bC-0j for bug-gnu-emacs@gnu.org; Tue, 03 Apr 2018 20:35:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Gemini Lasswell Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 04 Apr 2018 00:35:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 31052 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.152280205025302 (code B ref -1); Wed, 04 Apr 2018 00:35:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 4 Apr 2018 00:34:10 +0000 Original-Received: from localhost ([127.0.0.1]:37460 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f3WNN-0006a1-Lu for submit@debbugs.gnu.org; Tue, 03 Apr 2018 20:34:09 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:33719) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f3WNL-0006Zp-FR for submit@debbugs.gnu.org; Tue, 03 Apr 2018 20:34:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f3WNF-00080s-1v for submit@debbugs.gnu.org; Tue, 03 Apr 2018 20:34:02 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:35346) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1f3WNE-00080n-UG for submit@debbugs.gnu.org; Tue, 03 Apr 2018 20:34:00 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52922) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f3WND-0001ju-Dl for bug-gnu-emacs@gnu.org; Tue, 03 Apr 2018 20:34:00 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f3WNA-0007zK-AF for bug-gnu-emacs@gnu.org; Tue, 03 Apr 2018 20:33:59 -0400 Original-Received: from aibo.runbox.com ([91.220.196.211]:41200) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f3WN9-0007yM-Sa for bug-gnu-emacs@gnu.org; Tue, 03 Apr 2018 20:33:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=runbox.com; s=rbselector1; h=Content-Type:MIME-Version:Message-ID:Date:Subject:To:From; bh=6kJKC4lh4GHRJKstGPZGO7wLnP+UBCuAEuPhOD7gB9Q=; b=npCFkMe9FJnZk0QN/PAhkSYKV D6SLZ4RblkiFq25vjBi1NFks3oTD6u7QFP//DgMoYWYLNdJ/zIx0cdw3ZcBNgrfz9mSBzy98mPlIi 1pO//kwSmZKnW1QRlzhZb5htxJ6wtdq9ZznVKI9LERkvFnOLFtCeJ9LzKl9BhkE+1YyZmZoeXXUyJ WvC1dVk3qbF2pEcaotgmMVP67beeEZcHtCZC9ljQOmR+z8po2dn0UJv7W+TjNtP2GE33G/zwtsD2h TPPPz01h28nXuuhKfS0U44g3xssg7vnzWs9B3hXZp/E4tUeHejzkAPK2392p4XF1/qu1FHx46SeN2 xFdLvSUew==; Original-Received: from [10.9.9.210] (helo=mailfront10.runbox.com) by mailtransmit03.runbox with esmtp (Exim 4.86_2) (envelope-from ) id 1f3WN8-0000fY-17 for bug-gnu-emacs@gnu.org; Wed, 04 Apr 2018 02:33:54 +0200 Original-Received: from c-24-22-244-161.hsd1.wa.comcast.net ([24.22.244.161] helo=chinook) by mailfront10.runbox.com with esmtpsa (uid:179284 ) (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) id 1f3WMu-0002hJ-B4 for bug-gnu-emacs@gnu.org; Wed, 04 Apr 2018 02:33:40 +0200 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:144872 Archived-At: --=-=-= Content-Type: text/plain I just got acquainted with inline-letevals and found its description in the Elisp manual confusing because the purpose of the macro is not stated, and it is described as similar to 'let' without mention of an important difference in what happens to the elements of the bindings list which are symbols. Here's a patch to functions.texi where I've attempted to clarify the description. --=-=-= Content-Type: text/plain Content-Disposition: inline; filename=0001-Improve-documentation-of-inline-letevals.patch >From c1214913731b37c0444f8953a9b2a7619f22b2a9 Mon Sep 17 00:00:00 2001 From: Gemini Lasswell Date: Tue, 3 Apr 2018 13:12:15 -0700 Subject: [PATCH] Improve documentation of inline-letevals * doc/lispref/functions.texi (Defining Functions): Clarify what 'inline-letevals' is used for and how it differs from 'let'. --- doc/lispref/functions.texi | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/doc/lispref/functions.texi b/doc/lispref/functions.texi index 78372a8a10..a6187eb628 100644 --- a/doc/lispref/functions.texi +++ b/doc/lispref/functions.texi @@ -714,15 +714,19 @@ Defining Functions @end defmac @defmac inline-letevals (bindings@dots{}) body@dots{} -This is similar to @code{let} (@pxref{Local Variables}): it sets up -local variables as specified by @var{bindings}, and then evaluates -@var{body} with those bindings in effect. Each element of -@var{bindings} should be either a symbol or a list of the form -@w{@code{(@var{var} @var{expr})}}; the result is to evaluate -@var{expr} and bind @var{var} to the result. The tail of -@var{bindings} can be either @code{nil} or a symbol which should hold -a list of arguments, in which case each argument is evaluated, and the -symbol is bound to the resulting list. +Execute @var{body} in the context of @var{bindings}. This provides a +convenient way to ensure that the arguments to an inlined function are +evaluated exactly once, as well as to create local variables. Each +element of @var{bindings} should be either a symbol or a list of the +form @w{@code{(@var{var} @var{expr})}}. Elements of the form +@w{@code{(@var{var} @var{expr})}} work as in @code{let} (@pxref{Local +Variables}) to set up local variables by binding each symbol @var{var} +to the result of evaluating @var{expr}. When an element of +@var{bindings} is just a symbol @var{var}, the result of evaluating +@var{var} is re-bound to @var{var}. The tail of @var{bindings} can be +either @code{nil} or a symbol which should hold a list of arguments, +in which case each argument is evaluated, and the symbol is bound to +the resulting list. @end defmac @defmac inline-const-p expression -- 2.15.0 --=-=-=--