tk3369 / BinaryTraits.jl

Can do or not? It's easy. See https://tk3369.github.io/BinaryTraits.jl/dev/
MIT License
53 stars 3 forks source link

Global state `prefix_map` needs to be revisited #37

Closed tk3369 closed 4 years ago

tk3369 commented 4 years ago

First, it's kinda weird that we're storing client data in BinaryTraits module. Second, I just found another problem due to this design:

The global state is being re-initialized and the data gets wiped away. The case come up with I have a module X that uses BinaryTraits. In module X, I defined a trait. When using X is finished, BinaryTraits.prefix_map is empty again, where it should have a map for the trait that I defined in module X.

I think it would be cleaner to put this map in the client module's namespace - perhaps define a function that takes the trait symbol and map that to the prefixes.

For this reasons, I'm retracting PR #36