From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Davis Herring Newsgroups: gmane.emacs.devel Subject: Re: adding namespaces to emacs-lisp (better elisp?) Date: Fri, 26 Jul 2013 11:21:10 -0600 Organization: XCP-1 Message-ID: <51F2B006.3080107@lanl.gov> References: <874nbh2z3y.fsf@ferrier.me.uk> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1374859300 8929 80.91.229.3 (26 Jul 2013 17:21:40 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 26 Jul 2013 17:21:40 +0000 (UTC) Cc: Nic Ferrier , emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jul 26 19:21:42 2013 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 1V2li0-0008E0-97 for ged-emacs-devel@m.gmane.org; Fri, 26 Jul 2013 19:21:40 +0200 Original-Received: from localhost ([::1]:34461 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V2lhz-00054R-SK for ged-emacs-devel@m.gmane.org; Fri, 26 Jul 2013 13:21:39 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59606) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V2lhi-0004Zk-Hz for emacs-devel@gnu.org; Fri, 26 Jul 2013 13:21:23 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V2lhg-0001r8-Dc for emacs-devel@gnu.org; Fri, 26 Jul 2013 13:21:22 -0400 Original-Received: from proofpoint4.lanl.gov ([204.121.3.52]:58281) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V2lhg-0001qN-5c for emacs-devel@gnu.org; Fri, 26 Jul 2013 13:21:20 -0400 Original-Received: from mailrelay2.lanl.gov (mailrelay2.lanl.gov [128.165.4.103]) by mailgate4.lanl.gov (8.14.5/8.14.5) with ESMTP id r6QHLBsi008330; Fri, 26 Jul 2013 11:21:11 -0600 Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by mailrelay2.lanl.gov (Postfix) with ESMTP id 364681120FB5; Fri, 26 Jul 2013 11:21:11 -0600 (MDT) X-NIE-2-Virus-Scanner: amavisd-new at mailrelay2.lanl.gov Original-Received: from [128.165.123.183] (xray-r06.lanl.gov [128.165.123.183]) by mailrelay2.lanl.gov (Postfix) with ESMTP id 030431120C19; Fri, 26 Jul 2013 11:21:10 -0600 (MDT) User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.18) Gecko/20110717 Lanikai/3.1.11 In-Reply-To: X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.10.8794, 1.0.431, 0.0.0000 definitions=2013-07-26_08:2013-07-26, 2013-07-26, 1970-01-01 signatures=0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x X-Received-From: 204.121.3.52 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:162156 Archived-At: > - I'm not sure how well it will cope with shadowing and non-namespaced > symbols (e.g. symbols like `face' that aren't used as variables). > The rule "global obarray is inspected first and if a symbol is found > there that's what is used" means that we have to be vary careful about > interning things in the global obarray since it can affect the way > other code is handled. Currently, we're very liberal about interning > in the global obarray. > Basically I think this shadowing rule makes things a bit too automatic > for something where we need more control. > I think that, for backward compatibility reasons we can't easily mark > "non-prefixed symbols that should be global" (such as `face'), so the > safer alternative is to force local symbols to be specially marked > (like ::foo, maybe, to mean "foo in the current local obarray"). > Having to prefix every single local symbol that way probably sounds > rather unpalatable, tho. I think Mathematica's solution here works pretty well (see http://reference.wolfram.com/mathematica/tutorial/Contexts.html). The part I think relevant here would be to define a "built-in" namespace that would be searched first (like the global obarray mentioned above), but not have it be the default for namespace-oblivious code. Then the up-front cost would be merely that symbols like 'face (as well as more obvious things like 'car) would need to be explicitly placed in that special namespace, rather than that all references to them needing modification. Davis -- This product is sold by volume, not by mass. If it appears too dense or too sparse, it is because mass-energy conversion has occurred during shipping.