From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lars Magne Ingebrigtsen Newsgroups: gmane.emacs.devel Subject: Re: defvar inside let-binding Date: Mon, 18 Jul 2011 16:20:19 +0200 Organization: Programmerer Ingebrigtsen Message-ID: References: <87sjq7pq14.fsf@yun.yagibdah.de> <1ztyanqxv5.fsf@fencepost.gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1310998870 26225 80.91.229.12 (18 Jul 2011 14:21:10 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 18 Jul 2011 14:21:10 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jul 18 16:21:06 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Qiogy-0002rb-FH for ged-emacs-devel@m.gmane.org; Mon, 18 Jul 2011 16:21:04 +0200 Original-Received: from localhost ([::1]:56982 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qiogx-0000ZU-26 for ged-emacs-devel@m.gmane.org; Mon, 18 Jul 2011 10:21:03 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:41813) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QiogY-0000XQ-LV for emacs-devel@gnu.org; Mon, 18 Jul 2011 10:20:44 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QiogT-0005vq-Vf for emacs-devel@gnu.org; Mon, 18 Jul 2011 10:20:38 -0400 Original-Received: from lo.gmane.org ([80.91.229.12]:48595) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QiogT-0005vj-LF for emacs-devel@gnu.org; Mon, 18 Jul 2011 10:20:33 -0400 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1QiogR-0002dE-Hw for emacs-devel@gnu.org; Mon, 18 Jul 2011 16:20:31 +0200 Original-Received: from cm-84.215.51.58.getinternet.no ([84.215.51.58]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 18 Jul 2011 16:20:31 +0200 Original-Received: from larsi by cm-84.215.51.58.getinternet.no with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 18 Jul 2011 16:20:31 +0200 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: emacs-devel@gnu.org Original-Lines: 37 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: cm-84.215.51.58.getinternet.no Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAFVBMVEUMBgQcFgkCAAAFAgF9 eV8yKxQTDQaVlQXUAAACTUlEQVQ4jVWUzW7bMAzHmbjzOWxnnQfpBTSr8DlBpZ5rLMpZWha+/yPs T9kqWhoIbP7Cb1FkREYZCxENXn9m60IgKATPuIEAzWytdY5kIC6ktHhSvb/PdtaXQMxSRilk9a+n xRzhyseXQBmgcikN3A+sYIlvAKuIdDBUM9sAixQovrf4W1oDnyzAa74AXARAEAVpeX4B8E/NIhup yKAhDQGLgMwpprUCmAYqI1KYlw2wAhAADWGDe01DoIsptahSg/OztfMc6GfyiLGyWiAF2qpwcCkA KTMDavjKqGJGL+M5bGBqJqW2KuD0ByqPNzkY9bNVgUbRbnGR2oA29LgZUPwTKMH9X4fhhIVXdNxr hvHDk5b9rI2jx3RzXrtDT+oqQ9aMBDhnU80oKuk8NNCFp3VC5iLxA+4iEr6mDeCBvZGYAFSjdfAE 9aSAOb0DsOEhWLecft8I+lZwPANoZwqyN4GWKcMzTJLGEJkYox1vnsasAJU1i57SCtN8/QJSByhh 2izM9TuownuMVscnWBjgiu/dVYzdgmmcWp0mvn0JfhuLDY9WoOhKrB18CAZ+UL0pCloI7e1Y3OwO +0ECiNCxVDF0dMEetuE3oBMTMwTsUhuTdIARj9WQ12PZ9TrQmHlY2GDmfmHZjz2RHrjp/i91AC06 U8aiFlmuSXQxd0+QBkTCth+kR1j3QcWT1zOMmqT4TwOjIOhx1d1X0QC4D0iD46uru+h3uw++yewF AMsTcEJ0x7EYupbBlWNb+XartLf+8qt9edxDXbPLsekf/wFTQelfGPtgZwAAAABJRU5ErkJggg== Mail-Copies-To: never X-Now-Playing: DJ Rupture's _58.46 Radio Mix_: "Mutamassik - Show 2 Show:Dj Ruptures Paloma Grease Remix" User-Agent: Gnus/5.110018 (No Gnus v0.18) Emacs/24.0.50 (gnu/linux) Cancel-Lock: sha1:6sLBeL/CbaSZai3rfsSbn3WRUjU= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 80.91.229.12 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:142108 Archived-At: Stefan Monnier writes: >> Has changing the way `defvar' works in the presence of let-bindings been >> discussed? > > No. Personally I can't see how to make it work, because by the time we > get to defvar it's kind of too late. Maybe we could try to change the > let-binding so that the "saved void state" (which will be restored at > the end of the outer let) gets changed as if the var had been defvarred > before the let-binding. But it sounds terribly hackish. That was exactly what I was thinking should happen. :-) I mean, if you say (let ((foo-var nil)) (foo-function)) and `foo-function' is autoloaded -- I can't think of a single use case where you'd want `foo-var' to be unbound afterwards. That `foo-function' is autoloaded or a real function is something that should (in my opinion) have no effect on what you'd end up with after calling it. Leaving `foo-var' unbound is what is the hack, I think. We should strive to end up with the same result after calling `foo-function', no matter whether it's autoloaded or not. > Of course, another problem is that in the case of defcustom we don't > even detect the problem. I'm not sure I follow you there... -- (domestic pets only, the antidote for overdose, milk.) bloggy blog http://lars.ingebrigtsen.no/