all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Michael Heerdegen <michael_heerdegen@web.de>
To: help-gnu-emacs@gnu.org
Subject: Re: How does letf work?
Date: Thu, 30 Jan 2014 00:53:43 +0100	[thread overview]
Message-ID: <87mwie2vlk.fsf@web.de> (raw)
In-Reply-To: slrnlehfeo.6e2.joost.m.kremers@j.kremers4.news.arnhem.chello.nl

Joost Kremers <joost.m.kremers@gmail.com> writes:

> (letf (((cdr test-x) '(a b c d)))
>   (cdr test-x))
>
> = > (KEY a b c d)
>
> Taking what you say at face value, one might expect that at the moment
> the value of (cdr test-x) is printed, it's already been changed back to
> the original value, so it should say (KEY 1 2 3 4), but it doesn't.

(cdr test-x) here references an object being a list equal to '(a b c d).
But after the letf has been left, that object is not anymore the cdr of
test-x, because its cdr has been restored.  But that doesn't make the
return value "switch" to a different object.

The analogy with boxes is very helpful here.

Michael.




  parent reply	other threads:[~2014-01-29 23:53 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
     [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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87mwie2vlk.fsf@web.de \
    --to=michael_heerdegen@web.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.
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.