如何在 Haxe 中指定具有多个参数的函数类型?
我试图为接收两个或多个参数的函数指定函数类型。 对于具有一个参数的函数,这很简单:
var myFunction : Int -> Void;
您可以使用它引用这样的函数:
function doSomething ( param1 : Int ) : Void { ... }
...
myFunction = doSomething;
但是如何引用具有两个或更多参数的函数呢?不幸的是,仍然没有关于此的完整文档。
提前致谢!
I'm trying to specify a function type to a function receiving two or more parameters.
For a function with one parameter it's easy:
var myFunction : Int -> Void;
You can reference a function like this with it:
function doSomething ( param1 : Int ) : Void { ... }
...
myFunction = doSomething;
But how do you reference a function with two or more parameters? Unfortunately there is still no complete documentation about this.
Thanks in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我的 Haxe 有点生疏,但是...
一个接受两个
Int
参数并返回Void
的函数。My Haxe is a bit rusty, but...
A function that takes two
Int
args and returnsVoid
.