解开(c)=> C()
我有一个问题:(c)=>我发现在这里 ://stackoverflow.com/questions/51227165/what-does-foreachc-c-mean-in-dart“> where 。 我知道它可以定义一个具有未型参数的匿名函数c。但是它似乎是指
- 无参数的未定义函数c(),即具有与初始匿名函数的参数相同的名称,
- 或者是其自己的参数C,就好像此非常参数是无参数的未定义函数本身。
我很确定我没有正确地做到这一点,而且我错过了重点,但是任何提示都会有助于解开(c)和c(),并掌握功能最终的真实作用。
I have an issue with : (c) => c() which I found here and there.
I understand that it defines an anonymous function with an untyped parameter, c. But then it seems to refer
- to a parameter-free undefined function c(), i.e. having the same name as the parameter of the initial-anonymous function,
- or to its own parameter c as if this very parameter were a parameter-free undefined function it-self.
I'm pretty sure that I did not get it right and that I miss the point, but any hint would help to untangle (c) and c(), and grasp what the function ends up doing for real.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是一个匿名功能,可以获取名为
c
的东西。然后调用它的收到的函数好像是一个函数。这意味着编译器发现它是是没有参数的函数,或者是dynamic
。否则,编译器会抱怨。因此,英语:一个名为
c
的参数的匿名函数。该参数的类型是“无参数的函数”。然后调用它刚刚获得的函数。It is an anonymous function that gets something named
c
. It then calls what it gets as if it were a function. That implies that the compiler figured out that it either is a function with no parameters, or it is adynamic
. Otherwise the compiler would have complained.So in english: an anonymous function that has a parameter named
c
. The type of that parameter is "function with no parameters". It then calls the function it just got as argument.