From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Q: BLV for function slots + BL obarray/hmap for symbol lookup? Date: Sat, 29 May 2021 22:44:59 -0400 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="1558"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Arthur Miller Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun May 30 04:46: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 1lnBSy-0000Dz-H8 for ged-emacs-devel@m.gmane-mx.org; Sun, 30 May 2021 04:46:16 +0200 Original-Received: from localhost ([::1]:41562 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lnBSx-0000LH-J4 for ged-emacs-devel@m.gmane-mx.org; Sat, 29 May 2021 22:46:15 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34552) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lnBRt-0007pN-Rd for emacs-devel@gnu.org; Sat, 29 May 2021 22:45:09 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:22832) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lnBRr-0008FP-1w for emacs-devel@gnu.org; Sat, 29 May 2021 22:45:09 -0400 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id F2FB1441030; Sat, 29 May 2021 22:45:05 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 61B50441022; Sat, 29 May 2021 22:45:00 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1622342700; bh=wy3mQIPumQsl9jsoOJivm6jyPAW1MGdKwyJ4TZGw6Vc=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=Jj2E4/24rHhmEY6TpIjLqVpvVKBS5iBKR7XIpnEP5056sFmCCbjIDae13jlBgYZMB nrznpuLQ2FFsgVnz2aemQgOtJnXTPOIQWHJ/eqvdHsBLZWHizVK6OrWWy7mbyvoMLf SZU3OaTuBtnH08PT7XaSuCbN3LZ6+GMl3Z9V+ehh4u91wvTuGtQhlvMKTZMXLq9hDv Dqb/ztDgpa/uk46sIaoCmnfNIzH5W3hqiZ9u1tpyV5Lds42w4/4mmgVgJsyP/WMgZ1 yZ+eZqYWegm3JV+VtKsaKFAigp9hpoEIvTCs/I/CNNq5ULH4bVF7GLCXCv8sc1Bz6S Gf4V5E3fprsfg== Original-Received: from alfajor (69-196-163-239.dsl.teksavvy.com [69.196.163.239]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 09E2012023D; Sat, 29 May 2021 22:44:59 -0400 (EDT) In-Reply-To: (Arthur Miller's message of "Sun, 30 May 2021 04:30:24 +0200") Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=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:270104 Archived-At: 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. > 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. > 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. Stefan