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: Wed, 18 Feb 2015 18:53:31 +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 1424285735 29358 80.91.229.3 (18 Feb 2015 18:55:35 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 18 Feb 2015 18:55:35 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Feb 18 19:55:24 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 1YO9mO-0008Vv-Ck for ged-emacs-devel@m.gmane.org; Wed, 18 Feb 2015 19:55:24 +0100 Original-Received: from localhost ([::1]:52269 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YO9mN-0001rj-VQ for ged-emacs-devel@m.gmane.org; Wed, 18 Feb 2015 13:55:23 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56450) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YO9mJ-0001n7-0O for emacs-devel@gnu.org; Wed, 18 Feb 2015 13:55:21 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YO9mD-0004jp-W6 for emacs-devel@gnu.org; Wed, 18 Feb 2015 13:55:18 -0500 Original-Received: from relay6-d.mail.gandi.net ([2001:4b98:c:538::198]:47804) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YO9mD-0004jL-Qs for emacs-devel@gnu.org; Wed, 18 Feb 2015 13:55:13 -0500 Original-Received: from mfilter10-d.gandi.net (mfilter10-d.gandi.net [217.70.178.139]) by relay6-d.mail.gandi.net (Postfix) with ESMTP id B12B3FB8A3; Wed, 18 Feb 2015 19:55:12 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mfilter10-d.gandi.net Original-Received: from relay6-d.mail.gandi.net ([217.70.183.198]) by mfilter10-d.gandi.net (mfilter10-d.gandi.net [10.0.15.180]) (amavisd-new, port 10024) with ESMTP id JdhSxf0YWjN9; Wed, 18 Feb 2015 19:55:11 +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 relay6-d.mail.gandi.net (Postfix) with ESMTPSA id 3B795FB8B3; Wed, 18 Feb 2015 19:55:09 +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::198 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:183265 Archived-At: Stefan Monnier wrote: > Why would that be an error? Because of a classic mistake with dynamic binding: (defvar bar nil) (defun foo () (if something-rare... (makunbound 'bar)) ; Intent is global (do-something)) (let ((bar (something))) ; Intent is lexical (do-some-stuff) (foo) (if bar ; Oops (some-other-stuff))) Well the classic is with =C2=ABset=C2=BB, not makunbound, but the problem= is the same. There are legitimate cases for using =C2=ABset=C2=BB in dynamic =C2=ABlet= =C2=BB, so the interpreter must allow it, and you just have to deal with = the possibility of that kind of mistake. But for makunbound, if there are= no legitimate use cases, then the interpreter could catch it. > How often have you bumped into that error? Never. > And remember: a (dynamically scoped) `let' does not necessarily mean to > make a local binding, it can also be understood to mean to temporarily > change the global variable [snip] > You talk about "global variable" vs "dynamic variable", but that > difference is only in your head because of the interpretation you chose= . For single-threaded code, there's no difference, but for multi-threaded, = there is, which you already mentioned. Why have inconsistent interpretati= ons for single vs. multi, when you can have a consistent one for both? And aren't you planning to add multi-threading to Emacs?