From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Helmut Eller Newsgroups: gmane.emacs.devel Subject: Re: Help sought understanding shorthands wrt modules/packages Date: Sun, 30 Oct 2022 21:16:17 +0100 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="27306"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) To: emacs-devel@gnu.org Cancel-Lock: sha1:qDc8bDqE37/M+czi82u7Eu+gREs= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Oct 31 04:21:18 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 1opLMU-0006uh-7u for ged-emacs-devel@m.gmane-mx.org; Mon, 31 Oct 2022 04:21:18 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1opLLn-0002b0-Gu; Sun, 30 Oct 2022 23:20:35 -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 1opEjK-0001Bo-5J for emacs-devel@gnu.org; Sun, 30 Oct 2022 16:16:27 -0400 Original-Received: from ciao.gmane.io ([116.202.254.214]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1opEjI-0003Cd-Oe for emacs-devel@gnu.org; Sun, 30 Oct 2022 16:16:25 -0400 Original-Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1opEjG-0006L0-8O for emacs-devel@gnu.org; Sun, 30 Oct 2022 21:16:22 +0100 X-Injected-Via-Gmane: http://gmane.org/ Received-SPF: pass client-ip=116.202.254.214; envelope-from=ged-emacs-devel@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: 3 X-Spam_score: 0.3 X-Spam_bar: / X-Spam_report: (0.3 / 5.0 requ) BAYES_00=-1.9, DKIM_ADSP_CUSTOM_MED=0.001, FORGED_GMAIL_RCVD=1, FREEMAIL_FORGED_FROMDOMAIN=0.001, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.248, NML_ADSP_CUSTOM_MED=0.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Sun, 30 Oct 2022 23:20:34 -0400 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@gnu.org Xref: news.gmane.io gmane.emacs.devel:298835 Archived-At: On Sun, Oct 30 2022, Gerd Möllmann wrote: > So, I guess my first question is: does anyone here think shorthands are > a substitute got packages, and if so could you please share your thought > why, and how one would use them for that? If not, it might also be > helpful to know why not. I think that shorthands do reduce the visual clutter in the source text a bit. And that's about all they do. CL-like packages also provide runtime data structures to export/import/inherit symbols between packages. Obviously shorthands can't do that. In CL, it's also possible to create "empty" packages, i.e., packages that don't import symbols from the CL package. With this, one can create a private function +. That's also not possible with shorthands. > And my second question os: Because I don't get it, I'm considering the > possibility that shorthands are still incomplete, and some features are > missing that would make it a substitute for a module system. Something > that's not documented anywhere, apparently. If so, what is it? Or > where is it described? Or does someone have an idea? You know what I > mean. One thing that was talked about in the past is something like "local shorthands". I think the idea is that a certain prefix is only active in a certain region of the text. Preferably delimited by an sexp (and not by special tokens as IN-PACKAGE in CL). Or maybe it was about doing something like namespace defaulting in XML. I don't know if this is documented anywhere. My impression was that shorthands appeared out of the blue. I also had the impression that nobody liked the name "shorthands" much; or maybe that was just me :-). [...] > Or am I going nuts and overlooking the obvious? Well, its pretty obvious that RMS doesn't like CL packages. The other obvious problem are Lisp macros: macros make it darn hard to introduce a "real" module system as in Python or Haskell. I think the options are: 1. continue to use prefixes 2. adopt half measures like shortands 3. add namespaces to symbols, like CL or XML; keeps macros simple, but doesn't support renaming or aliases 4. introduce hygienic macros as in Scheme I think 4. is technically too difficult. There may also be technical problems with 3., but the CL community probably knows them and the workarounds. But I think 3. will not happen mainly for political/ideological reasons. Helmut