all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* How does letf work?
@ 2014-01-28 23:10 Florian Beck
  2014-01-29  2:23 ` Michael Heerdegen
       [not found] ` <mailman.13075.1390962244.10748.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 11+ messages in thread
From: Florian Beck @ 2014-01-28 23:10 UTC (permalink / raw)
  To: help-gnu-emacs

The docstring of letf says: "This is the analogue of `let', but with 
generalized variables (in the sense of `setf') for the PLACEs."

However, with setf, I get this:

(defvar test-x '(KEY 1 2 3 4))

(let ((x (copy-list test-x)))
   (setf (cdr x) '(a b c d))
   x)

=> (KEY a b c d)

(Without copy-list, the global variable is modified.)

Yet this doesn't work with letf:

(letf (((cdr test-x) '(a b c d)))
   test-x)

= > (KEY 1 2 3 4)

So, either "generalized variables" in the sense of setf are different 
from the sense of letf or -- more likely -- I don't understand how they 
work. Any hints?

-- 
Florian



^ permalink raw reply	[flat|nested] 11+ messages in thread
[parent not found: <mailman.13065.1390951154.10748.help-gnu-emacs@gnu.org>]

end of thread, other threads:[~2014-01-29 23:53 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-28 23:10 How does letf work? Florian Beck
2014-01-29  2:23 ` Michael Heerdegen
     [not found] ` <mailman.13075.1390962244.10748.help-gnu-emacs@gnu.org>
2014-01-29  8:37   ` Joost Kremers
2014-01-29  9:14     ` Joost Kremers
2014-01-29 15:29       ` Florian Beck
2014-01-29 16:12         ` Nicolas Richard
2014-01-29 20:19           ` Florian Beck
2014-01-29 15:06     ` Nicolas Richard
2014-01-29 23:46       ` Michael Heerdegen
2014-01-29 23:53     ` Michael Heerdegen
     [not found] <mailman.13065.1390951154.10748.help-gnu-emacs@gnu.org>
2014-01-29  0:35 ` Emanuel Berg

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.