emacs-devel
[Top][All Lists]
Advanced

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

Re: Proper namespaces in Elisp


From: Daniel Colascione
Subject: Re: Proper namespaces in Elisp
Date: Fri, 08 May 2020 17:32:15 -0700
User-agent: AquaMail/1.24.0-1585 (build: 102400006)



On May 8, 2020 5:13:00 PM Vladimir Sedach <address@hidden> wrote:

Daniel Colascione <address@hidden> writes:
I wouldn't call package-local nicknames "throw[ing] away" the
namespace system. The post describes a logical extension. Is your
argument that the CL namespace system (suitably extended) *allows*
people to do silly things (like :use) even though it doesn't require
that they do?

Yes, it is silly, and people do it. They will do it in Elisp if you
let them. I think unintended re-definition of short names due to
"namespace multiple inheritance" is going to be a problem for Elisp,
because ordinary Emacs users load code from MELPA. It is a lot
different than encountering the problem in C++ or something when you
are a distribution maintainer compiling binaries. Neither the R6RS
approach of throwing an error, nor clobbering the definition and
showing a warning (what some Common Lisp implementations do) that
will not be paid attention to is appropriate for what should be a
backwards-compatible package update.


So there are three basic operations we can support: in Python syntax, 1) from PKG import * (exposing PKG.foo as foo), 2) import PKG as p (exposing PKG.foo as p.foo) and 3), from PKG import foo (exposing PKG.foo as foo). CL supports all three. I'm most interested in supporting #2, since that's closest to existing use. The lexspace prototype posted earlier today supports #3 and #1 (the latter via lexspace inheritance) only, but I think we should do #2 instead, and I think we can do it without runtime overhead.





reply via email to

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