emacs-devel
[Top][All Lists]
Advanced

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

Re: Proper namespaces in Elisp


From: Stefan Monnier
Subject: Re: Proper namespaces in Elisp
Date: Mon, 04 May 2020 15:20:05 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

> I can't even imagine what a solution that _doesn't_ operate on the reader
> looks like. Are you talking about form walking macros that walk the
> forms and switch the short version of names into the long versions
> and intern everything into the same obarray?  Hmmm.

Something like it, yes.

E.g. in `macroexpand` we'd change the symbol case so that when a symbol
has the shape `s:bar` we treat it a bit as if we were looking
at `(: s bar)` so we pass it to the `:` macro which might replace it
with `(gethash s-obarray 'bar)` or with `string-bar` or ...

It comes with its own hurdles, obviously: e.g. making it work not just
on variables but on function names, face names, etc...

You can look at Scheme and Clojure for yet more ways to skin this cat.

AFAICT, adding namespaces to Elisp will only happen if someone comes up
with a working implementation and Emacs's head maintainer is strongly
supportive.  I don't think Eli is more strongly supportive of the idea
than I was, and yet it didn't happen during my tenure, so I won't hold
my breath.


        Stefan




reply via email to

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