unofficial mirror of emacs-devel@gnu.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: Sun, 23 May 2021 01:31:16 +0200	[thread overview]
Message-ID: <DB9PR09MB4986ECA0756441E4AEB03B5696289@DB9PR09MB4986.eurprd09.prod.outlook.com> (raw)
In-Reply-To: <jwvsg2e4d9d.fsf-monnier+emacs@gnu.org> (Stefan Monnier's message of "Sat, 22 May 2021 18:30:07 -0400")

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>> 1. Is there some special reason why BLV are implemented only for value
>> slots and not for function slots? Would it be inneficient, too
>> complicated, or just considered as not needed?
>
> 35 years of experience suggest it's not needed (thank god).
> It's quite easy to instead do something like
>
>     (defun foo (..)
>       (call foo-function ..))
>
> and then use a buffer-local setting for `foo-function` to get the same result.

Yeah, I know, it is exactly what I do know: defvar-local some-fn, and then save a
function in variable. However there is a fundamental restriction: if
there is already a foo defined, I can't use that name.

Beside, the obvious namespace problem, there is a thing I would like to
do, which I can't. If I would like to slightly modify a function, I can
either re-install my own version and do some conditional check to do own
thing or return original computation, or I could advice. Both of those
options have global effect in entire Emacs. It might be costly in terms
of performance, so in that case, I might use my own version just in some
buffer, leaving rest unnaffected.

>> 2. Would it be possible, not too inneficient, complicated etc, if obarray
>> or hashmap, whichever is used for symbol lookup by Emacs, could be defined
>> as BLV, so that Emacs would lookup symbols similar as it does for buffer
>> local variables?
>
> 35 years of experience suggest it's not needed (thank god).
It can also just mean that for 35 years people haven't being doing what
some people would like to do now? :) 

Can you give me anything on technical side of quesion? 

> Also, I think this could lead to quite unexpected semantics.

Ok, there you have something interesting. In which way? If you have time
to expand on that one. It is already possible to use custo obarray, but
we have to tell Emacs which obarray to use. I would like it to sort of
happen automatically if there is a buffer local one. Sort of. No idea
what would happen if there were more than one local :-). 

To explaing more:

I would like to have a private namespace, in this case it would provide
for a buffer-local namespae, if I can call it so.

It would be just one level: buffer-local or global. 

I don't want to write too long, but I would like to have a way to skip
prefixes in names and to be able to use ordinary elisp semantics of
defun, defmacro etc, but that work only on some "local" level. Buffer
local would be really nice. I could otherwise define my own DSL, but I
don't want to do that.



  reply	other threads:[~2021-05-22 23: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 [this message]
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
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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=DB9PR09MB4986ECA0756441E4AEB03B5696289@DB9PR09MB4986.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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).