Daniel Colascione <address@hidden> writes:
Common Lisp does deal with this problem in some cases, e.g., in LOOP.
We should be moving forwards keywords anyway.
LOOP would not even have to deal with that if namespaces were over
bindings, like Andrea suggested, and what Scheme module systems do.
FWIW, I think elisp should just literally copy Common Lisp's
approach.
Please see this other sub-thread where I explain why this is a really
bad idea:
https://lists.gnu.org/archive/html/emacs-devel/2020-05/msg00623.html
It's tried and tested, and the pitfalls are well-understood.
Well-understood enough where people want to throw away most of how it
does namespace imports, and have a backward-compatible replacement
ready this year:
https://gist.github.com/phoe/2b63f33a2a4727a437403eceb7a6b4a3
There is no need to repeat the same mistakes. Andrea's proposal for
namespacing over bindings/Scheme's approach avoids mangling the
reader, does not cause problems for the printer, and does not make
code resort to symbol-name hacks like LOOP does. Scheme's approach to
namespacing has a lot of advantages over Common Lisp's.
We can also avoid the "namespace multiple inheritance" problems of
unintended re-definition and import conflicts if we combine João's
approach of declaring prefixes with the ideas of package-local
nicknames and namespaces over bindings.
Here is how that might look:
--8<---------------cut here---------------start------------->8---
(declare-namespace jennys-awesome-string-library
(use elisp29)
(export foo))
(declare-namespace jonnys-amazing-syntax-library
(use elisp29)
(export foo))
(declare-namespace some-new-library
(use elisp30)
(import jennys-awesome-string-library st-)
(import jonnys-amazing-syntax-library sy-))