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.
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