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 01:31:16 +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="12306"; 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 01:32:21 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 1lkb6R-00031y-VB for ged-emacs-devel@m.gmane-mx.org; Sun, 23 May 2021 01:32:20 +0200 Original-Received: from localhost ([::1]:43864 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lkb6R-0003t1-1o for ged-emacs-devel@m.gmane-mx.org; Sat, 22 May 2021 19:32:19 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33404) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lkb5Y-0003Co-3e for emacs-devel@gnu.org; Sat, 22 May 2021 19:31:24 -0400 Original-Received: from mail-db8eur06olkn2019.outbound.protection.outlook.com ([40.92.51.19]:40748 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 1lkb5V-0006q2-Fw for emacs-devel@gnu.org; Sat, 22 May 2021 19:31:23 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=H9h9R9yW2ib4e0bY4Vdx183gxSoT9OG+UjqF3Jto8vn0pr2HfrMpVglX/AxkoaJOfJAk25TCN4F0gXKaTwvjQUhTEIy2my6i7+w/8ItuN+upiBYpOijz5jKb2aG/KhzGwJdR3lrNyn9RvW4DLmmYa2p2WuMvT975IfjZYq1sQIpCngED4NHYun3/nK8v8jZh2kxMa3Et9sWYy6SYE2K6EM7w5TLOIhnYpL7rYfVvlcLRQvngrM4jQ8iKr2S9OOez+4ZlxEigcltanZ9KuzqUPRWxcUx3t0wqykwgUyKXteN9Z7HzXCADF4gafCbpRclJUK6t6Vt7qbJ2pkVReAJy0g== 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=zeEsbaaeOC8MXbMWapjY1rL6wkgZi0plSkdr+sg+KMo=; b=YScfcgk+gSeBC0C4y1owBitFZhVKoZ1on9dQny8bbc9YRxaKPwishbeg8ctD0EEgfbP+aUtarGJmmKMTrAQarN1HSpMoZrDWp6OQdnM4fWOy7TJB24InSdLTwfPRfidk3C1YW2XBcuuTTWrOcIZ1CUIhwR7iS/4DNUmpMK6rA1v2SfImtNzKZYuxd6o28SlXcNqx/sWbG5LhF4COt6Z4ZiqsmoHFqsrwDJjpKZgLoP6rqJyKaao6n9NzwcLdTRTOH+5uKV3VGgGvZgavStUhiTElhchBN1SlTu/9T3RYSWy9aeolZkHa7Enjzlpn/a57Bkz/BwJ4NTjAUkhwMDN+kA== 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=zeEsbaaeOC8MXbMWapjY1rL6wkgZi0plSkdr+sg+KMo=; b=a3d1Yl7ZKEMoHUD+EJJh8l79q9v65tcaUMyCrg/Op/PO5VwZuBcd1Y5wDtaxaTP/z8GvHaI5eCjKoop3Nk52JNmnTTkR9tWkv5czr/RtJN1Dl3aL97JyOMWLCeTOYoLOEPNR7tIdcEdZrFVtJK9Oz7aBy3VP/HOcs5R0eshShxSeH2fF8zQ/M6o6xzMnnbrH70K+HJ/Qjivoxy/R/zoW3b3B/FZZ2bHFiPtu3M9/3TUeYPFS4MSEQooCoMsItemxgTkwS1oTdSPNccyHwTKoUcUQijEarKdWXiSg5AQM3V2TbEMaGVoZZ1L4knqOuQIZXXJVwliGQxjnbFdBNJIs5w== Original-Received: from DB8EUR06FT014.eop-eur06.prod.protection.outlook.com (2a01:111:e400:fc35::40) by DB8EUR06HT131.eop-eur06.prod.protection.outlook.com (2a01:111:e400:fc35::268) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4129.25; Sat, 22 May 2021 23:31:18 +0000 Original-Received: from DB9PR09MB4986.eurprd09.prod.outlook.com (2a01:111:e400:fc35::47) by DB8EUR06FT014.mail.protection.outlook.com (2a01:111:e400:fc35::116) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4129.25 via Frontend Transport; Sat, 22 May 2021 23:31:18 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:CDE88D478C9A66F67D152F92737492F15AF6512E08D30A2B3F510F98815AF78C; UpperCasedChecksum:64DA554BC10F22C0DE09F31913DFC516E9E9C2E8BD6BC17AEC37C251AA00FB0E; SizeAsReceived:7476; Count:46 Original-Received: from DB9PR09MB4986.eurprd09.prod.outlook.com ([fe80::8199:d67e:e470:b73e]) by DB9PR09MB4986.eurprd09.prod.outlook.com ([fe80::8199:d67e:e470:b73e%7]) with mapi id 15.20.4150.027; Sat, 22 May 2021 23:31:18 +0000 In-Reply-To: (Stefan Monnier's message of "Sat, 22 May 2021 18:30:07 -0400") X-TMN: [RKmdawJ0+2BxANOyC0hJNkEaJvJses/p] X-ClientProxiedBy: BEXP281CA0017.DEUP281.PROD.OUTLOOK.COM (2603:10a6:b10::27) To DB9PR09MB4986.eurprd09.prod.outlook.com (2603:10a6:10:2a9::19) X-Microsoft-Original-Message-ID: <82lf861h2z.fsf@live.com> X-MS-Exchange-MessageSentRepresentingType: 1 Original-Received: from HP-Laptop.homepc (81.232.177.30) by BEXP281CA0017.DEUP281.PROD.OUTLOOK.COM (2603:10a6:b10::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4173.11 via Frontend Transport; Sat, 22 May 2021 23:31:18 +0000 X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 46 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: 273d97d6-0905-4590-830a-08d91d79b31e X-MS-TrafficTypeDiagnostic: DB8EUR06HT131: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: WjMBTLGPPLJReHnW8YUtit4r7pwIgdyw6k3SihvaazJo0s90pHa6v473hXNf9jX2r29YfDYaqSy72I9tpPOjm8assszeryEMi1Xz68iJUTzUZHn5qGLQl/sJVh+5uFUmpWq/iy4StME6O+eO00IfVY9AuQ/s4CEcXooEpViTRNa4EIRYYX4ykKcgraL6qZxlOKtY3El8ea9hIEmzjBCNO/RF9FempeWq1lgWLX0dbF0Wi9AKfeGP2vKKweVVLakdaNhzAsSr9036MFBHAbHYg1idiGt7YpXuM3noMeLp0r2ebduDFebFOkt4Km7bHlkHPjbhYYpnKvPVhWteyOs+heSIwHrIZ5T7eZEraHBR1pVJHdpn+QDbXjIhwzSNuL/gFUbf68nQLoRQUhyFBQ+xxw== X-MS-Exchange-AntiSpam-MessageData: 72otFhqy4uvRWA9N934j2Fd8qvZpw23KYeijmCf+rT92McyGo8kMgmxZa2VoLthygEnMHhyyOcqwN40+dRKVyjLAPcFW7vFI6nse4y+fJRDbkbRuWTZkCgw5O5ee2Ycp2IJrIq1zq3NglprIQkAmzw== X-OriginatorOrg: live.com X-MS-Exchange-CrossTenant-Network-Message-Id: 273d97d6-0905-4590-830a-08d91d79b31e X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 May 2021 23:31:18.8491 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-AuthSource: DB8EUR06FT014.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: DB8EUR06HT131 Received-SPF: pass client-ip=40.92.51.19; 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:269635 Archived-At: Stefan Monnier writes: >> 1. Is there some special reason why BLV are implemented only for value >> slots and not for function slots? Would it be inneficient, too >> complicated, or just considered as not needed? > > 35 years of experience suggest it's not needed (thank god). > It's quite easy to instead do something like > > (defun foo (..) > (call foo-function ..)) > > and then use a buffer-local setting for `foo-function` to get the same result. Yeah, I know, it is exactly what I do know: defvar-local some-fn, and then save a function in variable. However there is a fundamental restriction: if there is already a foo defined, I can't use that name. Beside, the obvious namespace problem, there is a thing I would like to do, which I can't. If I would like to slightly modify a function, I can either re-install my own version and do some conditional check to do own thing or return original computation, or I could advice. Both of those options have global effect in entire Emacs. It might be costly in terms of performance, so in that case, I might use my own version just in some buffer, leaving rest unnaffected. >> 2. Would it be possible, not too inneficient, complicated etc, if obarray >> or hashmap, whichever is used for symbol lookup by Emacs, could be defined >> as BLV, so that Emacs would lookup symbols similar as it does for buffer >> local variables? > > 35 years of experience suggest it's not needed (thank god). It can also just mean that for 35 years people haven't being doing what some people would like to do now? :) Can you give me anything on technical side of quesion? > Also, I think this could lead to quite unexpected semantics. Ok, there you have something interesting. In which way? If you have time to expand on that one. It is already possible to use custo obarray, but we have to tell Emacs which obarray to use. I would like it to sort of happen automatically if there is a buffer local one. Sort of. No idea what would happen if there were more than one local :-). To explaing more: I would like to have a private namespace, in this case it would provide for a buffer-local namespae, if I can call it so. It would be just one level: buffer-local or global. I don't want to write too long, but I would like to have a way to skip prefixes in names and to be able to use ordinary elisp semantics of defun, defmacro etc, but that work only on some "local" level. Buffer local would be really nice. I could otherwise define my own DSL, but I don't want to do that.