mgl-pax
mgl-pax copied to clipboard
Add ability to reexport nested sections
I have some projects that define multiple packages (both with and without package-inferred-systems). In many of these cases, I want these packages to be an implementation detail the user shouldn't have to care about, so I reexport all the symbols from some toplevel package.
Complicating things, some packages export symbols that are meant for project-internal use only. So I can't use the :reexport
option of uiop:define-package
to do what I want.
I'd like to use mgl-pax for this since I have defsection
s in each package that document the symbols that should be exported from the top-level. But unless I'm missing something, it's not really possible to use mgl-pax to reexport all those public symbols.
I currently work around this with my own defsection
that basically expands to mgl-pax:defsection
but has another key :export-children
. If :export-children
is non-NIL, then all the symbols exported by any referenced section
are also exported. If you think such a feature would be useful to upstream, I'd be happy to put together a PR.
Sounds like a useful feature. As far as I can tell right now, the proposed addition of an :export-children
argument to defsection
is the way to go.