Stop exporting the module name CTLie once @Lie is hygienic

Aperta
#966 0 commenti 0 reazioni 1 assegnatario Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@ocots ci sta già lavorando.

Dal 9/10/2026.

  • #981 di @ocots — aperta

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

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.
Lingua principale
Julia
Stelle
135
Fork
11
Merge medio
7h 51m
PR unite (30g)
22

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di control-toolbox/OptimalControl.jl

Tutte le issue di control-toolbox/OptimalControl.jl

Issue simili

Altre issue su Julia

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.