I played with Neko modules, but I think I'm getting some inconsistent behavior.
var funcs = 0; var objs = 0; for (i in 0...m.globalsCount()) { var obj:Dynamic = m.getGlobal(i); if (Reflect.compareMethods(obj, init)) trace("matched"); if (Reflect.isFunction(obj)) funcs++; else if (Reflect.isObject(obj)) objs++; } trace('Functions: $funcs'); trace('Objects: $objs');
In the above code, when I run it for the first time, I get a total of 4487 functions. If I remove the function, rebuild and run, I get the expected 4486.
I added compareMethods comparison to compare obj with init , where init is a function declared in the main file, but the trace is never output.
I took a look at the code hint for the compareMethods function, and I came across the following terminology: if 'f1' and the 'f2' are **physically** equal .
Now these are both functions, and not where the Haxe manual mentions anything about physical functions. So I have a two-part question.
What is a physical function and how to achieve a trace result, as you expected above? Thanks in advance.
haxe neko
tienery
source share