all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Arthur Miller <arthur.miller@live.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: emacs-devel@gnu.org
Subject: Re: Q: BLV for function slots + BL obarray/hmap for symbol lookup?
Date: Sat, 29 May 2021 09:31:43 +0200	[thread overview]
Message-ID: <AM9PR09MB4977326AF47B64A449D6515E96219@AM9PR09MB4977.eurprd09.prod.outlook.com> (raw)
In-Reply-To: <AM9PR09MB49774E8E584DB5D68E0DDF3596279@AM9PR09MB4977.eurprd09.prod.outlook.com> (Arthur Miller's message of "Sun, 23 May 2021 18:23:27 +0200")

Arthur Miller <arthur.miller@live.com> writes:

>>> 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).

Just as curiosa to confirm, yes that worked, rather well :-). That was actually
what I asked for if you think, I just didn't thought of copying over the
obarray.

(setq-local obarray (copy-sequence obarray))
(defvar mysymbol "A SYMBOL")
(defun myfunc () "HELLO")

nysymbol and myfunc were avialable only in that buffer.

Don't know how efficient it is to copy entire obarray, in possibly
serveral buffers, but for the intended purpose, as a buffer-local
namespace works well. Thanks. 



  reply	other threads:[~2021-05-29  7:31 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-22 21:46 Q: BLV for function slots + BL obarray/hmap for symbol lookup? Arthur Miller
2021-05-22 22:30 ` Stefan Monnier
2021-05-22 23:31   ` Arthur Miller
2021-05-23  3:25     ` Stefan Monnier
2021-05-23  9:00       ` Arthur Miller
2021-05-23 15:27         ` Stefan Monnier
2021-05-23 16:23           ` Arthur Miller
2021-05-29  7:31             ` Arthur Miller [this message]
2021-05-29 12:44               ` Michael Heerdegen
2021-05-30  2:57                 ` Arthur Miller
2021-05-30 12:44                   ` Philipp
2021-05-29 13:47               ` Stefan Monnier
2021-05-30  2:30                 ` Arthur Miller
2021-05-30  2:44                   ` Stefan Monnier
2021-05-30 12:17                     ` Arthur Miller
2021-05-29 13:56               ` Stefan Monnier
2021-05-23 18:22 ` Clément Pit-Claudel
2021-05-23 20:23   ` Arthur Miller
2021-05-23 21:41     ` Clément Pit-Claudel
2021-05-24 12:37       ` Arthur Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AM9PR09MB4977326AF47B64A449D6515E96219@AM9PR09MB4977.eurprd09.prod.outlook.com \
    --to=arthur.miller@live.com \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.