How to make a wrapper of same named function/command?
Posted: Wed Dec 16, 2020 9:26 pm
in effort to keep code more readable, I am trying to make my debug stuff in to separate place in code that can be added/removed with copy-paste.
Idea is following:
Idea being that I am trying to replace the actual function with a same named function that would do some debugstuff and then call the original function to actually do the function.
The above codes problem is that instead of calling the original version of that function, it will call the new version of function, making it getting into infinite recursive loop.
To make this problem even more difficult is that many functions that I want to use this system at, are also using self. As example: "MyFuncs:MyPrint(var)"
Is this doable somehow in Hollywood, and how?
Idea is following:
Code: Select all
function myfunc(var)
debugprint("var")
endfunction
function myfunc(var)
debugprint("myfunc("..var..")")
myfunc(var)
endfunctionThe above codes problem is that instead of calling the original version of that function, it will call the new version of function, making it getting into infinite recursive loop.
To make this problem even more difficult is that many functions that I want to use this system at, are also using self. As example: "MyFuncs:MyPrint(var)"
Is this doable somehow in Hollywood, and how?