unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#46834: 28.0.50; byte-compiling the standard counter closure fails
@ 2021-02-28 15:04 Pip Cet
  2021-02-28 19:57 ` Pip Cet
  0 siblings, 1 reply; 21+ messages in thread
From: Pip Cet @ 2021-02-28 15:04 UTC (permalink / raw)
  To: 46834

(My apologies if this is well-known, documented, or plain stupid on my
part, but I think it's an interesting gotcha. Feel free to close
immediately in those cases.)

Steps to reproduce from emacs -Q:
Evaluate the following in a lexically-bound Emacs Lisp buffer:

(byte-compile (let ((l 0)) (lambda () (cl-incf l))))

Expected result:

A byte code object which will increment its return value by one every
time it is called.

Actual result:

A byte code object which always returns 1.





^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2021-03-02 13:48 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-28 15:04 bug#46834: 28.0.50; byte-compiling the standard counter closure fails Pip Cet
2021-02-28 19:57 ` Pip Cet
2021-02-28 20:34   ` Pip Cet
2021-03-01 14:23     ` Stefan Monnier
2021-03-01 15:01       ` Pip Cet
2021-03-01 16:02         ` Stefan Monnier
2021-03-02  7:00           ` Lars Ingebrigtsen
2021-03-02  7:31             ` Pip Cet
2021-03-02  7:34               ` Lars Ingebrigtsen
2021-03-02  7:36                 ` Pip Cet
2021-03-02 13:16                 ` Eli Zaretskii
2021-03-02 13:19                   ` Pip Cet
2021-03-02 13:48                     ` Eli Zaretskii
2021-03-01 13:16   ` Lars Ingebrigtsen
2021-03-01 14:34     ` Stefan Monnier
2021-03-01 15:16       ` Pip Cet
2021-03-01 16:15         ` Stefan Monnier
2021-03-01 16:41           ` Pip Cet
2021-03-01 17:01             ` Stefan Monnier
2021-03-01 17:13               ` Pip Cet
2021-03-01 16:31         ` Eli Zaretskii

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).