redex icon indicating copy to clipboard operation
redex copied to clipboard

Document global g_redex

Open kamalmarhubi opened this issue 8 years ago • 2 comments

There's no documentation that to use libredex you need to instantiate a RedexContext and set the global g_redex to it. This should at least be documented, or refactored around.

At least now I can find out if I can do the thing I'm trying to do! :-)

kamalmarhubi avatar Feb 06 '17 21:02 kamalmarhubi

Any suggestions for refactoring? It is really, really convenient to have g_redex be a global, or else it would have to be passed around everywhere. It's also nice to have it be an easily resettable object; we used to just have a bunch of static maps, and that made it really hard to write tests that needed "clean" contexts.

bertmaher avatar Feb 09 '17 20:02 bertmaher

I haven't used the write side of the library yet, so I can't really comment on a refactoring. Documentation of the global, though—perhaps a readme in /libredex?

kamalmarhubi avatar Feb 13 '17 04:02 kamalmarhubi