Subject: bug#25154: closed (Re: bug#25154: 25.1; Bindings in cl-letf are in reverse order)

From: [email-masked] (GNU bug Tracking System)
Date: Fri, 23 Dec 2016 16:32:02 +0000

Your bug report

#25154: 25.1; Bindings in cl-letf are in reverse order

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
25154: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=25154
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#25154: 25.1; Bindings in cl-letf are in reverse order
From: Philipp Stephani <[email-masked]>
To: Eli Zaretskii <[email-masked]>, [email-masked]
Cc: [email-masked], [email-masked]
Date: Fri, 23 Dec 2016 16:30:47 +0000
List-Id: <debbugs-submit.debbugs.gnu.org>

Eli Zaretskii <[email-masked]> schrieb am Fr., 23. Dez. 2016 um 14:53 Uhr:

> > From: Philipp Stephani <[email-masked]>
> > Date: Fri, 23 Dec 2016 12:17:54 +0000
> > Cc: [email-masked], [email-masked], [email-masked]
> >
> >  I agree, patches to that effect are welcome. (AFAICT, the manual
> >  tries to say that already, but the wording could be more explicit.)
> >
> > OK, I've attached a patch that hopefully clarifies this a bit.
>
> Thanks.  My only comment is that I think we prefer talking about
> "binding" instead of "assignment".
>

OK, replaced "assign" with "bind" and pushed to emacs-25 as
c04ac8a3191820d37e7858b7ca4e31cf04808cc3.

Subject: 25.1; Bindings in cl-letf are in reverse order
From: Alex <[email-masked]>
To: [email-masked]
Date: Fri, 09 Dec 2016 17:36:15 -0600
List-Id: <debbugs-submit.debbugs.gnu.org>

Compare the following:

(let ((x 5)
      (x 6))
  (+ x 10))

=> 16

(cl-letf ((x 5)
          (x 6))
  (+ x 10))

=> 15

This also occurs when using non-trivial places:

(setq v (vector 1 2 3 4 5))

(cl-letf (((aref v 1) 10)
          ((aref v 1) 20))
  (aref v 1))

=> 10

I ran into this when using two different setters that sometimes
indirectly modify the same variable. The current behaviour makes the
result of that unexpected.