From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Arthur Miller Newsgroups: gmane.emacs.devel Subject: Re: Q: BLV for function slots + BL obarray/hmap for symbol lookup? Date: Sun, 23 May 2021 18:23:27 +0200 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="15499"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (windows-nt) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun May 23 18:24:09 2021 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 1lkqtb-0003nj-St for ged-emacs-devel@m.gmane-mx.org; Sun, 23 May 2021 18:24:08 +0200 Original-Received: from localhost ([::1]:58240 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lkqta-0005vt-Vk for ged-emacs-devel@m.gmane-mx.org; Sun, 23 May 2021 12:24:06 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42896) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lkqt2-0005DB-Vt for emacs-devel@gnu.org; Sun, 23 May 2021 12:23:33 -0400 Original-Received: from mail-db8eur06olkn2095.outbound.protection.outlook.com ([40.92.51.95]:22107 helo=EUR06-DB8-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lkqt0-0006UX-M3 for emacs-devel@gnu.org; Sun, 23 May 2021 12:23:32 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IzecqWVugDKFQXxRQZ93R+rD47woIGpUR+yv0bj5Xw9vzwCG07Rl31oaRxSxpuiKoWFTzNjQSeNSqBuWwbnFo5CyoZ4tSpZkfYHZE757xcrGC4ifRnxG+aDZgg4PeyNMaOfZ+NcPbP5ZYka9E3RH8e1Juef81QrxrG7OqZNlct/cKwOPQcQ6nbBoYqxXe7TIaxIUc5qkD2+pmnsT0JdebG+PRuN7CNLMYAalONLEnwP25wErTuh6hvH2oef2UMwKblavmtvI2jv4jDAO63f7BL/4eqwMridT7y2IyvmQ1X3UPJsW3/ku4XiSICdRh4u7uZgqKD/JSsTMPE16EKAyJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=HRg44mjdYIYs2ZeIf2hNBijvrT/TZoAGLn4ZPj52OiQ=; b=DPihVOp0+Fy9hJzIeMwFGadCSg+bdZAdba/tQbyB8xYZ8XOYyiYWvZJZ+nW+fZSzJ2NYfaPg8ECOFZi5oJdmHLZkVA8DtmGeXK2s7Wb2iltwX8AuFXl0HeF2w9DyO9tMBdKMgEyKzdLA3GlaSGJxIqDZ+BH/L6wS7wYC84JBFwKdEEw60t0BumLtw/i49W41dFcnn8KV0DgbVHF7nBU2Y6cRu+s7MwNZzz04junQRW2TsssIxyUW0YyDZeaQr3cGL1wOtIGM8hhIG0j2QId/e+MMG2+G7Tr7VVmxJJtVQei9M0roTYcIHQxb7XP3A3JG0+gnH10VYIweF4kcBLdiQA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=live.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=HRg44mjdYIYs2ZeIf2hNBijvrT/TZoAGLn4ZPj52OiQ=; b=YDyIts3PhwATH/msSll2v+Hq1+BCY36dtKdb8Pa3LaESFrh9QJWI/8dgY07eBByuExchygv5+AzesxJHxsgJuYAfi4gW9anY330OorvKBo0z+uO/F/p7WxEGrxYqtaBKNcYiLAN42Gt35Cyt8mYILI1u95cuHx3biqR3nl/EUcBxGytKsEE1QMA1EKtHy1dxSi/vub5Ml0+jLpOg3QPY2a3aDJ8rECzgI58XqeqFmypsSY+6/DzA6erUVm6MWvCu9Zwpq7kXjLBQapwpxRQC10vW/R6tyzanyVF8UwDR9+uDSLFcok6HEwvvcXqNBl9xnH2YLt3p65CmbQaggFo/2w== Original-Received: from VI1EUR06FT039.eop-eur06.prod.protection.outlook.com (2a01:111:e400:fc37::48) by VI1EUR06HT200.eop-eur06.prod.protection.outlook.com (2a01:111:e400:fc37::505) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4129.25; Sun, 23 May 2021 16:23:27 +0000 Original-Received: from AM9PR09MB4977.eurprd09.prod.outlook.com (2a01:111:e400:fc37::4b) by VI1EUR06FT039.mail.protection.outlook.com (2a01:111:e400:fc37::128) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4129.25 via Frontend Transport; Sun, 23 May 2021 16:23:27 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:F1068025B8C5A976F2184C3F354CB46F41A05E259C489C29B8ED36026C22F189; UpperCasedChecksum:CB1D0621AB2F4DF30A58548384EEEC94439C721122214F71BD3318770D7951C3; SizeAsReceived:7766; Count:46 Original-Received: from AM9PR09MB4977.eurprd09.prod.outlook.com ([fe80::d1c1:2a0d:3b2b:4591]) by AM9PR09MB4977.eurprd09.prod.outlook.com ([fe80::d1c1:2a0d:3b2b:4591%7]) with mapi id 15.20.4150.027; Sun, 23 May 2021 16:23:27 +0000 In-Reply-To: (Stefan Monnier's message of "Sun, 23 May 2021 11:27:02 -0400") X-TMN: [iJ6JvalAFT5InH5JxxVeOTyBjQXMOxq0] X-ClientProxiedBy: AM5PR0602CA0023.eurprd06.prod.outlook.com (2603:10a6:203:a3::33) To AM9PR09MB4977.eurprd09.prod.outlook.com (2603:10a6:20b:304::20) X-Microsoft-Original-Message-ID: <82h7itpgg0.fsf@live.com> X-MS-Exchange-MessageSentRepresentingType: 1 Original-Received: from HP-Laptop.homepc (81.232.177.30) by AM5PR0602CA0023.eurprd06.prod.outlook.com (2603:10a6:203:a3::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4150.23 via Frontend Transport; Sun, 23 May 2021 16:23:27 +0000 X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 46 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: 98dbeff2-15ac-4b3d-839f-08d91e07187e X-MS-TrafficTypeDiagnostic: VI1EUR06HT200: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Mq3pKu9vQrM1sNyucjHWkyFZwXOkBJk9/y4MiOJPA04WfeQA4+4UDOgLnz5X9PXCnwHB5kZySp/jKUOT3hQUp33iDOsrD0NXEVPOKyvfarvTkhva4Inz62HvoQrjXk7PlJWUnaqvIPKbvYq8wn9D3uf6u4qp2V1rjNd43U6YbVdRi9yVEm6Ec1gWwZ7mCLfp2btED96YM4gagOhY584g+JBFEZlixVPzStIDfC3TQegv66eIAEs0Bai5tyDqOlq75oeZRGUoJR/teLPRuUt2f76nwhde9h3/OC63jkAb3PL+/ZCSLK056yI/OMXegAA0eyFenFheRtJ2YL7iQos1qPMZM9juM0csc768iPjvVnhd34xzppkqjmeuCpAmr6xV+xGWIiVG9x3jwmkFbmXyDg== X-MS-Exchange-AntiSpam-MessageData: 8NKFoZRQYo2wfBa8XtXgqOsluAoPtvhp7xVirspcfQF7GP+/GPrXLS4YYBMTQ1bjfASOvZ9ucDq7vIsOVG6EluxzhmOOvMUodq0PtJAJEHoqvjXArtVhDPPAVXpWQwhyEyeYB5iW+yytXu/PDsG3DA== X-OriginatorOrg: live.com X-MS-Exchange-CrossTenant-Network-Message-Id: 98dbeff2-15ac-4b3d-839f-08d91e07187e X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 May 2021 16:23:27.7858 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-AuthSource: VI1EUR06FT039.eop-eur06.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: Internet X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1EUR06HT200 Received-SPF: pass client-ip=40.92.51.95; envelope-from=arthur.miller@live.com; helo=EUR06-DB8-obe.outbound.protection.outlook.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.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, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no 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:269679 Archived-At: Stefan Monnier writes: >>> E.g. which buffer should be used to resolve the "buffer-localness"? >>> The one when `intern` is called or the one when the already-interned >>> symbol is used? >> >> I am not sure I understand what you mean here. The rule would be same as >> for buffer local vars, but they would work on symbol level instead of >> variable slot level, at least conceptually. > > E.g. when we `load` a file, the `current-buffer` is the one which > happened to be current when the `load` function was called. > Usually that's when `intern` is executed. So if you just naively make > `intern` use `current-buffer` to decide what to do, you may get very > unpredictable behavior. I am still not sure I understand the problem 100%, but I understand it partially I think :). Thanks. > Have you looked at the different attempts to add some kind of > namespace support to Emacs? Some of them may be particularly well > suited to your DSL situation. When writing our history of ELisp paper, > we found: Fakespaces, Namespaces, with-namespace, Codex, Names, and > Nameless (the last two are in GNU ELPA). Once, some years ago it was very popular with namespaces, so I have heard about some, read some rants on Wiki pages, but I didn't use Elisp that much, so I never checked them out. Back then namespaces used to pop up as completion frameworks does nowadays. This is the first time I feel I would have real use for a namespace (I peronally don't mind typing prefixes). Names package look like something I'll investigate and see if it works or the approach you suggest below. >> If "local obarray" is declafed in a buffer, all interning would go to >> that one, like all set/qset set's the local vaalue if there is one. > > But how do you control which buffer is current when the `intern` takes place? > > Also, have you considered something like > > (setq-local obarray (obarray-copy obarray)) You mean to copy Emacs global obarray into local variable, the other way around so to say, and use that one all the way? I didn't :-). Feels a bit drastic to a big global environment, but it might work, I'll have to try it. Thanks for the suggestion(s).