From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: =?UTF-8?B?Sm/Do28gVMOhdm9yYQ==?= Newsgroups: gmane.emacs.devel Subject: Proper namespaces in Elisp Date: Mon, 4 May 2020 11:52:18 +0100 Message-ID: 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="96734"; mail-complaints-to="usenet@ciao.gmane.io" To: emacs-devel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon May 04 12:57:22 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 1jVYmm-000P0H-HS for ged-emacs-devel@m.gmane-mx.org; Mon, 04 May 2020 12:57:20 +0200 Original-Received: from localhost ([::1]:33374 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jVYml-0000lF-Kd for ged-emacs-devel@m.gmane-mx.org; Mon, 04 May 2020 06:57:19 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:44256) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jVYi7-0005nr-S5 for emacs-devel@gnu.org; Mon, 04 May 2020 06:52:31 -0400 Original-Received: from mail-il1-x12f.google.com ([2607:f8b0:4864:20::12f]:34393) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jVYi6-0002st-TX for emacs-devel@gnu.org; Mon, 04 May 2020 06:52:31 -0400 Original-Received: by mail-il1-x12f.google.com with SMTP id w6so10800632ilg.1 for ; Mon, 04 May 2020 03:52:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to :content-transfer-encoding; bh=ApqoJU8wB4IXmGX5Nl3wHQqRxyJOab+LlUoehLGbESo=; b=utug79ALuIu1bHCriNNt/Ujd5y28CRTdj8wzKdAaw0ur0UFKuiiAD+JyA77VT9RT6y mcTwCWQgi7ex7xdN1HWQTTEgZQylJcbkmWKTdzPs7mORonVph+JomptNYW4sG7MBASS4 f8ki67U/B3ytZTEk4gnn0DRXP6nXzr3ocgUU9R08DN90CPzXX1Qs5lEQO5Q+xpCZgrKo KHWveXmOsHj+uHrTXU2Y/lVh7/1g6RP+r+bbONKaFNQTShLXg54I+nx4xqSr4X6V6Oli pMniepGZ+tq8AJ3lrmP8U2MHSiFUPV2T8nSJAu7F0jvsOhJS0Yk+DFn+mmhEO5nzc2Ie kGtQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to :content-transfer-encoding; bh=ApqoJU8wB4IXmGX5Nl3wHQqRxyJOab+LlUoehLGbESo=; b=YdO7rJnBLq8iq7NucXFzIukgLcsNOHDoNnkRTq+GjG59D2AFbBUyZskG/uTQkjCoxe 8LfjKFC3T17ERVLDa5fcIVnJHoN4iSL8TIeHDnq02FjbSuJ1sM0zeJ/s0+wHfNrj5Xhq Tsls5r3oXrFI4xsjxVTx3brz6XFSj9aTd45whciymaNvo7ghlcdHJFiPjanIL4M5nHJp y3ly60NCahbbOWrU9V3voCSN6hY24DP/M9keBtBSedNybF9+P30kgYNXfvFjiEEuZtik Gf7j7hxRxlX/2SZawLuCm+wPmo1/qLlpsyy8wJYe1+IoB9JLBol9ueWfwLs8qtoKE9eP 3DQg== X-Gm-Message-State: AGi0PublR+CXuI5tbnXLmeIGTavyHhCZs69/AeN8waefL3kMXqvgz6uL xK6u+GI7bns6gNN9X82ZtvSZNVocBNKftGtZRPlvAko2KfE= X-Google-Smtp-Source: APiQypIyzs5Ekiq+2GjI/V5XOK11N9PMls33KO42OsGH1KYFWkSh9sLuVu03jDnqdDPWtt7vnjCW6ce+biNMyJF8XSI= X-Received: by 2002:a92:9e11:: with SMTP id q17mr15972796ili.137.1588589549389; Mon, 04 May 2020 03:52:29 -0700 (PDT) Received-SPF: pass client-ip=2607:f8b0:4864:20::12f; envelope-from=joaotavora@gmail.com; helo=mail-il1-x12f.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, FROM_EXCESS_BASE64=0.979, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, 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:248806 Archived-At: Around 4 years ago, the "future of Emacs Lisp" came up, and we discussed namespaces in Elisp. Well the future is now, sort of. Here's a sample of that thread: https://lists.gnu.org/archive/html/emacs-devel/2016-10/msg00145.html An here's the idea: if the compiler uses the lexical-binding file-local var when compiling specific files, or functions inside those files, why can't it use a local-namespaces var when reading symbols? I think this very idea was floated at the time, but I can't find it. It would solve part of the problem people have here, one could use that variable to shadow/rename symbols locally. A modern-string.el library with a long discriminating "modern-string-" prefix could have its symbols locally accessible by "ms-" or even the "" empty string, if the the using file's author so desired. Same for modern-regexp.el library. And whoever likes those libraries (and maybe I would be one of them), wouldn't be constrained by this aliasing proposal which is very limitative, since it has to keep the order of arguments and other parts of the contract. thing-at-point would also be taught about these local-namespaces so xref and C-h f stuff would work well. Grep wouldn't know about it, sure, that's true, but that's something that already afflicts other languages with namespace qualifiers and isn't a terrible thing. Any other great difficulties you can think ot? Jo=C3=A3o T=C3=A1vora PS: There's also this, but it's not based on file-local variables. https://github.com/ellerh/namespace.el