From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Alex Newsgroups: gmane.emacs.bugs Subject: bug#25154: 25.1; Bindings in cl-letf are in reverse order Date: Sat, 10 Dec 2016 13:52:34 -0600 Message-ID: <87zik3wohp.fsf@gmail.com> References: <8737hwllow.fsf@gmail.com> <83zik4fdug.fsf@gnu.org> <87bmwjy80b.fsf@gmail.com> <838trnfxlv.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1481399595 22022 195.159.176.226 (10 Dec 2016 19:53:15 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 10 Dec 2016 19:53:15 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) Cc: 25154@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Dec 10 20:53:12 2016 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 1cFnhl-0004uP-FF for geb-bug-gnu-emacs@m.gmane.org; Sat, 10 Dec 2016 20:53:09 +0100 Original-Received: from localhost ([::1]:52916 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cFnhp-00054v-HQ for geb-bug-gnu-emacs@m.gmane.org; Sat, 10 Dec 2016 14:53:13 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42343) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cFnhi-00054j-Vq for bug-gnu-emacs@gnu.org; Sat, 10 Dec 2016 14:53:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cFnhe-0000xM-4y for bug-gnu-emacs@gnu.org; Sat, 10 Dec 2016 14:53:07 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:50107) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cFnhe-0000xH-1R for bug-gnu-emacs@gnu.org; Sat, 10 Dec 2016 14:53:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cFnhd-0007wA-QW for bug-gnu-emacs@gnu.org; Sat, 10 Dec 2016 14:53:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Alex Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 10 Dec 2016 19:53:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25154 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: notabug Original-Received: via spool by 25154-submit@debbugs.gnu.org id=B25154.148139956430481 (code B ref 25154); Sat, 10 Dec 2016 19:53:01 +0000 Original-Received: (at 25154) by debbugs.gnu.org; 10 Dec 2016 19:52:44 +0000 Original-Received: from localhost ([127.0.0.1]:37273 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cFnhM-0007vZ-2Q for submit@debbugs.gnu.org; Sat, 10 Dec 2016 14:52:44 -0500 Original-Received: from mail-io0-f177.google.com ([209.85.223.177]:34952) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cFnhK-0007vK-3z for 25154@debbugs.gnu.org; Sat, 10 Dec 2016 14:52:42 -0500 Original-Received: by mail-io0-f177.google.com with SMTP id h30so112006984iod.2 for <25154@debbugs.gnu.org>; Sat, 10 Dec 2016 11:52:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=2o5+4muqmC8bGT4j0ISTRZaYSmNGFTi1sfNa8TTsTa8=; b=S0xojpw7W9pfWwmGz0bMgl2EyPv0lKMsdN2/De+65kVGMLOymR0X7AtDAetNJE2koO ofa1/OvCNBzlOt0oOuDdZBIzIgLeb6urrbRSBaLN63TrM57Zp2H/ScnhghaoydfRGHys 0InwplDi6zJUzYTsAeMsg4rt+0aKosRE7kvzWJEOjSLlpWNLXk8JMveBoZfo8azocT5s K+h3MwJvkkfVy+ndZnpcswgMZ1AUVUaLsej9mMcL2GitmjiuAbDoMEOLuB/iYzJ8okX/ HSqMeW6BI4vvM2d0I6t1DJBy6w5xJCdX4V5c8UXrxSlQPtxyLMah0MoJ8Ikr3GrNqVCm p87Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=2o5+4muqmC8bGT4j0ISTRZaYSmNGFTi1sfNa8TTsTa8=; b=dxoLWscP2VYUmM5Md9xgAyrzmoSMIHXlHtwAEn7nWaTCRBks24iARsc7ItjO9v/J9K CNA7sXJbVnv23wC5y/jCNiSZJCosMftYXFlZC+lA3kKqEP5JFr+Io3lthRrghMxuwhlJ 9p9SU1npxixXzFejGsnqIfxSseFgzIo+jB81+WrbobURo/Y9AKbtBhggNF4bupGhsN76 AKkoJjubi2oiNyiEfr0rYMdT0eXvu3DZ0keVdn/2CpKxJpuuO6AKfGmrXGnK33NXK/DP Ltd+8OqejYH6QyXaGl8VW2PtAZp4P5090L4xEGNL4H6M+qgJbJYPM1lp0TlbGHmDWWKY p5eA== X-Gm-Message-State: AKaTC00uVHlaU9KQk+bq1AYdD3jKfc9be2HCKdCZd8Jt50Qg3kOSYaEM1TlqdwmxCnH3DQ== X-Received: by 10.36.73.156 with SMTP id e28mr3865710itd.49.1481399556424; Sat, 10 Dec 2016 11:52:36 -0800 (PST) Original-Received: from lylat (S01061859339e9903.ss.shawcable.net. [174.2.107.88]) by smtp.gmail.com with ESMTPSA id b196sm16806351ioe.16.2016.12.10.11.52.35 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 10 Dec 2016 11:52:35 -0800 (PST) In-Reply-To: <838trnfxlv.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 10 Dec 2016 20:27:40 +0200") 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:126827 Archived-At: Eli Zaretskii writes: >> From: Alex >> Cc: 25154@debbugs.gnu.org >> Date: Sat, 10 Dec 2016 12:05:40 -0600 >> >> > Isn't it true that the order of evaluation in a 'let' is unspecified? >> > If you want a particular order, use 'let*'. >> >> I don't think so. See (info "(elisp) Local Variables"): >> >> All of the VALUE-FORMs in BINDINGS are evaluated in the order they >> appear > > That's the evaluation order. Yes, which is what the (nreverse binds) in my patch actually affects, despite the name of the variable being `binds'. This is why I said that my choice of wording for this bug report was wrong, as it focused on a less important problem. As said in my last email, the expression: (cl-letf (((aref v 1) 10) ((aref w 2) 20)) (aref v 1)) expands to: (let* ((v v) (v w) (old (aref v 2)) (old (aref v 1))) (unwind-protect (progn (aset v 2 20) (aset v 1 10) (aref v 1)) (aset v 2 old) (aset v 1 old))) which does indeed evaluate the arefs and asets in reverse order. This is the most important part of my patch. > Your code relies on the order of > _binding_ variables to values, which is unspecified. Contrast the > above with the description of 'let*' below it. Just the (nreverse simplebinds) line, which I added just to make cl-letf a little bit saner (i.e. more like let). This part does seem to be unspecified, but I don't see why it should unnecessarily diverge from let.