From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Tom Tromey Newsgroups: gmane.emacs.devel Subject: Re: Proper namespaces in Elisp Date: Tue, 05 May 2020 09:10:38 -0600 Message-ID: <87ftcee7td.fsf@tromey.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="24883"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: emacs-devel To: =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue May 05 17:11:44 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 1jVzEW-0006LI-JR for ged-emacs-devel@m.gmane-mx.org; Tue, 05 May 2020 17:11:44 +0200 Original-Received: from localhost ([::1]:47386 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jVzEV-00085B-JX for ged-emacs-devel@m.gmane-mx.org; Tue, 05 May 2020 11:11:43 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41962) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jVzDl-0006xa-0D for emacs-devel@gnu.org; Tue, 05 May 2020 11:10:57 -0400 Original-Received: from gateway23.websitewelcome.com ([192.185.50.161]:11088) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jVzDi-000448-Vl for emacs-devel@gnu.org; Tue, 05 May 2020 11:10:56 -0400 Original-Received: from cm10.websitewelcome.com (cm10.websitewelcome.com [100.42.49.4]) by gateway23.websitewelcome.com (Postfix) with ESMTP id 270AC42B1 for ; Tue, 5 May 2020 10:10:40 -0500 (CDT) Original-Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id VzDUjhTIZEfyqVzDUjVE8R; Tue, 05 May 2020 10:10:40 -0500 X-Authority-Reason: nr=8 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID: In-Reply-To:Date:References:Subject:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=gJH9R6lkAhc/wPbDhJCLcgnsQvV7JsjgYCY5Niu7E3I=; b=SwpjGo2SdFJgmctk/JM7dyuOvj f/p7Z7M6Br6CcgQ8H5bDQB2OyPIiWAWjisTVRMdma98wT7g4/hWqm9EBEXNK2KqRpnIsHaJNMakSA sieYJrtZTBgwZ9SYjjPxwrYzn; Original-Received: from 184-96-229-138.hlrn.qwest.net ([184.96.229.138]:53656 helo=murgatroyd) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92) (envelope-from ) id 1jVzDT-001fjm-QM; Tue, 05 May 2020 09:10:39 -0600 X-Attribution: Tom In-Reply-To: (=?utf-8?Q?=22Jo=C3=A3o_T=C3=A1vora=22's?= message of "Mon, 4 May 2020 11:52:18 +0100") X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box5379.bluehost.com X-AntiAbuse: Original Domain - gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tromey.com X-BWhitelist: no X-Source-IP: 184.96.229.138 X-Source-L: No X-Exim-ID: 1jVzDT-001fjm-QM X-Source-Sender: 184-96-229-138.hlrn.qwest.net (murgatroyd) [184.96.229.138]:53656 X-Source-Auth: tom+tromey.com X-Email-Count: 2 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes Received-SPF: permerror client-ip=192.185.50.161; envelope-from=tom@tromey.com; helo=gateway23.websitewelcome.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/05 11:10:40 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_PASS=-0.001, SPF_NEUTRAL=0.779, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action 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:248999 Archived-At: >>>>> "Jo=C3=A3o" =3D=3D Jo=C3=A3o T=C3=A1vora write= s: Jo=C3=A3o> An here's the idea: if the compiler uses the lexical-binding fil= e-local var Jo=C3=A3o> when compiling specific files, or functions inside those files, = why can't Jo=C3=A3o> it use a local-namespaces var when reading symbols? I think this Jo=C3=A3o> very idea was floated at the time, but I can't find it. I did something like this https://github.com/tromey/emacs-module It lets you write short names for things in your elisp; and lets you import names with a shorter form. However, the underlying symbols actually use prefixes, in the traditional elisp way. Unlike the "Names" package, it doesn't require wrapping your entire file in a macro. Instead it works using advice, in particular on internal-macroexpand-for-load. Jo=C3=A3o> thing-at-point would also be taught about these local-namespaces Jo=C3=A3o> so xref and C-h f stuff would work well. Grep wouldn't know ab= out it, Jo=C3=A3o> sure, that's true, but that's something that already afflicts ot= her Jo=C3=A3o> languages with namespace qualifiers and isn't a terrible thing. Jo=C3=A3o> Any other great difficulties you can think ot? These were the main problems I had when using it. Tom