Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Global constants that get modified during precompilation don't work #181

Open
kris-brown opened this issue Dec 10, 2024 · 0 comments
Open
Labels
bug Something isn't working

Comments

@kris-brown
Copy link
Collaborator

kris-brown commented Dec 10, 2024

The @theory macro includes a line to register each theory module, indexed by the data of the theory.

const GAT_MODULE_LOOKUP = Dict{ScopeTag, Module}()

This is convenient when one is working with GATs rather than the associated theory modules but then need to do something with the theory module, e.g. using a theory morphism to do a model migration.

However, when testing this with Catlab, this no longer seems to work. Catlab adds a new theory, T, and during precompilation one can check that T is in GAT_MODULE_LOOKUP. But if one loads up GATlab and Catlab in the REPL, T is no longer in the cache (only the theories added in GATlab are there).

This might be relevant https://discourse.julialang.org/t/mutating-global-variable-during-precompilation/51478/3 \

In the immediate future, one workaround could be to only use @theorymap modules (which have the dom and codom modules) for migration.

@kris-brown kris-brown added the bug Something isn't working label Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant