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: Sun, 23 May 2021 11:27:02 -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="33414"; 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 23 17:27:56 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 1lkq1E-0008V9-5d for ged-emacs-devel@m.gmane-mx.org; Sun, 23 May 2021 17:27:56 +0200 Original-Received: from localhost ([::1]:57614 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lkq1D-00076q-7H for ged-emacs-devel@m.gmane-mx.org; Sun, 23 May 2021 11:27:55 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34854) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lkq0a-0005lx-DX for emacs-devel@gnu.org; Sun, 23 May 2021 11:27:16 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:51038) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lkq0Y-0002rL-9i for emacs-devel@gnu.org; Sun, 23 May 2021 11:27:15 -0400 Original-Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 2B44110028B; Sun, 23 May 2021 11:27:12 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id C5DC410020E; Sun, 23 May 2021 11:27:10 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1621783630; bh=jIGvgKljpIGrHxV4rC5+bu/aOZK4yQZakZW+whyUKDA=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=KN/0pJineNjI87BzZNHttzttxDH/WJFsjeWVP/iKZS5CKCivl6FGUCiYHgNPIMk3Z AkPfIcURbSdVAoxp7zylEWffn0Cs16UG2T4qkxu1Ajs/PO/aOgx1cpBhbCl/jrQjR0 qkXQfoTRyVGz8rDoltLyu4+m7v0nk5cnGNcU1+Gmcl1Yg/eOASwJcaehR94pnpIxgA ZL4U+6yTxsQSQCJxDN5KqX6GVPubk6bjCEXBr3aKQKOtyzzj8kxU/vj9eaen0ZxbXN cJ9VP8Z9R/w34EojdW4cNRvZeryJyKlykgdb2kXaM+K4tCrmUvOjv8fcAoj+vwERbp seFvTZoT2Ds8g== Original-Received: from alfajor (69-196-163-239.dsl.teksavvy.com [69.196.163.239]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 9CF8B120516; Sun, 23 May 2021 11:27:10 -0400 (EDT) In-Reply-To: (Arthur Miller's message of "Sun, 23 May 2021 11:00:44 +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:269675 Archived-At: >> 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. 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). > 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)) -- Stefan