gpt4 book ai didi

haxe - 如何在haxe中检测来电者?

转载 作者:行者123 更新时间:2023-12-04 17:49:37 24 4
gpt4 key购买 nike

我正在设置一个属性,我需要知道谁在设置属性值?这在haxe 3中可能吗?

另外,我可以知道谁在函数内部调用函数吗?

最佳答案

退房 PosInfos .你像这样使用它:

public static function add(a:Int, b:Int, ?pos:PosInfos) {
trace( 'Called from ${pos.className}');
trace( 'Called from ${pos.methodName}');
trace( 'Called from ${pos.fileName}');
trace( 'Called from ${pos.lineNumber}');
return a+b;
}

add( 1, 1 ); // "pos" will automatically be filled in by compiler

关于haxe - 如何在haxe中检测来电者?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20444071/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com