unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Strange incf behavior in Emacs 22. Intentional?
@ 2007-06-28 12:41 spamfilteraccount
  2007-06-28 12:46 ` Thien-Thi Nguyen
                   ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: spamfilteraccount @ 2007-06-28 12:41 UTC (permalink / raw)
  To: help-gnu-emacs

Here are two functions:

(defun testfun1 ()
  (interactive)
  (setq a '(0 0))
  (print a))

(defun testfun2 ()
  (interactive)
  (incf (car a))
  (print a))


I call the first one, a is (0 0).
I call the second one, a is (1 0).
I call the second one, a is (2 0).
I call the first one, a is (2 0).

"a" won't get the value (0 0) again until I redefine testfun1.

I suspect it is caused be some kind of internal optimization. Is it
intentional? It cost me a great deal of head scratching to find out
why my program doesn't work.

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

end of thread, other threads:[~2007-07-12 22:05 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-06-28 12:41 Strange incf behavior in Emacs 22. Intentional? spamfilteraccount
2007-06-28 12:46 ` Thien-Thi Nguyen
2007-06-28 13:51 ` Lennart Borgman (gmail)
2007-06-28 13:54 ` Juanma Barranquero
     [not found] ` <mailman.2737.1183038693.32220.help-gnu-emacs@gnu.org>
2007-06-28 22:32   ` David Kastrup
2007-06-28 23:29     ` Lennart Borgman (gmail)
2007-06-29 14:51     ` Stefan Monnier
2007-06-29 20:00       ` David Kastrup
2007-07-12 19:36         ` Stefan Monnier
2007-07-12 19:50           ` Lennart Borgman (gmail)
     [not found]           ` <mailman.3415.1184269869.32220.help-gnu-emacs@gnu.org>
2007-07-12 22:05             ` David Kastrup

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