What is meant by being "physically equal" in Haxe?

Viewed 189

I've been playing around with Neko Modules, but I think I'm getting some inconsistent behaviour.

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 the first time, I get a total of 4487 functions. If I remove a function, rebuild and run, I get the expected 4486.

I added the compareMethods comparison to compare the obj with init, where init is a function I declared in the Main file, but the trace is never output.

I glanced over at the code hint for the compareMethods function, and I stumbled across the following terminology: if 'f1' and the 'f2' are **physically** equal.

Now, they are both functions, and no where in the Haxe manual does it mention anything about physical functions. So I have a two part question, really.

What is a physical function, and how do I achieve the trace result as you would expect above? Thank you, in advance.

1 Answers
Related