all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / 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

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.