From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Florian Beck Newsgroups: gmane.emacs.help Subject: How does letf work? Date: Wed, 29 Jan 2014 00:10:00 +0100 Message-ID: <52E838C8.5020101@miszellen.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1390951155 19647 80.91.229.3 (28 Jan 2014 23:19:15 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 28 Jan 2014 23:19:15 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Jan 29 00:19:23 2014 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1W8HwB-0008IS-99 for geh-help-gnu-emacs@m.gmane.org; Wed, 29 Jan 2014 00:19:23 +0100 Original-Received: from localhost ([::1]:39890 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W8HwA-00035f-Q2 for geh-help-gnu-emacs@m.gmane.org; Tue, 28 Jan 2014 18:19:22 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34575) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W8HtL-0002aP-RK for help-gnu-emacs@gnu.org; Tue, 28 Jan 2014 18:16:33 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W8HtF-0001Tk-WC for help-gnu-emacs@gnu.org; Tue, 28 Jan 2014 18:16:27 -0500 Original-Received: from mo6-p04-ob.smtp.rzone.de ([2a01:238:20a:202:5304::9]:32946) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W8HtF-0001SP-J5 for help-gnu-emacs@gnu.org; Tue, 28 Jan 2014 18:16:21 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; t=1390950975; l=630; s=domk; d=streitblatt.de; h=Content-Transfer-Encoding:Content-Type:Subject:To:MIME-Version:From: Date:X-RZG-AUTH:X-RZG-CLASS-ID; bh=FHjIpOmwN/hqEHODnyuCz+HVNVw=; b=aMkQ/6gOO5rvgmAx9YXBmTUcCsuJxWxe3pzdcJOOUATwuzYjZG95Alk22+kggbK6MB4 yNW4oLyPohH2l9GyitlbH8jWGq4VCaHB8oI/mfsL4vM/qEKYqPWK/YLtG/yPA1OyY3LS6 +2DArHj7IWHcOn8xp2sP6UDRnCpYJLnX0Xk= X-RZG-CLASS-ID: mo04 X-RZG-AUTH: :KmALZ0mpdbGonPxw7gDkop508XQjelhLxGYn4B74/iddlkME3ssvHN/NVnmdtQqoyX5noYgVMs5z Original-Received: from [10.59.99.123] ([82.113.106.123]) by smtp.strato.de (RZmta 32.22 SBL|AUTH) with ESMTPSA id z04ad7q0SNA4Ihc (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) for ; Wed, 29 Jan 2014 00:10:04 +0100 (CET) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a01:238:20a:202:5304::9 X-Mailman-Approved-At: Tue, 28 Jan 2014 18:19:13 -0500 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:95739 Archived-At: 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