Right now i am moving code around and rewriting a library. Unfortunately design was wrong and or unfinished so i have a bunch of functions calling a static method in my lib. I dont want to do namespace.class.subclass.method everytime. I tried using method = namespace.class.subclass.method everytime but that doesnt work for static methods and only classes/namespaces.
So i’d like to hack a alias for this file or the namespace. Just until i clean everything up. Is it possible? perhaps by passing in a compile flag or setting a few options?
If you are planning to migrate these from static to instance methods, why not simply write the desired end result as an adapter to the existing static methods, then slowly migrate to using the adapter and, finally, incorporate the actual code into the adapter class.
used as
As you create new code use the adapter and as you touch old code, convert to use the adpater. Once the adapter holds all the references to the existing code, you’re good to start changing the adapter to incorporate the code directly and retire the old static class.