Stop exporting the module name CTLie once @Lie is hygienic

Abierto
#966 0 comentarios 0 reacciones 1 asignado Ver en GitHub

Los mantenedores suelen responder en 1 día

@ocots ya está trabajando en esto.

Desde el 9/10/2026.

  • #981 de @ocots — abierto

Evaluación

Este issue todavía no se ha evaluado.

Descripción

Summary

Once the @Lie macro is hygienic (control-toolbox/CTLie.jl#40), OptimalControl no longer needs to export the module name CTLie. Stop exporting it, so that using OptimalControl does not bring an implementation package into the user's namespace.

Why it is exported today

src/imports/ctlie.jl has:

# Generated code — the `@Lie` macro emits `CTLie.*` and `CTBase.Traits.*`
# prefixes in its expansion, so both modules must be in scope at the call site.
@reexport import CTLie: CTLie # for generated code (prefix)

That is the only reason: the expansion of @Lie names CTLie and CTBase.Traits in the caller's module. The functions and the macro (ad, Lift, Poisson, ∂ₜ, @Lie, dg_ad_backend, dg_ad_backend!) are re-exported by name and stay.

To do, after CTLie#40 is released

  1. Bump the CTLie compat to the release that has the hygienic expansion.
  2. Remove the line @reexport import CTLie: CTLie and its comment in src/imports/ctlie.jl. Keep import CTLie: … where the module is used inside OptimalControl (using CTLie: CTLie in src/OptimalControl.jl, LiftedHamiltonianFunction, src/deprecated.jl).
  3. Update the re-export test, test/suite/reexport/test_ctlie.jl, which checks the exported names.
  4. Check that @Lie still works from a module that did only import OptimalControl or using OptimalControl: @Lie, and add that as a test.
  5. Update the documentation, page "The @Lie macro" (docs/src/geometry/lie-macro.md): drop the section "using OptimalControl is needed", and the hidden check that it fails without it.

Not in scope

  • CTBase stays exported: it is used for other things (exceptions, CTBase.Differentiation in the docs), and the @def macro of CTParser still names modules in its expansion. Whether @def can also become hygienic is a separate question, in CTParser.
  • This is a change of the exported names, so mention it in BREAKING.md and the changelog of the release that makes it.
Lenguaje dominante
Julia
Estrellas
135
Forks
11
Merge medio
7 h 51 min
PR fusionados (30 d)
22

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de control-toolbox/OptimalControl.jl

Todos los issues de control-toolbox/OptimalControl.jl

Issues similares

Más issues de Julia

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.