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

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

Strange incf behavior in Emacs 22. Intentional?


From: address@hidden
Subject: Strange incf behavior in Emacs 22. Intentional?
Date: Thu, 28 Jun 2007 05:41:31 -0700
User-agent: G2/1.0

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.



reply via email to

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