bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Alex
Subject: bug#25154: 25.1; Bindings in cl-letf are in reverse order
Date: Fri, 09 Dec 2016 22:29:36 -0600
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux)

Alex <agrambot@gmail.com> writes:

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

I attached a patch that fixes this issue:

Attachment: 0001-Preserve-the-order-of-bindings-in-cl-letf.patch
Description: cl-letf patch


reply via email to

[Prev in Thread] Current Thread [Next in Thread]