I’d like add something to a Base method. In particular, I’d like to override Base.print for a particular type but still need to call the original function in most cases. The problem is that the original function is lost once I override it.
Any thoughts on how to do this?
To be more specific, I’d like to make Base.print show Inf and -Inf when the argument is typemax or typemin.
Now import this print into every module where you want to change the behavior the function.
(You can use eval to inject code into a module without having to modify that modules’ source code.)
When you want to use the original function, you simply call Base.print.
Edit: I haven’t actually tried this. Now that I think about it, there will probably be world age issues.