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: adding namespaces to emacs-lisp (better elisp?) Date: Fri, 26 Jul 2013 18:21:54 -0400 Message-ID: References: <874nbh2z3y.fsf@ferrier.me.uk> <871u6l2ral.fsf@ferrier.me.uk> <87siz116zo.fsf@ferrier.me.uk> <87mwp90zgi.fsf@ferrier.me.uk> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1374877326 6896 80.91.229.3 (26 Jul 2013 22:22:06 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 26 Jul 2013 22:22:06 +0000 (UTC) Cc: emacs-devel@gnu.org To: Nic Ferrier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Jul 27 00:22:06 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 1V2qOh-0007gm-Ih for ged-emacs-devel@m.gmane.org; Sat, 27 Jul 2013 00:22:03 +0200 Original-Received: from localhost ([::1]:33199 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V2qOg-0007cE-PX for ged-emacs-devel@m.gmane.org; Fri, 26 Jul 2013 18:22:02 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40264) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V2qOc-0007Yg-QY for emacs-devel@gnu.org; Fri, 26 Jul 2013 18:21:59 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V2qOb-0000eh-Cc for emacs-devel@gnu.org; Fri, 26 Jul 2013 18:21:58 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.182]:65029) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V2qOb-0000e4-7j for emacs-devel@gnu.org; Fri, 26 Jul 2013 18:21:57 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av4EABK/CFFFpZPn/2dsb2JhbABEvw4Xc4IeAQEEAVYjBQsLDiYSFBgNJIgeBsEtkQoDpHqBXoMT X-IPAS-Result: Av4EABK/CFFFpZPn/2dsb2JhbABEvw4Xc4IeAQEEAVYjBQsLDiYSFBgNJIgeBsEtkQoDpHqBXoMT X-IronPort-AV: E=Sophos;i="4.84,565,1355115600"; d="scan'208";a="19938471" Original-Received: from 69-165-147-231.dsl.teksavvy.com (HELO pastel.home) ([69.165.147.231]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 26 Jul 2013 18:21:49 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id 7B96262D1A; Fri, 26 Jul 2013 18:21:54 -0400 (EDT) In-Reply-To: <87mwp90zgi.fsf@ferrier.me.uk> (Nic Ferrier's message of "Fri, 26 Jul 2013 22:43:25 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 206.248.154.182 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:162183 Archived-At: > If a namespace package calls intern the symbol is interned in the > private obarray. I'm not sure how you could do that and neither am I sure that would preserve backward compatibility. So without more details of how that would work, it sounds like wishful thinking to me. >> I'm not sure why the implementation should be difficult. `intern' would >> "simply" need to parse the string into a list of elements (separated by >> "::" or whatever), then lookup the first element in the obarray, which >> should contain another obarray, then lookup the second element in that >> obarray, etc... until the last element which is handled "in the old >> way". > It would clearly be more work to add the extra indirection to allow > namespaced namespaces than to have one level. Could be, but not necessarily. It could amount to not much more than replacing a `when' with a `while'. Stefan