From: Florian Beck <fb@miszellen.de>
To: help-gnu-emacs@gnu.org
Subject: How does letf work?
Date: Wed, 29 Jan 2014 00:10:00 +0100 [thread overview]
Message-ID: <52E838C8.5020101@miszellen.de> (raw)
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
next reply other threads:[~2014-01-28 23:10 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-28 23:10 Florian Beck [this message]
2014-01-29 2:23 ` How does letf work? 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=52E838C8.5020101@miszellen.de \
--to=fb@miszellen.de \
--cc=help-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).