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

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

Re: How does letf work?


From: Emanuel Berg
Subject: Re: How does letf work?
Date: Wed, 29 Jan 2014 01:35:47 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

Florian Beck <fb@miszellen.de> writes:

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

(letf (((cdr test-x) '(a b c d)))
  (message "%s" test-x) ; says '(KEY a b c d)
  (cdr test-x) )        ; => (a b c d)

(And `... (nth 1 test-x)' => 'a, and so on.)

But:

(letf (((cdr test-x) '(a b c d)))
  (message "%s" test-x) ; says '(KEY a b c d)
  test-x)               ;   => '(KEY 1 2 3 4)

`letf' (or `cl-letf') resets the values when it exits:

> On exit, either normally or because of a `throw' or
> error, the PLACEs are set back to their original
> values.

So perhaps this inconsistency is due to the
implementation of that.

-- 
underground experts united:
http://user.it.uu.se/~embe8573


reply via email to

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