From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: The purpose of makunbound Date: Wed, 18 Feb 2015 17:42:41 -0500 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1424299796 5202 80.91.229.3 (18 Feb 2015 22:49:56 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 18 Feb 2015 22:49:56 +0000 (UTC) Cc: emacs-devel@gnu.org To: Kelly Dean Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Feb 18 23:49:46 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 1YODR9-0005uN-KH for ged-emacs-devel@m.gmane.org; Wed, 18 Feb 2015 23:49:43 +0100 Original-Received: from localhost ([::1]:53910 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YODR9-0001xz-1C for ged-emacs-devel@m.gmane.org; Wed, 18 Feb 2015 17:49:43 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52793) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YODKq-0006Le-IM for emacs-devel@gnu.org; Wed, 18 Feb 2015 17:43:13 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YODKl-0003AC-FP for emacs-devel@gnu.org; Wed, 18 Feb 2015 17:43:12 -0500 Original-Received: from mercure.iro.umontreal.ca ([132.204.24.67]:46656) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YODKl-0003A0-C4 for emacs-devel@gnu.org; Wed, 18 Feb 2015 17:43:07 -0500 Original-Received: from hidalgo.iro.umontreal.ca (hidalgo.iro.umontreal.ca [132.204.27.50]) by mercure.iro.umontreal.ca (Postfix) with ESMTP id BFBDF85C97; Wed, 18 Feb 2015 17:43:06 -0500 (EST) Original-Received: from lechon.iro.umontreal.ca (lechon.iro.umontreal.ca [132.204.27.242]) by hidalgo.iro.umontreal.ca (Postfix) with ESMTP id 1DC491E5913; Wed, 18 Feb 2015 17:42:42 -0500 (EST) Original-Received: by lechon.iro.umontreal.ca (Postfix, from userid 20848) id 03852B4102; Wed, 18 Feb 2015 17:42:41 -0500 (EST) In-Reply-To: (Kelly Dean's message of "Wed, 18 Feb 2015 18:53:31 +0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-DIRO-MailScanner-Information: Please contact the ISP for more information X-DIRO-MailScanner: Found to be clean X-DIRO-MailScanner-SpamCheck: n'est pas un polluriel, SpamAssassin (score=-2.82, requis 5, autolearn=not spam, ALL_TRUSTED -2.82, MC_TSTLAST 0.00) X-DIRO-MailScanner-From: monnier@iro.umontreal.ca X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 132.204.24.67 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:183274 Archived-At: >> 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))) This problematic situation is problematic regardless of the presence of makunbound. You simply can't have a (defvar ) for a variable you need to use lexically elsewhere. > For single-threaded code, there's no difference, but for multi-threaded, > there is, which you already mentioned. Why have inconsistent interpretations > for single vs. multi, when you can have a consistent one for both? Note that the current implementation technique for "bound/unbound" still works just fine with multithreading (the implementation of dynamically scoped "let" is more problematic but it has no particular problematic interaction with makunbound). So, adding multi-threading won't make much difference to this "problem". Stefan