From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Help sought understanding shorthands wrt modules/packages Date: Sun, 30 Oct 2022 10:25:07 -0400 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="7186"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Gerd =?windows-1252?Q?M=F6llmann?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Oct 30 15:26:11 2022 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 1op9GM-0001fA-TR for ged-emacs-devel@m.gmane-mx.org; Sun, 30 Oct 2022 15:26:11 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1op9FU-0007NN-9D; Sun, 30 Oct 2022 10:25:16 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1op9FT-0007NB-Fb for emacs-devel@gnu.org; Sun, 30 Oct 2022 10:25:15 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1op9FR-0006NY-LW for emacs-devel@gnu.org; Sun, 30 Oct 2022 10:25:15 -0400 Original-Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 584F2100142; Sun, 30 Oct 2022 10:25:11 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 7D8BF1000E6; Sun, 30 Oct 2022 10:25:09 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1667139909; bh=1KTTNdlhHK3sBXOwGxUxMQyPr7UNIK+pRv1/FldscZg=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=VQcijZSC/yDcEndhtowlpkGBdPeFWLqLFnkPgGqPnax631m9LgEFO+uT2q0BHdsd5 9N4KHgY9XnqNApai4X48xIyRA31Slkum0zt2c8Wgv8eUt7jQlJX5NPeLSRjdY7k0v9 JQ3MJaOjAtCU7GUJX38mm1EasUwoslPhwErCCSgxUTrykkjKCoSlfGJTb+SKbkr9zY ibuo8otgBCouuBLgdZF36jkBJz4U2IF47U7XX56p1bUiDNdKNYx9tanmCBiXzc6hp/ vxKH/wjs+JglDQPeE4npnjEpfsfvju0+l2ypF1T0GohW0A8sKatNRPLPjH7KcwJy2G a/irPprwghE1A== Original-Received: from pastel (65-110-220-202.cpe.pppoe.ca [65.110.220.202]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 4DD7C1206C1; Sun, 30 Oct 2022 10:25:09 -0400 (EDT) In-Reply-To: ("Gerd =?windows-1252?Q?M=F6l?= =?windows-1252?Q?lmann=22's?= message of "Sun, 30 Oct 2022 14:48:20 +0100") Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-Spam_score_int: -22 X-Spam_score: -2.3 X-Spam_bar: -- X-Spam_report: (-2.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URI_DOTEDU=1.997 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: "Emacs-devel" Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:298817 Archived-At: Gerd M=F6llmann [2022-10-30 14:48:20] wrote: > Stefan Monnier writes: >>> The reason why I think shorthands don't address that problem is pretty >>> simple, according to me again: The underlying one obarray can only >>> contain one name per symbol at a time. So, whatever name lands in the >> >> I thought CL packages had the same problem: you can't (globally) have >> two packages with the same name. > > That's true, in this case that's a problem with package names. I guess > everything having a name can conflict with the same name being used by > someone else. Indeed, the standard ELisp coding style is to always type the full `-` name. With CL packages, the full names look like `:` instead but are otherwise similarly forced to be unique. The main benefit of CL packages is that you get to skip the `:` prefix, and/or that you can locally use a different (e.g. shorter) prefix. The shorthands thingy doesn't let you skip the prefix altogether but does let you locally use shorter prefixes. > But, > > - You can handle it with rename-package. I've used that in CMUCL, while > working its CLOS implementation), to load two versions of PCL in the > same image at the same time. Indeed you get to manipulate your namespace more directly (you can also add global package aliases). Another benefit is that there's a clear "inside" and "outside" of a package, whereas with ELisp's convention there's no immediate downside for authors to define a few vars&functions outside of their namespace-prefix. > - There is an extension "hierarchical packages" which gives packages a > tree structure. It's more or less like with Java packages. An > implementation on top of standard packages isn't very hard. > https://cmucl.org/docs/cmu-user/html/Introduction-To-Hierarchical-Packa= ges.html Note that those still need to be globally unique, so it just pushes the problem a bit further. To solve it "for real", you can use something similar but where all your names a "relative". IIRC https://people.cs.uchicago.edu/~blume/papers/cm-TOPLAS.pdf is such an example. Stefan