emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Q: BLV for function slots + BL obarray/hmap for symbol lookup?


From: Stefan Monnier
Subject: Re: Q: BLV for function slots + BL obarray/hmap for symbol lookup?
Date: Sun, 23 May 2021 11:27:02 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]