From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Richard Stallman Newsgroups: gmane.emacs.devel Subject: Re: Proper namespaces in Elisp Date: Mon, 04 May 2020 22:51:32 -0400 Message-ID: References: <87y2q74tvw.fsf@alphapapa.net> <057e0083-593c-1fba-f83b-0195b42ca6f8@gmail.com> Reply-To: rms@gnu.org Content-Type: text/plain; charset=Utf-8 Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="6137"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: =?iso-8859-1?Q?Cl=C3=A9ment?= Pit-Claudel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue May 05 04:52:36 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jVnhD-0001UK-BW for ged-emacs-devel@m.gmane-mx.org; Tue, 05 May 2020 04:52:35 +0200 Original-Received: from localhost ([::1]:46210 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jVnhC-0000x1-Dy for ged-emacs-devel@m.gmane-mx.org; Mon, 04 May 2020 22:52:34 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59624) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jVngH-000848-Aw for emacs-devel@gnu.org; Mon, 04 May 2020 22:51:37 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:45376) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jVngG-0002In-QK; Mon, 04 May 2020 22:51:36 -0400 Original-Received: from rms by fencepost.gnu.org with local (Exim 4.82) (envelope-from ) id 1jVngD-0005wA-05; Mon, 04 May 2020 22:51:33 -0400 In-Reply-To: <057e0083-593c-1fba-f83b-0195b42ca6f8@gmail.com> (message from =?iso-8859-1?Q?Cl=C3=A9ment?= Pit-Claudel on Mon, 4 May 2020 11:38:07 -0400) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:248930 Archived-At: [[[ To any NSA and FBI agents reading my email: please consider ]]] [[[ whether defending the US Constitution against all enemies, ]]] [[[ foreign or domestic, requires you to follow Snowden's example. ]]] > And https://github.com/Malabarba/nameless/. I'm surprised that this package hasn't seen more adoption. It's basically solved the namespacing problem for me. > It uses font-lock to shorten package prefixes: my-package-xyz gets displayed as :xyz, my-package--abc gets displayed as ::abc, and other prefixes can be added (by default font-lock-xyz gets displayed as fl:xyz). Are you saying that this package implements _abbreviation_ for prefixes in a totally determined way, with no searching of multiple namespaces? It seems that way. What causes problems with namespaces in Lisp is searching multiple namespaces in series until one of them contains the desired symbol. If the system does not do that, it might not cause a problem -- but it won't do the same job that people expect. I think this will cause the problems: > Anyway, are there any contemporary objections to Nic's plan, in > particular I am interested in knowing if there any any major objections > to Nic's reader logic: > - given a string X > - lookup X in the local obarray > - if it exists return the symbol > - else > - lookup X in the global obarray > - if it exists return the symbol > - else > - add the symbol to the local obarray Any scheme for searching namespaces at read time will work out badly. Good results from namespaces require doing the search based on how the symbol will be used in each occurrence. -- Dr Richard Stallman Chief GNUisance of the GNU Project (https://gnu.org) Founder, Free Software Foundation (https://fsf.org) Internet Hall-of-Famer (https://internethalloffame.org)