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, 30 May 2021 14:17:08 +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="17250"; 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 30 14:18:17 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 1lnKOV-0004H7-8T for ged-emacs-devel@m.gmane-mx.org; Sun, 30 May 2021 14:18:16 +0200 Original-Received: from localhost ([::1]:40008 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lnKOT-0005GO-Sn for ged-emacs-devel@m.gmane-mx.org; Sun, 30 May 2021 08:18:13 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43012) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lnKNW-0004b9-Ty for emacs-devel@gnu.org; Sun, 30 May 2021 08:17:14 -0400 Original-Received: from mail-oln040092075098.outbound.protection.outlook.com ([40.92.75.98]:64420 helo=EUR04-VI1-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 1lnKNS-0003R8-MR for emacs-devel@gnu.org; Sun, 30 May 2021 08:17:14 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VsPkxTJTa0A4G4DoDcRpU2masMGXZfqQYIILfhHIJSnfpZCusSJ1s9+T4jX7hAaApl4y8RrDpDigb+6UH/fBwbtGmCa9tEZ+o7bqbbMIc8XmsBYCxt17q+olHekXJwi1Ms6a9lFzdIaLFu0GyGG4gc4ZLk+f71e+BIyKTLd8X2FNXeJBISi9u3NART4/i7U+JB3T/XrXSpWbvo/7EZwiM35PPeDfTSz7T/mRvpbDRfSXLPeLUf0p8/3HDWd28ZnBxi+gcQiP2NeL+WnIgaumklB2sCV1l804CBZHNsCVx9P53rTCd1w+iIyj5xnUa1xyTJwIPR/zAtBpgt3l2kL+aw== 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=n+kx9Yt9pW7Uxz21O0iH9RdbglovoJhPNvfGfvY5waU=; b=k7TRTyTMmJAjmv+yPnaq4RC5oqyQc7vC1GcWxhWapwD1uprqtRHXamP7VD+HNuSG6+UtCE0Pa4k6FwqUhCINBLImmuRwrNS7eVNL+sa7ZdSHEpXMVl007wLRWpymf6e7kCzdGPEeGTSPMYu+n2ZWtLZsuFLjmBhK4AoxOSj8xtzOwQWrJZTglufgR7ZDTWTaCM/XnDioK8e+4h1BqsQfz9jMtmq/KmQdPJBsx5uiXlMwp8zSaf5oQTe71YwFU6K39pECPlFN/CRqshDDTTQ6Ydg024TAyarJfMWajAED50P+2XHeMQkyZNq6rrnMk1fsqUF9J3zf6fXolAO5ElWZMQ== 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=n+kx9Yt9pW7Uxz21O0iH9RdbglovoJhPNvfGfvY5waU=; b=cPkzH5adjrr9zf5KtoHUmI7XhiOeFVZ+U+Ja2Js8V0gwDIb3CD5672W6enIZwqBnMMJH1HzgwtUrPCj2cTuaVDqvFgfX2iFdIMrePExZQ/DlK9VzlCvSMVhyFDSOqmpfKUwWHsPO2ae4TvJZYvq8i1PwSEcTerFoamw0eP9paQKAQeTfBpqFJlsKQZb9sAcDfYWpMt3GYbrIGGv5hF0tbVC9prgy8AOkWlnqrPYr0aTLUMhbs5GY3VxHU/MTbEVe9YcgL+N/WjfU4qvEc0oanoTFbhFoDaE/8EwVMH23VM4gRwYpJawWCakgr/VpXK91WnAchd6GcVNbFN81Q6I5+g== Original-Received: from VI1EUR04FT041.eop-eur04.prod.protection.outlook.com (2a01:111:e400:7e0e::4e) by VI1EUR04HT188.eop-eur04.prod.protection.outlook.com (2a01:111:e400:7e0e::223) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4150.28; Sun, 30 May 2021 12:17:07 +0000 Original-Received: from AM9PR09MB4977.eurprd09.prod.outlook.com (2a01:111:e400:7e0e::47) by VI1EUR04FT041.mail.protection.outlook.com (2a01:111:e400:7e0e::346) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4150.28 via Frontend Transport; Sun, 30 May 2021 12:17:07 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:C5E8492A1869136A70A07771F2A430716636DB610B1EE929EC131CECF2A4FB58; UpperCasedChecksum:D0BE0C615119D2DCBDE5BAAB09EAB4AF4DD6C382B61CF24A3FAE23CCAC235C15; SizeAsReceived:8077; 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.4173.030; Sun, 30 May 2021 12:17:07 +0000 In-Reply-To: (Stefan Monnier's message of "Sat, 29 May 2021 22:44:59 -0400") X-TMN: [dw+HjVn0SZmY6bQY8y0uN1bOKMLzrLJk] X-ClientProxiedBy: AM5PR0601CA0083.eurprd06.prod.outlook.com (2603:10a6:206::48) To AM9PR09MB4977.eurprd09.prod.outlook.com (2603:10a6:20b:304::20) X-Microsoft-Original-Message-ID: <82mtscl8l7.fsf@live.com> X-MS-Exchange-MessageSentRepresentingType: 1 Original-Received: from HP-Laptop.homepc (81.232.177.30) by AM5PR0601CA0083.eurprd06.prod.outlook.com (2603:10a6:206::48) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4173.20 via Frontend Transport; Sun, 30 May 2021 12:17:07 +0000 X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 46 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: 2ca296df-de6c-4cb6-8fdf-08d92364d7b1 X-MS-TrafficTypeDiagnostic: VI1EUR04HT188: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: eFmNeHA7hsD8eh3tcy1HpMm9bvbG0I16WT13G4lrkTaK7ERzbtLuXRyWqVO3Kq7w5OXwmgE5bJiV7ve7z0Q8NtzcOU0pY5z5Lx2lsyQboMrFxcCeLGhBP1A9X2Z6IEBfrS5958wQ7jgpfFbOkNfRfAX610SeJMjDE777u3ZKG3LXHDKF+WJgn5KF0C3q4OIpdW1LZsqgb9NEAhkDpBZ+I10+WxGZIKl6IKZ+40VREWhYQ5sHaIiv/5KazQ5t5JzILaTs9QbfpQEGqaVzcIThiqt91ABb8FFrYMtkzB1vLWhopExwkYuNxJ5Q5JF4PdlbWLpSMY3RxMQCsQ6V8wKN7UHowyy9+3hC+e/gN0fRWK0MBav0njivk/OTjK4tTNs55hLpwEqqR9aYxPy+37E8RA== X-MS-Exchange-AntiSpam-MessageData: EjCNDkKsixyWnLZHc+unEYU0eNlwKRmaFZ3XZ0mXz4p58TZTQ9GmYv1whDqPd/SWwX+sJkhLxkkpIfVh01JlJDKf+qoXvr2KWosafxgENIjArqypUqbKF67lgey4c2sLfoQLgiaiBYGDt+LdCPgMTg== X-OriginatorOrg: live.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2ca296df-de6c-4cb6-8fdf-08d92364d7b1 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 May 2021 12:17:07.5431 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-AuthSource: VI1EUR04FT041.eop-eur04.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: VI1EUR04HT188 Received-SPF: pass client-ip=40.92.75.98; envelope-from=arthur.miller@live.com; helo=EUR04-VI1-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:270125 Archived-At: Stefan Monnier writes: > Arthur Miller [2021-05-30 04:30:24] wrote: >> Stefan Monnier writes: >>>>>> (setq-local obarray (obarray-copy obarray)) >>> [...] >>>> (setq-local obarray (copy-sequence obarray)) >>> >>> obarray-copy != copy-sequence >> My Emacs 27.1 says void function obarray-copy, > > Indeed, it's not provided. > >> but copy-sequence worked. > > Not really, no. You just haven't noticed the breakage yet. Shallow copy, as Michael pointed it out? I'll see to update my Emacs. >> Aren't obarray just vectors? > > No, they're very special vectors. E.g.: > > (let ((oa (make-vector 1 nil))) > (intern "foo" oa) > (intern "bar" oa) > (intern "baz" oa) > oa) > > ==> > > [baz] > > Yet, `foo` and `bar` are definitely still in there. Yes, manual says use size 0 when making an obarray, so I understand the space is allocated elsewhere, when interning is happening. >> For your previous mail; yes I am quite aware this is very use-case >> specific solution. Anything done elsewhere, outside that particular >> buffer after the copy is performed will not be visible in that buffer, >> as well as no definition will escape to rest of the Emacs, so this >> buffer can only be used to change state of this particular buffer and >> nothing else, and that can be quite brittle. For the bad and good. I >> haven't experimented enough yet, just a bit, I am not sure how it will >> work with Emacs state internally, gc? etc. > > AFAIK I think it can be made to work, yes. > I don't expect any problem from "Emacs state internally" or the GC. > > The only source of trouble I can foresee is if "normal code" ends up > running while your obarray is the one held in the global `obarray` var. > This is because "normal code" will occasionally load files (via > `require` or autoloads, typically) and that can quickly lead to > confusion. > Allright, thanks for the clarifications.