From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kelly Dean Newsgroups: gmane.emacs.devel Subject: Re: The purpose of makunbound Date: Thu, 19 Feb 2015 23:51:39 +0000 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1424390004 8622 80.91.229.3 (19 Feb 2015 23:53:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 19 Feb 2015 23:53:24 +0000 (UTC) Cc: Richard Stallman , emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Feb 20 00:53:14 2015 Return-path: Envelope-to: ged-emacs-devel@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 1YOau8-0002VS-OS for ged-emacs-devel@m.gmane.org; Fri, 20 Feb 2015 00:53:12 +0100 Original-Received: from localhost ([::1]:58552 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YOau8-0001YF-3Y for ged-emacs-devel@m.gmane.org; Thu, 19 Feb 2015 18:53:12 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49041) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YOau2-0001Tt-8r for emacs-devel@gnu.org; Thu, 19 Feb 2015 18:53:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YOatz-0001mC-0Z for emacs-devel@gnu.org; Thu, 19 Feb 2015 18:53:06 -0500 Original-Received: from relay5-d.mail.gandi.net ([2001:4b98:c:538::197]:39281) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YOaty-0001m3-Rd; Thu, 19 Feb 2015 18:53:02 -0500 Original-Received: from mfilter1-d.gandi.net (mfilter1-d.gandi.net [217.70.178.130]) by relay5-d.mail.gandi.net (Postfix) with ESMTP id 64F2241C05D; Fri, 20 Feb 2015 00:53:01 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mfilter1-d.gandi.net X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "Cc" Original-Received: from relay5-d.mail.gandi.net ([217.70.183.197]) by mfilter1-d.gandi.net (mfilter1-d.gandi.net [10.0.15.180]) (amavisd-new, port 10024) with ESMTP id Cj73R+xbJ5rv; Fri, 20 Feb 2015 00:53:00 +0100 (CET) X-Originating-IP: 66.220.3.179 Original-Received: from localhost (gm179.geneticmail.com [66.220.3.179]) (Authenticated sender: kelly@prtime.org) by relay5-d.mail.gandi.net (Postfix) with ESMTPSA id B9A4E41C056; Fri, 20 Feb 2015 00:52:58 +0100 (CET) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4b98:c:538::197 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:183309 Archived-At: Stefan Monnier wrote: >> To get rid of the ambiguity, I propose always using the term =E2=80=9F= void=E2=80=9D for what >> makunbound sets, and using the =E2=80=9Fbind/unbind=E2=80=9D terminolo= gy exclusively for the >> kind of binding that =C2=ABlet=C2=BB does. > > Here's the problem: I don't see any difference between those two kinds > of bindings and the implementation doesn't see them as different either= . The implementation does see them as different, and the difference is expo= sed to the Lisp world too. The difference is not dependent on the interpr= etation of whether =C2=ABlet=C2=BB creates a new variable or temporarily = changes the value of the global variable. The difference is because makunbound works for let-bound and buffer-local= variables. Regardless of the interpretation, there are two different kin= ds of =E2=80=9Funbind=E2=80=9D events: the one caused by exit of a =C2=AB= let=C2=BB (which unshadows/restores the outer/previous value), and the on= e caused by makunbound (which sets the value to void). These are differen= t in the implementation and different in the Lisp world (observable by do= ing makunbound on a let-bound or buffer-local variable, then exiting the = =C2=ABlet=C2=BB or killing the buffer-local), yet the same terminology is= used for both. I'm proposing a difference in terminology to account for those two differ= ent kinds of events. In contrast, if makunbound didn't work for let-bound or buffer-local vari= ables, then there wouldn't be two different kinds of events in the Lisp w= orld (though there would still be in the implementation), because setting= non-shadowing/not-temporarily-changed non-buffer-local variables to void= is indistinguishable from unbinding them in the let-binding sense (becau= se there's no shadowed/previous value to restore). And because there woul= d be only one kind of event, there would be no need for a difference in t= erminology to avoid ambiguity. >> Just to be clear, the only reason there's any ambiguity in the first p= lace >> is because makunbound operates on non-global variables. > > Dynamically-scoped vars are global. In my message, I wrote that by =E2=80=9Fnon-global=E2=80=9D I meant =E2=80= =9Flet-bound or buffer-local=E2=80=9D, so I could use =E2=80=9Fnon-global= =E2=80=9D and =E2=80=9Fglobal=E2=80=9D as shorthand in the rest of the me= ssage. For your preferred interpretation of what let-binding does, just p= retend I spelled out =E2=80=9Flet-bound-or-buffer-local=E2=80=9D and =E2=80= =9Fnot-let-bound-and-not-buffer-local=E2=80=9D.